:root {
  --ink: #172422;
  --ink-soft: #4a5c59;
  --muted: #728481;
  --line: #dfe6e4;
  --line-strong: #c9d4d1;
  --canvas: #f4f2ec;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --teal-950: #073b36;
  --teal-900: #0b4b45;
  --teal-800: #0f5f57;
  --teal-700: #0f766e;
  --teal-600: #128c82;
  --teal-100: #d9f0ec;
  --teal-50: #eef8f6;
  --amber: #b7791f;
  --amber-soft: #fdf3dc;
  --danger: #b42318;
  --danger-soft: #fdeceb;
  --blue: #175cd3;
  --blue-soft: #eaf2fe;
  --purple: #6941c6;
  --purple-soft: #f2edfd;
  --shadow-sm: 0 1px 2px rgba(23, 36, 34, 0.06);
  --shadow-md: 0 10px 30px rgba(23, 36, 34, 0.09);
  --shadow-lg: 0 24px 70px rgba(7, 59, 54, 0.22);
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar-w: 268px;
  --font: "Segoe UI", "Helvetica Neue", Arial, system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--teal-700); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Boot */
.boot-screen {
  position: fixed; inset: 0; display: flex; flex-direction: column; gap: 16px;
  align-items: center; justify-content: center; background: var(--teal-950); color: #fff; z-index: 100;
}
.boot-mark {
  width: 58px; height: 58px; border-radius: 17px; background: transparent;
  display: grid; place-items: center; animation: pulse 1.4s ease-in-out infinite;
}
.boot-mark img { width: 100%; height: 100%; display: block; object-fit: contain; filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.32)); }
.boot-text { color: rgba(255,255,255,0.72); font-size: 13px; letter-spacing: 0.04em; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }

/* Login */
.login-screen { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 0.9fr; background: #fff; }
.login-visual {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(circle at 18% 15%, rgba(18, 140, 130, 0.55), transparent 44%),
    radial-gradient(circle at 85% 85%, rgba(183, 121, 31, 0.28), transparent 46%),
    linear-gradient(145deg, #062f2b, #0b4b45 55%, #0f5f57);
}
.login-visual::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 58px 58px; opacity: 0.5;
}
.login-visual::after {
  content: ""; position: absolute; width: 420px; height: 420px; border: 1px solid rgba(255,255,255,0.14);
  border-radius: 50%; right: -140px; bottom: -160px;
}
.login-visual-inner { position: relative; z-index: 1; padding: 56px 64px; max-width: 700px; height: 100%; display: flex; flex-direction: column; }
.login-visual h1 { margin-top: 64px; font-size: clamp(30px, 3.2vw, 46px); line-height: 1.12; letter-spacing: -0.02em; max-width: 560px; }
.login-lead { margin-top: 20px; max-width: 550px; color: rgba(255,255,255,0.75); font-size: 15px; line-height: 1.7; }
.login-features { list-style: none; padding: 0; margin: 38px 0 0; display: grid; gap: 14px; max-width: 500px; }
.login-features li { display: flex; gap: 14px; align-items: center; color: rgba(255,255,255,0.9); font-size: 14px; }
.login-features span {
  width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.16);
  font-size: 11px; font-weight: 700; color: #ffe2a8; letter-spacing: 0.05em;
}
.login-footnote { margin-top: auto; padding-top: 40px; color: rgba(255,255,255,0.45); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.login-form-side { display: flex; align-items: center; justify-content: center; padding: 48px; background: var(--canvas); }
.login-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 38px; box-shadow: var(--shadow-md); }
.login-card-head h2 { font-size: 24px; letter-spacing: -0.01em; }
.login-card-head p { color: var(--muted); margin-top: 6px; font-size: 13px; }
.login-card .field { margin-top: 20px; }
.demo-accounts { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 20px; display: grid; gap: 7px; }
.demo-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.demo-account {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 9px;
  border: 1px solid transparent; background: transparent; cursor: pointer; text-align: left;
}
.demo-account:hover { background: var(--teal-50); border-color: var(--teal-100); }
.demo-account strong { width: 112px; font-size: 12px; color: var(--ink); }
.demo-account span { flex: 1; font-size: 11px; color: var(--muted); }
.demo-account em { font-style: normal; font-size: 10px; color: var(--teal-700); background: var(--teal-50); padding: 2px 7px; border-radius: 99px; }

/* Brand */
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  background: transparent; flex: none;
}
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: contain; filter: drop-shadow(0 7px 16px rgba(7, 59, 54, 0.3)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15px; letter-spacing: -0.01em; }
.brand-text small { font-size: 11px; opacity: 0.55; letter-spacing: 0.06em; text-transform: uppercase; }
.brand-light { color: #fff; }
.brand-light .brand-text small { color: rgba(255,255,255,0.55); }

/* App shell */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: none; position: fixed; inset: 0 auto 0 0; z-index: 40;
  background: linear-gradient(180deg, var(--teal-950), #062f2b 70%);
  color: #fff; display: flex; flex-direction: column; padding: 22px 16px 18px;
}
.sidebar-brand { padding: 4px 8px 22px; }
.nav { flex: 1; overflow-y: auto; padding-right: 4px; }
.nav::-webkit-scrollbar { width: 5px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.16); border-radius: 99px; }
.nav-section { margin-top: 18px; }
.nav-label { padding: 0 10px 8px; font-size: 10px; letter-spacing: 0.13em; text-transform: uppercase; color: rgba(255,255,255,0.36); font-weight: 700; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px;
  color: rgba(255,255,255,0.7); text-decoration: none; font-size: 13px; margin-bottom: 2px;
  border: 1px solid transparent; transition: 0.14s ease;
}
.nav-item svg { flex: none; opacity: 0.75; }
.nav-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.nav-item.active { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.1); color: #fff; font-weight: 600; }
.nav-item.active svg { color: #ffd479; opacity: 1; }
.sidebar-foot { padding: 16px 6px 0; border-top: 1px solid rgba(255,255,255,0.09); margin-top: 14px; }
.sidebar-foot-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; background: rgba(255,255,255,0.05); }
.sidebar-foot-card .dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgba(74,222,128,0.15); }
.sidebar-foot-card strong { display: block; font-size: 11px; font-weight: 600; }
.sidebar-foot-card small { font-size: 10px; color: rgba(255,255,255,0.45); }
.sidebar-version { font-size: 10px; color: rgba(255,255,255,0.3); padding: 12px 10px 0; letter-spacing: 0.05em; }
.sidebar-backdrop { display: none; }
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }

/* Topbar */
.topbar {
  height: 78px; background: rgba(255,255,255,0.82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px;
  padding: 0 32px; position: sticky; top: 0; z-index: 30;
}
.topbar-title h2 { font-size: 18px; letter-spacing: -0.01em; }
.topbar-title span { font-size: 12px; color: var(--muted); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.today-chip { font-size: 12px; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line); padding: 7px 12px; border-radius: 99px; white-space: nowrap; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink-soft); }
.menu-toggle { display: none; }
.user-menu { position: relative; }
.user-button { display: flex; align-items: center; gap: 10px; background: transparent; border: 0; cursor: pointer; padding: 4px; border-radius: 12px; }
.user-button:hover { background: var(--surface-soft); }
.avatar {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: var(--teal-100); color: var(--teal-800); font-weight: 700; font-size: 13px;
}
.user-meta { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.user-meta strong { font-size: 12px; }
.user-meta small { font-size: 10px; color: var(--muted); }
.dropdown {
  position: absolute; right: 0; top: 52px; width: 250px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 13px; box-shadow: var(--shadow-md); overflow: hidden; z-index: 50;
}
.dropdown-head { padding: 15px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.dropdown-head strong { font-size: 13px; }
.dropdown-head span { font-size: 11px; color: var(--muted); }
.dropdown button { width: 100%; text-align: left; border: 0; background: transparent; padding: 12px 15px; cursor: pointer; color: var(--danger); font-size: 12px; }
.dropdown button:hover { background: var(--danger-soft); }

/* Page */
.page { padding: 30px 32px 60px; max-width: 1480px; width: 100%; margin: 0 auto; outline: none; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.page-header h1 { font-size: 26px; letter-spacing: -0.025em; }
.page-header p { color: var(--muted); margin-top: 5px; max-width: 720px; font-size: 13px; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.stack { display: grid; gap: 18px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface);
  padding: 9px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--ink);
  text-decoration: none; transition: 0.14s ease; white-space: nowrap;
}
.btn:hover { border-color: var(--teal-600); color: var(--teal-800); background: var(--teal-50); }
.btn-primary { background: var(--teal-700); border-color: var(--teal-700); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--teal-800); border-color: var(--teal-800); color: #fff; }
.btn-accent { background: var(--amber); border-color: var(--amber); color: #fff; }
.btn-accent:hover { background: #96621a; border-color: #96621a; color: #fff; }
.btn-danger { color: var(--danger); border-color: #efc4c0; background: #fff; }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-soft); border-color: var(--line); }
.btn-sm { padding: 6px 10px; font-size: 11.5px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 14px; }
.card-head p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 22px; }
.card-body.tight { padding: 0; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; right: -24px; top: -24px; width: 90px; height: 90px; border-radius: 50%; background: var(--teal-50); }
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; margin-top: 8px; position: relative; z-index: 1; }
.stat-value.sm { font-size: 21px; }
.stat-foot { margin-top: 8px; font-size: 11.5px; color: var(--ink-soft); display: flex; gap: 6px; align-items: center; position: relative; z-index: 1; }
.stat-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 12px; background: var(--teal-50); color: var(--teal-700); }
.stat-card.amber .stat-icon { background: var(--amber-soft); color: var(--amber); }
.stat-card.red .stat-icon { background: var(--danger-soft); color: var(--danger); }
.stat-card.blue .stat-icon { background: var(--blue-soft); color: var(--blue); }
.stat-card.purple .stat-icon { background: var(--purple-soft); color: var(--purple); }
.stat-trend { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 99px; background: var(--teal-50); color: var(--teal-800); }
.stat-trend.warn { background: var(--amber-soft); color: var(--amber); }
.stat-trend.bad { background: var(--danger-soft); color: var(--danger); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 600; white-space: nowrap; background: var(--surface-soft); color: var(--ink-soft); border: 1px solid var(--line); }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.7; }
.badge.green { background: #e9f8f0; color: #177245; border-color: #c6eed8; }
.badge.teal { background: var(--teal-50); color: var(--teal-800); border-color: var(--teal-100); }
.badge.amber { background: var(--amber-soft); color: var(--amber); border-color: #f5dfb4; }
.badge.red { background: var(--danger-soft); color: var(--danger); border-color: #f3c9c5; }
.badge.blue { background: var(--blue-soft); color: var(--blue); border-color: #c9dcfb; }
.badge.purple { background: var(--purple-soft); color: var(--purple); border-color: #dfd3fa; }
.badge.gray { background: #f1f4f3; color: var(--muted); border-color: var(--line); }
.badge.no-dot::before { display: none; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 11.5px; font-weight: 600; color: var(--ink-soft); letter-spacing: 0.01em; }
.field > span em { color: var(--danger); font-style: normal; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line-strong); background: #fff; border-radius: 9px;
  padding: 9px 11px; font-size: 13px; outline: none; transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--teal-600); box-shadow: 0 0 0 3px rgba(18,140,130,0.12); }
input::placeholder, textarea::placeholder { color: #a5b2af; }
textarea { min-height: 78px; resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #7b8b88 50%), linear-gradient(135deg, #7b8b88 50%, transparent 50%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
input[type="date"], input[type="month"] { color-scheme: light; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 4px; }
.form-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); margin-bottom: 12px; }
.form-hint { font-size: 11px; color: var(--muted); }
.form-error { background: var(--danger-soft); color: var(--danger); border: 1px solid #f3c9c5; border-radius: 8px; padding: 9px 11px; font-size: 12px; margin-top: 10px; }
.form-success { background: #e9f8f0; color: #177245; border: 1px solid #c6eed8; border-radius: 8px; padding: 9px 11px; font-size: 12px; margin-top: 10px; }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-soft); }
.checkbox input { width: auto; }
.filters { display: flex; gap: 11px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { min-width: 150px; }
.filters .field.grow { flex: 1; min-width: 220px; }

/* Table */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th {
  text-align: left; padding: 11px 14px; background: var(--surface-soft); color: var(--muted);
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; border-bottom: 1px solid var(--line);
  white-space: nowrap; user-select: none;
}
table.data th.sortable { cursor: pointer; }
table.data th.sortable:hover { color: var(--teal-800); }
table.data th .sort-arrow { opacity: 0.5; margin-left: 3px; font-size: 9px; }
table.data td { padding: 12px 14px; border-bottom: 1px solid #edf1f0; vertical-align: middle; }
table.data tbody tr:hover { background: #fbfcfc; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.strong { font-weight: 600; }
table.data .sub { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.table-toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.search-box { position: relative; min-width: 230px; }
.search-box input { padding-left: 32px; }
.search-box svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pagination { display: flex; align-items: center; gap: 5px; }
.pagination button { min-width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 11.5px; padding: 0 8px; }
.pagination button:hover:not(:disabled) { border-color: var(--teal-600); color: var(--teal-800); }
.pagination button.active { background: var(--teal-700); border-color: var(--teal-700); color: #fff; }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); }
.empty-icon { width: 46px; height: 46px; border-radius: 13px; background: var(--surface-soft); border: 1px solid var(--line); display: grid; place-items: center; margin: 0 auto 12px; color: var(--muted); }
.empty strong { display: block; color: var(--ink-soft); font-size: 13px; margin-bottom: 3px; }
.empty p { font-size: 12px; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab { border: 0; background: transparent; padding: 10px 14px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--teal-800); }
.tab.active { color: var(--teal-800); border-bottom-color: var(--teal-700); }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(7, 32, 29, 0.52); backdrop-filter: blur(3px); z-index: 80; display: flex; align-items: flex-start; justify-content: center; padding: 40px 20px; overflow-y: auto; }
.modal { width: 100%; max-width: 620px; background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); animation: modal-in 0.18s ease; margin: auto; }
.modal.lg { max-width: 820px; }
.modal.xl { max-width: 1040px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(0.99); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 17px; letter-spacing: -0.01em; }
.modal-head p { font-size: 12px; color: var(--muted); margin-top: 3px; }
.modal-close { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--muted); font-size: 16px; line-height: 1; }
.modal-close:hover { background: var(--surface-soft); color: var(--ink); }
.modal-body { padding: 22px 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 16px 24px; border-top: 1px solid var(--line); background: var(--surface-soft); border-radius: 0 0 18px 18px; flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }
.confirm-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--amber-soft); color: var(--amber); display: grid; place-items: center; margin-bottom: 14px; }

/* Toast */
.toast-root { position: fixed; right: 22px; bottom: 22px; z-index: 120; display: flex; flex-direction: column; gap: 9px; max-width: 380px; }
.toast { display: flex; gap: 10px; align-items: flex-start; background: var(--ink); color: #fff; padding: 12px 15px; border-radius: 11px; box-shadow: var(--shadow-md); font-size: 12.5px; animation: toast-in 0.2s ease; }
.toast.success { background: #124f3a; }
.toast.error { background: #7a1f18; }
.toast.info { background: var(--teal-900); }
.toast strong { display: block; font-size: 12px; margin-bottom: 2px; }
.toast span { color: rgba(255,255,255,0.78); }
.toast .toast-close { margin-left: auto; background: transparent; border: 0; color: rgba(255,255,255,0.6); cursor: pointer; font-size: 15px; line-height: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Dashboard specifics */
.dashboard-hero { display: flex; justify-content: space-between; gap: 24px; padding: 26px 28px; border-radius: var(--radius); background: linear-gradient(120deg, var(--teal-950), var(--teal-800)); color: #fff; overflow: hidden; position: relative; }
.dashboard-hero::after { content: ""; position: absolute; width: 280px; height: 280px; border: 1px solid rgba(255,255,255,0.12); border-radius: 50%; right: -60px; top: -140px; }
.dashboard-hero h2 { font-size: 22px; letter-spacing: -0.02em; }
.dashboard-hero p { color: rgba(255,255,255,0.7); font-size: 13px; margin-top: 6px; max-width: 580px; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; position: relative; z-index: 1; }
.hero-actions .btn { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); color: #fff; }
.hero-actions .btn:hover { background: rgba(255,255,255,0.18); color: #fff; }
.hero-actions .btn-primary { background: #fff; color: var(--teal-900); border-color: #fff; }
.hero-actions .btn-primary:hover { background: #f2f8f7; color: var(--teal-950); }
.occupancy-bar { height: 10px; border-radius: 99px; background: #eef2f1; overflow: hidden; display: flex; }
.occupancy-bar span { display: block; height: 100%; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--ink-soft); margin-top: 12px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.room-tile { border: 1px solid var(--line); border-radius: 11px; padding: 12px; background: var(--surface); }
.room-tile .room-no { font-weight: 700; font-size: 13px; display: flex; justify-content: space-between; align-items: center; }
.room-tile small { color: var(--muted); font-size: 10.5px; display: block; margin-top: 3px; }
.quick-list { display: grid; gap: 10px; }
.quick-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); text-decoration: none; color: inherit; }
.quick-item:hover { border-color: var(--teal-600); background: var(--teal-50); }
.quick-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--teal-50); color: var(--teal-800); display: grid; place-items: center; flex: none; }
.quick-item strong { display: block; font-size: 12.5px; }
.quick-item small { font-size: 11px; color: var(--muted); }
.bar-chart { display: flex; align-items: flex-end; gap: 12px; height: 150px; padding-top: 10px; }
.bar-chart .bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-chart .bars { display: flex; align-items: flex-end; gap: 3px; width: 100%; justify-content: center; height: 100%; }
.bar-chart .bar { width: 34%; border-radius: 4px 4px 0 0; min-height: 2px; background: var(--teal-700); }
.bar-chart .bar.expense { background: #d7a84b; }
.bar-chart .bar-label { font-size: 10px; color: var(--muted); }
.chart-legend { display: flex; gap: 14px; font-size: 11px; color: var(--muted); margin-top: 8px; }
.chart-legend i { width: 8px; height: 8px; display: inline-block; border-radius: 2px; margin-right: 5px; }

/* Detail lists */
.detail-list { display: grid; gap: 10px; }
.detail-row { display: flex; justify-content: space-between; gap: 16px; font-size: 12.5px; padding-bottom: 9px; border-bottom: 1px dashed var(--line); }
.detail-row:last-child { border-bottom: 0; padding-bottom: 0; }
.detail-row dt { color: var(--muted); }
.detail-row dd { margin: 0; font-weight: 600; text-align: right; }
.money-lg { font-size: 27px; font-weight: 700; letter-spacing: -0.03em; }
.money-positive { color: #177245; }
.money-negative { color: var(--danger); }
.info-strip { display: flex; gap: 14px; align-items: center; padding: 12px 15px; border-radius: 10px; background: var(--teal-50); border: 1px solid var(--teal-100); font-size: 12px; color: var(--teal-900); }
.info-strip.warn { background: var(--amber-soft); border-color: #f5dfb4; color: #7a5214; }
.info-strip.danger { background: var(--danger-soft); border-color: #f3c9c5; color: var(--danger); }
.print-doc { background: #fff; color: #111; font-size: 13px; }
.print-doc h1 { font-size: 20px; }
.print-doc table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.print-doc th, .print-doc td { padding: 7px 8px; border-bottom: 1px solid #ddd; text-align: left; font-size: 12px; }
.print-doc th { background: #f4f4f4; }
.doc-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid #111; padding-bottom: 12px; margin-bottom: 16px; }
.doc-head h1 { margin: 0 0 3px; }
.doc-meta { text-align: right; font-size: 12px; }
.doc-foot { margin-top: 22px; padding-top: 12px; border-top: 1px solid #ddd; font-size: 11px; color: #555; }
.print-only { display: none; }

/* Misc */
.loading-inline { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 46px; color: var(--muted); font-size: 12px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--teal-700); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.chip-select { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 11px; font-size: 11.5px; cursor: pointer; color: var(--ink-soft); }
.chip.active { background: var(--teal-700); border-color: var(--teal-700); color: #fff; }
.inline-note { font-size: 11px; color: var(--muted); }
.avatar-sm { width: 30px; height: 30px; border-radius: 9px; background: var(--teal-50); color: var(--teal-800); display: inline-grid; place-items: center; font-size: 10.5px; font-weight: 700; flex: none; }
.cell-user { display: flex; align-items: center; gap: 9px; }
.cell-user strong { display: block; font-size: 12.5px; }
.cell-user small { color: var(--muted); font-size: 10.5px; }
.settlement-hero { text-align: center; padding: 8px 0 18px; }
.settlement-hero .money-lg { font-size: 32px; }
.settlement-note { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.amount-input { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.kv { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.kv span { display: block; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.kv strong { display: block; font-size: 15px; margin-top: 3px; }
.notice { padding: 12px 14px; border-radius: 10px; font-size: 12px; border: 1px solid var(--line); background: var(--surface-soft); color: var(--ink-soft); }
.notice.warn { background: var(--amber-soft); border-color: #f5dfb4; color: #7a5214; }
.notice.danger { background: var(--danger-soft); border-color: #f3c9c5; color: var(--danger); }
.notice.ok { background: #e9f8f0; border-color: #c6eed8; color: #177245; }


/* Reports & filters */
.filter-bar { padding: 16px 20px; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.field.inline > span { white-space: nowrap; }
.field.inline input, .field.inline select { width: auto; min-width: 150px; }
.report-row { position: relative; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0 12px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--ink-soft); }
.report-row:last-child { border-bottom: 0; }
.report-row .progress { position: absolute; left: 0; bottom: 4px; height: 3px; width: 100%; background: var(--surface-soft); border-radius: 99px; overflow: hidden; }
.report-row .progress span { display: block; height: 100%; background: var(--teal-600); border-radius: 99px; }
.report-row .progress span.amber { background: var(--amber); }
.statement-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.statement-head h2 { font-size: 20px; letter-spacing: -0.02em; }
.statement-head .grid { gap: 10px; }
.statement-head .stat-card { padding: 14px; }
.statement-head .stat-value { font-size: 17px; }

/* Responsive */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-form-side { min-height: 100vh; padding: 28px 18px; }
  .sidebar { transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: var(--shadow-lg); }
  .app.sidebar-open .sidebar { transform: none; }
  .app.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(7,32,29,0.45); z-index: 35; }
  .main { margin-left: 0; }
  .menu-toggle { display: grid; }
  .topbar { padding: 0 18px; height: 70px; }
  .page { padding: 22px 18px 50px; }
  .today-chip { display: none; }
  .user-meta { display: none; }
}
@media (max-width: 700px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 22px; }
  .stat-value { font-size: 22px; }
  .modal-overlay { padding: 16px 10px; }
  .modal-body { padding: 18px; }
  .modal-head { padding: 17px 18px; }
  .modal-foot { padding: 14px 18px; }
  .dashboard-hero { padding: 20px; flex-direction: column; }
  .filters .field { min-width: 100%; }
  .table-toolbar { padding: 12px; }
  .search-box { width: 100%; }
  .kv-grid { grid-template-columns: 1fr; }
  .statement-head .grid { min-width: 0 !important; width: 100%; }
  .field.inline { flex-direction: column; align-items: stretch; }
  .field.inline input, .field.inline select { width: 100%; }
  .detail-row { flex-direction: column; gap: 3px; }
  .detail-row dd { text-align: left; }
  .toast-root { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}

@media print {
  body { background: #fff; }
  .sidebar, .topbar, .page-actions, .modal-foot, .toast-root, .btn { display: none !important; }
  .main { margin: 0; }
  .page { padding: 0; }
  .card { border: 0; box-shadow: none; }
  .modal-overlay { position: static; background: #fff; padding: 0; }
  .modal { box-shadow: none; max-width: none; }
  .modal-head { border: 0; padding: 0 0 10px; }
  .modal-body { padding: 0; }
}
