/* Management System - look and feel. Works offline (no outside fonts or files). */
:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #1d2433;
  --ink-2: #4a5468;
  --muted: #6b7486;
  --line: #e3e6ec;
  --line-2: #d3d8e0;
  --primary: #0f766e;
  --primary-dark: #0b5c56;
  --primary-soft: #e3f3f1;
  --side: #13213a;
  --side-ink: #c5cede;
  --side-active: #1f3354;
  --danger: #c0392b;
  --danger-soft: #fbeceb;
  --warn: #9a6400;
  --warn-soft: #fff5e0;
  --ok: #18794e;
  --ok-soft: #e7f6ee;
  --info: #1d5fa8;
  --info-soft: #e8f1fc;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", "Noto Sans Devanagari", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 .2rem; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; font-weight: 620; }
p { margin: 0 0 .75rem; }
.sprite { display: none; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -3px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: Consolas, "Courier New", monospace; }
.center, .center-text { text-align: center; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }
.inline-form { display: inline-flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin: .15rem .3rem .15rem 0; }
.inline-form select { width: auto; min-width: 8rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.shell { display: flex; min-height: 100vh; background: linear-gradient(to right, var(--side) 248px, var(--bg) 248px); }
.sidebar { width: 248px; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; flex: none; }
.brand { display: flex; align-items: center; gap: .7rem; padding: 1.1rem 1.1rem 1rem; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-mark { width: 36px; height: 36px; border-radius: 9px; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 1.1rem; flex: none; }
.brand-logo { width: 36px; height: 36px; object-fit: contain; background: #fff; border-radius: 8px; padding: 2px; flex: none; }
.brand-name { color: #fff; font-weight: 620; line-height: 1.25; font-size: .95rem; }
.menu { padding: .6rem .6rem 1rem; flex: 1; }
.menu-group { text-transform: uppercase; font-size: .7rem; letter-spacing: .08em; color: #7d8aa3; padding: 1rem .7rem .35rem; }
.menu-item { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 8px; color: var(--side-ink); font-size: .93rem; }
.menu-item:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.menu-item.active { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 #2dd4bf; }
.sidebar-foot { font-size: .72rem; color: #66738c; padding: .8rem 1.1rem; border-top: 1px solid rgba(255,255,255,.07); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 1rem; background: var(--card); border-bottom: 1px solid var(--line); padding: .6rem 1.5rem; position: sticky; top: 0; z-index: 5; }
.topbar-title { font-weight: 600; color: var(--ink-2); flex: 1; }
.userbox { display: flex; align-items: center; gap: .4rem; }
.user-info { display: flex; flex-direction: column; text-align: right; line-height: 1.2; margin-right: .4rem; }
.user-info span { font-size: .78rem; color: var(--muted); }
.content { padding: 1.5rem; max-width: 1280px; width: 100%; }
.nav-toggle, .nav-button, .nav-backdrop { display: none; }

/* ---------- cards & page ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1.25rem; }
.card.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.page-head p { margin: 0; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.count { display: inline-block; background: var(--primary-soft); color: var(--primary-dark); font-size: .8rem; font-weight: 600; padding: .1rem .55rem; border-radius: 99px; vertical-align: 4px; }
.back-link { display: inline-block; font-size: .85rem; margin-bottom: .3rem; }
.section-title { font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: .5rem 0 0; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid transparent; border-radius: 8px; padding: .5rem .95rem; font: inherit; font-weight: 550; cursor: pointer; text-decoration: none; line-height: 1.3; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-light { background: #fff; border-color: var(--line-2); color: var(--ink); }
.btn-light:hover { background: #f6f7f9; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: #f0f2f5; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a93226; }
.btn-sm { padding: .3rem .6rem; font-size: .85rem; }
.btn-icon { padding: .3rem .45rem; }
.btn-block { width: 100%; padding: .7rem; }
.danger-text { color: var(--danger) !important; }
:focus-visible { outline: 3px solid #5eead4; outline-offset: 1px; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.25rem; }
.form-grid .wide { grid-column: 1 / -1; }
.stack { display: flex; flex-direction: column; gap: .9rem; }
.field label { display: block; font-weight: 560; font-size: .88rem; margin-bottom: .3rem; color: var(--ink-2); }
.req { color: var(--danger); }
.opt { color: var(--muted); font-weight: 400; font-size: .85em; }
input:not([type=checkbox]):not([type=file]), select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: 8px; padding: .52rem .7rem; }
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap input { padding-right: 2.6rem !important; }
.pw-eye { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center;
  justify-content: center; width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: 6px; background: transparent;
  color: var(--muted); cursor: pointer; }
.pw-eye:hover, .pw-eye:focus-visible { color: var(--ink); background: #f1f3f5; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(15,118,110,.15); }
input[readonly], select:disabled, textarea[readonly] { background: #f6f7f9; color: var(--ink-2); }
textarea { resize: vertical; }
.help { font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.has-error input:not([type=checkbox]):not([type=file]), .has-error select, .has-error textarea { border-color: var(--danger); background: #fffafa; }
.error-text { font-size: .82rem; color: var(--danger); margin-top: .25rem; font-weight: 500; }
.check { display: flex !important; align-items: center; gap: .55rem; font-weight: 500 !important; cursor: pointer; padding: .3rem 0; color: var(--ink) !important; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.field-bool { align-self: end; }
.form-actions { display: flex; gap: .6rem; justify-content: flex-end; padding-top: .5rem; border-top: 1px solid var(--line); margin-top: .25rem; }
.record-meta { padding-top: .25rem; }

/* ---------- toolbar & table ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: .8rem; }
.toolbar select { width: auto; max-width: 240px; }
.search-box { position: relative; flex: 1 1 220px; }
.search-box .icon { position: absolute; left: .65rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box input { padding-left: 2.1rem !important; }
.date-filter { display: flex; align-items: center; gap: .35rem; font-size: .85rem; color: var(--muted); }
.date-filter input { width: auto; }
.table-card { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafbfc; border-bottom: 1px solid var(--line); padding: .65rem .9rem; white-space: nowrap; }
.table td { padding: .65rem .9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafcfc; }
.sort { color: inherit; display: inline-flex; align-items: center; gap: .25rem; }
.sort .icon { width: 13px; height: 13px; opacity: .35; }
.sort.sorted { color: var(--primary-dark); }
.sort.sorted .icon { opacity: 1; }
.row-link { font-weight: 600; color: var(--ink); }
.actions-col { text-align: right; white-space: nowrap; width: 1%; }
.actions-col .btn { margin-left: .25rem; }
.empty { padding: 2.5rem 1rem; text-align: center; color: var(--muted); }
.pager { display: flex; gap: .75rem; align-items: center; justify-content: center; margin: -.25rem 0 1.25rem; color: var(--muted); font-size: .9rem; }
.details pre { white-space: pre-wrap; word-break: break-word; font-size: .78rem; max-width: 420px; background: #f6f7f9; padding: .5rem; border-radius: 6px; margin: .3rem 0 0; }
.details summary { cursor: pointer; color: var(--primary); font-size: .85rem; }

/* ---------- pills & tags ---------- */
.pill { display: inline-block; padding: .1rem .55rem; border-radius: 99px; font-size: .78rem; font-weight: 600; }
.pill-yes { background: var(--ok-soft); color: var(--ok); }
.pill-no { background: #f0f1f4; color: var(--muted); }
.tag { display: inline-block; padding: .08rem .5rem; border-radius: 6px; font-size: .75rem; font-weight: 600; background: #eef0f4; color: var(--ink-2); text-transform: capitalize; white-space: nowrap; }
.tag-create, .tag-restore, .tag-login, .tag-setup, .tag-manual { background: var(--ok-soft); color: var(--ok); }
.tag-edit, .tag-settings, .tag-permissions, .tag-password, .tag-auto { background: var(--info-soft); color: var(--info); }
.tag-delete, .tag-purge, .tag-login_failed, .tag-locked, .tag-restore_backup, .tag-before-restore { background: var(--danger-soft); color: var(--danger); }
.tag-backup, .tag-export, .tag-uploaded { background: var(--warn-soft); color: var(--warn); }

/* ---------- alerts ---------- */
.alert { border-radius: 8px; padding: .75rem 1rem; margin-bottom: 1rem; border: 1px solid transparent; transition: opacity .6s; }
.alert .icon { margin-right: .25rem; }
.alert-success { background: var(--ok-soft); color: #11603d; border-color: #bfe6d0; }
.alert-error { background: var(--danger-soft); color: #962d22; border-color: #f2c4bf; }
.alert-warning { background: var(--warn-soft); color: #7a4f00; border-color: #f3dca8; }
.alert-info { background: var(--info-soft); color: #174d88; border-color: #c4dbf5; }
.alert.fade { opacity: 0; }

/* ---------- dashboard ---------- */
.welcome { margin-bottom: 1.25rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .2rem; color: var(--ink); border-top: 3px solid var(--primary); }
.stat:hover { text-decoration: none; border-color: var(--line-2); }
.stat-label { font-size: .82rem; color: var(--muted); font-weight: 550; }
.stat-value { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; }
.stat-small { font-size: 1.05rem; padding-top: .5rem; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.25rem; }
.dash-grid .card { margin-bottom: 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: auto 1fr; gap: .1rem .6rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.tl-text { font-size: .9rem; }
.tl-meta { grid-column: 2; font-size: .78rem; color: var(--muted); }
.plain-list { margin: 0; padding-left: 1.1rem; color: var(--ink-2); }
.plain-list li { margin-bottom: .35rem; }

/* ---------- company, settings, permissions ---------- */
.company-layout { display: grid; grid-template-columns: 260px 1fr; gap: 1.25rem; align-items: start; }
.logo-preview { height: 140px; border: 1px dashed var(--line-2); border-radius: 8px; display: grid; place-items: center; margin-bottom: 1rem; background: #fafbfc; }
.logo-preview img { max-width: 90%; max-height: 120px; object-fit: contain; }
.logo-card .stack { margin-bottom: .5rem; }
.preview-strip { display: flex; gap: 2.5rem; flex-wrap: wrap; }
.preview-strip div { display: flex; flex-direction: column; }
.preview-strip strong { font-size: 1.15rem; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.perm-group { margin: 0; }
.perm-group legend { font-weight: 650; padding: 0 .3rem; }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding: .8rem 0; border-top: 0; }
.confirm-icon { width: 56px; height: 56px; margin: .25rem auto .75rem; border-radius: 50%; display: grid; place-items: center; background: var(--warn-soft); color: var(--warn); }
.confirm-icon.danger { background: var(--danger-soft); color: var(--danger); }
.confirm-icon .icon { width: 28px; height: 28px; }
.confirm-actions { display: flex; gap: .6rem; justify-content: center; margin-top: 1rem; }
.error-code { font-size: 3rem; font-weight: 800; color: var(--line-2); }

/* ---------- login / setup pages ---------- */
body.plain { background: linear-gradient(160deg, #13213a 0%, #1b3354 45%, #0f766e 140%); min-height: 100vh; }
.plain-wrap { max-width: 420px; margin: 0 auto; padding: 3.5rem 1rem 2rem; }
.plain-wrap.wide { max-width: 760px; }
.plain-brand { text-align: center; margin-bottom: 1.25rem; color: #fff; }
.plain-logo { max-height: 70px; max-width: 200px; background: #fff; padding: 6px 10px; border-radius: 10px; margin-bottom: .6rem; }
.plain-name { font-size: 1.35rem; font-weight: 650; }
.plain-card { padding: 1.75rem; border: 0; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.plain-title { text-align: center; margin-bottom: 1rem; }
.plain-foot { text-align: center; color: rgba(255,255,255,.6); font-size: .8rem; margin-top: 1rem; }

/* ---------- tablet & phone ---------- */
@media (max-width: 1000px) {
  .dash-grid, .company-layout { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 30; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .nav-toggle:checked ~ .shell .sidebar { transform: none; }
  .nav-toggle:checked ~ .shell .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 20; }
  .shell { background: var(--bg); }
  .nav-button { display: inline-flex; cursor: pointer; padding: .35rem; border-radius: 8px; }
  .nav-button .icon { width: 22px; height: 22px; }
  .content { padding: 1rem; }
  .topbar { padding: .5rem 1rem; }
  .hide-sm { display: none; }
}
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .user-info { display: none; }
  .toolbar select { max-width: none; flex: 1 1 45%; }
  h1 { font-size: 1.3rem; }
}
@media print {
  .sidebar, .topbar, .toolbar, .page-actions, .actions-col, .pager { display: none !important; }
  .card { box-shadow: none; border: 0; }
  body { background: #fff; }
}

/* ---------- full system: shared bits ---------- */
.num, .table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.pad { padding: 1rem 1.25rem; }
.pre-line { white-space: pre-line; }
.warn-text { color: var(--warn); }
.push { margin-left: auto; }
.table.compact td, .table.compact th { padding: .4rem .6rem; }
.table tfoot td { border-top: 2px solid var(--line-2); background: #fafbfc; }
.dash-grid.three { grid-template-columns: repeat(3, 1fr); }
.quick-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.stat-danger { border-top-color: var(--danger); }
.stat-danger .stat-value { color: var(--danger); }
.stat-warn { border-top-color: #e0a100; }
.progress { display: block; height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: .4rem; }
.progress-bar { display: block; height: 100%; background: var(--primary); }
.w-0 { width: 0%; } .w-5 { width: 5%; } .w-10 { width: 10%; } .w-15 { width: 15%; } .w-20 { width: 20%; } .w-25 { width: 25%; } .w-30 { width: 30%; } .w-35 { width: 35%; } .w-40 { width: 40%; } .w-45 { width: 45%; } .w-50 { width: 50%; } .w-55 { width: 55%; } .w-60 { width: 60%; } .w-65 { width: 65%; } .w-70 { width: 70%; } .w-75 { width: 75%; } .w-80 { width: 80%; } .w-85 { width: 85%; } .w-90 { width: 90%; } .w-95 { width: 95%; } .w-100 { width: 100%; } 

/* badges: coloured by value */
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 99px; font-size: .76rem; font-weight: 600; background: #eef0f4; color: var(--ink-2); white-space: nowrap; }
.b-active, .b-paid, .b-done, .b-approved, .b-present, .b-received, .b-completed, .b-in, .b-yes { background: var(--ok-soft); color: var(--ok); }
.b-in_progress, .b-issued, .b-planned, .b-normal, .b-open, .b-review, .b-purchase, .b-opening { background: var(--info-soft); color: var(--info); }
.b-pending, .b-partly_paid, .b-on_hold, .b-high, .b-todo, .b-unpaid, .b-half_day, .b-on_leave, .b-adjust, .b-draft { background: var(--warn-soft); color: var(--warn); }
.b-urgent, .b-rejected, .b-cancelled, .b-absent, .b-resigned, .b-terminated, .b-out, .b-sale, .b-damaged { background: var(--danger-soft); color: var(--danger); }
.b-low, .b-week_off, .b-holiday { background: #f0f1f4; color: var(--muted); }

/* bell */
.bell { position: relative; }
.bell-count { position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; background: var(--danger); color: #fff; font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center; }
.note-list { list-style: none; margin: 0; padding: 0; }
.note-list li { border-bottom: 1px solid var(--line); }
.note-list li:last-child { border-bottom: 0; }
.note-btn { all: unset; box-sizing: border-box; display: flex; gap: .8rem; align-items: center; width: 100%; padding: .75rem .5rem; cursor: pointer; }
.note-btn:hover { background: #f7f8fa; }
.note-text { display: flex; flex-direction: column; flex: 1; }
.note-dot { width: 9px; height: 9px; border-radius: 50%; background: transparent; flex: none; }
.unread .note-dot { background: var(--primary); }
.note-list li:not(.unread) strong { font-weight: 500; color: var(--ink-2); }

/* forms extra */
.file-current { display: flex; align-items: center; gap: .5rem; margin-bottom: .35rem; font-size: .9rem; }
.file-links { font-size: .9rem; }
.decide-form, .inline-add { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.decide-form input[type=text], .inline-add input[type=text] { flex: 1; min-width: 200px; }
.reason-box { width: 100%; margin-bottom: 1rem; }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; }
.mini-stats div { display: flex; flex-direction: column; }
.related .card-head > div { display: flex; gap: .4rem; }
.bulk-bar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
.form-actions.pad { padding: 1rem; }

/* reports */
.report-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .75rem; }
.report-link { display: flex; gap: .7rem; align-items: flex-start; padding: .8rem .9rem; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); }
.report-link:hover { border-color: var(--primary); text-decoration: none; background: var(--primary-soft); }
.report-link span { display: flex; flex-direction: column; }
.report-link .icon { color: var(--primary); flex: none; margin-top: 2px; }

/* dashboard chart and task list */
.bar-chart { width: 100%; height: auto; }
.bar-chart .bar { fill: var(--primary); }
.bar-chart .axis { stroke: var(--line-2); }
.bar-chart .bar-label { font-size: 12px; fill: var(--muted); }
.bar-chart .bar-value { font-size: 11px; fill: var(--ink-2); }
.task-list { list-style: none; margin: 0; padding: 0; }
.task-list li { display: flex; gap: .6rem; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.task-list li a { flex: 1; min-width: 150px; font-weight: 550; }
.task-list li:last-child { border-bottom: 0; }

/* project and task pages */
.detail-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; margin: 0; }
.facts dt { color: var(--muted); font-size: .85rem; }
.facts dd { margin: 0; }
.status-buttons { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.check-row { display: flex; align-items: center; gap: .6rem; padding: .35rem 0; border-bottom: 1px dashed var(--line); }
.check-row.is-done span { text-decoration: line-through; color: var(--muted); }
.tick { width: 22px; height: 22px; border: 2px solid var(--line-2); border-radius: 6px; background: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; color: #fff; }
.is-done .tick { background: var(--primary); border-color: var(--primary); }
.tick .icon { width: 14px; height: 14px; }
.inline-add { margin-top: .75rem; }
.comments { list-style: none; margin: 0 0 1rem; padding: 0; }
.comments li { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.comments p { margin: .25rem 0 0; }
.comment-head { display: flex; gap: .5rem; align-items: baseline; }

/* task board */
.board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 1rem; overflow-x: auto; padding-bottom: .5rem; }
.board-col { background: #eceff3; border-radius: var(--radius); padding: .75rem; min-height: 200px; }
.board-col h2 { font-size: .95rem; margin: 0 0 .75rem; display: flex; justify-content: space-between; }
.task-card { background: var(--card); border-radius: 8px; padding: .65rem .75rem; margin-bottom: .6rem; box-shadow: var(--shadow); border-left: 4px solid var(--line-2); }
.task-card.prio-high { border-left-color: #e0a100; }
.task-card.prio-urgent { border-left-color: var(--danger); }
.task-card.prio-normal { border-left-color: var(--info); }
.task-title { display: block; font-weight: 600; color: var(--ink); margin-bottom: .3rem; }
.task-meta { display: flex; flex-wrap: wrap; gap: .3rem .7rem; color: var(--muted); }
.task-meta .icon { width: 13px; height: 13px; vertical-align: -2px; }
.move-form select { width: 100%; margin-top: .5rem; font-size: .8rem; padding: .25rem .4rem; }
.col-done .task-card { opacity: .75; }

/* attendance month grid */
.att-grid th, .att-grid td { padding: .3rem .35rem; text-align: center; font-size: .8rem; }
.att-grid td:first-child, .att-grid th:first-child { text-align: left; }
.att-grid th.sun { color: var(--danger); }
.att-P { background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.att-A { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.att-H, .att-L { background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.att-HO, .att-W { color: var(--muted); }
.att-WFH { background: var(--info-soft); color: var(--info); font-weight: 600; }

/* invoice / purchase editor */
.lines-table td { padding: .35rem .3rem; vertical-align: top; }
.lines-table input, .lines-table select { width: 100%; padding: .4rem .45rem; }
.lines-table .w-desc { min-width: 200px; }
.lines-table input.w-s { min-width: 64px; }
.lines-table input.w-m { min-width: 96px; }
.lines-table select.js-product { min-width: 150px; }
.lines-table select.js-tax { min-width: 76px; }
.lines-table .js-amount { padding-top: .75rem; font-weight: 600; white-space: nowrap; }
.totals-box { margin-left: auto; max-width: 340px; display: flex; flex-direction: column; gap: .3rem; margin-top: 1rem; }
.totals-box div { display: flex; justify-content: space-between; gap: 1rem; }
.totals-box .grand { border-top: 2px solid var(--ink); padding-top: .35rem; font-size: 1.1rem; }

/* printed documents (invoice, payslip, lists, reports) */
body.print-page { background: #e9ecf0; }
.print-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .75rem 1rem; background: var(--side); }
.print-bar .muted { color: var(--side-ink); }
.print-head { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem .5rem; background: #fff; }
.print-table { background: #fff; width: 100%; }
.doc { position: relative; background: #fff; max-width: 210mm; margin: 1.25rem auto; padding: 14mm 14mm 10mm; box-shadow: 0 2px 12px rgba(0,0,0,.12); font-size: 13px; }
.doc h1 { font-size: 1.35rem; margin: 0 0 .2rem; }
.doc h2 { font-size: 1.25rem; margin: 0 0 .4rem; text-transform: uppercase; letter-spacing: .04em; color: var(--primary-dark); }
.doc-head { display: flex; justify-content: space-between; gap: 1.5rem; border-bottom: 2px solid var(--primary); padding-bottom: .8rem; margin-bottom: .8rem; }
.doc-company { display: flex; gap: .8rem; align-items: flex-start; }
.doc-logo { max-height: 64px; max-width: 120px; }
.doc-title { text-align: right; }
.doc-meta { margin-left: auto; border-collapse: collapse; }
.doc-meta th { text-align: left; font-weight: 600; padding: .1rem .6rem .1rem 0; color: var(--ink-2); }
.doc-meta td { text-align: right; padding: .1rem 0; }
.copy-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.bill-to { margin-bottom: .8rem; }
.doc-info { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.doc-info th, .doc-info td { border: 1px solid var(--line-2); padding: .35rem .5rem; text-align: left; }
.doc-info th { background: #f5f7f9; width: 18%; font-weight: 600; }
.doc-lines, .doc-tax { width: 100%; border-collapse: collapse; }
.doc-lines th, .doc-lines td, .doc-tax th, .doc-tax td { border: 1px solid var(--line-2); padding: .35rem .5rem; }
.doc-lines thead th, .doc-tax thead th { background: #f0f4f4; text-align: left; }
.doc-lines thead th.num, .doc-tax thead th.num { text-align: right; }
.doc-tax { margin-bottom: .6rem; font-size: 12px; }
.doc-bottom { display: flex; gap: 1.5rem; margin-top: .8rem; align-items: flex-start; }
.doc-left { flex: 1; }
.doc-totals { border-collapse: collapse; min-width: 240px; }
.doc-totals th { text-align: left; font-weight: 500; padding: .25rem .6rem .25rem 0; }
.doc-totals td { padding: .25rem 0; }
.doc-totals .grand th, .doc-totals .grand td { border-top: 2px solid var(--ink); font-weight: 700; font-size: 1.05rem; padding-top: .4rem; }
.terms { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .5rem; }
.signs { display: flex; justify-content: space-between; margin-top: 3rem; gap: 2rem; }
.signs div { border-top: 1px solid var(--ink-2); padding-top: .3rem; min-width: 180px; text-align: center; }
.signs.single { justify-content: flex-end; }
.signs.single div { border-top: 0; text-align: right; }
.pay-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.net-pay { display: flex; justify-content: space-between; align-items: center; margin: 1rem 0 .3rem; padding: .7rem 1rem; background: var(--primary-soft); border-radius: 8px; font-size: 1.1rem; }
.stamped::after { content: attr(data-stamp); position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-25deg); font-size: 5rem; font-weight: 800; color: rgba(192, 57, 43, .15); pointer-events: none; letter-spacing: .1em; }

@media (max-width: 1000px) {
  .dash-grid.three, .detail-layout { grid-template-columns: 1fr; }
  .mini-stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .pay-cols, .doc-bottom { grid-template-columns: 1fr; flex-direction: column; }
  .doc { padding: 1rem; }
}
@media print {
  .no-print, .print-bar, .bell, .quick-actions { display: none !important; }
  body.print-page { background: #fff; }
  .doc { box-shadow: none; margin: 0; padding: 0; max-width: none; }
  .print-head { padding: 0 0 .5rem; }
  .table th, .table td { padding: .3rem .4rem; font-size: 11px; }
  .badge { border: 1px solid #ccc; }
  a { color: inherit; text-decoration: none; }
  @page { margin: 12mm; }
}
.toolbar input[type=month], .toolbar input[type=date] { width: auto; flex: none; }
.card.soft { background: var(--primary-soft); border-color: transparent; margin-bottom: 1.25rem; }

/* version 3.1: one-time password box, page help, welcome guide, help page */
.big-code code { font-size: 1.4rem; letter-spacing: .08em; padding: 8px 14px; display: inline-block; }
code.break { word-break: break-all; }
.page-help { display: flex; gap: 10px; align-items: flex-start; background: var(--info-soft, #eaf2fb); border: 1px solid #cfe0f3; border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; }
.page-help p { margin: 0; flex: 1; }
.page-help .btn { flex: none; }
.page-help[hidden] { display: none; }
.help-btn { background: none; border: 0; cursor: pointer; color: inherit; padding: 2px 4px; vertical-align: middle; }
.info-tip { display: inline-flex; vertical-align: middle; cursor: help; color: var(--muted, #667); }
.info-tip svg { width: 15px; height: 15px; }
.guide-card { border-left: 4px solid var(--primary, #1f4e79); }
.guide-card ol { margin: 8px 0 12px 18px; padding: 0; }
.guide-card li { margin: 4px 0; }
.howto { margin: 0; padding: 0; list-style: none; }
.howto > li { border-top: 1px solid var(--line, #e3e6ea); padding: 10px 0; }
.howto > li:first-child { border-top: 0; }
.howto details summary { cursor: pointer; font-weight: 600; }
.howto ol { margin: 6px 0 0 18px; }

/* version 3.3: tick many rows */
.bulk-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.bulk-bar select { max-width: 100%; }
.check-col { width: 34px; text-align: center; }
.check-col input { width: 16px; height: 16px; }

/* version 3.3: left menu groups that fold */
.menu-sec > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; border-radius: 6px; user-select: none; }
.menu-sec > summary::-webkit-details-marker { display: none; }
.menu-sec > summary:hover { color: #cbd5e1; }
.menu-sec > summary:focus-visible { outline: 2px solid #2dd4bf; outline-offset: 1px; }
.menu-caret { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin-right: .3rem; }
.menu-sec[open] > summary .menu-caret { transform: rotate(45deg); }

/* version 3.3: security pages */
.sec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.sec-grid .card { margin-bottom: 0; }
.sec-grid h2 { display: flex; align-items: center; gap: .4rem; }
.steps { padding-left: 1.2rem; display: flex; flex-direction: column; gap: 1rem; }
.qr { margin: .6rem 0; }
.qr img { display: block; width: 200px; height: 200px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.setup-key { display: inline-block; margin-top: .3rem; padding: .35rem .6rem; background: #f3f4f6; border-radius: 6px; font-size: 1rem; letter-spacing: .05em; word-break: break-all; }
.code-input { font-size: 1.3rem; letter-spacing: .25em; text-align: center; max-width: 14rem; }
.recovery-codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin: 1rem 0; }
.recovery-codes code { display: block; padding: .5rem; text-align: center; background: #f3f4f6; border-radius: 6px; font-size: 1.05rem; letter-spacing: .08em; }
.payslip-break { break-after: page; page-break-after: always; }
@media print { .payslip-break:last-child { break-after: auto; page-break-after: auto; } }

/* version 4: MANAGEMYOFFICE platform panel */
body.platform .pf-top { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .7rem 1.2rem; background: #0f172a; color: #fff; }
body.platform .pf-brand { font-weight: 700; letter-spacing: .04em; }
body.platform .pf-tag { font-weight: 500; font-size: .75rem; background: #0f766e; padding: .1rem .45rem; border-radius: 999px; margin-left: .3rem; }
body.platform .pf-nav { display: flex; gap: .3rem; flex-wrap: wrap; flex: 1; }
body.platform .pf-nav a { color: #cbd5e1; text-decoration: none; padding: .35rem .6rem; border-radius: 6px; display: inline-flex; align-items: center; gap: .35rem; }
body.platform .pf-nav a.on, body.platform .pf-nav a:hover { background: #1e293b; color: #fff; }
body.platform .pf-out { display: flex; align-items: center; gap: .5rem; }
body.platform .pf-main { max-width: 1150px; margin: 1.2rem auto; padding: 0 1rem; }
.table.compact td, .table.compact th { padding: .35rem .5rem; }
body.platform.pf-in { background: var(--bg, #f3f4f6); color: var(--ink); }
pre.codes { font-size: 1.15rem; letter-spacing: .08em; background: #f8fafc; border: 1px dashed var(--line-2); padding: .8rem 1rem; border-radius: 8px; columns: 2; }
/* version 4.3: staff roles, company code */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .1rem 1rem; margin: .3rem 0 .6rem; }
.check-grid .check { align-items: flex-start; flex-wrap: wrap; }
.check-grid .check .small { flex-basis: 100%; padding-left: 26px; margin-top: -.15rem; }
tr.sub-row td { background: var(--bg, #f7f8fa); padding-top: .2rem; padding-bottom: .6rem; }
tr.sub-row details summary { cursor: pointer; color: var(--primary); font-size: .9rem; }
.code-box { font: 700 1.6rem/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .12em; padding: .6rem 1rem; border: 2px dashed var(--primary); border-radius: 10px; display: inline-block; margin: .4rem 0; }
/* version 4.4: registration and verification */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.verify-steps { display: grid; gap: 1rem; }
.verify-steps h2 { font-size: 1.05rem; }
.doc-list { list-style: none; padding: 0; margin: .3rem 0 .8rem; }
.doc-list li { display: flex; align-items: center; gap: .4rem; padding: .3rem 0; border-bottom: 1px solid var(--line, #e5e7eb); }
.verify-banner { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.doc-viewer { position: relative; background: #2b2f36; border-radius: 10px; padding: 1rem; text-align: center; user-select: none; -webkit-user-select: none; }
.doc-viewer img { max-width: 100%; max-height: 80vh; pointer-events: none; }
.doc-viewer iframe { width: 100%; height: 80vh; border: 0; background: #fff; }
.doc-viewer .wm { position: absolute; inset: 0; pointer-events: none; display: flex; flex-wrap: wrap; align-content: space-around; justify-content: space-around; overflow: hidden; }
.doc-viewer .wm span { transform: rotate(-28deg); color: rgba(220, 38, 38, .28); font: 700 15px/1.2 sans-serif; white-space: nowrap; padding: 1.4rem .6rem; }
@media print { .doc-viewer { display: none !important; } }
/* 4.5 services */
.svc-switch { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: 0 0 .8rem; padding: .45rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card, #fff); }
.svc-switch select { width: auto; min-width: 12rem; }
.ok-text { color: var(--ok); }
.w-num { width: 6.5rem !important; }
.check-grid .check .nm { flex: 1 1 0; min-width: 0; }
.sig-ok { color: var(--ok); font-size: .8rem; }
/* 4.6.1 two-step recommendation */
.tip-2step { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.tip-2step > div { flex: 1 1 22rem; }

/* 4.7.4: rows to check in "Quick add (paste a list)" */
.table tr.row-warn td { background: #fdecea; }
.table td input[type="text"] { width: 100%; min-width: 8rem; }
.table td select { width: 100%; min-width: 7rem; }
.table td .small { min-width: 6rem; }
