:root {
  --bg: #f5f7f8; --panel: #ffffff; --ink: #14212b; --muted: #5d6b76; --line: #dfe5e9;
  --accent: #0f766e; --accent-ink: #ffffff; --accent-soft: #e0f2f0;
  --ok: #15803d; --ok-soft: #dcf5e4; --warn: #a16207; --warn-soft: #fdf1cc;
  --bad: #b42318; --bad-soft: #fde4e1; --info: #1d5fa8; --info-soft: #e1edfb; --off-soft: #eceff1;
  --radius: 10px; --text: var(--ink); --shadow: 0 1px 2px rgba(20,33,43,.06), 0 4px 14px rgba(20,33,43,.05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1619; --panel: #172025; --ink: #e8eef1; --muted: #93a3ad; --line: #26343b;
    --accent: #2dd4bf; --accent-ink: #062a27; --accent-soft: #123532;
    --ok: #4ade80; --ok-soft: #123222; --warn: #facc15; --warn-soft: #3a3210;
    --bad: #f87171; --bad-soft: #3b1816; --info: #7db4f2; --info-soft: #14283f; --off-soft: #222d33;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: system-ui, "Segoe UI", Roboto, Arial, sans-serif; line-height: 1.45; }
h1 { font-size: 1.45rem; margin: 0; } h2 { font-size: 1.1rem; margin: 0; } h3 { font-size: 1rem; margin: 0 0 .5rem; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); } .right { text-align: right; } .nowrap { white-space: nowrap; }

/* shell */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow: auto; display: flex; flex-direction: column; }
.brand { font-weight: 700; font-size: 1.1rem; padding: 4px 10px 14px; color: var(--accent); }
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; margin-top: 2px; }
.nav a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; margin-bottom: 2px; }
.nav a:hover { background: var(--off-soft); }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side .who { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); font-size: .85rem; }
.main { padding: 22px 26px 60px; min-width: 0; max-width: 1400px; }
.topbar { display: none; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .sub { color: var(--muted); font-size: .9rem; margin-top: 2px; }

/* controls */
.btn { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 13px; cursor: pointer; min-height: 36px; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.danger { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.small { padding: 3px 9px; min-height: 28px; font-size: .85rem; }
.btn:disabled { opacity: .55; cursor: default; }
.icon-btn { background: none; border: 0; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--muted); }
input, select, textarea { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; min-height: 36px; max-width: 100%; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 14px; }
.tfield { display: flex; flex-direction: column; gap: 3px; font-size: .8rem; color: var(--muted); }
.tfield input, .tfield select { color: var(--ink); }
.spacer { flex: 1; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 9px 14px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--muted); }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* cards and tables */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .n { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.stat .l { color: var(--muted); font-size: .85rem; }
.stat.ok .n { color: var(--ok); } .stat.warn .n { color: var(--warn); } .stat.bad .n { color: var(--bad); }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: var(--bg); white-space: nowrap; position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--accent-soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 36px; text-align: center; color: var(--muted); background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--off-soft); color: var(--muted); white-space: nowrap; }
.s-present, .s-active, .s-online, .s-approved, .s-done { background: var(--ok-soft); color: var(--ok); }
.s-half_day, .s-pending, .s-on_duty, .s-sent, .s-not_arrived, .s-scheduled { background: var(--info-soft); color: var(--info); }
.s-absent, .s-rejected, .s-failed, .s-offline, .s-suspended { background: var(--bad-soft); color: var(--bad); }
.s-incomplete, .s-never_seen, .s-trial { background: var(--warn-soft); color: var(--warn); }
.tag { display: inline-block; font-size: .72rem; padding: 1px 7px; border-radius: 6px; background: var(--warn-soft); color: var(--warn); margin-left: 4px; }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.pager { display: flex; gap: 10px; align-items: center; margin-top: 12px; color: var(--muted); }

/* modal and forms */
.overlay { position: fixed; inset: 0; background: rgba(10,18,24,.5); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 12px; z-index: 50; overflow: auto; }
.modal { background: var(--panel); border-radius: 12px; width: min(520px, 100%); box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.modal.wide { width: min(860px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 16px 18px; max-height: 68vh; overflow: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: .82rem; color: var(--muted); }
.field.inline { flex-direction: row; align-items: center; gap: 8px; } .field.inline input { min-height: 0; }
.field small { color: var(--muted); font-size: .78rem; }
.req { color: var(--bad); }
.days { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; gap: 5px; align-items: center; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; font-size: .85rem; color: var(--ink); cursor: pointer; }
.chip input { min-height: 0; }
@media (max-width: 560px) { .form { grid-template-columns: 1fr; } }
#toasts { position: fixed; right: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 8px; z-index: 80; max-width: min(380px, calc(100vw - 28px)); }
.toast { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.toast.error { background: var(--bad); color: #fff; } .toast.ok { background: var(--ok); color: #fff; }
.note { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }
.note.info { background: var(--info-soft); color: var(--info); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }

/* roster */
.roster td, .roster th { padding: 5px 6px; text-align: center; }
.roster td:first-child, .roster th:first-child { text-align: left; min-width: 170px; position: sticky; left: 0; background: var(--panel); z-index: 1; }
.cell { width: 100%; min-width: 86px; border: 1px dashed var(--line); border-radius: 6px; background: none; cursor: pointer; padding: 6px 4px; font-size: .82rem; color: var(--muted); }
.cell.set { border-style: solid; border-color: transparent; color: #fff; font-weight: 600; }
.cell.off { background: var(--off-soft); color: var(--muted); border-color: transparent; }
.cell:hover { outline: 2px solid var(--accent); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: min(380px, 100%); padding: 26px; }
.login h1 { color: var(--accent); margin-bottom: 4px; }
.login .field { margin-top: 14px; }
.login .btn { width: 100%; margin-top: 18px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; width: 250px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
  .main { padding: 16px 14px 60px; }
}
@media (max-width: 640px) {
  table.stack thead { display: none; }
  table.stack td { display: flex; justify-content: space-between; gap: 12px; border-bottom: 0; padding: 4px 12px; }
  table.stack td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; }
  table.stack tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--line); }
}
@media print { .side, .topbar, .toolbar, .btn { display: none !important; } .shell { display: block; } .main { padding: 0; } }

/* payroll */
.pay-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.pay-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.pay-col h3 { margin: 0 0 6px; font-size: .95rem; }
.pay-table { width: 100%; border-collapse: collapse; }
.pay-table td { padding: 5px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.pay-total { display: flex; justify-content: space-between; padding-top: 8px; }
.pay-net { display: flex; justify-content: space-between; margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: var(--accent-soft, rgba(15,118,110,.1)); font-size: 1.15rem; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.section-title { margin: 22px 0 8px; font-size: 1rem; }
@media (max-width: 640px) { .pay-cols { grid-template-columns: 1fr; } }
@media print {
  #root { display: none !important; }
  .overlay { position: static !important; background: none !important; display: block !important; padding: 0 !important; }
  .modal, .modal.wide { box-shadow: none !important; width: 100% !important; }
  .modal-actions, .modal-head .icon-btn, .no-print { display: none !important; }
  .modal-body { max-height: none !important; overflow: visible !important; }
}

/* my day / phone home */
.home { max-width: 640px; }
.home .hero { padding: 16px 18px; margin-bottom: 12px; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.quick .btn { text-decoration: none; }
.weeklist { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.weekrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.weekrow:last-child { border-bottom: 0; }

/* right-to-left (Urdu) */
[dir="rtl"] body { font-family: "Noto Naskh Arabic", "Segoe UI", "Urdu Typesetting", Tahoma, system-ui, sans-serif; line-height: 1.7; }
[dir="rtl"] th, [dir="rtl"] td { text-align: right; }
[dir="rtl"] td.num, [dir="rtl"] th.num, [dir="rtl"] .right { text-align: left; }
[dir="rtl"] .side { border-right: 0; border-left: 1px solid var(--line); }
[dir="rtl"] .tag { margin-left: 0; margin-right: 4px; }
[dir="rtl"] #toasts { right: auto; left: 14px; }
[dir="rtl"] .roster td:first-child, [dir="rtl"] .roster th:first-child { text-align: right; left: auto; right: 0; }
[dir="rtl"] input[type="number"], [dir="rtl"] input[type="date"], [dir="rtl"] input[type="time"] { direction: ltr; text-align: right; }
@media (max-width: 860px) { [dir="rtl"] .side { transform: translateX(100%); right: 0; left: auto; } [dir="rtl"] .side.open { transform: none; } }

/* notification bell */
.bell-wrap { position: relative; display: inline-block; }
.bell { position: relative; }
.bell-n { position: absolute; top: -6px; inset-inline-end: -6px; background: var(--bad, #c0392b); color: #fff; border-radius: 10px; font-size: .68rem; padding: 0 5px; line-height: 16px; min-width: 16px; text-align: center; }
.bell-panel { position: fixed; top: 110px; inset-inline-start: 12px; width: min(340px, 86vw); max-height: 70vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 28px rgba(0,0,0,.2); z-index: 90; }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.bell-item { display: block; padding: 10px 12px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.bell-item.unread { background: var(--ok-soft, rgba(13,148,136,.08)); }
.bell-item .small { font-size: .75rem; }
.topbar .bell-wrap { margin-inline-start: auto; }
.topbar .bell-panel { top: 52px; inset-inline-start: auto; inset-inline-end: 8px; }
.side-bell { padding: 0 6px 10px; }
@media (max-width: 860px) { .side-bell { display: none; } }

/* employee pictures */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--line); color: var(--muted); font-weight: 600; background-size: cover; background-position: center; flex: none; }

/* ===== visual refresh ===== */
:root {
  --bg: #f1f4f2; --ink: #10242a; --muted: #566a6e; --line: #dce3df;
  --accent: #0b7a6f; --accent-soft: #dcf0ec;
  --side-bg: #10242a; --side-ink: #d9e6e3; --side-muted: #8aa4a1; --side-hover: rgba(255,255,255,.07); --side-active: rgba(61,214,192,.14); --side-mark: #3dd6c0;
  --radius: 12px; --shadow: 0 1px 2px rgba(16,36,42,.05);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #0c1417; --side-bg: #0a1114; --side-ink: #d9e6e3; } }
html { font-size: 15.5px; }
body { font-family: var(--font); letter-spacing: -.005em; }
h1 { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; }
h3 { font-weight: 650; }
.page-head { margin-bottom: 20px; }
.page-head .sub { font-size: .92rem; }

/* sidebar */
.side { background: var(--side-bg); border-right: 0; padding: 18px 12px 14px; }
.brand { color: #fff; font-size: 1.12rem; letter-spacing: -.01em; padding: 2px 10px 16px; }
.brand small { color: var(--side-muted); }
.nav a { display: flex; align-items: center; gap: 11px; color: var(--side-ink); padding: 9px 12px; border-radius: 9px; margin-bottom: 1px; position: relative; transition: background .12s; }
.nav a:hover { background: var(--side-hover); }
.nav a.active { background: var(--side-active); color: #fff; font-weight: 600; }
.nav a.active::before { content: ""; position: absolute; inset-inline-start: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--side-mark); }
.ico { display: inline-flex; flex: none; opacity: .85; } .nav a.active .ico { opacity: 1; color: var(--side-mark); }
.side .who { border-top-color: rgba(255,255,255,.12); color: var(--side-ink); }
.side .who .muted { color: var(--side-muted); }
.side .btn { background: transparent; color: var(--side-ink); border-color: rgba(255,255,255,.2); }
.side .btn:hover { border-color: var(--side-mark); }
.side .bell { color: var(--side-ink); }
.side-bell { padding: 0 6px 12px; }

/* controls */
.btn { border-radius: 9px; transition: border-color .12s, background .12s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn.primary { box-shadow: 0 1px 0 rgba(0,0,0,.12); }
.btn.primary:hover { filter: brightness(1.08); }
input, select, textarea { border-radius: 9px; }

/* cards, tables, badges */
.stat, .card, .table-wrap { border-color: var(--line); }
th { text-transform: none; letter-spacing: 0; font-size: .82rem; font-weight: 600; }
tbody tr { transition: background .1s; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }
.note { border-radius: 10px; display: flex; gap: 8px; align-items: center; }

/* Today board */
.board-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.board-tools input[type="search"] { min-width: 220px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 5px 13px 5px 6px; cursor: pointer; color: var(--ink); transition: border-color .12s, background .12s; }
.seg-btn:hover { border-color: var(--accent); }
.seg-n { min-width: 26px; height: 26px; border-radius: 999px; display: inline-grid; place-items: center; font-weight: 700; font-size: .85rem; background: var(--off-soft); font-variant-numeric: tabular-nums; }
.seg-btn.ok .seg-n { background: var(--ok-soft); color: var(--ok); } .seg-btn.bad .seg-n { background: var(--bad-soft); color: var(--bad); }
.seg-btn.warn .seg-n { background: var(--warn-soft); color: var(--warn); } .seg-btn.wait .seg-n { background: var(--info-soft); color: var(--info); }
.seg-btn.on { background: var(--ink); color: var(--bg); border-color: var(--ink); } .seg-btn.on .seg-n { background: rgba(255,255,255,.18); color: inherit; }
.tl { --tlw: 210px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tl-head { display: grid; grid-template-columns: var(--tlw) 1fr; border-bottom: 1px solid var(--line); background: var(--bg); }
.tl-axiswrap { position: relative; height: 30px; margin-inline-end: 18px; }
.tl-axis span { position: absolute; top: 7px; transform: translateX(-50%); font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-body { position: relative; max-height: 62vh; overflow: auto; }
.tl-row { display: grid; grid-template-columns: var(--tlw) 1fr; align-items: center; border-bottom: 1px solid var(--line); min-height: 46px; cursor: default; }
.tl-row:last-child { border-bottom: 0; } .tl-row:hover { background: var(--accent-soft); }
.tl-who { padding: 6px 12px; display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.tl-who strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; } .tl-who span { font-size: .78rem; }
.tl-track { position: relative; height: 46px; margin-inline-end: 18px; }
.tl-track i, .tl-track b { position: absolute; }
.tl-grid { top: 0; bottom: 0; width: 1px; background: var(--line); opacity: .6; }
.tl-plan { top: 14px; height: 18px; border-radius: 5px; background: var(--accent-soft); outline: 1px dashed color-mix(in srgb, var(--accent) 40%, transparent); }
.tl-late { top: 14px; height: 18px; background: repeating-linear-gradient(135deg, var(--warn-soft) 0 4px, transparent 4px 8px); border-radius: 5px 0 0 5px; }
.tl-bar { top: 17px; height: 12px; border-radius: 6px; min-width: 6px; }
.tl-bar.live::after { content: ""; position: absolute; inset-inline-end: -3px; top: -2px; width: 16px; height: 16px; border-radius: 50%; background: inherit; opacity: .35; animation: tl-pulse 1.8s ease-out infinite; }
@keyframes tl-pulse { from { transform: scale(.6); opacity: .5; } to { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tl-bar.live::after { animation: none; } }
.tl-q { top: 12px; width: 20px; height: 20px; margin-inline-start: -2px; border-radius: 50%; background: var(--warn); color: #fff; display: grid; place-items: center; font-size: .75rem; z-index: 2; }
.tl-nowwrap { position: absolute; top: 0; bottom: 0; inset-inline-start: var(--tlw); inset-inline-end: 18px; pointer-events: none; }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bad); opacity: .7; }
@media (max-width: 640px) { .tl { --tlw: 118px; } .tl-who span { display: none; } .board-tools input[type="search"] { width: 100%; } }

/* phone: tab bar */
.tabbar { display: none; }
@media (max-width: 860px) {
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset-inline: 0; bottom: 0; z-index: 35; background: var(--panel); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 7px; font-size: .7rem; color: var(--muted); text-decoration: none; }
  .tabbar a.active { color: var(--accent); font-weight: 600; }
  .main { padding-bottom: 84px; }
  .side { background: var(--side-bg); }
  #toasts { bottom: 78px; }
}

/* loading */
.skel { border-radius: 10px; background: linear-gradient(90deg, var(--off-soft) 25%, var(--line) 50%, var(--off-soft) 75%); background-size: 200% 100%; animation: skel 1.3s linear infinite; }
@keyframes skel { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
.tl-note { position: absolute; top: 13px; margin-inline-start: 8px; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.tl-note.bad { color: var(--bad); font-weight: 600; }
.side .bell-wrap .bell { background: transparent; border-color: rgba(255,255,255,.2); }
.shell > div { min-width: 0; } .tl-body { overflow-x: hidden; overflow-y: auto; }

/* ===== modern shell (v3) ===== */
:root { --radius: 14px; --ring: color-mix(in srgb, var(--accent) 24%, transparent); --bar-bg: color-mix(in srgb, var(--bg) 82%, transparent); }
:root[data-theme="dark"] {
  --bg: #0c1417; --panel: #152024; --ink: #e6eef0; --muted: #93a6ab; --line: #24343a;
  --accent: #34d3be; --accent-ink: #062a27; --accent-soft: #12332f;
  --ok: #4ade80; --ok-soft: #123222; --warn: #facc15; --warn-soft: #3a3210; --bad: #f87171; --bad-soft: #3b1816; --info: #7db4f2; --info-soft: #14283f; --off-soft: #1e2b30;
  --side-bg: #0a1114; --shadow: none;
}
.shell { grid-template-columns: 244px minmax(0, 1fr); transition: grid-template-columns .2s ease; }
.shell.rail { grid-template-columns: 72px minmax(0, 1fr); }
.col { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.main { width: 100%; max-width: 1440px; margin: 0 auto; padding: 8px 28px 60px; }
.page-head h1 { font-size: 1.55rem; }

.bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; height: 62px; padding: 0 28px; background: var(--bar-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.bar-title { font-size: 1.02rem; font-weight: 650; letter-spacing: -.01em; margin: 0 14px 0 0; white-space: nowrap; }
.bar .spacer { flex: 1; }
.bar-btn, .bar .bell { width: 38px; height: 38px; min-height: 38px; padding: 0; display: inline-grid; place-items: center; border-radius: 50%; border: 1px solid transparent; background: transparent; color: var(--ink); cursor: pointer; position: relative; transition: background .12s; }
.bar-btn:hover, .bar .bell:hover { background: var(--off-soft); }
.bar .bell { font-size: 1.05rem; }
.menu-btn { display: none; }
.searchbtn { display: flex; align-items: center; gap: 10px; min-width: 300px; height: 38px; padding: 0 8px 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.searchbtn:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.searchbtn .st { flex: 1; text-align: start; }
kbd { font: inherit; font-size: .72rem; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); }
.umenu-wrap { position: relative; }
.bar-btn.user { width: 40px; height: 40px; }
.bar-btn.user .avatar { width: 34px; height: 34px; background: var(--accent); color: var(--accent-ink); font-size: .8rem; }
.umenu { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); width: 220px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.18); padding: 6px; z-index: 60; animation: pop .14s ease-out; }
.umenu-who { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.umenu-item { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; text-align: start; padding: 9px 12px; border-radius: 8px; cursor: pointer; color: var(--ink); }
.umenu-item:hover { background: var(--off-soft); }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }

/* sidebar, rail mode */
.side { padding: 16px 12px 12px; width: 244px; transition: width .2s ease; }
.shell.rail .side { width: 72px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 18px; }
.mark { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--side-mark); color: #0a2a27; font-weight: 800; }
.brand-t { line-height: 1.2; min-width: 0; } .brand-t small { display: block; }
.nav-t { white-space: nowrap; overflow: hidden; }
.shell.rail .brand-t, .shell.rail .nav-t { display: none; }
.shell.rail .brand { justify-content: center; padding-inline: 0; }
.shell.rail .nav a, .shell.rail .rail-btn { justify-content: center; padding-inline: 0; }
.rail-btn { margin-top: auto; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; border: 0; background: none; color: var(--side-muted); cursor: pointer; }
.rail-btn:hover { background: var(--side-hover); color: var(--side-ink); }
.shell.rail .nav a.active::before { inset-inline-start: -12px; }

/* controls */
.btn { min-height: 38px; border-radius: 10px; font-weight: 550; }
.btn.small { min-height: 30px; }
input, select, textarea { min-height: 40px; border-radius: 10px; transition: border-color .12s, box-shadow .12s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.btn:focus-visible, .nav a:focus-visible, .bar-btn:focus-visible, .searchbtn:focus-visible, tr.click:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tabs { border-bottom: 0; background: var(--off-soft); padding: 4px; border-radius: 12px; display: inline-flex; margin-bottom: 18px; gap: 2px; }
.tabs button { border: 0; border-radius: 9px; padding: 7px 14px; font-weight: 550; }
.tabs button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* surfaces */
.card, .stat, .table-wrap, .tl, .weeklist { border-radius: var(--radius); box-shadow: none; }
.table-wrap { background: var(--panel); }
th { padding: 11px 14px; background: color-mix(in srgb, var(--bg) 60%, var(--panel)); }
td { padding: 11px 14px; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--ink); }
th[aria-sort="ascending"]::after { content: " ↑"; color: var(--accent); } th[aria-sort="descending"]::after { content: " ↓"; color: var(--accent); }
tr.click { cursor: pointer; }
.avatar { background: var(--accent-soft); color: var(--accent); }
.avatar.big { width: 64px; height: 64px; font-size: 1.3rem; }
.empty { border-radius: var(--radius); padding: 44px 20px; }

/* dialogs and toasts */
.overlay { background: rgba(8,16,20,.5); backdrop-filter: blur(3px); }
.modal { border-radius: 16px; animation: pop .16s ease-out; }
.modal-head { border-bottom: 0; padding: 18px 22px 6px; } .modal-body { padding: 8px 22px 16px; } .modal-actions { border-top: 0; padding: 8px 22px 18px; }
.toast { border-radius: 12px; padding: 12px 16px; border-inline-start: 4px solid var(--accent); animation: pop .16s ease-out; }
.toast.error { border-inline-start-color: #fff; } .toast.ok { border-inline-start-color: #fff; }

/* side panel (person) */
.scrim { position: fixed; inset: 0; z-index: 70; background: rgba(8,16,20,.42); backdrop-filter: blur(2px); display: flex; justify-content: flex-end; animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.drawer { width: min(440px, 100%); height: 100%; background: var(--panel); border-inline-start: 1px solid var(--line); overflow: auto; position: relative; animation: slide-in .2s ease-out; }
@keyframes slide-in { from { transform: translateX(32px); opacity: .4; } to { transform: none; opacity: 1; } }
[dir="rtl"] .drawer { animation-name: slide-in-rtl; } @keyframes slide-in-rtl { from { transform: translateX(-32px); opacity: .4; } to { transform: none; opacity: 1; } }
.dr-close { position: absolute; top: 12px; inset-inline-end: 14px; }
.dr-body { padding: 26px 24px 30px; }
.dr-head { display: flex; gap: 16px; align-items: center; margin-bottom: 8px; } .dr-head h2 { font-size: 1.25rem; letter-spacing: -.01em; }
.dr-h { margin: 24px 0 10px; font-size: .9rem; color: var(--muted); font-weight: 600; }
.strip { display: grid; grid-template-columns: repeat(15, 1fr); gap: 5px; }
.strip .dot { aspect-ratio: 1; border-radius: 5px; background: var(--off-soft); display: block; }
.strip .dot.s-present { background: var(--ok); } .strip .dot.s-half_day { background: var(--info); } .strip .dot.s-absent { background: var(--bad); }
.strip .dot.s-incomplete { background: var(--warn); } .strip .dot.s-on_duty { background: var(--accent); } .strip .dot.s-leave { background: #8b7cf0; }
.strip .dot.s-weekly_off, .strip .dot.s-holiday { background: var(--line); }
.dr-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.dr-stats div { background: var(--off-soft); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; } .dr-stats strong { font-size: 1.15rem; } .dr-stats span { font-size: .75rem; color: var(--muted); }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); } .kv span:last-child { text-align: end; }
.dr-actions { display: flex; gap: 8px; margin-top: 24px; flex-wrap: wrap; } .dr-actions .btn { text-decoration: none; }

/* search palette */
.scrim.top { align-items: flex-start; justify-content: center; padding-top: 12vh; }
.palette { width: min(640px, calc(100vw - 24px)); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.35); overflow: hidden; animation: pop .14s ease-out; align-self: flex-start; }
.pal-input { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.pal-input input { flex: 1; border: 0; box-shadow: none; background: transparent; font-size: 1.05rem; color: var(--ink); min-height: 34px; padding: 0; }
.pal-input input:focus { box-shadow: none; }
.pal-list { max-height: min(56vh, 460px); overflow: auto; padding: 6px; }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; cursor: pointer; }
.pal-item.on { background: var(--accent-soft); }
.pal-item > div { flex: 1; min-width: 0; } .pal-kind { margin-inline-start: auto; }
.pal-item .ico { color: var(--muted); } .small { font-size: .8rem; }

/* sign-in */
.login { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); padding: 0; place-items: stretch; }
.login-art { background: var(--side-bg); color: #fff; padding: 56px 52px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art h2 { font-size: 2.1rem; line-height: 1.12; letter-spacing: -.025em; max-width: 15ch; margin: 0 0 14px; }
.login-art p { color: var(--side-muted); max-width: 36ch; margin: 0; }
.login-bars { display: grid; gap: 12px; margin: 38px 0; opacity: .95; }
.login-bars i { display: block; height: 14px; border-radius: 7px; background: var(--side-mark); }
.login-bars i:nth-child(2n) { background: #7be0cf; } .login-bars i:nth-child(3n) { background: #f2b84b; }
.login-form { display: grid; place-items: center; padding: 28px; }
.login-form .card { width: min(380px, 100%); border: 0; box-shadow: none; background: transparent; padding: 0; }
.login-form h1 { color: var(--ink); font-size: 1.7rem; }
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; } .login-art { display: none; }
  .shell, .shell.rail { grid-template-columns: minmax(0, 1fr); }
  .side, .shell.rail .side { width: 260px; }
  .shell.rail .brand-t, .shell.rail .nav-t { display: inline; } .shell.rail .nav a { justify-content: flex-start; padding-inline: 12px; }
  .rail-btn { display: none; }
  .bar { padding: 0 14px; height: 56px; } .menu-btn { display: inline-grid; }
  .searchbtn { min-width: 0; width: 38px; padding: 0; justify-content: center; } .searchbtn .st, .searchbtn kbd { display: none; }
  .bar-title { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
  .main { padding: 6px 14px 90px; }
  .topbar { display: none; }
}
@media (prefers-reduced-motion: reduce) { .modal, .toast, .umenu, .drawer, .palette, .scrim { animation: none; } .shell { transition: none; } }
input[type="checkbox"], input[type="radio"] { min-height: 0; width: 18px; height: 18px; padding: 0; accent-color: var(--accent); cursor: pointer; }
.tfield input[type="checkbox"] { margin: 8px 0; }

/* ===== v22: shared widgets and screen layouts ===== */
.avatar.tint { background: hsl(var(--hue, 200) 70% 90%); color: hsl(var(--hue, 200) 55% 30%); }
:root[data-theme="dark"] .avatar.tint { background: hsl(var(--hue, 200) 35% 24%); color: hsl(var(--hue, 200) 80% 80%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar.tint { background: hsl(var(--hue, 200) 35% 24%); color: hsl(var(--hue, 200) 80% 80%); } }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person .pn { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.person .pn strong, .person .pn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; font-size: .82rem; font-weight: 600; cursor: default; }
button.chip { cursor: pointer; transition: transform .12s, background .12s; }
button.chip:hover { transform: translateY(-1px); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip.ok { color: var(--ok); } .chip.warn { color: var(--warn); } .chip.bad { color: var(--bad); } .chip.info { color: var(--info); }
.chip.on.ok, .chip.on.warn, .chip.on.bad, .chip.on.info { color: var(--accent-ink); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0 0 16px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.kpi .kl { color: var(--muted); font-size: .8rem; } .kpi strong { font-size: 1.5rem; line-height: 1.2; } .kpi .ks { color: var(--muted); font-size: .78rem; }
.kpi.ok strong { color: var(--ok); } .kpi.warn strong { color: var(--warn); } .kpi.bad strong { color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--bad); }
.okc { color: var(--ok); font-weight: 600; } b.bad { color: var(--bad); }
.small { font-size: .8rem; } .nowrap { white-space: nowrap; }
.sec { margin: 18px 0 10px; font-size: .95rem; color: var(--muted); font-weight: 600; }

/* request cards */
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.rcard { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); transition: box-shadow .15s, transform .15s; }
.rcard:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.rc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rc-title { font-size: 1rem; } .rc-meta { color: var(--muted); font-size: .85rem; }
.rcard blockquote { margin: 0; padding: 8px 12px; border-inline-start: 3px solid var(--line); color: var(--muted); font-size: .88rem; }
.rc-actions { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.pair { display: inline-flex; gap: 6px; align-items: baseline; margin-inline-start: 10px; font-variant-numeric: tabular-nums; }
.pair i { font-style: normal; color: var(--muted); font-size: .75rem; }

/* devices */
.dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.dcard { padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; gap: 12px; }
.dc-top { display: flex; align-items: center; gap: 12px; } .dc-name { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.dc-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .dc-facts div { display: flex; flex-direction: column; font-size: .85rem; } .dc-facts span { color: var(--muted); font-size: .75rem; } .dc-facts b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.dc-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.pulse { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--muted); }
.pulse.on { background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: pulse 2s infinite; }
.pulse.warn { background: var(--warn); } .pulse.bad { background: var(--bad); }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .pulse.on { animation: none; } }

/* payslips (employee) */
.hero-pay { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 22px; border-radius: var(--radius); background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #000)); color: var(--accent-ink); }
.hero-pay > div { display: flex; flex-direction: column; gap: 4px; } .hero-pay .muted { color: inherit; opacity: .8; } .hero-pay strong { font-size: 2rem; }
.hero-pay .btn { background: #fff; color: #111; border-color: #fff; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.pcard { display: flex; flex-direction: column; gap: 4px; text-align: start; padding: 14px; font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; transition: transform .12s, box-shadow .12s; }
.pcard:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.08); } .pcard strong { font-size: 1.25rem; }

/* audit */
.aitem { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.adot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--info); } .adot.ok { background: var(--ok); } .adot.bad { background: var(--bad); }
.ab { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* payroll */
.stepper { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 16px; flex-wrap: wrap; }
.stepper li { flex: 1; min-width: 150px; display: flex; gap: 10px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--muted); }
.stepper li div { display: flex; flex-direction: column; line-height: 1.25; } .stepper li span:not(.sn) { font-size: .75rem; }
.stepper .sn { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--line); font-weight: 700; font-size: .8rem; flex: none; }
.stepper .done .sn { background: var(--ok); color: #fff; } .stepper .now { border-color: var(--accent); color: var(--text); } .stepper .now .sn { background: var(--accent); color: var(--accent-ink); }
.costbar { margin: 0 0 16px; } .costbar .cbar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--line); gap: 2px; }
.seg.a, .sw.a { background: var(--ok); } .seg.b, .sw.b { background: var(--warn); } .seg.c, .sw.c { background: var(--info); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: .8rem; color: var(--muted); } .legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.rungrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.runcard { text-align: start; font: inherit; color: var(--text); padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; display: flex; flex-direction: column; gap: 12px; transition: transform .12s, box-shadow .12s; }
.runcard:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.rc-h { display: flex; justify-content: space-between; gap: 8px; align-items: center; } .rc-net { display: flex; flex-direction: column; } .rc-net strong { font-size: 1.6rem; }
.rc-f { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }

/* attendance calendar */
.cal-bar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.cal-nav { display: flex; align-items: center; gap: 10px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.ch { text-align: center; font-size: .75rem; color: var(--muted); padding: 4px 0; }
.cd { display: flex; flex-direction: column; gap: 2px; min-height: 76px; padding: 6px 8px; font: inherit; text-align: start; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; overflow: hidden; }
.cd.blank { visibility: hidden; border: 0; } .cd:disabled { cursor: default; } .cd:not(:disabled):hover { border-color: var(--accent); }
.cd.today { outline: 2px solid var(--accent); } .cd b { font-size: .85rem; } .cd .ct { font-size: .7rem; color: var(--muted); font-variant-numeric: tabular-nums; } .cd .late { font-size: .66rem; color: var(--warn); font-style: normal; }
.cd.c-present, .sw.c-present { background: var(--ok-soft); } .cd.c-half_day, .sw.c-half_day { background: var(--info-soft); } .cd.c-absent, .sw.c-absent { background: var(--bad-soft); }
.cd.c-incomplete, .sw.c-incomplete { background: var(--warn-soft); } .cd.c-leave, .sw.c-leave { background: color-mix(in srgb, #8b7cf0 18%, var(--panel)); }
.cd.c-weekly_off, .cd.c-holiday, .cd.c-future, .sw.c-weekly_off { background: var(--off-soft); } .cd.c-future { opacity: .55; }
.cd.c-absent b { color: var(--bad); }
@media (max-width: 640px) { .cd { min-height: 56px; padding: 4px; } .cd .ct { display: none; } .rgrid, .dgrid { grid-template-columns: 1fr; } }

/* ===== phone punch, assets, blacklist ===== */
.punch { display: flex; flex-direction: column; gap: 12px; align-items: stretch; margin-bottom: 14px; }
.pc-btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; padding: 14px 18px; border: 0; border-radius: 16px; background: var(--accent); color: var(--accent-ink); font: inherit; font-size: 1.15rem; font-weight: 650; cursor: pointer; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); transition: transform .12s, opacity .12s; }
.pc-btn:active { transform: scale(.98); } .pc-btn:disabled { opacity: .7; cursor: default; }
.pc-btn .ico svg { width: 24px; height: 24px; }
.pc-btn.busy .ico { animation: pcspin 1s linear infinite; } @keyframes pcspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pc-btn.busy .ico { animation: none; } }
.pc-msg { min-height: 1.4em; font-size: .92rem; } .pc-msg.ok { color: var(--ok); } .pc-msg.warn { color: var(--warn); } .pc-msg.bad { color: var(--bad); }
.pc-today { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); } .btn.ghost:hover { color: var(--ink); border-color: var(--line); }
.ok-note { padding: 8px 12px; border-radius: 8px; background: var(--ok-soft); color: var(--ok); }
.small { font-size: .82rem; }
.chip.ok, .chip.info, .chip.bad, .chip.warn { cursor: default; }
.geo { font-size: .8rem; } .geo.out { color: var(--bad); font-weight: 600; }
.dr-flag { display: inline-block; margin-top: 6px; }

/* career timeline */
ol.career { list-style: none; margin: 0; padding: 0 0 0 14px; border-inline-start: 2px solid var(--line); }
ol.career li { position: relative; display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 0 0 18px 16px; }
ol.career li::before { content: ""; position: absolute; inset-inline-start: -21px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--teal, #0f766e); border: 2px solid var(--surface, #fff); }
ol.career li.k-joined::before { background: var(--muted); }
ol.career .cd { color: var(--muted); font-size: .85rem; padding-top: 1px; }
@media (max-width: 560px) { ol.career li { grid-template-columns: 1fr; gap: 2px; } }
ol.career .cd { background: none; border: 0; padding: 1px 0 0; box-shadow: none; }

/* profile page */
.pcover { height: 120px; border-radius: var(--radius) var(--radius) 0 0; background: linear-gradient(120deg, var(--accent), #14857b 55%, #0b5d56); position: relative; overflow: hidden; }
.pcover::after { content: ""; position: absolute; inset-inline-end: -40px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.08); }
.phead { display: flex; gap: 18px; align-items: flex-end; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-top: 0; padding: 0 20px 16px; border-radius: 0 0 var(--radius) var(--radius); margin-bottom: 10px; }
.pav { margin-top: -54px; border: 4px solid var(--panel); border-radius: 50%; background: var(--panel); line-height: 0; flex: none; }
.pwho { flex: 1; min-width: 200px; padding-top: 10px; } .pwho h2 { font-size: 1.35rem; margin-bottom: 2px; }
.pwho .chips { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.pact { display: flex; gap: 8px; flex-wrap: wrap; }
.pcomp { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; } .pbarbg { flex: 0 1 220px; height: 6px; border-radius: 4px; background: var(--off-soft); overflow: hidden; } .pbarbg i { display: block; height: 100%; background: var(--accent); }
.ptabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 14px; scrollbar-width: thin; }
.ptab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; cursor: pointer; color: var(--muted); white-space: nowrap; font-weight: 500; }
.ptab.on { color: var(--accent); border-bottom-color: var(--accent); } .pcount { margin-inline-start: 6px; background: var(--off-soft); border-radius: 10px; padding: 0 7px; font-size: .75rem; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.pgrid .kv:last-child { border-bottom: 0; }
.card-h { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 6px; } .card-h h3 { margin: 0; }
.card.rec { margin-bottom: 10px; padding: 14px 16px; } .rec-act { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.pendingrec { display: flex; justify-content: space-between; align-items: center; border-style: dashed; }
.files { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; } .filechip { display: inline-flex; align-items: center; gap: 4px; background: var(--off-soft); border-radius: 14px; padding: 3px 10px; font-size: .85rem; }
.filechip .x { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 1rem; line-height: 1; }
ol.career.feed li::before { background: var(--accent); } .ficon { display: inline-block; width: 1.6em; }
.switchrow { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; } .switchrow input { margin-top: 4px; width: 18px; height: 18px; }
.diff { margin-top: 8px; display: grid; gap: 4px; } .drow { display: grid; grid-template-columns: 140px 1fr 20px 1fr; gap: 8px; font-size: .9rem; align-items: start; }
.drow .old { color: var(--muted); text-decoration: line-through; } .drow .new { font-weight: 600; }
.reqline { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 560px) { .phead { padding: 0 14px 14px; } .pav { margin-top: -44px; } .drow { grid-template-columns: 1fr; } .drow span:nth-child(3) { display: none; } }

/* ===== v4: modern look ===== */
:root {
  --bg: #f4f6fb; --panel: #ffffff; --ink: #0f1b2d; --muted: #61708a; --line: #e5eaf3;
  --accent: #0f9a8a; --accent-2: #3b82f6; --accent-ink: #fff; --accent-soft: #e3f6f3;
  --grad: linear-gradient(135deg, #14b8a6 0%, #0e8f9c 55%, #3b82f6 140%);
  --side-bg: #0c1626; --side-ink: #c9d4e6; --side-muted: #7b8aa3; --side-mark: #34e0c8;
  --side-hover: rgba(255,255,255,.06); --side-active: linear-gradient(90deg, rgba(52,224,200,.18), rgba(52,224,200,.04));
  --ok: #12945a; --ok-soft: #dcf6e8; --warn: #b86e00; --warn-soft: #fff0cf; --bad: #d1344b; --bad-soft: #fde6ea;
  --info: #2f6fd6; --info-soft: #e4eeff; --off-soft: #eef1f7;
  --radius: 16px; --shadow: 0 1px 2px rgba(15,27,45,.04), 0 8px 24px -12px rgba(15,27,45,.12);
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #0a111d; --panel: #111b2b; --ink: #e8eef9; --muted: #92a2bd; --line: #1f2c42; --accent: #2dd4bf; --accent-soft: #0f2f33; --side-bg: #070d17; --off-soft: #17233a; --shadow: 0 8px 24px -14px rgba(0,0,0,.6); } }
:root[data-theme="dark"] { --bg: #0a111d; --panel: #111b2b; --ink: #e8eef9; --muted: #92a2bd; --line: #1f2c42; --accent: #2dd4bf; --accent-soft: #0f2f33; --side-bg: #070d17; --off-soft: #17233a; --shadow: 0 8px 24px -14px rgba(0,0,0,.6); }
body { background: var(--bg); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
.main { animation: rise .35s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .main { animation: none; } }
h1 { letter-spacing: -.03em; }
.page-head h1 { font-size: 1.75rem; font-weight: 750; }

/* sidebar */
.side { background: radial-gradient(120% 60% at 0% 0%, #12304a 0%, transparent 55%), var(--side-bg); }
.nav-group { margin: 16px 12px 6px; font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--side-muted); }
.nav-group:first-child { margin-top: 4px; }
.shell.rail .nav-group { height: 1px; margin: 10px 14px; font-size: 0; background: rgba(255,255,255,.1); }
.nav a { border-radius: 11px; padding: 9px 12px; font-weight: 500; transition: background .15s, transform .15s; }
.nav a:hover { background: var(--side-hover); transform: translateX(2px); }
.nav a.active { background: var(--side-active); box-shadow: inset 0 0 0 1px rgba(52,224,200,.18); }
.nav a.active::before { box-shadow: 0 0 12px var(--side-mark); background: var(--side-mark); }
.mark { background: var(--grad); color: #fff; box-shadow: 0 6px 16px -6px rgba(20,184,166,.8); }

/* top bar */
.bar { background: color-mix(in srgb, var(--bg) 70%, transparent); border-bottom-color: transparent; }
.searchbtn { background: var(--panel); border-color: var(--line); box-shadow: var(--shadow); }
.bar-btn.user .avatar { background: var(--grad); color: #fff; }

/* buttons & inputs */
.btn { border-radius: 11px; border-color: var(--line); background: var(--panel); font-weight: 550; box-shadow: 0 1px 1px rgba(15,27,45,.04); }
.btn:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); box-shadow: 0 4px 12px -6px rgba(15,27,45,.2); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 16px -8px rgba(14,143,156,.9); }
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 10px 22px -10px rgba(14,143,156,.95); }
input, select, textarea { border-radius: 11px; border-color: var(--line); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
.toolbar { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }

/* cards, tables */
.card, .stat, .table-wrap, .tl { border-radius: var(--radius); border-color: var(--line); box-shadow: var(--shadow); }
.table-wrap { overflow: hidden; overflow-x: auto; }
th { background: color-mix(in srgb, var(--off-soft) 70%, var(--panel)); color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 650; border-bottom: 1px solid var(--line); }
td { border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent); }
tbody tr:hover { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.badge { padding: 3px 10px; font-size: .75rem; }
.stat .n { font-weight: 750; letter-spacing: -.03em; }
.tabs { border-radius: 14px; }
.tabs button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(15,27,45,.14); }
.note { border-radius: 12px; border: 1px solid color-mix(in srgb, currentColor 14%, transparent); }
.overlay { backdrop-filter: blur(4px); background: rgba(8,16,30,.45); }
.modal { border-radius: 20px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.45); animation: pop .18s ease-out; }
.seg-btn { box-shadow: var(--shadow); }
.seg-btn.on { background: var(--ink); }
.toast { border-radius: 12px; }

/* dashboard overview */
.ov { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; margin-bottom: 8px; }
.ov-left { display: grid; gap: 16px; align-content: start; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile { display: flex; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -14px rgba(15,27,45,.25); }
.tile-ico { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 13px; background: var(--accent-soft); color: var(--accent); }
.tile.ok .tile-ico { background: var(--ok-soft); color: var(--ok); } .tile.bad .tile-ico { background: var(--bad-soft); color: var(--bad); } .tile.off .tile-ico { background: var(--off-soft); color: var(--muted); }
.tile-n { font-size: 1.65rem; font-weight: 750; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tile-l { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.ring-card { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.donut { --p: 0; width: 132px; height: 132px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--off-soft) 0); position: relative; }
.donut::before { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: var(--panel); }
.donut > div { position: relative; text-align: center; line-height: 1.1; }
.donut strong { display: block; font-size: 1.7rem; letter-spacing: -.03em; } .donut span { font-size: .72rem; color: var(--muted); }
.ring-t { flex: 1; min-width: 200px; } .ring-t p { margin: 0 0 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .82rem; color: var(--muted); }
.lg i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-inline-end: 6px; background: var(--muted); }
.lg.ok i { background: var(--ok); } .lg.wait i { background: var(--info); } .lg.bad i { background: var(--bad); } .lg.warn i { background: var(--warn); } .lg b { color: var(--ink); }
.dept-card h3 { margin-bottom: 12px; }
.dbars { display: grid; gap: 12px; }
.drow { display: grid; grid-template-columns: minmax(70px, 110px) 1fr auto; gap: 10px; align-items: center; font-size: .86rem; }
.dn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 550; } .dv { color: var(--muted); font-variant-numeric: tabular-nums; }
.dbar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--off-soft); gap: 2px; }
.dbar i { display: block; } .dbar .ok { background: var(--ok); } .dbar .warn { background: #f2b84b; } .dbar .wait { background: #93b6f2; } .dbar .bad { background: var(--bad); }
@media (max-width: 1100px) { .ov { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .donut { width: 108px; height: 108px; } }

/* profile hero */
.pf-cover, .profile-cover { background: var(--grad) !important; }

/* sign-in */
.login-art { background: radial-gradient(90% 70% at 85% 10%, #1e6a8f 0%, transparent 60%), radial-gradient(70% 60% at 0% 100%, #0e8f7e 0%, transparent 55%), #0a1424; padding: 44px 52px; }
.login-art .brandline { display: flex; align-items: center; gap: 12px; font-size: 1.15rem; }
.login-art .mark { width: 34px; height: 34px; border-radius: 10px; }
.login-hero { max-width: 520px; }
.login-art h2 { font-size: 2.6rem; font-weight: 800; max-width: 14ch; }
.login-art p { color: #a9bdd6; font-size: 1.02rem; }
.login-art .foot { color: #6f86a6; }
.float-stack { position: relative; height: 230px; margin-top: 40px; }
.fcard { position: absolute; display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 16px; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(14px); box-shadow: 0 18px 40px -18px rgba(0,0,0,.6); animation: bob 6s ease-in-out infinite; min-width: 250px; }
.fcard strong { display: block; font-size: .92rem; } .fcard small { color: #a9bdd6; }
.f1 { top: 0; left: 0; } .f2 { top: 70px; left: 70px; animation-delay: -2s; } .f3 { top: 140px; left: 20px; animation-delay: -4s; }
.fdot { width: 12px; height: 12px; border-radius: 50%; } .fdot.ok { background: #34e0c8; box-shadow: 0 0 12px #34e0c8; } .fdot.gold { background: #f2b84b; box-shadow: 0 0 12px #f2b84b; }
.fring { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(#34e0c8 92%, rgba(255,255,255,.15) 0); position: relative; }
.fring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #13283c; } .fring b { position: relative; font-size: .72rem; }
@keyframes bob { 50% { transform: translateY(-7px); } }
@media (prefers-reduced-motion: reduce) { .fcard { animation: none; } }
.login-form { background: var(--bg); }
.login-form .card { background: var(--panel); border: 1px solid var(--line); box-shadow: 0 30px 60px -30px rgba(15,27,45,.25); padding: 34px; border-radius: 22px; }
.login-form h1 { font-size: 1.9rem; font-weight: 800; }
.login-form .btn { height: 44px; font-size: 1rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .login-form .card { box-shadow: none; } }

/* ===== shared bits (both skins) ===== */
.umenu-label { padding: 8px 12px 2px; font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 700; }
.skinpick { display: flex; gap: 4px; margin: 4px 8px 8px; padding: 3px; background: var(--off-soft); border-radius: 999px; }
.skinpick button { flex: 1; border: 0; background: none; padding: 6px 10px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 600; transition: background .2s, color .2s, box-shadow .2s; }
.skinpick button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 4px rgba(15,27,45,.18); }
.bar-brand, .topnav { display: none; }
.mcal { margin-bottom: 14px; } .mcal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; } .mcal-head h3 { margin: 0; }
.mcal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.mcal-grid b { font-size: .7rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding-bottom: 2px; }
.mcal-day { position: relative; padding: 9px 0 13px; border-radius: 12px; font-size: .9rem; font-variant-numeric: tabular-nums; transition: transform .15s, background .15s; }
.mcal-day:hover { background: var(--off-soft); transform: translateY(-2px); }
.mcal-day.today { background: var(--accent); color: #fff; font-weight: 700; box-shadow: 0 8px 18px -8px var(--accent); }
.mcal-day.future { color: var(--muted); opacity: .55; }
.mcal-day .mdot { position: absolute; left: 50%; bottom: 4px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--muted); }
.mcal-day .mdot.ok { background: var(--ok); } .mcal-day .mdot.warn { background: #f2b84b; } .mcal-day .mdot.bad { background: var(--bad); } .mcal-day .mdot.info { background: var(--info); } .mcal-day .mdot.off { background: #b6bfce; }
.mcal-day.today .mdot { box-shadow: 0 0 0 2px rgba(255,255,255,.7); }
@property --p { syntax: "<number>"; inherits: false; initial-value: 0; }
@keyframes fillp { from { --p: 0; } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes sheen { to { transform: translateX(260%) skewX(-20deg); } }
@keyframes glowpulse { 50% { box-shadow: 0 0 0 8px rgba(47,108,246,0); } }
body[data-fresh] .page-head, body[data-fresh] .card, body[data-fresh] .tile, body[data-fresh] .stat, body[data-fresh] .kpi, body[data-fresh] .table-wrap, body[data-fresh] .tl, body[data-fresh] .rcard, body[data-fresh] .note, body[data-fresh] .toolbar, body[data-fresh] .board-tools, body[data-fresh] .tabs { animation: rise .55s cubic-bezier(.2,.8,.2,1) both; animation-delay: var(--d, 0ms); }
body[data-fresh] .donut { animation: fillp 1.3s cubic-bezier(.2,.8,.2,1) .2s both; }
body[data-fresh] .dbar i { transform-origin: left; animation: grow .9s cubic-bezier(.2,.8,.2,1) .25s both; }
@media (prefers-reduced-motion: reduce) { body[data-fresh] * { animation: none !important; } }

/* ===== MODERN skin ===== */
:root[data-skin="modern"] {
  --bg: #e6eaf2; --frame: #f2f4f9; --panel: #fbfcff; --ink: #14203a; --muted: #6b7893; --line: rgba(110,125,165,.16);
  --accent: #2f6bf5; --accent-soft: #e5edff; --accent-ink: #fff; --ring: rgba(47,107,245,.22);
  --grad: linear-gradient(135deg, #4f8bff 0%, #2f6bf5 55%, #5a52f0 130%);
  --ok: #17a05d; --ok-soft: #dff6ea; --warn: #c27a00; --warn-soft: #fff1d2; --bad: #e0425a; --bad-soft: #fde8ec; --info: #2f6bf5; --info-soft: #e5edff; --off-soft: #ebeef6;
  --radius: 22px; --shadow: 0 1px 0 #fff inset, 0 16px 34px -20px rgba(40,60,120,.35); --bar-bg: transparent;
}
:root[data-skin="modern"][data-theme="dark"] { --bg: #070b16; --frame: #0e1526; --panel: #141d33; --ink: #e8eefc; --muted: #8e9cbb; --line: rgba(150,170,220,.12); --accent: #5b8cff; --accent-soft: #17254a; --off-soft: #1a2440; --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 18px 36px -22px rgba(0,0,0,.8); }
@media (prefers-color-scheme: dark) { :root[data-skin="modern"]:not([data-theme="light"]) { --bg: #070b16; --frame: #0e1526; --panel: #141d33; --ink: #e8eefc; --muted: #8e9cbb; --line: rgba(150,170,220,.12); --accent: #5b8cff; --accent-soft: #17254a; --off-soft: #1a2440; --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 18px 36px -22px rgba(0,0,0,.8); } }
[data-skin="modern"] body { background: radial-gradient(60% 50% at 10% 0%, rgba(79,139,255,.18), transparent 60%), radial-gradient(50% 40% at 100% 100%, rgba(90,82,240,.14), transparent 60%), var(--bg); background-attachment: fixed; }
[data-skin="modern"] .shell, [data-skin="modern"] .shell.rail { display: block; width: calc(100% - 40px); max-width: 1560px; margin: 20px auto; min-height: calc(100vh - 40px); border-radius: 32px; background: var(--frame); box-shadow: 0 50px 100px -50px rgba(30,45,100,.45), 0 0 0 1px rgba(255,255,255,.5) inset; overflow: clip; }
[data-skin="modern"] .col { min-height: calc(100vh - 40px); }
[data-skin="modern"] .main { padding: 6px 32px 70px; max-width: none; animation: none; }
@media (min-width: 861px) { [data-skin="modern"] .side { display: none; } [data-skin="modern"] .menu-btn { display: none; } }
[data-skin="modern"] .bar-title { display: none; }
[data-skin="modern"] .page-head h1 { font-size: 1.9rem; font-weight: 800; letter-spacing: -.035em; }

/* top bar + pill menu */
[data-skin="modern"] .bar { height: 76px; padding: 0 28px; gap: 18px; background: transparent; backdrop-filter: none; border: 0; position: relative; z-index: 40; }
[data-skin="modern"] .bar-brand { display: flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
[data-skin="modern"] .bar-brand .mark { width: 38px; height: 38px; border-radius: 12px; background: var(--grad); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 20px -8px rgba(47,107,245,.8); }
[data-skin="modern"] .topnav { display: flex; position: relative; align-items: center; gap: 2px; margin: 0 auto; padding: 5px; border-radius: 999px; background: var(--panel); box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.tn-ind { position: absolute; left: 0; top: 5px; bottom: 5px; width: 0; border-radius: 999px; background: var(--grad); box-shadow: 0 10px 22px -8px rgba(47,107,245,.85); transition: transform .45s cubic-bezier(.3,1.3,.5,1), width .35s cubic-bezier(.3,1.3,.5,1), opacity .2s; z-index: 0; }
.tn-item { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: 999px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: none; white-space: nowrap; transition: color .25s; }
.tn-item:hover { color: var(--ink); }
.tn-item.active, .tn-group.active > .tn-item { color: #fff; }
.tn-caret { width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .25s; }
.tn-group { position: relative; z-index: 1; } .tn-group.open .tn-caret { transform: rotate(225deg) translateY(-1px); }
.tn-menu { position: absolute; top: calc(100% + 12px); left: 50%; min-width: 230px; padding: 8px; border-radius: 20px; background: var(--panel); box-shadow: 0 30px 60px -20px rgba(20,35,80,.45), 0 0 0 1px var(--line); opacity: 0; transform: translate(-50%, -8px) scale(.96); transform-origin: top center; pointer-events: none; transition: opacity .2s, transform .25s cubic-bezier(.2,.9,.3,1.2); }
.tn-group.open .tn-menu { opacity: 1; transform: translate(-50%, 0) scale(1); pointer-events: auto; }
.tn-menu a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 13px; color: var(--ink); text-decoration: none; font-weight: 550; font-size: .9rem; transition: background .15s, transform .15s; }
.tn-menu a .ico { color: var(--muted); } .tn-menu a:hover { background: var(--accent-soft); transform: translateX(3px); } .tn-menu a:hover .ico { color: var(--accent); }
.tn-menu a.active { background: var(--accent-soft); color: var(--accent); } .tn-menu a.active .ico { color: var(--accent); }
[data-skin="modern"] .searchbtn { min-width: 0; width: 42px; padding: 0; justify-content: center; border-radius: 50%; height: 42px; background: var(--panel); border: 0; box-shadow: var(--shadow), 0 0 0 1px var(--line); }
[data-skin="modern"] .searchbtn .st, [data-skin="modern"] .searchbtn kbd { display: none; }
[data-skin="modern"] .bar-btn, [data-skin="modern"] .bar .bell { width: 42px; height: 42px; background: var(--panel); box-shadow: var(--shadow), 0 0 0 1px var(--line); transition: transform .2s, box-shadow .2s; }
[data-skin="modern"] .bar-btn:hover, [data-skin="modern"] .bar .bell:hover, [data-skin="modern"] .searchbtn:hover { transform: translateY(-2px); background: var(--panel); }
[data-skin="modern"] .bar .spacer { display: none; }
[data-skin="modern"] .bar .bell-wrap { margin-inline-start: 0; }

/* soft raised cards */
[data-skin="modern"] .card, [data-skin="modern"] .stat, [data-skin="modern"] .tile, [data-skin="modern"] .kpi, [data-skin="modern"] .table-wrap, [data-skin="modern"] .tl, [data-skin="modern"] .rcard, [data-skin="modern"] .toolbar, [data-skin="modern"] .weeklist { background: var(--panel); border: 0; box-shadow: var(--shadow), 0 0 0 1px var(--line); border-radius: var(--radius); }
[data-skin="modern"] .tile, [data-skin="modern"] .stat, [data-skin="modern"] .kpi, [data-skin="modern"] .rcard { transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s; }
[data-skin="modern"] .tile:hover, [data-skin="modern"] .stat:hover, [data-skin="modern"] .kpi:hover, [data-skin="modern"] .rcard:hover { transform: translateY(-4px); box-shadow: 0 1px 0 #fff inset, 0 26px 40px -24px rgba(40,60,120,.5), 0 0 0 1px var(--line); }
[data-skin="modern"] .tile { flex-direction: column-reverse; align-items: flex-start; gap: 4px; padding: 18px 20px; }
[data-skin="modern"] .tile .tile-ico { display: none; }
[data-skin="modern"] .tile-n { font-size: 2.3rem; font-weight: 800; letter-spacing: -.04em; display: flex; align-items: center; gap: 10px; }
[data-skin="modern"] .tile-n::after { content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), 0 0 14px var(--accent); }
[data-skin="modern"] .tile.ok .tile-n::after { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft), 0 0 14px var(--ok); }
[data-skin="modern"] .tile.bad .tile-n::after { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft), 0 0 14px var(--bad); }
[data-skin="modern"] .tile.off .tile-n::after { background: #aeb8cc; box-shadow: 0 0 0 4px var(--off-soft); }
[data-skin="modern"] .tile-n { flex-direction: row; }
[data-skin="modern"] .donut { background: conic-gradient(from 0deg, #4f8bff, #2f6bf5 calc(var(--p) * 1%), var(--off-soft) 0); filter: drop-shadow(0 10px 14px rgba(47,107,245,.3)); }
[data-skin="modern"] .tiles { gap: 14px; }
[data-skin="modern"] .ov { gap: 18px; }
[data-skin="modern"] .stat .n, [data-skin="modern"] .kpi strong { font-weight: 800; letter-spacing: -.04em; }
[data-skin="modern"] th { background: transparent; border-bottom: 1px solid var(--line); }
[data-skin="modern"] td { border-bottom-color: var(--line); }
[data-skin="modern"] tbody tr { transition: background .15s, transform .15s; }
[data-skin="modern"] tbody tr:hover { background: var(--accent-soft); }
[data-skin="modern"] .badge { box-shadow: 0 0 0 1px color-mix(in srgb, currentColor 18%, transparent) inset; }

/* buttons */
[data-skin="modern"] .btn { position: relative; overflow: hidden; height: 40px; min-height: 40px; padding: 0 20px; border-radius: 999px; border: 0; background: var(--panel); color: var(--ink); font-weight: 650; box-shadow: var(--shadow), 0 0 0 1px var(--line); transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .2s, filter .2s; }
[data-skin="modern"] .btn:hover { transform: translateY(-2px); box-shadow: 0 1px 0 #fff inset, 0 14px 24px -14px rgba(40,60,120,.55), 0 0 0 1px var(--line); }
[data-skin="modern"] .btn:active { transform: translateY(0) scale(.96); }
[data-skin="modern"] .btn.small { height: 32px; min-height: 32px; padding: 0 14px; font-size: .84rem; }
[data-skin="modern"] .btn.primary { background: var(--grad); color: #fff; box-shadow: 0 14px 26px -12px rgba(47,107,245,.9), 0 1px 0 rgba(255,255,255,.35) inset; }
[data-skin="modern"] .btn.primary::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); transform: skewX(-20deg); }
[data-skin="modern"] .btn.primary:hover::after { animation: sheen .8s ease; }
[data-skin="modern"] .btn.primary:hover { box-shadow: 0 20px 32px -12px rgba(47,107,245,.95), 0 1px 0 rgba(255,255,255,.35) inset; filter: brightness(1.05); }
[data-skin="modern"] .btn.danger { background: linear-gradient(135deg, #f0607a, #d63a54); box-shadow: 0 14px 26px -12px rgba(214,58,84,.8); color: #fff; }
[data-skin="modern"] .punch-btn, [data-skin="modern"] .btn.big { animation: glowpulse 2.4s ease-in-out infinite; }
[data-skin="modern"] input, [data-skin="modern"] select, [data-skin="modern"] textarea { background: var(--panel); border: 0; box-shadow: 0 0 0 1px var(--line) inset, 0 1px 2px rgba(40,60,120,.06) inset; border-radius: 14px; min-height: 40px; }
[data-skin="modern"] input:focus, [data-skin="modern"] select:focus, [data-skin="modern"] textarea:focus { box-shadow: 0 0 0 2px var(--accent), 0 0 0 6px var(--ring); }
[data-skin="modern"] .tabs { background: var(--panel); box-shadow: var(--shadow), 0 0 0 1px var(--line); padding: 5px; border-radius: 999px; }
[data-skin="modern"] .tabs button { border-radius: 999px; padding: 8px 18px; transition: background .25s, color .25s, box-shadow .25s; }
[data-skin="modern"] .tabs button.on { background: var(--grad); color: #fff; box-shadow: 0 10px 20px -10px rgba(47,107,245,.9); }
[data-skin="modern"] .seg-btn { border: 0; box-shadow: var(--shadow), 0 0 0 1px var(--line); transition: transform .2s, box-shadow .2s; } [data-skin="modern"] .seg-btn:hover { transform: translateY(-2px); }
[data-skin="modern"] .seg-btn.on { background: var(--grad); color: #fff; box-shadow: 0 12px 22px -10px rgba(47,107,245,.9); }
[data-skin="modern"] .tl-bar { background-image: linear-gradient(90deg, rgba(255,255,255,.0), rgba(255,255,255,.28)); }
[data-skin="modern"] .modal { border-radius: 28px; animation: pop .3s cubic-bezier(.2,.9,.3,1.25); }
[data-skin="modern"] .toast { animation: rise .35s cubic-bezier(.2,.9,.3,1.2); border-radius: 16px; }
[data-skin="modern"] .umenu { border-radius: 20px; animation: pop .22s cubic-bezier(.2,.9,.3,1.25); }
[data-skin="modern"] .note { border: 0; border-radius: 16px; }
[data-skin="modern"] .mcal-day.today { background: var(--grad); }
[data-skin="modern"] .login-form .btn { height: 46px; }

/* modern on phones: back to drawer + tab bar */
@media (max-width: 860px) {
  [data-skin="modern"] .shell, [data-skin="modern"] .shell.rail { width: 100%; margin: 0; border-radius: 0; min-height: 100vh; box-shadow: none; }
  [data-skin="modern"] .topnav, [data-skin="modern"] .bar-brand { display: none; }
  [data-skin="modern"] .bar { height: 60px; padding: 0 14px; } [data-skin="modern"] .bar .spacer { display: block; }
  [data-skin="modern"] .bar-title { display: block; font-size: 1.05rem; }
  [data-skin="modern"] .main { padding: 4px 14px 90px; }
  [data-skin="modern"] .tabbar { background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(14px); border: 0; margin: 0 12px 10px; border-radius: 22px; box-shadow: 0 20px 40px -16px rgba(20,35,80,.5), 0 0 0 1px var(--line); }
  [data-skin="modern"] .tabbar a.active { color: var(--accent); }
}
@media (max-width: 1180px) and (min-width: 861px) { .tn-item { padding: 9px 12px; } [data-skin="modern"] .bar-brand span:last-child { display: none; } }

[data-skin="modern"] .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; line-height: 1; }
[data-skin="modern"] .quick { gap: 10px; margin: 14px 0; }
:root[data-skin="modern"][data-theme="dark"] { --ok: #4ade80; --ok-soft: #10301f; --warn: #f5c04a; --warn-soft: #3a2f10; --bad: #ff7a8e; --bad-soft: #3b1a22; --info: #7aa2ff; --info-soft: #17254a; }
@media (prefers-color-scheme: dark) { :root[data-skin="modern"]:not([data-theme="light"]) { --ok: #4ade80; --ok-soft: #10301f; --warn: #f5c04a; --warn-soft: #3a2f10; --bad: #ff7a8e; --bad-soft: #3b1a22; --info: #7aa2ff; --info-soft: #17254a; } }
@media (max-width: 860px) { [data-skin="modern"] .bar .spacer { display: none; } [data-skin="modern"] .bar-title { flex: 1; } }
@media (min-width: 861px) { [data-skin="modern"] .home { max-width: 760px; margin: 0 auto; } }
@media (max-width: 860px) { [data-skin="modern"] .bar-title { font-size: 1rem; margin: 0; overflow: visible; text-overflow: clip; min-width: 64px; } [data-skin="modern"] .bar { gap: 8px; } [data-skin="modern"] .bar-btn, [data-skin="modern"] .bar .bell, [data-skin="modern"] .searchbtn { width: 38px; height: 38px; min-height: 38px; } }
