/* Apple-inspired UI — clean, airy, SF type, frosted glass */
:root {
  --blue: #0071e3;
  --blue-dark: #0068d1;
  --bg: #f5f5f7;
  --card: #ffffff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --danger: #d70015;
  --radius: 18px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 1.25rem; }

/* Frosted-glass top bar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.topbar .wrap {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.65rem 1.25rem;
}
.brand { display: flex; gap: 0.75rem; align-items: center; }
.brand-mark {
  width: 2.5rem; height: 2.5rem; border-radius: 0.75rem;
  background: linear-gradient(135deg, var(--blue), #42a5f5);
  color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.35);
}
.brand strong { font-size: 1.02rem; letter-spacing: -0.01em; }
.brand small { display: block; color: var(--muted); font-size: 0.76rem; }
.topbar nav a {
  color: var(--ink); text-decoration: none; margin-left: 0.6rem;
  font-size: 0.92rem;
}
.topbar nav a:hover { color: var(--blue); }

main.wrap { padding-top: 2rem; padding-bottom: 3rem; }
.foot { padding: 1.5rem 1.25rem; color: var(--muted); text-align: center; }

h1 {
  font-size: 2rem; font-weight: 700; letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}
h2 {
  font-size: 1.3rem; font-weight: 600; letter-spacing: -0.015em;
  margin: 2.2rem 0 0.9rem; color: var(--ink);
}
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* Pill buttons */
.btn {
  display: inline-block; background: var(--blue); color: #fff;
  border: none; border-radius: 980px;
  padding: 0.55rem 1.3rem; text-decoration: none; cursor: pointer;
  font-size: 0.95rem; font-weight: 500;
  transition: background 0.2s, transform 0.1s;
}
.btn:hover { background: var(--blue-dark); }
.btn:active { transform: scale(0.98); }
.btn.small { padding: 0.32rem 0.85rem; font-size: 0.85rem; }
.btn.ghost { background: rgba(0, 113, 227, 0.1); color: var(--blue); }
.btn.ghost:hover { background: rgba(0, 113, 227, 0.18); }
.topbar .btn.small { background: var(--blue); color: #fff; margin-left: 0.6rem; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #b80012; }
button.btn { font-family: inherit; }

.report-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 0.5rem;
}
.weekpick { display: flex; align-items: center; gap: 0.5rem; color: var(--muted); font-size: 0.92rem; }
.weekpick select {
  padding: 0.5rem 0.8rem; border-radius: 12px;
  border: 1px solid var(--line); font-size: 0.92rem; background: #fff;
  font-family: inherit;
}

/* Stat cards */
.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.9rem; margin: 1.4rem 0;
}
.card {
  background: var(--card); border-radius: var(--radius);
  padding: 1rem 1.2rem; display: flex; flex-direction: column;
  box-shadow: var(--shadow);
}
.card .num {
  font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.card .lbl {
  font-size: 0.78rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em; margin-top: 0.15rem;
}

/* Table */
.tbl {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--card); border-radius: var(--radius);
  overflow: hidden; font-size: 0.92rem; box-shadow: var(--shadow);
}
.tbl th, .tbl td {
  text-align: left; padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line); vertical-align: top;
}
.tbl td { overflow-wrap: anywhere; word-break: break-word; }
.tbl th { white-space: nowrap; }
.tbl td:nth-child(3) { min-width: 200px; max-width: 360px; }
.tbl thead th {
  background: #f5f5f7; color: var(--muted); font-weight: 600;
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em;
}
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover td { background: #fafafc; }
.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl a { color: var(--blue); text-decoration: none; }
.tbl a:hover { text-decoration: underline; }

.worklist {
  background: var(--card); border-radius: var(--radius);
  padding: 1.1rem 1.3rem 1.1rem 2.4rem; margin: 0;
  box-shadow: var(--shadow); list-style: none;
}
.worklist li {
  margin: 0.55rem 0; padding-left: 0.2rem; position: relative;
  overflow-wrap: anywhere;
}
.worklist li::before {
  content: ""; position: absolute; left: -1.1rem; top: 0.55em;
  width: 0.45rem; height: 0.45rem; border-radius: 50%;
  background: var(--blue);
}

/* Admin panels */
.panel-grid { display: grid; gap: 1.2rem; }
.panel {
  background: var(--card); border-radius: 20px;
  padding: 1.4rem; box-shadow: var(--shadow);
}
.panel h2 { margin-top: 0; }
.rows { list-style: none; margin: 0.8rem 0; padding: 0; }
.rows li {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 0.8rem;
  padding: 0.75rem 0; border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.rows li:last-child { border-bottom: none; }
.row-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }
.row-actions form { margin: 0; }

.addbox {
  margin-top: 0.9rem; border: 1px solid var(--line);
  border-radius: 14px; padding: 0.7rem 1rem; background: #fafafc;
}
.addbox summary {
  cursor: pointer; font-weight: 600; color: var(--blue); font-size: 0.95rem;
}

/* Forms */
.form { display: grid; gap: 0.8rem; margin-top: 0.9rem; }
.form.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.form.narrow h1, h1.center { text-align: center; }
.form label { display: grid; gap: 0.3rem; font-size: 0.9rem; font-weight: 600; }
.form input, .form textarea, .form select {
  font: inherit; font-weight: 400; padding: 0.65rem 0.85rem;
  border: 1px solid var(--line); border-radius: 12px; width: 100%;
  background: #fff; transition: border-color 0.15s, box-shadow 0.15s;
}
.form input:focus, .form textarea:focus, .form select:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15);
}
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.form .four { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.7rem; }
.form-actions { display: flex; gap: 0.6rem; margin-top: 0.3rem; }
.error {
  color: var(--danger); font-weight: 600; background: rgba(215, 0, 21, 0.08);
  border-radius: 12px; padding: 0.7rem 1rem; font-size: 0.92rem;
}

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
.table-scroll .tbl { min-width: 900px; }
@media (max-width: 640px) {
  h1 { font-size: 1.6rem; }
  .form .two, .form .four { grid-template-columns: 1fr 1fr; }
  .report-head { flex-direction: column; }
}

/* ---- Hero + report sheets (public view) ---- */
.hero {
  background: linear-gradient(135deg, #005e62 0%, #0071e3 100%);
  border-radius: 28px;
  padding: 3rem 2.5rem;
  color: #fff;
  margin-bottom: 1.4rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.25s ease;
  box-shadow:
    inset 0 0.35rem 1rem rgba(255, 255, 255, 0.28),
    inset 0 -0.15rem 0.4rem rgba(0, 0, 0, 0.35),
    inset 0 -0.5rem 1rem rgba(255, 255, 255, 0.35),
    0 2.2rem 2.6rem rgba(0, 0, 0, 0.16),
    0 1rem 1.2rem -0.6rem rgba(0, 94, 98, 0.55);
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}
.hero::before {
  left: -15%; right: -15%;
  top: -75%; bottom: 45%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.13);
}
.hero::after {
  left: 5%; right: 5%;
  top: 5%; bottom: 58%;
  border-radius: 24px 24px 0 0;
  box-shadow: inset 0 10px 8px -10px rgba(255, 255, 255, 0.85);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.32) 0%, rgba(255, 255, 255, 0) 55%);
}
.hero:hover {
  box-shadow:
    inset 0 0.35rem 0.7rem rgba(255, 255, 255, 0.4),
    inset 0 -0.15rem 0.4rem rgba(0, 0, 0, 0.35),
    inset 0 -0.5rem 1rem rgba(255, 255, 255, 0.55),
    0 2.2rem 2.6rem rgba(0, 0, 0, 0.16),
    0 1rem 1.2rem -0.6rem rgba(0, 94, 98, 0.55);
}
.hero:hover::before { transform: translateY(-6%); }
.hero:hover::after { opacity: 0.55; transform: translateY(7%); }
.hero:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 0.35rem 0.7rem rgba(255, 255, 255, 0.45),
    inset 0 -0.15rem 0.4rem rgba(0, 0, 0, 0.4),
    inset 0 -0.5rem 1rem rgba(255, 255, 255, 0.35),
    0 1.4rem 1.8rem rgba(0, 0, 0, 0.14),
    0 0.8rem 1rem -0.6rem rgba(0, 94, 98, 0.5);
}
.hero-inner { position: relative; z-index: 1; transition: transform 0.2s ease; }
.hero:hover .hero-inner { transform: translateY(-3px); }
.hero-eyebrow {
  font-size: 0.8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
  opacity: 0.85; margin: 0 0 0.6rem;
}
.hero h1 {
  color: #fff; font-size: 2.6rem; margin: 0 0 0.4rem;
  letter-spacing: -0.03em; overflow-wrap: break-word;
}
.hero-sub { opacity: 0.9; margin: 0 0 1.2rem; font-size: 1.02rem; }
.hero-week select {
  appearance: none; -webkit-appearance: none;
  background: rgba(255,255,255,0.16); color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 980px; padding: 0.6rem 2.4rem 0.6rem 1.2rem;
  font: inherit; font-size: 0.95rem; font-weight: 500; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='white' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center;
}
.hero-week select option { color: #1d1d1f; }

.stats {
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 0.9rem; margin-bottom: 1.4rem;
}
.stat {
  background: linear-gradient(180deg, #ffffff 0%, #f6f6f8 100%);
  border-radius: var(--radius);
  padding: 1.25rem 1.2rem;
  display: flex; flex-direction: column; align-items: flex-start;
  position: relative; overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.25s ease;
  box-shadow:
    inset 0 0.2rem 0.5rem rgba(255, 255, 255, 0.9),
    inset 0 -0.2rem 0.5rem rgba(0, 0, 0, 0.05),
    inset 0 -0.1rem 0.25rem rgba(255, 255, 255, 0.7),
    0 1.4rem 1.8rem rgba(0, 0, 0, 0.07),
    0 0.5rem 0.8rem -0.4rem rgba(0, 0, 0, 0.12);
}
.stat::before,
.stat::after {
  content: "";
  position: absolute;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.stat::before {
  left: -20%; right: -20%;
  top: -80%; bottom: 55%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
}
.stat::after {
  left: 8%; right: 8%;
  top: 4%; bottom: 70%;
  border-radius: 14px 14px 0 0;
  box-shadow: inset 0 8px 6px -8px rgba(255, 255, 255, 0.9);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0) 60%);
}
.stat > * { position: relative; z-index: 1; }
.stat:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 0.2rem 0.4rem rgba(255, 255, 255, 1),
    inset 0 -0.2rem 0.5rem rgba(0, 0, 0, 0.05),
    inset 0 -0.1rem 0.25rem rgba(255, 255, 255, 0.9),
    0 1.8rem 2.2rem rgba(0, 0, 0, 0.09),
    0 0.6rem 1rem -0.4rem rgba(0, 0, 0, 0.14);
}
.stat:hover::before { transform: translateY(-8%); }
.stat:hover::after { opacity: 0.6; transform: translateY(8%); }
.stat:active {
  transform: translateY(2px) scale(0.99);
  box-shadow:
    inset 0 0.2rem 0.5rem rgba(255, 255, 255, 0.8),
    inset 0 -0.15rem 0.4rem rgba(0, 0, 0, 0.07),
    0 0.8rem 1.2rem rgba(0, 0, 0, 0.06),
    0 0.4rem 0.6rem -0.4rem rgba(0, 0, 0, 0.1);
}
.stat .icon {
  width: 2.4rem; height: 2.4rem; border-radius: 0.75rem;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 0.6rem;
}
.stat .icon svg { width: 1.25rem; height: 1.25rem; }
.icon.blue { background: rgba(0,113,227,0.12); color: #0071e3; }
.icon.teal { background: rgba(0,94,98,0.12); color: #005e62; }
.icon.pink { background: rgba(214,40,90,0.12); color: #d6285a; }
.icon.orange { background: rgba(245,130,32,0.14); color: #e07b1a; }
.icon.green { background: rgba(52,170,80,0.14); color: #2c9a46; }
.icon.purple { background: rgba(120,90,220,0.14); color: #6e56cf; }
.stat .num {
  font-size: 1.8rem; font-weight: 700; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; line-height: 1.2;
}
.stat .lbl {
  font-size: 0.7rem; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  white-space: nowrap; margin-top: 0.15rem;
}

.sheet {
  background: var(--card); border-radius: 22px;
  padding: 1.6rem; box-shadow: var(--shadow); margin-bottom: 1.2rem;
}
.sheet h2 { margin-top: 0; }
.sheet .tbl { box-shadow: none; border: 1px solid var(--line); }
.sheet-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 1.2rem; }
.sheet-grid .sheet { margin-bottom: 0; }
.big { font-size: 2.2rem; font-weight: 700; letter-spacing: -0.02em; margin: 0; }

@media (max-width: 1024px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .hero { padding: 2rem 1.4rem; border-radius: 22px; }
  .hero h1 { font-size: 1.9rem; }
  .sheet-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }
  .stat { padding: 1rem; }
  .stat .icon { width: 2.1rem; height: 2.1rem; margin-bottom: 0.45rem; }
  .stat .icon svg { width: 1.05rem; height: 1.05rem; }
  .stat .num { font-size: 1.5rem; }
  .stat .lbl { font-size: 0.64rem; letter-spacing: 0.04em; }
}
