/* Timefolio — UI styles (light + dark), datainmeta brand theme */

/* Brand typeface: Poppins (SIL OFL 1.1, bundled — see assets/fonts/LICENSE.txt). Weights up to 600 use Medium, 650+ use Bold (the closest cuts to the brand's Semi Bold). */
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/poppins-regular.woff") format("woff"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500 600; font-display: swap; src: url("fonts/poppins-medium.woff") format("woff"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 650 800; font-display: swap; src: url("fonts/poppins-bold.woff") format("woff"); }

:root {
  /* brand book: blue #52AFE2, red #DB3726, black, white */
  --brand-blue: #52afe2; --brand-red: #db3726; --brand-black: #000000; --brand-white: #ffffff;
  --bg: #f5f7f9; --surface: #ffffff; --surface-2: #f9fafb; --text: #111111; --muted: #5f6670; --border: #e3e6ea;
  /* brand blue is a background colour: black text on it (8.6:1). Blue *text* uses a deeper shade of the same hue (5.2:1 on white). */
  --primary: var(--brand-blue); --primary-ink: #000000; --primary-hover: #3a9bd3; --primary-soft: #e6f3fb; --link: #1a73a8;
  --success: #16a34a; --success-soft: #dcfce7; --warning: #d97706; --warning-soft: #fef3c7; --danger: var(--brand-red); --danger-soft: #fbe4e1;
  --info-soft: #e6f3fb; --sidebar: var(--brand-black); --sidebar-ink: #d4d7dc; --sidebar-active: #1c1c1c;
  --radius: 10px; --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 1px 3px rgba(0, 0, 0, .05);
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b0c; --surface: #151617; --surface-2: #101112; --text: #ececee; --muted: #9a9fa6; --border: #26282b;
    --primary-soft: #52afe226; --link: var(--brand-blue); --danger: #e5574a; --success-soft: #14532d55; --warning-soft: #78350f55; --danger-soft: #db372633; --info-soft: #52afe21f;
    --sidebar: #000000; --sidebar-active: #1a1b1d; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0b0c; --surface: #151617; --surface-2: #101112; --text: #ececee; --muted: #9a9fa6; --border: #26282b;
  --primary-soft: #52afe226; --link: var(--brand-blue); --danger: #e5574a; --success-soft: #14532d55; --warning-soft: #78350f55; --danger-soft: #db372633; --info-soft: #52afe21f;
  --sidebar: #000000; --sidebar-active: #1a1b1d; --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.25; }
h1 { font-size: 1.5rem; font-weight: 650; }
h3 { font-size: .95rem; font-weight: 650; }
hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }
code, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .small { font-size: 12px; } .nowrap { white-space: nowrap; } .grow { flex: 1; min-width: 0; }
.mt { margin-top: 18px; } .pad { padding: 14px 16px; }
.good { color: var(--success); } .warn { color: var(--warning); } .bad { color: var(--danger); }
.icon { width: 18px; height: 18px; flex: none; vertical-align: -4px; }

/* shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 232px; flex: none; background: var(--sidebar); color: var(--sidebar-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; color: #fff; padding: 20px 20px 14px; }
.brand:hover { text-decoration: none; }
.brand-logo { display: block; height: 28px; width: auto; max-width: 100%; }
.brand-product { font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-blue); padding-left: 2px; }
/* logo variant per theme: dark wordmark on light surfaces, white wordmark on dark ones */
.on-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .on-light { display: none; } :root:not([data-theme="light"]) .on-dark { display: block; } }
:root[data-theme="dark"] .on-light { display: none; } :root[data-theme="dark"] .on-dark { display: block; }
.logo { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--primary); color: #fff; }
.sidebar nav { padding: 4px 10px; flex: 1; }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #8a9099; padding: 14px 10px 6px; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; color: var(--sidebar-ink); padding: 8px 10px; border-radius: 8px; margin-bottom: 2px; }
.sidebar nav a:hover { background: var(--sidebar-active); color: #fff; text-decoration: none; }
.sidebar nav a.active { background: var(--primary); color: var(--primary-ink); font-weight: 500; }
.sidebar-foot { font-size: 11px; color: #6b7178; padding: 12px 20px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.top-timer { flex: 1; min-width: 0; }
.top-user { display: flex; align-items: center; gap: 6px; }
.user-link { display: flex; align-items: center; gap: 8px; color: var(--text); }
.user-link > span:not(.avatar) { display: flex; flex-direction: column; line-height: 1.2; }
.user-link small { color: var(--muted); font-size: 11px; }
.menu-toggle { display: none; }
.content { padding: 24px; max-width: 1480px; width: 100%; }
.running-pill { display: inline-flex; align-items: center; gap: 10px; background: var(--success-soft); border-radius: 999px; padding: 4px 6px 4px 14px; max-width: 100%; }
.rp-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rp-time { font-family: var(--mono); font-weight: 600; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--success); flex: none; box-shadow: 0 0 0 0 rgba(22, 163, 74, .6); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

/* bare pages */
body.bare { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.bare-wrap { width: 100%; max-width: 440px; }
.brand-lg { color: var(--text); align-items: center; padding: 8px 0 22px; gap: 8px; }
.brand-lg .brand-logo { height: 46px; }
.brand-lg .brand-product { color: var(--link); font-size: 12px; }
.auth-card h2 { font-size: 1.2rem; }

/* page head */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.badges { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.lead { margin: -6px 0 16px; color: var(--muted); max-width: 80ch; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 18px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.card-head.pad { margin: 0; }
.table-card { padding: 0; overflow-x: auto; }
.table-scroll { overflow-x: auto; }
.grid-main { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-main > .card { margin-bottom: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 14px; }

/* tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table thead th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: var(--surface-2); }
.table tfoot th, .table tfoot td { background: var(--surface-2); font-weight: 650; }
.table tbody tr:hover { background: var(--surface-2); }
.table.compact td, .table.compact th { padding: 6px 10px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .desc { max-width: 340px; }
.table tr.day-start td { border-top: 2px solid var(--border); }
.table tr.is-running { background: var(--success-soft); }
.table tr.dim { opacity: .55; }
.table .empty { text-align: center; color: var(--muted); padding: 28px; }
.actions-cell { text-align: right; width: 1%; }
.card > .table { margin: 0; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 7px 12px; font: inherit; font-weight: 550; cursor: pointer; line-height: 1.3; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-danger-ghost { color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { padding: 4px 9px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; margin-top: 6px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: 16px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }
form.inline { display: inline; margin: 0; }

/* forms */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.req { color: var(--danger); font-weight: 600; }
.help { color: var(--muted); font-size: 11px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
input[type=color] { padding: 2px; height: 36px; }
input[type=checkbox] { width: auto; }
.check { display: inline-flex; align-items: center; gap: 8px; margin: 4px 18px 12px 0; cursor: pointer; }
.checks { display: flex; flex-wrap: wrap; }
.form-card { max-width: 820px; }
.form-card.wide { max-width: 1100px; }
.form-card h3 { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.form-card h3:first-of-type { border-top: 0; padding-top: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; flex: 1; min-width: 110px; }
.inline-field { flex-direction: row; align-items: center; gap: 8px; margin: 0; }
.inline-field input { width: auto; }
.status-form { display: grid; gap: 8px; margin-bottom: 14px; }
.status-form .field { margin: 0; }
.status-form button { justify-self: end; }
.row-gap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }

/* filters */
.filters { padding: 14px 16px 10px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0 12px; }
.filter-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.chip.on, .chip:hover { background: var(--primary-soft); color: var(--link); text-decoration: none; }
.summary-strip { display: flex; gap: 22px; margin: -4px 2px 12px; color: var(--muted); flex-wrap: wrap; }
.summary-strip b { color: var(--text); }

/* alerts & badges */
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid transparent; }
.alert-success { background: var(--success-soft); border-color: #86efac66; }
.alert-danger { background: var(--danger-soft); border-color: #fca5a566; }
.alert-info { background: var(--info-soft); }
.alert-warn { background: var(--warning-soft); border-color: #fcd34d66; }
.alert .icon { margin-right: 4px; }
.to-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 12px; }
.to-summary b { display: block; font-size: 1.5rem; line-height: 1.1; }
.to-summary small { color: var(--muted); }
.hol-list.compact li { padding: 5px 0; }
.hol-list.compact .hol-date { width: 36px; height: 36px; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.st-proposed { background: #f3e8ff; color: #7e22ce; border-color: #e9d5ff; }
.st-planned { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
.st-active { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.st-on_hold { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.st-completed { background: #e2e8f0; color: #334155; border-color: #cbd5e1; }
.st-cancelled { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.inv-new { background: #e0f2fe; color: #0369a1; } .inv-sent { background: #fef3c7; color: #b45309; } .inv-paid { background: #dcfce7; color: #15803d; }
.health { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
.health i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.h-green i, .healthbar .h-green { background: #22c55e; } .h-amber i, .healthbar .h-amber { background: #f59e0b; } .h-red i, .healthbar .h-red { background: var(--brand-red); }
.prio { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 4px; white-space: nowrap; }
.prio.p1 { background: var(--surface-2); color: var(--muted); } .prio.p2 { background: #e0f2fe; color: #0369a1; }
.prio.p3 { background: #ffedd5; color: #c2410c; } .prio.p4 { background: #fee2e2; color: #b91c1c; }
.cdot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 7px; vertical-align: 0; flex: none; }
.flag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: #b91c1c; background: var(--danger-soft); padding: 1px 7px; border-radius: 4px; margin: 2px 4px 2px 0; white-space: nowrap; }
.flag .icon { width: 12px; height: 12px; }
.flags-row { margin: -6px 0 14px; }
.tag { display: inline-block; font-size: 11px; background: var(--primary-soft); color: var(--link); padding: 0 7px; border-radius: 999px; margin: 2px 4px 0 0; }
.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; flex: none; vertical-align: middle; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpis-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpis-6 .kpi > b { font-size: 1.3rem; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.kpi > span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi > b { display: block; font-size: 1.55rem; font-weight: 700; margin: 2px 0; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi > small { color: var(--muted); display: block; }
.kpi .meter { margin-top: 8px; }
.kpi .meter-label { display: none; }

/* meters */
.meter { height: 7px; border-radius: 999px; background: var(--border); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.meter.ok > span { background: #22c55e; } .meter.warn > span { background: #f59e0b; } .meter.over > span { background: var(--brand-red); }
.meter-label { font-size: 11px; color: var(--muted); } .meter-label.over { color: var(--danger); font-weight: 600; }
.healthbar { display: flex; height: 18px; border-radius: 5px; overflow: hidden; margin-top: 6px; }
.healthbar span { display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; }

/* timer */
.timer-card { padding: 16px; }
.timer-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.timer-form .field { margin: 0; min-width: 170px; }
.timer-form .field.grow { flex: 2 1 240px; }
.btn-start { height: 37px; padding: 0 18px; }
.running-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 4px 0; }
.big-clock { font: 700 1.6rem var(--mono); font-variant-numeric: tabular-nums; }

/* charts */
.colchart { display: flex; gap: 6px; align-items: flex-end; height: 170px; }
.colchart .col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.colchart .bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; background: var(--surface-2); border-radius: 5px; }
.colchart .bar { width: 100%; background: var(--primary); border-radius: 5px; min-height: 2px; opacity: .85; }
.colchart .col.weekend .bar { opacity: .45; }
.colchart .col.today .bar { background: #16a34a; }
.colchart small { font-size: 10px; color: var(--muted); text-align: center; line-height: 1.2; margin-top: 4px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr 58px; gap: 10px; align-items: center; margin-bottom: 8px; }
.hbar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar b { text-align: right; font-family: var(--mono); font-size: 13px; }
.hbar-track { display: block; height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.hbar-track > span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
svg.chart { width: 100%; height: auto; display: block; }
svg.chart .grid { stroke: var(--border); stroke-width: 1; }
svg.chart .axis { fill: var(--muted); font-size: 10px; }
svg.chart .budget { stroke: var(--brand-red); stroke-width: 1.5; stroke-dasharray: 6 4; }
svg.chart .budget-label { fill: var(--brand-red); }
svg.chart .planned { stroke: #94a3b8; stroke-width: 1.5; stroke-dasharray: 3 3; }
svg.chart .today { stroke: #16a34a; stroke-width: 1; }
svg.chart .actual { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linejoin: round; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.legend .lg-actual { background: var(--primary); } .legend .lg-planned { background: #94a3b8; } .legend .lg-budget { background: var(--brand-red); }
.legend .lg-today { background: #16a34a; } .legend .lg-progress { background: var(--text); }

/* dashboard lists */
.watch { list-style: none; padding: 0; margin: 0; }
.watch li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.watch li:last-child { border-bottom: 0; }
.who { display: flex; align-items: center; gap: 10px; padding: 6px 0; }

/* portfolio */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 550; }
.tabs a small { background: var(--surface-2); border-radius: 999px; padding: 0 6px; margin-left: 4px; }
.tabs a.on { color: var(--link); border-bottom-color: var(--primary); }
.tabs a:hover { text-decoration: none; color: var(--text); }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.board-col { background: var(--surface-2); border-radius: 8px; padding: 8px; min-height: 80px; }
.board-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 8px; }
.pcard { display: block; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--pc); border-radius: 8px; padding: 10px; margin-bottom: 8px; color: var(--text); }
.pcard:hover { text-decoration: none; border-color: var(--primary); border-left-color: var(--pc); }
.pcard-top { display: flex; gap: 6px; align-items: center; }
.pcard-meta { display: flex; justify-content: space-between; align-items: center; margin: 6px 0; gap: 6px; }
.mini { display: grid; grid-template-columns: 52px 1fr 34px; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); margin-top: 4px; }
.mini small { text-align: right; }
.pcard-flags { margin-top: 6px; }
.matrix { display: grid; grid-template-columns: 22px 1fr; grid-template-rows: 1fr auto auto; gap: 6px; }
.matrix-y { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; font-size: 11px; color: var(--muted); }
.matrix-x { grid-column: 2; text-align: center; font-size: 11px; color: var(--muted); }
.matrix-legend { grid-column: 2; display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); }
.matrix-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -2px; }
.matrix-grid { display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(5, minmax(48px, 1fr)); gap: 3px; }
.mcell { border-radius: 6px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 3px; padding: 3px; }
.z-best { background: #dcfce7; } .z-manage { background: #fef9c3; } .z-maintain { background: #e0f2fe; } .z-mid { background: var(--surface-2); } .z-worst { background: #fee2e2; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .z-best { background: #14532d66; } :root:not([data-theme="light"]) .z-manage { background: #71350f55; } :root:not([data-theme="light"]) .z-maintain { background: #0c4a6e66; } :root:not([data-theme="light"]) .z-worst { background: #7f1d1d66; } }
.bubble { border-radius: 50%; border: 2px solid rgba(255, 255, 255, .9); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); opacity: .9; }
.bubble:hover { opacity: 1; transform: scale(1.1); }
.bc-row { display: grid; grid-template-columns: minmax(110px, 34%) 1fr 116px; gap: 10px; align-items: center; margin-bottom: 10px; }
.bc-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.bc-track { position: relative; height: 14px; background: var(--surface-2); border-radius: 4px; border: 1px solid var(--border); }
.bc-spent { position: absolute; left: 0; top: 0; bottom: 0; background: var(--primary); border-radius: 3px; opacity: .8; }
.bc-spent.warn { background: #f59e0b; } .bc-spent.over { background: var(--brand-red); }
.bc-progress, .bc-plan { position: absolute; top: -3px; bottom: -3px; width: 3px; margin-left: -1px; border-radius: 2px; }
.bc-progress { background: var(--text); } .bc-plan { background: #94a3b8; }
.bc-num { text-align: right; color: var(--muted); font-size: 11px; white-space: nowrap; }
.roadmap { font-size: 12px; }
.rm-head, .rm-row { display: grid; grid-template-columns: 210px 1fr; gap: 10px; align-items: center; }
.rm-row { height: 30px; }
.rm-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-label a { color: var(--text); }
.rm-track { position: relative; height: 100%; }
.rm-head .rm-track { height: 20px; }
.rm-head .rm-track span { position: absolute; color: var(--muted); font-size: 11px; transform: translateX(3px); }
.rm-grid { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--border); }
.rm-bar { position: absolute; top: 7px; height: 16px; border-radius: 4px; background: color-mix(in srgb, var(--pc) 30%, transparent); border: 1px solid var(--pc); overflow: hidden; }
.rm-bar.st-proposed, .rm-bar.st-planned { background: repeating-linear-gradient(45deg, transparent 0 4px, color-mix(in srgb, var(--pc) 20%, transparent) 4px 8px); border-style: dashed; }
.rm-bar.st-on_hold { opacity: .6; }
.rm-progress { display: block; height: 100%; background: var(--pc); opacity: .85; }
.rm-ms { position: absolute; top: 10px; width: 10px; height: 10px; background: var(--surface); border: 2px solid var(--text); transform: translateX(-5px) rotate(45deg); z-index: 2; }
.rm-ms.done { background: var(--text); } .rm-ms.late { border-color: var(--danger); background: var(--danger); }
.rm-today { position: absolute; top: -2px; bottom: -2px; border-left: 2px solid #16a34a; z-index: 1; }

/* project view */
.milestones { list-style: none; padding: 0; margin: 0; }
.milestones li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.milestones li.done .grow { text-decoration: line-through; color: var(--muted); }
.ms-check { width: 20px; height: 20px; border-radius: 5px; border: 2px solid var(--border); background: var(--surface); display: inline-grid; place-items: center; cursor: pointer; padding: 0; font-size: 12px; color: #fff; font-weight: 700; }
li.done .ms-check { background: var(--success); border-color: var(--success); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.timeline li p { margin: 2px 0 0; }
.timeline .health { padding-top: 5px; }

/* resources */
.spark { display: flex; gap: 3px; }
.spark span { width: 16px; height: 18px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--border); }
.heat-none { background: var(--surface-2) !important; } .heat-low { background: #bfdbfe !important; } .heat-mid { background: #86efac !important; }
.heat-high { background: #22c55e !important; color: #fff; } .heat-over { background: #f87171 !important; color: #fff; } .heat-unplanned { background: #fde68a !important; }
.heat-away { background: repeating-linear-gradient(135deg, #7dd3fc 0 3px, transparent 3px 6px) !important; }
.legend .heat-low, .legend .heat-mid, .legend .heat-high, .legend .heat-over, .legend .heat-unplanned { width: 12px; height: 12px; border-radius: 3px; }
.matrix-table th.rot { font-size: 11px; text-transform: none; letter-spacing: 0; max-width: 120px; white-space: normal; }
.mcell-a small { color: inherit; opacity: .7; }

/* week grid */
.week-grid th.today, .week-grid td.today { background: var(--primary-soft); }
.week-grid .add-row td { background: transparent; border-bottom: 0; padding: 4px 12px; }

.pager { display: flex; gap: 14px; justify-content: center; align-items: center; margin: 12px 0; color: var(--muted); }
.error-card { text-align: center; padding: 40px; }
.error-card h1 { font-size: 3rem; color: var(--muted); }
pre.code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; overflow-x: auto; font-size: 12px; }
code.token { user-select: all; font-weight: 600; word-break: break-all; }

/* invoice */
.invoice { max-width: 860px; margin: 0 auto 18px; padding: 36px; }
.inv-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.invoice .brand { color: var(--text); padding: 0 0 10px; }
.invoice .brand-logo { height: 34px; }
.inv-meta h2 { letter-spacing: .15em; color: var(--muted); font-size: 1.3rem; text-align: right; }
.inv-meta td { padding: 1px 0 1px 16px; }
.inv-to { margin-bottom: 20px; }
.inv-items tfoot td { border-bottom: 0; }
.inv-total td { font-size: 1.1rem; font-weight: 700; border-top: 2px solid var(--text); }
.invoice footer { margin-top: 26px; }
body.print-body { background: #fff; color: #000; padding: 20px; }
@media print {
  .on-light { display: block !important; } .on-dark { display: none !important; }
  .sidebar, .topbar, .page-head, .alert { display: none !important; }
  body, .card { background: #fff !important; color: #000 !important; box-shadow: none !important; border: 0 !important; }
  .content { padding: 0; }
  .invoice { padding: 0; }
}

/* ---------- time off & holidays ---------- */
.nav-count { margin-left: auto; background: #f59e0b; color: #fff; font-size: 11px; line-height: 18px; min-width: 20px; padding: 0 6px; border-radius: 999px; text-align: center; }
.kpis-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.abs-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  color: var(--ac); background: color-mix(in srgb, var(--ac) 14%, transparent); border: 1px solid color-mix(in srgb, var(--ac) 35%, transparent); }
.abs-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ac); }
.abs-badge.pending { border-style: dashed; }
.abs-st-pending { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.abs-st-approved { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.abs-st-rejected { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.leave-bar-card { padding: 14px 16px; }
.leave-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.leave-bar span { display: block; height: 100%; }
.lb-taken { background: #0ea5e9; } .lb-upcoming { background: #7dd3fc; }
.lb-pending { background: repeating-linear-gradient(45deg, #fcd34d 0 5px, #fde68a 5px 10px); }
.legend i.lb-taken, .legend i.lb-upcoming, .legend i.lb-pending, .legend i.lb-free { height: 10px; width: 14px; }
.legend i.lb-free { background: var(--surface-2); border: 1px solid var(--border); }
.hol-list { list-style: none; margin: 0; padding: 0; }
.hol-list li { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.hol-list li:last-child { border-bottom: 0; }
.hol-date { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; background: #fef3c7; color: #92400e; line-height: 1; flex: none; }
.hol-date b { font-size: 17px; } .hol-date small { font-size: 10px; text-transform: uppercase; }
.hol-inline { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; padding: 0; margin: 0; }
.abs-preview { min-height: 1.4em; margin: 0 0 8px; }
.absence-form .check { margin-top: 0; }
.decide-form { display: flex; gap: 6px; }
.decide-form input { flex: 1; min-width: 80px; padding: 4px 8px; }
.allow-form { display: flex; align-items: center; gap: 4px; }
.allow-form input { width: 70px; padding: 4px 6px; }
.rules { margin: 0; padding-left: 18px; }
.rules li { margin-bottom: 6px; }
.import-form { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.import-form > div { flex: 1 1 320px; }
.import-form .field { margin: 0; min-width: 140px; }
.import-form p { margin: 0; }
.weekday-picks { display: flex; gap: 4px; flex-wrap: wrap; }
.wd-pick { cursor: pointer; }
.wd-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wd-pick span { display: inline-block; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; color: var(--muted); }
.wd-pick input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.wd-pick input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
/* team calendar */
table.cal { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12px; }
.cal th, .cal td { border-bottom: 1px solid var(--border); text-align: center; padding: 0; height: 34px; min-width: 26px; }
.cal thead th { font-weight: 600; color: var(--muted); padding: 4px 0; line-height: 1.15; background: var(--surface-2); }
.cal thead th small { font-size: 10px; font-weight: 500; }
.cal .cal-name { text-align: left; padding: 0 12px; white-space: nowrap; position: sticky; left: 0; background: var(--surface); z-index: 1; font-weight: 550; min-width: 160px; }
.cal thead .cal-name { background: var(--surface-2); }
.cal .cal-sum { padding: 0 10px; font-weight: 650; white-space: nowrap; }
.cal .cal-sum small { color: var(--muted); font-weight: 400; }
.cal th.we, .cal td.off { background: repeating-linear-gradient(135deg, var(--surface-2) 0 4px, transparent 4px 8px); }
.cal th.hol, .cal td.hol { background: #fef3c7; }
.cal td.hol.half { background: linear-gradient(135deg, #fef3c7 50%, transparent 50%); }
.cal th.today { color: var(--link); box-shadow: inset 0 -3px 0 var(--primary); }
.cal td.today { box-shadow: inset 2px 0 0 var(--primary), inset -2px 0 0 var(--primary); }
.cal td.abs { background: var(--ac); color: #fff; font-weight: 700; }
.cal td.abs.half { background: linear-gradient(135deg, var(--ac) 50%, color-mix(in srgb, var(--ac) 25%, transparent) 50%); }
.cal td.abs.pending { background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--ac) 55%, transparent) 0 4px, color-mix(in srgb, var(--ac) 20%, transparent) 4px 8px); color: var(--text); }
.cal-add { display: block; width: 100%; height: 34px; }
.cal-add:hover { background: var(--primary-soft); }
.cal-key { display: inline-grid; place-items: center; width: 18px !important; height: 18px !important; border-radius: 4px !important; background: var(--ac); color: #fff; font-style: normal; font-size: 10px; font-weight: 700; }
.cal-key.pending { background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--ac) 55%, transparent) 0 3px, color-mix(in srgb, var(--ac) 20%, transparent) 3px 6px); }
.cal-key.hol { background: #fef3c7; border: 1px solid #fcd34d; }
.cal-key.off { background: repeating-linear-gradient(135deg, var(--border) 0 3px, transparent 3px 6px); border: 1px solid var(--border); }
/* capacity integration */
.day-flag { display: block; font-size: 10px; font-weight: 600; margin-top: 3px; text-transform: none; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; margin-left: auto; }
.day-flag.hol { color: #b45309; }
.day-flag.abs { color: var(--ac); }
.week-grid th.is-off, .week-grid td.is-off { background: repeating-linear-gradient(135deg, var(--surface-2) 0 4px, transparent 4px 8px); }
.week-grid th.is-hol, .week-grid td.is-hol { background: #fef3c7; }
.week-grid tfoot tr.target-row th { font-weight: 500; color: var(--muted); }
.week-grid tfoot .diff-pos { color: var(--success); } .week-grid tfoot .diff-neg { color: var(--danger); }
.away-mini { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.dim-note { color: var(--muted); font-size: 11px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cal th.hol, :root:not([data-theme="light"]) .cal td.hol, :root:not([data-theme="light"]) .week-grid .is-hol { background: #78350f66; }
  :root:not([data-theme="light"]) .hol-date { background: #78350f66; color: #fde68a; }
}
@media (max-width: 1200px) { .kpis-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 800px) { .kpis-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .decide-form { flex-wrap: wrap; } }

.table.kv th { width: 34%; font-size: 12px; text-transform: none; letter-spacing: 0; color: var(--muted); background: transparent; vertical-align: top; }
.mono-soft { font-family: var(--mono); font-size: 12px; word-break: break-word; }
.diag { list-style: none; padding: 0; margin: 14px 0 0; }
.diag li { padding: 8px 10px; border-radius: 8px; margin-bottom: 6px; word-break: break-word; }
.diag li.ok { background: var(--success-soft); } .diag li.fail { background: var(--danger-soft); }
.sync-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.sync-list ul { margin: 4px 0 0; padding-left: 18px; font-size: 12px; max-height: 220px; overflow: auto; }
.dn, .dn-box { word-break: break-all; font-family: var(--mono); font-size: 11px; }
.dn-box { padding: 8px 10px; border: 1px dashed var(--border); border-radius: 8px; background: var(--surface-2); }
.badge.src-ad { background: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }
.sso-hint { margin: 0 0 12px; }
.sso-hint .icon { width: 15px; height: 15px; vertical-align: -3px; margin-right: 4px; }
input[readonly] { background: var(--surface-2); color: var(--muted); }

.btn-ms { background: #2f2f2f; border-color: #2f2f2f; color: #fff; padding: 10px 14px; gap: 10px; font-weight: 600; }
.btn-ms:hover { background: #111; color: #fff; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 16px 0 10px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.center { text-align: center; }
.badge.src-entra { background: var(--primary-soft); color: var(--link); border-color: #52afe255; }
.copy-field { display: flex; gap: 6px; }
.copy-field input { font-family: var(--mono); font-size: 12px; }

/* billing */
.badge.bill-billed { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.badge.bill-partial { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.badge.bill-open { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.badge.bill-empty { background: var(--surface-2); color: var(--muted); }
.bill-scope { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; }
.bill-scope .row-gap { margin: 0; }
.bill-table tr.bill-customer td { background: var(--surface-2); border-top: 2px solid var(--border); }
.bill-table tr.bill-project td:first-child { padding-left: 28px; }
.bill-table .meter-label { display: none; }
.bill-table form.inline + form.inline { margin-left: 4px; }
.month-strip { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; }
.mcell-b { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); text-decoration: none !important; border-radius: 6px; padding: 4px 0; }
.mcell-b.on { background: var(--primary-soft); color: var(--link); font-weight: 600; }
.mb-bar { width: 70%; height: 64px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; display: flex; align-items: flex-end; overflow: hidden; }
.mb-bar i { display: block; width: 100%; background: #22c55e; }
.s-partial .mb-bar i { background: #f59e0b; } .s-open .mb-bar { border-color: #fca5a5; }
.legend i.lg-billed { background: #22c55e; } .legend i.lg-partial { background: #f59e0b; } .legend i.lg-open { background: transparent; border: 1px solid #fca5a5; }
.bill-log { list-style: none; padding: 0; margin: 0; }
.bill-log li { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.bill-log li.undone .grow { opacity: .55; text-decoration: line-through; }
.bill-log li:last-child { border-bottom: 0; }
@media (max-width: 800px) { .month-strip { grid-template-columns: repeat(6, 1fr); } }

/* travel expenses */
.badge.exp-submitted { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.badge.exp-approved { background: var(--primary-soft); color: var(--link); border-color: #52afe255; }
.badge.exp-reimbursed { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.badge.exp-rejected { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.exp-money .field-wrap[hidden] { display: none; }
.calc { display: block; padding: 7px 0; font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.receipt-zone { border: 2px dashed var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; background: var(--surface-2); }
.receipt-zone input[type=file] { background: var(--surface); }
.file-list, .receipt-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.file-list li, .receipt-list li { display: flex; gap: 8px; align-items: center; padding: 3px 0; }
.file-list li.bad { color: var(--danger); }
.receipt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.receipt-grid figure { margin: 0; }
.receipt-grid img { width: 100%; height: 190px; object-fit: contain; object-position: center top; border: 1px solid var(--border); border-radius: 8px; background: #fff; display: block; }
.pdf-tile { display: grid; place-items: center; align-content: center; gap: 6px; height: 190px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--muted); font-weight: 700; }
.pdf-tile .icon { width: 36px; height: 36px; }
.receipt-grid figcaption { font-size: 11px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.decide-card .form-actions { margin-top: 4px; }

/* responsive */
@media (max-width: 1200px) {
  .kpis-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .grid-main { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rm-head, .rm-row { grid-template-columns: 140px 1fr; }
}
@media (max-width: 800px) {
  .sidebar { position: fixed; left: -240px; z-index: 50; transition: left .2s; }
  body.nav-open .sidebar { left: 0; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  .menu-toggle { display: inline-grid; }
  .content { padding: 16px; }
  .topbar { padding: 8px 16px; }
  .top-user .user-link > span:not(.avatar), .rp-label { display: none; }
  .kpis, .kpis-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .timer-form .field { min-width: 100%; }
  .bc-row { grid-template-columns: 1fr; gap: 3px; }
  .bc-num { text-align: left; }
  .invoice { padding: 18px; }
}
