:root {
    /* Color Palette - Dark Premium */
    --bg-main: #0a0b10;
    --bg-sidebar: #13141f;
    --bg-card: #1c1d29;
    --bg-hover: #262837;
    --text-main: #ffffff;
    --text-muted: #8d93aa;
    --border-color: rgba(255, 255, 255, 0.08);
    --primary: #6c5ce7;
    --primary-hover: #5b4cc4;
    --primary-light: rgba(108, 92, 231, 0.15);
    --success: #00b894;
    --success-light: rgba(0, 184, 148, 0.15);
    --warning: #fdcb6e;
    --danger: #d63031;
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);

    /* Layout */
    --font-family: 'Inter', sans-serif;
    --sidebar-width: 260px;
    --header-height: 80px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: 0.3s ease;
}

/* Light Theme Variables */
[data-theme="light"] {
    --bg-main: #f5f6fa;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #f1f2f6;
    --text-main: #2d3436;
    --text-muted: #636e72;
    --border-color: rgba(0, 0, 0, 0.08);
    --card-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --primary: #0984e3;
    --primary-hover: #74b9ff;
    --primary-light: rgba(9, 132, 227, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-main);
    transition: background-color var(--transition), color var(--transition);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Container Layout */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    position: relative;
    z-index: 10;
}

.auth-card {
    text-align: center;
    max-width: 400px;
    width: 100%;
    padding: 3rem 2rem;
}

.auth-brand {
    justify-content: center;
    padding: 0;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2.5rem;
}

.auth-btn {
    font-size: 1rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.auth-btn i {
    font-size: 1.2rem;
}

.auth-note {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.bg-animated {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(108, 92, 231, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(0, 184, 148, 0.05) 0%, transparent 30%);
    z-index: -1;
    animation: rotateBg 30s linear infinite;
    pointer-events: none;
}

[data-theme="light"] .bg-animated {
    background: radial-gradient(circle at center, rgba(9, 132, 227, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(0, 184, 148, 0.05) 0%, transparent 30%);
}

@keyframes rotateBg {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.app-container {
    display: flex;
    min-height: 100vh;
    backdrop-filter: blur(40px);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
    position: fixed;
    height: 100vh;
    transition: background-color var(--transition);
    z-index: 100;
    backdrop-filter: blur(20px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem 2rem;
}

.logo-icon {
    background: linear-gradient(135deg, var(--primary), #a29bfe);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}

.brand h2 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 1rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    font-weight: 500;
}

.nav-item:hover {
    background-color: var(--bg-hover);
    color: var(--text-main);
    transform: translateX(4px);
}

.nav-item.active {
    background-color: var(--primary-light);
    color: var(--primary);
}

.sidebar-footer {
    padding: 1.5rem;
    justify-self: flex-end;
}

.license-info {
    background: linear-gradient(145deg, var(--bg-card), var(--bg-hover));
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.license-info i {
    color: var(--warning);
    font-size: 1.5rem;
}

.license-text .plan {
    font-size: 0.85rem;
    font-weight: 600;
}

.license-text .price {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
}

h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.top-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

#current-date {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.theme-toggle:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: rotate(15deg);
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

/* Dashboard Grid */
.dashboard-grid {
    padding: 2rem 0;
    display: grid;
    grid-template-columns: 1fr 2fr;
    grid-template-rows: auto auto;
    gap: 1.5rem;
}

/* Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    transition: background-color var(--transition), border-color var(--transition), transform 0.3s;
}

.card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    border-color: var(--primary-light);
}

.kpi-cards {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.kpi-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-5px);
}

.kpi-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.kpi-icon.revenue {
    background: var(--success-light);
    color: var(--success);
}

.kpi-icon.sales {
    background: var(--primary-light);
    color: var(--primary);
}

.kpi-icon.avg {
    background: rgba(253, 203, 110, 0.15);
    color: var(--warning);
}

.kpi-details h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.kpi-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-top: 0.2rem;
    margin-bottom: 0.1rem;
}

.kpi-trend {
    font-size: 0.78rem;
    font-weight: 600;
    min-height: 1.1rem;
    display: block;
    transition: opacity 0.3s;
}

/* Edit btn warm hover */
.btn-icon.btn-edit-sale:hover,
.btn-icon.btn-edit-history:hover {
    color: var(--warning) !important;
    opacity: 1 !important;
    transform: scale(1.15);
}

/* Charts & Goal Row */
.charts-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.goal-card .goal-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.progress-bar-container {
    width: 100%;
    height: 12px;
    background: var(--bg-hover);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.8rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    width: 0%;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.goal-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.chart-card {
    display: flex;
    flex-direction: column;
}

.chart-container {
    height: 200px;
    width: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Form Section */
.form-section {
    grid-column: 1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.header-actions {
    display: flex;
    gap: 0.8rem;
}

.badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

input,
select {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-block {
    width: 100%;
    padding: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #a29bfe);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    flex: 1;
    padding: 0.5rem;
    font-size: 0.8rem;
}

.btn-outline:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

/* List Section */
.list-section {
    grid-column: 2;
    display: flex;
    flex-direction: column;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.2s;
}

.btn-icon:hover {
    color: var(--danger);
}

.search-container {
    position: relative;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.search-container i {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
}

.search-container input {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    color: var(--text-main);
}

.search-container input:focus {
    border-color: var(--primary);
    background: var(--bg-hover);
}

.table-container {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
    border-radius: var(--radius-sm);
}

.table-container::-webkit-scrollbar {
    width: 6px;
}

.table-container::-webkit-scrollbar-track {
    background: var(--bg-card);
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 10px;
}

.sales-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.sales-table th {
    padding: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-hover);
    position: sticky;
    top: 0;
    z-index: 10;
}

.sales-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.sales-table tbody tr {
    transition: background-color 0.2s;
    animation: fadeIn 0.4s ease-out forwards;
}

.sales-table tbody tr:hover {
    background-color: var(--bg-hover);
}

.sales-table td:last-child {
    font-weight: 700;
    color: var(--success);
}

/* Empty State */
.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    height: 100%;
}

.empty-state.active {
    display: flex;
}

.empty-icon {
    font-size: 3rem;
    color: var(--border-color);
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.empty-state span {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-card);
    border-left: 4px solid var(--success);
    border-radius: var(--radius-sm);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(150%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-icon {
    color: var(--success);
    font-size: 1.5rem;
}

.toast-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.toast-message {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    width: 90%;
    max-width: 400px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    padding: 1.5rem;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-size: 1.25rem;
}

.modal-lg {
    max-width: 500px;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-item {
    background: var(--bg-hover);
    padding: 1rem;
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid var(--border-color);
}

.summary-item span {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.summary-item strong {
    font-size: 1.2rem;
    color: var(--text-main);
}

.total-highlight {
    background: linear-gradient(135deg, var(--primary-light), rgba(0, 184, 148, 0.1));
    padding: 1.2rem;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--primary);
    margin-bottom: 1.5rem;
}

.total-highlight span {
    font-size: 1.1rem;
    font-weight: 600;
}

.total-highlight strong {
    font-size: 1.8rem;
    color: var(--success);
}

.warning-text {
    font-size: 0.85rem;
    color: var(--warning);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: rgba(253, 203, 110, 0.1);
    padding: 1rem;
    border-radius: var(--radius-sm);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Streak Widget --- */
.streak-card {
    display: flex;
    flex-direction: column;
}

.streak-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.8rem 0;
    flex: 1;
}

/* --- Live Clock --- */
.live-clock {
    font-size: 1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--primary);
    background: var(--primary-light);
    padding: .2rem .75rem;
    border-radius: 20px;
    letter-spacing: .05em;
    white-space: nowrap;
}

/* --- Day Notepad --- */
.notepad-card textarea:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-light) !important;
}

/* --- Category Filter Pills --- */
.category-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    padding: .6rem 0 .8rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: .5rem;
}

.cat-pill {
    padding: .3rem .8rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    font-size: .78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .18s ease;
    font-family: inherit;
    white-space: nowrap;
}

.cat-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.cat-pill.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    font-weight: 600;
    box-shadow: 0 2px 8px var(--primary-light);
}

.streak-number {

    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--warning), #e17055);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.streak-number.pulse {
    transform: scale(1.3);
}

.streak-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Print styles handled via JS popup window */

/* Responsive */
@media (max-width: 1200px) {
    .charts-row[style*="1fr 1fr 1fr"] {
        grid-template-columns: 1fr 1fr !important;
    }
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .charts-row {
        grid-template-columns: 1fr !important;
    }

    .list-section {
        grid-column: 1;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
        padding: 0 1rem;
    }

    .kpi-cards {
        grid-template-columns: 1fr;
    }
}

/* --- Floating Action Buttons --- */
.fab-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #a29bfe);
    color: white;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(108, 92, 231, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 500;
}

.fab-btn:hover {
    transform: scale(1.12) rotate(15deg);
    box-shadow: 0 10px 32px rgba(108, 92, 231, 0.7);
}


/* --- Top Product Widget --- */
.top-product-card {
    display: flex;
    flex-direction: column;
}

.top-product-content {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
    justify-content: center;
    padding: 0.5rem 0;
}

.top-product-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.top-product-amount {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fdcb6e, #e17055);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.top-product-count {
    font-size: 0.78rem;
    color: var(--text-muted);
    background: var(--bg-hover);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    display: inline-block;
    width: fit-content;
    font-weight: 500;
}

/* Responsive for 4-col chart row */
@media (max-width: 1400px) {
    .charts-row[style*="1fr 1fr 1fr 1fr"] {
        grid-template-columns: 1fr 1fr !important;
    }
}

@media (max-width: 768px) {
    .charts-row[style*="1fr 1fr 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    .fab-btn {
        bottom: 1.2rem;
        right: 1.2rem;
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .fab-btn-secondary {
        bottom: 4.6rem;
    }
}

/* --- Peak Hour Widget --- */
.peak-hour-card {
    display: flex;
    flex-direction: column;
}

.peak-hour-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 80px;
    flex: 1;
    margin: 0.8rem 0;
    padding: 0 2px;
}

.peak-bar {
    flex: 1;
    border-radius: 3px 3px 0 0;
    background: var(--primary-light);
    border: 1px solid rgba(108, 92, 231, 0.2);
    transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s;
    cursor: pointer;
    min-height: 2px;
}

.peak-bar:hover {
    background: rgba(108, 92, 231, 0.5);
}

.peak-bar-active {
    background: linear-gradient(180deg, var(--primary), #a29bfe);
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(108, 92, 231, 0.5), 0 0 20px rgba(108, 92, 231, 0.2);
    animation: peakPulse 2s ease-in-out infinite;
}

@keyframes peakPulse {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(108, 92, 231, 0.5);
    }

    50% {
        box-shadow: 0 0 20px rgba(108, 92, 231, 0.8), 0 0 30px rgba(108, 92, 231, 0.3);
    }
}

/* --- Activity Heatmap --- */
.rep-heatmap {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 5px;
    flex: 1;
    align-content: start;
    padding: 0.5rem 0;
}

.heatmap-dot {
    aspect-ratio: 1;
    border-radius: 4px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, background 0.3s;
    cursor: help;
}

.heatmap-dot:hover {
    transform: scale(1.2);
}

.heatmap-dot.hm-low {
    background: rgba(108, 92, 231, 0.25);
    border-color: rgba(108, 92, 231, 0.3);
}

.heatmap-dot.hm-mid {
    background: rgba(108, 92, 231, 0.55);
    border-color: rgba(108, 92, 231, 0.6);
}

.heatmap-dot.hm-high {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 6px rgba(108, 92, 231, 0.4);
}

/* --- Responsive for 5-col chart row --- */
@media (max-width: 1600px) {
    .charts-row[style*="1fr 1fr 1fr 1fr 1fr"] {
        grid-template-columns: 1fr 1fr 1fr !important;
    }
}

@media (max-width: 1100px) {
    .charts-row[style*="1fr 1fr 1fr 1fr 1fr"] {
        grid-template-columns: 1fr 1fr !important;
    }
}

@media (max-width: 768px) {
    .charts-row[style*="1fr 1fr 1fr 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    .hide-mobile {
        display: none !important;
    }
}

/* --- Share button micro-interaction --- */
#btn-share-summary {
    position: relative;
    overflow: hidden;
}

#btn-share-summary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(108, 92, 231, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s, opacity 0.4s;
    opacity: 0;
}

#btn-share-summary:active::after {
    width: 200px;
    height: 200px;
    opacity: 1;
}

/* =============================================
   Multi-Item Form System
   ============================================= */
.items-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.item-row {
    display: flex;
    flex-direction: column;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
    animation: itemSlideIn 0.25s ease;
}

.item-row:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.item-row-fields {
    display: grid;
    grid-template-columns: 1fr 130px 130px 36px;
    align-items: stretch;
}

.item-field-desc,
.item-field-amount {
    border-right: 1px solid var(--border-color);
}

.item-field-cat {
    border-right: 1px solid var(--border-color);
}

.item-field-desc .input-wrapper,
.item-field-amount .input-wrapper,
.item-field-cat .input-wrapper {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none !important;
    margin-bottom: 0;
    height: 44px;
}

.item-field-desc .input-wrapper:focus-within,
.item-field-amount .input-wrapper:focus-within {
    background: rgba(108, 92, 231, 0.05);
}

.item-product-input {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding-left: 2.5rem !important;
    height: 44px;
    font-size: 0.88rem;
    color: var(--text-main);
    width: 100%;
    font-family: inherit;
}

.item-amount-input {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding-left: 2.5rem !important;
    height: 44px;
    font-size: 0.88rem;
    color: var(--text-main);
    width: 100%;
    font-family: inherit;
    font-weight: 600;
}

.item-category-select {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    color: var(--text-muted);
    font-size: 0.78rem;
    height: 44px;
    width: 100%;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    padding: 0 0.5rem 0 0.8rem;
}

.item-remove-btn {
    width: 36px;
    background: none;
    border: none;
    color: var(--danger);
    opacity: 0.45;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s, transform 0.2s;
    padding: 0;
    flex-shrink: 0;
}

.item-remove-btn:hover {
    opacity: 1;
    transform: scale(1.2);
}

/* Add-Item Button */
.btn-add-item {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(108, 92, 231, 0.25);
    border-radius: 20px;
    padding: 0.28rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-family: inherit;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-add-item:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.04);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.35);
}

.btn-add-item:active {
    transform: scale(0.95);
}

/* Multi-Item Total Bar */
.multi-item-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.6rem;
    padding: 0.65rem 1rem;
    background: linear-gradient(135deg, var(--primary-light), rgba(0, 184, 148, 0.07));
    border: 1px solid rgba(108, 92, 231, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    color: var(--text-muted);
    animation: fadeIn 0.3s ease;
}

.multi-item-total strong {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

/* Slide animations */
@keyframes itemSlideIn {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes itemSlideOut {
    from {
        opacity: 1;
        transform: scale(1);
        max-height: 60px;
        margin-bottom: 0;
    }

    to {
        opacity: 0;
        transform: scale(0.96);
        max-height: 0;
        margin-bottom: -0.5rem;
    }
}

/* Responsive: stack on small screens */
@media (max-width: 600px) {
    .item-row-fields {
        grid-template-columns: 1fr 100px 36px;
    }

    .item-field-cat {
        display: none;
    }
}