/* NW BID web — same design system as nworks-work.com (DESIGN-1 tokens from merged/public/styles.css):
   blue gradient page, white rounded shell, light-blue pill sidebar, Poppins + Pretendard, 6px cards. */
:root{color-scheme:light;--bg:#f6f8fb;--panel:#fff;--line:#eceef3;--text:#1f2a3d;--muted:#667085;--accent:#3577c8;--accent2:#eaf3fd;
  --green:#2a7d56;--red:#b5474a;--link:#2f6fc0;--blue:#4a90e2;--ink:#111;--icon:#2b3a55;--field-line:#dfe3ea;--shadow:0 2px 8px rgba(0,0,0,.06);
  --font:Poppins,"Pretendard Variable",Pretendard,-apple-system,BlinkMacSystemFont,"Apple SD Gothic Neo","Noto Sans KR","Malgun Gothic",system-ui,sans-serif}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;min-height:100vh;background:linear-gradient(135deg,#5c9fe3 0%,#6fa2d8 55%,#7ea4cb 100%) fixed;color:var(--text);font-family:var(--font);-webkit-font-smoothing:antialiased;font-size:14px}
button,input,select,textarea{font:inherit;font-family:var(--font)}
a{color:var(--link)}
[hidden]{display:none!important}
.nw-ico{width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;vertical-align:-3px}

/* shell */
.shell{display:grid;grid-template-columns:112px minmax(0,1fr);min-height:calc(100vh - 28px);margin:14px;background:#fff;border-radius:28px;box-shadow:0 18px 50px rgba(28,72,140,.18)}
.sidebar{position:sticky;top:14px;align-self:start;height:calc(100vh - 56px);margin:14px 0 14px 14px;padding:16px 8px 14px;background:linear-gradient(180deg,#73c0ee 0%,#6cb2ed 100%);border-radius:40px;color:#fff;display:flex;flex-direction:column;gap:10px;overflow:hidden}
.brand{display:flex;justify-content:center;padding:0 0 6px}
.brand img{width:40px;height:40px;border-radius:50%;background:#fff;padding:5px}
#nav{flex:1;min-height:0;display:flex;flex-direction:column;gap:2px;overflow-y:auto;scrollbar-width:none}
#nav::-webkit-scrollbar{display:none}
.nav-btn{display:flex;align-items:center;gap:7px;width:100%;min-height:38px;padding:7px 9px;border:0;border-radius:14px;background:transparent;color:#fff;font-size:11px;font-weight:500;line-height:1.2;text-align:left;white-space:nowrap;cursor:pointer;text-decoration:none}
.nav-lbl{white-space:normal;word-break:keep-all}
.nav-btn .nw-ico{width:18px;height:18px;stroke:#fff;stroke-width:2}
.nav-btn:hover{background:rgba(255,255,255,.14)}
.nav-btn.active{background:rgba(255,255,255,.22);font-weight:600}
.nav-btn.settings{margin-top:auto}
.side-status{font-size:10px;line-height:1.5;color:#eaf6ff;padding:8px 6px 0;border-top:1px solid rgba(255,255,255,.3)}
.side-status b{font-weight:600}
main{min-width:0;display:flex;flex-direction:column}
.topbar{position:sticky;top:0;z-index:6;display:flex;align-items:center;justify-content:space-between;gap:12px 20px;flex-wrap:wrap;padding:22px 32px 10px 28px;background:rgba(255,255,255,.95);backdrop-filter:blur(6px);border-radius:0 28px 0 0}
.nw-hello{margin:0;font-size:24px;font-weight:700;color:var(--ink);letter-spacing:-.02em;line-height:1.2}
.nw-crumb{display:flex;align-items:baseline;gap:4px;margin-top:3px;font-size:12px;color:var(--muted)}
.nw-crumb h1{display:inline;margin:0;font-size:12px;font-weight:600;color:var(--accent)}
.top-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
#view{flex:1;padding:8px 32px 36px 28px;min-width:0}
.nw-foot{margin:0 32px 0 28px;padding:14px 0 22px;border-top:1px solid var(--line);font-size:12px;color:var(--muted);line-height:1.6}

/* text, buttons */
h2,h3,h4{color:var(--ink);letter-spacing:-.02em}
.hero{display:flex;justify-content:space-between;align-items:flex-end;gap:16px;margin:6px 0 18px;flex-wrap:wrap}
.hero h2{font-size:20px;font-weight:700;margin:2px 0 6px}
.hero p{margin:0;color:#5b6475;line-height:1.55}
.eyebrow{color:var(--accent);font-size:11px;font-weight:600;letter-spacing:.08em}
.muted{color:var(--muted)}
.small{font-size:12px}
button,.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:36px;padding:8px 14px;background:#fff;color:var(--icon);border:1px solid var(--field-line);border-radius:8px;cursor:pointer;text-decoration:none;font-size:13px;line-height:1.2}
button:hover,.btn:hover{background:#f3f7fc}
button:disabled{opacity:.55;cursor:not-allowed}
.primary,.primary:hover{background:linear-gradient(135deg,#4f97e4,#3c82d6);border-color:#3c82d6;color:#fff;font-weight:600}
.ghost{background:#f3f4f6;border-color:transparent;color:#4b5565}
.danger{color:var(--red);border-color:#efd3d4}
.wide{width:100%}
.btn-row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.btn-row.grow>*{flex:1 1 180px}

/* cards, grid */
.grid{display:grid;gap:18px}
.kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:18px}
.kpi{background:#fff;border:1px solid #eef0f4;border-radius:6px;box-shadow:var(--shadow);padding:16px 18px;min-height:96px;display:flex;flex-direction:column;justify-content:space-between}
.kpi small{color:var(--muted);font-size:12px}
.kpi strong{font-size:24px;font-weight:700;color:var(--ink);letter-spacing:-.02em}
.kpis>.kpi:first-child{background:linear-gradient(135deg,#72c2ec,#6eb4f0);border-color:transparent}
.kpis>.kpi:first-child small,.kpis>.kpi:first-child strong{color:#fff}
.card{background:#fff;border:1px solid #eef0f4;border-radius:6px;box-shadow:var(--shadow);padding:18px;margin-bottom:18px;min-width:0}
.card>h3,.card-head h3{font-size:15px;font-weight:700;margin:0 0 12px}
.card-head{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:10px}
.card-head h3{margin:0}
.card-head select{width:auto;min-width:130px}
.two{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px}
.callout{background:#f2f7fd;border:1px solid #d6e6f8;color:#24456e;border-radius:6px;padding:10px 12px;font-size:13px;line-height:1.55;margin:8px 0}
.callout.warn{background:#fff8ec;border-color:#f3dcb4;color:#7a4a12}
.callout.danger{background:#fdf4f4;border-color:#efd3d4;color:#8c3436}
.callout.ok{background:#eef8f2;border-color:#cde8d8;color:#1f5e40}
.pill{display:inline-flex;align-items:center;padding:3px 8px;border-radius:999px;background:#eef3fa;color:#3d5a80;font-size:11px;white-space:nowrap}
.pill.blue{background:#e3eefc;color:#245ea8}
.pill.green{background:#e8f5ee;color:#1f6a47}
.pill.red{background:#fbecec;color:#9c3a3d}
.pill.amber{background:#fff3df;color:#8a5410}
.pill.gray{background:#f1f2f5;color:#596172}
.score{display:inline-grid;grid-template-columns:34px 60px;align-items:center;gap:6px}
.score b{font-weight:700;text-align:right}
.bar{height:6px;background:#e8eef7;border-radius:99px;overflow:hidden}
.bar span{display:block;height:100%;background:linear-gradient(90deg,#9fd0f5,#63a4f0)}

/* forms */
.fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px 14px;margin-bottom:12px}
.field{display:grid;gap:5px;min-width:0}
.field.span2{grid-column:span 2}
.field.full{grid-column:1/-1}
.field label,.lbl{font-size:12px;color:var(--muted)}
input[type=text],input[type=password],input[type=number],input[type=date],input[type=search],input[type=url],select,textarea{width:100%;min-height:38px;padding:8px 10px;border:1px solid var(--field-line);border-radius:8px;background:#fff;color:var(--text);font-size:14px}
textarea{min-height:90px;resize:vertical;line-height:1.55}
input:focus,select:focus,textarea:focus{outline:2px solid #bcd8f6;border-color:#8fbbec}
.check{display:flex;gap:8px;align-items:flex-start;font-size:13px;line-height:1.45;cursor:pointer}
.check input{margin-top:2px;width:16px;height:16px;flex:none}
.hint{font-size:11.5px;color:var(--muted)}
details.more{border:1px solid var(--line);border-radius:6px;padding:10px 12px;margin:10px 0;background:#fbfcfe}
details.more>summary{cursor:pointer;color:var(--accent);font-weight:600;font-size:13px}
details.more[open]>summary{margin-bottom:10px}
.chips{display:flex;gap:6px;flex-wrap:wrap}
.chip{border:0;background:#e3e3e3;color:#595f6b;border-radius:6px;min-height:32px;padding:6px 11px;font-size:12px}
.chip.active{background:linear-gradient(135deg,#6aa3e3,#5995d8);color:#fff}
.tabs{display:flex;gap:6px;flex-wrap:wrap;margin:6px 0 14px}
.tabs button{border:0;background:#e3e3e3;color:#595f6b;border-radius:6px}
.tabs button.active{background:linear-gradient(135deg,#6aa3e3,#5995d8);color:#fff;font-weight:600}

/* tables */
.table-wrap{overflow:auto;max-height:520px;border:1px solid #eef0f4;border-radius:6px}
table{width:100%;border-collapse:collapse;font-size:13px}
th,td{padding:9px 10px;border-bottom:1px solid #eef0f4;text-align:left;vertical-align:top}
th{position:sticky;top:0;background:#fafbfd;color:#7a8394;font-weight:500;white-space:nowrap;z-index:1}
td.num,th.num{text-align:right;white-space:nowrap}
td.nowrap{white-space:nowrap}
td.title{min-width:220px;max-width:460px}
tr.sel td{background:#eef5fd}
tbody tr.clickable{cursor:pointer}
tbody tr.clickable:hover td{background:#f5f9fe}
.empty{text-align:center;padding:34px 10px;color:var(--muted)}
.codebox{background:#f5f7fb;color:var(--icon);border-radius:6px;padding:10px;font-size:12.5px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}
.selected-card{border-left:3px solid var(--accent)}
.metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin:10px 0}
.metric{border:1px solid var(--line);border-radius:6px;padding:10px 12px}
.metric small{display:block;color:var(--muted);font-size:11.5px}
.metric b{display:block;font-size:17px;margin-top:3px;overflow-wrap:anywhere}
.reason{padding:8px 0;border-bottom:1px dashed var(--line);font-size:13px;line-height:1.55}
.reason:last-child{border-bottom:0}

/* progress / toast / login */
.job{border:1px solid #d6e6f8;background:#f5f9fe;border-radius:6px;padding:10px 12px;margin:10px 0;font-size:13px}
.job .bar{height:8px;margin-top:6px}
#toast{position:fixed;right:20px;bottom:20px;max-width:min(420px,calc(100vw - 40px));background:#2b3a55;color:#fff;font-weight:600;padding:11px 14px;border-radius:10px;opacity:0;transform:translateY(10px);transition:.2s;pointer-events:none;z-index:20;font-size:13px;line-height:1.5}
#toast.show{opacity:1;transform:none}
#toast.err{background:#9c3a3d}
.login{min-height:100vh;display:grid;place-items:center;padding:16px}
.login main{width:100%;max-width:420px;background:#fff;border-radius:28px;padding:40px 32px 28px;text-align:center;box-shadow:0 20px 60px rgba(30,70,140,.25)}
.login .badge{width:84px;height:84px;margin:0 auto 18px;border-radius:24px;background:linear-gradient(180deg,#73c0ee,#6cb2ed);display:grid;place-items:center}
.login .badge img{width:58px;height:58px;object-fit:contain;border-radius:14px;background:#fff;padding:5px}
.login h1{font-size:22px;font-weight:800;margin:0 0 8px;color:#111}
.login p{color:#8a8f98;margin:0 0 20px;font-size:14px;line-height:1.6}
.login input{margin-bottom:12px;text-align:center}
.login button{width:100%;min-height:46px;font-size:15px}
.login .msg{color:#c0392b;font-size:13px;margin:10px 0 0;min-height:1em}
.login .foot{margin-top:18px;font-size:12px;color:#a3a8b0}
.skeleton{height:14px;border-radius:6px;background:linear-gradient(90deg,#eef2f7 25%,#f7f9fc 50%,#eef2f7 75%);background-size:200% 100%;animation:sk 1.1s infinite linear;margin:8px 0}
@keyframes sk{to{background-position:-200% 0}}

/* ---------- responsive ---------- */
/* Galaxy Fold unfolded (~673-884px) and tablets: icon sidebar, 2-col KPIs */
@media (max-width:1050px){
  .shell{grid-template-columns:76px minmax(0,1fr)}
  .nav-btn{flex-direction:column;gap:3px;font-size:10px;padding:8px 2px;text-align:center;white-space:normal}
  .side-status{display:none}
  .kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .two{grid-template-columns:1fr}
  #view{padding:8px 20px 30px 18px}
  .topbar{padding:18px 20px 10px 18px}
  .nw-foot{margin:0 20px 0 18px}
}
/* phones and Galaxy Fold folded (~344-412px): top tab bar, card tables */
@media (max-width:700px){
  body{background:#fff}
  .shell{display:block;margin:0;border-radius:0;box-shadow:none;min-height:100vh}
  .sidebar{position:sticky;top:0;z-index:8;height:auto;margin:0;border-radius:0 0 18px 18px;padding:8px 8px;flex-direction:row;align-items:center;gap:6px}
  .brand{padding:0}
  .brand img{width:32px;height:32px}
  #nav{flex-direction:row;overflow-x:auto;gap:4px}
  .nav-btn{flex:none;width:auto;flex-direction:row;font-size:12px;min-height:36px;padding:8px 10px;white-space:nowrap}
  .nav-btn .nw-ico{width:16px;height:16px}
  .nav-btn.settings{margin-top:0}
  .topbar{position:static;border-radius:0;padding:14px 14px 6px}
  .nw-hello{font-size:19px}
  #view{padding:6px 12px 26px}
  .nw-foot{margin:0 12px}
  .kpis{gap:10px}
  .kpi{min-height:80px;padding:12px 14px}
  .kpi strong{font-size:20px}
  .card{padding:14px}
  .field.span2{grid-column:auto}
  .fields{grid-template-columns:1fr 1fr}
  /* card-style tables */
  .table-wrap{max-height:none;border:0}
  table.cards thead{display:none}
  table.cards,table.cards tbody,table.cards tr,table.cards td{display:block;width:100%}
  table.cards tr{border:1px solid #eef0f4;border-radius:8px;margin-bottom:10px;padding:6px 10px;box-shadow:var(--shadow);background:#fff}
  table.cards td{border:0;padding:4px 0;display:flex;justify-content:space-between;gap:12px;text-align:right;max-width:none;min-width:0}
  table.cards td::before{content:attr(data-label);color:var(--muted);font-size:12px;text-align:left;flex:none;max-width:42%}
  table.cards td.title{display:block;text-align:left;font-weight:600;font-size:14px;padding-top:6px}
  table.cards td.title::before{display:none}
  table.cards td:empty{display:none}
}
@media (max-width:420px){
  .kpis{grid-template-columns:1fr 1fr}
  .fields{grid-template-columns:1fr}
  .nw-hello{font-size:17px}
  .hero h2{font-size:18px}
  button,.btn{padding:8px 11px}
  .btn-row>button,.btn-row>.btn{flex:1 1 auto}
}
@media (max-width:300px){ .kpis{grid-template-columns:1fr} }
@media (max-width:700px){ .nav-lbl{white-space:nowrap} }
