[hidden] { display: none !important; }
:root {
  --bg: #f3efe7; --surface: #fbf8f3; --ink: #1f2933; --muted: #6b7280; --border: #e2dccf; --primary: #1f4b43; --on-primary: #fff;
  --accent: #b5832f; --danger: #b42318; --warn: #b45309; --ok: #2f7d4f; --radius: 10px; --hover: #efe9dc; --nav: #1f4b43;
}
[data-theme="dark"] {
  --bg: #12161a; --surface: #1b2127; --ink: #e8e6e1; --muted: #9aa3ad; --border: #2c343c; --primary: #6fb5a5; --on-primary: #0d1512;
  --accent: #d9a84a; --hover: #232b32; --nav: #172a27;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
.page { max-width: 1100px; margin: 0 auto; padding: 1rem 16px 3rem; }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; font-size: 1.3rem; font-weight: 700; margin: .4rem 0 1rem; }
.page-title .actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.muted { color: var(--muted); } .small { font-size: .84rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.card-title { font-weight: 700; margin-bottom: .6rem; }
.grid { display: grid; gap: 1rem; } .g2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; text-decoration: none; color: inherit; display: block; }
.tile b { display: block; font-size: 1.6rem; } .tile span { color: var(--muted); font-size: .84rem; }
.btn { appearance: none; background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: 8px; padding: .55rem .95rem; font: inherit; font-weight: 600; cursor: pointer; min-height: 40px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; margin: 0; }
.btn:hover { background: var(--hover); }
.btn-primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); } .btn-primary:hover { background: var(--primary); opacity: .92; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-outline { background: transparent; }
.btn-sm { padding: .3rem .65rem; min-height: 32px; font-size: .85rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }
label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: .25rem; }
input, select, textarea { width: 100%; font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .55rem .7rem; min-height: 40px; appearance: none; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2rem; }
input[type=checkbox] { width: auto; min-height: 0; appearance: auto; }
.fg { margin-bottom: .8rem; } .row { display: flex; gap: .6rem; flex-wrap: wrap; } .row > * { flex: 1 1 140px; }
.alert { padding: .65rem .9rem; border-radius: 8px; margin: 0 0 .8rem; font-size: .9rem; border: 1px solid var(--border); background: var(--hover); }
.alert-danger { border-color: var(--danger); color: var(--danger); background: transparent; } .alert-warn { border-color: var(--warn); color: var(--warn); background: transparent; } .alert-ok { border-color: var(--ok); color: var(--ok); background: transparent; }
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 700; background: var(--hover); border: 1px solid var(--border); white-space: nowrap; }
.b-ok { color: var(--ok); border-color: var(--ok); } .b-warn { color: var(--warn); border-color: var(--warn); } .b-bad { color: var(--danger); border-color: var(--danger); }
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; } .toolbar input { flex: 2 1 200px; } .toolbar select { flex: 1 1 140px; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .75rem; }
.chip { appearance: none; border: 1px solid var(--border); background: var(--surface); color: inherit; font: inherit; font-size: .85rem; padding: .3rem .8rem; border-radius: 999px; cursor: pointer; }
.chip.on { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.tablewrap { max-height: 62vh; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { position: sticky; top: 0; background: var(--hover); z-index: 1; white-space: nowrap; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
td.num, th.num { text-align: right; }
tr:last-child td { border-bottom: 0; }
.nav { background: var(--nav); color: #fff; position: sticky; top: 0; z-index: 50; }
.nav-in { max-width: 1100px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: .6rem; min-height: 52px; }
.brand { color: #fff; font-weight: 800; text-decoration: none; display: flex; align-items: center; gap: .5rem; margin-right: .5rem; }
.brand img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: #fff; }
.links { display: flex; gap: .15rem; flex: 1; overflow-x: auto; scrollbar-width: none; }
.links a { color: rgba(255,255,255,.8); text-decoration: none; padding: .45rem .7rem; border-radius: 8px; white-space: nowrap; font-size: .9rem; }
.links a:hover { background: rgba(255,255,255,.1); } .links a.active { background: rgba(255,255,255,.18); color: #fff; font-weight: 700; }
.nav .who { font-size: .78rem; color: rgba(255,255,255,.75); white-space: nowrap; }
.nav .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); min-height: 32px; padding: .2rem .6rem; font-size: .82rem; }
.dot { background: var(--danger); color: #fff; border-radius: 999px; font-size: .68rem; padding: 0 .4rem; margin-left: .25rem; }
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 600; }
.modal { background: var(--surface); border-radius: 12px; width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; padding: 1.1rem; border: 1px solid var(--border); }
.modal h3 { margin-bottom: .8rem; } .modal .acts { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1rem; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #1f2933; color: #fff; padding: .6rem 1rem; border-radius: 8px; z-index: 900; font-size: .9rem; max-width: 92vw; }
.toast.danger { background: var(--danger); } .toast.success { background: var(--ok); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; margin: 2rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.banner { padding: .5rem 1rem; text-align: center; font-weight: 600; font-size: .86rem; color: #fff; }
.person { display: flex; gap: .8rem; align-items: flex-start; } .avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--hover); border: 1px solid var(--border); object-fit: cover; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--muted); }
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.2rem; } .box { width: 100%; max-width: 440px; }
.tabs { display: flex; gap: .3rem; margin-bottom: 1rem; flex-wrap: wrap; }
@media (max-width: 600px) { .nav .who { display: none; } th, td { padding: .5rem .5rem; } }
