:root {
  --bg: #f5f6f8; --surface: #ffffff; --surface2: #f0f2f5; --border: #e2e5ea; --text: #1b1f24; --text2: #5b6470; --muted: #8a929c;
  --accent: #128c7e; --accent-ink: #ffffff; --accent-soft: #e3f4f1; --danger: #d0353a; --danger-soft: #fdecec; --warn: #e6862a; --warn-soft: #fdf1e4;
  --good: #1f9d55; --good-soft: #e4f5ea; --info: #2f6fdb; --info-soft: #e7effc; --chat-in: #ffffff; --chat-out: #dcf6e9; --chat-bg: #eef0ec;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06); --r: 10px; --chart: #128c7e;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0f1215; --surface: #171b20; --surface2: #1f242a; --border: #2b3138; --text: #e8ebee; --text2: #a8b0b9; --muted: #78818b;
  --accent: #25b8a5; --accent-ink: #06201c; --accent-soft: #123430; --danger: #f0686c; --danger-soft: #3a1c1e; --warn: #f2a65a; --warn-soft: #3a2a17;
  --good: #4cc47e; --good-soft: #163221; --info: #6f9ff0; --info-soft: #18263d; --chat-in: #1f242a; --chat-out: #12382f; --chat-bg: #12161a;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3); --chart: #2cc0ac;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
h1 { font-size: 20px; margin: 0; } h2 { font-size: 16px; margin: 0 0 10px; } h3 { font-size: 14px; margin: 0 0 8px; }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; width: 100%; min-width: 0; }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
label { display: block; font-size: 12px; color: var(--text2); }
label input, label select, label textarea { margin-top: 3px; font-size: 14px; color: var(--text); }
.error { color: var(--danger); font-size: 13px; min-height: 18px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); padding: 6px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { color: var(--danger); } .btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 3px 8px; font-size: 12px; }
.btn.wide { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { border: 0; background: transparent; cursor: pointer; padding: 6px; border-radius: 8px; color: var(--text2); display: inline-flex; }
.icon-btn:hover { background: var(--surface2); color: var(--text); }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* login */
.login { min-height: 100%; display: grid; place-items: center; padding: 20px; }
.login-card { background: var(--surface); padding: 28px; border-radius: 14px; box-shadow: var(--shadow); width: 340px; display: grid; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.brand.big { font-size: 18px; margin-bottom: 6px; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; }

/* layout */
.app { display: flex; height: 100vh; }
.nav { width: 210px; flex: none; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 12px 8px; gap: 2px; overflow-y: auto; }
.nav .brand { padding: 4px 8px 12px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text2); text-decoration: none; }
.nav a:hover { background: var(--surface2); color: var(--text); }
.nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav .sep { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 12px 10px 4px; }
.nav .grow { flex: 1; }
.nav .me { padding: 8px 10px; font-size: 12px; color: var(--text2); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.badge { margin-left: auto; background: var(--accent); color: var(--accent-ink); border-radius: 999px; font-size: 11px; padding: 0 7px; font-weight: 700; min-width: 20px; text-align: center; }
.badge.warn { background: var(--warn); color: #fff; } .badge.danger { background: var(--danger); color: #fff; }
.main { flex: 1; min-width: 0; overflow: auto; }
.page { padding: 20px 24px; max-width: 1400px; }
.page-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin-right: auto; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; }
.toolbar .search { min-width: 220px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; }
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.kpi { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.row { display: flex; gap: 8px; align-items: center; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 8px; }
.form { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.form .full { grid-column: 1 / -1; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--surface2); color: var(--text2); white-space: nowrap; }
.chip.good { background: var(--good-soft); color: var(--good); } .chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.danger { background: var(--danger-soft); color: var(--danger); } .chip.info { background: var(--info-soft); color: var(--info); }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 12px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 8px 12px; cursor: pointer; color: var(--text2); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 5px 10px; cursor: pointer; color: var(--text2); }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.empty { padding: 30px; text-align: center; color: var(--muted); }

/* tables */
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 12px; color: var(--text2); font-weight: 600; background: var(--surface2); position: sticky; top: 0; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--surface2); }
tfoot td { font-weight: 700; background: var(--surface2); }

/* modal */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); width: 560px; max-width: 100%; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal.wide { width: 860px; }
.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); gap: 8px; }
.modal-head h2 { margin: 0; flex: 1; }
.modal-body { padding: 16px 18px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
.modal-foot .left { margin-right: auto; }

/* toasts and tooltip */
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 60; }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); max-width: 360px; cursor: pointer; }
.toast.err { background: var(--danger); color: #fff; }
.tip { position: fixed; pointer-events: none; background: var(--text); color: var(--bg); padding: 6px 9px; border-radius: 6px; font-size: 12px; z-index: 70; white-space: nowrap; }

/* inbox */
.inbox { display: grid; grid-template-columns: 330px 1fr; height: 100%; }
.inbox.with-panel { grid-template-columns: 330px 1fr 340px; }
.list-col { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.list-head { padding: 12px; border-bottom: 1px solid var(--border); display: grid; gap: 8px; }
.list-head .row select { flex: 1; }
.leads { overflow-y: auto; flex: 1; }
.lead { display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); cursor: pointer; border-left: 3px solid transparent; }
.lead:hover { background: var(--surface2); }
.lead.on { background: var(--accent-soft); }
.lead.waiting { border-left-color: var(--warn); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--surface2); display: grid; place-items: center; font-weight: 700; color: var(--text2); flex: none; font-size: 13px; }
.lead .body { min-width: 0; flex: 1; }
.lead .top { display: flex; gap: 6px; align-items: baseline; }
.lead .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.lead .time { font-size: 11px; color: var(--muted); }
.lead .last { color: var(--text2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead .tags { display: flex; gap: 4px; margin-top: 3px; flex-wrap: wrap; }
.unread { background: var(--accent); color: var(--accent-ink); border-radius: 999px; font-size: 11px; padding: 0 6px; font-weight: 700; }
.chat-col { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--chat-bg); position: relative; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--border); }
.chat-head .who { flex: 1; min-width: 0; }
.chat-head .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgs { flex: 1; overflow-y: auto; padding: 16px 6%; display: flex; flex-direction: column; gap: 4px; }
.msg { max-width: 72%; padding: 6px 10px 4px; border-radius: 10px; background: var(--chat-in); align-self: flex-start; box-shadow: 0 1px 1px rgba(0,0,0,.06); white-space: pre-wrap; word-wrap: break-word; }
.msg.out { align-self: flex-end; background: var(--chat-out); }
.msg .meta { font-size: 11px; color: var(--muted); text-align: right; margin-top: 2px; }
.msg img, .msg video { max-width: 280px; max-height: 320px; border-radius: 8px; display: block; margin-bottom: 4px; cursor: pointer; }
.msg audio { width: 260px; display: block; }
.day-sep { align-self: center; font-size: 12px; color: var(--text2); background: var(--surface); padding: 2px 10px; border-radius: 8px; margin: 8px 0; }
.composer { background: var(--surface); border-top: 1px solid var(--border); padding: 10px 12px; display: flex; gap: 8px; align-items: flex-end; position: relative; }
.composer textarea { min-height: 40px; max-height: 160px; resize: none; }
.files { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px 12px 0; background: var(--surface); }
.qr-pop { position: absolute; bottom: 100%; left: 12px; right: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); max-height: 260px; overflow: auto; }
.qr-pop div { padding: 8px 12px; cursor: pointer; } .qr-pop div.on, .qr-pop div:hover { background: var(--accent-soft); }
.drop { position: absolute; inset: 0; background: rgba(18,140,126,.15); border: 3px dashed var(--accent); display: grid; place-items: center; font-size: 18px; font-weight: 700; color: var(--accent); z-index: 5; }
.panel { border-left: 1px solid var(--border); background: var(--surface); overflow-y: auto; padding: 14px; }
.panel .section { margin-bottom: 16px; }
.timeline { display: grid; gap: 8px; }
.tl { border-left: 2px solid var(--border); padding: 2px 0 2px 10px; font-size: 13px; }
.tl.act { border-color: var(--accent); }
.tl .when { font-size: 11px; color: var(--muted); }

/* tasks */
.task { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-bottom: 1px solid var(--border); background: var(--surface); }
.task:hover { background: var(--surface2); }
.task .tbody { flex: 1; min-width: 0; cursor: pointer; }
.task .ttitle { font-weight: 500; }
.task.done .ttitle { text-decoration: line-through; color: var(--muted); }
.task .tmeta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 3px; font-size: 12px; color: var(--text2); align-items: center; }
.check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--muted); flex: none; cursor: pointer; background: none; display: grid; place-items: center; margin-top: 1px; padding: 0; }
.check.on { background: var(--good); border-color: var(--good); color: #fff; }
.prio-Urgent { color: var(--danger); font-weight: 700; } .prio-High { color: var(--warn); font-weight: 600; }
.overdue { color: var(--danger); font-weight: 600; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; align-items: start; padding-bottom: 8px; }
.bcol { background: var(--surface2); border-radius: var(--r); padding: 8px; min-height: 140px; }
.bcol.over { outline: 2px dashed var(--accent); }
.bcol h3 { display: flex; justify-content: space-between; padding: 2px 4px 8px; margin: 0; font-size: 13px; }
.bcard { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; margin-bottom: 8px; cursor: grab; box-shadow: 0 1px 1px rgba(0,0,0,.04); }
.bcard:hover { border-color: var(--accent); }
.bcard .t { font-weight: 500; margin-bottom: 4px; }
.bcard .m { display: flex; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--text2); }
.bcard.dragging { opacity: .4; }
.progress { height: 6px; border-radius: 999px; background: var(--surface2); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.progress.warn > i { background: var(--warn); } .progress.danger > i { background: var(--danger); }
.pcard { cursor: pointer; display: grid; gap: 8px; border-top: 4px solid var(--accent); }
.pcard:hover { box-shadow: var(--shadow); }
.checklist .ci { display: flex; gap: 8px; align-items: center; padding: 3px 0; }
.checklist .ci input[type=text] { border: 0; padding: 2px 4px; }
.comment { padding: 8px 10px; background: var(--surface2); border-radius: 8px; margin-bottom: 6px; white-space: pre-wrap; }

/* inventory */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.vcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; }
.vcard:hover { box-shadow: var(--shadow); }
.vcard .ph { aspect-ratio: 4/3; background: var(--surface2); display: grid; place-items: center; color: var(--muted); position: relative; }
.vcard .ph svg.i { width: 48px; height: 48px; stroke-width: 1.5; }
.vcard .ph img { width: 100%; height: 100%; object-fit: cover; }
.vcard .ph .chip { position: absolute; top: 8px; left: 8px; }
.vcard .vb { padding: 10px 12px; display: grid; gap: 3px; }
.vcard .price { font-weight: 700; font-size: 16px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.photos .p { position: relative; aspect-ratio: 4/3; border-radius: 8px; overflow: hidden; background: var(--surface2); }
.photos img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.photos .p .acts { position: absolute; right: 4px; top: 4px; display: none; gap: 4px; }
.photos .p:hover .acts { display: flex; }
.photos .p .acts button { background: rgba(0,0,0,.6); color: #fff; border: 0; border-radius: 6px; font-size: 11px; padding: 2px 6px; cursor: pointer; }
.photos .p .cover { position: absolute; left: 4px; bottom: 4px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 4px 12px; font-size: 13px; }
.kv dt { color: var(--text2); } .kv dd { margin: 0; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: grid; place-items: center; z-index: 80; cursor: zoom-out; }
.lightbox img, .lightbox video { max-width: 94vw; max-height: 94vh; }

.vtop { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); margin-bottom: 14px; }
@media (max-width: 760px) { .vtop { grid-template-columns: 1fr; } }

/* dashboard */
.kpi-tile { display: grid; gap: 2px; cursor: default; }
.kpi-tile.link { cursor: pointer; } .kpi-tile.link:hover { border-color: var(--accent); }
.kpi-tile .v { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-tile .l { font-size: 12px; color: var(--text2); }
.kpi-tile .s { font-size: 12px; color: var(--muted); }
.chart { width: 100%; height: 180px; display: block; }
.chart .bar { fill: var(--chart); } .chart .bar:hover, .chart .bar.hot { opacity: .75; }
.chart text { fill: var(--muted); font-size: 10px; }
.chart .grid line { stroke: var(--border); }
.feed { display: grid; gap: 6px; font-size: 13px; }
.feed .f { display: flex; gap: 8px; } .feed .f .when { color: var(--muted); font-size: 11px; white-space: nowrap; margin-left: auto; }
.wl { display: grid; gap: 10px; }
.wl-user .head { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.wl-user .stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text2); margin-top: 6px; }
.wl-user .stats b { color: var(--text); }
.qr-img { width: 260px; height: 260px; background: #fff; padding: 8px; border-radius: 8px; }

@media (max-width: 1100px) { .inbox.with-panel { grid-template-columns: 300px 1fr; } .inbox.with-panel .panel { position: fixed; right: 0; top: 0; bottom: 0; width: 340px; z-index: 20; box-shadow: var(--shadow); } }
@media (max-width: 760px) {
  .app { flex-direction: column; }
  .nav { width: auto; flex: none; flex-direction: row; align-items: center; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--border); padding: 4px 6px; }
  .nav .me { flex-wrap: nowrap; padding: 0 4px; }
  .main { min-height: 0; }
  .nav .brand, .nav .sep, .nav .grow, .nav .me span { display: none; }
  .nav a { flex-direction: column; gap: 2px; font-size: 11px; padding: 5px 8px; }
  .inbox, .inbox.with-panel { grid-template-columns: 1fr; height: 100%; }
  .inbox.chat-open .list-col { display: none; } .inbox:not(.chat-open) .chat-col { display: none; }
  .page { padding: 14px; } .form { grid-template-columns: 1fr; }
  .msg { max-width: 88%; }
}

/* notifications, timer, printing */
.bell { position: relative; }
.badge.dot { position: absolute; top: -2px; right: -4px; font-size: 10px; padding: 0 4px; min-width: 16px; }
.notif-pop { position: fixed; width: 370px; max-height: 70vh; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); z-index: 70; display: flex; flex-direction: column; }
.notif-list { overflow-y: auto; }
.notif { padding: 9px 12px; border-bottom: 1px solid var(--border); cursor: pointer; display: grid; gap: 2px; }
.notif:hover { background: var(--surface2); } .notif.new { background: var(--accent-soft); }
.ntype { display: inline-block; width: 18px; text-align: center; } .ntype.overdue { color: var(--danger); }
.timer-chip { margin: 4px 8px; padding: 6px 10px; border-radius: 8px; background: var(--danger-soft); color: var(--danger); font-size: 12px; display: flex; gap: 6px; align-items: center; cursor: pointer; }
#print { display: none; }
@media print {
  body.printing > *:not(#print) { display: none !important; }
  body.printing #print { display: block; }
  body.printing { background: #fff; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* gantt / roadmap */
.gantt { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.g-body { display: flex; overflow-x: auto; position: relative; }
.g-left { position: sticky; left: 0; z-index: 4; background: var(--surface); border-right: 1px solid var(--border); width: 260px; flex: none; }
.g-lhead { height: 42px; border-bottom: 1px solid var(--border); padding: 12px 10px; font-size: 12px; color: var(--text2); }
.g-names-wrap { position: relative; }
.g-name { position: absolute; left: 0; right: 0; height: 34px; display: flex; align-items: center; gap: 4px; padding-right: 8px; font-size: 13px; white-space: nowrap; overflow: hidden; cursor: pointer; border-bottom: 1px solid var(--border); }
.g-name:hover { background: var(--surface2); }
.g-name > span:not(.small) { overflow: hidden; text-overflow: ellipsis; }
.g-name.group { font-weight: 700; background: var(--surface2); padding-left: 10px; cursor: default; }
.g-right { flex: none; position: relative; }
.g-head { height: 42px; position: relative; border-bottom: 1px solid var(--border); font-size: 11px; color: var(--text2); }
.g-month { position: absolute; top: 3px; font-weight: 600; white-space: nowrap; padding-left: 4px; border-left: 1px solid var(--border); }
.g-day { position: absolute; top: 22px; text-align: center; font-size: 10px; white-space: nowrap; }
.g-day.sun { color: var(--danger); }
.g-track { position: relative; }
.g-bg { position: absolute; inset: 0; }
.g-weekend { position: absolute; top: 0; bottom: 0; background: var(--surface2); opacity: .7; }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); opacity: .6; z-index: 1; }
.g-bar { position: absolute; height: 20px; border-radius: 5px; background: var(--accent); color: #fff; font-size: 11px; overflow: hidden; cursor: grab; z-index: 2; display: flex; align-items: center; user-select: none; touch-action: none; }
.g-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(0,0,0,.22); }
.g-bar span { position: relative; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-bar.late { box-shadow: 0 0 0 2px var(--danger); }
.g-bar.done { opacity: .5; }
.g-bar.dragging { opacity: .8; cursor: grabbing; }
.g-resize { position: absolute; right: 0; top: 0; bottom: 0; width: 8px; cursor: ew-resize; background: rgba(255,255,255,.3); }
.g-ms { position: absolute; width: 16px; height: 16px; background: var(--warn); transform: rotate(45deg); border-radius: 2px; z-index: 3; cursor: pointer; border: 2px solid var(--surface); }
.g-ms.done { background: var(--good); }
.g-deps { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 1; color: var(--text2); overflow: visible; }
.g-dep { fill: none; stroke: currentColor; stroke-width: 1.5; opacity: .7; }
.g-dep.bad { stroke: var(--danger); }
.g-grouprow { position: absolute; left: 0; right: 0; background: var(--surface2); }
.roadmap .g-name { height: 44px; }
.roadmap .g-bar { height: 22px; }
.dotc { width: 10px; height: 10px; border-radius: 50%; flex: none; margin-left: 10px; }
/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--border); gap: 1px; }
.cal-h { background: var(--surface2); padding: 6px; font-size: 12px; color: var(--text2); text-align: center; }
.cal-cell { background: var(--surface); min-height: 108px; padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-cell.other { background: var(--bg); } .cal-cell.other .cal-date { color: var(--muted); }
.cal-cell.today .cal-date { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0 7px; align-self: flex-start; }
.cal-cell.over { outline: 2px dashed var(--accent); outline-offset: -3px; }
.cal-date { font-size: 12px; font-weight: 600; }
.cal-task { font-size: 12px; padding: 2px 6px; border-radius: 4px; background: var(--surface2); border-left: 3px solid var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal-task.done { text-decoration: line-through; color: var(--muted); } .cal-task.late { color: var(--danger); }
/* misc work */
.tag { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 11px; background: var(--info-soft); color: var(--info); }
.blocked { color: var(--warn); font-weight: 600; }
.task .play { opacity: 0; } .task:hover .play { opacity: 1; }
.myday-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .myday-grid { grid-template-columns: 1fr; } }
.sec-title { display: flex; align-items: center; gap: 8px; margin: 14px 0 6px; font-weight: 700; }
.sec-title .n { color: var(--muted); font-weight: 400; }
.heat { display: flex; gap: 2px; margin-top: 8px; }
.heat i { flex: 1; height: 14px; border-radius: 3px; background: var(--surface2); }

/* billing */
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.doc-paper { background: #fff; color: #1d2329; border-radius: 6px; box-shadow: var(--shadow); overflow: auto; }
@media (max-width: 1100px) { .doc-layout { grid-template-columns: 1fr; } }
.designer { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 16px; align-items: start; }
.designer > .card { position: sticky; top: 8px; max-height: calc(100vh - 100px); overflow-y: auto; }
.designer-controls h3 { margin: 12px 0 4px; }
@media (max-width: 1000px) { .designer { grid-template-columns: 1fr; } .designer > .card { position: static; max-height: none; } }
.layouts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.layout { border: 2px solid var(--border); background: var(--surface); border-radius: 10px; padding: 8px; cursor: pointer; text-align: left; display: grid; gap: 2px; }
.layout.on { border-color: var(--accent); background: var(--accent-soft); }
.lthumb { height: 46px; border-radius: 4px; background: #fff; border: 1px solid var(--border); display: grid; grid-template-rows: 12px 1fr 6px; gap: 3px; padding: 4px; margin-bottom: 4px; }
.lthumb i { display: block; border-radius: 2px; background: #dfe3e7; }
.lthumb.classic i:first-child { border-bottom: 2px solid #1f4e79; background: transparent; }
.lthumb.modern i:first-child { background: #1f4e79; } .lthumb.bold i:first-child { background: #1d2329; } .lthumb.bold i:last-child { background: #1f4e79; }
.lthumb.minimal i { background: #f0f1f2; } .lthumb.compact { grid-template-rows: 8px 1fr 4px; } .lthumb.thermal { width: 40%; margin-left: 30%; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); cursor: pointer; }
.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.menu-pop { position: fixed; z-index: 70; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; display: grid; min-width: 200px; }
.menu-pop button { border: 0; background: none; text-align: left; padding: 8px 12px; border-radius: 6px; cursor: pointer; color: var(--text); }
.menu-pop button:hover { background: var(--surface2); } .menu-pop hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
table.tot td { padding: 3px 6px; } td.lt { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- v5: HR attendance register and calendar ---------- */
table.muster { border-collapse: collapse; font-size: 12px; }
table.muster th, table.muster td { padding: 3px 2px; text-align: center; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.muster th.n, table.muster td.n { text-align: left; min-width: 160px; padding: 4px 8px; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.mcell { display: inline-block; min-width: 26px; padding: 3px 2px; border-radius: 5px; font-weight: 700; font-size: 11px; cursor: pointer; position: relative; background: var(--surface2); color: var(--muted); }
.mcell.late::after, .hrday.late::after { content: ''; position: absolute; top: 2px; right: 2px; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.mcell.mo, .hrday.mo { outline: 1.5px dashed var(--warn); }
.c-P { background: var(--good-soft) !important; color: var(--good) !important; } .c-A { background: var(--danger-soft) !important; color: var(--danger) !important; }
.c-HD { background: var(--warn-soft) !important; color: var(--warn) !important; } .c-L, .c-HL { background: #ede9fe !important; color: #6d28d9 !important; }
.c-H { background: var(--info-soft) !important; color: var(--info) !important; } .c-WO, .c-x { color: var(--muted) !important; } .c-OD, .c-WFH { background: var(--accent-soft) !important; color: var(--accent) !important; }
[data-theme=dark] .c-L, [data-theme=dark] .c-HL { background: #2e2454 !important; color: #c4b5fd !important; }
.hrcal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.hrday { position: relative; border-radius: 8px; padding: 5px 6px; min-height: 56px; background: var(--surface2); cursor: pointer; font-size: 12px; }
details.card > summary { list-style: none; } details.card > summary::-webkit-details-marker { display: none; }
details.card[open] > summary { margin-bottom: 8px; }
