/* ZENTAVA — spatial UI. Brand colours are variables; dark.css overrides them. */
:root {
  --brand: #14213d;          /* ZENTAVA deep navy */
  --brand-strong: #0b1427;
  --brand-soft: rgba(15, 157, 138, .13);   /* teal tint */
  --teal: #0f9d8a;           /* ZENTAVA teal: marks and fills */
  --gold: #f2b134;           /* ZENTAVA gold: marks and fills */
  --link: #0b7a6c;           /* teal, darkened for readable links */
  --accent: #a87308;         /* gold, darkened so icons stay readable on white */
  --accent-soft: rgba(242, 177, 52, .18);
  --danger: #c0392b;
  --success: #1f8a4c;
  --warning: #b7791f;

  --page-bg: #f4f6f8;
  --page-glow-1: rgba(15, 157, 138, .14);
  --page-glow-2: rgba(242, 177, 52, .12);
  /* Aurora: soft moving light behind the glass panels (ZENTAVA teal, sky blue, gold, navy) */
  --aurora-1: rgba(15, 157, 138, .38);
  --aurora-2: rgba(84, 132, 230, .30);
  --aurora-3: rgba(242, 177, 52, .34);
  --aurora-4: rgba(20, 33, 61, .14);
  --aurora-5: rgba(46, 196, 174, .26);
  /* Neumorphism (sign-in pages): the card is moulded from the background */
  --neu-bg: #eef1f5;
  --neu-dark: rgba(20, 33, 61, .16);
  --neu-light: rgba(255, 255, 255, .95);
  --surface: rgba(255, 255, 255, .68);
  --glass-edge: rgba(255, 255, 255, .75);
  --surface-solid: #ffffff;
  --surface-2: rgba(255, 255, 255, .55);
  --border: rgba(20, 33, 61, .10);
  --text: #1f2430;
  --text-muted: #586274;
  --shadow: 0 10px 30px rgba(20, 33, 61, .08), 0 2px 6px rgba(20, 33, 61, .05);
  --shadow-lg: 0 24px 60px rgba(20, 33, 61, .14);
  --radius: 20px;
  --radius-sm: 14px;
  --sidebar-w: 260px;
  --sidebar-w-compact: 76px;
  --topbar-h: 64px;

  --bs-primary: var(--brand);
  --bs-primary-rgb: 20, 33, 61;
  --bs-link-color: var(--link);
  --bs-link-color-rgb: 11, 122, 108;
  --bs-link-hover-color: var(--brand-strong);
  --bs-body-font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-border-radius: 12px;
}

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: var(--page-bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  isolation: isolate;
}

/* ---------- Aurora background ----------
   Two fixed layers of large, soft colour fields. They stay still: moving light under frosted glass made
   some screens flicker. Glass panels blur what is behind them, which turns the aurora into a gentle glow. */
body::before, body::after {
  content: "";
  position: fixed;
  inset: -25vmax;
  z-index: -1;
  pointer-events: none;
}
body::before {
  background:
    radial-gradient(38vmax 26vmax at 18% 22%, var(--aurora-1), transparent 62%),
    radial-gradient(34vmax 24vmax at 78% 16%, var(--aurora-2), transparent 62%),
    radial-gradient(42vmax 28vmax at 62% 88%, var(--aurora-3), transparent 64%);
  transform: rotate(-4deg) scale(1.03);
}
body::after {
  background:
    radial-gradient(46vmax 18vmax at 30% 70%, var(--aurora-5), transparent 64%),
    radial-gradient(30vmax 22vmax at 88% 60%, var(--aurora-4), transparent 62%),
    conic-gradient(from 210deg at 50% 40%, transparent 0deg, var(--aurora-5) 40deg, transparent 90deg,
                   var(--aurora-2) 160deg, transparent 220deg);
  opacity: .55;
  transform: rotate(6deg);
}
a { color: var(--link); }
a:hover { color: var(--brand); }
.text-muted, .form-text { color: var(--text-muted) !important; }
.visually-hidden-focusable:focus { position: fixed; z-index: 2000; top: 8px; left: 8px; padding: 8px 14px; background: var(--surface-solid); border-radius: 10px; }

/* ---------- Glass panels ---------- */
.glass, .panel {
  background: var(--surface);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-edge);
}
.panel { padding: 22px; margin-bottom: 20px; }
.panel-header { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-header h2, .panel-header h3 { margin: 0; font-size: 1.05rem; font-weight: 650; }
.panel-flush { padding: 0; overflow: hidden; }
.panel-flush .panel-header { padding: 18px 22px 0; }

/* ---------- Buttons ---------- */
.btn { border-radius: 12px; font-weight: 550; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-strong); --bs-btn-hover-border-color: var(--brand-strong); --bs-btn-active-bg: var(--brand-strong); --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); box-shadow: 0 6px 16px rgba(20, 33, 61, .25); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand); }
.btn-soft { background: var(--brand-soft); color: var(--brand); border: 0; }
.btn-soft:hover { background: var(--brand); color: #fff; }
.btn-icon { width: 40px; height: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.btn-icon:hover { background: var(--brand-soft); color: var(--brand); }
.btn.is-loading { opacity: .7; cursor: progress; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 12px auto 12px 12px; width: var(--sidebar-w);
  display: flex; flex-direction: column; z-index: 1040; padding: 16px 12px;
  transition: width .2s ease, transform .25s ease;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; min-height: 52px; }
.brand-mark { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; letter-spacing: .5px; background: linear-gradient(135deg, var(--brand), #24365f); box-shadow: 0 6px 16px rgba(20, 33, 61, .3); }
.brand-mark.logo { background: #f4f6f8; padding: 3px; box-shadow: 0 6px 16px rgba(20, 33, 61, .18), inset 0 0 0 1px rgba(20, 33, 61, .08); }
.brand-mark.logo img { border-radius: 9px; }
.brand-tagline { color: var(--accent); font-weight: 600; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.brand-text { line-height: 1.15; min-width: 0; }
.brand-text strong { display: block; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-text small { color: var(--text-muted); font-size: .75rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-close { display: none; margin-left: auto; }
.nav-filter { margin: 0 4px 10px; }
.nav-filter input { font-size: .9rem; border-radius: 12px; background: var(--surface-2); }
.sidebar-nav { overflow-y: auto; flex: 1; padding: 0 2px; }
.nav-group { margin-bottom: 10px; }
.nav-group-title { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); padding: 8px 12px 4px; font-weight: 650; }
.nav-group ul { list-style: none; margin: 0; padding: 0; }
.nav-link-item a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text); text-decoration: none; font-weight: 520; white-space: nowrap; }
.nav-link-item a i { font-size: 1.1rem; width: 22px; text-align: center; color: var(--text-muted); }
.nav-link-item a:hover { background: var(--brand-soft); }
.nav-link-item a[aria-current="page"] { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(20, 33, 61, .3); }
.nav-link-item a[aria-current="page"] i { color: #fff; }
.sidebar-footer { padding: 10px 8px 0; border-top: 1px solid var(--border); margin-top: 8px; display: flex; gap: 8px; align-items: center; }
.sidebar-footer small { color: var(--text-muted); }

.main { flex: 1; min-width: 0; margin-left: calc(var(--sidebar-w) + 24px); padding: 12px 20px 40px 0; transition: margin-left .2s ease; }
html.sidebar-compact .sidebar { width: var(--sidebar-w-compact); }
html.sidebar-compact .main { margin-left: calc(var(--sidebar-w-compact) + 24px); }
html.sidebar-compact .brand-text, html.sidebar-compact .nav-group-title, html.sidebar-compact .nav-filter,
html.sidebar-compact .nav-link-item a span, html.sidebar-compact .sidebar-footer small { display: none; }
html.sidebar-compact .nav-link-item a { justify-content: center; }

.topbar { position: sticky; top: 12px; z-index: 1030; display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: var(--topbar-h); margin-bottom: 20px; }
.topbar-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.topbar-title h1 { font-size: 1.2rem; margin: 0; font-weight: 680; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-tools { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.menu-btn, .app-back { display: none; }
html.is-standalone .app-back { display: inline-flex; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .8rem; font-weight: 700; color: var(--brand); background: var(--brand-soft); }
.user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.user-chip .name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.dropdown-menu { border-radius: 14px; border: 1px solid var(--border); box-shadow: var(--shadow-lg); padding: 6px; }
.dropdown-item { border-radius: 10px; padding: 8px 12px; }
.dropdown-item.active, .dropdown-item:active { background: var(--brand); }

.scrim { display: none; }
.tabbar { display: none; }

.support-banner { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 16px; margin-bottom: 18px; border-radius: var(--radius-sm); background: var(--accent-soft); border: 1px solid rgba(217, 145, 26, .4); }

/* ---------- Page bits ---------- */
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.page-head p { margin: 4px 0 0; color: var(--text-muted); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { padding: 18px 20px; display: flex; gap: 14px; align-items: center; }
.stat-icon { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.3rem; background: var(--brand-soft); color: var(--brand); }
.stat-icon.amber { background: var(--accent-soft); color: var(--accent); }
.stat-icon.red { background: rgba(192, 57, 43, .12); color: var(--danger); }
.stat-value { font-size: 1.6rem; font-weight: 750; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--text-muted); font-size: .85rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; }
.grid-2 > .panel { margin-bottom: 0; }

.empty { text-align: center; padding: 34px 16px; color: var(--text-muted); }
.empty i { font-size: 2rem; display: block; margin-bottom: 8px; color: var(--brand); opacity: .7; }

/* Tables scroll inside their own box */
.table-scroll { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-sm); }
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: 12px 14px; border-bottom-color: var(--border); vertical-align: middle; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 650; white-space: nowrap; }
.table tbody tr:hover { background: var(--brand-soft); }
.nowrap, td.date, td.code, td.num { white-space: nowrap; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-sub { display: block; color: var(--text-muted); font-size: .82rem; }

.badge-status { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: .75rem; font-weight: 650; white-space: nowrap; }
.badge-status::first-letter { text-transform: uppercase; }   /* "Past due", "En retard de paiement" */
.st-active, .st-approved { background: rgba(31, 138, 76, .14); color: var(--success); }
.st-pending, .st-invited, .st-trial { background: var(--accent-soft); color: var(--warning); }
.st-suspended, .st-deactivated, .st-rejected, .st-denied, .st-revoked, .st-expired, .st-cancelled, .st-past_due { background: rgba(192, 57, 43, .12); color: var(--danger); }
.st-ended { background: rgba(90, 104, 102, .14); color: var(--text-muted); }

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.filters .form-control, .filters .form-select { max-width: 260px; flex: 1 1 180px; }

/* Forms */
.form-control, .form-select { border-radius: 12px; border-color: var(--border); background-color: var(--surface-solid); padding: .6rem .85rem; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem var(--brand-soft); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-label { font-weight: 560; font-size: .92rem; }
.form-section { margin-bottom: 22px; }
.form-section h3 { font-size: .95rem; font-weight: 650; margin-bottom: 12px; color: var(--brand); }
.invalid-feedback { display: block; }
.req::after { content: " *"; color: var(--danger); }

.perm-module { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 12px; background: var(--surface-2); }
.perm-module h3 { font-size: .95rem; margin-bottom: 10px; }
.perm-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 6px 0; border-top: 1px dashed var(--border); }
.perm-row:first-of-type { border-top: 0; }
.perm-row .form-select { max-width: 200px; font-size: 16px; padding: .35rem .7rem; }

.alert { border-radius: var(--radius-sm); border: 1px solid var(--border); }
.one-time-link { word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }
.kv { display: grid; grid-template-columns: minmax(120px, 34%) minmax(0, 1fr); gap: 8px 16px; margin: 0; }
.kv dt { color: var(--text-muted); font-weight: 520; }
.kv dd { margin: 0; overflow-wrap: anywhere; min-width: 0; }
.kv dd code { word-break: break-all; }
.pagination { --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand); --bs-pagination-color: var(--brand); --bs-pagination-border-radius: 10px; flex-wrap: wrap; gap: 4px; }

/* ---------- Auth pages: neumorphism + spatial ---------- */
.auth-body { display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-tools { position: fixed; top: max(14px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); z-index: 10; }
.auth-body { min-height: 100vh; min-height: 100svh; }   /* svh: stays still while the phone address bar slides */
/* Neumorphic base: a soft card moulded from the background (raised by a dark and a light shadow) */
.auth-card {
  position: relative;
  width: 100%; max-width: 440px; padding: 64px 30px 30px; margin-top: 44px; border-radius: 28px;
  background: var(--neu-bg);
  border: 1px solid rgba(255, 255, 255, .55);
  box-shadow: 18px 18px 42px var(--neu-dark), -14px -14px 36px var(--neu-light);
}
/* Spatial layer on top: the brand floats above the card as a glass pane with deeper shadow */
.auth-card > .auth-brand {
  position: absolute; left: 22px; right: 22px; top: -40px; margin: 0;
  padding: 14px 16px; border-radius: 22px;
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(170%); -webkit-backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid var(--border);
  box-shadow: 0 22px 44px rgba(20, 33, 61, .18), 0 4px 10px rgba(20, 33, 61, .08), inset 0 1px 0 var(--glass-edge);
}
.auth-card .btn-primary { box-shadow: 6px 6px 16px var(--neu-dark), -4px -4px 12px var(--neu-light); }
.auth-card .btn-primary:active { box-shadow: inset 3px 3px 8px rgba(0, 0, 0, .25); }
.auth-card.wide { max-width: 860px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.auth-wordmark { font-size: 1.25rem; line-height: 1.2; }
.auth-title { font-size: 1.35rem; margin: 0 0 14px; font-weight: 750; }
.auth-brand h1 { font-size: 1.35rem; margin: 0; font-weight: 750; }
.auth-brand p { margin: 0; color: var(--text-muted); font-size: .85rem; }
/* Neumorphic fields: pressed into the card */
.neu-input .form-control, .auth-card .form-control, .auth-card .form-select { background: var(--neu-bg); border: 0; border-radius: 14px; box-shadow: inset 5px 5px 11px var(--neu-dark), inset -5px -5px 11px var(--neu-light); }
.neu-input .form-control:focus, .auth-card .form-control:focus, .auth-card .form-select:focus { background: var(--neu-bg); box-shadow: inset 5px 5px 11px var(--neu-dark), inset -5px -5px 11px var(--neu-light), 0 0 0 .2rem var(--brand-soft); }
.auth-foot { text-align: center; margin-top: 18px; font-size: .9rem; color: var(--text-muted); }

/* ---------- Public landing ---------- */
.hero { max-width: 1080px; margin: 0 auto; padding: 40px 20px 60px; }
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 40px; flex-wrap: wrap; }
.hero h1 { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 800; letter-spacing: -.02em; }
.hero .lead { color: var(--text-muted); max-width: 640px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-top: 36px; }
.feature { padding: 20px; }
.feature i { font-size: 1.5rem; color: var(--brand); }
.feature h3 { font-size: 1rem; margin: 10px 0 6px; font-weight: 650; }
.feature p { margin: 0; color: var(--text-muted); font-size: .92rem; }

/* ---------- Print: always white ---------- */
@media print {
  html, body { background: #fff !important; color: #000 !important; }
  body::before, body::after { display: none !important; }
  .sidebar, .topbar-tools, .tabbar, .scrim, .menu-btn, .toolbar, .btn, .filters, form { display: none !important; }
  .main { margin: 0 !important; padding: 0 !important; }
  .glass, .panel { background: #fff !important; box-shadow: none !important; border: 1px solid #ccc !important; backdrop-filter: none !important; }
  * { color: #000 !important; }
}
code { color: var(--brand-strong); }

/* ---------- Phase 2 ---------- */
.icon-badge { position: relative; text-decoration: none; }
.badge-dot { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.checklist { max-height: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; padding: 6px 10px; background: var(--surface-solid); }
.checklist-item { display: flex; gap: 8px; align-items: center; padding: 6px 0 6px 1.6em; margin: 0; border-bottom: 1px dashed var(--border); }
.checklist-item:last-child { border-bottom: 0; }
.list-plain { list-style: none; padding-left: 0; }
.border-bottom-soft { border-bottom: 1px solid var(--border); }
.border-bottom-soft:last-child { border-bottom: 0; }
.pr-low { background: rgba(90, 104, 102, .14); color: var(--text-muted); }
.pr-normal { background: var(--brand-soft); color: var(--brand); }
.pr-high { background: var(--accent-soft); color: var(--warning); }
.pr-urgent { background: rgba(192, 57, 43, .14); color: var(--danger); }
.st-todo, .st-registered, .st-scheduled, .st-pending_approval, .st-awaiting_approval { background: var(--accent-soft); color: var(--warning); }
.st-in_progress, .st-assigned, .st-held, .st-responded, .st-present, .st-remote, .st-field_work { background: var(--brand-soft); color: var(--brand); }
.st-done, .st-closed, .st-archived { background: rgba(31, 138, 76, .14); color: var(--success); }
.st-blocked, .st-absent, .st-late, .st-exited { background: rgba(192, 57, 43, .12); color: var(--danger); }
.st-on_leave, .st-probation, .st-draft { background: rgba(90, 104, 102, .14); color: var(--text-muted); }
.overdue { color: var(--danger); font-weight: 650; }
.tabs-scroll { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 4px; margin-bottom: 14px; -webkit-overflow-scrolling: touch; }
.tabs-scroll a { white-space: nowrap; padding: 7px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: .9rem; font-weight: 550; }
.tabs-scroll a[aria-current="page"] { background: var(--brand); color: #fff; border-color: var(--brand); }
html[data-theme="dark"] .tabs-scroll a[aria-current="page"] { color: #04201d; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; border-left: 2px solid var(--border); margin-left: 6px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); }
.timeline li:last-child { border-left-color: transparent; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg { max-width: 78%; padding: 10px 14px; border-radius: 16px; margin-bottom: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.msg.mine { margin-left: auto; background: var(--brand-soft); }
.msg .meta { font-size: .75rem; color: var(--text-muted); margin-bottom: 2px; }
.cal { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 4px; }
.cal th { font-size: .72rem; text-transform: uppercase; color: var(--text-muted); text-align: center; font-weight: 650; }
.cal td { vertical-align: top; height: 104px; padding: 6px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.cal td.other { opacity: .45; }
.cal td.today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.cal .daynum { font-size: .8rem; font-weight: 700; }
.cal .ev { display: block; font-size: .72rem; line-height: 1.25; padding: 2px 6px; border-radius: 6px; margin-top: 3px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-meeting { background: var(--brand-soft); color: var(--brand); }
.ev-task { background: var(--accent-soft); color: var(--warning); }
.ev-leave { background: rgba(90, 104, 102, .15); color: var(--text-muted); }
.ev-correspondence, .ev-document { background: rgba(192, 57, 43, .12); color: var(--danger); }
.agenda-day { font-weight: 700; margin: 14px 0 6px; }
.qr-box { background: #fff; padding: 12px; border-radius: 16px; display: inline-block; }
.qr-box img { width: 200px; height: 200px; display: block; }
.recovery-codes { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; columns: 2; font-size: 1rem; }
.report-page { max-width: 820px; margin: 0 auto; background: #fff; color: #111; padding: 32px; border-radius: 12px; }
.report-page h1 { font-size: 1.5rem; }
.report-page table { width: 100%; border-collapse: collapse; }
.report-page th, .report-page td { border: 1px solid #ccc; padding: 6px 8px; text-align: left; vertical-align: top; }
@media print {
  .report-page { background: #fff !important; color: #000 !important; padding: 0 !important; }
  .report-page th, .report-page td { border-color: #999 !important; }
}
.ev-activity { background: rgba(31, 138, 76, .14); color: var(--success); }
.ev-milestone { background: var(--accent-soft); color: var(--warning); }
.meter-wrap { display: inline-flex; align-items: center; gap: 8px; min-width: 140px; width: 100%; }
.meter { flex: 1 1 auto; height: 10px; min-width: 80px; }
.meter-track { fill: var(--border); }
.meter-fill { fill: var(--brand); }
.meter-fill.over { fill: var(--danger); }
.meter-val { font-variant-numeric: tabular-nums; font-size: .82rem; min-width: 3.2em; text-align: right; color: var(--text); }
.prog-head .badge-status { vertical-align: middle; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.kpi .v { font-size: 1.25rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: .8rem; color: var(--text-muted); }
.tree-row { padding: 10px 0; border-bottom: 1px solid var(--border); }
.tree-row:last-child { border-bottom: 0; }
.tree-d1 { padding-left: 18px; border-left: 3px solid var(--brand-soft); margin-left: 6px; }
.tree-d2 { padding-left: 36px; border-left: 3px solid var(--brand-soft); margin-left: 6px; }
.tree-d3 { padding-left: 54px; border-left: 3px solid var(--brand-soft); margin-left: 6px; }
.lvl { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--brand); }
.gantt-box { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.gantt { display: block; min-width: 760px; width: 100%; height: auto; font-family: inherit; }
.gantt .grid { stroke: var(--border); stroke-width: 1; }
.gantt .mlabel { fill: var(--text-muted); font-size: 11px; }
.gantt .alabel { fill: var(--text); font-size: 12px; }
.gantt .bar { fill: var(--brand-soft); }
.gantt .bar-done { fill: var(--brand); }
.gantt .bar.late { fill: rgba(192, 57, 43, .22); }
.gantt .bar-done.late { fill: var(--danger); }
.gantt .today { stroke: var(--accent); stroke-width: 2; }
.gantt .ms { fill: var(--accent); }
.gantt .ms.done { fill: var(--success); }
.gantt a:hover .bar, .gantt a:focus .bar { fill: rgba(20, 33, 61, .28); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .8rem; color: var(--text-muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }
.lg-plan { background: var(--brand-soft); } .lg-done { background: var(--brand); } .lg-late { background: var(--danger); } .lg-ms { background: var(--accent); transform: rotate(45deg); border-radius: 1px !important; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.gantt .grid.major { stroke: var(--text-muted); stroke-opacity: .35; }

/* Phase 4: projects — work breakdown, deliverables, risks, closure */
.st-submitted, .st-monitoring { background: var(--accent-soft); color: var(--warning); }
.st-verified, .st-resolved { background: rgba(31, 138, 76, .14); color: var(--success); }
.st-returned, .st-open { background: rgba(192, 57, 43, .12); color: var(--danger); }
.lv-low { background: rgba(90, 104, 102, .14); color: var(--text-muted); }
.lv-medium { background: var(--accent-soft); color: var(--warning); }
.lv-high { background: rgba(214, 102, 31, .16); color: #b4531a; }
.lv-critical { background: rgba(192, 57, 43, .16); color: var(--danger); }
.wbs { margin: 0; }
.wbs .list-plain { margin: 6px 0 0; padding-left: 18px; border-left: 3px solid var(--brand-soft); margin-left: 6px; }
.wbs-act { padding: 10px 0; border-bottom: 1px solid var(--border); }
.wbs-act:last-child { border-bottom: 0; }
.wbs-task, .wbs-deliv { padding: 5px 0; }
.wbs-sub { font-size: .95em; }
.wbs .bi-box-seam { color: var(--accent); }
.risk-matrix { border-collapse: separate; border-spacing: 3px; margin: 0 auto; }
.risk-matrix th { font-size: .8rem; color: var(--text-muted); text-align: center; padding: 2px 6px; font-weight: 600; }
.risk-matrix td { width: 52px; height: 40px; text-align: center; border-radius: 8px; font-weight: 750; font-variant-numeric: tabular-nums; }
.rm-low { background: rgba(31, 138, 76, .16); color: var(--success); }
.rm-medium { background: rgba(217, 145, 26, .22); color: var(--warning); }
.rm-high { background: rgba(214, 102, 31, .28); color: #9c4514; }
.rm-critical { background: rgba(192, 57, 43, .30); color: #8e2a1f; }
.rm-key { display: inline-block; padding: 1px 8px; border-radius: 6px; font-weight: 600; white-space: nowrap; }
.st-planned, .st-on_hold { background: rgba(90, 104, 102, .14); color: var(--text-muted); }
.st-completed { background: rgba(31, 138, 76, .14); color: var(--success); }
.st-postponed { background: var(--accent-soft); color: var(--warning); }

/* Phase 5: MEAL & beneficiaries */
.consent-given { background: rgba(31, 138, 76, .14); color: var(--success); }
.consent-withdrawn { background: rgba(192, 57, 43, .12); color: var(--danger); }
.consent-none { background: var(--accent-soft); color: var(--warning); }
.st-merged, .st-inactive, .st-exited { background: rgba(90, 104, 102, .14); color: var(--text-muted); }
.st-new, .st-acknowledged { background: var(--accent-soft); color: var(--warning); }
.st-responded, .st-published { background: var(--brand-soft); color: var(--brand); }
.privacy-note { font-size: .82rem; color: var(--text-muted); display: flex; gap: 6px; align-items: flex-start; }
.match-list { border: 1px solid rgba(217, 145, 26, .45); background: var(--accent-soft); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 16px; }
.answer-q { padding: 14px 0; border-bottom: 1px solid var(--border); }
.answer-q:last-child { border-bottom: 0; }
.attendee { display: flex; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--border); }
.attendee:last-child { border-bottom: 0; }
.dist-row { display: grid; grid-template-columns: minmax(80px, 130px) minmax(0, 1fr); gap: 10px; align-items: center; padding: 3px 0; font-size: .9rem; }
.dist-row .meter-wrap { width: 100%; }

/* Phase 6: procurement and assets */
.st-ordered, .st-partially_received, .st-in_use { background: var(--brand-soft); color: var(--brand); }
.st-received, .st-in_store { background: rgba(31, 138, 76, .14); color: var(--success); }
.st-under_repair, .st-suspended { background: var(--accent-soft); color: var(--warning); }
.st-lost, .st-blacklisted { background: rgba(192, 57, 43, .12); color: var(--danger); }
.st-disposed { background: rgba(90, 104, 102, .14); color: var(--text-muted); }

/* Phase 7: reports and charts. One validated series colour per mode (dataviz validator: all checks pass). */
:root { --chart-1: #0b8f80; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.report-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); text-decoration: none; }
.report-card span { font-size: .86rem; color: var(--text-muted); }
.report-card:hover, .report-card:focus { border-color: var(--brand); }
.report-filters .form-control, .report-filters .form-select { max-width: 220px; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 0 18px; }
.chart { margin: 0; }
.chart-title { font-weight: 650; margin-bottom: 10px; }
.hbars { list-style: none; margin: 0; padding: 0; }
.hbar-row { display: grid; grid-template-columns: minmax(90px, 34%) minmax(0, 1fr); gap: 10px; align-items: center; padding: 4px 0; font-size: .88rem; }
.hbar-label { overflow-wrap: anywhere; color: var(--text); }
.hbar-track { display: flex; align-items: center; gap: 6px; min-width: 0; }
.hbar { display: block; height: 14px; max-width: calc(100% - 5.5em); background: var(--chart-1); border-radius: 0 4px 4px 0; flex: none; }
.hbar:hover, .hbar:focus, .vcol:hover, .vcol:focus { filter: brightness(1.15); outline: none; }
.hbar:focus-visible, .vcol:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.hbar-value { font-variant-numeric: tabular-nums; color: var(--text-muted); font-size: .82rem; white-space: nowrap; }
.vcols-wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px; }
.vcols-axis { display: flex; flex-direction: column; justify-content: space-between; font-size: .72rem; color: var(--text-muted); height: 140px; padding-top: 16px; box-sizing: content-box; line-height: 1; text-align: right; font-variant-numeric: tabular-nums; }
.vcols { position: relative; list-style: none; margin: 0; padding: 0; display: flex; align-items: stretch; gap: 2px; overflow-x: auto; }
.vcol-slot { flex: 1 1 0; min-width: 18px; display: flex; flex-direction: column; align-items: center; }
.vcol-area { height: 140px; padding-top: 16px; box-sizing: content-box; width: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; border-bottom: 1px solid var(--border); position: relative; }
.vcol { display: block; width: min(24px, 80%); background: var(--chart-1); border-radius: 4px 4px 0 0; }
.vcol-value { font-size: .7rem; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; margin-bottom: 2px; }
.vcol-label { font-size: .7rem; color: var(--text-muted); margin-top: 4px; white-space: nowrap; }
.row-total td { font-weight: 700; }
.chart-tip { position: fixed; z-index: 3000; pointer-events: none; padding: 6px 10px; border-radius: 8px; background: var(--surface-solid); color: var(--text); border: 1px solid var(--border); box-shadow: 0 6px 18px rgba(0,0,0,.18); font-size: .82rem; max-width: 260px; }
.vcol-label-skip { visibility: hidden; }   /* every other label when there are many columns */
@media (max-width: 760px) { .report-filters .form-control, .report-filters .form-select { max-width: none; } }
.bw-0 { width: calc((100% - 5.5em) * 0.00); }
.bw-1 { width: calc((100% - 5.5em) * 0.01); }
.bw-2 { width: calc((100% - 5.5em) * 0.02); }
.bw-3 { width: calc((100% - 5.5em) * 0.03); }
.bw-4 { width: calc((100% - 5.5em) * 0.04); }
.bw-5 { width: calc((100% - 5.5em) * 0.05); }
.bw-6 { width: calc((100% - 5.5em) * 0.06); }
.bw-7 { width: calc((100% - 5.5em) * 0.07); }
.bw-8 { width: calc((100% - 5.5em) * 0.08); }
.bw-9 { width: calc((100% - 5.5em) * 0.09); }
.bw-10 { width: calc((100% - 5.5em) * 0.10); }
.bw-11 { width: calc((100% - 5.5em) * 0.11); }
.bw-12 { width: calc((100% - 5.5em) * 0.12); }
.bw-13 { width: calc((100% - 5.5em) * 0.13); }
.bw-14 { width: calc((100% - 5.5em) * 0.14); }
.bw-15 { width: calc((100% - 5.5em) * 0.15); }
.bw-16 { width: calc((100% - 5.5em) * 0.16); }
.bw-17 { width: calc((100% - 5.5em) * 0.17); }
.bw-18 { width: calc((100% - 5.5em) * 0.18); }
.bw-19 { width: calc((100% - 5.5em) * 0.19); }
.bw-20 { width: calc((100% - 5.5em) * 0.20); }
.bw-21 { width: calc((100% - 5.5em) * 0.21); }
.bw-22 { width: calc((100% - 5.5em) * 0.22); }
.bw-23 { width: calc((100% - 5.5em) * 0.23); }
.bw-24 { width: calc((100% - 5.5em) * 0.24); }
.bw-25 { width: calc((100% - 5.5em) * 0.25); }
.bw-26 { width: calc((100% - 5.5em) * 0.26); }
.bw-27 { width: calc((100% - 5.5em) * 0.27); }
.bw-28 { width: calc((100% - 5.5em) * 0.28); }
.bw-29 { width: calc((100% - 5.5em) * 0.29); }
.bw-30 { width: calc((100% - 5.5em) * 0.30); }
.bw-31 { width: calc((100% - 5.5em) * 0.31); }
.bw-32 { width: calc((100% - 5.5em) * 0.32); }
.bw-33 { width: calc((100% - 5.5em) * 0.33); }
.bw-34 { width: calc((100% - 5.5em) * 0.34); }
.bw-35 { width: calc((100% - 5.5em) * 0.35); }
.bw-36 { width: calc((100% - 5.5em) * 0.36); }
.bw-37 { width: calc((100% - 5.5em) * 0.37); }
.bw-38 { width: calc((100% - 5.5em) * 0.38); }
.bw-39 { width: calc((100% - 5.5em) * 0.39); }
.bw-40 { width: calc((100% - 5.5em) * 0.40); }
.bw-41 { width: calc((100% - 5.5em) * 0.41); }
.bw-42 { width: calc((100% - 5.5em) * 0.42); }
.bw-43 { width: calc((100% - 5.5em) * 0.43); }
.bw-44 { width: calc((100% - 5.5em) * 0.44); }
.bw-45 { width: calc((100% - 5.5em) * 0.45); }
.bw-46 { width: calc((100% - 5.5em) * 0.46); }
.bw-47 { width: calc((100% - 5.5em) * 0.47); }
.bw-48 { width: calc((100% - 5.5em) * 0.48); }
.bw-49 { width: calc((100% - 5.5em) * 0.49); }
.bw-50 { width: calc((100% - 5.5em) * 0.50); }
.bw-51 { width: calc((100% - 5.5em) * 0.51); }
.bw-52 { width: calc((100% - 5.5em) * 0.52); }
.bw-53 { width: calc((100% - 5.5em) * 0.53); }
.bw-54 { width: calc((100% - 5.5em) * 0.54); }
.bw-55 { width: calc((100% - 5.5em) * 0.55); }
.bw-56 { width: calc((100% - 5.5em) * 0.56); }
.bw-57 { width: calc((100% - 5.5em) * 0.57); }
.bw-58 { width: calc((100% - 5.5em) * 0.58); }
.bw-59 { width: calc((100% - 5.5em) * 0.59); }
.bw-60 { width: calc((100% - 5.5em) * 0.60); }
.bw-61 { width: calc((100% - 5.5em) * 0.61); }
.bw-62 { width: calc((100% - 5.5em) * 0.62); }
.bw-63 { width: calc((100% - 5.5em) * 0.63); }
.bw-64 { width: calc((100% - 5.5em) * 0.64); }
.bw-65 { width: calc((100% - 5.5em) * 0.65); }
.bw-66 { width: calc((100% - 5.5em) * 0.66); }
.bw-67 { width: calc((100% - 5.5em) * 0.67); }
.bw-68 { width: calc((100% - 5.5em) * 0.68); }
.bw-69 { width: calc((100% - 5.5em) * 0.69); }
.bw-70 { width: calc((100% - 5.5em) * 0.70); }
.bw-71 { width: calc((100% - 5.5em) * 0.71); }
.bw-72 { width: calc((100% - 5.5em) * 0.72); }
.bw-73 { width: calc((100% - 5.5em) * 0.73); }
.bw-74 { width: calc((100% - 5.5em) * 0.74); }
.bw-75 { width: calc((100% - 5.5em) * 0.75); }
.bw-76 { width: calc((100% - 5.5em) * 0.76); }
.bw-77 { width: calc((100% - 5.5em) * 0.77); }
.bw-78 { width: calc((100% - 5.5em) * 0.78); }
.bw-79 { width: calc((100% - 5.5em) * 0.79); }
.bw-80 { width: calc((100% - 5.5em) * 0.80); }
.bw-81 { width: calc((100% - 5.5em) * 0.81); }
.bw-82 { width: calc((100% - 5.5em) * 0.82); }
.bw-83 { width: calc((100% - 5.5em) * 0.83); }
.bw-84 { width: calc((100% - 5.5em) * 0.84); }
.bw-85 { width: calc((100% - 5.5em) * 0.85); }
.bw-86 { width: calc((100% - 5.5em) * 0.86); }
.bw-87 { width: calc((100% - 5.5em) * 0.87); }
.bw-88 { width: calc((100% - 5.5em) * 0.88); }
.bw-89 { width: calc((100% - 5.5em) * 0.89); }
.bw-90 { width: calc((100% - 5.5em) * 0.90); }
.bw-91 { width: calc((100% - 5.5em) * 0.91); }
.bw-92 { width: calc((100% - 5.5em) * 0.92); }
.bw-93 { width: calc((100% - 5.5em) * 0.93); }
.bw-94 { width: calc((100% - 5.5em) * 0.94); }
.bw-95 { width: calc((100% - 5.5em) * 0.95); }
.bw-96 { width: calc((100% - 5.5em) * 0.96); }
.bw-97 { width: calc((100% - 5.5em) * 0.97); }
.bw-98 { width: calc((100% - 5.5em) * 0.98); }
.bw-99 { width: calc((100% - 5.5em) * 0.99); }
.bw-100 { width: calc((100% - 5.5em) * 1.00); }
.bh-0 { height: 0%; }
.bh-1 { height: 1%; }
.bh-2 { height: 2%; }
.bh-3 { height: 3%; }
.bh-4 { height: 4%; }
.bh-5 { height: 5%; }
.bh-6 { height: 6%; }
.bh-7 { height: 7%; }
.bh-8 { height: 8%; }
.bh-9 { height: 9%; }
.bh-10 { height: 10%; }
.bh-11 { height: 11%; }
.bh-12 { height: 12%; }
.bh-13 { height: 13%; }
.bh-14 { height: 14%; }
.bh-15 { height: 15%; }
.bh-16 { height: 16%; }
.bh-17 { height: 17%; }
.bh-18 { height: 18%; }
.bh-19 { height: 19%; }
.bh-20 { height: 20%; }
.bh-21 { height: 21%; }
.bh-22 { height: 22%; }
.bh-23 { height: 23%; }
.bh-24 { height: 24%; }
.bh-25 { height: 25%; }
.bh-26 { height: 26%; }
.bh-27 { height: 27%; }
.bh-28 { height: 28%; }
.bh-29 { height: 29%; }
.bh-30 { height: 30%; }
.bh-31 { height: 31%; }
.bh-32 { height: 32%; }
.bh-33 { height: 33%; }
.bh-34 { height: 34%; }
.bh-35 { height: 35%; }
.bh-36 { height: 36%; }
.bh-37 { height: 37%; }
.bh-38 { height: 38%; }
.bh-39 { height: 39%; }
.bh-40 { height: 40%; }
.bh-41 { height: 41%; }
.bh-42 { height: 42%; }
.bh-43 { height: 43%; }
.bh-44 { height: 44%; }
.bh-45 { height: 45%; }
.bh-46 { height: 46%; }
.bh-47 { height: 47%; }
.bh-48 { height: 48%; }
.bh-49 { height: 49%; }
.bh-50 { height: 50%; }
.bh-51 { height: 51%; }
.bh-52 { height: 52%; }
.bh-53 { height: 53%; }
.bh-54 { height: 54%; }
.bh-55 { height: 55%; }
.bh-56 { height: 56%; }
.bh-57 { height: 57%; }
.bh-58 { height: 58%; }
.bh-59 { height: 59%; }
.bh-60 { height: 60%; }
.bh-61 { height: 61%; }
.bh-62 { height: 62%; }
.bh-63 { height: 63%; }
.bh-64 { height: 64%; }
.bh-65 { height: 65%; }
.bh-66 { height: 66%; }
.bh-67 { height: 67%; }
.bh-68 { height: 68%; }
.bh-69 { height: 69%; }
.bh-70 { height: 70%; }
.bh-71 { height: 71%; }
.bh-72 { height: 72%; }
.bh-73 { height: 73%; }
.bh-74 { height: 74%; }
.bh-75 { height: 75%; }
.bh-76 { height: 76%; }
.bh-77 { height: 77%; }
.bh-78 { height: 78%; }
.bh-79 { height: 79%; }
.bh-80 { height: 80%; }
.bh-81 { height: 81%; }
.bh-82 { height: 82%; }
.bh-83 { height: 83%; }
.bh-84 { height: 84%; }
.bh-85 { height: 85%; }
.bh-86 { height: 86%; }
.bh-87 { height: 87%; }
.bh-88 { height: 88%; }
.bh-89 { height: 89%; }
.bh-90 { height: 90%; }
.bh-91 { height: 91%; }
.bh-92 { height: 92%; }
.bh-93 { height: 93%; }
.bh-94 { height: 94%; }
.bh-95 { height: 95%; }
.bh-96 { height: 96%; }
.bh-97 { height: 97%; }
.bh-98 { height: 98%; }
.bh-99 { height: 99%; }
.bh-100 { height: 100%; }

/* Phase 8: billing */
.st-trial, .st-open { background: var(--brand-soft); color: var(--brand); }
.st-paid { background: rgba(31, 138, 76, .14); color: var(--success); }
.st-past_due { background: var(--accent-soft); color: var(--warning); }
.st-void, .st-failed { background: rgba(90, 104, 102, .14); color: var(--text-muted); }
.st-succeeded { background: rgba(31, 138, 76, .14); color: var(--success); }
.billing-banner { margin-bottom: 18px; }

/* ZENTAVA acronym tiles (public page) */
.acronym { padding: 18px; margin: 4px 0 22px; border-radius: var(--radius); }
.acronym h2 { font-size: .95rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 12px; padding-left: 10px; border-left: 4px solid var(--teal); }
.acr-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.acr-tiles li { background: #14213d; color: #fff; border-radius: 12px; padding: 10px 4px 9px; text-align: center; min-width: 0; }
.acr-tiles b { display: block; color: var(--gold); font-size: 1.6rem; line-height: 1.1; font-weight: 800; }
.acr-tiles span { display: block; font-size: .72rem; overflow-wrap: anywhere; }
@media (max-width: 760px) { .acr-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 600px) { .acr-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 374px) { .acr-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ZENTAVA OIMS wordmark: brand bold, product lighter in teal */
.wordmark { white-space: nowrap; }
.wm-brand { font-weight: 800; letter-spacing: .02em; }
.wm-product { font-weight: 600; color: var(--link); letter-spacing: .04em; }

/* Language switch (EN / FR) beside the light/dark button */
.lang-switch { display: inline-flex; margin: 0; }
.lang-btn { font-weight: 700; font-size: .8rem; letter-spacing: .04em; }
.auth-tools { display: flex; gap: 8px; }

/* ---------- ZENTAVA Assistant ---------- */
.assist-fab { position: fixed; right: max(24px, env(safe-area-inset-right)); bottom: max(24px, env(safe-area-inset-bottom)); z-index: 1060;
  width: 56px; height: 56px; border-radius: 50%; border: 0; display: grid; place-items: center; font-size: 1.35rem;
  color: #fff; background: linear-gradient(135deg, var(--brand), #24365f); box-shadow: 0 12px 28px rgba(20, 33, 61, .32); }
.assist-fab:hover { filter: brightness(1.08); }
.assist.is-open .assist-fab { box-shadow: 0 0 0 4px var(--brand-soft), 0 12px 28px rgba(20, 33, 61, .32); }
.assist-panel { position: fixed; right: max(24px, env(safe-area-inset-right)); bottom: calc(max(24px, env(safe-area-inset-bottom)) + 68px);
  z-index: 1061; width: min(400px, calc(100vw - 32px)); height: min(580px, calc(100vh - 140px));
  display: flex; flex-direction: column; overflow: hidden; border-radius: 22px;
  background: var(--surface-solid); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.assist-panel[hidden] { display: none; }
.assist-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--border); }
.assist-head strong { flex: 1; font-size: .98rem; }
.assist-avatar { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; background: #f4f6f8; padding: 2px; }
.assist-avatar img { width: 100%; height: 100%; display: block; }
.assist-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.assist-msg { max-width: 92%; padding: 10px 12px; border-radius: 16px; font-size: .92rem; line-height: 1.45; }
.assist-msg p { margin: 0 0 6px; }
.assist-msg p:last-child { margin-bottom: 0; }
.assist-msg.bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.assist-msg.me { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 6px; }
.assist-msg.pending { color: var(--text-muted); font-style: italic; }
.assist-msg.error { border-color: rgba(192, 57, 43, .35); }
.assist-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.assist-link { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--link); font-size: .82rem; text-decoration: none; font-weight: 600; }
.assist-link:hover { text-decoration: underline; }
.assist-source { font-size: .75rem; color: var(--text-muted); margin-top: 6px !important; }
.assist-suggest { display: flex; gap: 6px; padding: 0 12px 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.assist-suggest::-webkit-scrollbar { display: none; }
.assist-chip { flex: 0 0 auto; white-space: nowrap; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 999px; padding: 6px 12px; font-size: .82rem; }
.assist-chip:hover { border-color: var(--teal); }
.assist-form { display: flex; gap: 8px; align-items: flex-end; padding: 8px 12px; border-top: 1px solid var(--border); }
.assist-form textarea { flex: 1; resize: none; min-height: 42px; max-height: 120px; font-size: 16px; padding: 9px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--page-bg); color: var(--text); }
.assist-form textarea:focus { outline: 0; border-color: var(--teal); box-shadow: 0 0 0 .2rem var(--brand-soft); }
.assist-send { width: 42px; height: 42px; padding: 0; border-radius: 12px; }
.assist-note { margin: 0; padding: 0 12px 10px; font-size: .72rem; color: var(--text-muted); }
@media print { .assist { display: none !important; } }

/* Installable app */
[data-install][hidden] { display: none !important; }
.install-steps { padding-left: 1.3rem; }
.install-steps li { margin-bottom: .45rem; }
.install-steps .bi { font-size: 1.1rem; color: var(--link); }

/* Public pricing */
.pricing { margin-top: 44px; }
.pricing h2 { font-size: 1.35rem; font-weight: 700; margin-bottom: 4px; }
.pricing-note { color: var(--text-muted); font-size: .92rem; margin: 0 0 16px; }
.pricing-note:last-child { margin: 16px 0 0; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.plan-card { padding: 22px; display: flex; flex-direction: column; gap: 6px; }
.plan-card h3 { font-size: 1.1rem; font-weight: 700; margin: 0; }
.plan-desc { color: var(--text-muted); font-size: .9rem; margin: 0 0 6px; }
.plan-price { margin: 4px 0 0; }
.plan-amount { font-size: 1.6rem; font-weight: 750; white-space: nowrap; }
.plan-per, .plan-annual { color: var(--text-muted); font-size: .9rem; }
.plan-annual { margin: 0; }
.plan-limits { list-style: none; padding: 0; margin: 10px 0 14px; font-size: .92rem; }
.plan-limits li { display: flex; gap: 8px; align-items: center; padding: 3px 0; }
.plan-limits .bi { color: var(--link); }
.plan-card .btn { margin-top: auto; align-self: flex-start; }
@media (min-width: 761px) { .plan-desc { min-height: 4.5em; } }

/* Video calls and live notes */
.call-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.call-layout.has-frame { grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); }
.call-layout:not(.has-frame) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
.call-stage { padding: 0; overflow: hidden; }
.call-frame { display: block; width: 100%; height: min(78vh, 760px); border: 0; background: #0b1120; }
.call-open { padding: 36px 24px; text-align: center; }
.call-open h2 { font-size: 1.3rem; font-weight: 700; margin: 8px 0; }
.call-icon { font-size: 2.6rem; color: var(--link); }
.call-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.call-side > .panel { margin-bottom: 0; }
.notes-status { font-size: .85rem; color: var(--text-muted); }
.notes-status.is-live { color: var(--danger, #c0392b); font-weight: 650; }
.notes-status.is-live::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; }
.notes-lang { width: auto; max-width: 100%; }
.notes-interim { min-height: 1.4em; margin: 0 0 6px; color: var(--text-muted); font-style: italic; font-size: .92rem; }
.notes-text { font-size: .95rem; line-height: 1.5; }
.notes-draft-text { white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: .92rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; max-height: 420px; overflow: auto; }
@media (max-width: 1100px) { .call-layout.has-frame, .call-layout:not(.has-frame) { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .call-frame { height: 62vh; height: 62svh; min-height: 380px; } }

/* Staff photos */
.avatar-photo { object-fit: cover; padding: 0; border: 2px solid var(--surface-solid); box-shadow: 0 1px 3px rgba(20, 33, 61, .15); }
.avatar-xl { width: 96px; height: 96px; font-size: 1.6rem; flex: 0 0 auto; }
.name-with-avatar { display: inline-flex; align-items: center; gap: 10px; }
.name-with-avatar .avatar { width: 32px; height: 32px; font-size: .72rem; flex: 0 0 auto; }
.profile-photo-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.profile-photo-tools { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1 1 220px; }
.photo-upload { margin: 0; }
.camera-stage { position: relative; width: min(100%, 360px); margin: 0 auto; aspect-ratio: 7 / 9; border-radius: 18px; overflow: hidden; background: #0b1120; }
.camera-video, .camera-shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.camera-video.is-mirrored { transform: scaleX(-1); }
.camera-guide { position: absolute; inset: 0; pointer-events: none; }
.guide-head { position: absolute; left: 22%; right: 22%; top: 12%; height: 58%; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, .8); box-shadow: 0 0 0 999px rgba(0, 0, 0, .3); }
.camera-shot:not([hidden]) ~ .camera-guide { display: none; }
.camera-choice { display: flex; gap: 6px; justify-content: center; margin-bottom: 10px; flex-wrap: wrap; }
.camera-choice .btn { border: 1px solid var(--border); background: var(--surface-solid); color: var(--text); border-radius: 999px; }
.camera-choice .btn.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.avatar-photo { object-position: 50% 22%; }
.passport-photo { width: 105px; height: 135px; border-radius: 10px; object-fit: cover; border: 3px solid var(--surface-solid); box-shadow: 0 2px 10px rgba(20, 33, 61, .16); flex: 0 0 auto; }
.passport-empty { display: grid; place-items: center; align-content: center; gap: 4px; background: var(--surface-2); color: var(--text-muted); border: 2px dashed var(--border); box-shadow: none; }
.passport-empty .bi { font-size: 2rem; }
.passport-empty span { font-size: .72rem; }
/* printable sheet of passport photos (35 x 45 mm each) */
.passport-sheet { display: grid; grid-template-columns: repeat(auto-fill, 35mm); gap: 6mm; padding: 8mm; background: #fff; border-radius: 12px; justify-content: start; }
.passport-sheet figure { margin: 0; }
.passport-sheet img { display: block; width: 35mm; height: 45mm; object-fit: cover; outline: 0.2mm dashed #999; outline-offset: 1mm; }
.passport-sheet figcaption { font-size: 7pt; color: #333; text-align: center; margin-top: 1.5mm; }
@media print {
  .passport-page .page-head, .passport-page .no-print { display: none !important; }
  .passport-sheet { padding: 0; border-radius: 0; }
  @page { margin: 10mm; }
}
.camera-actions { flex-wrap: wrap; gap: 8px; }
/* no floating help button over dialogs (camera, confirmations) */
body.modal-open .assist { display: none; }
.passport-page select.form-select { min-width: 5.5rem; }
@media (max-width: 760px) {
  .camera-stage { width: auto; height: min(52vh, 460px); height: min(52svh, 460px); max-width: 100%; }
  #camera-modal .modal-body { padding-bottom: 6px; }
}
