:root {
  --navy: #0b1d4d;
  --navy-2: #13307a;
  --ink: #0e1a3a;
  --muted: #5b6785;
  --line: #dfe7f5;
  --bg: #eef4ff;
  --card: #ffffff;
  --gold: #f4b52c;
  --gold-2: #e39b12;
  --gold-soft: #fff4d8;
  --blue: #1f8bf0;
  --cyan: #38c8f4;
  --blue-soft: #e4f2ff;
  --green: #17a36b;
  --green-soft: #e1f7ee;
  --amber: #c77d00;
  --amber-soft: #fff1d6;
  --red: #d64545;
  --red-soft: #fde8e8;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(11, 29, 77, .06), 0 6px 20px rgba(11, 29, 77, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.hide { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.center { text-align: center; }

.boot { min-height: 100vh; display: grid; place-items: center; background: var(--navy); }
.boot img { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.94); opacity: .7; } }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 11px 18px; font-weight: 600; cursor: pointer;
  background: var(--navy); color: #fff; text-decoration: none; min-height: 44px; transition: transform .08s, filter .15s;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: scale(.98); }
.btn.gold { background: linear-gradient(135deg, #ffd36b, var(--gold) 45%, var(--gold-2)); color: var(--navy); }
.btn.light { background: var(--blue-soft); color: var(--navy); }
.btn.ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--line); }
.btn.wa { background: #1fae5b; color: #fff; }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.sm { padding: 7px 12px; min-height: 36px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: default; }
.link-btn { background: none; border: 0; color: var(--blue); cursor: pointer; padding: 4px; font-weight: 600; }

label.f { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
label.f > span { display: block; margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=time],
input[type=number], input[type=url], input[type=search], select, textarea {
  width: 100%; border: 1.5px solid var(--line); background: #fff; border-radius: 12px;
  padding: 11px 13px; min-height: 46px; outline: none; transition: border-color .15s;
  color: var(--ink); font-weight: 500;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31, 139, 240, .15); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- auth ---------- */
.auth {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr;
  background: radial-gradient(1200px 600px at 10% 0%, #1a3b8f 0%, var(--navy) 55%, #071433 100%);
}
.auth-hero { color: #fff; padding: 56px 48px; display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.auth-hero .crest { width: 150px; filter: drop-shadow(0 10px 30px rgba(56, 200, 244, .35)); }
.pill-gold { display: inline-block; background: var(--gold); color: var(--navy); font-weight: 800; font-size: 11px; letter-spacing: .12em; padding: 6px 12px; border-radius: 99px; text-transform: uppercase; }
.auth-hero h1 { font-size: 46px; line-height: 1.05; }
.auth-hero h1 .hl { background: linear-gradient(90deg, var(--cyan), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-hero p { color: #c8d6f5; font-size: 16px; max-width: 460px; margin: 0; }
.auth-hero .stats { display: flex; gap: 10px; flex-wrap: wrap; }
.auth-hero .stat { border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.05); border-radius: 12px; padding: 8px 14px; text-align: center; }
.auth-hero .stat b { display: block; color: var(--gold); font-size: 20px; }
.auth-hero .stat span { font-size: 12px; color: #c8d6f5; }
.auth-panel { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 440px; background: #fff; border-radius: 22px; padding: 26px; box-shadow: 0 30px 60px rgba(0,0,0,.3); }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.seg button { border: 0; background: transparent; padding: 10px; border-radius: 9px; font-weight: 600; cursor: pointer; color: var(--muted); }
.seg button.on { background: #fff; color: var(--navy); box-shadow: var(--shadow); }
.err { background: var(--red-soft); color: var(--red); padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 500; }
.byline { color: #8ea3d6; font-size: 12px; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 32px 20px 4px; text-align: center; align-items: center; gap: 14px; }
  .auth-hero .crest { width: 96px; }
  .auth-hero h1 { font-size: 34px; }
  .auth-hero .stats { justify-content: center; }
  .auth-hero .desk { display: none; }
}

/* ---------- shell ---------- */
.top {
  position: sticky; top: 0; z-index: 20; background: var(--navy); color: #fff;
  padding: 10px 20px; display: flex; align-items: center; gap: 12px;
}
.top .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.top .brand img { width: 34px; height: auto; }
.top .brand b { font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
.top .brand small { display: block; color: #8ea3d6; font-size: 11px; font-weight: 500; margin-top: -2px; }
.top nav { display: flex; gap: 4px; margin-left: 18px; }
.top nav a { color: #c8d6f5; text-decoration: none; padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 14px; position: relative; }
.top nav a.on { background: rgba(255,255,255,.1); color: #fff; }
.top nav a.on::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 3px; border-radius: 3px; background: var(--gold); }
.me-btn { margin-left: auto; display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.08); border: 0; color: #fff; border-radius: 99px; padding: 4px 12px 4px 4px; cursor: pointer; text-decoration: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: linear-gradient(135deg, var(--cyan), var(--blue)); color: #fff; flex: none; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }
.badge-dot { background: var(--gold); color: var(--navy); border-radius: 99px; font-size: 11px; font-weight: 800; padding: 0 6px; margin-left: 4px; }

main { max-width: 1060px; margin: 0 auto; padding: 22px 20px 110px; }
.bottom-nav { display: none; }
@media (max-width: 760px) {
  .top { padding: 10px 16px; }
  .top nav { display: none; }
  main { padding: 16px 16px 110px; }
  .bottom-nav {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: #fff; border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; padding: 6px 0; border-radius: 12px; }
  .bottom-nav a svg { width: 22px; height: 22px; }
  .bottom-nav a.on { color: var(--navy); background: var(--gold-soft); }
  .me-btn span.nm { display: none; }
  .me-btn { padding: 4px; }
}

/* ---------- cards ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card, .card + .section, .section + .card, .section + .section { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.cols > .card + .card { margin-top: 0; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } .cols > .card + .card { margin-top: 0; } }

/* hero */
.hero {
  background: radial-gradient(700px 300px at 100% 0%, #1f4fbf 0%, var(--navy) 60%); color: #fff; border-radius: 20px;
  padding: 20px; display: flex; gap: 18px; align-items: center; box-shadow: var(--shadow);
}
.hero .rank-img { width: 76px; height: 76px; object-fit: contain; flex: none; filter: drop-shadow(0 6px 16px rgba(56,200,244,.35)); }
.hero h1 { font-size: 24px; }
.hero .sub { color: #c8d6f5; font-size: 14px; }
.hero .gold { color: var(--gold); font-weight: 700; }
.bar { height: 10px; border-radius: 99px; background: rgba(255,255,255,.14); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--cyan), var(--gold)); }
.bar.light { background: var(--line); }
.hero .day-big { margin-left: auto; text-align: right; flex: none; }
.hero .day-big b { display: block; font-size: 34px; font-weight: 800; line-height: 1; color: var(--gold); }
.hero .day-big span { font-size: 12px; color: #c8d6f5; }
@media (max-width: 560px) {
  .hero { flex-wrap: wrap; gap: 12px; }
  .hero .rank-img { width: 56px; height: 56px; }
  .hero h1 { font-size: 20px; }
  .hero .day-big b { font-size: 26px; }
}

/* checklist */
.check { display: flex; align-items: flex-start; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.check:last-child { border-bottom: 0; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box { width: 24px; height: 24px; flex: none; border: 2px solid #b8c7e6; border-radius: 7px; display: grid; place-items: center; margin-top: 1px; transition: all .15s; background: #fff; }
.check .box svg { width: 15px; height: 15px; opacity: 0; color: #fff; }
.check input:checked + .box { background: var(--green); border-color: var(--green); }
.check input:checked + .box svg { opacity: 1; }
.check input:focus-visible + .box { box-shadow: 0 0 0 3px rgba(31,139,240,.3); }
.check .txt { flex: 1; min-width: 0; }
.check input:checked ~ .txt .t { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(91,103,133,.4); }
.check .open { font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; background: var(--blue-soft); padding: 3px 9px; border-radius: 99px; color: var(--navy-2); }

.part { border-radius: 14px; padding: 14px 14px 6px; }
.part + .part { margin-top: 12px; }
.part.morning { background: linear-gradient(180deg, #fff8e6, #fff2cf); }
.part.day { background: var(--blue-soft); }
.part.night { background: var(--navy); color: #fff; }
.part.night .check { border-color: rgba(255,255,255,.12); }
.part.night .box { background: transparent; border-color: rgba(255,255,255,.4); }
.part.night .check input:checked ~ .txt .t { color: #9fb2de; }
.part .part-h { display: flex; justify-content: space-between; font-weight: 700; }
.part .part-h small { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .75; }

/* todo */
.todo { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.todo .x { margin-left: auto; background: none; border: 0; color: #a3afc9; cursor: pointer; font-size: 20px; line-height: 1; padding: 4px 8px; }
.add-row { display: flex; gap: 8px; margin-top: 10px; }
.add-row input { flex: 1; }

/* chips / stage picker */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
.chip { flex: none; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 7px 12px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); text-align: left; }
.chip b { display: block; color: var(--ink); font-size: 13px; }
.chip.on { border-color: var(--navy); background: var(--navy); color: #c8d6f5; }
.chip.on b { color: #fff; }
.chip.done { border-color: var(--green); }
.chip.now:not(.on) { border-color: var(--gold); }

.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.pill.on-track, .pill.graduated { background: var(--green-soft); color: var(--green); }
.pill.watch { background: var(--amber-soft); color: var(--amber); }
.pill.behind { background: var(--red-soft); color: var(--red); }
.pill.not-started { background: #eef1f7; color: var(--muted); }
.pill.role { background: var(--gold-soft); color: #8a5a00; text-transform: capitalize; }
.pill.blue { background: var(--blue-soft); color: var(--navy-2); }

/* dots (last 7 days) */
.dots { display: flex; gap: 4px; }
.dots i { width: 12px; height: 12px; border-radius: 4px; background: #e4e9f3; display: block; }
.dots i.l1 { background: #bfe0ff; } .dots i.l2 { background: #67b6f7; } .dots i.l3 { background: var(--blue); } .dots i.l4 { background: var(--green); }

/* messages */
.msg { border-left: 4px solid var(--gold); background: var(--gold-soft); border-radius: 12px; padding: 12px 14px; }
.msg + .msg { margin-top: 10px; }
.msg .from { font-size: 12px; font-weight: 700; color: #8a5a00; }

/* meeting */
.meet { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.meet:last-child { border-bottom: 0; }
.cal { width: 54px; flex: none; border-radius: 12px; overflow: hidden; text-align: center; background: #fff; border: 1.5px solid var(--line); }
.cal small { display: block; background: var(--navy); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 0; text-transform: uppercase; }
.cal b { display: block; font-size: 20px; padding: 2px 0; }
.next-meet { background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; }
.next-meet .muted { color: #c8d6f5; }

/* stats tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { background: #fff; border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); border: 2px solid transparent; cursor: pointer; text-align: left; }
.tile.on { border-color: var(--navy); }
.tile b { display: block; font-size: 26px; font-weight: 800; line-height: 1.1; }
.tile span { font-size: 13px; color: var(--muted); font-weight: 600; }
.tile.green b { color: var(--green); } .tile.amber b { color: var(--amber); } .tile.red b { color: var(--red); } .tile.gold b { color: var(--gold-2); }

/* team list */
.person { display: grid; grid-template-columns: 44px 1.6fr 1.3fr 1fr auto; gap: 14px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; text-decoration: none; color: inherit; }
.person:hover { background: #f7faff; }
.person:last-child { border-bottom: 0; }
.person .avatar { width: 40px; height: 40px; }
.person .name { font-weight: 700; }
@media (max-width: 760px) {
  .person { grid-template-columns: 40px 1fr auto; }
  .person .hide-m { display: none; }
}

/* table */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 8px 6px; border-bottom: 1.5px solid var(--line); }
.tbl td { padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.scroll-x { overflow-x: auto; }

/* resources */
.res { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.res:last-child { border-bottom: 0; }
.res .ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--blue-soft); color: var(--navy-2); flex: none; }
.res .ic svg { width: 20px; height: 20px; }
.res a.t { font-weight: 600; color: var(--ink); text-decoration: none; }
.res a.t:hover { color: var(--blue); }

/* month cards */
.month { border-radius: 16px; padding: 16px; background: #fff; box-shadow: var(--shadow); }
.month.now { outline: 2px solid var(--gold); }
.month .targets { margin: 8px 0 0; padding-left: 18px; font-size: 14px; }

.empty { text-align: center; color: var(--muted); padding: 22px 10px; font-size: 14px; }
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 600; margin-bottom: 12px; }

#toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: 14px;
  transition: all .25s; z-index: 100; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.date-nav { display: flex; align-items: center; gap: 6px; }
.date-nav button { width: 36px; height: 36px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-size: 16px; }
.date-nav button[disabled] { opacity: .35; cursor: default; }

.hit { display: flex; gap: 8px; }
.hit button { flex: 1; border: 1.5px solid rgba(255,255,255,.25); background: transparent; color: #fff; border-radius: 10px; padding: 9px; cursor: pointer; font-weight: 600; }
.hit button.on { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.part.night textarea { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.18); color: #fff; min-height: 64px; }
.part.night textarea::placeholder { color: #8ea3d6; }
.part.night label.f { color: #c8d6f5; }

.footer-note { text-align: center; color: var(--muted); font-size: 12px; margin-top: 28px; }
.footer-note img { width: 22px; vertical-align: middle; margin-right: 4px; }
details.more summary { cursor: pointer; font-weight: 600; color: var(--blue); list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
