/* ============================================================
   index.css — Design System for Bảng Kê Thực Phẩm TBCTVN
   Redesigned with UI/UX Pro Max recommendations
   Font: Be Vietnam Pro | Icons: Lucide SVG | Style: Data-Dense Dashboard
   ============================================================ */

/* --- Google Fonts: Be Vietnam Pro + Noto Sans --- */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;500;600;700;800&family=Noto+Sans:wght@400;500;600;700&display=swap');

/* --- Cascade Layers for predictability --- */
@layer reset, base, tokens, components, utilities;

/* --- Reset --- */
@layer reset {
  *, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color-scheme: dark;
  }

  body {
    font-family: var(--font-family);
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
  }

  input, select, button, textarea {
    font-family: inherit;
    font-size: inherit;
  }

  button { cursor: pointer; }
  a { text-decoration: none; color: inherit; }
}

/* --- Design Tokens --- */
@layer tokens {
  :root {
    /* Font */
    --font-family: 'Be Vietnam Pro', 'Noto Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

    /* Sizing */
    --font-2xs:  0.65rem;
    --font-xs:   0.75rem;
    --font-sm:   0.8125rem;
    --font-base: 0.875rem;
    --font-md:   1rem;
    --font-lg:   1.125rem;
    --font-xl:   1.25rem;
    --font-2xl:  1.5rem;
    --font-3xl:  1.875rem;

    /* Colors — Dark Financial Dashboard palette */
    --bg-base:       #0c0e14;
    --bg-surface:    #12151e;
    --bg-raised:     #1a1e2e;
    --bg-overlay:    #222840;
    --bg-hover:      #262d45;
    --bg-active:     #2e3650;

    /* Glass surfaces */
    --glass-bg:      rgba(22, 27, 45, 0.72);
    --glass-border:  rgba(99, 115, 170, 0.12);
    --glass-border-hover: rgba(99, 115, 170, 0.25);

    /* Text */
    --text-primary:   #e8ecf4;
    --text-secondary: #8b95b0;
    --text-muted:     #555f7a;
    --text-inverse:   #0c0e14;

    /* Brand Accent — blue for construction/professional feel */
    --accent:           #0ea5e9;
    --accent-hover:     #38bdf8;
    --accent-muted:     rgba(14, 165, 233, 0.15);
    --accent-border:    rgba(14, 165, 233, 0.25);
    --accent-glow:      0 0 24px rgba(14, 165, 233, 0.12);

    /* Semantic */
    --success:        #22c55e;
    --success-muted:  rgba(34, 197, 94, 0.12);
    --warning:        #f59e0b;
    --warning-muted:  rgba(245, 158, 11, 0.12);
    --danger:         #ef4444;
    --danger-muted:   rgba(239, 68, 68, 0.12);
    --info:           #3b82f6;
    --info-muted:     rgba(59, 130, 246, 0.12);

    /* Category Colors — food classification */
    --cat-meat:       #f87171;
    --cat-seafood:    #38bdf8;
    --cat-egg:        #fbbf24;
    --cat-vegetable:  #4ade80;
    --cat-spice:      #fb923c;
    --cat-organ:      #c084fc;
    --cat-other:      #94a3b8;

    /* Spacing (8px grid) */
    --sp-1:  4px;
    --sp-2:  8px;
    --sp-3:  12px;
    --sp-4:  16px;
    --sp-5:  20px;
    --sp-6:  24px;
    --sp-8:  32px;
    --sp-10: 40px;
    --sp-12: 48px;
    --sp-16: 64px;

    /* Radii */
    --radius-sm:   6px;
    --radius-md:   10px;
    --radius-lg:   14px;
    --radius-xl:   20px;
    --radius-pill: 9999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.5);

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --dur-fast: 150ms;
    --dur-norm: 250ms;
    --dur-slow: 400ms;

    /* Table */
    --table-row-h: 40px;
    --sidebar-w:   240px;
    --header-h:    64px;
  }
}

/* --- Scrollbar --- */
@layer base {
  :root {
    scrollbar-color: rgba(139, 149, 176, 0.25) transparent;
    scrollbar-width: thin;
  }

  /* Ambient background glow */
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
      radial-gradient(ellipse 60% 50% at 15% 10%, rgba(14, 165, 233, 0.04) 0%, transparent 70%),
      radial-gradient(ellipse 50% 60% at 85% 80%, rgba(59, 130, 246, 0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
  }

  /* Selection */
  ::selection {
    background: rgba(14, 165, 233, 0.3);
    color: #fff;
  }
}

/* --- Components --- */
@layer components {

  /* ===== Layout ===== */
  .app-container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--sp-6);
    padding-bottom: var(--sp-16);
  }

  /* ===== Header ===== */
  .app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    padding: var(--sp-4) var(--sp-6);
    margin-bottom: var(--sp-6);
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: var(--sp-4);
    z-index: 50;
  }

  .app-logo {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    min-width: 0;
  }

  .app-logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent), #0284c7);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--accent-glow);
    color: var(--text-inverse);
  }
  .app-logo-icon svg { width: 22px; height: 22px; }

  .app-logo-text h1 {
    font-size: var(--font-md);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
    color: var(--text-primary);
  }

  .app-logo-text .subtitle {
    font-size: var(--font-2xs);
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  /* Header Controls */
  .header-controls {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    flex-shrink: 0;
  }

  .month-selector {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    background: var(--bg-raised);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--sp-2) var(--sp-3);
    transition: border-color var(--dur-fast) var(--ease-out);
  }
  .month-selector:hover,
  .month-selector:focus-within {
    border-color: var(--glass-border-hover);
  }

  .month-selector label {
    display: flex;
    align-items: center;
    color: var(--text-muted);
  }
  .month-selector label svg {
    width: 16px;
    height: 16px;
  }

  .month-selector input[type="month"] {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: var(--font-sm);
    font-weight: 600;
    cursor: pointer;
    outline: none;
    width: 135px;
  }
  .month-selector input[type="month"]::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
    cursor: pointer;
  }

  /* ===== Tabs ===== */
  .tab-bar {
    display: flex;
    gap: 2px;
    margin-bottom: var(--sp-6);
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 3px;
    border: 1px solid var(--glass-border);
  }

  .tab-btn {
    flex: 1;
    padding: var(--sp-3) var(--sp-4);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: var(--font-sm);
    font-weight: 500;
    cursor: pointer;
    border-radius: calc(var(--radius-md) - 2px);
    transition: all var(--dur-fast) var(--ease-out);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
  }
  .tab-btn svg { width: 18px; height: 18px; }

  .tab-btn:hover:not(.active) {
    color: var(--text-primary);
    background: var(--bg-hover);
  }

  .tab-btn.active {
    background: var(--accent);
    color: var(--text-inverse);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.25);
  }

  .tab-content {
    display: none;
  }
  .tab-content.active {
    display: block;
    animation: slideUp 0.3s var(--ease-out);
  }

  @keyframes slideUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* ===== Stats Grid ===== */
  .stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-3);
    margin-bottom: var(--sp-6);
  }

  .stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--sp-4) var(--sp-5);
    transition: all var(--dur-fast) var(--ease-out);
    position: relative;
    overflow: hidden;
  }

  .stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    opacity: 0;
    transition: opacity var(--dur-fast) var(--ease-out);
  }

  .stat-card:hover {
    border-color: var(--glass-border-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
  }
  .stat-card:hover::before {
    opacity: 1;
  }

  .stat-card .stat-label {
    font-size: var(--font-2xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-bottom: var(--sp-1);
  }

  .stat-card .stat-value {
    font-size: var(--font-xl);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
    line-height: 1.2;
  }
  .stat-card .stat-value.success { color: var(--success); }
  .stat-card .stat-value.warning { color: var(--warning); }

  /* ===== Action Bar ===== */
  .action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    margin-bottom: var(--sp-4);
    flex-wrap: wrap;
  }
  .action-bar-left {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
  }

  /* ===== Buttons ===== */
  .btn {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-4);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: var(--bg-raised);
    color: var(--text-primary);
    font-size: var(--font-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease-out);
    white-space: nowrap;
    line-height: 1.5;
  }
  .btn svg { width: 16px; height: 16px; flex-shrink: 0; }

  .btn:hover {
    background: var(--bg-hover);
    border-color: var(--glass-border-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-xs);
  }
  .btn:active {
    transform: translateY(0);
  }

  .btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--text-inverse);
    font-weight: 600;
  }
  .btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: 0 2px 12px rgba(14, 165, 233, 0.3);
  }

  .btn-success {
    background: var(--success);
    border-color: var(--success);
    color: white;
    font-weight: 600;
  }
  .btn-success:hover {
    background: #16a34a;
    box-shadow: 0 2px 12px rgba(34, 197, 94, 0.3);
  }

  .btn-danger {
    background: transparent;
    border-color: transparent;
    color: var(--text-muted);
    padding: var(--sp-1);
  }
  .btn-danger:hover {
    color: var(--danger);
    background: var(--danger-muted);
  }

  .btn-icon {
    padding: var(--sp-2);
    min-width: 32px;
    min-height: 32px;
    justify-content: center;
    border-radius: var(--radius-sm);
  }

  .btn-sm {
    padding: var(--sp-1) var(--sp-2);
    font-size: var(--font-xs);
  }
  .btn-sm svg { width: 14px; height: 14px; }

  .btn-ghost {
    background: transparent;
    border-color: transparent;
  }
  .btn-ghost:hover {
    background: var(--bg-hover);
    border-color: var(--glass-border);
  }

  /* ===== Data Table ===== */
  .table-container {
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
  }

  .data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-sm);
  }

  .data-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .data-table th {
    background: var(--bg-raised);
    color: var(--text-muted);
    font-size: var(--font-2xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: var(--sp-3);
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
  }

  .data-table td {
    padding: var(--sp-2) var(--sp-3);
    border-bottom: 1px solid rgba(99, 115, 170, 0.06);
    vertical-align: middle;
    height: var(--table-row-h);
  }

  .data-table tbody tr {
    transition: background var(--dur-fast) var(--ease-out);
  }
  .data-table tbody tr:hover {
    background: rgba(99, 115, 170, 0.05);
  }

  /* Day separator */
  .day-separator td {
    border-top: 2px solid var(--accent-border);
  }

  .day-start td:first-child,
  .day-start td:nth-child(2) {
    font-weight: 600;
  }

  /* Column widths */
  .col-date     { width: 72px; }
  .col-meal     { width: 52px; }
  .col-food     { min-width: 150px; }
  .col-unit     { width: 60px; }
  .col-qty      { width: 72px; }
  .col-price    { width: 100px; }
  .col-total    { width: 100px; }
  .col-daytotal { width: 110px; }
  .col-actions  { width: 48px; }

  /* Food name with category dot */
  .food-name-cell {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
  }

  .cat-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    opacity: 0.9;
  }

  .cat-thit    .cat-dot { background: var(--cat-meat); }
  .cat-haisan  .cat-dot { background: var(--cat-seafood); }
  .cat-trung   .cat-dot { background: var(--cat-egg); }
  .cat-raucu   .cat-dot { background: var(--cat-vegetable); }
  .cat-giavi   .cat-dot { background: var(--cat-spice); }
  .cat-noitang .cat-dot { background: var(--cat-organ); }
  .cat-khac    .cat-dot { background: var(--cat-other); }

  .text-right  { text-align: right !important; }
  .text-center { text-align: center !important; }

  .price-text {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    color: var(--text-secondary);
  }
  .total-text {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--accent);
  }

  /* ===== Autocomplete ===== */
  .autocomplete-wrapper {
    position: relative;
  }

  .autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 300px;
    max-height: 280px;
    overflow-y: auto;
    background: var(--bg-overlay);
    border: 1px solid var(--glass-border-hover);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: none;
  }
  .autocomplete-dropdown.show {
    display: block;
    animation: dropIn 0.15s var(--ease-out);
  }

  @keyframes dropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .ac-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-2) var(--sp-3);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out);
    gap: var(--sp-3);
    border-bottom: 1px solid rgba(99, 115, 170, 0.06);
  }
  .ac-item:last-child { border-bottom: none; }
  .ac-item:hover,
  .ac-item.selected {
    background: var(--accent-muted);
  }

  .ac-item-left {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    min-width: 0;
  }
  .ac-item-name {
    font-size: var(--font-sm);
    font-weight: 500;
    white-space: nowrap;
  }
  .ac-item-unit {
    font-size: var(--font-2xs);
    color: var(--text-muted);
  }
  .ac-item-right {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    flex-shrink: 0;
  }
  .ac-item-price {
    font-size: var(--font-xs);
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
  }
  .ac-item-category {
    font-size: var(--font-2xs);
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    background: var(--bg-raised);
    white-space: nowrap;
  }

  /* ===== Quick Add Panel ===== */
  .quick-add-panel {
    background: var(--bg-surface);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-lg);
    padding: var(--sp-5) var(--sp-6);
    margin-bottom: var(--sp-4);
    box-shadow: var(--accent-glow), var(--shadow-md);
    display: none;
  }
  .quick-add-panel.show {
    display: block;
    animation: slideUp 0.25s var(--ease-out);
  }

  .quick-add-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--sp-5);
  }
  .quick-add-header h3 {
    font-size: var(--font-base);
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
  }
  .quick-add-header h3 svg { width: 18px; height: 18px; }

  .quick-add-form {
    display: grid;
    grid-template-columns: 135px 80px 1fr 72px 90px 100px auto;
    gap: var(--sp-3);
    align-items: end;
  }
  .quick-add-form .form-group { margin-bottom: 0; }

  /* ===== Form Fields ===== */
  .form-group {
    margin-bottom: var(--sp-4);
  }
  .form-group label {
    display: block;
    font-size: var(--font-2xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--sp-1);
  }

  .form-control {
    width: 100%;
    padding: var(--sp-2) var(--sp-3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: var(--bg-raised);
    color: var(--text-primary);
    font-size: var(--font-sm);
    transition: all var(--dur-fast) var(--ease-out);
    outline: none;
    line-height: 1.5;
  }
  .form-control:hover {
    border-color: var(--glass-border-hover);
  }
  .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-muted);
  }
  .form-control::placeholder {
    color: var(--text-muted);
  }

  .input-number,
  .input-price {
    text-align: right;
    font-variant-numeric: tabular-nums;
  }

  .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-3);
  }

  /* ===== Add Row CTA ===== */
  .add-row-area {
    padding: var(--sp-3) var(--sp-4);
  }
  .add-row-btn {
    width: 100%;
    padding: var(--sp-3);
    border: 1px dashed var(--glass-border);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-muted);
    font-size: var(--font-sm);
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease-out);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
  }
  .add-row-btn svg { width: 16px; height: 16px; }
  .add-row-btn:hover {
    border-color: var(--accent-border);
    color: var(--accent);
    background: var(--accent-muted);
  }

  /* ===== Table Footer ===== */
  .table-footer {
    background: var(--bg-raised);
    border-top: 2px solid var(--accent-border);
    padding: var(--sp-4) var(--sp-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .grand-total-label {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .grand-total-value {
    font-size: var(--font-2xl);
    font-weight: 800;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
  }

  /* ===== Empty State ===== */
  .empty-state {
    text-align: center;
    padding: var(--sp-16) var(--sp-6);
  }
  .empty-state-icon {
    margin-bottom: var(--sp-4);
    color: var(--text-muted);
    opacity: 0.3;
  }
  .empty-state-icon svg { width: 56px; height: 56px; }
  .empty-state h3 {
    font-size: var(--font-lg);
    color: var(--text-secondary);
    margin-bottom: var(--sp-2);
  }
  .empty-state p {
    font-size: var(--font-sm);
    color: var(--text-muted);
    margin-bottom: var(--sp-6);
    max-width: 320px;
    margin-inline: auto;
  }

  /* ===== Dialog / Modal ===== */
  dialog.modal {
    margin: auto;
    border: none;
    background: var(--bg-surface);
    color: var(--text-primary);
    border-radius: var(--radius-lg);
    padding: 0;
    max-width: 520px;
    width: 90vw;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.25s var(--ease-out);
  }
  dialog.modal::backdrop {
    background: rgba(8, 10, 16, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  @keyframes modalIn {
    from { opacity: 0; transform: scale(0.97) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
  }

  .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-5) var(--sp-6);
    border-bottom: 1px solid var(--glass-border);
  }
  .modal-header h2 {
    font-size: var(--font-lg);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--sp-2);
  }
  .modal-header h2 svg { width: 20px; height: 20px; color: var(--accent); }

  .modal-body { padding: var(--sp-6); }
  .modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--sp-3);
    padding: var(--sp-4) var(--sp-6);
    border-top: 1px solid var(--glass-border);
  }

  /* ===== Import Drop Zone ===== */
  .import-drop-zone {
    border: 2px dashed var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--sp-10);
    text-align: center;
    transition: all var(--dur-fast) var(--ease-out);
    cursor: pointer;
  }
  .import-drop-zone:hover,
  .import-drop-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-muted);
  }
  .import-drop-zone .drop-icon {
    margin-bottom: var(--sp-3);
    color: var(--text-muted);
  }
  .import-drop-zone .drop-icon svg { width: 40px; height: 40px; }
  .import-drop-zone p {
    color: var(--text-secondary);
    font-size: var(--font-sm);
  }
  .import-drop-zone .file-input { display: none; }

  /* ===== Toast Notifications ===== */
  .toast-container {
    position: fixed;
    bottom: var(--sp-6);
    right: var(--sp-6);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
  }

  .toast {
    background: var(--bg-overlay);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--sp-3) var(--sp-4);
    box-shadow: var(--shadow-lg);
    font-size: var(--font-sm);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    animation: toastIn 0.3s var(--ease-out);
    min-width: 260px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .toast svg { width: 16px; height: 16px; flex-shrink: 0; }
  .toast.success { border-left: 3px solid var(--success); }
  .toast.success svg { color: var(--success); }
  .toast.warning { border-left: 3px solid var(--warning); }
  .toast.warning svg { color: var(--warning); }
  .toast.error   { border-left: 3px solid var(--danger); }
  .toast.error svg { color: var(--danger); }

  @keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
  }
  @keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(20px); }
  }

  /* Row animations */
  .row-new {
    animation: rowPulse 0.6s var(--ease-out);
  }
  @keyframes rowPulse {
    0%   { background: var(--accent-muted); }
    100% { background: transparent; }
  }
}

/* --- Utilities --- */
@layer utilities {
  .hidden { display: none !important; }

  /* Responsive */
  @media (max-width: 900px) {
    .app-header {
      flex-direction: column;
      gap: var(--sp-3);
      position: static;
    }
    .quick-add-form {
      grid-template-columns: 1fr 1fr;
    }
    .stats-bar {
      grid-template-columns: repeat(2, 1fr);
    }
    .table-container {
      overflow-x: auto;
    }
  }

  @media (max-width: 600px) {
    .app-container {
      padding: var(--sp-3);
    }
    .quick-add-form {
      grid-template-columns: 1fr;
    }
    .stats-bar {
      grid-template-columns: 1fr 1fr;
    }
    .form-row {
      grid-template-columns: 1fr;
    }
  }

  /* Reduced motion */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }
}
