:root {
  color-scheme: light;
  --ink: #102330;
  --muted: #566972;
  --subtle: #76868a;
  --line: #dbe3df;
  --paper: #fff;
  --background: #f4f7f4;
  --nav: #102330;
  --nav-ink: #ebf0ee;
  --accent: #dff36f;
  --focus: #5d7829;
  --radius: 16px;
  font-family: Inter, 'Pretendard', 'Noto Sans KR', 'Malgun Gothic', system-ui, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--ink); }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .53; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 15; transform: translateY(-150%); padding: .55rem 1rem; border-radius: 7px; background: var(--accent); }
.skip-link:focus { transform: translateY(0); }

.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; align-self: start; display: flex; height: 100dvh; min-height: 420px; flex-direction: column; background: var(--nav); color: var(--nav-ink); padding: 26px 16px 16px; }
.brand { display: flex; align-items: center; gap: 9px; padding: 0 6px 23px; }
.brand img { display: block; object-fit: contain; }
.brand strong { display: block; color: white; font-size: 25px; line-height: .99; font-weight: 780; letter-spacing: -.065em; }
.brand small { display: block; margin-top: 6px; color: #a4b8b9; font-size: 10px; letter-spacing: .04em; }
.navigation { display: flex; flex-direction: column; gap: 5px; overflow-y: auto; padding: 12px 0; border-top: 1px solid #2b404a; }
.navigation a { display: flex; min-height: 43px; align-items: center; gap: 12px; border-radius: 8px; padding: 9px 12px; color: #c7d4d5; font-size: 14px; font-weight: 570; }
.navigation a:hover { background: #203540; color: #fff; }
.navigation a[aria-current=page] { background: var(--accent); color: #182d24; font-weight: 750; }
.sidebar-footer { display: flex; gap: 9px; align-items: center; margin-top: auto; padding: 14px 5px 3px; border-top: 1px solid #2b404a; }
.sidebar-footer strong, .sidebar-footer small { display: block; }
.sidebar-footer strong { font-size: 10px; letter-spacing: .055em; }
.sidebar-footer small { color: #aec0bf; font-size: 9px; line-height: 1.4; margin-top: 4px; }
.owner-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: #263b46; color: #e4efdc; font-size: 11px; font-weight: 700; }

.topbar { display: flex; align-items: center; position: sticky; top: 0; z-index: 3; background: var(--paper); border-bottom: 1px solid var(--line); min-height: 62px; padding: 0 clamp(18px, 3.5vw, 44px); }
.breadcrumbs { display: flex; align-items: center; gap: 11px; font-size: 12px; color: var(--muted); }
.breadcrumbs strong { color: var(--ink); font-weight: 680; }
.top-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.mode-label { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid #dbe5d1; border-radius: 20px; background: #f3f8eb; color: #396033; font-size: 11px; white-space: nowrap; }
.mode-label::before, .mode-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #699245; }
.mode-label::before { content: ''; }
.mobile-toggle, .sidebar-scrim { display: none; }
.workspace { width: min(1530px, 100%); margin-inline: auto; padding: 34px clamp(18px, 3.5vw, 44px) 50px; }
.workspace:focus { outline: 0; }
.workspace > .panel + .panel, .wf-panel + .wf-panel { margin-top: 18px; }

.dashboard-intro { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.dashboard-intro h1, .access-panel h1 { margin: 0 0 8px; font-size: clamp(29px, 4.1vw, 43px); line-height: 1.14; letter-spacing: -.055em; font-weight: 780; }
.dashboard-intro p { margin: 0; color: var(--muted); font-size: 14px; }
.dashboard-intro .dashboard-date { margin: 0 0 8px; color: #5a706f; font-size: 11px; font-weight: 650; letter-spacing: .08em; }
.dashboard-date span { margin-inline: 3px; color: #94a67e; }
.demo-banner { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 18px; padding: 9px 12px; border: 1px solid #dce7d0; border-radius: 8px; background: #eff5e8; color: #506344; font-size: 12px; line-height: 1.45; }
.demo-banner strong { color: #34512e; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 20px; }
.metric { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 6px 11px; min-height: 112px; padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.metric:hover { border-color: #94ab70; }
.metric-icon { display: inline-grid; place-items: center; position: relative; width: 34px; height: 34px; border-radius: 9px; background: #edf4e5; color: #46613b; }
.metric-label { font-size: 13px; line-height: 1.35; font-weight: 630; color: var(--muted); }
.metric > strong { grid-column: 1 / -1; align-self: end; font-variant-numeric: tabular-nums; font-size: 30px; line-height: 1; letter-spacing: -.06em; }
.metric > strong small { margin-left: 5px; color: var(--subtle); font-size: 12px; font-weight: 550; letter-spacing: normal; }

.nav-glyph { position: relative; display: grid; flex: 0 0 17px; width: 17px; height: 17px; place-items: center; }
.nav-glyph::before, .metric-icon::before { display: inline-block; font-size: 19px; line-height: 1; font-weight: 650; }
.icon-home::before { content: '▦'; }
.icon-list::before { content: '▤'; }
.icon-route::before { content: '⇄'; }
.icon-ledger::before { content: '▥'; }
.icon-file::before { content: '▱'; }
.icon-cube::before { content: '⬡'; }
.icon-users::before { content: '♧'; }
.icon-tag::before { content: '◇'; }

.dashboard-panels { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 14px; }
.panel { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 2px 2px #17312d04; overflow: clip; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 17px 18px; border-bottom: 1px solid #e8ede8; }
.panel-head h1, .panel-head h2, .panel-head h3 { margin: 0; font-size: 18px; line-height: 1.35; letter-spacing: -.035em; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.panel-body { padding: 16px 18px; }
.panel-body > .table-wrap { margin: 12px 0 0; }
.text-link { color: #45613c; font-size: 12px; font-weight: 700; white-space: nowrap; }
.text-link:hover { text-decoration: underline; }
.text-link span { margin-left: 4px; }
.table-wrap { min-width: 0; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.data-table th { padding: 9px 14px; background: #f5f8f4; color: #53666a; font-size: 12px; font-weight: 680; white-space: nowrap; }
.data-table td { padding: 11px 14px; border-top: 1px solid #edf0eb; vertical-align: middle; line-height: 1.34; }
.data-table th:first-child, .data-table td:first-child { padding-left: 18px; }
.data-table th:last-child, .data-table td:last-child { padding-right: 18px; }
.data-table td strong { font-weight: 710; }
.data-table tr:hover td { background: #fbfcf9; }
.data-table td small, .wf-subline { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
.data-table .numeric { white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table .btn { min-height: 29px; padding: 4px 8px; font-size: 11px; white-space: nowrap; }
.empty { margin: 0; padding: 19px 18px; text-align: center; color: var(--muted); font-size: 13px; }
.data-table .empty { padding: 22px; }

.due-list { margin: 0; padding: 0 15px; list-style: none; }
.due-list li { display: grid; grid-template-columns: 31px minmax(0, 1fr) max-content; align-items: center; gap: 8px; min-height: 62px; padding-block: 6px; }
.due-list li + li { border-top: 1px solid #edf0eb; }
.due-kind { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 7px; font-size: 10px; font-weight: 740; }
.due-receive { background: #e8f2de; color: #416b36; }
.due-pay { background: #fff0d9; color: #805626; }
.due-list strong { display: block; font-size: 12px; }
.due-list small { display: block; margin-top: 3px; font-size: 10px; color: var(--muted); overflow-wrap: anywhere; }
.due-amount { font-variant-numeric: tabular-nums; }
.work-links { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.work-links a { display: grid; grid-template-columns: 34px minmax(0, 1fr) 14px; align-items: center; gap: 11px; min-height: 65px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcf9; }
.work-links a:hover { border-color: #94ab70; }
.work-links strong, .work-links small { display: block; }
.work-links strong { font-size: 13px; }
.work-links small { margin-top: 4px; font-size: 11px; color: var(--muted); }

.btn { display: inline-flex; justify-content: center; align-items: center; gap: 6px; min-height: 36px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fdfefc; color: var(--ink); font-size: 13px; font-weight: 700; white-space: nowrap; }
.btn:hover { border-color: #9cb193; background: #f4f8f1; }
.btn-primary { background: var(--accent); border-color: #d2e766; color: #16271b; }
.btn-primary:hover { background: #d5eb57; border-color: #adbf50; }
.btn.small { min-height: 30px; font-size: 11px; padding: 4px 8px; }
.btn-secondary { background: #fafcf9; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 20px; white-space: nowrap; font-size: 11px; font-weight: 680; line-height: 1.1; }
.badge-success { background: #e5f1de; color: #366232; }
.badge-info { background: #e6eef1; color: #31586e; }
.badge-neutral { background: #edf0ec; color: #52635f; }
.badge-warning { background: #fff0d4; color: #795018; }
.badge-danger { background: #fbe8e5; color: #922d24; }

.wf-stack { display: grid; gap: 18px; }
.wf-stack .wf-panel + .wf-panel { margin-top: 0; }
.wf-actions, .wf-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.wf-toolbar { padding: 11px 18px; }
.wf-toolbar input { min-width: min(100%, 230px); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: #344e52; font-size: 12px; font-weight: 670; }
.field-wide { grid-column: 1 / -1; }
input:not([type=checkbox]):not([type=radio]), select, textarea { min-height: 35px; max-width: 100%; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); font-size: 13px; }
input[type=checkbox], input[type=radio] { accent-color: #607c3a; }
textarea { resize: vertical; }
.wf-choices { min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: 8px; }
.wf-choices legend { font-size: 12px; font-weight: 650; }
.wf-choice { display: flex; align-items: start; gap: 6px; padding: 6px 2px; font-size: 12px; }

dialog { width: min(620px, calc(100% - 24px)); max-height: calc(100dvh - 35px); padding: 18px; background: white; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 24px 90px #0a251e4d; }
dialog::backdrop { background: #09222bb0; }
dialog h2, dialog h3 { margin: 0 0 14px; font-size: 18px; letter-spacing: -.025em; }
dialog header, dialog footer, .wf-dialog-head, .wf-dialog-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
dialog header h2, .wf-dialog-head h2 { margin: 0; }
dialog header, .wf-dialog-head { margin-bottom: 14px; }
dialog footer, .wf-dialog-foot { justify-content: flex-end; margin-top: 16px; }
.wf-delete { margin-right: auto; color: #97392d; }
.wf-form-error, .login-error { margin: 9px 0; color: #9b3025; font-size: 12px; line-height: 1.4; }
dialog iframe, dialog object, dialog embed { width: 100%; min-height: min(62vh, 590px); border: 1px solid var(--line); }
dialog img { display: block; max-width: 100%; max-height: 62vh; margin: auto; }
.access-panel { max-width: 410px; margin: 9vh auto 0; padding: 24px; }
.access-panel > img { margin-left: -5px; }
.access-panel h1 { font-size: 28px; margin-top: 5px; }
.access-panel p { font-size: 13px; color: var(--muted); line-height: 1.5; }
.access-panel form { display: grid; gap: 10px; margin-top: 16px; }
.toast { position: fixed; z-index: 12; right: 18px; bottom: 18px; max-width: calc(100% - 36px); padding: 11px 15px; border-radius: 9px; background: #142932; box-shadow: 0 8px 34px #0b201b36; color: #fff; font-size: 13px; line-height: 1.45; }

@media (max-width: 1120px) {
  .shell { grid-template-columns: 200px minmax(0, 1fr); }
  .dashboard-panels { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .shell { display: block; }
  .sidebar { position: fixed; z-index: 9; inset: 0 auto 0 0; width: 235px; transform: translateX(-100%); transition: transform .18s ease; }
  .menu-open .sidebar { transform: translateX(0); }
  .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 8; background: #0819228c; border: 0; }
  .mobile-toggle { display: inline-grid; place-items: center; margin-right: 9px; width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); background: #f9fbf8; border-radius: 7px; color: var(--ink); }
  .breadcrumbs > span { display: none; }
  .topbar { min-height: 52px; }
  .workspace { padding-top: 22px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .dashboard-intro { align-items: start; }
  .dashboard-intro p { font-size: 12px; }
  .dashboard-intro .btn { margin-top: 19px; padding: 6px 8px; font-size: 11px; }
  .form-grid, .work-links { grid-template-columns: 1fr; }
  .metric { min-height: 95px; padding: 11px; gap: 5px 8px; }
  .metric-label { font-size: 12px; }
  .data-table th, .data-table td { padding-inline: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; }
}
