/* Emerald theme (optional, second step on the theme button: light -> emerald -> dark -> futuristic).
   Colors taken from the UITC page of the TUP Cavite website (tupcavite.edu.ph/office/uitc): emerald green #047857 / #059669 with deep
   green #064e3b / #14532d, mint #34d399, a pale green tint #ecfdf5, green-tinted borders #d3e7de, slate text, and the campus name kept in maroon.
   It is a light theme: <html class="em"> (no "dark"). Only tokens and a few overrides, so everything that uses var(--btn), var(--maroon),
   var(--hover), var(--link) turns green by itself. Red stays red where it means a warning (overdue, busy, errors).
   Delete this file and its <link> in base.html (plus the 'emerald' step in app.js and the head script) to remove the theme. */

html.em {
  --maroon: #047857;          /* accent: active menu, borders on hover, dots */
  --btn: #047857;             /* primary buttons, focus ring */
  --btn-hover: #065f46;
  --red-50: #ecfdf5;          /* pale tints (pills, quick cards, tags) */
  --red-100: #a7f3d0;

  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f4faf7;
  --text: #1d293d;
  --heading: #13241d;
  --muted: #45556c;
  --faint: #8393a8;
  --border: #d3e7de;
  --border-soft: #e6f2ec;
  --hover: #ecfdf5;
  --link: #047857;
  --nav-bg: rgba(255, 255, 255, .96);
  --glow-a: rgba(5, 150, 105, .10);
  --glow-b: rgba(6, 78, 59, .05);
  --shadow: 0 1px 2px rgba(6, 78, 59, .08);
  --shadow-lift: 0 12px 26px -12px rgba(6, 78, 59, .35);
  color-scheme: light;
}

html.em ::selection { background: rgba(52, 211, 153, .35); }

/* ---- header: white bar, a green line on top like the hero of the UITC page; the campus name stays maroon ---- */
html.em .topbar { border-bottom-color: var(--border); }
html.em .topbar::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; pointer-events: none;
  background: linear-gradient(90deg, #14532d, #059669 55%, #34d399); }
html.em .brand-text strong span, html.em .footer-brand span { color: #800000; }
html.em .brand-text small { color: #047857; }
html.em .nav a:hover, html.em .nav a.active { color: #047857; border-bottom-color: #34d399; }
html.em .nav-user-name small { color: #047857; }
html.em .nav a.nav-cta, html.em .avatar { background: linear-gradient(135deg, #059669, #047857); }
html.em .nav a.nav-cta:hover, html.em .nav a.nav-cta.active { background: linear-gradient(135deg, #047857, #064e3b); }
html.em .footer { border-top: 3px solid transparent; border-image: linear-gradient(90deg, #14532d, #059669 55%, #34d399) 1 0 0 0; }

/* ---- buttons and charts ---- */
html.em .btn-primary { background: linear-gradient(135deg, #059669, #047857); border-color: #047857; box-shadow: 0 8px 18px -8px rgba(4, 120, 87, .55); }
html.em .btn-primary:hover { background: linear-gradient(135deg, #047857, #064e3b); border-color: #064e3b; }
html.em .bar { background: linear-gradient(180deg, #34d399, #047857); }
html.em .hb-fill, html.em .flip-progress span { background: linear-gradient(90deg, #34d399, #047857); }
html.em .stat-n { color: #065f46; }
html.em .chat-head { background: linear-gradient(135deg, #059669, #064e3b); }

/* ---- warnings stay red: overdue, busy, errors ---- */
html.em .stat-alert { border-color: #fecaca; background: linear-gradient(135deg, #fef2f2, var(--surface) 70%); }
html.em .stat-alert .stat-n { color: #b91c1c; }
html.em .row-overdue { background: #fef2f2; }
html.em .row-overdue td:first-child { box-shadow: inset 3px 0 0 #dc2626; }
html.em .row-overdue time.running { color: #b91c1c; }
html.em .pill-busy { background: #fee2e2; color: #991b1b; }
html.em .room-card.room-busy { border-left-color: #dc2626; }
html.em .timeline-rooms li.tl-busy { border-left-color: #dc2626; }
html.em .filepick-msg { background: #fef2f2; color: #991b1b; }
html.em .role-admin { background: #ecfdf5; color: #047857; }

/* ---- the button shows the theme a click switches to: light -> leaf, emerald -> moon, dark -> star, futuristic -> sun ---- */
.theme-toggle .leaf { display: none; }
html:not(.dark):not(.em) .theme-toggle .leaf { display: inline; color: #047857; }
html:not(.dark):not(.em) .theme-toggle .moon { display: none; }
html.em .theme-toggle { border-color: var(--border); }
html.em .theme-toggle:hover { border-color: #34d399; }
