/* Quality People — design system. Tokens shared with Quality CFO Copilot's palette. */
:root {
  --ink: #17253a;
  --ink-2: #26364d;
  --muted: #5b6b82;
  --line: #dce4ee;
  --line-soft: #e9eef4;
  --soft: #f5f8fb;
  --panel: #ffffff;
  --brand: #0872b9;
  --brand-hover: #065f9c;
  --brand-soft: #eaf4fb;
  --ok: #1a7f5a;
  --ok-soft: #eaf7f1;
  --warn: #8a5300;
  --warn-soft: #fff4e0;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --info: #0b5d95;
  --info-soft: #e8f2fa;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(23, 37, 58, .06), 0 4px 14px rgba(23, 37, 58, .05);
  --sidebar: 245px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --tap: 44px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5;
  color: var(--ink); background: var(--soft);
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { color: var(--ink); line-height: 1.25; margin: 0; }
h1 { font-size: 22px; font-weight: 750; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0 0 .75em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--panel); padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8;
        stroke-linecap: round; stroke-linejoin: round; }

/* ---------- shell ---------- */
.shell { min-height: 100vh; }
.sidebar { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 34px; height: 34px; flex: none; border-radius: 9px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; white-space: nowrap; }
.brand-text small { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--brand); }
.brand-text strong { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.company-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.company-logo { height: 28px; width: auto; max-width: 120px; object-fit: contain; flex: none; }
.topbar-spacer { flex: 1; }
.company-switch select { font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line);
                         border-radius: var(--radius-sm); background: var(--panel); color: var(--ink); max-width: 46vw; }
.company-name { font-size: 13px; color: var(--muted); max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: var(--tap); height: var(--tap);
            border-radius: 50%; color: var(--ink-2); background: transparent; border: 0; cursor: pointer; }
.icon-btn:hover { background: var(--soft); text-decoration: none; }
.badge-dot { position: absolute; top: 8px; right: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
             background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.main { padding: 16px 16px 96px; max-width: 1180px; margin: 0 auto; }
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--panel); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 6px;
                min-height: 56px; font-size: 11px; font-weight: 600; color: var(--muted); }
.bottom-nav a:hover { text-decoration: none; }
.bottom-nav a[aria-current="page"] { color: var(--brand); }

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
  .sidebar {
    display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
    padding: 18px 12px; background: var(--panel); border-right: 1px solid var(--line);
  }
  .sidebar .brand { padding: 2px 8px 18px; }
  .sidebar-toggle { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0;
                    border-radius: var(--radius-sm); background: none; color: var(--muted); font: inherit; font-size: 13px;
                    font-weight: 600; cursor: pointer; }
  .sidebar-toggle:hover { background: var(--soft); color: var(--ink); }
  .sidebar-toggle .icon { transition: transform .2s; }
  /* Collapsed: icons only (preference kept in a cookie, rendered server-side: no flash). */
  .shell.is-collapsed { grid-template-columns: 76px minmax(0, 1fr); }
  .shell.is-collapsed .sidebar { padding: 18px 10px; }
  .shell.is-collapsed .brand-text, .shell.is-collapsed .nav-label, .shell.is-collapsed .sidebar-section,
  .shell.is-collapsed .sidebar-toggle-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .shell.is-collapsed .sidebar .brand { justify-content: center; padding: 2px 0 18px; }
  .shell.is-collapsed .sidebar a.nav-link, .shell.is-collapsed .sidebar-toggle { justify-content: center; padding: 10px 0; }
  .shell.is-collapsed .sidebar-section + a.nav-link { margin-top: 14px; }
  .shell.is-collapsed .sidebar-toggle .icon { transform: rotate(180deg); }
  .sidebar-section { margin: 14px 10px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase;
                     letter-spacing: .06em; color: var(--muted); }
  .sidebar a.nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm);
                        color: var(--ink-2); font-weight: 600; font-size: 14px; }
  .sidebar a.nav-link:hover { background: var(--soft); text-decoration: none; }
  .sidebar a.nav-link[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }
  .topbar .brand { display: none; }
  .bottom-nav { display: none; }
  .main { padding: 24px 32px 48px; }
}

/* ---------- page header ---------- */
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-header .eyebrow { font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a { padding: 10px 12px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--brand); border-color: var(--brand); }
.tabs a:hover { text-decoration: none; color: var(--ink); }

/* ---------- cards & layout ---------- */
.grid { display: grid; gap: 14px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1080px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } .grid-main { grid-template-columns: 1.4fr 1fr; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card-link { font-size: 13px; font-weight: 600; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.divider { border: 0; border-top: 1px solid var(--line-soft); margin: 12px 0; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; }
.stat .hint { font-size: 13px; color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.list > li:first-child { border-top: 0; }

/* ---------- clock hero ---------- */
.clock-hero { text-align: center; padding: 22px 16px; }
.clock-state { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; padding: 6px 12px; border-radius: 999px; }
.clock-state.working { background: var(--ok-soft); color: var(--ok); }
.clock-state.on_break { background: var(--warn-soft); color: var(--warn); }
.clock-state.off { background: var(--soft); color: var(--muted); }
.clock-state .pulse { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.clock-time { font-size: 40px; font-weight: 800; letter-spacing: -.02em; margin: 10px 0 2px; font-variant-numeric: tabular-nums; }
.clock-actions { display: grid; gap: 10px; margin-top: 16px; }
@media (prefers-reduced-motion: no-preference) {
  .clock-state.working .pulse { animation: pulse 1.8s ease-in-out infinite; }
  @keyframes pulse { 50% { opacity: .35; } }
}
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.timeline li:first-child { border-top: 0; }
.timeline .t { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap);
       padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--panel);
       color: var(--ink); font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--soft); text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #146a4b; }
.btn-danger { background: var(--panel); border-color: #e6b8b4; color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--brand); }
.btn-xl { min-height: 64px; font-size: 18px; border-radius: var(--radius); width: 100%; }
.btn-sm { min-height: 34px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.inline-form { display: inline; margin: 0; }

/* ---------- chips & alerts ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px;
        font-weight: 700; white-space: nowrap; background: var(--soft); color: var(--ink-2); border: 1px solid var(--line); }
.chip-ok { background: var(--ok-soft); color: var(--ok); border-color: #bfe3d2; }
.chip-warn { background: var(--warn-soft); color: var(--warn); border-color: #f1d9ad; }
.chip-danger { background: var(--danger-soft); color: var(--danger); border-color: #f0c4c0; }
.chip-info { background: var(--info-soft); color: var(--info); border-color: #c5dcee; }
.alert { padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--panel); margin-bottom: 14px; }
.alert-ok { background: var(--ok-soft); border-color: #bfe3d2; color: #0f5c40; }
.alert-warn { background: var(--warn-soft); border-color: #f1d9ad; color: #6b4000; }
.alert-danger { background: var(--danger-soft); border-color: #f0c4c0; color: #8a1d17; }
.alert-info { background: var(--info-soft); border-color: #c5dcee; color: #0a4a77; }

/* ---------- forms ---------- */
.form { display: grid; gap: 14px; }
.form-grid { display: grid; gap: 14px; }
@media (min-width: 720px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } .form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }
.field { display: grid; gap: 6px; }
.field label, .field .label { font-weight: 650; font-size: 14px; }
.field .help { font-size: 13px; color: var(--muted); }
.field .error { font-size: 13px; color: var(--danger); font-weight: 600; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=time], input[type=tel], input[type=url], input[type=search], input[type=file], select, textarea {
  width: 100%; min-height: var(--tap); padding: 9px 12px; font: inherit; color: var(--ink); background: var(--panel);
  border: 1px solid #c9d4e0; border-radius: var(--radius-sm);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(8, 114, 185, .25); border-color: var(--brand); }
input[aria-invalid=true], select[aria-invalid=true], textarea[aria-invalid=true] { border-color: var(--danger); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line);
         border-radius: 999px; background: var(--panel); font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.code-input { font-size: 28px; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table th { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: #fafcfe; white-space: nowrap; }
.table th a { color: inherit; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafcfe; }
.table .filters th { background: var(--panel); padding: 6px 8px; text-transform: none; }
.table .filters input, .table .filters select { min-height: 34px; padding: 4px 8px; font-size: 13px; }
.table td.num, .table th.num { text-align: right; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 2px; font-size: 13px; color: var(--muted); }
.pagination .btn { min-height: 34px; }

/* ---------- week grid (project time) ---------- */
.week-grid { width: 100%; border-collapse: collapse; }
.week-grid th, .week-grid td { padding: 6px; border-bottom: 1px solid var(--line-soft); text-align: center; }
.week-grid th:first-child, .week-grid td:first-child { text-align: left; min-width: 160px; }
.week-grid input { min-height: 38px; padding: 4px 6px; text-align: center; width: 64px; }
.week-grid .off { background: #f7f9fb; color: var(--muted); }
.week-grid tfoot td { font-weight: 700; }

/* ---------- calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; text-transform: uppercase; }
.cal .day { min-height: 44px; border-radius: var(--radius-sm); background: var(--panel); border: 1px solid var(--line-soft);
            padding: 4px; font-size: 12px; }
.cal .day.out { opacity: .35; }
.cal .day.weekend, .cal .day.holiday { background: #f3f6f9; }
.cal .day.leave { background: var(--info-soft); border-color: #c5dcee; }
.cal .day.today { border-color: var(--brand); outline: 1px solid var(--brand); outline-offset: -2px; }

/* ---------- empty / auth / misc ---------- */
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty .icon { width: 36px; height: 36px; margin-bottom: 8px; color: #9fb0c4; }
.empty h3 { color: var(--ink); margin-bottom: 4px; }
/* Access screens: same layout as Quality CFO Copilot's login, shared by all group tools. */
.login-page { min-height: 100vh; margin: 0; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(circle at top left, rgba(0, 103, 177, .18), transparent 35%), #eef3f8; }
.login-card { width: min(430px, 100%); padding: 40px; border: 1px solid #d8e1ea; border-radius: 22px; background: #fff;
  box-shadow: 0 24px 70px rgba(26, 48, 73, .12); }
.login-mark { display: block; width: 44px; height: 44px; border-radius: 12px; }
.login-card h1 { margin: 18px 0 10px; font-size: 34px; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; }
.login-card h1.login-title-sm { font-size: 25px; }
.login-subtitle { margin: 0 0 24px; color: #69778a; }
.login-form { display: grid; gap: 10px; }
.login-form label { margin-top: 8px; font-size: 14px; font-weight: 700; }
.login-form input { width: 100%; padding: 14px 15px; border: 1px solid #d6dee7; border-radius: 12px; background: #fff; font: inherit; }
.login-form input:focus { outline: 3px solid rgba(0, 103, 177, .15); border-color: #0067b1; }
.login-code { font-size: 25px !important; font-weight: 700; letter-spacing: 8px; text-align: center; }
.login-button, .login-button-secondary { display: block; width: 100%; margin-top: 16px; padding: 13px; border-radius: 12px;
  font: inherit; font-size: 15px; font-weight: 700; text-align: center; cursor: pointer; }
.login-button { border: 0; background: #0067b1; color: #fff; }
.login-button:hover { background: #00579a; text-decoration: none; }
.login-button-secondary { margin-top: 10px; border: 1px solid #cbd5e1; background: #fff; color: var(--ink); }
.login-button-secondary:hover { background: var(--soft); }
.login-foot { margin: 18px 0 0; text-align: center; font-size: 14px; }
.login-link { border: 0; background: none; padding: 4px; font: inherit; color: #526176; cursor: pointer; }
.login-link:hover { color: var(--ink); text-decoration: underline; }
.login-error, .login-notice { margin-bottom: 16px; padding: 12px 14px; border-radius: 11px; font-size: 14px; }
.login-error { border: 1px solid #f1b9b9; background: #fff2f2; color: #a32929; }
.login-notice { border: 1px solid #bfe3d2; background: var(--ok-soft); color: #0f5c40; }
.error-card { max-width: 640px; }
.error-card h1 { margin-bottom: 8px; }
dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; max-width: 440px; width: calc(100% - 32px); color: var(--ink); }
dialog::backdrop { background: rgba(23, 37, 58, .45); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.progress { height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); }
.notice-list li.unread { font-weight: 650; }
.unread-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--brand); vertical-align: middle; }
@media print { .sidebar, .bottom-nav, .topbar, .page-actions { display: none !important; } .main { padding: 0; } }

/* Bulk selection (e.g. team members): wrapping grid of checkboxes, scrolls when long. */
.check-grid { display: flex; flex-wrap: wrap; gap: 8px; max-height: 320px; overflow-y: auto; padding: 2px; }

/* ---------- standard lists (same pattern as Quality CFO Copilot) ---------- */
.list-card { padding: 0; overflow: hidden; }
.list-toolbar, .list-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; }
.list-toolbar { border-bottom: 1px solid var(--line-soft); }
.list-pagination { border-top: 1px solid var(--line-soft); }
.list-toolbar-spacer { flex: 1; }
.list-count { font-size: 14px; color: var(--muted); }
.list-count strong { color: var(--ink); }
.list-toolbar select { font: inherit; font-size: 13px; min-height: 34px; padding: 4px 8px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--panel); }
.list-table { margin: 0; }
.list-table thead th { position: sticky; top: 0; }
.sort-link { display: inline-flex; align-items: center; gap: 4px; color: inherit; }
.sort-link:hover { color: var(--ink); text-decoration: none; }
.sort-link.is-active { color: var(--brand); }
.sort-arrow { font-size: 10px; opacity: .6; }
.list-filter-row td { padding: 6px 8px; background: #fafcfe; border-bottom: 1px solid var(--line); }
.list-filter-row input, .list-filter-row select { width: 100%; min-width: 7rem; font: inherit; font-size: 13px; min-height: 32px;
  padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); }
.list-filter-row input:focus, .list-filter-row select:focus { outline: 2px solid rgba(8, 114, 185, .25); border-color: var(--brand); }
.list-lead { width: 36px; text-align: center; }
.list-trail { width: 1%; white-space: nowrap; text-align: right; }
.row-title { font-weight: 650; color: var(--ink); }
.row-title:hover { color: var(--brand); }

/* ---------- detail pages and forms ---------- */
.detail-grid { display: grid; gap: 14px; margin-bottom: 14px; }
@media (min-width: 900px) { .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.form-card { max-width: 760px; }
.form-stack { display: grid; gap: 14px; }
.form-stack .field input:not([type=checkbox]):not([type=radio]), .form-stack .field select { width: 100%; }
.form-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.form-row .field { flex: 1 1 12rem; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.hint { margin: 0; font-size: 13px; color: var(--muted); }
.sep { border: 0; border-top: 1px solid var(--line-soft); margin: 16px 0; }
.detail-current { margin-bottom: 14px; }
.history { margin-top: 12px; }
.history summary { cursor: pointer; color: var(--muted); }
.checks-column { flex-direction: column; align-items: stretch; }
.checks-column .check { align-items: flex-start; padding: 10px 12px; min-height: 0; }
.checks-column .check input { margin-top: 2px; }
.check-wide { width: 100%; }
.radio { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; font-size: 14px; }
.section-title { margin: 18px 0 10px; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.sync-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }

/* Bulk assignment (organigrama) */
.bulk-panel { margin-bottom: 14px; }
.bulk-panel summary { cursor: pointer; }
.bulk-panel[open] summary { margin-bottom: 14px; }
.bulk-grid { display: grid; gap: 12px; align-items: end; }
@media (min-width: 900px) { .bulk-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.bulk-choice { border: 0; padding: 0; margin: 0; }
.bulk-grid select, .bulk-grid input[type=date] { width: 100%; }

/* Companies */
.company-grid { display: grid; gap: 14px; }
@media (min-width: 760px) { .company-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); } }
.company-card { display: flex; gap: 14px; align-items: flex-start; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.company-card:hover { text-decoration: none; border-color: #b9cfe3; box-shadow: 0 6px 20px rgba(23, 37, 58, .08); }
.company-card h2 { font-size: 16px; }
.company-card-logo { width: 72px; height: 56px; flex: none; display: grid; place-items: center; border: 1px solid var(--line-soft);
  border-radius: 10px; background: var(--soft); color: #9fb0c4; overflow: hidden; }
.company-card-logo img { max-width: 64px; max-height: 44px; object-fit: contain; }
.company-card-logo .icon { width: 28px; height: 28px; }
.logo-preview { display: grid; place-items: center; min-height: 96px; padding: 16px; margin-bottom: 12px; border: 1px dashed var(--line);
  border-radius: var(--radius-sm); background: repeating-conic-gradient(#f3f6f9 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.logo-preview img { max-width: 100%; max-height: 90px; object-fit: contain; }

/* Personal data and payroll preparation */
.section-card { margin-bottom: 14px; }
.option { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--panel); font-size: 14px; cursor: pointer; }
.option + .option { margin-top: 8px; }
.option input { margin-top: 3px; accent-color: var(--brand); }
.option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.family-list > li { display: block; }
.family-item summary { cursor: pointer; padding: 2px 0; }
.family-item[open] summary { margin-bottom: 12px; }
.add-panel { margin-top: 14px; }
.add-panel summary { list-style: none; display: inline-flex; }
.add-panel summary::-webkit-details-marker { display: none; }
.add-panel[open] summary { margin-bottom: 14px; }
.add-inline { margin-top: 6px; }
.add-inline summary { cursor: pointer; color: var(--brand); }
.add-inline[open] { min-width: 16rem; }
.item-line { display: flex; gap: 6px; align-items: baseline; }
.link-btn { border: 0; background: none; padding: 0 4px; font: inherit; color: var(--danger); cursor: pointer; }
.stats-row { margin-bottom: 14px; }
.birthday-note { margin-bottom: 14px; }

/* Team calendar filters */
.team-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.team-filters .field { min-width: 12rem; flex: 1 1 12rem; }
.team-filter-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }

/* Mis datos: IRPF communication */
.communicate-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 18px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--brand-soft); border: 1px solid #c5dcee; }
.communicate-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Controls inside table rows keep a readable width (the table scrolls if needed). */
.assign-form { flex-wrap: wrap; }
.assign-form select { min-width: 16rem; flex: 1 1 16rem; }
.option input[type=radio] { width: 18px; height: 18px; flex: none; }
.option span { text-align: left; }

/* Mail settings */
.mail-backend { margin-top: 6px; }
.mail-status { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.sticky-actions { margin: 4px 0 8px; }

/* Holiday presets */
.preset { padding: 12px 0; border-top: 1px solid var(--line-soft); }
.preset:first-of-type { border-top: 0; padding-top: 0; }
.preset h3 { margin-bottom: 4px; }
.preset details { margin: 6px 0 10px; }

/* Mail service: choice on the left, the chosen service's settings on the right */
.mail-service { margin-bottom: 14px; }
.service-layout { display: grid; gap: 18px; }
@media (min-width: 900px) { .service-layout { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; } }
.service-list { border: 0; padding: 0; margin: 0; }
.service-panel { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); }
.service-panel h3 { margin-bottom: 10px; }
.service-panel .hint { margin-bottom: 12px; }
.service-panel[hidden] { display: none; }

/* Documents */
.pending-card { margin-bottom: 14px; border-color: #f1d9ad; background: #fffaf0; }
.progress-cell { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
progress { width: 90px; height: 8px; border: 0; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--line-soft); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--ok); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--ok); border-radius: 999px; }
.required-card { max-width: 760px; margin: 24px auto; }
.required-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 12px; }
.required-head .icon { width: 32px; height: 32px; color: var(--warn); flex: none; }
.required-head h1 { font-size: 20px; margin-bottom: 4px; }
.doc-description { white-space: pre-line; }
.doc-open { margin-top: 14px; }
.people-picker { max-height: 280px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; }

/* People picker (scales to hundreds of people) */
.picker { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.picker-tools { display: grid; gap: 10px; padding: 12px; border-bottom: 1px solid var(--line-soft); }
@media (min-width: 760px) { .picker-tools { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.picker-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; background: var(--soft);
  border-bottom: 1px solid var(--line-soft); }
.picker-count { font-weight: 650; font-size: 14px; }
.picker-only { min-height: 34px; }
.picker-list { display: grid; max-height: 360px; overflow-y: auto; padding: 4px 0; }
@media (min-width: 900px) { .picker-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.picker-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 12px; cursor: pointer; border-radius: 6px; }
.picker-item:hover { background: var(--soft); }
.picker-item input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--brand); }
.picker-item:has(input:checked) { background: var(--brand-soft); }
.picker-item[hidden], .picker-empty[hidden] { display: none; }
.picker-empty { padding: 8px 12px; }

/* Support impersonation banner */
.acting-banner { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; justify-content: space-between; }
.picker-single .picker-list { max-height: 22rem; }

/* Leave page: the employee's month calendar */
.leave-cal .card-header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.lcal { display: grid; gap: 4px; }
.lcal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.lcal-head span { font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; padding: 2px 0; }
.lcal-day { position: relative; display: flex; flex-direction: column; gap: 2px; min-height: 64px; padding: 6px;
  border: 1px solid var(--line-soft); border-radius: var(--radius-sm); background: var(--panel); color: var(--ink);
  font-size: 13px; overflow: hidden; }
a.lcal-day:hover { border-color: var(--brand); text-decoration: none; }
.lcal-num { font-weight: 700; font-size: 13px; }
.lcal-label { font-size: 11px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lcal-day.is-out { opacity: .35; }
.lcal-day.is-rest, .lcal-swatch.is-rest { background: var(--soft); color: var(--muted); }
.lcal-day.is-none { background: var(--soft); color: var(--muted); }
.lcal-day.is-holiday, .lcal-swatch.is-holiday { background: #eef0f3; color: var(--ink-2); border-color: #cfd6df; }
.lcal-day.is-birthday, .lcal-swatch.is-birthday { background: #fdf0f7; color: #8a1f5c; border-color: #f2c4dd; }
.lcal-day.is-today { box-shadow: inset 0 0 0 2px var(--brand); }
/* Leave types: solid when approved; striped + dashed border while pending approval. */
.lt-0 { --lt: #1a7f5a; --lt-soft: #e3f4ec; }
.lt-1 { --lt: #0b5d95; --lt-soft: #e3eff9; }
.lt-2 { --lt: #8a5300; --lt-soft: #fdf0d9; }
.lt-3 { --lt: #6a3fb5; --lt-soft: #efe8fb; }
.lt-4 { --lt: #b3261e; --lt-soft: #fbe6e4; }
.lt-5 { --lt: #0f766e; --lt-soft: #dff4f2; }
.lt-6 { --lt: #9a3412; --lt-soft: #fdebe0; }
.lt-7 { --lt: #4d5b70; --lt-soft: #e9edf2; }
.lcal-day.is-leave { background: var(--lt-soft); border-color: var(--lt); color: var(--lt); }
.lcal-day.is-leave .lcal-num { color: var(--ink); }
.lcal-day.is-pending { border: 1px dashed var(--lt); color: var(--lt);
  background: repeating-linear-gradient(135deg, var(--lt-soft) 0 6px, var(--panel) 6px 12px); }
.lcal-day.is-half.is-leave { background: linear-gradient(135deg, var(--lt-soft) 50%, var(--panel) 50%); }
.lcal-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; list-style: none; margin: .75rem 0 0; padding: 0;
  font-size: 13px; color: var(--muted); }
.lcal-legend li { display: flex; align-items: center; gap: .4rem; }
.lcal-swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line); display: inline-block; }
.lcal-swatch[class*="lt-"] { background: var(--lt-soft); border-color: var(--lt); }
.lcal-swatch.is-pending-swatch { border: 1px dashed var(--muted);
  background: repeating-linear-gradient(135deg, var(--line) 0 3px, var(--panel) 3px 6px); }
@media (max-width: 640px) {
  .lcal-day { min-height: 44px; padding: 4px; }
  .lcal-label { display: none; }
}

/* Modal dialogs (data-dialog-open) */
dialog.modal { border: 0; border-radius: var(--radius); padding: 0; width: min(540px, calc(100% - 32px));
  max-height: calc(100vh - 48px); overflow: auto; color: var(--ink); background: var(--panel);
  box-shadow: 0 20px 60px rgba(23, 37, 58, .28); }
dialog.modal::backdrop { background: rgba(23, 37, 58, .45); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft); }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-body { padding: 16px 20px; display: grid; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; padding: 12px 20px; border-top: 1px solid var(--line-soft);
  background: var(--soft); }
.row-actions { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
.item-lines { display: grid; gap: 4px; }
dialog.modal > form { padding: 16px 20px 0; }
dialog.modal > form .modal-actions { margin: 8px -20px 0; }

/* Avatars (employee photo or initials) */
.avatar { border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.avatar-link { padding: 0; }
.greeting { display: flex; align-items: center; gap: 14px; }
.greeting h1 { margin: 0; }
.photo-edit { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }

/* CFO sync schedule */
.sync-when { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sync-when select, .sync-when input { width: auto; min-width: 0; }

/* Assistant chat */
.chat { display: grid; gap: 12px; }
.chat-log { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; padding: 4px; }
.chat-msg { max-width: 80%; padding: 10px 14px; border-radius: 14px; line-height: 1.45; }
.chat-msg p { margin: 0 0 6px; }
.chat-msg p:last-child { margin-bottom: 0; }
.chat-bot { align-self: flex-start; background: var(--soft); border: 1px solid var(--line-soft); border-bottom-left-radius: 4px; }
.chat-user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.chat-waiting { color: var(--muted); font-style: italic; }
.chat-sources { font-size: 12px; color: var(--muted); }
.chat-suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea { flex: 1; resize: vertical; min-height: 44px; }
.chat-foot { margin: 0; }
@media (max-width: 640px) { .chat-msg { max-width: 95%; } }
.icon-btn-assistant { color: var(--brand); }
.icon-btn-assistant:hover { background: var(--brand-soft); }
.notice-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; font-weight: 400; }
.notice-actions form { margin: 0; }
@media (max-width: 640px) { .notice-list li { flex-wrap: wrap; } .notice-actions .btn { font-size: 12px; } }
/* Team activity: clocked time over logged project hours per day */
.activity-table th.num, .activity-table td.act { padding: 4px 3px; min-width: 38px; }
.activity-table th.is-today { color: var(--brand); }
.act { text-align: center; font-size: 11px; line-height: 1.25; font-variant-numeric: tabular-nums; }
.act .act-c, .act .act-p { display: block; }
.act-c { color: var(--muted); }
.act-p { font-weight: 650; color: var(--ink); }
.act-rest, .act-off, .act-none { background: #f7f9fb; color: var(--muted); }
.act-missing { background: var(--danger-soft); }
.act-missing .act-p { color: var(--danger); }
.act-short { background: var(--warn-soft); }
.activity-alert { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.activity-alert form { margin: 0; }
.activity-legend .act-c, .activity-legend .act-p { display: inline; }
.act-key { display: inline-block; padding: 0 6px; border-radius: 4px; }
.chip-neutral { color: var(--muted); }
/* HR request conversation */
.thread { display: grid; gap: 10px; margin-bottom: 16px; }
.thread-msg { padding: 10px 14px; border: 1px solid var(--line-soft, var(--line)); border-radius: 12px; background: var(--panel); }
.thread-msg p { margin: 0 0 6px; }
.thread-msg p:last-child { margin-bottom: 0; }
.thread-msg.from-hr { background: var(--brand-soft); }
.thread-msg.is-internal { background: var(--warn-soft); border-style: dashed; }
/* Survey rating scales */
.scale { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.scale-opt { position: relative; }
.scale-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.scale-opt span { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 8px; border: 1px solid var(--line);
                  border-radius: 10px; background: var(--panel); cursor: pointer; font-weight: 600; }
.scale-opt input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.scale-opt input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }
fieldset.field { border: 0; padding: 0; margin: 0; }
fieldset.field legend { font-weight: 600; margin-bottom: 4px; }
.celebrations .icon { color: var(--brand); vertical-align: -3px; }
.prose p { line-height: 1.6; }
/* Microsoft 365 sign-in */
.login-sso { display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #1f1f1f;
             border: 1px solid #8c8c8c; text-align: center; }
.login-sso:hover { background: #f3f3f3; color: #1f1f1f; }
.ms-logo { width: 18px; height: 18px; }
.login-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 4px; color: var(--muted); font-size: 13px; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.value-lg { font-size: 28px; }
/* Approve / reject from a detail page */
.approval-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; }
.approval-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; flex: 1; justify-content: flex-end; }
.approval-form input[name=comment] { flex: 1 1 16rem; max-width: 28rem; }
/* Company switcher: unread notices in the other companies */
.company-switch { position: relative; }
.company-unread { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px;
                  border-radius: 9px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; }
/* Drag & drop around file fields */
.dropzone { display: grid; gap: 6px; padding: 14px; border: 2px dashed var(--line); border-radius: 12px;
            background: var(--panel); transition: border-color .15s, background .15s; }
.dropzone.is-over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone input[type=file] { max-width: 100%; }
.dropzone-hint { margin: 0; font-size: 13px; color: var(--muted); }
.dropzone-error { margin: 0; font-size: 13px; color: var(--danger); }

/* Inactivity countdown (base.html, people.js) */
.idle-dialog .idle-count { font-variant-numeric: tabular-nums; font-size: 1.15em; color: var(--brand, #0872b9); }
