/* =====================================================
   ROSSOPOMODORO — LIGHT THEME  (main content only)
   Sidebar stays dark as designed in base.html.
   ===================================================== */

/* ── 1. DESIGN TOKENS ── */
:root {
  /* Brand */
  --brand:       #ff5e00;
  --brand-dark:  #e55000;
  --brand-light: rgba(255,94,0,0.10);

  /* Light page surfaces */
  --lp-bg:        #f7f5f2;   /* warm off-white page */
  --lp-surface:   #ffffff;   /* card face */
  --lp-surface-2: #faf8f6;   /* secondary surface (thead, card-header) */
  --lp-raised:    #ffffff;   /* modals, popovers */

  /* Text */
  --lp-text:     #323232;
  --lp-text-2:   #4e4e4e;
  --lp-text-3:   #8a8a8a;

  /* Borders */
  --lp-border:   #e2dfd9;
  --lp-border-2: #cac6bf;

  /* ── 3D Extrude shadows ──
     Layered: top edge highlight + bottom soft shadow.
     Creates a subtle "lifted tile" look without being skeuomorphic. */
  --sh-card:
    inset 0 1px 0 rgba(255,255,255,0.85),
    0 1px 2px rgba(0,0,0,0.07),
    0 4px 12px rgba(0,0,0,0.07),
    0 10px 24px rgba(0,0,0,0.05);

  --sh-card-hover:
    inset 0 1px 0 rgba(255,255,255,1),
    0 2px 4px rgba(0,0,0,0.09),
    0 8px 20px rgba(0,0,0,0.10),
    0 20px 40px rgba(0,0,0,0.08);

  --sh-stat:
    inset 0 1px 0 rgba(255,255,255,0.90),
    0 1px 3px rgba(0,0,0,0.08),
    0 6px 16px rgba(0,0,0,0.07);

  --sh-stat-hover:
    inset 0 1px 0 rgba(255,255,255,1),
    0 3px 8px rgba(0,0,0,0.11),
    0 12px 28px rgba(0,0,0,0.10);

  --sh-table:
    inset 0 1px 0 rgba(255,255,255,0.80),
    0 1px 3px rgba(0,0,0,0.07),
    0 6px 18px rgba(0,0,0,0.06);

  --sh-input:
    inset 0 2px 4px rgba(0,0,0,0.05);

  --sh-input-focus:
    inset 0 2px 4px rgba(0,0,0,0.05),
    0 0 0 3px rgba(255,94,0,0.15);
}

/* ── 2. PAGE BACKGROUND & BODY ── */
body {
  background: var(--lp-bg) !important;
  color: var(--lp-text) !important;
}
main,
.main-wrapper {
  background: var(--lp-bg) !important;
}

/* ── 3. MOBILE HEADER — light, matches sidebar card style ── */
.mobile-header {
  background: #FFFFFF !important;
  border-bottom: 1px solid #E0E0E0 !important;
  border-top: 3px solid var(--brand) !important;
}

/* ── 4. FLASH MESSAGES (light palette) ── */
.flash {
  backdrop-filter: none;
  border-radius: 10px;
}
.flash.success {
  background: #f0fdf4 !important;
  color: #166534 !important;
  border-left-color: #22c55e !important;
  box-shadow: var(--sh-card);
}
.flash.danger {
  background: #fff5f5 !important;
  color: #991b1b !important;
  border-left-color: var(--brand) !important;
  box-shadow: var(--sh-card);
}
.flash.warning {
  background: #fffbeb !important;
  color: #92400e !important;
  border-left-color: #f59e0b !important;
  box-shadow: var(--sh-card);
}
.flash.info {
  background: #eff6ff !important;
  color: #1e40af !important;
  border-left-color: #3b82f6 !important;
  box-shadow: var(--sh-card);
}

/* ── 5. PAGE HEADER ── */
.page-header {
  border-bottom: 1px solid var(--lp-border) !important;
}
.page-header h1,
.page-header h2 {
  color: var(--lp-text) !important;
}
.page-header p {
  color: var(--lp-text-2) !important;
}

/* ── 6. STAT CARDS (3D extruded tiles) ── */
.stat-card {
  background: var(--lp-surface) !important;
  border: 1px solid var(--lp-border) !important;
  border-left: 3px solid var(--brand) !important;
  box-shadow: var(--sh-stat) !important;
}
.stat-card:hover {
  background: var(--lp-surface) !important;
  box-shadow: var(--sh-stat-hover) !important;
  transform: translateY(-3px) !important;
}
.stat-value {
  color: var(--lp-text) !important;
}
.stat-label {
  color: var(--lp-text-3) !important;
}
.stat-icon-brand   { background: rgba(255,94,0,0.10) !important; color: var(--brand) !important; }
.stat-icon-blue    { background: rgba(100,116,139,0.10) !important; color: #64748b !important; }
.stat-icon-success { background: rgba(34,197,94,0.10) !important; color: #16a34a !important; }
.stat-icon-warning { background: rgba(245,158,11,0.10) !important; color: #d97706 !important; }

/* ── 7. CARDS (white with red top accent) ── */
.card,
.page-card {
  background: var(--lp-surface) !important;
  border: 1px solid var(--lp-border) !important;
  border-top: 3px solid var(--brand) !important;
  box-shadow: var(--sh-card) !important;
}
.card:hover {
  background: var(--lp-surface) !important;
  box-shadow: var(--sh-card-hover) !important;
  transform: translateY(-2px) !important;
}

.card-header {
  background: var(--lp-surface-2) !important;
  border-bottom: 1px solid var(--lp-border) !important;
  color: var(--lp-text) !important;
  box-shadow: inset 0 -1px 0 var(--lp-border) !important;
}
.card-body {
  background: transparent;
  color: var(--lp-text);
}
.card-footer {
  background: var(--lp-surface-2) !important;
  border-top: 1px solid var(--lp-border) !important;
}

/* ── 8. TABLE (extruded panel + clean rows) ── */
.table-container,
.table-responsive {
  background: var(--lp-surface) !important;
  border: 1px solid var(--lp-border) !important;
  box-shadow: var(--sh-table) !important;
  border-radius: 12px;
  overflow: hidden;
}

.table {
  background: var(--lp-surface) !important;
}

.table thead th {
  background: #F5F5F5 !important;
  color: #555555 !important;
  border-bottom: 2px solid #E8E8E8 !important;
  box-shadow: none !important;
  letter-spacing: .07em;
}

.table tbody td {
  color: var(--lp-text) !important;
  border-bottom: 1px solid #eeece8 !important;
}
.table tbody tr:nth-child(even) {
  background: #faf8f5 !important;
}
.table tbody tr:nth-child(odd) {
  background: var(--lp-surface) !important;
}
.table tbody tr:hover {
  background: #fff3e8 !important;
}
.table tbody tr:last-child td {
  border-bottom: none !important;
}

/* ── 9. CHART CONTAINERS ── */
.chart-container {
  background: var(--lp-surface) !important;
  border: 1px solid var(--lp-border) !important;
  box-shadow: var(--sh-card) !important;
}
.chart-title {
  color: var(--lp-text) !important;
}
.chart-controls {
  background: var(--lp-surface-2) !important;
  border: 1px solid var(--lp-border) !important;
}
.chart-btn {
  color: var(--lp-text-2) !important;
}
.chart-btn:hover {
  color: var(--lp-text) !important;
}
.chart-btn.active {
  background: #323232 !important;
  color: #fff !important;
  box-shadow: none !important;
}

/* ── 10. FORMS (light inputs with inset depth) ── */
.form-label {
  color: var(--lp-text-2) !important;
}
.form-control,
.form-select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
  background: var(--lp-surface) !important;
  border: 1px solid var(--lp-border-2) !important;
  color: var(--lp-text) !important;
  box-shadow: var(--sh-input) !important;
}
.form-control:focus,
.form-select:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand) !important;
  box-shadow: var(--sh-input-focus) !important;
  background: #ffffff !important;
}
.form-control::placeholder { color: #b0ada8 !important; }

/* ── 11. ALERTS (light tinted backgrounds) ── */
.alert-success {
  background: #f0fdf4 !important;
  color: #166534 !important;
  border-left-color: #22c55e !important;
}
.alert-danger {
  background: #fff5f5 !important;
  color: #991b1b !important;
  border-left-color: var(--brand) !important;
}
.alert-warning {
  background: #fffbeb !important;
  color: #92400e !important;
  border-left-color: #f59e0b !important;
}
.alert-info {
  background: #eff6ff !important;
  color: #1e40af !important;
  border-left-color: #3b82f6 !important;
}

/* ── 12. BADGES (on light bg, adjust dark ones) ── */
.badge-blue   { background: #f1f5f9 !important; color: #475569 !important; }
.badge-gray   { background: #f4f3f0 !important; color: #6b7280 !important; }
.badge-purple { background: #f5f3ff !important; color: #7c3aed !important; }

/* ── 13. BUTTONS — consistent system ── */
.btn-secondary {
  background: #ffffff !important;
  color: #333333 !important;
  border: 1.5px solid #333333 !important;
  box-shadow: none !important;
}
.btn-secondary:hover {
  background: #333333 !important;
  color: #ffffff !important;
}
.btn-ghost {
  background: transparent !important;
  color: var(--lp-text-2) !important;
  border: 1px solid var(--lp-border) !important;
}
.btn-ghost:hover {
  background: var(--lp-surface-2) !important;
  color: var(--lp-text) !important;
}
.btn-outline-primary {
  background: #ffffff !important;
  color: var(--brand) !important;
  border: 1px solid var(--brand) !important;
}
.btn-outline-primary:hover {
  background: var(--brand) !important;
  color: #ffffff !important;
}
.btn-outline-secondary {
  background: #ffffff !important;
  color: #333333 !important;
  border: 1.5px solid #333333 !important;
}
.btn-outline-secondary:hover {
  background: #333333 !important;
  color: #ffffff !important;
}

/* Success / danger / warning — semantic colors */
.btn-success {
  background: #f0fdf4 !important;
  color: #166534 !important;
  border: 1px solid #bbf7d0 !important;
  box-shadow: var(--sh-stat) !important;
}
.btn-success:hover {
  background: #dcfce7 !important;
  color: #14532d !important;
  box-shadow: var(--sh-stat-hover) !important;
}
.btn-danger {
  background: #fff5f5 !important;
  color: #991b1b !important;
  border: 1px solid #fecaca !important;
  box-shadow: var(--sh-stat) !important;
}
.btn-danger:hover {
  background: #fee2e2 !important;
  color: #7f1d1d !important;
  box-shadow: var(--sh-stat-hover) !important;
}
.btn-warning {
  background: #fffbeb !important;
  color: #92400e !important;
  border: 1px solid #fde68a !important;
  box-shadow: var(--sh-stat) !important;
}
.btn-warning:hover {
  background: #fef3c7 !important;
  box-shadow: var(--sh-stat-hover) !important;
}
.btn-outline-danger {
  background: transparent !important;
  color: #dc2626 !important;
  border: 1px solid #fca5a5 !important;
}
.btn-outline-danger:hover {
  background: #fff5f5 !important;
  box-shadow: 0 0 0 3px rgba(220,38,38,0.10) !important;
}

/* ── 14. SUPPLIER ITEM ── */
.supplier-item {
  background: var(--lp-surface) !important;
  border: 1px solid var(--lp-border) !important;
  box-shadow: var(--sh-stat) !important;
}
.supplier-item:hover {
  box-shadow: var(--sh-stat-hover) !important;
  border-color: var(--lp-border-2) !important;
}

/* ── 15. LOADING SPINNER (light bg) ── */
.spinner {
  border-color: rgba(0,0,0,0.12) !important;
  border-top-color: var(--brand) !important;
}

/* ── 16. TEXT UTILITIES (on light bg) ── */
.text-navy  { color: var(--lp-text) !important; }
.text-muted { color: var(--lp-text-3) !important; }

/* ── 17. AUTH PAGES ── */
.auth-wrapper,
.auth-container {
  background: var(--lp-bg) !important;
}
.auth-card {
  background: var(--lp-surface) !important;
  border: 1px solid var(--lp-border) !important;
  box-shadow: var(--sh-card) !important;
  border-top: 3px solid var(--brand) !important;
}
.auth-header h2 { color: var(--lp-text) !important; }
.auth-header p  { color: var(--lp-text-2) !important; }
.auth-footer    { color: var(--lp-text-2) !important; border-top-color: var(--lp-border) !important; }

/* ── 18. MOBILE BOTTOM NAV ── */
@media (max-width: 768px) {
  .bottom-nav {
    background: #FFFFFF !important;
    border-top: 1px solid #E0E0E0 !important;
  }
  .mobile-location {
    background: #F5F5F5 !important;
  }
}

/* ── 19. REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── 20. PRINT ── */
@media print {
  body, main { background: white !important; }
  .sidebar, .mobile-header, .btn, .flash-container { display: none !important; }
}

/* ── 21. FOCUS RING ── */
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ── 22. FADE-IN ANIMATION (lighter feel) ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.main-container > * {
  animation: fadeUp 0.28s ease-out both;
}

/* ── 23. DASHBOARD-SPECIFIC 3D DEPTH ── */
.db-card {
  box-shadow: var(--sh-card) !important;
}
.db-card:hover {
  box-shadow: var(--sh-card-hover) !important;
}
.db-act {
  box-shadow: var(--sh-stat) !important;
  transition: box-shadow 0.16s ease, transform 0.16s ease, border-color 0.16s ease !important;
}
.db-act:hover {
  box-shadow: var(--sh-stat-hover) !important;
  transform: translateY(-2px) !important;
}
.db-hero {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 4px 12px rgba(0,0,0,.07) !important;
}
