:root {
  --navy: #0B2545;
  --navy-2: #13315C;
  --ink-2: #4A5A73;
  --ink-3: #5B6B82;
  --ground: #F3F5F9;
  --line: #E1E6EE;
  --soft: #F7F9FC;
  --red: #B42318; --red-bg: #FDECEA;
  --amber: #8A3A00; --amber-bg: #FEF0E1;
  --green: #047857; --green-bg: #E3F5EE;
  --blue: #1849A9; --blue-bg: #EAF1FB;
  --violet: #4B2BA8; --violet-bg: #EDE9FB;
  --shadow: 0 1px 2px rgba(11,37,69,.05), 0 10px 28px rgba(11,37,69,.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--navy); font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--navy); }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.wrap { max-width: 1240px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px 40px; display: flex; flex-direction: column; gap: 20px; }
.loading { padding: 80px 0; text-align: center; color: var(--ink-2); }

/* Hero */
.hero { border-radius: 24px; background: linear-gradient(135deg, #123A6B 0%, #0B2545 55%, #08203D 100%); color: #fff; padding: 24px; display: flex; flex-direction: column; gap: 20px; box-shadow: 0 2px 6px rgba(6,21,41,.2), 0 30px 60px rgba(6,21,41,.28); }
.hero-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(145deg, #2E6FD1, #0E3A75); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 6px 16px rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; }
.logo .ic { width: 24px; height: 24px; color: #fff; }
.brand h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.brand p { margin: 2px 0 0; font-size: 13px; color: #B9CBE6; }
.hero-actions { display: flex; align-items: center; gap: 10px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #A7F3D0; background: rgba(16,185,129,.16); border: 1px solid rgba(110,231,183,.35); padding: 6px 10px; border-radius: 999px; }
.live.stale { color: #FDE68A; background: rgba(245,158,11,.16); border-color: rgba(252,211,77,.35); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #34D399; box-shadow: 0 0 10px #34D399; }
.live.stale .dot { background: #FBBF24; box-shadow: 0 0 10px #FBBF24; }
.glass { background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.18); color: #fff; transition: transform .2s ease, background .2s ease; }
.glass:hover { transform: translateY(-2px); background: rgba(255,255,255,.16); }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; }
.icon-btn .ic { width: 20px; height: 20px; }
.spin .ic { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.greet { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.sub { margin: 6px 0 0; font-size: 15px; color: #C9D8EE; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 16px; text-decoration: none; }
.kpi b { font-size: 30px; line-height: 1; }
.kpi span { font-size: 13px; color: #C9D8EE; }
.k-red { color: #FCA5A5; text-shadow: 0 0 18px rgba(248,113,113,.55); }
.k-gold { color: #FCD34D; text-shadow: 0 0 18px rgba(252,211,77,.5); }
.k-white { color: #fff; text-shadow: 0 0 18px rgba(147,197,253,.6); }
.k-blue { color: #93C5FD; text-shadow: 0 0 18px rgba(147,197,253,.6); }
.launch { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.launch a { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 16px; border-radius: 14px; text-decoration: none; font-weight: 600; font-size: 15px; }
.launch .ic { width: 20px; height: 20px; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.card { background: linear-gradient(180deg, #fff 0%, #FBFCFE 100%); border: 1px solid var(--line); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); transition: transform .25s ease, box-shadow .25s ease; min-width: 0; }
.card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(11,37,69,.06), 0 18px 40px rgba(11,37,69,.14); }
.card.wide { grid-column: 1 / -1; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.card-head h2 { margin: 0; font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.badge3d { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(145deg, #2E6FD1, #0B2545); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 6px 14px rgba(11,37,69,.28); display: inline-flex; align-items: center; justify-content: center; color: #fff; flex: none; }
.meta { font-size: 13px; color: var(--ink-2); }
.count { font-size: 13px; font-weight: 700; color: #fff; padding: 3px 10px; border-radius: 999px; }
.count.red { background: var(--red); } .count.amber { background: #B54708; } .count.zero { background: var(--green); }
.row { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--soft); text-decoration: none; color: var(--navy); min-width: 0; }
a.row:hover { background: #EEF2F8; }
.row.between { justify-content: space-between; align-items: center; }
.col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.t { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.d { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.s { font-size: 12px; color: var(--ink-3); }
.chip { flex: none; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 4px 8px; border-radius: 6px; }
.pill { flex: none; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.c-red { color: var(--red); } .c-amber { color: var(--amber); } .c-green { color: var(--green); } .c-ink { color: var(--ink-2); }
.b-red { background: var(--red-bg); color: var(--red); } .b-amber { background: var(--amber-bg); color: var(--amber); } .b-green { background: var(--green-bg); color: var(--green); } .b-blue { background: var(--blue-bg); color: var(--blue); } .b-violet { background: var(--violet-bg); color: var(--violet); }
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.empty { padding: 14px; border-radius: 12px; background: var(--green-bg); color: var(--green); font-size: 14px; font-weight: 600; }
.err { padding: 14px; border-radius: 12px; background: var(--amber-bg); color: var(--amber); font-size: 13px; }
.more { font-size: 14px; font-weight: 600; text-decoration: none; padding: 6px 0; background: none; border: 0; color: var(--navy); cursor: pointer; text-align: left; font-family: inherit; }
.btn { min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid #D5DCE6; background: #fff; font: inherit; font-size: 13px; font-weight: 600; color: var(--navy); cursor: pointer; }
.days { flex: none; width: 52px; text-align: center; border-radius: 10px; padding: 6px 0; }
.days b { display: block; font-size: 18px; } .days span { display: block; font-size: 11px; font-weight: 600; }
.time { flex: none; width: 64px; font-size: 13px; font-weight: 700; }

/* Team tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: #fff; color: var(--navy); text-align: left; font: inherit; cursor: pointer; box-shadow: 0 1px 2px rgba(11,37,69,.05), 0 6px 16px rgba(11,37,69,.07); transition: transform .25s ease, box-shadow .25s ease; min-height: 44px; }
.tile:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(11,37,69,.06), 0 14px 30px rgba(11,37,69,.12); }
.tile.warn { border-color: #F6D3A8; }
.tile.late { border-color: #F4B4AE; background: #FFF8F7; }
.tile-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.av { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(145deg, #E7EEF9, #C9D8EE); box-shadow: inset 0 1px 0 #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.tile b { font-size: 22px; }
.tile .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foot { margin: 0; font-size: 12px; color: var(--ink-3); text-align: center; }

/* Drawer */
.drawer { border: 0; padding: 0; border-radius: 20px; width: min(560px, calc(100vw - 24px)); max-height: min(80vh, 720px); box-shadow: 0 30px 80px rgba(6,21,41,.35); color: var(--navy); }
.drawer::backdrop { background: rgba(6,21,41,.45); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 16px 8px 20px; position: sticky; top: 0; background: #fff; }
.drawer-head h2 { margin: 0; font-size: 18px; }
.drawer-head .icon-btn { border: 1px solid #D5DCE6; background: #fff; color: var(--navy); }
.drawer-body { padding: 8px 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--soft); min-height: 44px; font-size: 14px; font-weight: 600; }
.toggle input { width: 22px; height: 22px; accent-color: var(--navy); }

/* Sign in */
.signin { min-height: 80vh; display: flex; align-items: center; justify-content: center; }
.signin .hero { max-width: 440px; width: 100%; align-items: flex-start; }
.signin a { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 20px; border-radius: 14px; font-weight: 600; text-decoration: none; }

@media (max-width: 420px) { .grid { grid-template-columns: 1fr; } .greet { font-size: 24px; } .hero { padding: 18px; } }
@media (prefers-reduced-motion: reduce) { .card, .tile, .glass { transition: none; } .card:hover, .tile:hover, .glass:hover { transform: none; } .spin .ic { animation: none; } }
.rows-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.t, .d { unicode-bidi: plaintext; }
