:root {
  --bg: #f4f6f9; --card: #ffffff; --ink: #1c2430; --muted: #6b7785; --line: #e2e7ee;
  --brand: #1f5f8b; --brand-dark: #16455f; --green: #1f7a4d; --red: #b3261e; --amber: #b87514;
  --shadow: 0 1px 3px rgba(20,30,45,.08), 0 4px 16px rgba(20,30,45,.06);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); font-size: 15px; }
.hidden { display: none !important; }
button { font: inherit; cursor: pointer; border: none; border-radius: 7px; padding: 8px 14px; background: var(--brand); color: #fff; }
button:hover { background: var(--brand-dark); }
button.ghost { background: transparent; color: var(--muted); }
button.ghost:hover { background: rgba(0,0,0,.05); color: var(--ink); }
button.danger { background: var(--red); }
button.secondary { background: #eef1f5; color: var(--ink); }
button.secondary:hover { background: #e2e7ee; }
button.small { padding: 5px 10px; font-size: 13px; }
a { color: var(--brand); }
input, select, textarea { font: inherit; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); }
textarea { resize: vertical; min-height: 64px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
label input, label select, label textarea { margin-top: 4px; }
.error { color: var(--red); font-size: 13.5px; margin-top: 8px; min-height: 18px; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { background: var(--card); padding: 32px; border-radius: 12px; box-shadow: var(--shadow); width: 360px; }
.login-card h1 { font-size: 21px; margin: 0; color: var(--brand); text-align: center; }
.login-card .sub { color: var(--muted); margin: 4px 0 24px; text-align: center; }
.login-card button[type=submit] { width: 100%; margin-top: 8px; }
.topbar { display: flex; align-items: center; gap: 20px; background: var(--card); padding: 0 22px; height: 58px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
#nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
#nav button { background: transparent; color: var(--muted); border-radius: 7px; }
#nav button:hover { background: rgba(0,0,0,.05); color: var(--ink); }
#nav button.active { background: rgba(31,95,139,.12); color: var(--brand); font-weight: 600; }
.user-box { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
#user-label { font-size: 13.5px; color: var(--muted); }
main { max-width: 1080px; margin: 0 auto; padding: 26px 22px 60px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 16px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 20px; }
.muted { color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
th { background: #f8fafc; color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.pending { background: #fdf2e1; color: var(--amber); }
.badge.approved { background: #e3f3ea; color: var(--green); }
.badge.rejected { background: #fbe6e5; color: var(--red); }
.badge.active { background: #e3f3ea; color: var(--green); }
.badge.closed { background: #eceff3; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.stat-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; flex: 1; min-width: 180px; box-shadow: var(--shadow); }
.stat .k { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.stat .v { font-size: 24px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .v.green { color: var(--green); }
.toolbar-inline { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar-inline label { margin-bottom: 0; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(20,30,45,.45); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: var(--card); border-radius: 12px; box-shadow: var(--shadow); width: 540px; max-width: 100%; max-height: 90vh; overflow: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); }
.modal-head h2 { margin: 0; font-size: 18px; }
#modal-body { padding: 22px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 8px; box-shadow: var(--shadow); z-index: 100; font-size: 14px; }
.toast.err { background: var(--red); }
.notice { background: #fdf2e1; color: #7a5212; border: 1px solid #f0d9a8; border-radius: 8px; padding: 10px 12px; font-size: 13.5px; margin: 14px 0; line-height: 1.5; }
.opt-list { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; margin: 6px 0 4px; }
.opt-row { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-bottom: 1px solid var(--line); cursor: pointer; }
.opt-row:last-child { border-bottom: none; }
.opt-row:hover { background: #f8fafc; }
.opt-row input { width: auto; margin-top: 3px; }
.opt-row.sel { background: rgba(31,95,139,.07); }
.opt-row .ot { font-weight: 600; }
.opt-row .od { font-size: 12.5px; color: var(--muted); }
.fixed-field { background: #f1f5f9; border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; margin-top: 4px; font-weight: 600; }
.check-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.check-row input { width: auto; }
.check-row label { margin: 0; font-size: 14px; color: var(--ink); }
#notif-btn { font-size: 16px; }
.notif-badge { display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; margin-left: 1px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; }
.notif-item { padding: 11px 13px; border-bottom: 1px solid var(--line); font-size: 14px; }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: rgba(31,95,139,.06); }
.notif-item .nt { font-size: 12px; color: var(--muted); margin-top: 2px; }
.sum-row td { font-weight: 700; background: #f8fafc; }
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.brand .bt { font-weight: 700; color: var(--brand); }
.logo { height: 28px; width: auto; display: block; }
.logo-lg { height: 56px; margin: 0 auto 8px; }
.app-name { display: inline-flex; align-items: center; font-weight: 600; color: var(--ink); padding: 6px 12px 6px 4px; margin-right: 6px; border-right: 1px solid var(--line); }
#nav .nav-back { color: var(--brand); font-weight: 600; }
#nav .nav-back:hover { background: rgba(31,95,139,.1); }
.cockpit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.module { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.module.clickable { cursor: pointer; transition: box-shadow .15s ease, transform .15s ease; }
.module.clickable:hover { box-shadow: 0 8px 26px rgba(20,30,45,.13); transform: translateY(-2px); }
.module.soon { opacity: .6; }
.module .icon { width: 44px; height: 44px; border-radius: 11px; background: rgba(31,95,139,.1); display: grid; place-items: center; font-size: 22px; margin-bottom: 4px; }
.module h3 { margin: 0; font-size: 17px; }
.module .desc { color: var(--muted); font-size: 13.5px; line-height: 1.45; flex: 1; }
.module .kpis { display: flex; gap: 18px; margin: 8px 0 4px; flex-wrap: wrap; }
.module .kpi .v { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.module .kpi .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.module .open-btn { align-self: flex-start; margin-top: 4px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } .topbar { flex-wrap: wrap; height: auto; padding: 10px 16px; } }
