@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable.css');

/* ===== Design tokens ===== */
:root{
  /* neutral surfaces */
  --bg:#e9edf2; --surface:#ffffff; --surface-2:#f3f6f9; --surface-3:#eef2f6;
  --border:#e3e8ee; --border-strong:#d3dbe4;
  --text:#1f2a33; --muted:#6a7683; --heading:#22303c; --faint:#95a1ad;

  /* brand fills (white text sits on these — stay deep in both themes) */
  --maj:#2f6088; --table-head:#28527a; --gold:#c0872b;
  --hero-from:#2f6088; --hero-to:#2f6340;

  /* accent text (flips light/dark) */
  --maj2:#28527a; --edu2:#2f6340; --good:#2f8f56;

  /* phase palette (saturated pills / stripes) */
  --ph-0:#c0872b; --ph-1:#4a86c0; --ph-2:#2f6088; --ph-3:#5b6fae; --ph-4:#8a5487;

  /* soft status tints  (bg / fg pairs) */
  --t-good-bg:#e5f3ea; --t-good-fg:#2f8f56;
  --t-gold-bg:#faf0dc; --t-gold-fg:#a06e1e;
  --t-blue-bg:#e7eff7; --t-blue-fg:#2f6088;
  --t-red-bg:#f9e9e8;  --t-red-fg:#bb4b48;
  --t-tan-bg:#f6ecdd;  --t-tan-fg:#a5641f;
  --t-gray-bg:#eef1f4; --t-gray-fg:#6a7683;

  --now:#2f6088;
  --shadow-sm:0 1px 2px rgba(20,30,45,.06);
  --shadow:0 10px 30px -14px rgba(20,30,45,.28);
  --shadow-lg:0 20px 45px -20px rgba(20,30,45,.35);
  --radius:16px; --radius-lg:20px; --radius-sm:11px;
  --maxw:1000px;
}
:root[data-theme="dark"]{
  --bg:#0d131a; --surface:#161f29; --surface-2:#1b2733; --surface-3:#202d3a;
  --border:#27333f; --border-strong:#35434f;
  --text:#dde5ed; --muted:#93a1b0; --heading:#e9f1f8; --faint:#71808f;

  --maj:#3d78a8; --table-head:#2b4f70; --gold:#cf9a45;
  --hero-from:#274f6f; --hero-to:#274f42;

  --maj2:#83b4dc; --edu2:#7cc79b; --good:#57bd82;

  --ph-0:#d6a153; --ph-1:#5f9ad0; --ph-2:#5f9ad0; --ph-3:#8494cf; --ph-4:#b47caf;

  --t-good-bg:rgba(87,189,130,.14); --t-good-fg:#68c98f;
  --t-gold-bg:rgba(207,154,69,.15); --t-gold-fg:#d9a95e;
  --t-blue-bg:rgba(95,154,208,.15); --t-blue-fg:#7db2df;
  --t-red-bg:rgba(203,90,86,.16);  --t-red-fg:#e58480;
  --t-tan-bg:rgba(181,110,45,.16); --t-tan-fg:#d59a5c;
  --t-gray-bg:rgba(255,255,255,.06); --t-gray-fg:#9aa7b4;

  --now:#5f9ad0;
  --shadow-sm:0 1px 2px rgba(0,0,0,.4);
  --shadow:0 10px 30px -14px rgba(0,0,0,.6);
  --shadow-lg:0 20px 45px -20px rgba(0,0,0,.7);
}

/* ===== base ===== */
*{box-sizing:border-box;margin:0;padding:0}
html{color-scheme:light dark}
body{
  font-family:'Pretendard Variable','Pretendard','Malgun Gothic',system-ui,-apple-system,sans-serif;
  color:var(--text);background:var(--bg);line-height:1.55;
  -webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;
  transition:background .25s ease,color .25s ease;
}
a{color:inherit;text-decoration:none}
::selection{background:rgba(47,96,136,.22)}

/* ===== top nav ===== */
.nav{
  position:sticky;top:0;z-index:50;
  background:color-mix(in srgb,var(--surface) 82%,transparent);
  backdrop-filter:saturate(1.4) blur(12px);
  -webkit-backdrop-filter:saturate(1.4) blur(12px);
  border-bottom:1px solid var(--border);
}
.nav-in{max-width:var(--maxw);margin:0 auto;display:flex;align-items:center;gap:14px;
  padding:11px 16px;flex-wrap:wrap}
.brand{display:flex;align-items:center;gap:8px;font-weight:800;font-size:15px;color:var(--heading);white-space:nowrap}
.brand .logo{width:26px;height:26px;border-radius:8px;display:grid;place-items:center;
  background:linear-gradient(135deg,var(--maj),var(--edu2));color:#fff;font-size:14px}
.nav-links{display:flex;gap:2px;margin-left:6px;overflow-x:auto;flex:1;scrollbar-width:none}
.nav-links::-webkit-scrollbar{display:none}
.nav-links a{font-size:13px;font-weight:600;color:var(--muted);padding:7px 12px;border-radius:9px;
  white-space:nowrap;transition:.15s}
.nav-links a:hover{color:var(--heading);background:var(--surface-2)}
.nav-links a.active{color:var(--maj2);background:var(--t-blue-bg)}
.nav-actions{display:flex;gap:7px;align-items:center;margin-left:auto}
.iconbtn{width:34px;height:34px;border-radius:10px;border:1px solid var(--border);
  background:var(--surface);color:var(--muted);cursor:pointer;font-size:15px;display:grid;place-items:center;transition:.15s}
.iconbtn:hover{color:var(--heading);border-color:var(--border-strong)}
.logout{font-size:12.5px;font-weight:700;color:var(--muted);border:1px solid var(--border);
  background:var(--surface);border-radius:10px;padding:0 13px;height:34px;cursor:pointer;transition:.15s}
.logout:hover{color:var(--t-red-fg);border-color:var(--border-strong)}

/* ===== layout ===== */
.wrap{max-width:var(--maxw);margin:0 auto;padding:22px 16px 72px}
.hero{background:linear-gradient(135deg,var(--hero-from),var(--hero-to));color:#fff;
  border-radius:var(--radius-lg);padding:26px 26px;box-shadow:var(--shadow);position:relative;overflow:hidden}
.hero::after{content:'';position:absolute;right:-60px;top:-60px;width:220px;height:220px;
  background:radial-gradient(circle,rgba(255,255,255,.14),transparent 70%);pointer-events:none}
.hero h1{font-size:21px;font-weight:800;letter-spacing:-.2px}
.hero .sub{opacity:.92;font-size:12.5px;margin-top:6px;max-width:640px}
.hero-row{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;flex-wrap:wrap}
.dday{text-align:right;flex:none}
.dday .n{font-size:34px;font-weight:800;line-height:1}
.dday .l{font-size:11px;opacity:.9;margin-top:2px}

.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-top:18px}
.kpi{background:rgba(255,255,255,.13);border:1px solid rgba(255,255,255,.16);border-radius:13px;padding:11px 13px}
.kpi .l{font-size:10.5px;opacity:.88} .kpi .v{font-size:18px;font-weight:800;margin-top:3px}
.kpi .v small{font-size:11px;font-weight:600;opacity:.8}

/* section heads */
h2.sec{font-size:15px;margin:26px 3px 12px;color:var(--maj2);display:flex;align-items:center;gap:8px;letter-spacing:-.2px}
h2.sec::before{content:'';width:5px;height:17px;background:var(--maj);border-radius:3px}

.grid2{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.card,.panel{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);
  padding:16px 18px;box-shadow:var(--shadow-sm)}
.panel h3{font-size:13px;margin-bottom:9px;color:var(--maj2)}
.panel h3.e{color:var(--edu2)}
.panel ul{list-style:none}
.panel li{font-size:12.5px;padding:6px 0 6px 15px;position:relative;border-bottom:1px dashed var(--border)}
.panel li:last-child{border:0}
.panel li::before{content:'';position:absolute;left:2px;top:12px;width:5px;height:5px;border-radius:50%;background:var(--maj)}
.panel.e li::before{background:var(--edu2)}
.panel b{color:var(--heading)}

/* chips */
.chips{display:flex;flex-wrap:wrap;gap:7px}
.chip{font-size:11.5px;font-weight:700;border-radius:999px;padding:5px 12px;border:1px solid transparent}
.chip.c{background:var(--t-good-bg);color:var(--t-good-fg)}
.chip.b{background:var(--t-red-bg);color:var(--t-red-fg)}
.chip.g{background:var(--t-gray-bg);color:var(--t-gray-fg)}

/* checklist / principles */
.prin{list-style:none}
.prin li{font-size:12.5px;padding:8px 0 8px 26px;position:relative;border-bottom:1px dashed var(--border)}
.prin li:last-child{border:0}
.prin li::before{content:'✓';position:absolute;left:4px;top:7px;color:#fff;background:var(--maj);
  width:16px;height:16px;border-radius:50%;font-size:10px;display:grid;place-items:center;font-weight:800}
.prin b{color:var(--heading)}

/* tables */
.tbl-wrap{overflow-x:auto;border-radius:var(--radius);box-shadow:var(--shadow-sm);border:1px solid var(--border)}
table{width:100%;border-collapse:collapse;background:var(--surface);font-size:12.5px;min-width:560px}
th,td{padding:10px 11px;border-bottom:1px solid var(--border);text-align:left;vertical-align:top}
thead th{background:var(--table-head);color:#fff;font-size:11px;font-weight:700;position:sticky;top:0}
tbody tr:last-child td{border-bottom:0}
tbody tr:hover{background:var(--surface-2)}

/* soft status badges (books page) */
.bd{font-size:10.5px;font-weight:800;border-radius:6px;padding:3px 8px;white-space:nowrap;display:inline-block}
.bd.kp{background:var(--t-good-bg);color:var(--t-good-fg)}
.bd.ck{background:var(--t-gold-bg);color:var(--t-gold-fg)}
.bd.tr{background:var(--t-tan-bg);color:var(--t-tan-fg)}
.bd.ms{background:var(--t-red-bg);color:var(--t-red-fg)}

/* note box */
.note,.foot{margin-top:16px;font-size:12px;color:var(--muted);background:var(--surface-2);
  border:1px solid var(--border);border-radius:var(--radius-sm);padding:15px 17px;line-height:1.85}
.note b,.foot b{color:var(--heading)}

/* buttons */
.btn{border:1px solid var(--border);background:var(--surface);color:var(--maj2);border-radius:10px;
  padding:8px 14px;font-weight:700;font-size:12.5px;cursor:pointer;transition:.15s}
.btn:hover{border-color:var(--border-strong);background:var(--surface-2)}

@media(max-width:820px){
  .grid2{grid-template-columns:1fr}
  .kpis{grid-template-columns:repeat(2,1fr)}
  .hero h1{font-size:19px}
}
