:root {
    /* Color Palette - Dark Premium */
    --bg-main: #080910;
    --bg-sidebar: #0f1018;
    --bg-card: #161822;
    --bg-hover: #1f2130;
    --bg-card-alt: #1a1c28;
    --text-main: #f0f0ff;
    --text-muted: #7d85a4;
    --border-color: rgba(255, 255, 255, 0.07);
    --border-glow: rgba(108, 92, 231, 0.25);
    --primary: #7c6ff0;
    --primary-hover: #6c5ce7;
    --primary-light: rgba(124, 111, 240, 0.12);
    --primary-glow: rgba(124, 111, 240, 0.3);
    --success: #00cba4;
    --success-light: rgba(0, 203, 164, 0.12);
    --warning: #ffd66e;
    --warning-light: rgba(255, 214, 110, 0.12);
    --danger: #e84393;
    --danger-light: rgba(232, 67, 147, 0.12);
    --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.5);
    --card-shadow-hover: 0 8px 40px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.6);

    /* Layout */
    --font-family: 'Inter', sans-serif;
    --sidebar-width: 270px;
    --header-height: 72px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --transition: 0.25s ease;
    --content-padding: 2.5rem;
}

/* Light Theme Variables */
[data-theme="light"] {
    --bg-main: #f0f2f8;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-card-alt: #f8f9ff;
    --bg-hover: #eaedf5;
    --text-main: #1a1d2e;
    --text-muted: #5a6380;
    --border-color: rgba(0, 0, 0, 0.07);
    --card-shadow: 0 4px 24px rgba(31, 38, 135, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    --card-shadow-hover: 0 8px 40px rgba(31, 38, 135, 0.14);
    --primary: #5b50d6;
    --primary-hover: #7069e8;
    --primary-light: rgba(91, 80, 214, 0.1);
    --primary-glow: rgba(91, 80, 214, 0.2);
    --success: #00a884;
    --success-light: rgba(0, 168, 132, 0.1);
    --warning: #f0a500;
    --warning-light: rgba(240, 165, 0, 0.1);
    --danger: #d6336c;
    --danger-light: rgba(214, 51, 108, 0.1);
    --border-glow: rgba(91, 80, 214, 0.2);
}

* {
    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;
    max-width: 100%;
    width: 100%;
}

html {
    overflow-x: hidden;
    max-width: 100%;
}

/* 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: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse 60% 50% at 15% 10%, rgba(124, 111, 240, 0.07) 0%, transparent 100%),
        radial-gradient(ellipse 50% 40% at 85% 80%, rgba(0, 203, 164, 0.05) 0%, transparent 100%),
        radial-gradient(ellipse 40% 30% at 50% 50%, rgba(232, 67, 147, 0.03) 0%, transparent 100%);
    z-index: -1;
    pointer-events: none;
}

[data-theme="light"] .bg-animated {
    background:
        radial-gradient(ellipse 60% 50% at 15% 10%, rgba(91, 80, 214, 0.05) 0%, transparent 100%),
        radial-gradient(ellipse 50% 40% at 85% 80%, rgba(0, 168, 132, 0.04) 0%, transparent 100%);
}

@keyframes rotateBg {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.app-container {
    display: flex;
    min-height: 100vh;
    backdrop-filter: blur(40px);
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--bg-sidebar) 0%, rgba(13, 14, 24, 0.97) 100%);
    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(30px);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.3);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0 1.5rem 2rem;
}

.logo-icon {
    background: linear-gradient(135deg, var(--primary), #b8aeff);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
    box-shadow: 0 4px 20px var(--primary-glow);
    flex-shrink: 0;
}

.brand h2 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text-main), rgba(255, 255, 255, 0.7));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0 0.75rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    transition: all var(--transition);
    font-weight: 500;
    font-size: 0.92rem;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
}

.nav-item:hover {
    background: rgba(124, 111, 240, 0.08);
    color: var(--primary);
    transform: translateX(3px);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary-light), rgba(124, 111, 240, 0.08));
    color: var(--primary);
    border: 1px solid rgba(124, 111, 240, 0.2);
    font-weight: 600;
}

.sidebar-footer {
    padding: 1.25rem;
    justify-self: flex-end;
}

.license-info {
    background: linear-gradient(135deg, rgba(255, 214, 110, 0.07), rgba(255, 214, 110, 0.04));
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 214, 110, 0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.license-info i {
    color: var(--warning);
    font-size: 1.3rem;
}

.license-text .plan {
    font-size: 0.82rem;
    font-weight: 600;
}

.license-text .price {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 0 var(--content-padding);
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
}

h1 {
    font-size: 1.6rem;
    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);
}

#dynamic-greeting {
    background: linear-gradient(135deg, var(--text-main) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#current-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.theme-toggle:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--border-glow);
    transform: rotate(20deg);
}

.user-profile img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
    transition: border-color var(--transition);
}

.user-profile img:hover {
    border-color: var(--primary);
}

/* Dashboard Grid */
.dashboard-grid {
    padding: 2rem 0;
    display: grid;
    grid-template-columns: 1fr 2fr;
    grid-template-rows: auto auto;
    gap: 1.75rem;
}

/* Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    padding: 1.5rem 1.75rem;
    transition: box-shadow var(--transition), border-color var(--transition), transform 0.25s;
    min-width: 0;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
    border-color: rgba(124, 111, 240, 0.15);
}

/* KPI Cards - New vertical design */
.kpi-cards {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.kpi-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 1.5rem 1.6rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: linear-gradient(90deg, var(--primary), #b8aeff);
    opacity: 0.7;
    transition: opacity var(--transition);
}

.kpi-card:nth-child(1)::before {
    background: linear-gradient(90deg, var(--success), #00e5c0);
}

.kpi-card:nth-child(2)::before {
    background: linear-gradient(90deg, var(--primary), #b8aeff);
}

.kpi-card:nth-child(3)::before {
    background: linear-gradient(90deg, var(--danger), #ff9de2);
}

.kpi-card:nth-child(4)::before {
    background: linear-gradient(90deg, var(--warning), #ffae00);
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 1.1rem;
    align-self: flex-start;
}

.kpi-icon.revenue {
    background: var(--success-light);
    color: var(--success);
    box-shadow: 0 4px 15px rgba(0, 203, 164, 0.2);
}

.kpi-icon.sales {
    background: var(--primary-light);
    color: var(--primary);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.kpi-icon.avg {
    background: var(--warning-light);
    color: var(--warning);
    box-shadow: 0 4px 15px rgba(255, 214, 110, 0.2);
}

.kpi-details {
    flex: 1;
}

.kpi-details h3 {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.5rem;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
    letter-spacing: -0.03em;
    line-height: 1;
}

.kpi-trend {
    font-size: 0.76rem;
    font-weight: 600;
    min-height: 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    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.25rem;
}

.goal-card .goal-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 0.92rem;
}

.progress-bar-container {
    width: 100%;
    height: 10px;
    background: var(--bg-hover);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    width: 0%;
    transition: width 0.9s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(124, 111, 240, 0.4);
}

.goal-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.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.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.header-actions {
    display: flex;
    gap: 0.6rem;
}

.badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid rgba(124, 111, 240, 0.2);
    letter-spacing: 0.01em;
}

.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-md);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s;
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light), 0 2px 8px rgba(124, 111, 240, 0.15);
    background: var(--bg-card);
}

/* 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) 0%, #b8aeff 100%);
    color: white;
    box-shadow: 0 4px 18px var(--primary-glow);
    letter-spacing: 0.01em;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(124, 111, 240, 0.55);
    background: linear-gradient(135deg, var(--primary-hover) 0%, #a29bfe 100%);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px var(--primary-glow);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.82rem;
    transition: all 0.2s;
}

.btn-outline:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary-light);
}

/* 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;
    overflow-x: auto;
    max-height: 400px;
    border-radius: var(--radius-sm);
    -webkit-overflow-scrolling: touch;
}

.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;
    min-width: 600px;
}

.sales-table th {
    padding: 0.85rem 1rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    background: var(--bg-hover);
    position: sticky;
    top: 0;
    z-index: 10;
}

.sales-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.88rem;
}

.sales-table tbody tr {
    transition: background-color 0.15s;
    animation: fadeIn 0.35s ease-out forwards;
}

.sales-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(124, 111, 240, 0.04), transparent);
}

.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.9rem 0;
    flex: 1;
}

/* --- Live Clock --- */
.live-clock {
    font-size: 0.9rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--primary);
    background: var(--primary-light);
    padding: .18rem .7rem;
    border-radius: 20px;
    letter-spacing: .04em;
    white-space: nowrap;
    border: 1px solid rgba(124, 111, 240, 0.2);
}

/* --- 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.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--warning), #ff8c6b);
    -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%);
        transition: transform 0.3s ease;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 0 1rem;
    }

    .kpi-cards {
        grid-template-columns: 1fr;
    }

    .hide-desktop {
        display: block !important;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 90;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    .top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem 0;
    }

    .header-right {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .card {
        padding: 1rem 1.25rem;
        border-radius: var(--radius-md);
    }
    
    .kpi-card {
        padding: 1.2rem 1.25rem;
    }

    .item-row-fields {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        gap: 0;
    }

    .item-field-desc,
    .item-field-amount,
    .item-field-cat {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .item-remove-btn {
        width: 100%;
        padding: 0.8rem;
        background: rgba(232, 67, 147, 0.05);
    }
}

/* --- 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: 2px;
    height: 90px;
    flex: 1;
    margin: 0.9rem 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;
    }
}



/* ============================================
   WEEKLY SUMMARY WIDGET
   ============================================ */
.weekly-summary-card {
    display: flex;
    flex-direction: column;
}

.weekly-bars-container {
    display: flex;
    align-items: flex-end;
    gap: 0.6rem;
    height: 120px;
    padding: 0.75rem 0 0.5rem;
    flex: 1;
}

.weekly-day-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    gap: 0.3rem;
    height: 100%;
}

.weekly-bars-group {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    flex: 1;
    width: 100%;
    justify-content: center;
}

.weekly-bar {
    border-radius: 4px 4px 0 0;
    min-height: 3px;
    width: 14px;
    transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
    cursor: pointer;
    position: relative;
}

.weekly-bar.income-bar {
    background: linear-gradient(180deg, var(--success), rgba(0, 184, 148, 0.5));
}

.weekly-bar.expense-bar {
    background: linear-gradient(180deg, var(--danger), rgba(214, 48, 49, 0.4));
}

.weekly-bar:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.weekly-day-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.weekly-day-col.today .weekly-day-label {
    color: var(--primary);
    font-weight: 700;
}

.weekly-day-col.best-day .weekly-bar.income-bar {
    background: linear-gradient(180deg, gold, rgba(253, 203, 110, 0.6));
}

.weekly-legend {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.6rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.weekly-legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.weekly-legend-dot.income-dot {
    background: var(--success);
}

.weekly-legend-dot.expense-dot {
    background: var(--danger);
}

/* ============================================
   QUICK PRODUCTS WIDGET
   ============================================ */
.quick-products-card {
    display: flex;
    flex-direction: column;
}

.quick-products-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-content: flex-start;
}

.quick-product-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: inherit;
}

.quick-product-chip:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.2);
}

.quick-product-chip:active {
    transform: scale(0.95);
}

.quick-product-chip .chip-price {
    font-size: 0.72rem;
    color: var(--success);
    font-weight: 600;
    background: rgba(0, 184, 148, 0.12);
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
}

.quick-products-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
}

.quick-products-empty i {
    font-size: 1.8rem;
    opacity: 0.4;
}

/* ============================================
   MONTHLY PROJECTION (inside goal card)
   ============================================ */
.monthly-projection {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.8rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.08), rgba(0, 184, 148, 0.06));
    border: 1px solid rgba(108, 92, 231, 0.15);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    color: var(--text-muted);
    animation: fadeIn 0.4s ease;
}

.monthly-projection i {
    color: var(--primary);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.monthly-projection span {
    line-height: 1.4;
}

/* ============================================
   VISUAL ENHANCEMENTS - Extra Polish
   ============================================ */

/* Dashboard wrapper smooth scroll */
.dashboard-wrapper {
    padding-bottom: 3rem;
}

/* Form section - more breathing room */
.form-section .card-header {
    margin-bottom: 1.5rem;
}

.sale-form .form-group {
    margin-bottom: 1.1rem;
}

.sale-form .form-group label {
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Transaction type toggle - pill style */
.transaction-type-toggle .btn {
    border-radius: 10px;
    font-size: 0.88rem;
}

/* Quick amount buttons - more refined */
.quick-actions .btn-outline {
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.45rem 0.9rem;
    flex: none;
    color: var(--text-muted);
}

.quick-actions .btn-outline:hover {
    color: var(--success);
    border-color: var(--success);
    background: rgba(0, 203, 164, 0.08);
    box-shadow: none;
}

/* KPI trend pills - colored backgrounds */
.kpi-trend[style*="color: var(--success)"],
.kpi-trend.trend-up {
    background: rgba(0, 203, 164, 0.1);
    color: var(--success) !important;
}

.kpi-trend[style*="color: var(--danger)"],
.kpi-trend.trend-down {
    background: rgba(232, 67, 147, 0.1);
    color: var(--danger) !important;
}

/* Section labels above rows */
.section-divider {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.25rem 0;
    margin-top: 0.5rem;
}

.section-divider span {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    white-space: nowrap;
}

.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* Scrollbar global styling */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(124, 111, 240, 0.2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(124, 111, 240, 0.4);
}

/* Notepad textarea refined */
.notepad-card textarea {
    border-radius: var(--radius-md) !important;
    font-size: 0.88rem !important;
    min-height: 60px;
}

/* Category pills row - scrollable on small screens */
.category-filter-row {
    padding: 0.5rem 0 0.75rem;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-filter-row::-webkit-scrollbar {
    display: none;
}

/* Search container modernization */
.search-container input {
    border-radius: var(--radius-md) !important;
    padding: 0.65rem 1rem 0.65rem 2.5rem !important;
    font-size: 0.88rem !important;
}

/* Btn.close-register - highlight it slightly */
.btn-close-register {
    color: var(--warning);
    border-color: rgba(255, 214, 110, 0.3);
}

.btn-close-register:hover {
    background: var(--warning-light);
    color: var(--warning);
    border-color: rgba(255, 214, 110, 0.5);
}

/* Goal card projection panel */
.monthly-projection {
    border-radius: var(--radius-md);
    padding: 0.6rem 0.9rem;
}

/* Table container - a bit more height */
.table-container {
    max-height: 440px;
}

/* Card header h2 global */
.card>.card-header>h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Empty state icon - subtle glow */
.empty-icon {
    font-size: 2.5rem;
    color: var(--border-color);
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Report KPIs - keep same vertical style */
#view-reportes .kpi-card::before {
    opacity: 0.6;
}

/* Dashboard entry animation on view switch */
@keyframes dashboardFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-wrapper {
    animation: dashboardFadeIn 0.3s ease;
}

/* Header share and close buttons */
.top-header .btn-outline {
    font-size: 0.82rem;
    padding: 0.45rem 1rem;
    border-radius: 20px;
}

/* nav-item active left indicator */
.nav-item.active {
    position: relative;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 25%;
    bottom: 25%;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--primary);
}

/* Modal improvements */
.modal {
    border-radius: var(--radius-xl);
    padding: 2rem;
}

/* Weekly bar tooltip pill */
.weekly-bar:hover::after {
    font-size: 0.72rem;
    padding: 5px 10px;
    border-radius: 8px;
    font-weight: 600;
}

/* Receipt / print modal */
.modal-lg {
    max-width: 540px;
    border-radius: var(--radius-xl);
}

/* Light theme sidebar */
[data-theme="light"] .sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.06);
}

/* ============================================
   SECONDARY METRICS STRIP
   ============================================ */
.secondary-metrics-strip {
    grid-column: 1 / -1;
    display: flex;
    align-items: stretch;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    animation: dashboardFadeIn 0.4s ease;
}

.sec-metric {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1.1rem 1.75rem;
    flex: 1;
    transition: background var(--transition);
    cursor: default;
}

.sec-metric:hover {
    background: rgba(124, 111, 240, 0.04);
}

.sec-metric-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.sec-metric-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.sec-metric-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 500;
}

.sec-metric-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
    line-height: 1;
}

.sec-metric-divider {
    width: 1px;
    background: var(--border-color);
    align-self: stretch;
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .secondary-metrics-strip {
        flex-wrap: wrap;
    }

    .sec-metric {
        min-width: 45%;
    }

    .sec-metric-divider:nth-child(4) {
        display: none;
    }
}

/* ============================================
   SETUP CHECKLIST
   ============================================ */
.setup-checklist-card {
    grid-column: 1 / -1;
    padding: 1.25rem 1.5rem;
    border-color: rgba(124, 111, 240, 0.18);
    background:
        linear-gradient(135deg, rgba(124, 111, 240, 0.08), rgba(255, 214, 110, 0.04)),
        var(--bg-card);
}

.setup-checklist-card[data-complete="true"] {
    border-color: rgba(0, 203, 164, 0.25);
    background:
        linear-gradient(135deg, rgba(0, 203, 164, 0.1), rgba(124, 111, 240, 0.04)),
        var(--bg-card);
}

.setup-checklist-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.setup-checklist-title {
    margin-bottom: 0.3rem;
}

.setup-checklist-title h2 {
    font-size: 1rem;
}

.setup-checklist-title h2 i {
    color: var(--warning);
    margin-right: 0.45rem;
}

#setup-checklist-subtitle {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.setup-checklist-toggle {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    cursor: pointer;
}

.setup-progress-track {
    height: 7px;
    margin: 1rem 0;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
}

.setup-progress-fill {
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--success));
    transition: width 0.35s ease;
}

.setup-checklist-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.7rem;
}

.setup-step {
    min-height: 72px;
    padding: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s, background 0.2s, color 0.2s;
}

.setup-step i {
    color: var(--primary);
    font-size: 1rem;
}

.setup-step:hover {
    transform: translateY(-2px);
    border-color: rgba(124, 111, 240, 0.38);
    color: var(--text-main);
}

.setup-step.done {
    color: var(--text-main);
    border-color: rgba(0, 203, 164, 0.28);
    background: rgba(0, 203, 164, 0.08);
}

.setup-step.done i {
    color: var(--success);
}

.setup-checklist-card.collapsed .setup-progress-track,
.setup-checklist-card.collapsed .setup-checklist-grid {
    display: none;
}

@media (max-width: 900px) {
    .setup-checklist-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .setup-checklist-head {
        align-items: stretch;
    }

    .setup-checklist-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   DAILY PULSE INSIGHT
   ============================================ */
.daily-pulse-card {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.35rem 1.5rem;
    border-color: rgba(124, 111, 240, 0.18);
    background:
        linear-gradient(135deg, rgba(124, 111, 240, 0.1), rgba(0, 203, 164, 0.05)),
        var(--bg-card);
}

.daily-pulse-card[data-tone="success"] {
    border-color: rgba(0, 203, 164, 0.28);
    background:
        linear-gradient(135deg, rgba(0, 203, 164, 0.12), rgba(124, 111, 240, 0.05)),
        var(--bg-card);
}

.daily-pulse-card[data-tone="warning"] {
    border-color: rgba(255, 214, 110, 0.32);
    background:
        linear-gradient(135deg, rgba(255, 214, 110, 0.12), rgba(124, 111, 240, 0.05)),
        var(--bg-card);
}

.daily-pulse-card[data-tone="danger"] {
    border-color: rgba(232, 67, 147, 0.32);
    background:
        linear-gradient(135deg, rgba(232, 67, 147, 0.12), rgba(124, 111, 240, 0.05)),
        var(--bg-card);
}

.daily-pulse-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.daily-pulse-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary);
    background: var(--primary-light);
    font-size: 1.25rem;
}

.daily-pulse-card[data-tone="success"] .daily-pulse-icon {
    color: var(--success);
    background: var(--success-light);
}

.daily-pulse-card[data-tone="warning"] .daily-pulse-icon {
    color: var(--warning);
    background: var(--warning-light);
}

.daily-pulse-card[data-tone="danger"] .daily-pulse-icon {
    color: var(--danger);
    background: var(--danger-light);
}

.daily-pulse-copy {
    min-width: 0;
}

.daily-pulse-header {
    margin-bottom: 0.35rem;
}

.daily-pulse-header h2 {
    font-size: 1rem;
}

.daily-pulse-copy p {
    color: var(--text-muted);
    font-size: 0.94rem;
    line-height: 1.5;
    max-width: 780px;
}

.daily-pulse-actions {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-shrink: 0;
}

.daily-pulse-action {
    min-height: 42px;
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.86rem;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.daily-pulse-action:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    background: var(--primary-light);
}

@media (max-width: 900px) {
    .daily-pulse-card {
        align-items: stretch;
        flex-direction: column;
    }

    .daily-pulse-actions {
        width: 100%;
    }

    .daily-pulse-action {
        flex: 1;
    }
}

@media (max-width: 520px) {
    .daily-pulse-main {
        align-items: flex-start;
    }

    .daily-pulse-actions {
        flex-direction: column;
    }

    .daily-pulse-action {
        width: 100%;
    }
}

/* ============================================
   RECEIVABLES SNAPSHOT
   ============================================ */
.receivables-card {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.35rem 1.5rem;
    border-color: rgba(232, 67, 147, 0.18);
}

.receivables-card[data-state="pending"] {
    background:
        linear-gradient(135deg, rgba(232, 67, 147, 0.1), rgba(255, 214, 110, 0.05)),
        var(--bg-card);
}

.receivables-card[data-state="clear"] {
    background:
        linear-gradient(135deg, rgba(0, 203, 164, 0.08), rgba(124, 111, 240, 0.04)),
        var(--bg-card);
}

.receivables-copy {
    min-width: 0;
}

.receivables-header {
    margin-bottom: 0.4rem;
}

.receivables-header h2 {
    font-size: 1rem;
}

.receivables-header i {
    color: var(--warning);
    margin-right: 0.45rem;
}

.receivables-amount {
    color: var(--text-main);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.35rem;
}

.receivables-card[data-state="pending"] .receivables-amount {
    color: var(--danger);
}

.receivables-card[data-state="clear"] .receivables-amount {
    color: var(--success);
}

.receivables-detail {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.55;
    max-width: 760px;
}

.receivables-detail strong {
    color: var(--text-main);
}

.receivables-actions {
    display: flex;
    gap: 0.7rem;
    flex-shrink: 0;
}

.receivables-action {
    min-height: 42px;
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.86rem;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.receivables-action.primary {
    border-color: rgba(124, 111, 240, 0.32);
    background: var(--primary-light);
    color: var(--primary);
}

.receivables-action:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    background: var(--primary-light);
}

@media (max-width: 900px) {
    .receivables-card {
        align-items: stretch;
        flex-direction: column;
    }

    .receivables-actions {
        width: 100%;
    }

    .receivables-action {
        flex: 1;
    }
}

@media (max-width: 520px) {
    .receivables-actions {
        flex-direction: column;
    }

    .receivables-action {
        width: 100%;
    }
}

/* ============================================
   STOCK ALERT SNAPSHOT
   ============================================ */
.stock-alert-card {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.35rem 1.5rem;
    border-color: rgba(255, 214, 110, 0.18);
    background:
        linear-gradient(135deg, rgba(255, 214, 110, 0.08), rgba(124, 111, 240, 0.04)),
        var(--bg-card);
}

.stock-alert-card[data-state="ok"] {
    border-color: rgba(0, 203, 164, 0.24);
    background:
        linear-gradient(135deg, rgba(0, 203, 164, 0.09), rgba(124, 111, 240, 0.04)),
        var(--bg-card);
}

.stock-alert-card[data-state="warning"] {
    border-color: rgba(255, 214, 110, 0.34);
}

.stock-alert-card[data-state="danger"] {
    border-color: rgba(232, 67, 147, 0.34);
    background:
        linear-gradient(135deg, rgba(232, 67, 147, 0.11), rgba(255, 214, 110, 0.05)),
        var(--bg-card);
}

.stock-alert-copy {
    min-width: 0;
}

.stock-alert-header {
    margin-bottom: 0.4rem;
}

.stock-alert-header h2 {
    font-size: 1rem;
}

.stock-alert-header i {
    color: var(--warning);
    margin-right: 0.45rem;
}

#stock-alert-text {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.stock-alert-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.stock-alert-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.82rem;
}

.stock-alert-chip strong {
    color: var(--text-main);
}

.stock-alert-chip em {
    color: var(--warning);
    font-style: normal;
    font-weight: 800;
}

.stock-alert-actions {
    display: flex;
    gap: 0.7rem;
    flex-shrink: 0;
}

.stock-alert-action {
    min-height: 42px;
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.86rem;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.stock-alert-action.primary {
    border-color: rgba(124, 111, 240, 0.32);
    background: var(--primary-light);
    color: var(--primary);
}

.stock-alert-action:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    background: var(--primary-light);
}

@media (max-width: 900px) {
    .stock-alert-card {
        align-items: stretch;
        flex-direction: column;
    }

    .stock-alert-actions {
        width: 100%;
    }

    .stock-alert-action {
        flex: 1;
    }
}

@media (max-width: 520px) {
    .stock-alert-actions {
        flex-direction: column;
    }

    .stock-alert-action {
        width: 100%;
    }
}

/* ============================================
   DATA HEALTH PANEL
   ============================================ */
.data-health-panel {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 1px solid rgba(124, 111, 240, 0.2);
    border-radius: var(--radius-md);
    background:
        linear-gradient(135deg, rgba(124, 111, 240, 0.08), rgba(0, 203, 164, 0.04)),
        var(--bg-card);
}

.data-health-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.data-health-header h3 {
    margin-bottom: 0.35rem;
    color: var(--text-main);
}

.data-health-header h3 i {
    margin-right: 0.5rem;
    color: var(--primary);
}

.data-health-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.data-health-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
}

.data-health-item {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.035);
}

.data-health-item span {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.data-health-item strong {
    color: var(--text-main);
    font-size: 1.4rem;
    line-height: 1;
}

.data-health-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.86rem;
}

.data-health-footer i {
    color: var(--primary);
    margin-right: 0.35rem;
}

@media (max-width: 700px) {
    .data-health-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .data-health-header {
        flex-direction: column;
    }
}

/* ============================================
   CLOSE READINESS PANEL
   ============================================ */
.close-readiness-panel {
    margin: 1.2rem 0;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.035);
}

.close-readiness-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.close-readiness-head h3 {
    color: var(--text-main);
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.close-readiness-head h3 i {
    color: var(--primary);
    margin-right: 0.45rem;
}

.close-readiness-head p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.close-readiness-head p strong {
    color: var(--text-main);
}

.close-readiness-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.close-readiness-item {
    display: flex;
    gap: 0.65rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
}

.close-readiness-item i {
    margin-top: 0.15rem;
}

.close-readiness-item.ok i {
    color: var(--success);
}

.close-readiness-item.warn i {
    color: var(--warning);
}

.close-readiness-item strong,
.close-readiness-item span {
    display: block;
}

.close-readiness-item strong {
    color: var(--text-main);
    font-size: 0.88rem;
    margin-bottom: 0.15rem;
}

.close-readiness-item span {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

@media (max-width: 680px) {
    .close-readiness-list {
        grid-template-columns: 1fr;
    }

    .close-readiness-head {
        flex-direction: column;
    }
}

/* ============================================
   DASHBOARD INFORMATION ARCHITECTURE
   ============================================ */
#view-dashboard .dashboard-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: start;
    gap: 1.25rem;
}

#view-dashboard .kpi-cards {
    order: 1;
    grid-column: 1 / -1;
}

#view-dashboard .daily-pulse-card {
    order: 2;
    grid-column: 1 / -1;
}

#view-dashboard .form-section {
    order: 3;
    grid-column: 1 / span 5;
    position: sticky;
    top: calc(var(--header-height) + 1rem);
    align-self: start;
}

#view-dashboard .list-section {
    order: 4;
    grid-column: 6 / -1;
    min-height: 620px;
}

#view-dashboard .list-section .table-container {
    max-height: 520px;
}

#view-dashboard .secondary-metrics-strip {
    order: 5;
    grid-column: 1 / -1;
}

#view-dashboard .setup-checklist-card {
    order: 6;
    grid-column: 1 / span 4;
    height: 100%;
}

#view-dashboard .receivables-card {
    order: 7;
    grid-column: 5 / span 4;
    height: 100%;
}

#view-dashboard .stock-alert-card {
    order: 8;
    grid-column: 9 / -1;
    height: 100%;
}

#view-dashboard .setup-checklist-card,
#view-dashboard .receivables-card,
#view-dashboard .stock-alert-card {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
}

#view-dashboard .setup-checklist-grid {
    grid-template-columns: 1fr;
}

#view-dashboard .receivables-actions,
#view-dashboard .stock-alert-actions {
    width: 100%;
    margin-top: auto;
}

#view-dashboard .receivables-action,
#view-dashboard .stock-alert-action {
    flex: 1;
}

#view-dashboard .charts-row {
    order: 20;
    grid-column: 1 / -1;
}

#view-dashboard #week-vs-lastweek-card {
    order: 30;
    grid-column: 1 / -1 !important;
}

#view-dashboard .notepad-card {
    order: 40;
    grid-column: 1 / -1 !important;
}

#view-dashboard .kpi-card,
#view-dashboard .daily-pulse-card,
#view-dashboard .form-section,
#view-dashboard .list-section {
    border-color: rgba(124, 111, 240, 0.12);
}

@media (max-width: 1180px) {
    #view-dashboard .form-section {
        grid-column: 1 / -1;
        position: static;
    }

    #view-dashboard .list-section {
        grid-column: 1 / -1;
        min-height: auto;
    }

    #view-dashboard .setup-checklist-card {
        grid-column: 1 / span 6;
    }

    #view-dashboard .receivables-card {
        grid-column: 7 / -1;
    }

    #view-dashboard .stock-alert-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    #view-dashboard .dashboard-grid {
        gap: 1rem;
    }

    #view-dashboard .setup-checklist-card,
    #view-dashboard .receivables-card,
    #view-dashboard .stock-alert-card {
        grid-column: 1 / -1;
    }
}

/* ============================================
   LIVE ACTIVITY FEED WIDGET
   ============================================ */
.activity-feed-card {
    display: flex;
    flex-direction: column;
}

.activity-feed-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
    overflow-y: auto;
    max-height: 200px;
}

.activity-feed-list::-webkit-scrollbar {
    width: 3px;
}

.activity-feed-list::-webkit-scrollbar-thumb {
    background: rgba(124, 111, 240, 0.2);
    border-radius: 10px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-color);
    animation: feedSlideIn 0.3s ease;
    transition: background 0.15s;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item:hover {
    background: rgba(124, 111, 240, 0.03);
    border-radius: var(--radius-sm);
    padding-left: 4px;
}

@keyframes feedSlideIn {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.activity-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.activity-dot.income {
    background: var(--success);
    box-shadow: 0 0 6px rgba(0, 203, 164, 0.5);
}

.activity-dot.expense {
    background: var(--danger);
    box-shadow: 0 0 6px rgba(232, 67, 147, 0.5);
}

.activity-info {
    flex: 1;
    min-width: 0;
}

.activity-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.activity-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.activity-amount {
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.activity-amount.income {
    color: var(--success);
}

.activity-amount.expense {
    color: var(--danger);
}

.activity-feed-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex: 1;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-align: center;
}

.activity-feed-empty i {
    font-size: 1.8rem;
    opacity: 0.3;
}
