/* ==========================================================================
   RCH Office legacy compatibility bundle v1
   Transitional bundle for pre-v0.19 consolidation.

   Source order is preserved. All forced-priority tokens were removed so the
   consolidated Office layer can govern the cascade without specificity wars.
   ========================================================================== */


/* --------------------------------------------------------------------------
   SOURCE: office.css
   -------------------------------------------------------------------------- */
:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --text: #111827;
  --muted: #667085;
  --line: #e2e8f0;
  --primary: #1769e8;
  --primary-dark: #0f55c7;
  --sidebar: #0d1728;
  --sidebar-soft: #17243a;
  --success: #07875f;
  --warning: #b54708;
  --danger: #d92d20;
  --purple: #a52ad5;
  --indigo: #6941c6;
  --shadow: 0 12px 34px rgba(16, 24, 40, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 9px 14px; border: 1px solid transparent; border-radius: 11px; font-weight: 800; cursor: pointer; transition: .16s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.primary { color: #fff; background: var(--primary); }
.btn.primary:hover { background: var(--primary-dark); }
.btn.secondary { color: #344054; background: #fff; border-color: #d0d5dd; }
.btn.ghost { color: #475467; background: transparent; border-color: #d0d5dd; }
.btn.wide { width: 100%; }

.access-gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 10%, #dbeafe 0, transparent 32%), radial-gradient(circle at 85% 90%, #ede9fe 0, transparent 35%), #f6f8fc; }
.gate-card { width: min(440px, 100%); border: 1px solid rgba(203, 213, 225, .8); border-radius: 28px; padding: 34px; background: rgba(255,255,255,.96); box-shadow: 0 24px 80px rgba(15,23,42,.14); }
.gate-logo { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; color: white; font-size: 30px; background: linear-gradient(135deg,#1677ff,#6d4aff); box-shadow: 0 10px 28px rgba(54,94,255,.28); }
.eyebrow { margin: 18px 0 4px; color: #667085; font-size: 11px; font-weight: 900; letter-spacing: .12em; }
.gate-card h1 { margin: 0; font-size: 31px; letter-spacing: -.04em; }
.gate-message { color: var(--muted); line-height: 1.55; }
.gate-login { display: grid; gap: 8px; margin-top: 22px; }
.gate-card label { margin-top: 7px; color: #344054; font-size: 13px; font-weight: 800; }
.gate-card input { width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid #cfd7e6; border-radius: 12px; outline: none; }
.gate-card input:focus { border-color: #84adff; box-shadow: 0 0 0 4px #eff4ff; }
.gate-status { margin: 18px 0 0; min-height: 20px; color: var(--muted); font-size: 13px; text-align: center; }
.gate-denied { display: grid; gap: 10px; margin-top: 20px; padding: 16px; border: 1px solid #fecaca; border-radius: 16px; background: #fff5f5; }
.gate-denied p { margin: 0 0 4px; color: #667085; font-size: 14px; line-height: 1.5; }

.office-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0,1fr); }
.office-sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 14px; color: #e7edf7; background: var(--sidebar); }
.office-brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 20px; }
.office-brand-mark { width: 43px; height: 43px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px; color: #fff; font-size: 24px; background: linear-gradient(135deg,#1d7afc,#714cff); }
.office-brand strong { display: block; font-size: 14px; }
.office-brand small { display: block; margin-top: 2px; color: #9eacc1; font-size: 12px; }
.office-nav { display: grid; gap: 6px; }
.nav-item { width: 100%; display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 8px; padding: 11px 12px; color: #b8c4d6; border: 0; border-radius: 12px; background: transparent; text-align: left; font-weight: 750; cursor: pointer; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active { color: #fff; background: linear-gradient(90deg,rgba(35,113,255,.28),rgba(96,70,255,.17)); box-shadow: inset 3px 0 0 #4f8cff; }
.nav-item b { min-width: 24px; padding: 3px 7px; border-radius: 999px; color: #dce8ff; background: #24344e; font-size: 11px; text-align: center; }
.nav-roadmap { margin-top: 28px; padding: 0 10px; }
.nav-roadmap > p { color: #718198; font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.nav-roadmap > div { display: flex; justify-content: space-between; gap: 8px; padding: 9px 0; color: #93a2b8; font-size: 12px; border-bottom: 1px solid rgba(255,255,255,.05); }
.nav-roadmap small { color: #5f718c; }
.sidebar-footer { margin-top: auto; display: grid; gap: 8px; }
.sidebar-footer .btn.secondary { color: #e6efff; border-color: #30435e; background: #17243a; }
.sidebar-footer .btn.ghost { color: #9eacc1; border-color: #30435e; }

.office-main { min-width: 0; }
.office-topbar { min-height: 91px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 19px 28px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(10px); }
.office-topbar .eyebrow { margin: 0 0 4px; }
.office-topbar h1 { margin: 0; font-size: 25px; letter-spacing: -.035em; }
.page-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.status-chip, .user-chip { display: inline-flex; align-items: center; min-height: 38px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; color: #475467; background: #fff; font-size: 12px; font-weight: 800; white-space: nowrap; }
.status-chip.online { color: #067647; border-color: #abefc6; background: #ecfdf3; }
.status-chip.offline { color: #b54708; border-color: #fedf89; background: #fffaeb; }
.user-chip { color: #175cd3; border-color: #b2ccff; background: #eff4ff; }

.office-content { padding: 22px 28px 42px; }
.office-view { display: none; }
.office-view.active { display: block; }
.kpi-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 12px; }
.kpi-card { position: relative; min-height: 126px; overflow: hidden; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 7px 24px rgba(16,24,40,.05); }
.kpi-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--accent); }
.kpi-card::after { content: ""; position: absolute; top: -35px; right: -28px; width: 105px; height: 105px; border-radius: 50%; background: var(--soft); }
.kpi-card small { position: relative; z-index: 1; display: block; color: #667085; font-size: 11px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.kpi-card strong { position: relative; z-index: 1; display: block; margin: 7px 0 3px; font-size: 34px; letter-spacing: -.04em; }
.kpi-card span { position: relative; z-index: 1; color: #98a2b3; font-size: 12px; }
.kpi-card.blue { --accent:#1677ff; --soft:#eaf2ff; }.kpi-card.red { --accent:#e53935; --soft:#ffeded; }.kpi-card.violet { --accent:#c32ee8; --soft:#fbebff; }.kpi-card.indigo { --accent:#7655ef; --soft:#f0edff; }.kpi-card.green { --accent:#099268; --soft:#eafaf3; }.kpi-card.magenta { --accent:#d629d8; --soft:#ffedff; }
.overview-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 16px; margin-top: 16px; }
.panel { border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: 0 8px 26px rgba(16,24,40,.05); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 19px 20px 14px; }
.panel-heading .eyebrow { margin: 0 0 4px; }
.panel-heading h2, .section-intro h2 { margin: 0; font-size: 18px; letter-spacing: -.025em; }
.link-button { padding: 5px; color: var(--primary); border: 0; background: transparent; font-weight: 800; cursor: pointer; }
.priority-list, .progress-list, .workload-list { display: grid; gap: 8px; padding: 0 16px 18px; }
.priority-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 12px; border: 1px solid #edf0f5; border-radius: 13px; background: #fbfcfe; cursor: pointer; }
.priority-row:hover { border-color: #b2ccff; background: #f6f9ff; }
.priority-row strong { display: block; font-size: 13px; }
.priority-row span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.badge { display: inline-flex; align-items: center; align-self: center; padding: 4px 8px; border-radius: 999px; color: #475467; background: #f2f4f7; font-size: 11px; font-weight: 800; white-space: nowrap; }
.badge.high, .badge.alert { color: #b42318; background: #fef3f2; }.badge.medium { color: #b54708; background: #fffaeb; }.badge.low { color: #175cd3; background: #eff4ff; }.badge.success { color: #067647; background:#ecfdf3; }.badge.purple { color:#6938ef;background:#f4f3ff; }
.progress-row { display: grid; gap: 6px; }
.progress-label { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; font-weight: 750; }
.progress-label span:last-child { color: #667085; }
.progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: #e8ecf2; }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#1677ff,#c42ee7); }
.workload-row { padding: 11px 12px; border: 1px solid #edf0f5; border-radius: 13px; }
.workload-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; font-size: 12px; }
.workload-head strong { font-size: 13px; }.workload-head span { color: var(--primary); font-weight: 900; }
.quality-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; padding: 0 16px 18px; }
.quality-card { padding: 13px; border: 1px solid #e5e7eb; border-radius: 14px; background: #fafbfc; }
.quality-card strong { display: block; font-size: 22px; }.quality-card span { color: var(--muted); font-size: 11px; }
.empty-state { padding: 26px; color: #98a2b3; text-align: center; font-size: 13px; }

.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; }
.toolbar-main { flex: 1; display: grid; grid-template-columns: minmax(240px,1.4fr) repeat(4,minmax(145px,.7fr)); gap: 9px; }
.toolbar-actions { display: flex; gap: 8px; }
input, select, textarea { width: 100%; border: 1px solid #d0d5dd; border-radius: 10px; padding: 10px 11px; color: #101828; background: #fff; outline: none; }
input:focus, select:focus, textarea:focus { border-color: #84adff; box-shadow: 0 0 0 3px #eff4ff; }
.bulk-bar { position: sticky; top: 8px; z-index: 5; display: grid; grid-template-columns: auto repeat(3,minmax(170px,1fr)) auto auto; align-items: center; gap: 9px; margin: 12px 0; padding: 11px 13px; border: 1px solid #b2ccff; border-radius: 14px; background: #eff4ff; box-shadow: var(--shadow); }
.table-panel { margin-top: 12px; overflow: hidden; }
.table-meta { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; color: #667085; border-bottom: 1px solid var(--line); font-size: 12px; }
.table-scroll { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 1000px; }
.data-table th { padding: 11px 12px; color: #667085; background: #f8fafc; border-bottom: 1px solid var(--line); font-size: 10px; letter-spacing: .07em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 11px 12px; border-bottom: 1px solid #edf0f5; font-size: 12px; vertical-align: middle; }
.data-table tbody tr:hover { background: #f8fbff; }
.data-table tbody tr.selected { background: #eff6ff; }
.check-cell { width: 38px; text-align: center; }.check-cell input { width: auto; }
.cell-title { display: block; max-width: 280px; overflow: hidden; font-size: 12px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.cell-subtitle { display: block; max-width: 280px; overflow: hidden; margin-top: 3px; color: #667085; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.row-action { padding: 7px 10px; color: #175cd3; border: 1px solid #b2ccff; border-radius: 9px; background: #eff4ff; font-weight: 800; cursor: pointer; }
.pagination { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 16px; }
.section-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px; }
.section-intro p:last-child { margin: 6px 0 0; color: var(--muted); }
.assignment-cards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; margin-top: 14px; }
.assignment-card { padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: 0 7px 22px rgba(16,24,40,.05); }
.assignment-card h3 { margin: 0 0 5px; font-size: 14px; }.assignment-card p { min-height: 34px; margin: 0 0 12px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.assignment-card .form-line { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.audit-heading > span { color: var(--muted); font-size: 12px; }.audit-table { min-width: 900px; }

.drawer { position: fixed; inset: 0; z-index: 50; visibility: hidden; pointer-events: none; }
.drawer.open { visibility: visible; pointer-events: auto; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.38); opacity: 0; transition: .2s ease; }
.drawer.open .drawer-backdrop { opacity: 1; }
.drawer-panel { position: absolute; top: 0; right: 0; width: min(580px,94vw); height: 100%; overflow-y: auto; padding: 22px; background: #fff; box-shadow: -20px 0 60px rgba(15,23,42,.2); transform: translateX(102%); transition: .22s ease; }
.drawer.open .drawer-panel { transform: translateX(0); }
.drawer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.drawer-header .eyebrow { margin: 0 0 4px; }.drawer-header h2 { margin: 0; font-size: 22px; }
.icon-button { width: 38px; height: 38px; border: 1px solid #d0d5dd; border-radius: 11px; background: #fff; font-size: 24px; cursor: pointer; }
.drawer-form { display: grid; gap: 14px; padding-top: 18px; }
.drawer-form label { display: grid; gap: 6px; color: #344054; font-size: 12px; font-weight: 800; }
.form-grid { display: grid; gap: 11px; }.form-grid.two { grid-template-columns: repeat(2,1fr); }.address-grid { grid-template-columns: 1fr 120px; }
.drawer-facts { display: flex; flex-wrap: wrap; gap: 7px; min-height: 25px; }
.drawer-actions { position: sticky; bottom: -22px; display: flex; justify-content: flex-end; gap: 9px; margin: 4px -22px -22px; padding: 15px 22px; border-top: 1px solid var(--line); background: #fff; }

.toast-host { position: fixed; top: 16px; right: 16px; z-index: 100; display: grid; gap: 8px; width: min(380px,calc(100vw - 32px)); }
.toast { padding: 13px 15px; color: #fff; border-radius: 13px; background: #182230; box-shadow: 0 12px 38px rgba(15,23,42,.23); font-size: 13px; animation: toast-in .2s ease; }
.toast.success { background: #067647; }.toast.error { background: #b42318; }.toast.warning { background: #b54708; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

@media (max-width: 1320px) {
  .kpi-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .toolbar-main { grid-template-columns: repeat(3,minmax(150px,1fr)); }
  .search-input { grid-column: span 2; }
  .assignment-cards { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 980px) {
  .office-shell { grid-template-columns: 80px minmax(0,1fr); }
  .office-sidebar { padding-inline: 10px; }
  .office-brand span:last-child, .nav-item span:nth-child(2), .nav-item b, .nav-roadmap, .sidebar-footer .btn { font-size: 0; }
  .office-brand { justify-content: center; padding-inline: 0; }.office-brand-mark { width: 44px; }
  .nav-item { grid-template-columns: 1fr; justify-items: center; font-size: 20px; }
  .sidebar-footer .btn::first-letter { font-size: 16px; }
  .overview-grid { grid-template-columns: 1fr; }
  .table-toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-main { grid-template-columns: repeat(2,1fr); }.search-input { grid-column: span 2; }
  .bulk-bar { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 700px) {
  .office-shell { display: block; }
  .office-sidebar { position: static; width: 100%; height: auto; flex-direction: row; align-items: center; overflow-x: auto; }
  .office-brand { min-width: 55px; padding: 0; }.office-nav { display: flex; }.nav-item { min-width: 52px; }
  .sidebar-footer, .nav-roadmap { display: none; }
  .office-topbar { align-items: flex-start; flex-direction: column; padding: 15px 16px; }
  .topbar-actions { width: 100%; overflow-x: auto; }
  .office-content { padding: 14px 12px 30px; }
  .kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }.kpi-card { min-height: 112px; padding: 15px; }.kpi-card strong { font-size: 29px; }
  .toolbar-main { grid-template-columns: 1fr; }.search-input { grid-column: auto; }.toolbar-actions { justify-content: stretch; }.toolbar-actions .btn { flex: 1; }
  .bulk-bar { position: static; grid-template-columns: 1fr; }
  .assignment-cards { grid-template-columns: 1fr; }
  .form-grid.two, .address-grid { grid-template-columns: 1fr; }
}


/* --------------------------------------------------------------------------
   SOURCE: rch-office-v2.css
   -------------------------------------------------------------------------- */
/* ========================================================================== 
   RCH OS DESIGN SYSTEM v2 — Office
   Visual-only layer. No application logic or Supabase behavior is changed.
   ========================================================================== */

:root {
  --os-navy-950: #031327;
  --os-navy-900: #061b38;
  --os-navy-800: #0a2a54;
  --os-blue-600: #0d6efd;
  --os-blue-500: #2387ff;
  --os-cyan-500: #14b8c7;
  --os-green-500: #11a36a;
  --os-orange-500: #f79009;
  --os-red-500: #e53935;
  --os-violet-500: #7a5af8;
  --os-magenta-500: #d946ef;
  --os-ink: #101828;
  --os-muted: #667085;
  --os-line: #dde6f0;
  --os-canvas: #eef4fb;
  --os-panel: #ffffff;
  --os-shadow-1: 0 6px 20px rgba(3,19,39,.06);
  --os-shadow-2: 0 20px 52px rgba(3,19,39,.14);
}

html, body {
  color: var(--os-ink);
  background:
    radial-gradient(circle at 18% 0%, rgba(35,135,255,.10), transparent 28%),
    linear-gradient(180deg, #f5f8fd, var(--os-canvas));
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Access gate ------------------------------------------------------------- */
.access-gate {
  background:
    radial-gradient(circle at 17% 18%, rgba(35,135,255,.30), transparent 30%),
    radial-gradient(circle at 84% 85%, rgba(20,184,199,.16), transparent 31%),
    linear-gradient(135deg, var(--os-navy-950), var(--os-navy-900) 58%, #082b58);
}
.gate-card {
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 26px;
  background: rgba(255,255,255,.965);
  box-shadow: 0 32px 100px rgba(0,0,0,.34);
}
.gate-logo {
  width: 62px;
  height: 62px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 18px;
  background: linear-gradient(145deg, var(--os-blue-500), #4f46e5);
  box-shadow: 0 14px 34px rgba(13,110,253,.34);
  font-size: 0;
}
.gate-logo::after { content: "RCH"; color: #fff; font-size: 17px; font-weight: 900; letter-spacing: -.06em; }
.gate-card h1 { color: #101828; font-size: 30px; }
.gate-card input {
  border-color: #d7e1ec;
  background: #fbfdff;
}
.gate-card input:focus { border-color: #72adff; box-shadow: 0 0 0 4px rgba(35,135,255,.12); }

/* App frame --------------------------------------------------------------- */
.office-shell { grid-template-columns: 252px minmax(0,1fr); }
.office-sidebar {
  padding: 16px 13px;
  color: #e8f0fb;
  border-right: 1px solid rgba(255,255,255,.07);
  background:
    radial-gradient(circle at 25% 0%, rgba(35,135,255,.34), transparent 28%),
    linear-gradient(180deg, var(--os-navy-950), var(--os-navy-900) 55%, #04162e);
  box-shadow: 12px 0 34px rgba(3,19,39,.10);
}
.office-brand {
  gap: 12px;
  margin-bottom: 8px;
  padding: 7px 8px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.office-brand-mark {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 15px;
  background: linear-gradient(145deg, var(--os-blue-500), #4f46e5);
  box-shadow: 0 12px 28px rgba(13,110,253,.30);
  font-size: 0;
}
.office-brand-mark::after { content: "RCH"; color: #fff; font-size: 13px; font-weight: 900; letter-spacing: -.06em; }
.office-brand strong { color: #fff; font-size: 15px; letter-spacing: -.02em; }
.office-brand small { color: #9eb4ce; font-size: 11px; }
.office-nav { gap: 5px; margin-top: 8px; }
.nav-item {
  min-height: 45px;
  padding: 10px 11px;
  color: #aebed2;
  border: 1px solid transparent;
  border-radius: 11px;
}
.nav-item:hover { color: #fff; border-color: rgba(255,255,255,.08); background: rgba(255,255,255,.06); }
.nav-item.active {
  color: #fff;
  border-color: rgba(83,151,255,.22);
  background: linear-gradient(90deg, rgba(35,135,255,.28), rgba(79,70,229,.14));
  box-shadow: inset 3px 0 0 #3d91ff, 0 7px 18px rgba(0,0,0,.09);
}
.nav-item b { color: #dbeaff; background: rgba(255,255,255,.10); }
.nav-roadmap { margin-top: 26px; }
.nav-roadmap > p { color: #6f89a7; }
.nav-roadmap > div { color: #9bb0c8; border-color: rgba(255,255,255,.06); }
.nav-roadmap small { color: #607995; }
.sidebar-footer .btn.secondary {
  color: #eaf2ff;
  border-color: rgba(255,255,255,.12);
  background: rgba(255,255,255,.07);
}
.sidebar-footer .btn.ghost { color: #aebed2; border-color: rgba(255,255,255,.10); }

.office-main { background: transparent; }
.office-topbar {
  min-height: 92px;
  padding: 18px 28px;
  border-bottom: 1px solid #dce5ef;
  background: rgba(255,255,255,.92);
  box-shadow: 0 4px 18px rgba(3,19,39,.045);
  backdrop-filter: blur(14px);
}
.office-topbar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--os-blue-500), var(--os-cyan-500), var(--os-violet-500));
}
.office-topbar { position: sticky; top: 0; z-index: 20; }
.office-topbar h1 { color: #101828; font-size: 25px; }
.office-topbar .eyebrow { color: #0d6efd; }
.page-subtitle { color: var(--os-muted); }
.status-chip,
.user-chip {
  min-height: 38px;
  border-color: #dce5ef;
  background: #fff;
}
.status-chip.online { color: #087a51; border-color: #a8ebca; background: #ecfdf3; }
.user-chip { color: #0d5dcc; border-color: #c8ddfb; background: #f1f7ff; }

/* Content and KPI --------------------------------------------------------- */
.office-content { padding: 22px 26px 44px; }
.kpi-grid { gap: 11px; }
.kpi-card {
  min-height: 128px;
  padding: 17px 17px 15px 19px;
  border: 1px solid var(--os-line);
  border-radius: 17px;
  background: rgba(255,255,255,.97);
  box-shadow: var(--os-shadow-1);
}
.kpi-card::before { inset: 13px auto 13px 0; width: 4px; border-radius: 0 999px 999px 0; }
.kpi-card::after { top: -39px; right: -31px; width: 112px; height: 112px; opacity: .75; }
.kpi-card small { color: #667085; font-size: 10px; }
.kpi-card strong { color: #101828; font-size: 36px; }
.kpi-card span { color: #8492a6; }
.kpi-card.blue { --accent:#2387ff; --soft:#e9f3ff; }
.kpi-card.red { --accent:#e53935; --soft:#fff0ef; }
.kpi-card.violet { --accent:#d946ef; --soft:#fbeeff; }
.kpi-card.indigo { --accent:#7a5af8; --soft:#f1efff; }
.kpi-card.green { --accent:#11a36a; --soft:#eafaf3; }
.kpi-card.magenta { --accent:#d946ef; --soft:#fbeeff; }

.overview-grid { gap: 14px; margin-top: 14px; }
.panel {
  border: 1px solid var(--os-line);
  border-radius: 18px;
  background: rgba(255,255,255,.97);
  box-shadow: var(--os-shadow-1);
}
.panel-heading {
  padding: 17px 18px 13px;
  border-bottom: 1px solid #edf2f7;
}
.panel-heading .eyebrow,
.section-intro .eyebrow { color: #0d6efd; }
.panel-heading h2,
.section-intro h2 { color: #172033; }
.link-button { color: #0d6efd; }
.priority-list,
.progress-list,
.workload-list { gap: 8px; padding: 13px 14px 16px; }
.priority-row,
.workload-row {
  border-color: #e3eaf2;
  border-radius: 13px;
  background: #fbfdff;
}
.priority-row:hover { border-color: #9bc7ff; background: #f4f9ff; transform: translateY(-1px); }
.progress-track { height: 7px; background: #e8eef5; }
.progress-track i { background: linear-gradient(90deg, #0d6efd, #14b8c7); }
.quality-grid { padding: 14px; }
.quality-card {
  border-color: #e3eaf2;
  border-radius: 13px;
  background: #fbfdff;
}

/* Forms and table --------------------------------------------------------- */
.table-toolbar { padding: 13px; }
input, select, textarea {
  min-height: 41px;
  color: #1d2939;
  border: 1px solid #d7e1ec;
  border-radius: 10px;
  background: #fbfdff;
}
input:focus, select:focus, textarea:focus {
  border-color: #72adff;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(35,135,255,.12);
}
.btn {
  border-radius: 10px;
  font-weight: 780;
  box-shadow: none;
}
.btn.primary {
  color: #fff;
  border-color: #0d6efd;
  background: linear-gradient(135deg, #2387ff, #0d6efd);
  box-shadow: 0 7px 17px rgba(13,110,253,.20);
}
.btn.secondary { color: #344054; border-color: #d5dfe9; background: #fff; }
.btn.ghost { color: #667085; border-color: #d5dfe9; background: transparent; }
.bulk-bar {
  border-color: #bed8fb;
  border-radius: 14px;
  background: #f0f7ff;
  box-shadow: var(--os-shadow-1);
}
.table-panel { border-radius: 18px; }
.table-meta { background: #fbfdff; }
.data-table th {
  padding-block: 12px;
  color: #5d6b7e;
  border-color: #e1e8f0;
  background: #f5f8fc;
}
.data-table td { border-color: #edf2f7; }
.data-table tbody tr:hover { background: #f6faff; }
.data-table tbody tr.selected { background: #edf6ff; }
.row-action {
  color: #0d5dcc;
  border-color: #c8ddfb;
  background: #f1f7ff;
}
.assignment-card {
  border-color: var(--os-line);
  border-radius: 16px;
  box-shadow: var(--os-shadow-1);
}

/* Drawer ------------------------------------------------------------------ */
.drawer-backdrop { background: rgba(3,19,39,.55); backdrop-filter: blur(5px); }
.drawer-panel {
  border-left: 1px solid #dbe5f0;
  background: #f8fbff;
  box-shadow: -28px 0 75px rgba(3,19,39,.24);
}
.drawer-header { border-color: #dfe7f1; }
.drawer-form { gap: 13px; }
.drawer-form label { color: #475467; }
.drawer-actions {
  border-color: #dfe7f1;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
}
.icon-button { border-color: #d7e1ec; background: #fff; }

/* Toast ------------------------------------------------------------------- */
.toast { border: 1px solid rgba(255,255,255,.08); background: var(--os-navy-900); box-shadow: 0 18px 50px rgba(3,19,39,.25); }
.toast.success { background: #087a51; }
.toast.error { background: #bd2b22; }
.toast.warning { background: #a85b08; }

@media (max-width: 1320px) {
  .kpi-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 980px) {
  .office-shell { grid-template-columns: 78px minmax(0,1fr); }
  .office-sidebar { padding-inline: 9px; }
}
@media (max-width: 700px) {
  .office-sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.09);
  }
  .office-topbar { position: static; padding: 15px 16px; }
  .office-content { padding: 14px 12px 32px; }
  .kpi-card { min-height: 110px; }
}


/* --------------------------------------------------------------------------
   SOURCE: rch-office-v2-1.css
   -------------------------------------------------------------------------- */
/* ========================================================================== 
   RCH OS DESIGN SYSTEM v2.1 — Office refinements and official logo.
   ========================================================================== */

.gate-brand-logo {
  width: 82px;
  height: 82px;
  display: block;
  margin: 0 auto 12px;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(13,110,253,.20));
}

.office-brand-logo {
  width: 50px;
  height: 50px;
  display: block;
  flex: 0 0 50px;
  object-fit: contain;
  filter: drop-shadow(0 9px 18px rgba(13,110,253,.26));
}

.office-brand { text-decoration: none; }
.office-brand > span { min-width: 0; }

#view-activities .table-toolbar {
  position: sticky;
  top: 104px;
  z-index: 15;
  background: rgba(255,255,255,.94);
  box-shadow: 0 10px 30px rgba(3,19,39,.08);
  backdrop-filter: blur(14px);
}

#view-activities .table-panel { overflow: visible; }
#view-activities .data-table thead {
  position: sticky;
  top: 183px;
  z-index: 12;
}

.audit-panel .data-table td:nth-child(2) {
  max-width: 280px;
  overflow-wrap: anywhere;
}

.drawer-panel {
  background:
    radial-gradient(circle at 100% 0%, rgba(35,135,255,.08), transparent 28%),
    #f8fbff;
}

@media (max-width: 980px) {
  .office-brand-logo { width: 47px; height: 47px; flex-basis: 47px; }
  #view-activities .table-toolbar,
  #view-activities .data-table thead { position: static; }
}

@media (max-width: 700px) {
  .gate-brand-logo { width: 70px; height: 70px; }
}


/* --------------------------------------------------------------------------
   SOURCE: rch-office-v0-2.css
   -------------------------------------------------------------------------- */
/* ==========================================================================
   RCH Office v0.2 — Ambiti operativi + Audit unificato
   ========================================================================== */

.scope-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 5px 8px 5px 12px;
  border: 1px solid #cfe0f6;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 8px 22px rgba(3,19,39,.06);
  white-space: nowrap;
}

.scope-control span {
  color: #5d6b7e;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.scope-control select {
  width: auto;
  min-width: 185px;
  min-height: 32px;
  padding: 5px 28px 5px 8px;
  border: 0;
  border-radius: 999px;
  background-color: #eef6ff;
  color: #0a2a54;
  font-weight: 800;
}

.scope-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px 18px;
  border: 1px solid #cfe0f6;
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(20,184,166,.13), transparent 26%),
    linear-gradient(135deg, #f8fbff, #ffffff);
  box-shadow: 0 12px 30px rgba(3,19,39,.05);
}

.scope-banner strong {
  color: #08244a;
  font-size: 14px;
}

.scope-banner span {
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
}

.audit-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(160px, .7fr) minmax(150px, .65fr) minmax(150px, .65fr) auto;
  gap: 10px;
  align-items: center;
  padding: 14px 16px;
  border-top: 1px solid #edf2f7;
  border-bottom: 1px solid #edf2f7;
  background: #fbfdff;
}

.audit-toolbar .search-input,
.audit-toolbar select {
  min-height: 42px;
}

.audit-toolbar strong {
  justify-self: end;
  color: #5d6b7e;
  font-size: 12px;
  white-space: nowrap;
}

.audit-table .badge + .cell-title {
  margin-top: 7px;
}

#view-activities .table-panel {
  overflow: hidden;
}

#view-activities .table-scroll {
  overflow-x: auto;
  overflow-y: visible;
}

#view-activities .data-table thead,
#view-activities .data-table th {
  position: static;
}

@media (max-width: 1320px) {
  .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .scope-control {
    order: -1;
  }
}

@media (max-width: 980px) {
  .scope-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .audit-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .audit-toolbar strong {
    justify-self: start;
  }
}

@media (max-width: 700px) {
  .scope-control {
    width: 100%;
    justify-content: space-between;
  }

  .scope-control select {
    min-width: 0;
    flex: 1;
  }

  .audit-toolbar {
    grid-template-columns: 1fr;
  }
}


/* --------------------------------------------------------------------------
   SOURCE: rch-office-v0-14.css
   -------------------------------------------------------------------------- */
/* RCH Office v0.14 — revisione grafica, responsive e Inbox RCH */

:root {
  --rch-v14-radius: 22px;
  --rch-v14-soft-shadow: 0 16px 48px rgba(6, 27, 56, .08);
  --rch-v14-border: #d9e4f2;
  --rch-v14-muted: #48617f;
  --rch-v14-green-bg: #e9f9ef;
  --rch-v14-green-border: #a8e6ba;
  --rch-v14-green-text: #146c2e;
}

html {
  -webkit-text-size-adjust: 100%;
}

body[data-rch-ui="v2"] input,
body[data-rch-ui="v2"] select,
body[data-rch-ui="v2"] textarea,
body[data-rch-ui="v2"] button,
.timer-shell input,
.timer-shell select,
.timer-shell textarea,
.timer-shell button {
  font-size: 16px;
}

body[data-rch-ui="v2"] .office-content {
  max-width: 1480px;
}

body[data-rch-ui="v2"] .panel {
  border-radius: var(--rch-v14-radius);
  box-shadow: var(--rch-v14-soft-shadow);
}

body[data-rch-ui="v2"] .office-nav .nav-item,
body[data-rch-ui="v2"] .btn,
.timer-shell .btn {
  min-height: 44px;
}

body[data-rch-ui="v2"] .table-toolbar,
body[data-rch-ui="v2"] .audit-toolbar {
  gap: 14px;
}

body[data-rch-ui="v2"] .toolbar-main {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 10px;
  width: 100%;
}

body[data-rch-ui="v2"] .toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

body[data-rch-ui="v2"] .toolbar-actions .btn {
  white-space: nowrap;
}

body[data-rch-ui="v2"] .data-table th,
body[data-rch-ui="v2"] .data-table td {
  vertical-align: top;
}

body[data-rch-ui="v2"] .rch-compact-table th,
body[data-rch-ui="v2"] .rch-compact-table td {
  padding-top: 10px;
  padding-bottom: 10px;
}

body[data-rch-ui="v2"] .table-scroll {
  border-radius: 18px;
}

body[data-rch-ui="v2"] .badge.success,
body[data-rch-ui="v2"] .badge.green,
body[data-rch-ui="v2"] .calendar-entry-chip.success,
body[data-rch-ui="v2"] .calendar-entry-chip.availability-chip {
  background: var(--rch-v14-green-bg);
  border-color: var(--rch-v14-green-border);
  color: var(--rch-v14-green-text);
}

.calendar-month-scroll {
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}

.calendar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(122px, 1fr));
  gap: 8px;
  min-width: 760px;
}

.calendar-day-head {
  font-weight: 800;
  color: var(--rch-v14-muted);
  padding: 4px 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.calendar-day,
.calendar-day.empty {
  min-height: 106px;
  border: 1px solid var(--rch-v14-border);
  border-radius: 18px;
  background: #fff;
  padding: 10px;
  text-align: left;
  overflow: hidden;
}

.calendar-day {
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.calendar-day:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(6, 27, 56, .10);
}

.calendar-day.today {
  background: #eef5ff;
  border-color: #9cc5ff;
}

.calendar-day.has-availability {
  background: linear-gradient(180deg, #f7fff9 0%, #ffffff 74%);
  border-color: var(--rch-v14-green-border);
}

.calendar-day-number {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 800;
}

.calendar-day-count {
  display: block;
  margin-top: 4px;
  color: var(--rch-v14-muted);
  font-size: 12px;
}

.calendar-entry-chip {
  display: block;
  margin-top: 5px;
  padding: 4px 6px;
  border: 1px solid #dbe5f2;
  border-radius: 999px;
  background: #f8fafc;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-entry-more {
  display: block;
  margin-top: 5px;
  color: var(--rch-v14-muted);
  font-size: 11px;
  font-weight: 700;
}

.rch-inbox-hero {
  background: linear-gradient(135deg, rgba(6, 27, 56, .98), rgba(30, 87, 153, .92));
  color: #fff;
}

.rch-inbox-hero .eyebrow,
.rch-inbox-hero p {
  color: rgba(255, 255, 255, .82);
}

.rch-inbox-hero h2 {
  color: #fff;
}

.rch-inbox-hero .btn.secondary {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .28);
  color: #fff;
}

.rch-compact-kpis .kpi-card strong {
  font-size: clamp(26px, 4vw, 40px);
}

.rch-inbox-grid {
  align-items: stretch;
}

.inbox-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.inbox-flow article {
  border: 1px solid var(--rch-v14-border);
  border-radius: 18px;
  padding: 14px;
  background: #fff;
}

.inbox-flow strong {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #061b38;
  color: #fff;
  margin-bottom: 10px;
}

.inbox-flow span {
  display: block;
  font-weight: 800;
  color: #061b38;
}

.inbox-flow small {
  display: block;
  margin-top: 5px;
  color: var(--rch-v14-muted);
  line-height: 1.35;
}

.inbox-roadmap .quality-card strong {
  font-size: 24px;
}

.drawer-facts {
  gap: 8px;
}

.drawer-facts span {
  line-height: 1.35;
}

.timer-shell .timer-wrap {
  max-width: 1080px;
}

.timer-shell select[multiple] {
  min-height: 190px;
  border-radius: 18px;
  padding: 10px;
}

.timer-shell .form-grid.two {
  gap: 14px;
}

.timer-shell .timer-clock {
  border-radius: 30px;
}

@media (max-width: 1180px) {
  body[data-rch-ui="v2"] .office-shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .inbox-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 880px) {
  body[data-rch-ui="v2"] .office-shell {
    display: block;
  }

  body[data-rch-ui="v2"] .office-sidebar {
    position: relative;
    width: auto;
    min-height: auto;
  }

  body[data-rch-ui="v2"] .office-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-rch-ui="v2"] .office-topbar,
  body[data-rch-ui="v2"] .section-intro,
  body[data-rch-ui="v2"] .panel-heading,
  .timer-shell .timer-header {
    display: grid;
    gap: 12px;
  }

  body[data-rch-ui="v2"] .topbar-actions,
  body[data-rch-ui="v2"] .toolbar-actions,
  .timer-shell .timer-actions {
    width: 100%;
  }

  body[data-rch-ui="v2"] .topbar-actions > *,
  body[data-rch-ui="v2"] .toolbar-actions .btn,
  .timer-shell .timer-actions .btn {
    flex: 1 1 160px;
  }

  body[data-rch-ui="v2"] .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-rch-ui="v2"] .overview-grid {
    grid-template-columns: 1fr;
  }

  body[data-rch-ui="v2"] .drawer-panel {
    width: min(100vw, 720px);
  }
}

@media (max-width: 560px) {
  body[data-rch-ui="v2"] .office-content,
  body[data-rch-ui="v2"] .office-main,
  .timer-shell {
    padding-left: 10px;
    padding-right: 10px;
  }

  body[data-rch-ui="v2"] .office-nav {
    grid-template-columns: 1fr;
  }

  body[data-rch-ui="v2"] .kpi-grid {
    grid-template-columns: 1fr;
  }

  .inbox-flow {
    grid-template-columns: 1fr;
  }

  body[data-rch-ui="v2"] .toolbar-main {
    grid-template-columns: 1fr;
  }

  body[data-rch-ui="v2"] .toolbar-actions .btn {
    flex-basis: 100%;
  }

  body[data-rch-ui="v2"] .drawer-panel {
    width: 100vw;
    border-radius: 0;
  }

  .calendar-month-grid {
    min-width: 700px;
    grid-template-columns: repeat(7, minmax(100px, 1fr));
  }

  .calendar-day,
  .calendar-day.empty {
    min-height: 96px;
    border-radius: 16px;
  }
}


/* RCH Office v0.14.1 — rifinitura mobile, timer e dettagli */

body[data-rch-ui="v2"] .office-main {
  min-width: 0;
}

.office-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 27, 56, .48);
  z-index: 90;
}

.mobile-menu-toggle {
  display: none;
}

.office-timer-link,
.office-territory-link {
  white-space: nowrap;
}

.mobile-timer-fab {
  display: none;
}

body[data-rch-ui="v2"] .nav-roadmap div:first-of-type {
  border-color: rgba(255, 255, 255, .10);
}

body[data-rch-ui="v2"] .sidebar-footer {
  display: grid;
  gap: 10px;
}

body[data-rch-ui="v2"] .fieldwork-hero {
  align-items: center;
  background: linear-gradient(135deg, #ffffff 0%, #f4f8ff 62%, #eef6ff 100%);
}

.timer-open-cta {
  box-shadow: 0 14px 30px rgba(0, 98, 255, .18);
}

.calendar-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.calendar-detail-grid span {
  display: grid;
  gap: 4px;
  border: 1px solid var(--rch-v14-border);
  border-radius: 16px;
  background: #fff;
  padding: 12px;
}

.calendar-detail-grid strong {
  color: var(--rch-v14-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.calendar-detail-grid em {
  color: #061b38;
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
}

body[data-rch-ui="v2"] #availabilityTableBody td {
  padding-top: 9px;
  padding-bottom: 9px;
}

body[data-rch-ui="v2"] #availabilityTableBody .link-button,
body[data-rch-ui="v2"] #calendarTableBody .link-button {
  font-weight: 800;
}

body[data-rch-ui="v2"] #calendarTableBody tr:has(.badge.success),
body[data-rch-ui="v2"] #availabilityTableBody tr:has(.badge.success) {
  background: linear-gradient(90deg, rgba(233, 249, 239, .65), #fff 48%);
}

.timer-shell {
  background:
    radial-gradient(circle at top left, rgba(16, 101, 255, .10), transparent 32%),
    linear-gradient(180deg, #f5f8fd 0%, #eef4fb 100%);
}

.timer-shell .timer-wrap {
  max-width: 1120px;
}

.timer-shell .timer-header {
  background: linear-gradient(135deg, #061b38, #0b356b);
  color: #fff;
  border: 0;
}

.timer-shell .timer-header .eyebrow,
.timer-shell .timer-header .page-subtitle {
  color: rgba(255, 255, 255, .78);
}

.timer-shell .timer-header h1 {
  color: #fff;
}

.timer-shell .timer-actions .btn.secondary {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border-color: rgba(255, 255, 255, .24);
}

.timer-shell .timer-actions .btn.ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, .24);
}

.timer-shell .timer-clock {
  box-shadow: 0 18px 46px rgba(6, 27, 56, .22);
}

.timer-shell #startBtn,
.timer-shell #endBtn {
  min-height: 54px;
  font-size: 17px;
  font-weight: 900;
  position: sticky;
  bottom: 14px;
  z-index: 5;
  box-shadow: 0 18px 42px rgba(0, 98, 255, .20);
}

.timer-shell .panel {
  overflow: visible;
}

.timer-shell .control-row,
.timer-shell .drawer-form {
  min-width: 0;
}

@media (min-width: 1500px) {
  body[data-rch-ui="v2"] .office-content {
    max-width: 1680px;
  }

  body[data-rch-ui="v2"] #view-overview .overview-grid {
    grid-template-columns: minmax(560px, 1.15fr) minmax(460px, .85fr);
  }
}

@media (max-width: 960px) {
  .mobile-menu-toggle {
    display: inline-flex;
  }

  .office-territory-link {
    display: none;
  }

  body[data-rch-ui="v2"] .office-shell {
    display: block;
  }

  body[data-rch-ui="v2"] .office-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 360px);
    min-height: 100dvh;
    z-index: 100;
    transform: translateX(-105%);
    transition: transform .22s ease;
    overflow-y: auto;
    box-shadow: 24px 0 60px rgba(6, 27, 56, .28);
  }

  body.sidebar-open .office-sidebar {
    transform: translateX(0);
  }

  body[data-rch-ui="v2"] .office-main {
    width: 100%;
  }

  body[data-rch-ui="v2"] .office-topbar {
    position: sticky;
    top: 0;
    z-index: 70;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid #dfe8f4;
  }

  body[data-rch-ui="v2"] .topbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  body[data-rch-ui="v2"] .scope-control {
    flex: 1 1 100%;
  }

  .mobile-timer-fab {
    display: grid;
    place-items: center;
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 75;
    width: 58px;
    height: 58px;
    border-radius: 999px;
    background: #0062ff;
    color: #fff;
    text-decoration: none;
    font-size: 26px;
    box-shadow: 0 18px 44px rgba(0, 98, 255, .34);
  }

  body[data-rch-ui="v2"] .sidebar-footer {
    position: static;
    padding-bottom: 20px;
  }
}

@media (max-width: 720px) {
  body[data-rch-ui="v2"] .office-content {
    padding: 14px;
  }

  body[data-rch-ui="v2"] .section-intro,
  body[data-rch-ui="v2"] .panel-heading {
    grid-template-columns: 1fr;
  }

  .fieldwork-hero-actions,
  .fieldwork-hero-actions .btn {
    width: 100%;
  }

  .calendar-detail-grid {
    grid-template-columns: 1fr;
  }

  .timer-shell .timer-actions {
    display: grid;
    grid-template-columns: 1fr;
    margin-top: 12px;
  }

  .timer-shell .timer-header {
    border-radius: 24px;
  }

  .timer-shell .form-grid.two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  body[data-rch-ui="v2"] .topbar-actions .office-timer-link,
  body[data-rch-ui="v2"] .topbar-actions #refreshBtn,
  body[data-rch-ui="v2"] .topbar-actions .mobile-menu-toggle {
    flex: 1 1 calc(50% - 6px);
  }

  body[data-rch-ui="v2"] #currentUserLabel,
  body[data-rch-ui="v2"] #realtimeStatus,
  body[data-rch-ui="v2"] #dataLoadStatus {
    display: none;
  }

  body[data-rch-ui="v2"] .calendar-month-grid {
    min-width: 660px;
  }

  body[data-rch-ui="v2"] .drawer-panel {
    max-height: 100dvh;
    overflow-y: auto;
  }
}


/* RCH Office v0.14.2 — fix Territory/Timer e rifinitura mobile */

body[data-rch-ui="v2"] .topbar-actions {
  align-items: center;
}

body[data-rch-ui="v2"] .office-timer-link {
  font-weight: 900;
}

.timer-page .timer-shell {
  background:
    radial-gradient(circle at 10% 0%, rgba(0, 98, 255, .16), transparent 34%),
    linear-gradient(180deg, #eef4fb 0%, #f7fbff 100%);
}

.timer-page .timer-wrap {
  max-width: 1180px;
}

.timer-page .panel {
  border: 1px solid #d9e4f2;
  border-radius: 28px;
  box-shadow: 0 18px 56px rgba(6, 27, 56, .09);
}

.timer-page .timer-header {
  padding: 22px;
  background: linear-gradient(135deg, #061b38, #0b356b 62%, #0f4d9d);
}

.timer-page .timer-header h1 {
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: -.04em;
}

.timer-page .timer-actions .btn {
  min-width: 130px;
  justify-content: center;
}

.timer-page .timer-main-panel {
  padding: clamp(18px, 3vw, 28px);
}

.timer-page .timer-main-panel .panel-heading {
  align-items: center;
  border-bottom: 1px solid #e4edf7;
  padding-bottom: 14px;
  margin-bottom: 2px;
}

.timer-page .timer-clock {
  margin: 4px 0 6px;
  background:
    radial-gradient(circle at 50% 0%, rgba(52, 211, 153, .24), transparent 42%),
    linear-gradient(135deg, #061b38, #0b356b);
  border: 1px solid rgba(255, 255, 255, .12);
}

.timer-page .drawer-form {
  display: grid;
  gap: 16px;
}

.timer-page .drawer-form label {
  display: grid;
  gap: 7px;
  font-weight: 800;
  color: #061b38;
}

.timer-page .drawer-form small {
  color: #5d6f89;
  font-weight: 600;
}

.timer-page .type-pill-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.timer-page .type-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #d9e4f2;
  border-radius: 999px;
  background: #fff;
  color: #061b38;
  font-weight: 800;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.timer-page .type-pill:hover {
  transform: translateY(-1px);
  border-color: #9cc5ff;
}

.timer-page .type-pill input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #0062ff;
}

.timer-page .type-pill.is-selected {
  background: #eaf2ff;
  border-color: #7ab0ff;
  color: #084c9f;
}

.timer-page #startBtn,
.timer-page #endBtn {
  border-radius: 20px;
  min-height: 62px;
  font-size: 18px;
  letter-spacing: -.01em;
}

.timer-page #startBtn {
  background: linear-gradient(135deg, #0062ff, #004bd1);
}

.timer-page #endBtn {
  background: linear-gradient(135deg, #061b38, #0b356b);
}

.timer-page .control-row {
  border-radius: 20px;
  border: 1px solid #d9e4f2;
  background: #fff;
  padding: 12px;
}

@media (max-width: 860px) {
  body[data-rch-ui="v2"] .office-timer-link {
    flex: 1 1 100%;
  }

  .timer-page .timer-header {
    padding: 18px;
  }

  .timer-page .timer-actions .btn {
    min-width: 0;
  }

  .timer-page .type-pill-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .timer-page .timer-clock {
    padding: 22px 12px;
  }
}

@media (max-width: 520px) {
  .timer-page .type-pill-grid {
    grid-template-columns: 1fr;
  }

  .timer-page .timer-main-panel {
    padding: 14px;
    border-radius: 22px;
  }

  .timer-page .timer-clock {
    font-size: clamp(44px, 17vw, 72px);
    border-radius: 24px;
  }

  .timer-page #startBtn,
  .timer-page #endBtn {
    min-height: 58px;
  }
}


/* RCH Office v0.14.4 — correzioni copy Territory, sidebar e Inbox */

.gate-denied {
  display: grid;
  gap: 10px;
}

.gate-denied[hidden] {
  display: none;
}

.gate-denied .btn.primary {
  min-height: 48px;
  font-weight: 900;
}

body[data-rch-ui="v2"] .office-content {
  width: 100%;
  max-width: 1760px;
}

body[data-rch-ui="v2"] .office-sidebar {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 14px;
  min-height: 100vh;
}

.office-sidebar-scroll {
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  scroll-behavior: smooth;
}

.office-sidebar-scroll::-webkit-scrollbar {
  width: 8px;
}

.office-sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(151, 176, 214, .55);
  border-radius: 999px;
}

.sidebar-scroll-controls {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
}

.sidebar-scroll-controls.is-hidden {
  opacity: .4;
}

.sidebar-scroll-label {
  color: rgba(255, 255, 255, .70);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  text-align: center;
}

.sidebar-scroll-btn {
  min-height: 38px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, opacity .16s ease;
}

.sidebar-scroll-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, .14);
}

.sidebar-scroll-btn:disabled {
  opacity: .36;
  cursor: default;
}

.office-timer-link {
  min-width: max-content;
}

.rch-compact-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.rch-inbox-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(240px, .75fr);
  gap: 22px;
  align-items: start;
}

.rch-inbox-hero > :first-child {
  min-width: 0;
}

.rch-inbox-hero .toolbar-actions {
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  justify-items: stretch;
  width: min(220px, 100%);
  margin-left: auto;
}

.rch-inbox-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, .88fr);
  gap: 16px;
  align-items: stretch;
}

.rch-inbox-grid > .panel {
  height: 100%;
}

.inbox-roadmap {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 12px;
}

.inbox-roadmap .quality-card {
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (max-width: 1360px) {
  .rch-inbox-hero,
  .rch-inbox-grid {
    grid-template-columns: 1fr;
  }

  .rch-inbox-hero .toolbar-actions {
    width: 100%;
    max-width: 320px;
    margin-left: 0;
  }
}

@media (max-width: 960px) {
  body[data-rch-ui="v2"] .office-sidebar {
    display: block;
  }

  .sidebar-scroll-controls {
    display: none;
  }
}

@media (max-width: 880px) {
  .rch-compact-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .rch-compact-kpis,
  .inbox-roadmap {
    grid-template-columns: 1fr;
  }
}


/* RCH Office v0.14.5 — palette stati condivisa */

:root {
  --rch-state-total: #1570ef;
  --rch-state-validated: #ef4444;
  --rch-state-investigate: #d946ef;
  --rch-state-assigned: #7c3aed;
  --rch-state-verified: #12b76a;
  --rch-state-alert: #ec4899;
  --rch-progress-track: #e6edf5;
}

.kpi-card.red {
  border-left-color: var(--rch-state-validated);
}

.kpi-card.violet,
.kpi-card.indigo {
  border-left-color: var(--rch-state-assigned);
}

.kpi-card.green {
  border-left-color: var(--rch-state-verified);
}

.kpi-card.magenta {
  border-left-color: var(--rch-state-alert);
}

.progress-list .progress-bar,
.workload-list .progress-bar {
  background: var(--rch-progress-track);
}

.progress-list .progress-bar i,
.workload-list .progress-bar i {
  background: var(--rch-state-verified);
  min-width: 0;
}


/* RCH Office v0.15 — Inbox funzionale */
.rch-inbox-functional {
  background: linear-gradient(135deg, #061b38, #123d78 64%, #0b7fff);
}

.rch-inbox-functional .btn.primary {
  background: #ffffff;
  color: #061b38;
  border-color: rgba(255,255,255,.55);
}

.compact-toolbar {
  border: 0;
  box-shadow: none;
  padding: 14px 0 10px;
}

.drawer-actions-wrap {
  flex-wrap: wrap;
}

.badge.neutral {
  background: #eef2f7;
  color: #344054;
}

.badge.blue {
  background: #eff6ff;
  color: #175cd3;
}

.badge.indigo {
  background: #eef4ff;
  color: #3538cd;
}

.badge.warning {
  background: #fff7ed;
  color: #c2410c;
}

#view-inbox .data-table td {
  vertical-align: top;
}

@media (min-width: 1500px) {
  #view-inbox .table-panel {
    min-height: 420px;
  }
}


/* RCH Office v0.15.1 — rifinitura Inbox e cockpit accertatori */

body[data-rch-ui="v2"] #view-inbox .table-toolbar,
body[data-rch-ui="v2"] #view-inbox .table-meta {
  align-items: center;
}

body[data-rch-ui="v2"] #view-inbox .drawer-form,
body[data-rch-ui="v2"] #inboxDrawer .drawer-form {
  gap: 16px;
}

body[data-rch-ui="v2"] #view-inbox .badge,
body[data-rch-ui="v2"] #inboxDrawer .badge {
  border-radius: 999px;
  font-weight: 850;
  padding: 6px 9px;
}

.rch-inbox-hero {
  position: relative;
  overflow: hidden;
}

.rch-inbox-hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -120px;
  width: 280px;
  height: 280px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255,255,255,.18), transparent 68%);
  pointer-events: none;
}

.rch-inbox-hero > * {
  position: relative;
  z-index: 1;
}

.inbox-quick-actions,
.inbox-drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.inbox-quick-actions .btn,
.inbox-drawer-actions .btn {
  min-height: 42px;
}

/* Cockpit accertatori */
.timer-page {
  background: #eef4fb;
}

.timer-page .field-cockpit {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(0, 98, 255, .24), transparent 38%),
    linear-gradient(145deg, #061b38 0%, #0a2547 52%, #07172d 100%);
  color: #fff;
  box-shadow: 0 22px 55px rgba(6, 27, 56, .24);
}

.timer-page .field-cockpit .eyebrow {
  color: rgba(255,255,255,.62);
}

.timer-page .field-cockpit h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(22px, 4vw, 30px);
  letter-spacing: -.04em;
}

.timer-page .field-cockpit-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.timer-page .field-avatar {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .16);
  color: #fff;
  font-weight: 900;
}

.timer-page .field-cockpit-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.timer-page .field-cockpit-stats article {
  min-height: 72px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .08);
  display: grid;
  place-items: center;
  align-content: center;
}

.timer-page .field-cockpit-stats strong {
  color: #fff;
  font-size: 28px;
  line-height: 1;
}

.timer-page .field-cockpit-stats article:nth-child(1) strong {
  color: #60a5fa;
}

.timer-page .field-cockpit-stats article:nth-child(2) strong {
  color: #fb7185;
}

.timer-page .field-cockpit-stats article:nth-child(3) strong {
  color: #34d399;
}

.timer-page .field-cockpit-stats span {
  color: rgba(255, 255, 255, .72);
  font-size: 12px;
  font-weight: 800;
}

.timer-page .field-task-cards {
  display: grid;
  gap: 12px;
}

.timer-page .field-task-card {
  display: grid;
  gap: 12px;
  padding: 15px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .08);
  border-left: 5px solid #60a5fa;
}

.timer-page .field-task-card.is-urgent {
  border-left-color: #fb7185;
}

.timer-page .field-task-card.is-done {
  opacity: .74;
  border-left-color: #34d399;
}

.timer-page .field-task-card.is-empty {
  border-left-color: rgba(255,255,255,.18);
}

.timer-page .field-task-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.timer-page .field-task-main strong {
  display: block;
  color: #fff;
  font-size: 18px;
  line-height: 1.15;
}

.timer-page .field-task-main span {
  display: block;
  margin-top: 5px;
  color: rgba(255, 255, 255, .68);
  line-height: 1.35;
}

.timer-page .field-status {
  white-space: nowrap;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, .10);
  color: rgba(255,255,255,.82);
  font-style: normal;
  font-weight: 900;
  font-size: 12px;
}

.timer-page .field-status.verify {
  background: rgba(251, 113, 133, .18);
  color: #fb7185;
}

.timer-page .field-status.working {
  background: rgba(251, 191, 36, .18);
  color: #fbbf24;
}

.timer-page .field-status.done {
  background: rgba(52, 211, 153, .16);
  color: #34d399;
}

.timer-page .field-status.alert {
  background: rgba(244, 63, 94, .18);
  color: #fb7185;
}

.timer-page .field-task-action {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #0062ff, #1d4ed8);
  color: #fff;
  font-weight: 950;
  box-shadow: 0 16px 32px rgba(0, 98, 255, .22);
}

.timer-page .field-task-action:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}

@media (min-width: 1040px) {
  .timer-page .timer-main-panel {
    grid-template-columns: minmax(360px, .9fr) minmax(0, 1.1fr);
    align-items: start;
  }

  .timer-page .timer-main-panel > .panel-heading,
  .timer-page .timer-main-panel > .timer-clock {
    grid-column: 1 / -1;
  }

  .timer-page .field-cockpit {
    position: sticky;
    top: 18px;
  }

  .timer-page #startForm,
  .timer-page #endForm {
    grid-column: 2;
  }
}

@media (max-width: 620px) {
  .timer-page .field-cockpit {
    padding: 14px;
    border-radius: 24px;
  }

  .timer-page .field-cockpit-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .timer-page .field-cockpit-stats strong {
    font-size: 24px;
  }

  .timer-page .field-task-main {
    grid-template-columns: 1fr;
  }

  .timer-page .field-status {
    justify-self: start;
  }
}


/* RCH Office v0.15.2 — Accertatori mobile app redesign */

.timer-page {
  background:
    radial-gradient(circle at 10% 0%, rgba(0, 98, 255, .10), transparent 34%),
    linear-gradient(180deg, #eef4fb 0%, #e9f0f9 100%);
}

.timer-page .timer-shell {
  min-height: 100dvh;
  padding: 14px;
  background: transparent;
}

.timer-page .timer-wrap {
  width: min(100%, 1080px);
  margin: 0 auto;
}

.timer-page .timer-header {
  display: none;
}

.field-app-shell {
  width: min(100%, 540px);
  min-height: calc(100dvh - 28px);
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-radius: 34px;
  background:
    radial-gradient(circle at top right, rgba(0, 98, 255, .30), transparent 32%),
    linear-gradient(145deg, #061b38 0%, #0a2547 54%, #07172d 100%);
  color: #fff;
  box-shadow: 0 26px 75px rgba(6, 27, 56, .28);
}

.field-app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 10px;
}

.field-app-header h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(26px, 6vw, 34px);
  letter-spacing: -.05em;
}

.field-app-header .eyebrow,
.field-app-header .page-subtitle,
.field-cockpit .eyebrow {
  color: rgba(255, 255, 255, .64);
}

.field-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field-logout-btn {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 14px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-weight: 850;
  padding: 0 12px;
}

.field-avatar {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .16);
  color: #fff;
  font-weight: 950;
}

.field-tab-panel {
  min-height: 0;
  display: none;
  overflow: hidden;
  padding: 0 18px 94px;
}

.field-tab-panel.active {
  display: grid;
}

.field-cockpit {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 14px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #fff;
}

.field-cockpit-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.field-cockpit h2 {
  margin: 0;
  color: #fff;
  font-size: 24px;
  letter-spacing: -.04em;
}

.field-cockpit-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.field-cockpit-stats article {
  min-height: 78px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .08);
  display: grid;
  place-items: center;
  align-content: center;
}

.field-cockpit-stats strong {
  color: #fff;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -.04em;
}

.field-cockpit-stats article:nth-child(1) strong { color: #60a5fa; }
.field-cockpit-stats article:nth-child(2) strong { color: #fb7185; }
.field-cockpit-stats article:nth-child(3) strong { color: #34d399; }

.field-cockpit-stats span {
  color: rgba(255, 255, 255, .72);
  font-size: 12px;
  font-weight: 850;
}

.field-task-tools {
  display: grid;
  gap: 10px;
}

.field-task-tools input {
  width: 100%;
  min-height: 48px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  padding: 0 14px;
  outline: none;
}

.field-task-tools input::placeholder {
  color: rgba(255, 255, 255, .52);
}

.field-filter-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.field-filter-pills::-webkit-scrollbar {
  display: none;
}

.field-filter-pill {
  white-space: nowrap;
  min-height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.78);
  padding: 0 12px;
  font-weight: 850;
}

.field-filter-pill.active {
  background: #0062ff;
  border-color: #0062ff;
  color: #fff;
}

.field-task-cards {
  min-height: 0;
  max-height: calc(100dvh - 360px);
  overflow-y: auto;
  display: grid;
  gap: 12px;
  padding-right: 4px;
  padding-bottom: 10px;
  overscroll-behavior: contain;
}

.field-task-cards::-webkit-scrollbar {
  width: 7px;
}

.field-task-cards::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .20);
  border-radius: 999px;
}

.field-task-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .08);
  border-left: 5px solid #60a5fa;
}

.field-task-card.is-urgent {
  border-left-color: #fb7185;
}

.field-task-card.is-done {
  opacity: .78;
  border-left-color: #34d399;
}

.field-task-card.is-empty {
  border-left-color: rgba(255, 255, 255, .18);
}

.field-task-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.field-task-main strong {
  display: block;
  color: #fff;
  font-size: 17px;
  line-height: 1.17;
  text-transform: uppercase;
}

.field-task-main span {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, .66);
  line-height: 1.35;
}

.field-status {
  white-space: nowrap;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, .10);
  color: rgba(255, 255, 255, .82);
  font-style: normal;
  font-weight: 900;
  font-size: 12px;
}

.field-status.verify {
  background: rgba(251, 113, 133, .18);
  color: #fb7185;
}

.field-status.working {
  background: rgba(251, 191, 36, .18);
  color: #fbbf24;
}

.field-status.done {
  background: rgba(52, 211, 153, .16);
  color: #34d399;
}

.field-status.alert {
  background: rgba(244, 63, 94, .18);
  color: #fb7185;
}

.field-task-action {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #0062ff, #1d4ed8);
  color: #fff;
  font-weight: 950;
  box-shadow: 0 16px 32px rgba(0, 98, 255, .22);
}

.field-task-action:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}

.field-timer-card,
.field-history-card {
  min-height: 0;
  display: grid;
  gap: 14px;
  align-content: start;
  overflow-y: auto;
  max-height: calc(100dvh - 160px);
  padding-right: 4px;
}

.field-timer-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.field-timer-head h2 {
  margin: 0;
  color: #fff;
  font-size: 24px;
}

.timer-page .timer-clock {
  margin: 4px 0;
  border-radius: 28px;
  padding: 24px 12px;
  background:
    radial-gradient(circle at 50% 0%, rgba(52, 211, 153, .20), transparent 42%),
    linear-gradient(135deg, #041226, #0b356b);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .10), 0 18px 40px rgba(0,0,0,.25);
}

.field-form-card,
.field-controls-card,
.field-history-card {
  border-radius: 22px;
  padding: 16px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.10);
}

.timer-page .drawer-form label,
.timer-page .drawer-form small,
.timer-page .field-form-card label,
.timer-page .field-form-card small {
  color: rgba(255, 255, 255, .80);
}

.timer-page .field-form-card input,
.timer-page .field-form-card select,
.timer-page .field-form-card textarea,
.timer-page .field-controls-card input,
.timer-page .field-controls-card select,
.timer-page .field-controls-card textarea {
  background: rgba(255,255,255,.96);
  color: #061b38;
}

.timer-page .field-controls-card .panel-heading h2,
.timer-page .field-history-card .table-meta strong {
  color: #fff;
}

.timer-page .field-history-card .table-meta span {
  color: rgba(255,255,255,.66);
}

.timer-page .field-history-card .table-scroll {
  border-radius: 18px;
  background: rgba(255,255,255,.96);
}

.field-bottom-nav {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  min-height: 68px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border-radius: 24px;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 42px rgba(0,0,0,.22);
}

.field-bottom-tab {
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: rgba(255,255,255,.66);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  text-decoration: none;
  font-weight: 850;
  cursor: pointer;
}

.field-bottom-tab span {
  font-size: 20px;
  line-height: 1;
}

.field-bottom-tab em {
  font-style: normal;
  font-size: 11px;
}

.field-bottom-tab.active {
  background: #0062ff;
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 98, 255, .28);
}

@media (min-width: 920px) {
  .field-app-shell {
    width: min(100%, 620px);
  }
}

@media (max-width: 540px) {
  .timer-page .timer-shell {
    padding: 0;
  }

  .field-app-shell {
    min-height: 100dvh;
    border-radius: 0;
  }

  .field-app-header {
    padding: 18px 16px 8px;
  }

  .field-tab-panel {
    padding: 0 14px 92px;
  }

  .field-task-cards {
    max-height: calc(100dvh - 352px);
  }

  .field-cockpit-stats article {
    min-height: 70px;
  }

  .field-cockpit-stats strong {
    font-size: 25px;
  }

  .field-task-main {
    grid-template-columns: 1fr;
  }

  .field-status {
    justify-self: start;
  }

  .field-bottom-nav {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }
}

/* RCH Office v0.15.3 — audit UI e riallineamento globale */
:root {
  --rch-layout-max-wide: 1760px;
  --rch-panel-gap: 16px;
  --rch-panel-radius-global: 24px;
  --rch-module-hero-bg: radial-gradient(circle at 100% 0%, rgba(0,98,255,.10), transparent 34%), linear-gradient(135deg,#ffffff 0%,#f7fbff 100%);
}
body[data-rch-ui="v2"] .office-main { min-width: 0; }
body[data-rch-ui="v2"] .office-content { width: 100%; max-width: var(--rch-layout-max-wide); margin-inline: auto; }
body[data-rch-ui="v2"] .office-view { min-width: 0; }
body[data-rch-ui="v2"] .panel,
body[data-rch-ui="v2"] .section-intro,
body[data-rch-ui="v2"] .table-panel { border-radius: var(--rch-panel-radius-global); }
body[data-rch-ui="v2"] .office-topbar { gap: 18px; align-items: start; }
body[data-rch-ui="v2"] .topbar-actions { align-items: center; justify-content: flex-end; gap: 10px; }
body[data-rch-ui="v2"] .scope-control { min-width: min(360px, 100%); }
body[data-rch-ui="v2"] .topbar-actions .btn,
body[data-rch-ui="v2"] .topbar-actions .status-chip,
body[data-rch-ui="v2"] .topbar-actions .user-chip { min-height: 42px; }
body[data-rch-ui="v2"] .section-intro,
body[data-rch-ui="v2"] .scope-banner {
  background: var(--rch-module-hero-bg);
  border: 1px solid #dbe7f5;
  box-shadow: 0 16px 48px rgba(6,27,56,.07);
}
body[data-rch-ui="v2"] .section-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
}
body[data-rch-ui="v2"] .section-intro > :first-child,
body[data-rch-ui="v2"] .panel-heading > :first-child { min-width: 0; }
body[data-rch-ui="v2"] .section-intro p,
body[data-rch-ui="v2"] .page-subtitle { max-width: 980px; }
body[data-rch-ui="v2"] .kpi-grid { gap: var(--rch-panel-gap); }
body[data-rch-ui="v2"] .kpi-card { min-width: 0; overflow: hidden; }
body[data-rch-ui="v2"] .kpi-card small,
body[data-rch-ui="v2"] .kpi-card span { overflow-wrap: anywhere; }
body[data-rch-ui="v2"] .table-toolbar,
body[data-rch-ui="v2"] .audit-toolbar { align-items: end; border-radius: 22px; }
body[data-rch-ui="v2"] .toolbar-main { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
body[data-rch-ui="v2"] .toolbar-actions { justify-content: flex-end; }
body[data-rch-ui="v2"] .table-panel { overflow: hidden; }
body[data-rch-ui="v2"] .table-meta { gap: 12px; flex-wrap: wrap; }
body[data-rch-ui="v2"] .data-table th { white-space: nowrap; }
body[data-rch-ui="v2"] .cell-title { line-height: 1.25; }
body[data-rch-ui="v2"] .cell-subtitle { line-height: 1.35; }
body[data-rch-ui="v2"] .nav-roadmap { margin-top: 8px; }
body[data-rch-ui="v2"] .nav-roadmap div { min-height: 34px; }
body[data-rch-ui="v2"] #view-inbox .rch-inbox-hero { grid-template-columns: minmax(0, 1fr) minmax(220px, 280px); }
body[data-rch-ui="v2"] #view-inbox .rch-inbox-grid { grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr); }
body[data-rch-ui="v2"] #view-inbox .inbox-flow { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
body[data-rch-ui="v2"] #view-inbox .inbox-roadmap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body[data-rch-ui="v2"] .calendar-month-grid { gap: 8px; }
body[data-rch-ui="v2"] .calendar-day { border-radius: 16px; }
body[data-rch-ui="v2"] .calendar-entry { max-width: 100%; }
.timer-page .timer-wrap { width: 100%; }
.timer-page .field-app-shell { isolation: isolate; }
.timer-page .field-task-cards { scroll-padding-bottom: 22px; }
.timer-page .field-form-card,
.timer-page .field-controls-card,
.timer-page .field-history-card { min-width: 0; }
@media (min-width: 1500px) {
  body[data-rch-ui="v2"] #view-overview .overview-grid {
    grid-template-columns: minmax(520px, 1.1fr) minmax(460px, .9fr);
  }
}
@media (max-width: 1360px) {
  body[data-rch-ui="v2"] #view-inbox .rch-inbox-hero,
  body[data-rch-ui="v2"] #view-inbox .rch-inbox-grid { grid-template-columns: 1fr; }
  body[data-rch-ui="v2"] #view-inbox .inbox-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  body[data-rch-ui="v2"] .section-intro,
  body[data-rch-ui="v2"] .office-topbar { grid-template-columns: 1fr; }
  body[data-rch-ui="v2"] .topbar-actions,
  body[data-rch-ui="v2"] .toolbar-actions { justify-content: stretch; }
  body[data-rch-ui="v2"] .topbar-actions > *,
  body[data-rch-ui="v2"] .toolbar-actions .btn { flex: 1 1 160px; }
}
@media (max-width: 620px) {
  body[data-rch-ui="v2"] .section-intro { grid-template-columns: 1fr; }
  body[data-rch-ui="v2"] #view-inbox .inbox-flow,
  body[data-rch-ui="v2"] #view-inbox .inbox-roadmap { grid-template-columns: 1fr; }
  body[data-rch-ui="v2"] .toolbar-main { grid-template-columns: 1fr; }
}



/* RCH Office v0.15.4 — Field App accertatori full redesign */
.timer-page{min-height:100dvh;background:radial-gradient(circle at 15% 0%,rgba(0,98,255,.16),transparent 34%),radial-gradient(circle at 85% 6%,rgba(20,184,166,.10),transparent 30%),linear-gradient(135deg,#eaf2fb 0%,#f6f9fd 100%)}
.timer-page .timer-shell{min-height:100dvh;padding:22px 10px;background:transparent}.timer-page .timer-wrap{width:min(100%,980px);margin-inline:auto}.timer-page .timer-header{display:none}
.field-app-shell.field-app-v154{--field-blue:#1570ef;--field-green:#34d399;--field-red:#fb7185;--field-yellow:#facc15;--field-border:rgba(255,255,255,.14);width:min(100%,520px);min-height:min(960px,calc(100dvh - 44px));max-height:calc(100dvh - 44px);margin-inline:auto;position:relative;overflow:hidden;display:grid;grid-template-rows:auto minmax(0,1fr) auto;border-radius:42px;background:radial-gradient(circle at 12% -8%,rgba(0,98,255,.35),transparent 32%),radial-gradient(circle at 86% 4%,rgba(18,183,106,.12),transparent 28%),linear-gradient(145deg,#061b38 0%,#08284e 47%,#06162b 100%);color:#fff;box-shadow:0 34px 90px rgba(6,27,56,.32);isolation:isolate}
.field-app-v154 .field-bg-map{position:absolute;inset:0;pointer-events:none;opacity:.34;background:linear-gradient(115deg,transparent 0 42%,rgba(0,184,255,.18) 43%,transparent 44%),linear-gradient(24deg,transparent 0 55%,rgba(255,255,255,.08) 56%,transparent 57%),radial-gradient(circle at 12% 84%,rgba(0,149,255,.45) 0 1px,transparent 2px),radial-gradient(circle at 70% 22%,rgba(255,255,255,.38) 0 1px,transparent 2px);mask-image:linear-gradient(180deg,transparent 0%,#000 18%,#000 74%,transparent 100%)}
.field-app-v154:after{content:"";position:absolute;left:-18%;right:-20%;bottom:54px;height:160px;pointer-events:none;opacity:.34;background:radial-gradient(ellipse at 55% 85%,rgba(0,98,255,.48),transparent 60%),linear-gradient(165deg,transparent 0 42%,rgba(0,180,255,.35) 43%,transparent 44%),linear-gradient(172deg,transparent 0 56%,rgba(255,255,255,.12) 57%,transparent 58%)}.field-app-v154>*:not(.field-bg-map){position:relative;z-index:1}
.field-app-v154 .field-app-header{padding:28px 28px 12px;display:flex;align-items:start;justify-content:space-between;gap:14px}.field-app-v154 .eyebrow{color:rgba(226,237,255,.72);letter-spacing:.16em}.field-app-v154 .field-app-header h1{color:#fff;font-size:clamp(32px,7vw,46px);line-height:.96;margin:4px 0 8px;letter-spacing:-.06em}.field-app-v154 .page-subtitle{color:rgba(214,229,255,.60);font-weight:650}.field-app-v154 .field-header-actions{display:flex;align-items:center;gap:8px}.field-app-v154 .field-state-pill,.field-app-v154 .field-avatar,.field-app-v154 .field-logout-btn{min-height:42px;border-radius:999px;border:1px solid var(--field-border);background:rgba(255,255,255,.09);color:#fff;font-weight:900;padding:0 14px;display:inline-grid;place-items:center}.field-app-v154 .field-state-pill{white-space:nowrap}.field-app-v154 .field-state-pill.working{color:var(--field-green)}.field-app-v154 .field-avatar{width:46px;padding:0;background:rgba(255,255,255,.12)}.field-app-v154 .field-logout-btn{cursor:pointer}
.field-app-v154 .field-tab-panel{min-height:0;display:none;overflow:hidden;padding:0 24px 96px}.field-app-v154 .field-tab-panel.active{display:grid}.field-app-v154 .field-dashboard,.field-app-v154 .field-timer-view,.field-app-v154 .field-controls-view,.field-app-v154 .field-history-card{min-height:0;display:grid;gap:14px;align-content:start}
.field-app-v154 .field-stat-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.field-app-v154 .field-stat-card{min-height:126px;border-radius:22px;border:1px solid var(--field-border);background:radial-gradient(circle at 50% 20%,rgba(255,255,255,.08),transparent 38%),rgba(255,255,255,.082);display:grid;place-items:center;align-content:center;gap:6px}.field-app-v154 .field-stat-card .stat-icon{width:50px;height:50px;border-radius:999px;display:grid;place-items:center;background:rgba(255,255,255,.08);color:var(--field-blue);font-size:24px}.field-app-v154 .field-stat-card.red .stat-icon{color:var(--field-red);background:rgba(251,113,133,.14)}.field-app-v154 .field-stat-card.green .stat-icon{color:var(--field-green);background:rgba(52,211,153,.14)}.field-app-v154 .field-stat-card strong{font-size:clamp(30px,8vw,44px);line-height:.9;letter-spacing:-.06em}.field-app-v154 .field-stat-card.blue strong{color:#60a5fa}.field-app-v154 .field-stat-card.red strong{color:var(--field-red)}.field-app-v154 .field-stat-card.green strong{color:var(--field-green)}.field-app-v154 .field-stat-card small{color:rgba(226,237,255,.78);font-weight:900}
.field-app-v154 .field-search-card{min-height:56px;display:flex;align-items:center;gap:12px;padding:0 16px;border-radius:20px;border:1px solid var(--field-border);background:rgba(255,255,255,.085)}.field-app-v154 .field-search-card .search-icon{font-size:30px;color:rgba(226,237,255,.78)}.field-app-v154 #fieldTaskSearch{min-width:0;width:100%;border:0;outline:0;background:transparent;color:#fff;font-size:16px;font-weight:750;box-shadow:none}.field-app-v154 #fieldTaskSearch::placeholder{color:rgba(226,237,255,.48)}
.field-app-v154 .field-filter-pills{display:flex;gap:8px;overflow-x:auto;padding:0 0 2px;scrollbar-width:none}.field-app-v154 .field-filter-pills::-webkit-scrollbar{display:none}.field-app-v154 .field-filter-pill{min-height:44px;white-space:nowrap;border-radius:999px;border:1px solid var(--field-border);background:rgba(255,255,255,.08);color:rgba(226,237,255,.78);padding:0 18px;font-weight:950;font-size:15px}.field-app-v154 .field-filter-pill.active{background:linear-gradient(135deg,#1683ff,#005cff);color:#fff;border-color:transparent;box-shadow:0 14px 28px rgba(0,98,255,.24)}.field-app-v154 .field-list-head{display:flex;align-items:center;justify-content:space-between;gap:12px;color:rgba(226,237,255,.72)}.field-app-v154 .field-list-head strong{color:rgba(255,255,255,.86);font-size:18px}.field-app-v154 .field-list-head span{color:rgba(226,237,255,.58);font-weight:750;font-size:13px}
.field-app-v154 .field-task-cards{min-height:0;max-height:calc(100dvh - 436px);overflow-y:auto;display:grid;gap:12px;padding:0 4px 16px 0;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.22) transparent}.field-app-v154 .field-task-card{display:grid;grid-template-columns:56px minmax(0,1fr);gap:14px;align-items:start;padding:16px;border-radius:22px;border:1px solid var(--field-border);border-left:4px solid rgba(96,165,250,.75);background:rgba(255,255,255,.08)}.field-app-v154 .field-task-card.is-featured{border-left-color:#2f9bff;background:rgba(255,255,255,.10)}.field-app-v154 .field-task-card.is-urgent{border-left-color:var(--field-red)}.field-app-v154 .field-task-card.is-done{border-left-color:var(--field-green);opacity:.78}.field-app-v154 .field-card-icon{width:52px;height:52px;border-radius:999px;display:grid;place-items:center;background:rgba(21,112,239,.18);color:#60a5fa;border:1px solid rgba(96,165,250,.18);font-size:26px}.field-app-v154 .field-card-body{min-width:0;display:grid;gap:10px}.field-app-v154 .field-task-main{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:start}.field-app-v154 .field-task-main strong{display:block;color:#fff;font-size:18px;line-height:1.15;letter-spacing:-.02em}.field-app-v154 .field-task-main span{display:block;margin-top:4px;color:rgba(226,237,255,.63);line-height:1.32;font-weight:680}.field-app-v154 .field-card-meta{display:flex;flex-wrap:wrap;gap:8px}.field-app-v154 .field-card-meta span{display:inline-flex;align-items:center;gap:4px;min-height:28px;padding:0 10px;border-radius:999px;background:rgba(255,255,255,.08);color:rgba(226,237,255,.70);font-size:12px;font-weight:850}
.field-app-v154 .field-status{white-space:nowrap;border-radius:999px;padding:7px 10px;background:rgba(250,204,21,.16);color:var(--field-yellow);font-style:normal;font-size:12px;font-weight:950}.field-app-v154 .field-status.verify,.field-app-v154 .field-status.alert{background:rgba(251,113,133,.16);color:var(--field-red)}.field-app-v154 .field-status.working{background:rgba(250,204,21,.16);color:var(--field-yellow)}.field-app-v154 .field-status.done{background:rgba(52,211,153,.14);color:var(--field-green)}.field-app-v154 .field-task-action,.field-app-v154 .field-submit-btn{min-height:54px;border:0;border-radius:18px;background:linear-gradient(135deg,#1683ff,#005cff);color:#fff;font-size:16px;font-weight:950;box-shadow:0 16px 32px rgba(0,98,255,.25)}
.field-app-v154 .field-timer-view,.field-app-v154 .field-controls-view,.field-app-v154 .field-history-card{overflow-y:auto;max-height:calc(100dvh - 170px);padding-right:4px;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.22) transparent}.field-app-v154 .field-timer-hero{min-height:278px;position:relative;overflow:hidden;display:grid;place-items:center;align-content:center;gap:8px;padding:22px;border-radius:28px;border:1px solid rgba(96,165,250,.34);background:radial-gradient(circle at 50% 56%,rgba(52,211,153,.16),transparent 24%),radial-gradient(circle at 90% 80%,rgba(0,98,255,.40),transparent 34%),linear-gradient(145deg,#041226,#0b356b)}.field-app-v154 .field-timer-map{position:absolute;inset:0;opacity:.42;background:linear-gradient(156deg,transparent 0 52%,rgba(0,198,255,.55) 53%,transparent 55%),linear-gradient(28deg,transparent 0 35%,rgba(255,255,255,.10) 36%,transparent 37%),radial-gradient(circle at 74% 69%,rgba(255,255,255,.9) 0 1px,transparent 2px),radial-gradient(circle at 82% 58%,rgba(0,198,255,.8) 0 1px,transparent 2px);mask-image:linear-gradient(180deg,transparent 0%,#000 18%,#000 92%)}.field-app-v154 .field-timer-status{z-index:1;min-height:34px;display:inline-flex;align-items:center;padding:0 18px;border-radius:999px;border:1px solid var(--field-border);background:rgba(255,255,255,.08);color:var(--field-green);letter-spacing:.14em;font-size:12px;font-weight:950}.field-app-v154 .field-timer-status.working{color:#facc15}.field-app-v154 .timer-clock{z-index:1;margin:0;padding:0;background:transparent;box-shadow:none;border:0;color:#fff;font-size:clamp(58px,18vw,94px);line-height:.98;letter-spacing:-.07em;text-shadow:0 16px 40px rgba(0,0,0,.32)}.field-app-v154 .field-timer-units{z-index:1;display:grid;grid-template-columns:repeat(3,1fr);width:min(420px,85%);color:rgba(226,237,255,.64);font-weight:850;letter-spacing:.10em;text-align:center;font-size:12px}.field-app-v154 .field-play-btn{z-index:1;width:76px;height:76px;border:0;border-radius:999px;display:grid;place-items:center;background:linear-gradient(135deg,#34d399,#10b981);color:#fff;font-size:30px;box-shadow:0 20px 44px rgba(16,185,129,.35);cursor:pointer}.field-app-v154 .field-play-btn.is-running{background:linear-gradient(135deg,#facc15,#f59e0b);box-shadow:0 20px 44px rgba(245,158,11,.25)}.field-app-v154 #quickTimerLabel{z-index:1;color:#fff;font-size:17px}
.field-app-v154 .field-current-card,.field-app-v154 .field-form-card,.field-app-v154 .field-controls-view,.field-app-v154 .field-history-card{border-radius:24px;border:1px solid var(--field-border);background:rgba(255,255,255,.075);padding:18px}.field-app-v154 .field-current-card{display:grid;grid-template-columns:62px minmax(0,1fr);gap:14px;align-items:center}.field-app-v154 .field-current-icon{width:62px;height:62px;border-radius:999px;display:grid;place-items:center;border:1px dashed rgba(226,237,255,.42);color:rgba(226,237,255,.78);font-size:30px}.field-app-v154 .field-current-card h2,.field-app-v154 .field-section-head h2{margin:0;color:#fff;font-size:21px}.field-app-v154 .field-current-card p,.field-app-v154 .field-section-head p{margin:4px 0 0;color:rgba(226,237,255,.64)}.field-app-v154 .field-form-card{display:grid;gap:16px}.field-app-v154 .field-form-section{display:grid;gap:9px}.field-app-v154 .field-form-title,.field-app-v154 .field-form-card label{color:rgba(226,237,255,.78);font-weight:900;letter-spacing:.02em}.field-app-v154 .field-form-title{margin:0;text-transform:uppercase;font-size:12px;letter-spacing:.12em}.field-app-v154 .field-form-title span,.field-app-v154 .field-form-card label span{color:var(--field-blue);margin-right:6px}.field-app-v154 .field-type-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.field-app-v154 .type-pill{min-height:48px;border-radius:16px;border:1px solid rgba(226,237,255,.25);background:rgba(255,255,255,.06);color:#fff;padding:0 12px}.field-app-v154 .type-pill.is-selected{background:rgba(21,112,239,.32);border-color:#1683ff}.field-app-v154 .field-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.field-app-v154 .field-form-card input,.field-app-v154 .field-form-card select,.field-app-v154 .field-form-card textarea,.field-app-v154 .field-controls-view input,.field-app-v154 .field-controls-view select,.field-app-v154 .field-controls-view textarea{width:100%;min-height:52px;border-radius:16px;border:1px solid rgba(226,237,255,.20);background:rgba(255,255,255,.055);color:#fff;padding:0 14px;outline:none}.field-app-v154 .field-form-card textarea,.field-app-v154 .field-controls-view textarea{padding-top:12px}.field-app-v154 .field-form-card select option,.field-app-v154 .field-controls-view select option{color:#061b38}.field-app-v154 .field-form-card input::placeholder,.field-app-v154 .field-form-card textarea::placeholder,.field-app-v154 .field-controls-view input::placeholder,.field-app-v154 .field-controls-view textarea::placeholder{color:rgba(226,237,255,.42)}.field-app-v154 .field-controls-list{display:grid;gap:12px;margin-top:14px}.field-app-v154 .control-row{background:rgba(255,255,255,.07);border-color:var(--field-border);border-radius:20px;color:#fff}.field-app-v154 .control-row h2,.field-app-v154 .control-row .eyebrow{color:#fff}.field-app-v154 .field-history-card .table-scroll{border-radius:18px;background:rgba(255,255,255,.96)}
.field-app-v154 .field-bottom-nav{position:absolute;left:14px;right:14px;bottom:14px;min-height:72px;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;padding:8px;border-radius:26px;background:rgba(7,25,50,.72);border:1px solid rgba(255,255,255,.14);backdrop-filter:blur(20px);box-shadow:0 20px 48px rgba(0,0,0,.28)}.field-app-v154 .field-bottom-tab{min-width:0;border:0;border-radius:18px;background:transparent;color:rgba(226,237,255,.58);display:grid;place-items:center;align-content:center;gap:2px;text-decoration:none;font-weight:850;cursor:pointer}.field-app-v154 .field-bottom-tab span{font-size:19px;line-height:1}.field-app-v154 .field-bottom-tab em{font-style:normal;font-size:10px}.field-app-v154 .field-bottom-tab.active{background:linear-gradient(135deg,rgba(0,98,255,.92),rgba(0,73,200,.82));color:#fff;box-shadow:0 10px 24px rgba(0,98,255,.26)}
@media (min-width:860px){.field-app-shell.field-app-v154{width:min(100%,760px)}.field-app-v154 .field-task-cards{max-height:calc(100dvh - 470px)}}@media (max-width:620px){.timer-page .timer-shell{padding:0}.field-app-shell.field-app-v154{width:100%;min-height:100dvh;max-height:100dvh;border-radius:0}.field-app-v154 .field-app-header{padding:20px 16px 10px}.field-app-v154 .field-tab-panel{padding:0 14px 92px}.field-app-v154 .field-stat-grid{gap:10px}.field-app-v154 .field-stat-card{min-height:108px;border-radius:20px}.field-app-v154 .field-stat-card .stat-icon{width:42px;height:42px}.field-app-v154 .field-task-cards{max-height:calc(100dvh - 410px)}.field-app-v154 .field-task-card{grid-template-columns:1fr}.field-app-v154 .field-card-icon{display:none}.field-app-v154 .field-task-main{grid-template-columns:1fr}.field-app-v154 .field-status{justify-self:start}.field-app-v154 .field-form-grid,.field-app-v154 .field-type-grid{grid-template-columns:1fr}.field-app-v154 .field-bottom-nav{left:10px;right:10px;bottom:10px}.field-app-v154 .field-bottom-tab em{font-size:9px}}@media (max-width:380px){.field-app-v154 .field-stat-card strong{font-size:28px}.field-app-v154 .field-stat-card small{font-size:11px}.field-app-v154 .field-bottom-nav{gap:4px}}


/* RCH Office v0.15.5 — performance tuning + Ferris wheel background */
.field-app-shell.field-app-v154 {
  background:
    linear-gradient(148deg, #072d6a 0%, #07315e 42%, #082743 100%);
  box-shadow: 0 22px 56px rgba(6, 27, 56, .22);
}

.field-app-v154 .field-bg-map {
  opacity: .52;
  background-image: url("../assets/rimini-wheel-bg.svg");
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: cover;
  mask-image: none;
}

.field-app-shell.field-app-v154::after {
  display: none;
}

.field-app-v154 .field-bottom-nav {
  background: rgba(7, 25, 50, .92);
  backdrop-filter: none;
  box-shadow: 0 12px 28px rgba(0,0,0,.22);
}

.field-app-v154 .field-stat-card,
.field-app-v154 .field-search-card,
.field-app-v154 .field-task-card,
.field-app-v154 .field-current-card,
.field-app-v154 .field-form-card,
.field-app-v154 .field-controls-view,
.field-app-v154 .field-history-card,
.field-app-v154 .field-timer-hero {
  box-shadow: none;
}

.field-app-v154 .field-task-cards,
.field-app-v154 .field-timer-view,
.field-app-v154 .field-controls-view,
.field-app-v154 .field-history-card,
.field-app-v154 .field-tab-panel {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: auto;
}

.field-app-v154 .field-task-card {
  content-visibility: auto;
  contain-intrinsic-size: 220px;
  contain: layout paint style;
}

.field-app-v154 .field-task-cards {
  overscroll-behavior: contain;
}

.field-app-v154 .field-task-action,
.field-app-v154 .field-submit-btn,
.field-app-v154 .field-bottom-tab,
.field-app-v154 .field-filter-pill,
.field-app-v154 .field-play-btn,
.field-app-v154 .field-logout-btn {
  transition: background-color .14s ease, color .14s ease, border-color .14s ease, opacity .14s ease;
}

.field-app-v154 .field-load-more {
  min-height: 52px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color: #fff;
  font-weight: 900;
}

.field-app-v154 .field-controls-view {
  align-content: start;
}

.field-app-v154 .control-row,
.field-app-v154 .field-history-card .table-scroll {
  content-visibility: auto;
}

@media (prefers-reduced-motion: reduce) {
  .field-app-v154 *,
  .field-app-v154 *::before,
  .field-app-v154 *::after {
    animation: none;
    transition: none;
    scroll-behavior: auto;
  }
}


/* RCH Office v0.15.6 — revisione grafica Timer accertatori */

/* La tab Timer viene forzata in un flusso ordinato: timer sopra, stato sotto, form sotto.
   Evita composizioni laterali sbilanciate su desktop/tablet e il timer non viene più tagliato. */
.field-app-v154 [data-field-panel="timer"].active {
  min-height: 0;
}

.field-app-v154 .field-timer-view {
  grid-template-columns: 1fr;
  align-content: start;
  gap: 16px;
  max-height: calc(100dvh - 178px);
  overflow-x: hidden;
  padding-right: 2px;
}

.field-app-v154 .field-timer-hero,
.field-app-v154 .field-current-card,
.field-app-v154 #startForm,
.field-app-v154 #endForm {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
}

/* Timer hero più proporzionato e leggibile */
.field-app-v154 .field-timer-hero {
  min-height: 238px;
  padding: 18px 18px 20px;
  gap: 8px;
  border-radius: 26px;
  justify-items: center;
  align-content: center;
}

.field-app-v154 .field-timer-status {
  min-height: 32px;
  padding: 0 14px;
  font-size: 11px;
  letter-spacing: .13em;
}

.field-app-v154 .timer-clock {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-align: center;
  font-size: clamp(46px, 11vw, 78px);
  line-height: .96;
  letter-spacing: -.065em;
  white-space: nowrap;
}

.field-app-v154 .field-timer-units {
  width: min(360px, 86%);
  font-size: 11px;
  letter-spacing: .08em;
}

.field-app-v154 .field-play-btn {
  width: 66px;
  height: 66px;
  font-size: 25px;
}

.field-app-v154 #quickTimerLabel {
  font-size: 15px;
  font-weight: 950;
}

/* Stato corrente più compatto e allineato */
.field-app-v154 .field-current-card {
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 15px;
  border-radius: 22px;
}

.field-app-v154 .field-current-icon {
  width: 52px;
  height: 52px;
  font-size: 25px;
}

.field-app-v154 .field-current-card h2 {
  font-size: clamp(18px, 4vw, 22px);
  line-height: 1.08;
  letter-spacing: -.035em;
}

.field-app-v154 .field-current-card p {
  font-size: 14px;
  line-height: 1.28;
}

/* Form Timer: campi più leggibili e meno “pesanti” */
.field-app-v154 .field-form-card {
  gap: 14px;
  padding: 16px;
  border-radius: 22px;
}

.field-app-v154 .field-form-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
  color: rgba(226,237,255,.82);
}

.field-app-v154 .field-form-card label {
  display: grid;
  gap: 8px;
  color: rgba(226,237,255,.80);
  font-size: 13px;
  line-height: 1.2;
}

.field-app-v154 .field-form-card small {
  color: rgba(226,237,255,.58);
  font-size: 12px;
  font-weight: 750;
}

.field-app-v154 .field-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.field-app-v154 .field-form-card input,
.field-app-v154 .field-form-card select,
.field-app-v154 .field-form-card textarea {
  min-height: 48px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 750;
}

.field-app-v154 .field-form-card textarea {
  min-height: 92px;
  line-height: 1.35;
}

/* Tipologie attività: da checkbox grandi a pill compatte */
.field-app-v154 .field-type-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.field-app-v154 .type-pill {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  border-radius: 15px;
  padding: 0 12px;
  color: rgba(255,255,255,.90);
  font-size: 14px;
  line-height: 1.15;
  font-weight: 900;
  background: rgba(255,255,255,.065);
  border: 1px solid rgba(226,237,255,.18);
  overflow: hidden;
}

.field-app-v154 .type-pill input {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 5px;
  border: 2px solid rgba(226,237,255,.55);
  background: rgba(255,255,255,.08);
  margin: 0;
  display: grid;
  place-items: center;
}

.field-app-v154 .type-pill input:checked {
  border-color: #1683ff;
  background: #1683ff;
  box-shadow: 0 0 0 4px rgba(22,131,255,.14);
}

.field-app-v154 .type-pill input:checked::after {
  content: "✓";
  color: #fff;
  font-size: 13px;
  line-height: 1;
  font-weight: 950;
}

.field-app-v154 .type-pill span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.field-app-v154 .type-pill.is-selected {
  background: rgba(22,131,255,.22);
  border-color: rgba(22,131,255,.82);
  color: #fff;
}

/* Pulsanti finali più proporzionati */
.field-app-v154 .field-submit-btn {
  min-height: 56px;
  border-radius: 17px;
  font-size: 16px;
}

/* La tab controlli usa tutta l’altezza in modo più equilibrato */
.field-app-v154 .field-controls-view {
  min-height: min(560px, calc(100dvh - 220px));
  align-content: start;
}

.field-app-v154 .field-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
}

/* Mobile stretto */
@media (max-width: 620px) {
  .field-app-v154 .field-timer-view {
    max-height: calc(100dvh - 158px);
  }

  .field-app-v154 .field-timer-hero {
    min-height: 228px;
    padding: 16px;
  }

  .field-app-v154 .timer-clock {
    font-size: clamp(44px, 16vw, 68px);
  }

  .field-app-v154 .field-current-card {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .field-app-v154 .field-current-icon {
    width: 46px;
    height: 46px;
  }

  .field-app-v154 .field-form-grid,
  .field-app-v154 .field-type-grid {
    grid-template-columns: 1fr;
  }

  .field-app-v154 .field-section-head {
    grid-template-columns: 1fr;
  }
}

/* Desktop/tablet largo: manteniamo una mini-app leggibile, non una dashboard stirata */
@media (min-width: 860px) {
  .field-app-shell.field-app-v154 {
    width: min(100%, 680px);
  }

  .field-app-v154 .field-timer-hero {
    min-height: 250px;
  }

  .field-app-v154 .timer-clock {
    font-size: clamp(58px, 7.4vw, 82px);
  }
}


/* RCH Office v0.16 — Import richieste Inbox */

body[data-rch-ui="v2"] .rch-inbox-functional .toolbar-actions {
  align-items: center;
}

.rch-import-help {
  margin: 0;
  padding: 18px;
  box-shadow: none;
}

.drawer-panel-wide {
  width: min(920px, calc(100vw - 28px));
}

.rch-import-preview-list {
  display: grid;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}

.rch-import-preview-list article {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid #dbe7f5;
  border-radius: 14px;
  background: #f8fbff;
}

.rch-import-preview-list b {
  color: #0f172a;
  font-size: 14px;
}

.rch-import-preview-list span {
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
}

#inboxImportText {
  min-height: 280px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .drawer-panel-wide {
    width: min(100vw, 100%);
  }

  #inboxImportText {
    min-height: 220px;
  }
}


/* RCH Office v0.17.0 — OCR fascicolo multiplo + Task team */

.drawer-panel-xwide {
  width: min(1120px, calc(100vw - 24px));
}

.rch-ocr-shell {
  display: grid;
  gap: 18px;
}

.rch-ocr-step {
  display: grid;
  gap: 16px;
}

.rch-ocr-step + .rch-ocr-step {
  padding-top: 18px;
  border-top: 1px solid #e6edf6;
}

.rch-ocr-step-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.rch-ocr-step-head > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #eaf2ff;
  color: #1265d6;
  font-weight: 950;
}

.rch-ocr-step-head div {
  display: grid;
  gap: 2px;
}

.rch-ocr-step-head strong {
  color: #0f172a;
  font-size: 18px;
}

.rch-ocr-step-head small {
  color: #667085;
}

.rch-ocr-dropzone {
  min-height: 150px;
  border: 2px dashed #a8c4e7;
  border-radius: 22px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 22px;
  text-align: center;
  background: linear-gradient(145deg, #f8fbff, #eef5ff);
  cursor: pointer;
}

.rch-ocr-dropzone input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rch-ocr-dropzone strong {
  color: #123b6f;
  font-size: 18px;
}

.rch-ocr-dropzone span {
  max-width: 620px;
  color: #667085;
  line-height: 1.45;
}

.rch-ocr-file-list {
  display: grid;
  gap: 8px;
}

.rch-ocr-file-list article {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 13px;
  border: 1px solid #dce7f3;
  border-radius: 15px;
  background: #fff;
}

.rch-ocr-file-list article > span {
  width: 44px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #eaf2ff;
  color: #1265d6;
  font-size: 11px;
  font-weight: 950;
}

.rch-ocr-file-list article div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.rch-ocr-file-list article strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rch-ocr-file-list article small,
.rch-ocr-file-list article em,
.rch-ocr-empty {
  color: #667085;
  font-size: 12px;
  font-style: normal;
}

.rch-ocr-practice-list {
  display: grid;
  gap: 16px;
}

.rch-ocr-practice {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid #dbe7f5;
  border-radius: 22px;
  background: #f9fbfe;
}

.rch-ocr-practice-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.rch-ocr-practice-head h3 {
  margin: 2px 0 0;
  color: #0f172a;
  font-size: 20px;
}

.rch-ocr-subsection,
.rch-ocr-task-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #dbe7f5;
  border-radius: 17px;
  background: #fff;
}

.rch-ocr-task-box {
  background: #f4f8ff;
  border-color: #cfe0f5;
}

.rch-ocr-movements {
  display: grid;
  gap: 8px;
}

.rch-ocr-movements article {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 13px;
  background: #f7f9fc;
}

.rch-ocr-movements span,
.rch-ocr-movements small {
  color: #667085;
}

.rch-ocr-sources {
  border: 1px solid #dbe7f5;
  border-radius: 15px;
  background: #fff;
  padding: 12px 14px;
}

.rch-ocr-sources summary {
  cursor: pointer;
  color: #123b6f;
  font-weight: 850;
}

.rch-ocr-sources p {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px;
  margin: 9px 0 0;
  padding-top: 9px;
  border-top: 1px solid #eef2f7;
}

.rch-ocr-sources p small {
  grid-column: 2;
  color: #667085;
}

.rch-ocr-warning {
  padding: 11px 13px;
  border: 1px solid #f4c7c2;
  border-radius: 14px;
  background: #fff3f1;
  color: #9f2d20;
}

.rch-tasks-hero {
  background: linear-gradient(145deg, #f8fbff, #eef5ff);
}

#taskTableBody select {
  min-width: 150px;
}

.text-alert {
  color: #b42318;
  font-weight: 850;
}

.row-alert {
  background: #fff8f6;
}

.badge.success {
  background: #e8f8f0;
  color: #087443;
}

@media (max-width: 760px) {
  .drawer-panel-xwide {
    width: 100%;
  }

  .rch-ocr-practice-head {
    display: grid;
  }

  .rch-ocr-sources p {
    grid-template-columns: 1fr;
  }

  .rch-ocr-sources p small {
    grid-column: 1;
  }
}


/* --------------------------------------------------------------------------
   SOURCE: rch-office-v0-17-6.css
   -------------------------------------------------------------------------- */
/* ==========================================================================
   RCH Office v0.17.6 — Stabilizzazione grafica globale Office
   Corregge topbar compressa, titoli spezzati, spazi vuoti, KPI e filtri.
   ========================================================================== */

:root {
  --rch176-sidebar: 258px;
  --rch176-content-gap: 14px;
  --rch176-panel-radius: 20px;
  --rch176-control-height: 46px;
}

html,
body[data-rch-ui="v2"] {
  overflow-x: hidden;
}

body[data-rch-ui="v2"] .office-shell {
  width: 100%;
  min-width: 0;
  grid-template-columns: var(--rch176-sidebar) minmax(0, 1fr);
}

body[data-rch-ui="v2"] .office-sidebar {
  width: var(--rch176-sidebar);
  min-width: var(--rch176-sidebar);
}

body[data-rch-ui="v2"] .office-main {
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Topbar: assegna uno spazio reale al titolo e consente alle azioni di andare
   ordinatamente su più righe, senza comprimere ogni parola.
   -------------------------------------------------------------------------- */

body[data-rch-ui="v2"] .office-topbar {
  position: sticky;
  top: 0;
  z-index: 70;
  min-height: 104px;
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  align-items: start;
  gap: 20px;
  padding: 16px 22px;
  overflow: visible;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #dce6f2;
  backdrop-filter: blur(14px);
}

body[data-rch-ui="v2"] .office-topbar > :first-child {
  min-width: 0;
  max-width: 300px;
}

body[data-rch-ui="v2"] .office-topbar .eyebrow {
  margin-bottom: 5px;
  font-size: 11px;
  letter-spacing: 0.13em;
}

body[data-rch-ui="v2"] #pageTitle {
  margin: 0;
  max-width: 100%;
  color: #0f172a;
  font-size: clamp(27px, 2.2vw, 34px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

body[data-rch-ui="v2"] #pageSubtitle {
  margin-top: 6px;
  max-width: 300px;
  color: #62718a;
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: normal;
  word-break: normal;
}

body[data-rch-ui="v2"] .topbar-actions {
  min-width: 0;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: flex-start;
  justify-content: flex-end;
  gap: 8px;
}

body[data-rch-ui="v2"] .topbar-actions > * {
  flex: 0 0 auto;
  max-width: 100%;
}

body[data-rch-ui="v2"] .scope-control {
  flex: 1 1 310px;
  min-width: 270px;
  max-width: 390px;
  min-height: var(--rch176-control-height);
  padding: 5px 7px 5px 13px;
  border-radius: 999px;
}

body[data-rch-ui="v2"] .scope-control select {
  min-width: 0;
  height: 38px;
}

body[data-rch-ui="v2"] .topbar-actions .status-chip,
body[data-rch-ui="v2"] .topbar-actions .user-chip,
body[data-rch-ui="v2"] .topbar-actions .btn {
  min-height: var(--rch176-control-height);
  padding-inline: 13px;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Contenuto e pannelli
   -------------------------------------------------------------------------- */

body[data-rch-ui="v2"] .office-content {
  width: 100%;
  max-width: 1760px;
  margin-inline: auto;
  padding: 20px 24px 40px;
}

body[data-rch-ui="v2"] .office-view {
  min-width: 0;
}

body[data-rch-ui="v2"] .office-view.active {
  display: grid;
  gap: var(--rch176-content-gap);
}

body[data-rch-ui="v2"] .panel,
body[data-rch-ui="v2"] .section-intro,
body[data-rch-ui="v2"] .table-panel,
body[data-rch-ui="v2"] .scope-banner {
  border-radius: var(--rch176-panel-radius);
}

body[data-rch-ui="v2"] .section-intro {
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
}

body[data-rch-ui="v2"] .section-intro h2 {
  margin: 2px 0 5px;
  font-size: clamp(21px, 2vw, 28px);
  line-height: 1.15;
}

body[data-rch-ui="v2"] .section-intro p {
  margin: 0;
  max-width: 940px;
  line-height: 1.42;
}

body[data-rch-ui="v2"] .section-intro .toolbar-actions {
  width: auto;
  justify-content: flex-end;
}

/* Inbox: evita il grande riquadro quasi vuoto e allinea le azioni. */
body[data-rch-ui="v2"] #view-inbox .rch-inbox-hero {
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 240px);
}

body[data-rch-ui="v2"] #view-inbox .rch-inbox-hero .toolbar-actions {
  display: grid;
  grid-template-columns: 1fr;
  align-self: stretch;
  align-content: center;
  gap: 8px;
}

body[data-rch-ui="v2"] #view-inbox .rch-inbox-hero .toolbar-actions .btn {
  width: 100%;
  min-height: 42px;
}

/* KPI: griglia fluida. Gli otto KPI accertatori entrano su una riga quando
   lo spazio lo consente, senza lasciare due schede isolate sotto. */
body[data-rch-ui="v2"] .kpi-grid,
body[data-rch-ui="v2"] .rch-compact-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 12px;
}

body[data-rch-ui="v2"] .kpi-card {
  min-width: 0;
  min-height: 112px;
  padding: 17px 18px;
  border-radius: 18px;
}

body[data-rch-ui="v2"] .kpi-card small {
  font-size: 11px;
  line-height: 1.2;
}

body[data-rch-ui="v2"] .kpi-card strong,
body[data-rch-ui="v2"] .rch-compact-kpis .kpi-card strong {
  margin-top: 6px;
  font-size: clamp(29px, 3vw, 40px);
  line-height: 1;
}

body[data-rch-ui="v2"] .kpi-card span {
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.25;
}

/* --------------------------------------------------------------------------
   Filtri e tabelle
   -------------------------------------------------------------------------- */

body[data-rch-ui="v2"] .table-toolbar,
body[data-rch-ui="v2"] .audit-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px 16px;
}

body[data-rch-ui="v2"] .toolbar-main {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 9px;
}

body[data-rch-ui="v2"] .toolbar-main > input,
body[data-rch-ui="v2"] .toolbar-main > select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
}

body[data-rch-ui="v2"] .toolbar-actions {
  width: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

body[data-rch-ui="v2"] .toolbar-actions .btn {
  flex: 0 0 auto;
  min-height: 44px;
}

/* Report accertatori: sfrutta l'intera riga per gli otto filtri. */
body[data-rch-ui="v2"] #view-fieldwork .table-toolbar {
  grid-template-columns: minmax(0, 1fr);
}

body[data-rch-ui="v2"] #view-fieldwork .toolbar-main {
  grid-template-columns: repeat(4, minmax(165px, 1fr));
}

body[data-rch-ui="v2"] #view-fieldwork .toolbar-actions {
  justify-content: flex-start;
}

body[data-rch-ui="v2"] #view-fieldwork .fieldwork-hero-actions {
  display: flex;
  width: auto;
  flex-wrap: wrap;
}

body[data-rch-ui="v2"] .table-scroll {
  max-width: 100%;
  overflow: auto;
  scrollbar-gutter: stable;
}

body[data-rch-ui="v2"] .data-table {
  min-width: 760px;
}

body[data-rch-ui="v2"] .data-table th,
body[data-rch-ui="v2"] .data-table td {
  padding: 11px 12px;
}

/* Sidebar: più compatta, ma con footer sempre leggibile. */
body[data-rch-ui="v2"] .office-sidebar {
  gap: 10px;
  padding: 18px 13px 12px;
}

body[data-rch-ui="v2"] .office-brand {
  padding-inline: 8px;
}

body[data-rch-ui="v2"] .office-nav {
  gap: 4px;
}

body[data-rch-ui="v2"] .office-nav .nav-item {
  min-height: 43px;
  padding: 8px 10px;
  border-radius: 12px;
}

body[data-rch-ui="v2"] .sidebar-footer {
  gap: 7px;
}

body[data-rch-ui="v2"] .sidebar-footer .btn {
  min-height: 41px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1450px) {
  body[data-rch-ui="v2"] .office-topbar {
    grid-template-columns: minmax(220px, 270px) minmax(0, 1fr);
  }

  body[data-rch-ui="v2"] .scope-control {
    flex-basis: 280px;
    max-width: 340px;
  }

  body[data-rch-ui="v2"] #view-fieldwork .toolbar-main {
    grid-template-columns: repeat(3, minmax(175px, 1fr));
  }
}

@media (max-width: 1180px) {
  body[data-rch-ui="v2"] .office-shell {
    grid-template-columns: 226px minmax(0, 1fr);
  }

  body[data-rch-ui="v2"] .office-sidebar {
    width: 226px;
    min-width: 226px;
  }

  body[data-rch-ui="v2"] .office-topbar {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  body[data-rch-ui="v2"] .office-topbar > :first-child {
    max-width: 620px;
  }

  body[data-rch-ui="v2"] #pageSubtitle {
    max-width: 620px;
  }

  body[data-rch-ui="v2"] .topbar-actions {
    justify-content: flex-start;
  }

  body[data-rch-ui="v2"] #view-fieldwork .toolbar-main {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 880px) {
  body[data-rch-ui="v2"] .office-shell {
    display: block;
  }

  body[data-rch-ui="v2"] .office-sidebar {
    width: min(86vw, 340px);
    min-width: 0;
  }

  body[data-rch-ui="v2"] .office-topbar {
    padding: 13px 14px;
  }

  body[data-rch-ui="v2"] .office-content {
    padding: 14px 12px 34px;
  }

  body[data-rch-ui="v2"] .section-intro,
  body[data-rch-ui="v2"] #view-inbox .rch-inbox-hero {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  body[data-rch-ui="v2"] .section-intro .toolbar-actions,
  body[data-rch-ui="v2"] #view-inbox .rch-inbox-hero .toolbar-actions {
    width: 100%;
    display: flex;
    justify-content: flex-start;
  }

  body[data-rch-ui="v2"] #view-inbox .rch-inbox-hero .toolbar-actions .btn {
    width: auto;
  }

  body[data-rch-ui="v2"] .table-toolbar,
  body[data-rch-ui="v2"] .audit-toolbar {
    grid-template-columns: 1fr;
  }

  body[data-rch-ui="v2"] .toolbar-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  body[data-rch-ui="v2"] #pageTitle {
    font-size: 27px;
  }

  body[data-rch-ui="v2"] .scope-control {
    min-width: 100%;
    max-width: none;
    flex-basis: 100%;
  }

  body[data-rch-ui="v2"] .topbar-actions > * {
    flex: 1 1 calc(50% - 5px);
  }

  body[data-rch-ui="v2"] .topbar-actions .scope-control,
  body[data-rch-ui="v2"] .topbar-actions .user-chip {
    flex-basis: 100%;
  }

  body[data-rch-ui="v2"] .kpi-grid,
  body[data-rch-ui="v2"] .rch-compact-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-rch-ui="v2"] #view-fieldwork .toolbar-main,
  body[data-rch-ui="v2"] .toolbar-main {
    grid-template-columns: 1fr;
  }

  body[data-rch-ui="v2"] .toolbar-actions .btn {
    flex: 1 1 calc(50% - 5px);
  }

  body[data-rch-ui="v2"] .data-table {
    min-width: 680px;
  }
}
