:root {
  --bg: #f4f5fb; --surface: #ffffff; --surface-2: #f8f9fd; --border: #e6e8f0; --text: #1c1f2e; --muted: #6b7086; --faint: #9ca0b4;
  --primary: #5145e5; --primary-2: #6a5ff0; --primary-soft: #eeedfd; --primary-text: #fff;
  --green: #15a36b; --green-soft: #e3f7ee; --orange: #e88a12; --orange-soft: #fff3e0; --red: #e0384f; --red-soft: #fde8eb;
  --blue: #2f6fe4; --blue-soft: #e7effd; --purple: #8b46e6; --purple-soft: #f2e9fd; --gray-soft: #eef0f4; --teal: #0e9488; --teal-soft: #e0f5f3; --cyan: #0891b2; --cyan-soft: #e0f4fa;
  --radius: 12px; --radius-sm: 8px; --shadow: 0 1px 2px rgba(20, 22, 40, .04), 0 4px 14px rgba(20, 22, 40, .05);
  --sidebar-w: 236px; --top-h: 62px;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
:root[data-theme="dark"] {
  --bg: #12131c; --surface: #1b1d2a; --surface-2: #222536; --border: #2d3045; --text: #e8e9f2; --muted: #a2a6bd; --faint: #737891;
  --primary: #7b71ff; --primary-2: #8c84ff; --primary-soft: #2a2850; --green-soft: #173a2d; --orange-soft: #3d2c12; --red-soft: #432029;
  --blue-soft: #1c2c4d; --purple-soft: #31204b; --gray-soft: #2a2d3f; --teal-soft: #163834; --cyan-soft: #123544; --shadow: 0 1px 2px rgba(0,0,0,.3);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 26px; margin: 0; letter-spacing: -.02em; }
h2 { font-size: 18px; margin: 0; }
h3 { font-size: 15px; margin: 0; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12px; } .nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; } .row.wrap { flex-wrap: wrap; } .spacer { flex: 1; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grid { display: grid; gap: 16px; }
.hidden { display: none !important; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; grid-template-rows: var(--top-h) 1fr; height: 100vh; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--border); z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; width: calc(var(--sidebar-w) - 20px); }
.brand-logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--primary), #9b5cf6); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.brand > div > b { display: block; font-size: 15px; } .brand > div > span { font-size: 11px; color: var(--muted); display: block; }
.search { flex: 1; max-width: 520px; position: relative; }
.search input { width: 100%; padding: 9px 14px 9px 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); }
.search::before { content: "⌕"; position: absolute; left: 13px; top: 6px; color: var(--faint); font-size: 18px; }
.search-results { position: absolute; top: 44px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 30px rgba(0,0,0,.12); max-height: 70vh; overflow: auto; padding: 8px; }
.search-results .sr-head { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--faint); padding: 8px 8px 4px; }
.search-results a { display: flex; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 8px; color: var(--text); }
.search-results a:hover { background: var(--primary-soft); text-decoration: none; }
.icon-btn { position: relative; width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent; background: transparent; cursor: pointer; display: grid; place-items: center; font-size: 17px; color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); }
.badge-dot { position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.me-btn { display: flex; align-items: center; gap: 9px; padding: 4px 8px 4px 4px; border-radius: 10px; border: none; background: none; cursor: pointer; }
.me-btn:hover { background: var(--surface-2); }
.me-btn > div > b { display: block; font-size: 13px; text-align: left; } .me-btn > div > span { font-size: 11px; color: var(--muted); display: block; text-align: left; }

.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 14px 12px; overflow-y: auto; }
.nav a, .nav .nav-group > button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 12px; border-radius: 10px; color: var(--text); font-weight: 500; border: none; background: none; cursor: pointer; text-align: left; margin-bottom: 2px; }
.nav a:hover, .nav .nav-group > button:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(81,69,229,.3); }
.nav .ic { width: 20px; text-align: center; font-size: 15px; opacity: .85; }
.nav .chev { margin-left: auto; font-size: 11px; transition: transform .15s; }
.nav-group.open .chev { transform: rotate(180deg); }
.nav-sub { display: none; padding: 4px 0 6px 31px; }
.nav-group.open .nav-sub { display: block; }
.nav-sub a { padding: 7px 10px; font-size: 13px; font-weight: 500; }
.nav-sep { height: 1px; background: var(--border); margin: 12px 4px; }
.nav .count { margin-left: auto; background: var(--red); color: #fff; border-radius: 10px; font-size: 11px; padding: 0 7px; font-weight: 700; }
.nav a.active .count { background: #fff; color: var(--primary); }

.main { overflow-y: auto; padding: 24px 28px 60px; position: relative; }
.main::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 220px; background: linear-gradient(180deg, var(--primary-soft), transparent); opacity: .7; pointer-events: none; }
.main > * { position: relative; }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 6px; } .crumbs a { color: var(--primary); }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }

/* ---------- elements ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13px; white-space: nowrap; color: var(--text); }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; } .btn-primary:hover { background: var(--primary-2); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; } .btn-danger:hover { filter: brightness(1.05); background: var(--red); }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; } .btn-green:hover { background: var(--green); filter: brightness(1.05); }
.btn-ghost { border-color: transparent; background: transparent; } .btn-ghost:hover { background: var(--surface-2); }
.btn-soft { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn-icon { padding: 6px 8px; }
.input, select.input, textarea.input { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); outline: none; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea.input { resize: vertical; min-height: 80px; }
label.lbl { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
label.lbl .req { color: var(--red); }
.field { margin-bottom: 14px; }
.help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--gray-soft); color: var(--muted); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.no-dot::before { display: none; }
.s-pending { background: var(--orange-soft); color: var(--orange); } .s-in_progress { background: var(--purple-soft); color: var(--purple); }
.s-submitted { background: var(--blue-soft); color: var(--blue); } .s-completed { background: var(--green-soft); color: var(--green); }
.s-paused { background: var(--gray-soft); color: var(--muted); } .s-declined, .s-abandoned { background: var(--red-soft); color: var(--red); }
.s-draft { background: var(--gray-soft); color: var(--muted); } .s-planning { background: var(--orange-soft); color: var(--orange); }
.p-low { background: var(--teal-soft); color: var(--teal); } .p-medium { background: var(--orange-soft); color: var(--orange); }
.p-high { background: var(--red-soft); color: var(--red); } .p-urgent { background: var(--red); color: #fff; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--primary); font-weight: 600; background: var(--primary-soft); padding: 2px 7px; border-radius: 6px; white-space: nowrap; }

.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 11.5px; font-weight: 700; flex-shrink: 0; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; } .avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.user-chip > span > b { font-weight: 600; font-size: 13px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.user-chip > span > span { font-size: 11px; color: var(--muted); display: block; }

.progress { height: 7px; background: var(--gray-soft); border-radius: 9px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--primary), #8b7dff); border-radius: 9px; }
.progress.green > div { background: var(--green); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 12px; overflow-x: auto; }
.tabs button { border: none; background: none; padding: 13px 12px; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--primary); border-color: var(--primary); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 12.5px; }
.chip .n { background: var(--gray-soft); border-radius: 6px; padding: 0 6px; font-size: 11px; }
.chip.active { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.seg button { border: none; background: none; padding: 6px 12px; border-radius: 7px; cursor: pointer; font-weight: 600; color: var(--muted); font-size: 13px; }
.seg button.active { background: var(--primary); color: #fff; }

/* tables */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; text-transform: none; color: var(--muted); font-weight: 600; padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.clickable:hover td { background: var(--surface-2); cursor: pointer; }
.tbl .title-cell { font-weight: 600; max-width: 320px; }
.tbl .title-cell a { color: var(--text); }
.date-cell { font-size: 12px; white-space: nowrap; line-height: 1.35; } .date-cell .st { font-weight: 700; font-size: 11.5px; }
.pager { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }

/* metrics */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.metric { display: flex; align-items: center; gap: 14px; padding: 18px; }
.metric .mi { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; }
.metric .ml { font-weight: 600; font-size: 13px; } .metric .mv { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }

/* project cards */
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.pcard { padding: 16px; cursor: pointer; transition: transform .1s, box-shadow .1s; display: flex; flex-direction: column; gap: 10px; }
.pcard:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(20,22,40,.08); }
.pcard h3 { font-size: 16px; }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 17, 30, .45); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 16px; z-index: 100; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 560px; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.modal.wide { max-width: 980px; } .modal.mid { max-width: 720px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); border-radius: 16px 16px 0 0; z-index: 2; }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); }
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

/* toast */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.2); max-width: 360px; animation: pop .2s; }
.toast.err { background: var(--red); color: #fff; } .toast.ok { background: var(--green); color: #fff; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* multi select */
.ms { position: relative; }
.ms-box { min-height: 40px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; padding: 5px 30px 5px 8px; border: 1px solid var(--border); border-radius: 9px; cursor: pointer; background: var(--surface); }
.ms-box::after { content: "▾"; position: absolute; right: 11px; top: 10px; color: var(--faint); }
.ms-tag { display: inline-flex; align-items: center; gap: 5px; background: var(--primary-soft); color: var(--primary); border-radius: 6px; padding: 2px 4px 2px 8px; font-size: 12px; font-weight: 600; }
.ms-tag button { border: none; background: none; cursor: pointer; color: inherit; padding: 0 3px; }
.ms-ph { color: var(--faint); padding: 3px 4px; }
.ms-pop { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.14); z-index: 30; max-height: 260px; overflow: auto; padding: 6px; }
.ms-pop input { margin-bottom: 4px; }
.ms-opt { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 7px; cursor: pointer; }
.ms-opt:hover { background: var(--surface-2); } .ms-opt.sel { background: var(--primary-soft); }

/* rich editor */
.rte { border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: var(--surface); }
.rte-bar { display: flex; gap: 2px; padding: 5px; background: var(--surface-2); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.rte-bar button { border: none; background: none; width: 30px; height: 28px; border-radius: 6px; cursor: pointer; font-weight: 700; color: var(--muted); }
.rte-bar button:hover { background: var(--surface); color: var(--text); }
.rte-area { min-height: 110px; max-height: 360px; overflow: auto; padding: 10px 12px; outline: none; }
.rte-area:empty::before { content: attr(data-ph); color: var(--faint); }
.prose { overflow-wrap: anywhere; } .prose p { margin: 0 0 8px; } .prose ul, .prose ol { margin: 0 0 8px; padding-left: 22px; }

/* drop zone */
.drop { border: 1.5px dashed var(--border); border-radius: 10px; padding: 16px; text-align: center; color: var(--muted); cursor: pointer; }
.drop.over { border-color: var(--primary); background: var(--primary-soft); }
.att-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.att { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.att a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* lists */
.list-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: none; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .big { font-size: 34px; margin-bottom: 6px; opacity: .6; }
.kv { display: flex; flex-direction: column; gap: 14px; }
.kv > div > .k { font-size: 11px; text-transform: uppercase; font-weight: 700; color: var(--faint); letter-spacing: .04em; margin-bottom: 3px; }

/* dropdown menu */
.menu { position: absolute; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.15); padding: 6px; z-index: 60; min-width: 190px; }
.menu button, .menu a { display: flex; width: 100%; gap: 8px; align-items: center; padding: 8px 10px; border: none; background: none; border-radius: 7px; cursor: pointer; text-align: left; color: var(--text); font-size: 13px; }
.menu button:hover, .menu a:hover { background: var(--surface-2); text-decoration: none; }
.menu .danger { color: var(--red); }

/* comments */
.comment { display: flex; gap: 10px; padding: 10px 0; }
.comment .bubble { background: var(--surface-2); border: 1px solid var(--border); border-radius: 0 12px 12px 12px; padding: 9px 12px; flex: 1; white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding: 4px 0 12px; font-size: 13px; }
.tl-item::before { content: ""; position: absolute; left: -17px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); border: 2px solid var(--surface); }

/* calendar */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.cal-grid .dh { padding: 10px; text-align: center; font-weight: 600; font-size: 12px; color: var(--muted); background: var(--surface-2); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cal-cell { min-height: 112px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); }
.cal-cell.other { background: var(--surface-2); opacity: .6; } .cal-cell.today .dn { background: var(--primary); color: #fff; }
.cal-cell .dn { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 12px; font-weight: 700; font-size: 12px; margin-bottom: 4px; }
.cal-ev { display: block; font-size: 11px; padding: 3px 6px; border-radius: 5px; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; color: var(--text); }
.cal-ev.task { background: var(--blue-soft); } .cal-ev.task.done { background: var(--green-soft); text-decoration: line-through; opacity: .8; }
.cal-ev.task.overdue { background: var(--red-soft); }
.cal-ev.event { background: var(--purple-soft); } .cal-ev.holiday, .cal-ev.announcement { background: var(--orange-soft); }

/* chat */
.chat-fab { position: fixed; right: 22px; bottom: 22px; width: 52px; height: 52px; border-radius: 50%; background: var(--primary); color: #fff; border: none; cursor: pointer; font-size: 22px; box-shadow: 0 10px 26px rgba(81,69,229,.4); z-index: 90; }
.chat-panel { position: fixed; right: 22px; bottom: 86px; width: 360px; height: 520px; max-height: calc(100vh - 120px); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.2); z-index: 90; display: flex; flex-direction: column; overflow: hidden; }
.chat-list { overflow-y: auto; flex: 1; }
.chat-contact { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border); }
.chat-contact:hover { background: var(--surface-2); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); }
.msg { max-width: 78%; padding: 8px 11px; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.msg.me { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 3px; }
.msg.them { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 3px; }
.msg .t { font-size: 10px; opacity: .7; margin-top: 3px; }

/* auth pages */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, var(--primary-soft), transparent 50%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; padding: 32px; }
.auth-card h1 { font-size: 24px; margin: 18px 0 6px; }

/* kb */
.kb-layout { display: grid; grid-template-columns: 240px 1fr; gap: 18px; align-items: start; }
.kb-cats a { display: flex; justify-content: space-between; padding: 8px 10px; border-radius: 8px; color: var(--text); font-size: 13px; }
.kb-cats a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.kb-cats a:hover { text-decoration: none; background: var(--surface-2); }
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.note-card { padding: 12px; border-radius: 10px; color: #3a3420; min-height: 90px; position: relative; white-space: pre-wrap; font-size: 13px; }
.note-card button { position: absolute; top: 6px; right: 6px; border: none; background: rgba(0,0,0,.06); border-radius: 6px; cursor: pointer; }
.donut-wrap { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.legend { display: flex; flex-direction: column; gap: 9px; font-size: 13px; }
.legend .li { display: flex; align-items: center; gap: 8px; } .legend .sw { width: 10px; height: 10px; border-radius: 50%; }
.bar-row { display: grid; grid-template-columns: 70px 1fr 70px; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 13px; }
.perm-matrix td, .perm-matrix th { text-align: center; } .perm-matrix td:first-child, .perm-matrix th:first-child { text-align: left; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.spin { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: sp .7s linear infinite; vertical-align: middle; }
@keyframes sp { to { transform: rotate(360deg); } }

@media (max-width: 1000px) {
  .two-col, .kb-layout { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: var(--top-h); bottom: 0; left: 0; width: var(--sidebar-w); z-index: 50; transform: translateX(-100%); transition: transform .2s, box-shadow .2s; box-shadow: none; }
  .shell.nav-open .sidebar { transform: none; box-shadow: 10px 0 30px rgba(0,0,0,.15); }
  .brand { width: auto; } .brand > div { display: none; }
  .main { padding: 18px 14px 80px; }
  .me-btn > div { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .chat-panel { right: 8px; left: 8px; width: auto; }
}
@media (min-width: 821px) { .menu-toggle { display: none; } }

/* dashboard */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }
.paged-nav { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 6px; }
.count-pill { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--primary-soft); color: var(--primary); font-size: 12px; margin-left: 4px; vertical-align: middle; }
.ellipsis { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-item .avatar.sm { width: 20px; height: 20px; font-size: 9px; vertical-align: middle; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; font-size: 13px; }
.switch input { width: 34px; height: 20px; appearance: none; background: var(--border); border-radius: 20px; position: relative; cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch input:checked { background: var(--green); } .switch input:checked::after { left: 17px; }
.switch input:disabled { opacity: .6; cursor: not-allowed; }

/* ---------- activity cards ---------- */
.act-pad { padding: 6px 18px 12px; }
.act-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 10px; margin: 0 -10px; border-radius: 10px; transition: background .12s; }
.act-item + .act-item { border-top: 1px solid var(--border); }
.act-item:hover { background: var(--surface-2); }
.act-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 15px; flex-shrink: 0; font-weight: 700; }
.act-avatar { position: relative; flex-shrink: 0; }
.act-avatar .avatar { width: 34px; height: 34px; font-size: 12px; }
.act-badge { position: absolute; right: -5px; bottom: -4px; width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center; font-size: 10px; border: 2px solid var(--surface); font-weight: 700; }
.act-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.act-text { font-size: 13.5px; color: var(--text); }
.act-text b { font-weight: 700; }
.act-target { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-target a { font-weight: 600; }
.act-time { font-size: 11.5px; color: var(--faint); white-space: nowrap; padding-top: 2px; }
.dash-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 10px; color: var(--muted); font-size: 13px; text-align: center; }
.dash-empty > span { width: 42px; height: 42px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; font-size: 20px; }
.paged-nav { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; }
.paged-nav .btn { width: 30px; height: 30px; padding: 0; border-radius: 8px; font-size: 16px; }
.ev-item { display: flex; align-items: center; gap: 12px; padding: 10px; margin: 0 -10px; border-radius: 10px; color: inherit; }
.ev-item:hover { background: var(--surface-2); text-decoration: none; }
.ev-item + .ev-item { border-top: 1px solid var(--border); }
.ev-date { width: 46px; height: 50px; border-radius: 10px; background: var(--primary-soft); display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
.ev-date small { font-size: 10px; font-weight: 800; color: var(--primary); letter-spacing: .04em; }
.ev-date b { font-size: 18px; line-height: 1.1; }

/* ---------- notification cards ---------- */
.ncard { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; color: inherit; position: relative; transition: background .12s; }
.ncard + .ncard { border-top: 1px solid var(--border); }
.ncard:hover { background: var(--surface-2); text-decoration: none; }
.ncard.unread { background: color-mix(in srgb, var(--primary-soft) 55%, transparent); }
.ncard.unread:hover { background: var(--primary-soft); }
.ncard-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-size: 16px; flex-shrink: 0; }
.ncard-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ncard-title { font-weight: 600; font-size: 13.5px; line-height: 1.35; }
.ncard.unread .ncard-title { font-weight: 700; }
.ncard-body { font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ncard-meta { font-size: 11.5px; color: var(--faint); }
.ncard-tag { font-weight: 700; }
.ncard-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); flex-shrink: 0; margin-top: 6px; box-shadow: 0 0 0 3px var(--primary-soft); }
.notif-pop { position: fixed; width: 390px; max-width: calc(100vw - 16px); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 24px 60px rgba(15,17,30,.18); z-index: 95; display: flex; flex-direction: column; overflow: hidden; animation: pop .15s; }
.notif-pop-head { display: flex; align-items: center; gap: 8px; padding: 16px 16px 10px; }
.notif-pop-head b { font-size: 16px; }
.notif-tabs { margin: 0 16px 10px; align-self: flex-start; }
.notif-tabs button { padding: 4px 12px; font-size: 12px; }
.notif-pop-list { max-height: min(430px, 60vh); overflow-y: auto; border-top: 1px solid var(--border); }
.notif-pop-foot { display: block; text-align: center; padding: 12px; font-weight: 700; font-size: 13px; border-top: 1px solid var(--border); background: var(--surface-2); }
.notif-pop-foot:hover { background: var(--primary-soft); text-decoration: none; }
.notif-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 16px; color: var(--muted); font-size: 13px; }
.link-btn { border: none; background: none; color: var(--primary); font-weight: 600; font-size: 12.5px; cursor: pointer; padding: 4px; }
.link-btn:hover { text-decoration: underline; }
.notif-page { max-width: 860px; }
.notif-group { margin-bottom: 18px; }
.notif-day { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); margin: 0 0 8px 4px; }
.notif-card-list { overflow: hidden; }
.notif-card-list .ncard { padding: 14px 18px; }

/* ---------- submitted work ---------- */
.sub-wrap { margin-bottom: 22px; }
.sub-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: var(--surface); margin-bottom: 10px; }
.sub-card.latest { border-color: color-mix(in srgb, var(--blue) 45%, var(--border)); box-shadow: 0 0 0 3px var(--blue-soft); }
.sub-note { margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; }
.sub-feedback { margin-top: 10px; padding: 9px 12px; border-radius: 9px; background: var(--surface-2); font-size: 13px; }
.sub-history summary { cursor: pointer; color: var(--primary); font-weight: 600; font-size: 13px; margin: 4px 0 10px; }
.dlv-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-top: 10px; }
.dlv { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: inherit; min-width: 0; }
.dlv:hover { border-color: var(--primary); background: var(--primary-soft); text-decoration: none; }
.dlv-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--surface); display: grid; place-items: center; font-size: 17px; flex-shrink: 0; border: 1px solid var(--border); }
.dlv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dlv-main b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlv-main small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlv-go { font-size: 12px; font-weight: 700; color: var(--primary); white-space: nowrap; }

/* ---------- team performance ---------- */
.tp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.tp-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; color: inherit; transition: transform .1s, box-shadow .1s; }
.tp-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(20,22,40,.09); text-decoration: none; }
.tp-card h3 { font-size: 17px; }
.tp-live { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--gray-soft); color: var(--muted); white-space: nowrap; }
.tp-live.on { background: var(--green-soft); color: var(--green); }
.tp-live.mid { background: var(--purple-soft); color: var(--purple); }
.tp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tp-stats > div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.tp-stats b { font-size: 18px; } .tp-stats span { font-size: 11px; color: var(--muted); }
.tp-stats .bad b { color: var(--red); } .tp-stats .good b { color: var(--green); }
.tp-stats.small-stats { grid-template-columns: repeat(6, 1fr); margin: 12px 0 10px; }
.tp-stats.small-stats b { font-size: 15px; }
@media (max-width: 700px) { .tp-stats.small-stats { grid-template-columns: repeat(3, 1fr); } }
.tp-member { padding: 16px 18px; }
.tp-now { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--green-soft); color: inherit; }
.tp-now:hover { text-decoration: none; filter: brightness(.98); }
.tp-now > span:first-child { width: 28px; height: 28px; border-radius: 8px; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 12px; flex-shrink: 0; }
.tp-now small { display: block; font-size: 11px; color: var(--green); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.tp-section { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.tp-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); margin-bottom: 6px; cursor: default; }
details.tp-section summary { cursor: pointer; }
.tp-task { display: flex; align-items: center; gap: 8px; padding: 7px 8px; margin: 0 -8px; border-radius: 8px; color: inherit; font-size: 13px; min-width: 0; }
.tp-task:hover { background: var(--surface-2); text-decoration: none; }

/* ---- Employee details (HR) ---- */
.emp-h { margin: 20px 0 10px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.emp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.emp-f { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; min-width: 0; }
.emp-f.wide { grid-column: 1 / -1; }
.emp-l { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
.emp-v { font-weight: 600; overflow-wrap: anywhere; display: flex; align-items: center; gap: 8px; }
.emp-docs { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; }
.emp-doc { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); min-width: 0; }
.emp-doc .spacer { min-width: 0; } .emp-doc .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emp-doc.empty { border-style: dashed; background: transparent; }
.emp-doc-ic { font-size: 22px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--blue-soft); flex: none; }
.emp-eye { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 18px; text-decoration: none; cursor: pointer; flex: none; }
.emp-eye:hover { background: var(--blue-soft); border-color: var(--primary); }
.emp-v .emp-eye { width: 30px; height: 30px; font-size: 15px; }
.modal .emp-docs { grid-template-columns: 1fr; }
.emp-doc .spacer { text-align: left; }
.emp-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.emp-side { position: sticky; top: 80px; max-height: calc(100vh - 110px); display: flex; flex-direction: column; overflow: hidden; }
.emp-side [data-list] { overflow-y: auto; padding: 0 8px 8px; }
.emp-li { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.emp-li .spacer { display: flex; flex-direction: column; min-width: 0; } .emp-li .spacer > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emp-li:hover { background: var(--surface-2); } .emp-li.active { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.emp-pct { font-size: 12px; font-weight: 700; white-space: nowrap; }
.emp-main-head { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.emp-main-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 16px 16px; }
@media (max-width: 900px) { .emp-layout { grid-template-columns: 1fr; } .emp-side { position: static; max-height: 340px; } }

/* ---- Row action buttons (tables) ---- */
.act-cell { display: inline-flex; gap: 6px; justify-content: flex-end; align-items: center; }
.act-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 9px; font-size: 18px; line-height: 1; text-decoration: none; cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--text); transition: background .15s, border-color .15s, transform .1s; }
.act-btn:hover { background: var(--primary-soft); border-color: var(--primary); }
.act-btn:active { transform: scale(.94); }
.act-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* edit form: icon + name on top, buttons on their own row */
.emp-form .emp-docs { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.emp-doc-edit { flex-direction: column; align-items: stretch; gap: 12px; }
.emp-doc-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.emp-doc-txt { min-width: 0; flex: 1; }
.emp-doc-txt b, .emp-doc-txt .small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emp-doc-actions { display: flex; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.emp-doc-actions .emp-eye { width: 32px; height: 32px; font-size: 16px; }
.emp-doc-actions .emp-rm { margin-left: auto; color: var(--red); }
.emp-doc-edit.empty .emp-doc-actions { border-top-style: dashed; }
.emp-doc-edit.empty .emp-doc-actions label { width: 100%; justify-content: center; }
.emp-doc, .emp-doc.empty { text-align: left; padding: 12px 14px; }

/* ---- Mobile: plain white page background (follows dark mode too) ---- */
@media (max-width: 820px) {
  body, .shell, .main { background: var(--surface); }
  .main::before { display: none; }
  .card, .metric { border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(16, 24, 40, .06); }
}

/* =================== Attendance: top-bar chip =================== */
.att-chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.att-chip b { font-variant-numeric: tabular-nums; }
.att-chip.in { border-color: color-mix(in srgb, var(--green) 35%, var(--border)); background: var(--green-soft); }
.att-chip.out { border-color: color-mix(in srgb, var(--orange) 40%, var(--border)); background: var(--orange-soft); }
.att-chip:hover { box-shadow: 0 2px 10px rgba(20, 22, 40, .08); }
.att-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--orange); flex: none; }
.att-chip.in .att-dot, .att-dot.live { background: var(--green); box-shadow: 0 0 0 0 rgba(21, 163, 107, .5); animation: attPulse 2s infinite; }
@keyframes attPulse { 0% { box-shadow: 0 0 0 0 rgba(21, 163, 107, .55); } 70% { box-shadow: 0 0 0 8px rgba(21, 163, 107, 0); } 100% { box-shadow: 0 0 0 0 rgba(21, 163, 107, 0); } }
.att-pop { position: fixed; z-index: 120; width: 290px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 20px 50px rgba(0, 0, 0, .18); padding: 18px; display: flex; flex-direction: column; gap: 10px; animation: popIn .15s ease; }
@keyframes popIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.att-pop-h { display: flex; align-items: center; gap: 8px; }
.att-pop-big { font-size: 34px; font-weight: 800; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.att-pop-rows { display: grid; gap: 4px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.att-pop-rows div { display: flex; justify-content: space-between; }
.att-pop-late { font-size: 12px; color: var(--orange); background: var(--orange-soft); border-radius: 8px; padding: 6px 10px; }
.att-out-btn { width: 100%; justify-content: center; background: var(--red-soft); color: var(--red); border-color: transparent; font-weight: 700; height: 42px; }
.att-out-btn:hover { background: var(--red); color: #fff; }
@media (max-width: 820px) { .att-chip { padding: 0 10px; height: 34px; } .att-chip .att-chip-l { display: none; } .att-chip.out .att-chip-l { display: none; } }

/* =================== Attendance: check-in gate =================== */
.att-gate { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; overflow-y: auto;
  background: radial-gradient(circle at 15% 10%, rgba(123, 111, 247, .55), transparent 45%), radial-gradient(circle at 90% 90%, rgba(168, 85, 247, .45), transparent 40%), rgba(20, 18, 48, .78);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: gateIn .3s ease; }
.att-gate.leaving { opacity: 0; transition: opacity .35s; }
@keyframes gateIn { from { opacity: 0; } to { opacity: 1; } }
.att-card { width: min(880px, 100%); display: grid; grid-template-columns: 1fr 1.15fr; background: var(--surface); border-radius: 26px; overflow: hidden; box-shadow: 0 40px 100px rgba(0, 0, 0, .4); animation: cardUp .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes cardUp { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }
.att-side { background: linear-gradient(150deg, #4c3fd1, #2b2280 70%); color: #fff; padding: 34px 32px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.att-side::after { content: ""; position: absolute; width: 320px; height: 320px; border-radius: 50%; right: -120px; bottom: -120px; background: rgba(255, 255, 255, .07); box-shadow: 0 0 0 40px rgba(255, 255, 255, .04), 0 0 0 80px rgba(255, 255, 255, .025); }
.att-org { display: flex; align-items: center; gap: 10px; font-weight: 700; opacity: .95; margin-bottom: auto; }
.att-org .brand-logo { background: rgba(255, 255, 255, .18); }
.att-clock { font-size: 64px; font-weight: 800; letter-spacing: -2px; line-height: 1; margin-top: 70px; font-variant-numeric: tabular-nums; }
.att-clock small { font-size: 22px; letter-spacing: 0; margin-left: 6px; opacity: .8; }
.att-date { font-size: 16px; opacity: .85; }
.att-hours { margin-top: 26px; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); width: fit-content; position: relative; z-index: 1; }
.att-hours span { font-size: 12px; opacity: .8; } .att-hours b { font-size: 16px; }
.att-main { padding: 34px 36px; display: flex; flex-direction: column; gap: 16px; justify-content: center; }
.att-user { display: flex; align-items: center; gap: 14px; }
.att-user .avatar.lg { width: 58px; height: 58px; font-size: 20px; }
.att-greet { color: var(--muted); font-size: 15px; } .att-user h2 { font-size: 28px; margin: 0; letter-spacing: -.5px; }
.att-lead { margin: 4px 0 0; font-size: 15px; color: var(--muted); }
.att-hint { align-self: flex-start; font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 999px; }
.att-hint.ok { background: var(--green-soft); color: var(--green); } .att-hint.late { background: var(--orange-soft); color: var(--orange); } .att-hint.early { background: var(--blue-soft); color: var(--blue); }
.att-warn { background: var(--orange-soft); color: var(--orange); border-radius: 12px; padding: 10px 14px; font-size: 13px; font-weight: 600; }
.att-btn { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; height: 64px; margin-top: 6px; border: 0; border-radius: 18px; cursor: pointer;
  background: linear-gradient(135deg, #16a974, #0e8f62); color: #fff; font: inherit; font-size: 20px; font-weight: 800; letter-spacing: .2px; box-shadow: 0 14px 30px rgba(21, 163, 107, .35); transition: transform .12s, box-shadow .2s; }
.att-btn:hover { transform: translateY(-2px); box-shadow: 0 18px 36px rgba(21, 163, 107, .45); }
.att-btn:active { transform: scale(.98); } .att-btn:disabled { opacity: .7; cursor: wait; }
.att-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--green) 50%, transparent); outline-offset: 3px; }
.att-btn-ic { font-size: 24px; }
.att-btn-ring { position: absolute; inset: 0; border-radius: inherit; animation: ring 2.4s infinite; pointer-events: none; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(21, 163, 107, .45); } 70% { box-shadow: 0 0 0 14px rgba(21, 163, 107, 0); } 100% { box-shadow: 0 0 0 0 rgba(21, 163, 107, 0); } }
.att-done { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.att-done div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.att-done span { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; } .att-done b { font-size: 17px; }
.att-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--faint); }
.att-success { text-align: center; padding: 30px 0; animation: cardUp .35s ease; }
.att-tick { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center; font-size: 44px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #16a974, #0e8f62); box-shadow: 0 14px 30px rgba(21, 163, 107, .4); animation: pop .4s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
.att-success h2 { margin: 0 0 4px; }
@media (max-width: 760px) {
  .att-gate { padding: 0; place-items: stretch; }
  .att-card { grid-template-columns: 1fr; border-radius: 0; min-height: 100%; }
  .att-side { padding: 22px 22px 24px; } .att-clock { margin-top: 18px; font-size: 52px; } .att-hours { margin-top: 14px; }
  .att-main { padding: 24px 22px 30px; justify-content: flex-start; }
}

/* =================== Attendance: admin page =================== */
.tnum { font-variant-numeric: tabular-nums; } .ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-info { font-size: 12px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; }
.att-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; margin-right: 4px; white-space: nowrap; }
.att-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.att-s-in { background: var(--green-soft); color: var(--green); } .att-s-out { background: var(--teal-soft); color: var(--teal); }
.att-s-none { background: var(--gray-soft); color: var(--muted); } .att-s-abs { background: var(--red-soft); color: var(--red); }
.att-s-miss { background: var(--purple-soft); color: var(--purple); } .att-s-off { background: var(--gray-soft); color: var(--faint); } .att-s-late { background: var(--orange-soft); color: var(--orange); }
.att-kpis { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.att-kpi { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; text-align: left; font: inherit; color: var(--text); transition: border-color .15s, box-shadow .15s, transform .1s; }
.att-kpi:hover { border-color: var(--c); } .att-kpi.active { border-color: var(--c); box-shadow: 0 0 0 3px var(--cs); }
.att-kpi-ic { width: 40px; height: 40px; border-radius: 11px; background: var(--cs); display: grid; place-items: center; font-size: 18px; flex: none; }
.att-kpi b { display: block; font-size: 24px; line-height: 1.1; color: var(--c); } .att-kpi small { color: var(--muted); font-size: 12px; font-weight: 600; }
@media (max-width: 1200px) { .att-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .att-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.att-tl { overflow-x: auto; }
.att-tl-head, .att-tl-row { display: grid; grid-template-columns: 220px minmax(420px, 1fr) 250px; align-items: center; gap: 14px; padding: 10px 16px; min-width: 900px; }
.att-tl-head { border-bottom: 1px solid var(--border); background: var(--surface-2); padding-top: 12px; padding-bottom: 12px; }
.att-tl-row { border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s; } .att-tl-row:hover, .att-tl-row:focus-visible { background: var(--surface-2); outline: none; }
.att-tl-who { display: flex; align-items: center; gap: 10px; min-width: 0; } .att-tl-head .att-tl-who { flex-direction: column; align-items: flex-start; gap: 0; }
.att-tl-track { position: relative; height: 30px; border-radius: 8px; background: var(--surface-2); }
.att-tl-scale { background: none; height: 18px; } .att-scale span { position: absolute; top: 0; transform: translateX(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.att-office { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--primary) 9%, transparent); border-left: 1px dashed color-mix(in srgb, var(--primary) 40%, transparent); border-right: 1px dashed color-mix(in srgb, var(--primary) 40%, transparent); }
.att-gl { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border); }
.att-seg { position: absolute; top: 6px; bottom: 6px; border-radius: 6px; background: linear-gradient(90deg, #16a974, #22c58a); box-shadow: 0 2px 6px rgba(21, 163, 107, .3); }
.att-seg.late { box-shadow: inset 4px 0 0 var(--orange), 0 2px 6px rgba(21, 163, 107, .3); }
.att-seg.live { background: repeating-linear-gradient(-45deg, #16a974 0 8px, #2bd194 8px 16px); background-size: 22px 22px; animation: attStripe 1s linear infinite; }
@keyframes attStripe { from { background-position: 0 0; } to { background-position: 22px 0; } }
.att-seg.miss { background: repeating-linear-gradient(-45deg, var(--purple) 0 5px, transparent 5px 10px); box-shadow: none; opacity: .7; }
.att-now { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--red); border-radius: 2px; } .att-now::before { content: ""; position: absolute; top: -3px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.att-empty-l { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; color: var(--faint); }
.att-tl-num { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.att-legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 12px 16px; font-size: 12px; color: var(--muted); align-items: center; }
.att-legend span { display: inline-flex; align-items: center; gap: 6px; } .att-legend i { width: 18px; height: 10px; border-radius: 4px; display: inline-block; }
.lg-on { background: #1bb57c; } .lg-live { background: repeating-linear-gradient(-45deg, #16a974 0 4px, #2bd194 4px 8px); } .lg-late { background: #1bb57c; box-shadow: inset 4px 0 0 var(--orange); }
.lg-miss { background: repeating-linear-gradient(-45deg, var(--purple) 0 3px, transparent 3px 6px); } .lg-office { background: color-mix(in srgb, var(--primary) 14%, transparent); border: 1px dashed color-mix(in srgb, var(--primary) 50%, transparent); }
.att-sess { display: grid; gap: 8px; } .att-sess-row { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; } .att-sess-row > div { flex: 1; min-width: 0; }
.att-sum { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.att-sum div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; } .att-sum b { display: block; font-size: 20px; } .att-sum span { font-size: 12px; color: var(--muted); }
@media (max-width: 1000px) { .att-sum { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.att-hbar { display: inline-block; vertical-align: middle; width: 70px; height: 6px; border-radius: 4px; background: var(--gray-soft); margin-right: 8px; overflow: hidden; } .att-hbar i { display: block; height: 100%; background: var(--green); border-radius: 4px; }
.att-month-wrap { border: 1px solid var(--border); border-radius: 12px; }
.att-month { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12px; }
.att-month th, .att-month td { padding: 6px 3px; text-align: center; border-bottom: 1px solid var(--border); }
.att-month th { position: sticky; top: 0; background: var(--surface-2); font-weight: 700; color: var(--muted); } .att-month th small { display: block; font-size: 9px; color: var(--faint); }
.att-month th.we { color: var(--faint); } .att-month .td { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.att-month .att-mn { position: sticky; left: 0; background: var(--surface); text-align: left; padding-left: 12px; min-width: 170px; max-width: 200px; z-index: 1; } .att-month th.att-mn { background: var(--surface-2); z-index: 2; }
.att-month .att-ms { padding: 6px 8px; min-width: 52px; }
i.c { display: inline-block; width: 18px; height: 18px; border-radius: 5px; vertical-align: middle; }
i.c.ok { background: #1bb57c; } i.c.late { background: var(--orange); } i.c.abs { background: var(--red); } i.c.miss { background: var(--purple); }
i.c.off { background: repeating-linear-gradient(-45deg, var(--gray-soft) 0 3px, transparent 3px 6px); border: 1px solid var(--border); } i.c.none { border: 1.5px dashed var(--faint); } i.c.na { background: transparent; }
.att-legend i.c { width: 14px; height: 14px; }
.att-switch { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; cursor: pointer; }
.att-switch input { position: absolute; opacity: 0; } .att-sw { flex: none; width: 42px; height: 24px; border-radius: 999px; background: var(--gray-soft); position: relative; transition: background .2s; margin-top: 2px; }
.att-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.att-switch input:checked + .att-sw { background: var(--green); } .att-switch input:checked + .att-sw::after { transform: translateX(18px); }
.att-switch input:focus-visible + .att-sw { outline: 2px solid var(--primary); outline-offset: 2px; }
.att-days { display: flex; flex-wrap: wrap; gap: 8px; } .att-days input { position: absolute; opacity: 0; }
.att-days span { display: inline-block; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--border); cursor: pointer; font-weight: 600; user-select: none; }
.att-days input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; } .att-days input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.att-month th, .att-month td { padding: 6px 1px; } .att-month i.c { width: 16px; height: 16px; border-radius: 4px; }
.att-month .att-mn { min-width: 150px; max-width: 170px; } .att-month .att-ms { min-width: 46px; padding: 6px 6px; }
.att-month-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.att-mc { border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; background: var(--surface-2); display: grid; gap: 8px; align-content: start; }
.att-mc-h { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.att-mc-r { display: flex; align-items: center; gap: 8px; font-size: 13px; } .att-mc-r > span:not(.avatar) { flex: 1; min-width: 0; } .att-mc-r .avatar { flex: none; } .att-mc-r b { white-space: nowrap; }
@media (max-width: 900px) { .att-month-cards { grid-template-columns: 1fr; } }
.att-month td.att-ms small { font-size: 10px; }
.topbar .att-chip { margin-right: -2px; }
.att-logout { display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.att-logout:hover { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.att-logout:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.att-foot { justify-content: center; }
@media (max-width: 820px) { .att-chip.opt .att-chip-l { display: inline; } }
.att-chip.opt { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); color: var(--primary); font-weight: 700; }
.att-chip.opt .att-dot { background: var(--primary); }
/* dashboard team workload: normal table that scrolls left/right when the card is narrow */
.wl-tbl { min-width: 760px; }
.wl-tbl th { white-space: nowrap; }
.wl-tbl td:not(:first-child):not(.wl-act), .wl-tbl th:not(:first-child) { text-align: center; }
.wl-who .ellipsis { display: block; white-space: nowrap; }
.wl-act { width: 1%; white-space: nowrap; text-align: right; }
.wl-tbl .act-btn { width: 32px; height: 32px; font-size: 15px; color: var(--text); }
[data-team] .table-wrap { overflow-x: auto; scrollbar-width: thin; }
/* team workload pager: same breathing room as the other dashboard cards */
[data-team] .paged-nav { padding: 12px 20px 14px; margin-top: 0; gap: 8px; align-items: center; }
[data-team] .paged-nav b { min-width: 34px; text-align: center; }
/* dashboard projects: list / cards switch + pager */
.seg-sm { margin-right: 12px; } .seg-sm button { padding: 4px 10px; font-size: 15px; line-height: 1; }
.dp-cards .pcards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 700px) { .dp-cards .pcards { grid-template-columns: 1fr; } }
.dp-nav { padding: 12px 20px 14px; margin-top: 0; gap: 8px; align-items: center; } .dp-nav b { min-width: 34px; text-align: center; }
.dp-cards + .dp-nav { padding-top: 12px; }
.dp-tbl tr.clickable { cursor: pointer; }

/* ---------- leave ---------- */
.att-s-leave { background: var(--cyan-soft); color: var(--cyan); }
.att-empty-l.lv { color: var(--cyan); font-weight: 700; background: repeating-linear-gradient(-45deg, transparent 0 8px, color-mix(in srgb, var(--cyan) 9%, transparent) 8px 16px); border-radius: 8px; }
i.c.lv { background: var(--cyan); } i.c.lv.half { background: linear-gradient(135deg, var(--cyan) 50%, var(--gray-soft) 50%); }
i.c.lv.plan { background: transparent; border: 2px dashed var(--cyan); }
i.c.half-lv { box-shadow: inset 0 -5px 0 var(--cyan); }
.lv-bal { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.lv-card { border: 1px solid var(--border); border-radius: 16px; padding: 16px; background: var(--surface); position: relative; overflow: hidden; display: grid; gap: 10px; }
.lv-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--c); }
.lv-card-h { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.lv-card-n { font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: -.02em; } .lv-card-n small { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.lv-bar { height: 7px; border-radius: 99px; background: var(--gray-soft); overflow: hidden; display: flex; }
.lv-bar i { display: block; height: 100%; background: var(--c); } .lv-bar i.p { background: color-mix(in srgb, var(--c) 40%, transparent); }
.lv-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; display: inline-block; }
.lv-list { display: grid; gap: 10px; }
.lv-item { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; background: var(--surface); }
.lv-date { width: 54px; text-align: center; border-radius: 12px; background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); padding: 6px 0; line-height: 1.1; }
.lv-date b { display: block; font-size: 20px; } .lv-date small { font-size: 11px; font-weight: 700; text-transform: uppercase; }
.lv-meta { min-width: 0; display: grid; gap: 3px; } .lv-meta .ell { max-width: 100%; }
.lv-acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.lv-st { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.lv-st.pending { background: var(--orange-soft); color: var(--orange); } .lv-st.approved { background: var(--green-soft); color: var(--green); }
.lv-st.rejected { background: var(--red-soft); color: var(--red); } .lv-st.cancelled { background: var(--gray-soft); color: var(--muted); }
.lv-note { font-size: 12.5px; color: var(--muted); background: var(--surface-2); border-radius: 8px; padding: 6px 10px; margin-top: 4px; }
.lv-away { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.lv-away-p { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 99px; padding: 4px 12px 4px 4px; background: var(--surface); font-size: 13px; }
.lv-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.lv-cal-h { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; text-align: center; padding: 4px 0; }
.lv-cal-d { min-height: 86px; border: 1px solid var(--border); border-radius: 10px; padding: 6px; background: var(--surface); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lv-cal-d.we { background: var(--surface-2); } .lv-cal-d.out { opacity: .4; } .lv-cal-d.td { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.lv-cal-n { font-size: 12px; font-weight: 700; color: var(--muted); }
.lv-cal-e { font-size: 11.5px; font-weight: 600; border-radius: 6px; padding: 2px 6px; background: color-mix(in srgb, var(--c) 15%, transparent); color: var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-cal-e.pend { background: transparent; border: 1px dashed var(--c); }
.lv-type-row { display: grid; grid-template-columns: 44px 1fr 120px auto auto; gap: 10px; align-items: center; margin-bottom: 10px; }
.lv-type-row input[type=color] { width: 44px; height: 38px; padding: 2px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
.nav-badge { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; border-radius: 99px; padding: 1px 7px; min-width: 20px; text-align: center; }
.att-chip.leave { background: var(--cyan-soft); color: var(--cyan); border-color: transparent; } .att-chip.leave .att-dot { background: var(--cyan); }
@media (max-width: 700px) {
  .lv-item { grid-template-columns: auto 1fr; } .lv-acts { grid-column: 1 / -1; justify-content: flex-start; }
  .lv-cal { gap: 3px; } .lv-cal-d { min-height: 58px; padding: 3px; } .lv-cal-e { font-size: 0; height: 6px; padding: 0; }
  .lv-type-row { grid-template-columns: 44px 1fr 90px; } .lv-type-row > :nth-child(n+4) { grid-column: span 1; }
}

.att-alt { display: grid; grid-template-columns: 1fr auto; gap: 8px; } .att-alt [data-leave] { color: var(--cyan); }
@media (max-width: 520px) { .att-alt { grid-template-columns: 1fr; } }
.att-gate ~ .modal-bg, body:has(.att-gate) .modal-bg { z-index: 300; }
body:has(.att-gate) .toast-wrap, body:has(.att-gate) #toasts { z-index: 400; }

.tabs button .count { margin-left: 6px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; border-radius: 99px; padding: 1px 7px; }

/* ---------- end-of-day reports ---------- */
.eod-work { display: grid; gap: 6px; }
.eod-wt { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); text-decoration: none; min-width: 0; }
.eod-wt:hover { border-color: var(--primary); }
.eod-wt-t { flex: 1; min-width: 0; display: flex; flex-direction: column; } .eod-wt-h { font-weight: 700; font-size: 13px; white-space: nowrap; }
.eod-tag { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--gray-soft); color: var(--muted); white-space: nowrap; }
.eod-tag.ok { background: var(--green-soft); color: var(--green); } .eod-tag.sub { background: var(--blue-soft); color: var(--blue); } .eod-tag.blk { background: var(--orange-soft); color: var(--orange); }
.eod-sec { margin-top: 12px; } .eod-sec-h { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 5px; }
.eod-sec.blk .eod-sec-h { color: var(--orange); }
.eod-txt { white-space: pre-wrap; line-height: 1.55; font-size: 14px; }
.eod-sec.blk .eod-txt { background: var(--orange-soft); border-radius: 10px; padding: 8px 12px; }
.eod-today { display: flex; align-items: center; gap: 16px; border: 1px solid var(--border); border-radius: 16px; padding: 18px; background: var(--surface-2); flex-wrap: wrap; }
.eod-today.done { background: var(--green-soft); border-color: transparent; }
.eod-today-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: var(--surface); flex: none; }
.eod-today.done .eod-today-ic { background: var(--green); color: #fff; font-weight: 800; }
.eod-list { display: grid; gap: 10px; }
.eod-card { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.eod-card > summary { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; }
.eod-card > summary::-webkit-details-marker { display: none; }
.eod-card-b { padding: 0 16px 16px; border-top: 1px solid var(--border); }
.eod-date { width: 48px; text-align: center; border-radius: 12px; background: var(--primary-soft); color: var(--primary); padding: 5px 0; line-height: 1.1; flex: none; }
.eod-date b { display: block; font-size: 19px; } .eod-date small { font-size: 11px; font-weight: 700; text-transform: uppercase; }
.eod-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.eod-kpi { border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; background: var(--surface); display: flex; flex-direction: column; gap: 2px; }
.eod-kpi b { font-size: 26px; color: var(--c); } .eod-kpi b small { font-size: 14px; color: var(--muted); } .eod-kpi span { font-size: 13px; color: var(--muted); }
.eod-missing { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; padding: 10px 14px; border-radius: 12px; background: var(--red-soft); }
.eod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; }
.eod-rep { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); padding: 16px; min-width: 0; }
.eod-cm { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; display: grid; gap: 10px; }
.eod-c { display: flex; gap: 10px; font-size: 13.5px; } .eod-c .avatar { flex: none; }
.eod-cf { display: flex; gap: 8px; } .eod-cf .input { flex: 1; min-width: 0; }
@media (max-width: 700px) { .eod-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .eod-grid { grid-template-columns: 1fr; } }

/* ---------- payroll ---------- */
.pay-st { font-size: 12px; font-weight: 800; padding: 5px 12px; border-radius: 99px; white-space: nowrap; }
.pay-st.final { background: var(--green-soft); color: var(--green); } .pay-st.draft { background: var(--orange-soft); color: var(--orange); } .pay-st.none { background: var(--gray-soft); color: var(--muted); }
.pay-note { background: var(--blue-soft); color: var(--text); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; font-size: 13.5px; }
.pay-note.warn { background: var(--orange-soft); }
.pay-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.pay-kpi { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; background: var(--surface); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pay-kpi span { font-size: 12px; color: var(--muted); font-weight: 600; } .pay-kpi b { font-size: 19px; color: var(--c, var(--text)); white-space: nowrap; } .pay-kpi b small { font-size: 13px; color: var(--muted); }
.pay-kpi.big { background: var(--primary); border-color: var(--primary); } .pay-kpi.big span, .pay-kpi.big b { color: #fff; }
.pay-tbl th, .pay-tbl td { white-space: nowrap; padding-left: 8px; padding-right: 8px; } .pay-tbl th { line-height: 1.2; vertical-align: bottom; } .pay-tbl .r { text-align: right; } .pay-tbl .c { text-align: center; }
.pay-tbl td.bad, .pay-det td.bad { color: var(--red); } .pay-tbl td.warn, .pay-det td.warn { color: var(--orange); } .pay-tbl td.good, .pay-det td.good { color: var(--green); }
.pay-tbl tfoot td { border-top: 2px solid var(--border); font-weight: 600; background: var(--surface-2); }
.pay-net { font-size: 15px; }
.pay-who { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; color: var(--text); font: inherit; }
.pay-who span { display: flex; flex-direction: column; } .pay-who small { color: var(--muted); font-size: 12px; } .pay-who:hover b { color: var(--primary); text-decoration: underline; }
.pay-acts { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.pay-paid { border: 0; background: var(--green-soft); color: var(--green); font-weight: 700; font-size: 12.5px; padding: 6px 10px; border-radius: 99px; cursor: pointer; white-space: nowrap; }
.pay-det td { padding: 9px 6px; } .pay-det .r { text-align: right; white-space: nowrap; } .pay-det tr.tot td { font-size: 17px; font-weight: 800; border-top: 2px solid var(--text); }
input.saved { border-color: var(--green) !important; box-shadow: 0 0 0 3px var(--green-soft); }
.pay-slips { display: grid; gap: 10px; max-width: 720px; }
.pay-slip-card { display: flex; align-items: center; gap: 16px; border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; background: var(--surface); cursor: pointer; text-align: left; font: inherit; color: var(--text); }
.pay-slip-card:hover { border-color: var(--primary); }
.pay-slip-m { flex: 1; display: flex; flex-direction: column; gap: 3px; } .pay-slip-m b { font-size: 16px; } .pay-slip-m small { color: var(--muted); }
.pay-slip-n { font-size: 20px; font-weight: 800; } .pay-slip-go { color: var(--primary); font-weight: 700; font-size: 13px; }
@media (max-width: 1100px) { .pay-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .pay-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pay-slip-go { display: none; } }

.pay-pend { display: inline-block; margin-left: 5px; font-size: 11px; font-weight: 700; color: var(--orange); background: var(--orange-soft); border-radius: 99px; padding: 1px 6px; vertical-align: 1px; }

.pay-stamp-box { display: flex; align-items: center; gap: 16px; } .pay-stamp-prev { width: 110px; height: 110px; border: 1px dashed var(--border); border-radius: 14px; display: grid; place-items: center; background: #fff; flex: none; overflow: hidden; } .pay-stamp-prev img { width: 100%; height: 100%; object-fit: contain; }
