:root {
  --navy: #44568f;
  --navy-dark: #26345f;
  --teal: #10b9a5;
  --bg: #f4f5fb;
  --line: #e4e7f0;
  --text: #1f2937;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, "Noto Sans KR", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
a { color: inherit; text-decoration: none; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 220px; background: #fff; border-right: 1px solid var(--line); padding: 20px 14px; overflow-y: auto; transition: transform .18s ease; z-index: 1000; }
.brand { height: 48px; display: flex; align-items: center; margin-bottom: 20px; }
.brand svg { width: 168px; max-width: 100%; height: auto; }
.side-label { color: #a0a7b8; font-size: 12px; font-weight: 700; margin: 12px 0; }
nav { display: flex; flex-direction: column; gap: 6px; }
nav a { padding: 11px 12px; color: #677086; border-radius: 4px; font-weight: 700; }
nav a.active, nav a:hover { color: var(--navy); background: #eef2ff; }
.balance-card { margin-top: 24px; border: 1px solid var(--line); border-radius: 4px; padding: 14px; color: #687084; background: #fafbff; }
.balance-card strong { color: var(--text); display: block; margin-top: 6px; font-size: 18px; }
.main { margin-left: 220px; min-height: 100vh; transition: margin-left .18s ease; }
body.sidebar-collapsed .sidebar { transform: translateX(-220px); }
body.sidebar-collapsed .main { margin-left: 0; }
.topbar { height: 64px; background: #fff; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; padding: 0 24px; }
.hamburger { border: 0; background: transparent; color: #7b8498; font-size: 22px; cursor: pointer; }
.account-menu { position: relative; }
.account-toggle { height: 36px; background: transparent; color: var(--text); border: 0; padding: 0 8px; font-weight: 700; }
.account-toggle:hover { background: #eef2ff; color: var(--navy); }
.account-dropdown { position: absolute; right: 0; top: calc(100% + 8px); min-width: 160px; background: #fff; border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 14px 30px rgba(15, 23, 42, .12); padding: 6px; z-index: 1100; }
.account-dropdown button, .account-dropdown a { width: 100%; height: 36px; display: flex; align-items: center; justify-content: flex-start; padding: 0 10px; border: 0; border-radius: 4px; background: #fff; color: #334155; font-weight: 700; }
.account-dropdown button:hover, .account-dropdown a:hover { background: #eef2ff; color: var(--navy); }
.content { padding: 24px; }
h1 { margin: 0 0 18px; font-size: 18px; }
h2 { margin: 0 0 12px; font-size: 15px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 16px; margin-bottom: 18px; box-shadow: 0 1px 2px rgba(20, 28, 50, .03); overflow-x: auto; }
.action-panel { display: flex; align-items: center; gap: 10px; min-height: 62px; }
.filter, .grid-form { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.filter-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 2px; }
label { display: flex; flex-direction: column; gap: 7px; font-weight: 700; color: #424b60; }
input, select { width: 100%; height: 38px; border: 1px solid #d4d9e5; border-radius: 4px; padding: 0 10px; background: #fff; color: var(--text); }
.btn, button { height: 38px; border: 0; border-radius: 4px; padding: 0 18px; background: var(--navy); color: #fff; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
.btn:hover, button:hover { background: var(--navy-dark); }
.btn.secondary { background: #eef2f7; color: #334155; }
.btn.secondary:hover { background: #dfe5ef; }
table { width: 100%; border-collapse: collapse; min-width: 1050px; }
th, td { border: 1px solid #e6e9f1; padding: 11px 10px; text-align: center; vertical-align: middle; }
th { background: #f8f9fc; color: #4a5367; font-size: 13px; }
td { background: #fff; }
.badge { display: inline-flex; background: #e7fbf5; color: #07946f; border-radius: 4px; padding: 4px 8px; font-size: 12px; font-weight: 700; }
.flash { padding: 12px 14px; border-radius: 4px; margin-bottom: 16px; background: #e9fff5; border: 1px solid #98ebc9; color: #08754f; }
.flash.error { background: #fff0f0; border-color: #f4b2b2; color: #a32727; }
.muted { color: #697386; margin-top: 0; }
.warn { color: #c2410c; margin-bottom: 0; }
.pagination { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.pagination span { color: #687084; font-size: 13px; margin-right: 6px; }
.pagination a { min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: #445068; font-weight: 700; padding: 0 10px; }
.pagination a:hover, .pagination a.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .48); display: grid; place-items: center; padding: 18px; z-index: 2000; }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 36px); overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 24px 60px rgba(15, 23, 42, .24); padding: 18px; }
.small-modal { width: min(420px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-head h2 { margin: 0; font-size: 17px; }
.icon-btn { width: 34px; height: 34px; padding: 0; background: transparent; color: #667085; font-size: 24px; line-height: 1; }
.icon-btn:hover { background: #f1f4f9; color: #1f2937; }
.modal-form { display: grid; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.login-body { min-height: 100vh; display: grid; place-items: center; background: #f3f4fa; }
.login-card { width: min(420px, calc(100vw - 32px)); background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 28px; box-shadow: 0 12px 30px rgba(20, 28, 50, .08); }
.login-logo { font-size: 34px; letter-spacing: 4px; font-weight: 700; margin-bottom: 18px; text-align: center; }
.login-card h1 { font-size: 20px; }
.login-card label { margin-bottom: 14px; }
.login-card button { width: 100%; margin-top: 8px; }
@media (max-width: 900px) {
  body { overflow-x: hidden; }
  .sidebar { width: min(82vw, 280px); transform: translateX(-100%); box-shadow: 12px 0 30px rgba(15, 23, 42, .16); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-collapsed .sidebar { transform: translateX(-100%); }
  .main { margin-left: 0; }
  body.sidebar-collapsed .main { margin-left: 0; }
  .topbar { position: sticky; top: 0; z-index: 900; padding: 0 14px; }
  .filter, .grid-form { grid-template-columns: 1fr; }
  .content { padding: 14px; max-width: 100vw; overflow-x: hidden; }
  .panel { padding: 12px; margin-bottom: 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 780px; }
  th, td { padding: 9px 8px; font-size: 12px; }
  .modal { width: 100%; padding: 14px; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }
}
