:root {
  --ink: #0f1f1d; --ink-2: #44504e; --ink-3: #7a8583;
  --bg: #f4f6f5; --card: #fff; --line: #e3e8e6; --line-2: #eef2f0;
  --brand: #134e4a; --brand-2: #0f766e; --brand-soft: #e6f2f0;
  --side: #0d2f2c; --side-ink: #b9cfcb; --side-hi: #ffffff;
  --ok: #15803d; --ok-bg: #e8f6ec; --warn: #b45309; --warn-bg: #fdf3e3; --bad: #b91c1c; --bad-bg: #fdeaea; --info: #1d4ed8; --info-bg: #e9effd;
  --r: 10px; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--brand-2); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { padding: 40px; color: var(--ink-3); }

/* layout */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: #fff; font-weight: 700; font-size: 16px; }
.brand .logo { width: 30px; height: 30px; border-radius: 8px; background: #14b8a6; color: #06302c; display: grid; place-items: center; font-weight: 800; }
.brand small { display: block; font-weight: 400; font-size: 11px; color: var(--side-ink); }
.nav-group { margin: 14px 0 4px; padding: 0 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #7fa39d; }
.nav a { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 7px; color: var(--side-ink); }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.on { background: rgba(20,184,166,.18); color: #fff; }
.nav .ico { width: 18px; text-align: center; }
details.mod summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 7px; }
details.mod summary::-webkit-details-marker { display: none; }
details.mod summary:hover { background: rgba(255,255,255,.06); color: #fff; }
details.mod summary::after { content: "▸"; margin-left: auto; font-size: 10px; transition: transform .15s; }
details.mod[open] summary::after { transform: rotate(90deg); }
details.mod .sub a { padding-left: 37px; font-size: 13px; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar .who { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.menu-btn { display: none; }
.page { padding: 24px 28px 60px; max-width: 1400px; }
.page h1 { font-size: 22px; margin: 0 0 4px; }
.page .lead { color: var(--ink-3); margin: 0 0 20px; }

/* cards & widgets */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.widget { padding: 16px 18px; display: block; color: inherit; transition: border-color .15s, transform .15s; }
a.widget:hover { border-color: #b7d3ce; transform: translateY(-1px); }
.widget .t { color: var(--ink-3); font-size: 12.5px; }
.widget .v { font-size: 26px; font-weight: 700; margin: 6px 0 2px; letter-spacing: -.01em; }
.widget .s { color: var(--ink-2); font-size: 12.5px; min-height: 16px; }
.section-title { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 24px 0 10px; text-transform: uppercase; letter-spacing: .06em; }
.two { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
.ann { padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.ann:last-child { border-bottom: 0; }
.ann h4 { margin: 0 0 4px; font-size: 14px; }
.ann p { margin: 0 0 6px; color: var(--ink-2); white-space: pre-wrap; }
.ann .m { font-size: 12px; color: var(--ink-3); }
.card-h { padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 600; display: flex; align-items: center; gap: 8px; }

/* toolbar + table */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.input, select.input, textarea.input { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 10px; outline: none; min-width: 0; }
.input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(15,118,110,.12); }
.search { width: 260px; }
.btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 14px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { background: #f8faf9; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #0f3f3c; }
.btn.danger { color: var(--bad); }
.btn.big { padding: 14px 28px; font-size: 16px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.table-wrap { overflow: auto; }
table.t { width: 100%; border-collapse: collapse; background: #fff; }
table.t th { text-align: left; font-weight: 600; font-size: 12px; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfb; white-space: nowrap; cursor: pointer; user-select: none; position: sticky; top: 0; }
table.t th.sorted::after { content: " ↓"; }
table.t th.sorted.asc::after { content: " ↑"; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.t tbody tr { cursor: pointer; }
table.t tbody tr:hover td { background: #f7faf9; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 40px; text-align: center; color: var(--ink-3); }
.count { color: var(--ink-3); font-size: 12.5px; margin-top: 8px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eef1f0; color: var(--ink-2); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }
.card-Yellow { background: #fef9c3; color: #854d0e; } .card-Orange { background: #ffedd5; color: #c2410c; }
.card-Red { background: #fee2e2; color: #b91c1c; } .card-Black { background: #1f2937; color: #fff; } .card-Green { background: #dcfce7; color: #166534; }

/* modal */
.overlay { position: fixed; inset: 0; background: rgba(15,31,29,.35); display: flex; justify-content: flex-end; z-index: 50; }
.drawer { width: min(620px, 100%); background: #fff; height: 100%; display: flex; flex-direction: column; box-shadow: -10px 0 30px rgba(0,0,0,.12); animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: .6; } }
.drawer .h { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.drawer .h h2 { margin: 0; font-size: 17px; flex: 1; }
.drawer .b { padding: 18px 22px; overflow-y: auto; flex: 1; }
.drawer .f { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; }
.drawer .f .sp { flex: 1; }
.x { border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--ink-3); line-height: 1; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form .full { grid-column: 1 / -1; }
.fld label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 5px; font-weight: 500; }
.fld .input { width: 100%; }
.fld .ro { padding: 8px 0; color: var(--ink); min-height: 36px; white-space: pre-wrap; }
.fld .req { color: var(--bad); }
.dialog { margin: auto; background: #fff; border-radius: 12px; width: min(440px, 92%); padding: 22px; box-shadow: 0 20px 50px rgba(0,0,0,.2); }
.dialog h3 { margin: 0 0 10px; }
.dialog p { color: var(--ink-2); margin: 0 0 14px; }
.dialog .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.err { background: var(--bad-bg); color: var(--bad); padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; }

#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #0f1f1d; color: #fff; padding: 11px 16px; border-radius: 9px; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 560px; }
.toast.bad { background: var(--bad); }

/* notifications */
.bell-wrap { position: relative; }
.bell { position: relative; padding: 7px 11px; }
.badge { position: absolute; top: -6px; right: -6px; background: var(--bad); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 700; padding: 1px 6px; }
.bell-panel { position: absolute; right: 0; top: 44px; width: 360px; max-width: 92vw; z-index: 30; box-shadow: 0 12px 30px rgba(0,0,0,.14); }
.bell-list { max-height: 420px; overflow-y: auto; }
.notif { display: block; padding: 11px 16px; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.notif:hover { background: #f7faf9; }
.notif b { display: block; font-size: 13.5px; }
.notif span { display: block; color: var(--ink-2); font-size: 12.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif small { color: var(--ink-3); font-size: 11.5px; }
.notif.unread { background: var(--brand-soft); }
.notif.unread b::before { content: "● "; color: var(--brand-2); }

/* login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login .art { background: radial-gradient(1200px 600px at -10% 110%, #14b8a6 0%, transparent 55%), var(--side); color: #fff; padding: 60px; display: flex; flex-direction: column; justify-content: space-between; }
.login .art h1 { font-size: 38px; line-height: 1.15; margin: 0 0 14px; max-width: 460px; }
.login .art p { color: #b9cfcb; max-width: 440px; line-height: 1.6; }
.login .depts { display: flex; flex-wrap: wrap; gap: 8px; max-width: 460px; }
.login .depts span { border: 1px solid rgba(255,255,255,.18); padding: 5px 12px; border-radius: 999px; font-size: 13px; color: #d8e7e4; }
.login form { margin: auto; width: min(360px, 88%); }
.login form h2 { margin: 0 0 6px; }
.login form .fld { margin-bottom: 14px; }

/* clock */
.clock { padding: 30px; text-align: center; }
.clock .time { font-size: 54px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.clock .meta { color: var(--ink-3); margin-bottom: 22px; }
.clock .state { display: flex; gap: 30px; justify-content: center; margin: 20px 0 6px; }
.clock .state div b { display: block; font-size: 20px; }
.clock .state div span { color: var(--ink-3); font-size: 12.5px; }

/* progress */
.bar { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; background: var(--brand-2); border-radius: 99px; }
.bar.done i { background: var(--ok); }
.big-progress { padding: 18px 20px; }
.big-progress .n { font-size: 30px; font-weight: 700; }
.big-progress .bar { height: 12px; margin-top: 10px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 7px 14px; cursor: pointer; }
.seg button.on { background: var(--brand); color: #fff; }

/* payslip */
.payslip { max-width: 720px; padding: 34px 38px; }
.payslip .top { display: flex; justify-content: space-between; border-bottom: 2px solid var(--brand); padding-bottom: 14px; margin-bottom: 18px; }
.payslip h2 { margin: 0; color: var(--brand); }
.payslip table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.payslip td { padding: 8px 4px; border-bottom: 1px solid var(--line-2); }
.payslip td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.payslip tr.total td { font-weight: 700; font-size: 16px; border-top: 2px solid var(--ink); border-bottom: 0; }
.payslip .kv { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; color: var(--ink-2); }
.payslip .kv b { color: var(--ink); }

.settings-row { padding: 14px 18px; border-bottom: 1px solid var(--line-2); display: grid; grid-template-columns: 260px 1fr auto; gap: 14px; align-items: start; }
.settings-row code { font-size: 12px; color: var(--ink-3); }
.settings-row textarea { width: 100%; min-height: 90px; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; }
  .menu-btn { display: inline-block; }
  .two { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; } .login .art { display: none; }
  .form { grid-template-columns: 1fr; }
  .page { padding: 18px 14px 50px; } .topbar { padding: 10px 14px; }
  .search { width: 100%; }
  .hide-sm { display: none !important; }
  .settings-row { grid-template-columns: 1fr; }
}
@media print {
  .side, .topbar, .no-print, #toast { display: none !important; }
  .shell { display: block; } .page { padding: 0; } body { background: #fff; } .card { border: 0; box-shadow: none; }
}
