/* =====================================================================
   Recycle and Earn Monitoring System: shared styles
   Palette (taken from the Barucboc National High School seal):
     Seal blue  = brand, buttons, links, headings accents
     Leaf green = recycling, bottles, money received, "ok"
     Ray gold   = points, highlights, header underline
     Teal       = "today" figures; Red = danger only
   ===================================================================== */
:root {
  --blue-950: #081a47;
  --blue-900: #0b2563;
  --blue-800: #12348c;
  --blue-700: #1b45b8;
  --blue-600: #2556d6;
  --blue-100: #e5ecff;
  --blue-50: #f1f5ff;

  --green-700: #15803d;
  --green-600: #16a34a;
  --green-100: #dcf6e5;
  --green-50: #effaf3;

  --gold-500: #f5b301;
  --gold-600: #d99a06;
  --gold-700: #a16207;
  --gold-100: #fff2c4;
  --gold-50: #fff9e6;

  --teal-700: #0e7490;
  --teal-100: #d9f2f6;

  --red-600: #c62828;
  --red-100: #fde8e8;

  --ink: #0f1b3d;
  --muted: #5a6a8a;
  --line: #e2e8f5;
  --bg: #f3f6fc;
  --card: #ffffff;

  --shadow: 0 1px 2px rgba(11, 37, 99, .05), 0 10px 30px rgba(11, 37, 99, .07);
  --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: linear-gradient(180deg, #e7eeff 0, var(--bg) 320px) no-repeat, var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--blue-700); }
a:hover { color: var(--blue-900); }
:focus-visible { outline: 3px solid rgba(37, 86, 214, .45); outline-offset: 2px; border-radius: 6px; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
.top { background: linear-gradient(120deg, var(--blue-950) 0%, var(--blue-900) 55%, #1a43a6 100%); color: #fff; border-bottom: 4px solid var(--gold-500); box-shadow: 0 6px 20px rgba(8, 26, 71, .25); }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding-top: 12px; padding-bottom: 12px; }
.brandlink { display: flex; align-items: center; gap: 14px; color: #fff; text-decoration: none; margin-right: auto; min-width: 0; }
.brandlink:hover { color: #fff; }
.logo { width: 52px; height: 52px; border-radius: 50%; background: #fff; object-fit: contain; flex: 0 0 auto; padding: 2px; }
.logo.mono { display: flex; align-items: center; justify-content: center; background: var(--blue-700); color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .03em; border: 2px solid var(--gold-500); }
/* The real school seal: no circle or ring behind it, just a soft glow. */
.logo.logo-img { background: none; border: 0; border-radius: 0; padding: 0; object-fit: contain;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, .6)) drop-shadow(0 0 9px rgba(130, 185, 255, .75)); }
.top .logo.logo-img { width: 60px; height: 60px; }
.brandtext { display: flex; flex-direction: column; min-width: 0; }
.school { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: #b9ccf5; }
.sys { font-size: 18px; font-weight: 700; line-height: 1.25; letter-spacing: -.005em; }
nav { display: flex; gap: 4px; }
nav a { color: #d4e0fb; text-decoration: none; padding: 8px 14px; border-radius: 10px; font-size: 14px; font-weight: 600; white-space: nowrap; transition: background .15s, color .15s; }
nav a:hover { background: rgba(255, 255, 255, .14); color: #fff; }
nav a.active { background: #fff; color: var(--blue-900); box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }

main { flex: 1; padding-top: 28px; padding-bottom: 36px; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 18px 16px 24px; }

/* ---------- Type ---------- */
h1 { font-size: 27px; margin: 0 0 4px; line-height: 1.2; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 0 0 14px; letter-spacing: -.005em; }
.subtitle { color: var(--muted); margin: 0 0 20px; font-size: 14.5px; }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 18px; }
.grid .card { margin-bottom: 0; }

/* stat cards: an icon tile + label, big number, small note */
.stat { transition: transform .15s ease, box-shadow .15s ease; }
.stat:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(11, 37, 99, .06), 0 16px 36px rgba(11, 37, 99, .11); }
.stat-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.stat-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 auto; background: var(--tone-bg, var(--blue-100)); color: var(--tone, var(--blue-700)); }
.stat-icon svg { display: block; }
.stat-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; line-height: 1.25; }
.stat-value { font-size: 32px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.tone-blue { --tone: var(--blue-700); --tone-bg: var(--blue-100); }
.tone-green { --tone: var(--green-700); --tone-bg: var(--green-100); }
.tone-gold { --tone: var(--gold-700); --tone-bg: var(--gold-100); }
.tone-teal { --tone: var(--teal-700); --tone-bg: var(--teal-100); }

/* welcome banner on the student page */
.hero { position: relative; overflow: hidden; display: flex; align-items: center; gap: 18px; color: #fff; border: 0;
  background: linear-gradient(135deg, var(--blue-700) 0%, var(--blue-900) 100%); box-shadow: 0 14px 34px rgba(11, 37, 99, .28); }
.hero::before { content: ""; position: absolute; right: -60px; top: -90px; width: 240px; height: 240px; border-radius: 50%; border: 3px solid rgba(245, 179, 1, .45); background: rgba(255, 255, 255, .06); }
.hero::after { content: ""; position: absolute; right: 80px; bottom: -110px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255, 255, 255, .06); }
.hero > * { position: relative; z-index: 1; }
.hero h1 { color: #fff; margin: 0; }
.hero .muted { color: #c6d6ff; }
.hero .chip { display: inline-block; background: rgba(255, 255, 255, .15); border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; padding: 3px 12px; font-size: 13px; margin: 8px 6px 0 0; }
.avatar { width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; font-weight: 800; font-size: 23px; letter-spacing: .02em;
  background: rgba(255, 255, 255, .16); border: 2px solid rgba(255, 255, 255, .4); }

/* a card title with a small icon */
.card-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-title h2 { margin: 0; }
.card-title .stat-icon { width: 34px; height: 34px; border-radius: 10px; }

/* ---------- Forms ---------- */
label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 5px; color: var(--ink); }
input, select { width: 100%; padding: 11px 12px; border: 1px solid #cdd8ee; border-radius: 11px; font-size: 16px; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input::placeholder { color: #9aa8c4; }
input:focus, select:focus { outline: none; border-color: var(--blue-600); box-shadow: 0 0 0 4px rgba(37, 86, 214, .15); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 14px; }
button, .btn { display: inline-block; background: var(--blue-700); color: #fff; border: 0; padding: 11px 20px; border-radius: 11px; font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: none; text-align: center; box-shadow: 0 2px 6px rgba(27, 69, 184, .28); transition: background .15s, transform .05s; }
button:hover, .btn:hover { background: var(--blue-800); color: #fff; }
button:active, .btn:active { transform: translateY(1px); }
button.secondary, .btn.secondary { background: var(--blue-50); color: var(--blue-800); box-shadow: none; border: 1px solid #d3defa; }
button.secondary:hover, .btn.secondary:hover { background: var(--blue-100); color: var(--blue-900); }
button.danger { background: var(--red-600); box-shadow: 0 2px 6px rgba(198, 40, 40, .25); }
button.danger:hover { background: #a61f1f; }
button.small { padding: 7px 12px; font-size: 13px; }
.inline { display: inline; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; vertical-align: middle; }
th { background: #f1f5fd; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
th:first-child { border-top-left-radius: 10px; }
th:last-child { border-top-right-radius: 10px; }
tbody tr:hover td { background: #f8faff; }
tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

/* ---------- Messages & pills ---------- */
.msg { padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; font-size: 14px; border: 1px solid transparent; }
.msg.ok { background: var(--green-50); border-color: #bfe8cd; color: #0f5c2c; }
.msg.warn { background: var(--gold-50); border-color: #f4dd8f; color: #7a4f05; }
.msg.err { background: var(--red-100); border-color: #f5c2c2; color: #8c1d1d; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill.on { background: var(--green-100); color: #0f5c2c; }
.pill.off { background: var(--gold-100); color: var(--gold-700); }

.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }

/* ---------- Drop-off list (grouped bottles) ---------- */
.drops { list-style: none; margin: 0; padding: 0; }
.drops li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.drops li:last-child { border-bottom: 0; }
.drop-main { font-weight: 700; }
.drop-sub { color: var(--muted); font-size: 13px; }
.drop-value { text-align: right; font-variant-numeric: tabular-nums; }
.drop-value b { display: block; color: var(--green-700); }

/* ---------- Public landing ---------- */
.center-card { max-width: 440px; margin: 28px auto; }
.center-card:not(.landing) h1 { margin-bottom: 16px; }
.landing { text-align: center; padding: 28px 24px; }
.landing .logo { width: 96px; height: 96px; margin: 0 auto 12px; display: block; border: 3px solid var(--gold-500); background: #fff; }
.landing .logo.mono { font-size: 22px; }
.landing .logo.logo-img { width: 128px; height: 128px; margin: 0 auto 14px; border: 0; background: none;
  filter: drop-shadow(0 8px 16px rgba(27, 69, 184, .35)); }
.landing h1 { font-size: 25px; }
.landing form { text-align: left; }

/* ---------- Mobile ---------- */
.rk-sm { display: none; }

/* checkboxes: normal weight, big tap target */
label.check { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; font-weight: 500; line-height: 1.4; margin-bottom: 14px; cursor: pointer; }
label.check input { width: 20px; height: 20px; flex: 0 0 auto; margin: 1px 0 0; accent-color: var(--blue-700); }

/* six stat cards: 6 across, then 3, then 2 */
.grid.six { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1000px) { .grid.six { grid-template-columns: repeat(3, 1fr); } }

@media (max-width: 720px) {
  .bar { gap: 10px; }
  /* menu: every item visible, in a tidy grid (no hidden sideways scrolling) */
  nav { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  nav a { text-align: center; padding: 9px 6px; font-size: 14px; background: rgba(255, 255, 255, .09); }
  nav a.active { background: #fff; }
  .sys { font-size: 15px; }
  .logo { width: 44px; height: 44px; }
  .top .logo.logo-img { width: 52px; height: 52px; }
  main { padding-top: 18px; }
  h1 { font-size: 22px; }
  .grid, .grid.six { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-value { font-size: 25px; }
  .stat-head { gap: 8px; margin-bottom: 8px; }
  .stat-icon { width: 32px; height: 32px; border-radius: 10px; }
  .stat-icon svg { width: 18px; height: 18px; }
  .card { padding: 15px; border-radius: 14px; }
  .hero { gap: 14px; align-items: flex-start; }
  .hero::before { width: 150px; height: 150px; right: -70px; top: -90px; border-width: 2px; }
  .hero::after { width: 130px; height: 130px; right: 20px; bottom: -90px; }
  .hero .chip { font-size: 12px; padding: 2px 9px; margin: 6px 5px 0 0; }
  .hero h1 { font-size: 21px; }
  .avatar { width: 52px; height: 52px; font-size: 18px; }
  button, .btn { width: 100%; }
  .actions button, .actions .btn, td button, td .btn { width: auto; }
}

/* tables become compact cards on phones and tablets: three small values per row, wide fields get their own line */
@media (max-width: 900px) {
  .rk-sm { display: inline; color: var(--muted); font-weight: 600; margin-right: 6px; }
  table.stack thead { display: none; }
  table.stack, table.stack tbody { display: block; }
  table.stack tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
  table.stack tbody tr:hover td { background: transparent; }
  table.stack tr { display: grid; grid-template-columns: repeat(6, 1fr); align-content: start; gap: 2px 10px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fafcff; }
  table.stack td { display: block; grid-column: span 2; min-width: 0; border: 0; padding: 4px 0; text-align: left; font-size: 14px; overflow-wrap: anywhere; }
  table.stack td::before { content: attr(data-label); display: block; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
  table.stack td[data-label=""]::before, table.stack td:not([data-label])::before { content: none; }
  table.stack td.num { text-align: left; }
  table.stack td.wide { grid-column: 1 / -1; }
  table.stack td.half { grid-column: span 3; }
  table.stack td.first { order: -1; }
  table.stack td.name { font-size: 16px; font-weight: 700; }
  table.stack td.name::before { content: none; }
  table.stack td.hide-sm { display: none; }
  table.stack td.actions-cell { grid-column: 1 / -1; padding-top: 8px; }
  table.stack td.actions-cell::before { content: none; }
  table.stack td.empty-row { grid-column: 1 / -1; }
  table.stack tr:has(td.empty-row) { grid-column: 1 / -1; }
}
