/* =====================================================================
   Guardian SST â€” Design system
   ===================================================================== */
:root {
    --bg: #f3f6fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --ink: #0f172a;
    --ink-2: #334155;
    --muted: #64748b;
    --muted-2: #94a3b8;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --navy: #0b1426;
    --navy-2: #111f38;
    --primary: #2563eb;
    --primary-600: #1d4ed8;
    --primary-soft: #eff6ff;
    --accent: #10b981;
    --accent-soft: #ecfdf5;
    --warning: #f59e0b;
    --warning-soft: #fffbeb;
    --danger: #ef4444;
    --danger-soft: #fef2f2;
    --info: #0ea5e9;
    --info-soft: #f0f9ff;
    --purple: #8b5cf6;
    --purple-soft: #f5f3ff;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow: 0 10px 30px rgba(15, 23, 42, .07);
    --shadow-lg: 0 24px 60px rgba(15, 23, 42, .14);
    --sidebar-w: 278px;
    --sidebar-w-collapsed: 84px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-600); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.02em; }
p { margin: 0; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }
img { max-width: 100%; }

/* ---------------------------------------------------------------------
   Shell
   --------------------------------------------------------------------- */
.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--navy) 0%, #0a1220 100%);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    z-index: 50;
    transition: transform .25s ease, width .25s ease;
    overflow: hidden;
}
.sidebar::after {
    content: '';
    position: absolute;
    top: -120px; right: -100px;
    width: 280px; height: 280px;
    background: radial-gradient(circle, rgba(37,99,235,.32), transparent 65%);
    pointer-events: none;
}
.sidebar-brand { padding: 22px 20px 14px; position: relative; z-index: 1; }
.brand-link { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand-link:hover { color: #fff; }
.brand-mark {
    width: 44px; height: 44px; min-width: 44px;
    border-radius: 13px;
    background: linear-gradient(135deg, #2563eb, #10b981);
    display: grid; place-items: center;
    font-size: 20px; color: #fff;
    box-shadow: 0 8px 20px rgba(37, 99, 235, .35);
}
.brand-text { display: flex; flex-direction: column; white-space: nowrap; }
.brand-text strong { font-size: 18px; letter-spacing: -.03em; }
.brand-text strong span { color: #34d399; }
.brand-text small { font-size: 10px; color: #7c8ba3; text-transform: uppercase; letter-spacing: .09em; }

.tenant-chip {
    margin: 4px 16px 18px;
    padding: 11px 12px;
    display: flex; align-items: center; gap: 10px;
    background: rgba(255,255,255,.055);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    position: relative; z-index: 1;
}
.tenant-avatar {
    width: 34px; height: 34px; min-width: 34px;
    display: grid; place-items: center;
    border-radius: 9px;
    background: rgba(52, 211, 153, .14);
    color: #6ee7b7;
    font-weight: 700; font-size: 12px;
}
.tenant-chip div { min-width: 0; }
.tenant-chip strong { display: block; color: #e2e8f0; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tenant-chip small { display: block; color: #7c8ba3; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.superadmin-chip .tenant-avatar { background: rgba(139,92,246,.18); color: #c4b5fd; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 0 12px 20px; position: relative; z-index: 1; }
.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 5px; }
.nav-group { margin-bottom: 18px; }
.nav-label {
    display: block; padding: 0 12px 7px;
    font-size: 10px; font-weight: 700; letter-spacing: .12em;
    text-transform: uppercase; color: #64748b;
    white-space: nowrap;
}
.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px; margin-bottom: 2px;
    border-radius: 10px;
    color: #9fb0c7; font-weight: 500; font-size: 13px;
    transition: background .15s, color .15s;
    white-space: nowrap;
    position: relative;
}
.nav-item i { width: 18px; text-align: center; font-size: 14px; color: #6f819a; transition: color .15s; }
.nav-item:hover { background: rgba(255,255,255,.055); color: #e2e8f0; }
.nav-item:hover i { color: #cbd5e1; }
.nav-item.active {
    background: linear-gradient(90deg, rgba(37,99,235,.23), rgba(37,99,235,.08));
    color: #fff;
}
.nav-item.active::before {
    content: '';
    position: absolute; left: -12px; top: 8px; bottom: 8px;
    width: 3px; border-radius: 0 3px 3px 0;
    background: #34d399;
}
.nav-item.active i { color: #6ee7b7; }

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,.07);
    display: flex; align-items: center; gap: 8px;
    background: rgba(0,0,0,.12);
}
.sidebar-user { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; }
.sidebar-user-info { min-width: 0; }
.sidebar-user-info strong { display: block; color: #e2e8f0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info small { display: block; color: #7c8ba3; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
    width: 36px; height: 36px; min-width: 36px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: linear-gradient(135deg, #2563eb, #8b5cf6);
    color: #fff; font-weight: 700; font-size: 12px;
    text-transform: uppercase;
}
.avatar-sm { width: 32px; height: 32px; min-width: 32px; font-size: 11px; }
.btn-logout {
    border: 0; background: rgba(255,255,255,.06); color: #94a3b8;
    width: 32px; height: 32px; border-radius: 9px; cursor: pointer;
}
.btn-logout:hover { background: rgba(239,68,68,.16); color: #fca5a5; }

.main-area { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin .25s ease; }
.topbar {
    height: 76px; padding: 0 28px;
    background: rgba(255,255,255,.82);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    position: sticky; top: 0; z-index: 40;
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.page-heading h1 { font-size: 20px; font-weight: 700; }
.page-heading p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.today-chip { font-size: 12px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); padding: 7px 11px; border-radius: 9px; white-space: nowrap; }
.today-chip i { margin-right: 5px; }
.plan-chip { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #047857; background: var(--accent-soft); border: 1px solid #a7f3d0; padding: 6px 9px; border-radius: 999px; }
.topbar-user { display: flex; align-items: center; gap: 9px; padding-left: 14px; border-left: 1px solid var(--line); }
.topbar-user strong { display: block; font-size: 12px; }
.topbar-user small { display: block; font-size: 10px; color: var(--muted); }
.icon-btn {
    width: 38px; height: 38px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--surface);
    color: var(--ink-2); cursor: pointer; display: inline-grid; place-items: center;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.menu-toggle { display: none; }

.content { padding: 26px 28px 40px; flex: 1; }
.app-footer { padding: 16px 28px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 11px; display: flex; justify-content: space-between; gap: 10px; }
.footer-secure { color: #059669; }

/* Collapsed desktop */
body.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
body.sidebar-collapsed .main-area { margin-left: var(--sidebar-w-collapsed); }
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .tenant-chip div,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-item span,
body.sidebar-collapsed .sidebar-user-info { display: none; }
body.sidebar-collapsed .sidebar-brand { padding: 22px 20px 14px; }
body.sidebar-collapsed .tenant-chip { justify-content: center; padding: 9px; margin: 4px 14px 16px; }
body.sidebar-collapsed .nav-item { justify-content: center; padding: 11px; }
body.sidebar-collapsed .nav-item i { width: auto; font-size: 16px; }
body.sidebar-collapsed .sidebar-footer { justify-content: center; }
body.sidebar-collapsed .sidebar-user { flex: 0; }
.sidebar-overlay { display: none; }

/* ---------------------------------------------------------------------
   Typography / general
   --------------------------------------------------------------------- */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.text-success { color: #059669; }
.text-warning { color: #d97706; }
.text-danger { color: #dc2626; }
.text-info { color: #0284c7; }
.text-primary { color: var(--primary); }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.w-100 { width: 100%; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }

.page-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-toolbar h2 { font-size: 17px; }
.toolbar-actions { display: flex; gap: 9px; flex-wrap: wrap; }

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 16px;
    border-radius: 10px; border: 1px solid transparent;
    font-weight: 600; font-size: 13px; cursor: pointer;
    transition: all .15s; text-decoration: none; white-space: nowrap;
}
.btn i { font-size: 13px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 14px rgba(37,99,235,.22); }
.btn-primary:hover { background: var(--primary-600); color: #fff; transform: translateY(-1px); }
.btn-success { background: #059669; color: #fff; }
.btn-success:hover { background: #047857; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-outline { background: var(--surface); border-color: var(--line-strong); color: var(--ink-2); }
.btn-outline:hover { background: var(--surface-2); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-sm { height: 34px; padding: 0 11px; font-size: 12px; border-radius: 8px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-icon {
    width: 31px; height: 31px; border-radius: 8px;
    display: inline-grid; place-items: center;
    color: var(--muted); background: transparent; border: 1px solid transparent;
    transition: all .15s;
}
.btn-icon:hover { background: var(--surface-2); border-color: var(--line); color: var(--primary); }
.btn-icon.danger:hover { background: var(--danger-soft); border-color: #fecaca; color: var(--danger); }
.actions-cell { display: flex; gap: 2px; justify-content: flex-end; align-items: center; }

/* ---------------------------------------------------------------------
   Cards / panels
   --------------------------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-header {
    padding: 18px 20px; border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.card-header h3 { font-size: 14px; font-weight: 700; }
.card-header p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 20px; }
.card-body.p-0 { padding: 0; }
.card-footer { padding: 13px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

/* ---------------------------------------------------------------------
   Dashboard
   --------------------------------------------------------------------- */
.dash-hero {
    background: linear-gradient(120deg, #0f2a5e 0%, #123d7a 45%, #0b6b5c 100%);
    border-radius: 20px;
    padding: 28px 30px;
    color: #fff;
    margin-bottom: 22px;
    display: flex; justify-content: space-between; align-items: center; gap: 24px;
    position: relative; overflow: hidden;
    box-shadow: var(--shadow);
}
.dash-hero::before {
    content: '';
    position: absolute; width: 360px; height: 360px; right: -80px; top: -160px;
    border-radius: 50%; border: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 0 0 40px rgba(255,255,255,.035), 0 0 0 90px rgba(255,255,255,.02);
}
.dash-hero h2 { font-size: 24px; margin-bottom: 6px; }
.dash-hero p { color: #b7c7e2; font-size: 13px; max-width: 680px; }
.dash-hero .hero-actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.dash-hero .btn-outline { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.25); color: #fff; }
.dash-hero .btn-outline:hover { background: rgba(255,255,255,.16); }
.hero-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #6ee7b7; margin-bottom: 10px; }
.hero-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,.16); }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 22px; }
.stat-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
    padding: 17px 18px; box-shadow: var(--shadow-sm);
    position: relative; overflow: hidden;
}
.stat-card::after { content: ''; position: absolute; inset: auto 0 0 0; height: 3px; background: var(--tone, var(--primary)); opacity: .8; }
.stat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.stat-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .055em; }
.stat-value { font-size: 28px; font-weight: 800; line-height: 1; margin: 9px 0 4px; letter-spacing: -.03em; }
.stat-sub { font-size: 11px; color: var(--muted); }
.stat-icon {
    width: 42px; height: 42px; border-radius: 12px;
    display: grid; place-items: center; font-size: 17px;
    color: var(--tone, var(--primary)); background: var(--tone-soft, var(--primary-soft));
}
.tone-primary { --tone: #2563eb; --tone-soft: #eff6ff; }
.tone-success { --tone: #059669; --tone-soft: #ecfdf5; }
.tone-warning { --tone: #d97706; --tone-soft: #fffbeb; }
.tone-danger { --tone: #dc2626; --tone-soft: #fef2f2; }
.tone-info { --tone: #0284c7; --tone-soft: #f0f9ff; }
.tone-purple { --tone: #7c3aed; --tone-soft: #f5f3ff; }

.dash-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 18px; margin-bottom: 18px; }
.dash-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; margin-bottom: 18px; }
.dash-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; margin-bottom: 18px; }

.alert-list { display: flex; flex-direction: column; }
.alert-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.alert-row:last-child { border-bottom: 0; }
.alert-row .alert-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 13px; background: var(--surface-2); color: var(--muted); }
.alert-row.warning .alert-ico { background: var(--warning-soft); color: #b45309; }
.alert-row.danger .alert-ico { background: var(--danger-soft); color: #b91c1c; }
.alert-row.info .alert-ico { background: var(--info-soft); color: #0369a1; }
.alert-row.success .alert-ico { background: var(--accent-soft); color: #047857; }
.alert-row .alert-info { min-width: 0; flex: 1; }
.alert-row .alert-info strong { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-row .alert-info span { display: block; font-size: 11px; color: var(--muted); }
.alert-row .alert-meta { font-size: 11px; color: var(--muted); text-align: right; white-space: nowrap; }

.chart-bars { display: flex; align-items: flex-end; gap: 12px; height: 190px; padding: 10px 4px 0; }
.chart-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.chart-bar { width: 100%; max-width: 46px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, #60a5fa, #2563eb); min-height: 4px; position: relative; transition: height .4s; }
.chart-bar.accent { background: linear-gradient(180deg, #34d399, #059669); }
.chart-bar.warn { background: linear-gradient(180deg, #fbbf24, #d97706); }
.chart-bar.danger { background: linear-gradient(180deg, #f87171, #dc2626); }
.chart-bar span { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 700; color: var(--ink-2); }
.chart-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut {
    width: 150px; height: 150px; border-radius: 50%;
    background: conic-gradient(var(--accent) 0 var(--p1), var(--warning) var(--p1) var(--p2), var(--danger) var(--p2) var(--p3), var(--line) var(--p3) 100%);
    position: relative; flex-shrink: 0;
}
.donut::after { content: ''; position: absolute; inset: 26px; border-radius: 50%; background: var(--surface); }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; text-align: center; }
.donut-center strong { display: block; font-size: 21px; line-height: 1; }
.donut-center span { display: block; font-size: 9px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 3px; }
.donut-legend { display: flex; flex-direction: column; gap: 9px; font-size: 12px; flex: 1; }
.donut-legend div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.donut-legend .left { display: flex; align-items: center; gap: 7px; color: var(--ink-2); }
.donut-legend strong { font-size: 12px; }

.module-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; }
.module-card {
    border: 1px solid var(--line); border-radius: 13px; padding: 15px;
    background: var(--surface); display: flex; flex-direction: column; gap: 9px;
    transition: all .18s; color: var(--ink);
}
.module-card:hover { border-color: #bfdbfe; box-shadow: var(--shadow); transform: translateY(-2px); color: var(--ink); }
.module-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 15px; }
.module-card strong { font-size: 12.5px; }
.module-card small { font-size: 10.5px; color: var(--muted); line-height: 1.35; }

.activity-list { display: flex; flex-direction: column; }
.activity-row { display: flex; gap: 11px; padding: 11px 20px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.activity-row:last-child { border-bottom: 0; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 6px; flex-shrink: 0; }
.activity-row strong { font-size: 12px; display: block; }
.activity-row span { font-size: 10.5px; color: var(--muted); display: block; }

/* ---------------------------------------------------------------------
   Toolbar / filters / tables
   --------------------------------------------------------------------- */
.filter-bar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
.filter-bar .form-group { margin: 0; min-width: 150px; }
.filter-bar .search-field { flex: 1; min-width: 240px; }
.filter-bar .form-control { height: 37px; background: #fff; }
.filter-bar .btn { height: 37px; }
.search-input-wrap { position: relative; }
.search-input-wrap i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-size: 12px; }
.search-input-wrap .form-control { padding-left: 33px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .055em;
    color: var(--muted); font-weight: 700; padding: 11px 16px;
    background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 12.5px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafcff; }
.table .actions-col { width: 1%; white-space: nowrap; }
.inline-details { display: inline-block; position: relative; vertical-align: middle; }
.inline-details > summary { list-style: none; cursor: pointer; }
.inline-details > summary::-webkit-details-marker { display: none; }
.inline-details[open] > summary { background: var(--primary-soft); border-color: #bfdbfe; color: var(--primary); }
.inline-details[open] { white-space: normal; }
.inline-popover {
    display: block; position: absolute; right: 0; top: calc(100% + 7px); z-index: 25;
    width: 232px; padding: 13px; text-align: left;
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    box-shadow: var(--shadow-lg);
}
.inline-popover .form-label { margin-bottom: 5px; }
.inline-popover .btn { margin-top: 9px; }
.cell-main { font-weight: 600; color: var(--ink); font-size: 12.5px; }
.cell-sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.count-pill { display: inline-grid; place-items: center; min-width: 27px; height: 23px; padding: 0 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 11px; font-weight: 700; color: var(--ink-2); }
a.count-pill:hover { border-color: #bfdbfe; color: var(--primary); }

.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.table-footer .muted { font-size: 11.5px; }
.pagination { display: flex; gap: 4px; flex-wrap: wrap; }
.pagination a, .pagination span {
    min-width: 31px; height: 31px; padding: 0 8px;
    display: inline-grid; place-items: center;
    border: 1px solid var(--line); border-radius: 8px;
    font-size: 11.5px; color: var(--ink-2); background: #fff;
}
.pagination a:hover { border-color: #bfdbfe; color: var(--primary); }
.pagination .active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.pagination .disabled { opacity: .4; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .015em; white-space: nowrap; }
.badge-success { background: var(--accent-soft); color: #047857; border: 1px solid #a7f3d0; }
.badge-warning { background: var(--warning-soft); color: #b45309; border: 1px solid #fde68a; }
.badge-danger { background: var(--danger-soft); color: #b91c1c; border: 1px solid #fecaca; }
.badge-info { background: var(--info-soft); color: #0369a1; border: 1px solid #bae6fd; }
.badge-neutral { background: #f1f5f9; color: #475569; border: 1px solid var(--line); }
.badge-purple { background: var(--purple-soft); color: #6d28d9; border: 1px solid #ddd6fe; }

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */
.form-card { max-width: 1120px; }
.form-section { padding: 22px 24px; border-bottom: 1px solid var(--line); }
.form-section:last-of-type { border-bottom: 0; }
.form-section-title { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; }
.form-section-title i { width: 26px; height: 26px; border-radius: 7px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 11px; }
.form-section-title h3 { font-size: 13px; font-weight: 700; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: 14px 16px; }
.form-group { margin-bottom: 0; }
.col-12 { grid-column: span 12; }
.col-9 { grid-column: span 9; }
.col-8 { grid-column: span 8; }
.col-7 { grid-column: span 7; }
.col-6 { grid-column: span 6; }
.col-5 { grid-column: span 5; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }
.col-2 { grid-column: span 2; }
.col-1 { grid-column: span 1; }
.form-label { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-control {
    width: 100%; height: 40px; padding: 0 12px;
    border: 1px solid var(--line-strong); border-radius: 9px;
    background: #fff; color: var(--ink); outline: none;
    transition: border .15s, box-shadow .15s;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.form-control::placeholder { color: var(--muted-2); }
textarea.form-control { height: auto; min-height: 88px; padding: 9px 12px; resize: vertical; line-height: 1.5; }
select.form-control { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8.5 1.5 4h9z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
.form-control.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(239,68,68,.1); }
.field-error { color: var(--danger); font-size: 10.5px; margin-top: 4px; }
.field-help { color: var(--muted); font-size: 10.5px; margin-top: 4px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; height: 40px; }
.checkbox-row input { width: 17px; height: 17px; accent-color: var(--primary); }
.checkbox-label { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.file-current { display: flex; align-items: center; gap: 7px; font-size: 11.5px; margin-bottom: 7px; }
.file-current a { display: inline-flex; align-items: center; gap: 5px; }
input[type="file"].form-control { padding: 8px 10px; height: 40px; font-size: 11.5px; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.form-actions .left { margin-right: auto; color: var(--muted); font-size: 11.5px; }

.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 15px; border-radius: 11px; margin-bottom: 16px; font-size: 12.5px; border: 1px solid; }
.alert i { margin-top: 1px; }
.alert span { flex: 1; }
.alert-close { border: 0; background: transparent; color: inherit; font-size: 18px; cursor: pointer; opacity: .55; line-height: 1; padding: 0 2px; }
.alert-close:hover { opacity: 1; }
.alert-success { background: var(--accent-soft); color: #047857; border-color: #a7f3d0; }
.alert-error, .alert-danger { background: var(--danger-soft); color: #b91c1c; border-color: #fecaca; }
.alert-warning { background: var(--warning-soft); color: #b45309; border-color: #fde68a; }
.alert-info { background: var(--info-soft); color: #0369a1; border-color: #bae6fd; }

/* ---------------------------------------------------------------------
   Detail pages
   --------------------------------------------------------------------- */
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 22px; padding: 6px 22px 18px; }
.detail-item { padding: 12px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.detail-item.full { grid-column: span 2; }
.detail-item dt { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.detail-item dd { margin: 0; font-size: 13px; color: var(--ink); word-break: break-word; }
.detail-item dd.pre { white-space: pre-wrap; font-size: 12.5px; line-height: 1.6; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.profile-head { display: flex; gap: 14px; align-items: center; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.profile-avatar { width: 54px; height: 54px; border-radius: 14px; background: linear-gradient(135deg, #2563eb, #10b981); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 17px; }
.profile-head h2 { font-size: 17px; }
.profile-head p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.empty-state { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty-state i { font-size: 30px; color: var(--line-strong); margin-bottom: 10px; display: block; }
.empty-state strong { display: block; color: var(--ink-2); font-size: 13px; margin-bottom: 4px; }
.empty-state span { font-size: 12px; }

.stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.mini-stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; }
.mini-stat span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.mini-stat strong { display: block; font-size: 21px; margin-top: 4px; letter-spacing: -.02em; }

/* ---------------------------------------------------------------------
   Auth
   --------------------------------------------------------------------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: #fff; }
.auth-side {
    background: linear-gradient(150deg, #081326 0%, #0d2a57 55%, #0a5b50 100%);
    color: #fff; padding: 46px 52px; display: flex; flex-direction: column; justify-content: space-between;
    position: relative; overflow: hidden;
}
.auth-side::before { content: ''; position: absolute; width: 500px; height: 500px; border-radius: 50%; border: 1px solid rgba(255,255,255,.1); right: -180px; top: -140px; box-shadow: 0 0 0 60px rgba(255,255,255,.025), 0 0 0 130px rgba(255,255,255,.015); }
.auth-side::after { content: ''; position: absolute; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(16,185,129,.2), transparent 65%); left: -130px; bottom: -120px; }
.auth-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.auth-brand .brand-mark { width: 46px; height: 46px; font-size: 21px; }
.auth-brand strong { font-size: 20px; display: block; letter-spacing: -.02em; }
.auth-brand small { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #8ea4c4; }
.auth-copy { position: relative; z-index: 1; max-width: 470px; }
.auth-copy .eyebrow { color: #6ee7b7; font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 10px; display: block; }
.auth-copy h1 { font-size: 35px; line-height: 1.14; margin-bottom: 14px; }
.auth-copy h1 span { color: #6ee7b7; }
.auth-copy p { color: #a9bddb; font-size: 13.5px; line-height: 1.65; }
.auth-features { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; }
.auth-feature { display: flex; gap: 9px; align-items: flex-start; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.08); border-radius: 11px; padding: 11px; }
.auth-feature i { color: #34d399; margin-top: 2px; }
.auth-feature strong { display: block; font-size: 11.5px; }
.auth-feature span { font-size: 10px; color: #8ea4c4; }
.auth-side-footer { position: relative; z-index: 1; font-size: 10.5px; color: #6f86a8; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px; background: radial-gradient(circle at top right, #f0f7ff, #fff 55%); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 25px; margin-bottom: 5px; }
.auth-card > p { color: var(--muted); font-size: 13px; margin-bottom: 26px; }
.auth-form .form-group { margin-bottom: 15px; }
.auth-form .form-label { font-size: 12px; }
.auth-form .form-control { height: 44px; }
.auth-form .btn { height: 46px; margin-top: 6px; font-size: 13.5px; }
.auth-note { margin-top: 22px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 11px; color: var(--muted); line-height: 1.5; }
.auth-demo { margin-top: 20px; border: 1px dashed var(--line-strong); border-radius: 10px; padding: 12px 14px; font-size: 11px; color: var(--muted); line-height: 1.55; }
.auth-demo strong { color: var(--ink-2); }
.auth-error { background: var(--danger-soft); border: 1px solid #fecaca; color: #b91c1c; border-radius: 10px; padding: 10px 13px; font-size: 12px; margin-bottom: 15px; display: flex; gap: 8px; align-items: flex-start; }
.form-check { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.form-check input { accent-color: var(--primary); }

/* ---------------------------------------------------------------------
   Admin / tenants
   --------------------------------------------------------------------- */
.company-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.company-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; position: relative; }
.company-card .company-top { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; margin-bottom: 12px; }
.company-logo { width: 42px; height: 42px; border-radius: 11px; background: linear-gradient(135deg, #eff6ff, #ecfdf5); border: 1px solid var(--line); color: var(--primary); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.company-card h3 { font-size: 14px; margin-bottom: 2px; }
.company-card .cnpj { font-size: 10.5px; color: var(--muted); }
.company-metrics { display: flex; gap: 16px; padding: 11px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 12px 0; }
.company-metrics div { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.company-metrics strong { display: block; font-size: 16px; color: var(--ink); letter-spacing: -.02em; margin-bottom: 2px; }
.company-card .company-actions { display: flex; gap: 8px; }
.company-card .company-actions .btn { flex: 1; }

/* ---------------------------------------------------------------------
   Reports / print
   --------------------------------------------------------------------- */
.report-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 20px; }
.report-link { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 16px; display: flex; gap: 11px; align-items: center; color: var(--ink); }
.report-link:hover { border-color: #bfdbfe; box-shadow: var(--shadow-sm); color: var(--ink); }
.report-link .module-ico { flex-shrink: 0; }
.report-link strong { display: block; font-size: 12.5px; }
.report-link small { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }

.print-page { background: #fff; color: #111827; max-width: 900px; margin: 24px auto; padding: 38px 44px; border-radius: 4px; box-shadow: var(--shadow); font-size: 12px; }
.print-toolbar { max-width: 900px; margin: 20px auto 0; display: flex; justify-content: space-between; gap: 10px; }
.print-header { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid #111827; padding-bottom: 14px; margin-bottom: 20px; }
.print-brand { display: flex; gap: 10px; align-items: center; }
.print-brand .mark { width: 40px; height: 40px; border-radius: 8px; background: #0f172a; color: #fff; display: grid; place-items: center; font-size: 17px; }
.print-brand strong { font-size: 16px; display: block; }
.print-brand small { font-size: 10px; color: #6b7280; }
.print-doc-title { text-align: right; }
.print-doc-title h1 { font-size: 17px; text-transform: uppercase; letter-spacing: .06em; }
.print-doc-title p { font-size: 10.5px; color: #6b7280; margin-top: 3px; }
.print-section { margin-bottom: 18px; }
.print-section h2 { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: #374151; border-bottom: 1px solid #d1d5db; padding-bottom: 5px; margin-bottom: 9px; }
.print-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px 24px; }
.print-field { font-size: 11px; }
.print-field span { display: block; font-size: 8.5px; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; }
.print-field strong { font-weight: 600; }
.print-text { font-size: 11px; line-height: 1.6; white-space: pre-wrap; }
.print-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 60px; }
.signature-line { border-top: 1px solid #111827; padding-top: 5px; font-size: 9.5px; text-align: center; color: #374151; }
.print-footer { margin-top: 34px; padding-top: 8px; border-top: 1px solid #d1d5db; font-size: 8.5px; color: #6b7280; display: flex; justify-content: space-between; }
.print-table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.print-table th, .print-table td { border: 1px solid #d1d5db; padding: 5px 7px; text-align: left; }
.print-table th { background: #f3f4f6; font-size: 9px; text-transform: uppercase; }

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */
@media (max-width: 1280px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .module-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .report-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .company-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 1100px) {
    .dash-grid { grid-template-columns: 1fr; }
    .dash-grid-3 { grid-template-columns: 1fr 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .topbar-user div { display: none; }
}
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); width: var(--sidebar-w); box-shadow: var(--shadow-lg); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 45; }
    .main-area, body.sidebar-collapsed .main-area { margin-left: 0; }
    body.sidebar-collapsed .sidebar { width: var(--sidebar-w); }
    body.sidebar-collapsed .brand-text, body.sidebar-collapsed .tenant-chip div,
    body.sidebar-collapsed .nav-label, body.sidebar-collapsed .nav-item span,
    body.sidebar-collapsed .sidebar-user-info { display: block; }
    body.sidebar-collapsed .nav-item { justify-content: flex-start; padding: 9px 12px; }
    body.sidebar-collapsed .tenant-chip { justify-content: flex-start; }
    .menu-toggle { display: inline-grid; }
    .topbar { padding: 0 18px; height: 68px; }
    .content { padding: 20px 18px 34px; }
    .today-chip, .plan-chip { display: none; }
    .dash-hero { flex-direction: column; align-items: flex-start; padding: 24px; }
    .dash-grid-3, .dash-grid-2 { grid-template-columns: 1fr; }
    .module-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .auth-page { grid-template-columns: 1fr; }
    .auth-side { display: none; }
    .auth-main { min-height: 100vh; padding: 24px; }
}
@media (max-width: 640px) {
    .stats-grid, .stat-strip, .report-grid, .company-grid { grid-template-columns: 1fr 1fr; }
    .module-grid { grid-template-columns: 1fr; }
    .form-grid { gap: 12px; }
    .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9 { grid-column: span 12; }
    .detail-list { grid-template-columns: 1fr; }
    .detail-item.full { grid-column: span 1; }
    .table-footer { flex-direction: column; align-items: flex-start; }
    .page-heading h1 { font-size: 17px; }
    .page-heading p { display: none; }
    .print-page { margin: 0; padding: 22px; box-shadow: none; }
    .print-grid, .print-signatures { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------
   ImpressÃ£o
   --------------------------------------------------------------------- */
@media print {
    body { background: #fff; }
    .sidebar, .topbar, .app-footer, .print-toolbar, .no-print, .sidebar-overlay { display: none !important; }
    .main-area { margin: 0 !important; }
    .content { padding: 0 !important; }
    .print-page { box-shadow: none; margin: 0; max-width: none; padding: 0; }
    a { color: inherit; text-decoration: none; }
    .print-section { page-break-inside: avoid; }
}

/* ---------------------------------------------------------------------
   Consulta de CA, lanÃ§amentos mÃºltiplos e Ishikawa
   --------------------------------------------------------------------- */
.ca-lookup-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.ca-official-link { font-size: 12px; color: var(--muted); text-decoration: none; }
.ca-official-link:hover { color: var(--primary); }
.ca-lookup-result { margin-top: 6px; min-height: 18px; }
.ca-lookup-result.is-success { color: #15803d; }
.ca-lookup-result.is-warning { color: #b45309; }
.ca-lookup-result.is-error { color: var(--danger); }
.ca-lookup-result a { color: inherit; text-decoration: underline; }
.ca-lookup-result .btn { margin-left: 4px; }

.lookup-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.lookup-official-link { font-size: 12px; color: var(--muted); text-decoration: none; }
.lookup-official-link:hover { color: var(--primary); }
.lookup-result { margin-top: 6px; min-height: 18px; }
.lookup-result.is-success { color: #15803d; }
.lookup-result.is-warning { color: #b45309; }
.lookup-result.is-error { color: var(--danger); }
.lookup-result a { color: inherit; text-decoration: underline; }
.lookup-result .btn { margin-left: 4px; }

.form-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 22px;
}
.form-section-head .form-section-title { padding-left: 0; padding-right: 0; }

.batch-items { display: grid; gap: 14px; padding: 4px 22px 22px; }
.batch-item {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfdff;
    overflow: hidden;
}
.batch-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 16px;
    background: #f1f7fd;
    border-bottom: 1px solid var(--line);
    color: var(--navy);
    font-size: 13px;
}
.batch-item-number { color: var(--muted); font-weight: 500; }
.batch-item .form-grid { padding: 16px; }
.batch-remove { color: var(--danger); }
.batch-remove:hover { background: #fef2f2; }

.fishbone-editor,
.fishbone-view {
    padding: 18px 22px 22px;
    background: linear-gradient(180deg, #fbfdff 0%, #f7fbff 100%);
    border-top: 1px solid var(--line);
}
.fishbone-effect {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 16px;
    margin-bottom: 16px;
    border-left: 4px solid var(--primary);
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}
.fishbone-effect span { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.fishbone-effect strong { color: var(--navy); font-size: 14px; }
.fishbone-diagram { position: relative; }
.fishbone-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.fishbone-row-top { margin-bottom: 0; }
.fishbone-row-bottom { margin-top: 0; }
.fishbone-branch {
    position: relative;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px;
    box-shadow: var(--shadow-sm);
}
.fishbone-branch textarea { min-height: 82px; font-size: 13px; }
.fishbone-branch-title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 7px;
    font-size: 12px;
    font-weight: 700;
    color: var(--navy);
}
.fishbone-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); display: inline-block; flex: 0 0 auto; }
.fishbone-spine {
    position: relative;
    height: 34px;
    margin: 2px 18px;
    display: flex;
    align-items: center;
}
.fishbone-spine-line {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), #7dd3fc);
    border-radius: 2px;
}
.fishbone-spine-arrow {
    position: absolute;
    right: -1px;
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 13px solid #7dd3fc;
}
.fishbone-help { padding: 0 22px 18px; margin: 0; }
.fishbone-view-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.fishbone-view-branch {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 14px;
}
.fishbone-view-branch strong { display: flex; align-items: center; gap: 7px; color: var(--navy); font-size: 12px; margin-bottom: 6px; }
.fishbone-view-branch p { margin: 0; color: var(--navy); font-size: 13px; white-space: pre-wrap; }

@media (max-width: 900px) {
    .fishbone-row, .fishbone-view-grid { grid-template-columns: 1fr; }
    .fishbone-spine { display: none; }
}
.print-note { font-size: 11px; line-height: 1.6; color: #374151; margin-top: 10px; }
.print-signature { text-align: center; font-size: 9.5px; color: #374151; }
.print-signature span { display: block; border-top: 1px solid #111827; margin-bottom: 5px; }
.print-signature strong { display: block; font-size: 9.5px; }
.print-signature small { display: block; color: #6b7280; margin-top: 2px; }

.fishbone-row-top .fishbone-branch::after,
.fishbone-row-bottom .fishbone-branch::before {
    content: "";
    position: absolute;
    left: 50%;
    width: 1px;
    height: 18px;
    background: #93c5fd;
}
.fishbone-row-top .fishbone-branch::after {
    bottom: -19px;
    transform: rotate(16deg);
    transform-origin: top center;
}
.fishbone-row-bottom .fishbone-branch::before {
    top: -19px;
    transform: rotate(16deg);
    transform-origin: bottom center;
}
@media (max-width: 900px) {
    .fishbone-row-top .fishbone-branch::after,
    .fishbone-row-bottom .fishbone-branch::before { display: none; }
}
