:root{
      --bg:#f6f8fb;
      --card:#ffffff;
      --text:#0f172a;
      --muted:#64748b;
      --line:#e5e7eb;
      --blue:#2563eb;
      --blue2:#1d4ed8;
      --red:#ef4444;
      --green:#16a34a;
      --amber:#f59e0b;
      --beige:#fff7e6;
      --beige2:#fff1d6;

--field:#fffdf6;
--fieldOpt:#f8fafc;
--fieldFocus:#ffffff;
--fieldDisabled:#f1f5f9;
--ring: 0 0 0 4px rgba(37,99,235,.12);
      --shadow: 0 10px 25px rgba(2,6,23,.06);
      --radius: 14px;
      --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
      --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Noto Sans KR", "Apple SD Gothic Neo", Arial, "Helvetica Neue", sans-serif;
    }

    html, body { height: 100%; }
    body{
      margin:0;
      font-family: var(--sans);
      background: var(--bg);
      color: var(--text);
    }

    .wrap{
      max-width: 1180px;
      margin: 0 auto;
      padding: 28px 16px 60px;
    }

    header{
      display:flex;
      flex-wrap:wrap;
      gap: 12px 16px;
      align-items:flex-end;
      justify-content:space-between;
      margin-bottom: 14px;
    }

    .title h1{
      margin:0;
      font-size: 24px;
      letter-spacing:-.4px;
    }
    .title p{
      margin:6px 0 0;
      color:var(--muted);
      font-size: 13px;
      line-height: 1.4;
    }

    .topbar{
      display:flex;
      gap:10px;
      flex-wrap:wrap;
      align-items:center;
      justify-content:flex-end;
    }

    .card{
      background: var(--card);
      border:1px solid var(--line);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      padding: 16px;
    }

    .grid{
      display:grid;
      grid-template-columns: 360px 1fr;
      gap: 14px;
      margin-top: 14px;
    }

    @media (max-width: 980px){
      .grid{ grid-template-columns: 1fr; }
    }

    .row{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
    .row.space{ justify-content: space-between; }

    label{
      font-size: 12px;
      color: var(--muted);
      display:block;
      margin-bottom:6px;
    }

    
input[type="text"], input[type="number"], input[type="date"], input[type="month"], select, textarea{
  width:100%;
  box-sizing:border-box;
  padding: 10px 10px;
  border:1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
  color:var(--text);
  outline:none;
  font-size: 14px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input.optional, select.optional, textarea.optional{
  background: var(--fieldOpt);
}
input:focus, select:focus, textarea:focus{
  border-color: rgba(37,99,235,.55);
  box-shadow: var(--ring);
  background: var(--fieldFocus);
}
input:disabled, select:disabled, textarea:disabled{
  background: var(--fieldDisabled);
  color:#94a3b8;
  cursor:not-allowed;
}
    input[type="number"]{ font-family: var(--mono); }

    textarea{ min-height: 72px; resize: vertical; }

    .btn{
      appearance:none;
      border:1px solid var(--line);
      background:#fff;
      color:var(--text);
      padding: 10px 12px;
      border-radius: 12px;
      cursor:pointer;
      font-weight: 700;
      font-size: 13px;
      line-height: 1;
      transition: transform .05s ease, border-color .15s ease, background .15s ease;
      user-select:none;
    }
    .btn:hover{ border-color:#cbd5e1; }
    .btn:active{ transform: translateY(1px); }

    .btn:disabled{
      opacity:.55;
      cursor:not-allowed;
      transform:none;
    }
    .btn:disabled:hover{ border-color: var(--line); }


    .btn.primary{
      background: var(--blue);
      border-color: var(--blue);
      color:#fff;
    }
    .btn.primary:hover{ background: var(--blue2); border-color: var(--blue2); }

    .btn.ghost{
      background:#fff;
      border-color: var(--line);
      color: var(--text);
    }

    .btn.danger{
      background:#fff;
      border-color:#fecaca;
      color:#b91c1c;
    }

    .pill{
      display:inline-flex;
      align-items:center;
      gap:8px;
      padding: 7px 10px;
      border-radius: 999px;
      background:#f1f5f9;
      border:1px solid var(--line);
      font-size: 12px;
      color: var(--muted);
    }

    .pill.good{ background:#f0fdf4; border-color:#bbf7d0; color:#166534; }
    .pill.warn{ background:#fffbeb; border-color:#fde68a; color:#92400e; }

    /* Guided steps */
    .stepBadge{
      display:inline-flex;
      align-items:center;
      justify-content:center;
      width: 18px;
      height: 18px;
      border-radius: 999px;
      background: rgba(37,99,235,.10);
      border:1px solid rgba(37,99,235,.35);
      color: var(--blue2);
      font-weight: 900;
      font-size: 11px;
      line-height: 1;
      margin-right: 6px;
      vertical-align: middle;
      flex: 0 0 auto;
    }

    .quickGuide{
      margin-top: 10px;
      display:flex;
      flex-wrap:wrap;
      gap: 8px;
      align-items:center;
    }
    .quickGuide .qs{
      display:inline-flex;
      align-items:center;
      gap: 6px;
      padding: 6px 10px;
      border-radius: 999px;
      border:1px solid var(--line);
      background:#fff;
      color: var(--muted);
      font-size: 12px;
      line-height: 1;
      user-select:none;
    }
    .quickGuide .stepBadge{ margin-right:0; }


    .kpi{
      display:grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
      margin-top: 12px;
    }
    @media (max-width: 980px){
      .kpi{ grid-template-columns: 1fr; }
    }
    .kpi .box{
      border:1px solid var(--line);
      border-radius: 14px;
      padding: 12px 12px;
      background: #fff;
    }
    .kpi .box.emph{ background: var(--beige); border-color: #fde68a; }
    .kpi .label{ font-size: 12px; color: var(--muted); }
    .kpi .value{ margin-top: 6px; font-size: 20px; font-weight: 900; letter-spacing:-.4px; }
    .kpi .sub{ margin-top: 6px; font-size: 12px; color: var(--muted); }

    .list{
      margin: 10px 0 0;
      padding:0;
      list-style:none;
      display:flex;
      flex-direction:column;
      gap: 8px;
    }

    .empItem{
      border:1px solid var(--line);
      border-radius: 14px;
      padding: 10px 10px;
      background:#fff;
      display:flex;
      gap:10px;
      align-items:center;
      justify-content:space-between;
      cursor:pointer;
    }
    .empItem.active{
      border-color: rgba(37,99,235,.35);
      box-shadow: 0 0 0 4px rgba(37,99,235,.12);
    }
    .empItem .name{
      font-weight: 900;
      letter-spacing:-.2px;
      margin:0;
      font-size: 14px;
    }
    .empItem .meta{
      margin:4px 0 0;
      color: var(--muted);
      font-size: 12px;
    }
    .empItem .right{
      text-align:right;
      color: var(--muted);
      font-size: 12px;
      min-width: 110px;
    }
    .empItem .right .money{
      color: var(--text);
      font-weight: 900;
      font-family: var(--mono);
      font-size: 12px;
    }

    .sectionTitle{
      display:flex;
      align-items:baseline;
      justify-content:space-between;
      gap:10px;
      margin:0 0 10px;
    }
    .sectionTitle h2{
      margin:0;
      font-size: 16px;
      letter-spacing:-.2px;
    }
    .sectionTitle .hint{
      color: var(--muted);
      font-size: 12px;
    }

    .split{
      display:grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
    }
    @media (max-width: 980px){
      .split{ grid-template-columns: 1fr; }
    }

    .mini{
      font-size: 12px;
      color: var(--muted);
      line-height: 1.5;
    }

    .hr{
      height:1px;
      background: var(--line);
      margin: 12px 0;
    }

    .tag{
      display:inline-flex;
      align-items:center;
      gap:8px;
      padding: 6px 10px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 800;
      border:1px solid var(--line);
      background:#fff;
    }
    .tag.good{ border-color:#bbf7d0; background:#f0fdf4; color:#166534; }
    .tag.bad{ border-color:#fecaca; background:#fef2f2; color:#991b1b; }
    .tag.warn{ border-color:#fde68a; background:#fffbeb; color:#92400e; }

    /* Calendar */
    .calWrap{
      border:1px solid var(--line);
      border-radius: 16px;
      overflow:hidden;
      background:#fff;
    }
    .calHead{
      display:flex;
      justify-content:space-between;
      align-items:center;
      padding: 10px 12px;
      background:#f8fafc;
      border-bottom:1px solid var(--line);
      gap:10px;
      flex-wrap:wrap;
    }
    .calHead .left{
      font-weight: 900;
      letter-spacing:-.2px;
    }
    .calGrid{
      display:grid;
      grid-template-columns: repeat(7, 1fr);
    }
    .calDow{
      padding: 8px 6px;
      font-size: 12px;
      color: var(--muted);
      text-align:center;
      background:#fff;
      border-bottom:1px solid var(--line);
    }
    .calCell{
      border-right: 1px solid var(--line);
      border-bottom: 1px solid var(--line);
      padding: 8px 8px;
      min-height: 78px;
      box-sizing:border-box;
    }
    .calCell:nth-child(7n){
      border-right: none;
    }
    .calCell .dateRow{
      display:flex;
      justify-content:space-between;
      align-items:center;
      gap:8px;
      margin-bottom: 8px;
    }
    .calCell .date{
      font-family: var(--mono);
      font-size: 12px;
      font-weight: 900;
      color: var(--text);
    }
    .calCell.outMonth .date{
      color: #94a3b8;
    }
    .calCell .badges{
      display:flex;
      gap:6px;
      align-items:center;
      justify-content:flex-end;
      flex-wrap:wrap;
    }
    .badge{
      font-size: 10px;
      padding: 4px 7px;
      border-radius: 999px;
      border:1px solid var(--line);
      color: var(--muted);
      background:#fff;
      white-space:nowrap;
    }
    .badge.scheduled{ background:#eff6ff; border-color:#bfdbfe; color:#1d4ed8; }
    .badge.holiday{ background:#fff7ed; border-color:#fed7aa; color:#9a3412; }
    .badge.employ{ background:#f0fdf4; border-color:#bbf7d0; color:#166534; }

    .calCell input.hours{
      width: 100%;
      padding: 9px 10px;
      border-radius: 12px;
      border:1px solid var(--line);
      background: var(--beige);
      font-family: var(--mono);
      font-weight: 800;
    }
    .calCell.outMonth input.hours{
      background:#fff;
      color:#64748b;
    }

    /* Weekly table */
    table{
      width:100%;
      border-collapse: collapse;
      font-size: 13px;
    }
    th, td{
      border-bottom:1px solid var(--line);
      padding: 10px 8px;
      text-align:left;
      vertical-align:middle;
    }
    th{
      background:#f8fafc;
      font-size: 12px;
      color: var(--muted);
      font-weight: 900;
      letter-spacing:-.2px;
    }

    .switch{
      display:inline-flex;
      align-items:center;
      gap:8px;
      font-size: 12px;
      color: var(--muted);
      user-select:none;
    }
    .switch input{ transform: translateY(1px); }

    details{
      border:1px solid var(--line);
      border-radius: 14px;
      padding: 10px 12px;
      background:#fff;
    }
    details summary{
      cursor:pointer;
      font-weight: 900;
      letter-spacing:-.2px;
    }
    details .mini{ margin-top: 8px; }

    .note{
      padding: 10px 12px;
      border-radius: 14px;
      background:#f8fafc;
      border:1px solid var(--line);
      color: var(--muted);
      font-size: 12px;
      line-height: 1.5;
    }

    .footer{
      margin-top: 14px;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.6;
    }

    .muted{ color: var(--muted); }
    .mono{ font-family: var(--mono); }

    .toast{
      position: fixed;
      left: 50%;
      bottom: 18px;
      transform: translateX(-50%);
      background: rgba(15,23,42,.92);
      color:#fff;
      padding: 10px 12px;
      border-radius: 999px;
      font-size: 12px;
      opacity: 0;
      pointer-events:none;
      transition: opacity .18s ease, transform .18s ease;
      z-index: 50;
    }
    .toast.show{
      opacity: 1;
      transform: translateX(-50%) translateY(-4px);
    }

    /* Print */
    @media print{
      body{ background:#fff; }
      .wrap{ max-width:none; padding: 0; }
      header, .topbar, .btn, .note, .footer, #exportCard, #scenarioCard, #helpCard { display:none !important; }
      .card{ box-shadow:none; border:1px solid #ddd; }
    }
