/* DarkControl v2 application design system. Light mode only. */
:root,
html[data-theme="light"],
html[data-theme="dark"] {
    color-scheme: light;
    --brand: #17201e;
    --brand-2: #33413d;
    --accent: #14715f;
    --accent-hover: #0f5d4e;
    --accent-press: #0a493d;
    --accent-subtle: #e9f5f1;
    --accent-ring: rgba(20, 113, 95, .18);
    --success: #187348;
    --success-subtle: #e8f5ee;
    --success-ring: rgba(24, 115, 72, .17);
    --danger: #b23a3a;
    --danger-subtle: #fbecec;
    --danger-ring: rgba(178, 58, 58, .16);
    --warning: #956417;
    --warning-subtle: #fbf3e3;
    --warning-ring: rgba(149, 100, 23, .16);
    --info: #365f94;
    --info-subtle: #edf2f8;
    --bg-app: #f4f6f5;
    --bg-surface: #ffffff;
    --bg-elevated: #f0f3f2;
    --bg-hover: #f4f7f6;
    --bg-overlay: rgba(18, 27, 25, .48);
    --text-primary: #17201e;
    --text-secondary: #485652;
    --text-muted: #71807b;
    --text-disabled: #9ba6a2;
    --text-inverse: #ffffff;
    --border: #dfe5e3;
    --border-strong: #cbd5d1;
    --divider: #ebefee;
    --badge-allow-text: #145a3a;
    --badge-deny-text: #8d2c2c;
    --badge-ask-text: #755013;
    --radius-xs: 3px;
    --radius-sm: 5px;
    --radius: 6px;
    --radius-lg: 8px;
    --radius-xl: 8px;
    --shadow-xs: 0 1px 2px rgba(23, 32, 30, .04);
    --shadow-sm: 0 2px 6px rgba(23, 32, 30, .07);
    --shadow-md: 0 12px 30px rgba(23, 32, 30, .10);
    --shadow-lg: 0 24px 64px rgba(23, 32, 30, .18);
    --transition: 150ms cubic-bezier(.2, 0, 0, 1);
    --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
    --sidebar-w: 236px;
    --sidebar-w-collapsed: 64px;
    --topbar-h: 58px;
    --content-max: 1540px;
    --content-pad: 28px;
}

html { background: var(--bg-app); }
body.v2-console { min-width: 320px; color: var(--text-primary); background: var(--bg-app); font-size: 14px; letter-spacing: 0; }
body.v2-console h1,
body.v2-console h2,
body.v2-console h3,
body.v2-console h4,
body.v2-console h5 { color: var(--text-primary); letter-spacing: 0; }
body.v2-console h1 { font-size: 1.55rem; font-weight: 680; }
body.v2-console h2 { font-size: 1rem; font-weight: 680; }
body.v2-console h3 { font-size: .9rem; font-weight: 680; }
body.v2-console a { color: var(--accent); }
body.v2-console a:hover { color: var(--accent-hover); }
body.v2-console :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dc-skip-link { position: fixed; z-index: 10000; top: 10px; left: 10px; padding: 9px 13px; border-radius: 5px; color: #fff !important; background: var(--accent); box-shadow: var(--shadow-md); transform: translateY(calc(-100% - 18px)); transition: transform var(--transition); }
.dc-skip-link:focus { transform: translateY(0); }
.dc-sr-only,
.sr-only { position: fixed !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
body.v2-console ::selection { color: var(--text-primary); background: var(--accent-ring); }
body.v2-console ::-webkit-scrollbar { width: 10px; height: 10px; }
body.v2-console ::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 8px; background: #c5cfcb; background-clip: padding-box; }
body.v2-console ::-webkit-scrollbar-track { background: transparent; }

/* Application frame */
.v2-app { min-height: 100vh; background: var(--bg-app); }
.v2-app-body { min-width: 0; }
.v2-sidebar { position: sticky; top: 0; display: flex; flex: 0 0 var(--sidebar-w); flex-direction: column; width: var(--sidebar-w); height: 100vh; border-right: 1px solid var(--border); background: #fbfcfc; transition: width var(--transition), flex-basis var(--transition); z-index: 90; }
.v2-sidebar-head { display: flex; align-items: center; flex: 0 0 66px; justify-content: space-between; padding: 0 14px; border-bottom: 1px solid var(--divider); }
.v2-brand { display: flex; align-items: center; min-width: 0; gap: 10px; color: var(--text-primary) !important; }
.v2-brand img { flex: 0 0 auto; width: 30px; height: 30px; object-fit: contain; }
.v2-brand > span { display: flex; min-width: 0; flex-direction: column; line-height: 1.2; }
.v2-brand strong { overflow: hidden; color: var(--text-primary); font-size: .83rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.v2-brand small { margin-top: 2px; color: var(--text-muted); font-size: .62rem; }
.v2-sidebar-close { position: relative; display: none; width: 32px; height: 32px; border: 0; border-radius: 5px; background: transparent; color: var(--text-muted); cursor: pointer; }
.v2-sidebar-close::before,
.v2-sidebar-close::after { content: ""; position: absolute; top: 15px; left: 9px; width: 14px; height: 1.5px; background: currentColor; }
.v2-sidebar-close::before { transform: rotate(45deg); }
.v2-sidebar-close::after { transform: rotate(-45deg); }
.v2-nav { flex: 1 1 auto; min-height: 0; padding: 12px 9px 18px; overflow-y: auto; scrollbar-width: thin; }
.v2-nav-section + .v2-nav-section { margin-top: 16px; }
.v2-nav-label { height: 22px; padding: 0 9px; color: #909b97; font-size: .61rem; font-weight: 700; letter-spacing: .08em; line-height: 22px; text-transform: uppercase; white-space: nowrap; }
.v2-nav-item { position: relative; display: flex; align-items: center; min-height: 36px; gap: 10px; padding: 7px 9px; border-radius: 5px; color: var(--text-secondary) !important; font-size: .78rem; font-weight: 540; transition: color var(--transition), background var(--transition); }
.v2-nav-item:hover { color: var(--text-primary) !important; background: #f0f3f2; }
.v2-nav-item.is-active { color: #0f5d4e !important; background: var(--accent-subtle); font-weight: 670; }
.v2-nav-item.is-active::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: -9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.v2-nav-icon { display: inline-flex; flex: 0 0 18px; align-items: center; justify-content: center; }
.v2-nav-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2-sidebar-foot { position: relative; flex: 0 0 auto; padding: 9px; border-top: 1px solid var(--divider); background: #fff; }
.v2-account { display: flex; align-items: center; width: 100%; min-width: 0; min-height: 48px; gap: 10px; padding: 7px; border: 0; border-radius: 6px; background: transparent; color: var(--text-secondary); cursor: pointer; text-align: left; }
.v2-account:hover { background: var(--bg-hover); color: var(--text-primary); }
.v2-account .user-avatar { display: inline-flex; flex: 0 0 31px; align-items: center; justify-content: center; width: 31px; height: 31px; border: 1px solid #c8ddd6; border-radius: 50%; color: #125e4f; background: #edf7f4; font-size: .67rem; font-weight: 700; }
.v2-account-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; line-height: 1.25; }
.v2-account-copy strong,
.v2-account-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2-account-copy strong { color: var(--text-primary); font-size: .73rem; font-weight: 650; }
.v2-account-copy small { margin-top: 2px; color: var(--text-muted); font-size: .62rem; }
.v2-account-menu { right: 9px; bottom: calc(100% + 7px); left: 9px; top: auto; min-width: 0; border-color: var(--border); border-radius: 7px; box-shadow: var(--shadow-md); }
.v2-menu-state { margin-left: auto; color: var(--text-muted); font-size: .68rem; }
.user-menu-item.is-danger { color: var(--danger); }

/* Collapsed desktop rail */
html[data-sidebar="collapsed"] .v2-sidebar { flex-basis: var(--sidebar-w-collapsed); width: var(--sidebar-w-collapsed); }
html[data-sidebar="collapsed"] .v2-sidebar-head { justify-content: center; padding: 0; }
html[data-sidebar="collapsed"] .v2-brand > span,
html[data-sidebar="collapsed"] .v2-nav-label,
html[data-sidebar="collapsed"] .v2-nav-text,
html[data-sidebar="collapsed"] .v2-account-copy,
html[data-sidebar="collapsed"] .v2-account > svg { display: none; }
html[data-sidebar="collapsed"] .v2-nav { padding-right: 9px; padding-left: 9px; }
html[data-sidebar="collapsed"] .v2-nav-section + .v2-nav-section { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--divider); }
html[data-sidebar="collapsed"] .v2-nav-item { justify-content: center; padding: 8px; }
html[data-sidebar="collapsed"] .v2-nav-item.is-active::before { left: -9px; }
html[data-sidebar="collapsed"] .v2-account { justify-content: center; padding: 7px 0; }
html[data-sidebar="collapsed"] .v2-account-menu { left: 60px; bottom: 8px; width: 230px; }

/* Top bar */
.v2-topbar { position: sticky; top: 0; display: flex; align-items: center; height: var(--topbar-h); gap: 8px; padding: 0 18px; border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, .97); z-index: 70; }
.v2-icon-button { position: relative; display: inline-flex; flex: 0 0 34px; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 5px; color: var(--text-secondary); background: transparent; cursor: pointer; }
.v2-icon-button:hover { color: var(--text-primary); background: var(--bg-elevated); }
.v2-org-switcher { width: auto; max-width: 260px; min-width: 170px; height: 34px; padding: 5px 30px 5px 9px; border: 1px solid var(--border); border-radius: 5px; color: var(--text-secondary); background: #fff; font-size: .72rem; }
.v2-search-trigger { display: flex; align-items: center; width: 210px; height: 34px; gap: 8px; padding: 0 9px; border: 1px solid var(--border); border-radius: 5px; color: var(--text-muted); background: #fafbfb; font-size: .72rem; text-align: left; }
.v2-search-trigger:hover { border-color: var(--border-strong); color: var(--text-primary); background: #fff; }
.v2-search-trigger > span { flex: 1; }
.v2-search-trigger kbd { padding: 1px 5px; border: 1px solid var(--border); border-radius: 3px; color: var(--text-muted); background: #fff; font-family: var(--font-sans); font-size: .6rem; }
.v2-topbar .notif-badge { position: absolute; top: 2px; right: 1px; min-width: 15px; height: 15px; padding: 0 3px; border: 2px solid #fff; border-radius: 8px; color: #fff; background: var(--danger); font-size: 9px; line-height: 11px; }
.dc-env-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border: 1px solid #d8c48f; border-radius: 999px; color: #725c20; background: #fff9df; font-size: .61rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.dc-route-progress { position: fixed; z-index: 1000; top: 0; left: 0; width: 0; height: 2px; opacity: 0; background: var(--accent); box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 45%, transparent); pointer-events: none; }
body.dc-route-loading .dc-route-progress { width: 82%; opacity: 1; transition: width 2.5s cubic-bezier(.1,.7,.2,1), opacity .12s; }
.dc-mobile-nav { display: none; }
.dc-notification-loading { color: var(--text-muted); font-size: 13px; padding: 12px 2px; }
.dc-notification-feed { display: grid; gap: 0; }
.dc-notification-item { position: relative; display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 10px; padding: 15px 2px; border-bottom: 1px solid var(--divider); }
.dc-notification-item:last-child { border-bottom: 0; }
.dc-notification-dot { width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: var(--border); }
.dc-notification-item.is-unseen .dc-notification-dot { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }
.dc-notification-title { color: var(--text-primary); font-size: 13.5px; font-weight: 650; }
.dc-notification-item p { margin: 4px 0 7px; color: var(--text-secondary); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.dc-notification-meta { color: var(--text-muted); font-size: 11.5px; }
.dc-notification-more { width: 100%; margin-top: 14px; }
.dc-notification-empty { display: grid; gap: 5px; place-items: center; padding: 42px 12px; text-align: center; }
.dc-notification-empty strong { color: var(--text-primary); font-size: 14px; }
.dc-notification-empty span { color: var(--text-muted); font-size: 13px; }

/* Main content */
.v2-main { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 22px var(--content-pad) 72px; }
.v2-breadcrumbs { display: flex; align-items: center; min-height: 24px; gap: 6px; margin: 0 0 12px; color: var(--text-muted); font-size: .68rem; }
.v2-breadcrumbs a { color: var(--text-muted); }
.v2-breadcrumbs a:hover { color: var(--text-primary); }
.v2-breadcrumbs .sep { color: #adb6b3; }
.v2-page-header,
body.v2-console .page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; padding: 0 0 20px; margin: 0 0 20px; border-bottom: 1px solid var(--border); }
.v2-page-title { min-width: 0; }
.v2-page-title h1,
body.v2-console .page-header h1 { margin: 0; font-size: 1.5rem; font-weight: 680; line-height: 1.2; }
.v2-page-title .page-header-sub,
body.v2-console .page-header-sub { display: block; max-width: 760px; margin: 6px 0 0; color: var(--text-muted); font-size: .79rem; line-height: 1.5; }
body.v2-console .page-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
body.v2-console .page-content { min-width: 0; }

/* Surfaces and hierarchy */
body.v2-console .card { border: 1px solid var(--border); border-radius: 7px; background: #fff; box-shadow: var(--shadow-xs); }
body.v2-console .card-header { padding: 14px 16px; border-bottom: 1px solid var(--divider); background: #fff; }
body.v2-console .card-body { padding: 16px; }
body.v2-console .panel-title { color: var(--text-secondary); font-size: .72rem; font-weight: 680; letter-spacing: 0; text-transform: none; }
body.v2-console .section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin: 24px 0 10px; }
body.v2-console .section-heading h2 { font-size: .92rem; }
body.v2-console .metric-card,
body.v2-console .kpi-card { min-height: 104px; border-radius: 7px; }
body.v2-console .metric-value,
body.v2-console .kpi-value { color: var(--text-primary); font-size: 1.45rem; font-weight: 680; letter-spacing: 0; }
body.v2-console .metric-label,
body.v2-console .kpi-label { color: var(--text-muted); font-size: .68rem; font-weight: 620; letter-spacing: 0; text-transform: none; }
body.v2-console .chart-card { border-radius: 7px; }

/* Buttons */
body.v2-console .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; gap: 7px; padding: 7px 12px; border: 1px solid transparent; border-radius: 5px; font-size: .74rem; font-weight: 650; letter-spacing: 0; line-height: 1.2; cursor: pointer; transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition); }
body.v2-console .btn-sm { min-height: 32px; padding: 6px 10px; font-size: .7rem; }
body.v2-console .btn-primary { border-color: var(--accent); color: #fff; background: var(--accent); box-shadow: none; }
body.v2-console .btn-primary:hover { border-color: var(--accent-hover); color: #fff; background: var(--accent-hover); }
body.v2-console .btn-ghost,
body.v2-console .btn-secondary { border-color: var(--border-strong); color: var(--text-secondary); background: #fff; }
body.v2-console .btn-ghost:hover,
body.v2-console .btn-secondary:hover { border-color: #aebbb6; color: var(--text-primary); background: var(--bg-hover); }
body.v2-console .btn-danger { border-color: var(--danger); color: #fff; background: var(--danger); }
body.v2-console .btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: 1px solid transparent; border-radius: 5px; color: var(--text-muted); background: transparent; cursor: pointer; }
body.v2-console .btn-icon:hover { border-color: var(--border); color: var(--text-primary); background: var(--bg-hover); }

/* Forms */
body.v2-console .form-group { margin-bottom: 16px; }
body.v2-console .form-group > label,
body.v2-console .selector-group > label,
body.v2-console .filter-group > label { display: block; margin-bottom: 5px; color: var(--text-secondary); font-size: .68rem; font-weight: 660; letter-spacing: 0; text-transform: none; }
body.v2-console .form-control { min-height: 38px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 5px; color: var(--text-primary); background: #fff; font: inherit; font-size: .78rem; }
body.v2-console .form-control:hover { border-color: #aebbb6; }
body.v2-console .form-control:focus { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 3px var(--accent-ring); }
body.v2-console .form-control[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-ring); }
body.v2-console textarea.form-control { min-height: 88px; line-height: 1.5; resize: vertical; }
body.v2-console .form-hint { margin-top: 5px; color: var(--text-muted); font-size: .67rem; line-height: 1.45; }
body.v2-console input[type="checkbox"],
body.v2-console input[type="radio"] { accent-color: var(--accent); }
body.v2-console .selector-row { display: flex; align-items: flex-end; gap: 12px; }
body.v2-console .selector-card { border-radius: 7px; }
body.v2-console .inline-form { padding: 14px; border: 1px solid var(--border); border-radius: 7px; background: #f8faf9; }
body.v2-console .toggle-switch { flex: 0 0 auto; }

/* Tables and toolbars */
body.v2-console .table-wrap { overflow: auto; border-radius: 7px; }
body.v2-console .table-wrap.dc-table-overflow { scrollbar-color: var(--border-strong) transparent; box-shadow: inset 12px 0 10px -14px rgba(23,32,30,.75), inset -12px 0 10px -14px rgba(23,32,30,.75); }
body.v2-console .table-wrap.dc-table-overflow.dc-scroll-start { box-shadow: inset -12px 0 10px -14px rgba(23,32,30,.75); }
body.v2-console .table-wrap.dc-table-overflow.dc-scroll-end { box-shadow: inset 12px 0 10px -14px rgba(23,32,30,.75); }
body.v2-console .table-wrap.dc-table-overflow:focus-visible { outline-offset: 3px; }
body.v2-console table { width: 100%; border-collapse: collapse; color: var(--text-secondary); font-size: .76rem; }
body.v2-console thead th { height: 41px; padding: 9px 12px; border-bottom: 1px solid var(--border); color: var(--text-muted); background: #fafbfb; font-size: .64rem; font-weight: 700; letter-spacing: .04em; text-align: left; text-transform: uppercase; white-space: nowrap; }
body.v2-console tbody td { padding: 11px 12px; border-bottom: 1px solid var(--divider); vertical-align: middle; }
body.v2-console tbody tr:last-child td { border-bottom: 0; }
body.v2-console tbody tr:hover td { background: #fafcfb; }
body.v2-console tbody td strong { color: var(--text-primary); font-weight: 650; }
body.v2-console th.num,
body.v2-console td.num { text-align: right; font-variant-numeric: tabular-nums; }
body.v2-console .toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
body.v2-console .dc-bulkbar { min-height: 42px; margin-bottom: 10px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; background: #f5f8f7; }
body.v2-console .empty-state { padding: 40px 20px; color: var(--text-muted); text-align: center; }
body.v2-console .empty-icon { border: 1px solid var(--border); background: #f5f7f6; box-shadow: none; }

body.v2-console .toast-icon svg,
body.v2-console .toast-dismiss svg,
body.v2-console .act-ico svg,
body.v2-console .btn-icon svg,
body.v2-console .chip-x svg,
body.v2-console .dc-top-btn svg,
body.v2-console .dc-watch-star svg,
body.v2-console .ob-check svg { width: 1em; height: 1em; display: block; }
body.v2-console .btn-icon { display: inline-grid; place-items: center; }
body.v2-console .btn-icon svg { width: 17px; height: 17px; }
body.v2-console .toast-dismiss { display: grid; place-items: center; }
body.v2-console .chip-x { border: 0; background: transparent; color: inherit; padding: 2px; cursor: pointer; }
body.v2-console .dc-watch-star { width: 28px; height: 28px; display: inline-grid; place-items: center; color: var(--text-muted); }
body.v2-console .dc-watch-star svg { width: var(--star); height: var(--star); }
body.v2-console .ob-check { width: 18px; height: 18px; display: inline-grid; place-items: center; }
body.v2-console .ob-check svg { width: 18px; height: 18px; }
body.v2-console .ob-pending { width: 14px; height: 14px; border: 1.5px solid currentColor; border-radius: 50%; display: block; }
body.v2-console .dc-mpick-check svg { width: 16px; height: 16px; display: block; }
body.v2-console .skeleton { background: #eef1f0; }

/* Badges and status */
body.v2-console .badge { display: inline-flex; align-items: center; min-height: 21px; padding: 2px 7px; border: 1px solid var(--border); border-radius: 4px; color: var(--text-secondary); background: #f2f4f3; font-size: .63rem; font-weight: 650; letter-spacing: 0; text-transform: none; }
body.v2-console .badge-allow { border-color: #c9e2d4; color: var(--badge-allow-text); background: var(--success-subtle); }
body.v2-console .badge-deny { border-color: #edcaca; color: var(--badge-deny-text); background: var(--danger-subtle); }
body.v2-console .badge-ask { border-color: #e8d7b8; color: var(--badge-ask-text); background: var(--warning-subtle); }
body.v2-console .badge-service { border-color: #d8ddec; color: #4e587d; background: #f2f3f8; }
body.v2-console .chip { border-radius: 4px; }
body.v2-console .dot { width: 7px; height: 7px; }
body.v2-console .role-badge { border-radius: 4px; }

/* Tabs and segmented controls */
body.v2-console .tabs,
body.v2-console .pol-tabs { display: flex; align-items: center; gap: 20px; border-bottom: 1px solid var(--border); }
body.v2-console .tab,
body.v2-console .pol-tab { position: relative; min-height: 41px; padding: 0 1px; border: 0; color: var(--text-muted); background: transparent; font-size: .74rem; font-weight: 640; }
body.v2-console .tab.active,
body.v2-console .pol-tab.active { color: var(--text-primary); }
body.v2-console .tab.active::after,
body.v2-console .pol-tab.active::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--accent); }
body.v2-console .seg,
body.v2-console .seg-control { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: 6px; background: #eef1f0; }
body.v2-console .seg-btn,
body.v2-console .seg-control button { min-height: 30px; padding: 5px 10px; border: 0; border-radius: 4px; color: var(--text-muted); background: transparent; font-size: .69rem; font-weight: 640; }
body.v2-console .seg-btn.active,
body.v2-console .seg-control button.active { color: var(--text-primary); background: #fff; box-shadow: var(--shadow-xs); }

/* Modals and drawers */
body.dc-modal-open { overflow: hidden; }
body.v2-console .modal-backdrop { visibility: hidden; align-items: center; justify-content: center; padding: 24px; background: var(--bg-overlay); backdrop-filter: blur(3px); }
body.v2-console .modal-backdrop.active { visibility: visible; }
body.v2-console .modal { display: flex; flex-direction: column; width: min(520px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 48px); min-height: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: #fff; box-shadow: var(--shadow-lg); }
body.v2-console .modal.lg { width: min(760px, calc(100vw - 32px)); }
body.v2-console .modal.xl { width: min(1040px, calc(100vw - 32px)); }
body.v2-console .modal-header { display: flex; flex: 0 0 auto; align-items: flex-start; justify-content: space-between; min-height: 64px; gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--border); background: #fff; }
body.v2-console .modal-header h3 { font-size: .94rem; }
body.v2-console .modal-body { flex: 1 1 auto; min-height: 0; padding: 18px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
body.v2-console .modal-footer { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; min-height: 58px; gap: 8px; padding: 11px 18px; border-top: 1px solid var(--border); background: #fafbfb; }
body.v2-console .drawer-backdrop { background: rgba(18, 27, 25, .44); backdrop-filter: blur(2px); }
body.v2-console .drawer { width: min(680px, 100vw); border: 0; background: #fff; box-shadow: var(--shadow-lg); }
body.v2-console .drawer-header { min-height: 64px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
body.v2-console .drawer-body { min-height: 0; padding: 18px; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
body.v2-console .modal-backdrop.dc-confirm-backdrop {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
body.v2-console .confirm-dialog { width: min(440px, calc(100vw - 32px)); border-radius: 8px; }
body.v2-console .confirm-dialog .modal-header { min-height: 58px; }
body.v2-console .confirm-dialog .modal-body { padding-block: 20px; }
body.v2-console .confirm-message { margin: 0; color: var(--text-primary); font-size: .84rem; line-height: 1.6; }
body.v2-console .confirm-detail { margin-top: 14px; padding: 10px 12px; overflow-wrap: anywhere; border: 1px solid var(--border); border-radius: 5px; background: #f6f8f7; color: var(--text-secondary); font-family: var(--font-mono); font-size: .72rem; }
@media (max-width: 600px) {
    body.v2-console .modal-backdrop.dc-confirm-backdrop { align-items: flex-end; padding: 12px; }
    body.v2-console .confirm-dialog { width: 100%; max-height: calc(100vh - 24px); }
    body.v2-console .confirm-dialog .modal-footer { display: grid; grid-template-columns: 1fr 1fr; }
    body.v2-console .confirm-dialog .modal-footer .btn { width: 100%; }
}

/* Menus, comboboxes, command search */
body.v2-console .user-menu,
body.v2-console .quicknew-menu,
body.v2-console .dc-views-panel,
body.v2-console .dc-kebab-menu,
body.v2-console .dgcb-panel,
body.v2-console .dc-mpick-panel { border: 1px solid var(--border); border-radius: 7px; background: #fff; box-shadow: var(--shadow-md); }
body.v2-console .user-menu-item,
body.v2-console .dc-kebab-item { min-height: 34px; border-radius: 4px; color: var(--text-secondary); font-size: .73rem; }
body.v2-console .user-menu-item:hover,
body.v2-console .dc-kebab-item:hover { color: var(--text-primary); background: var(--bg-hover); }
body.v2-console .cmdk { border: 1px solid var(--border); border-radius: 8px; background: #fff; box-shadow: var(--shadow-lg); }
body.v2-console .cmdk-input { border-bottom-color: var(--border); }
body.v2-console .cmdk-item.active { background: var(--accent-subtle); }

/* Toasts and notices */
body.v2-console .toast { border: 1px solid var(--border); border-left-width: 3px; border-radius: 6px; background: #fff; box-shadow: var(--shadow-md); }
body.v2-console .form-notice,
body.v2-console .notice,
body.v2-console .dash-since { border: 1px solid var(--border); border-radius: 6px; background: #f7f9f8; }
body.v2-console .form-notice.error { border-color: #edcaca; background: var(--danger-subtle); }
body.v2-console .form-notice.success { border-color: #c9e2d4; background: var(--success-subtle); }

/* Charts */
body.v2-console .chart-legend { color: var(--text-muted); font-size: .65rem; }
body.v2-console .chart-grid { stroke: #e6ebe9; }
body.v2-console .donut { filter: none; }
body.v2-console .donut-tooltip,
body.v2-console .chart-tooltip { border: 1px solid var(--border); border-radius: 5px; color: var(--text-primary); background: #fff; box-shadow: var(--shadow-sm); }

/* Remove light-mode-incompatible decoration from copied pages */
body.v2-console .page-header::after,
body.v2-console .card::before,
body.v2-console .auth-aside::before { display: none; }
body.v2-console .theme-toggle { display: none !important; }

/* Responsive */
@media (max-width: 1180px) {
    :root { --content-pad: 22px; }
    .v2-search-trigger { width: 170px; }
}
@media (max-width: 1024px) {
    html[data-sidebar="collapsed"] .v2-sidebar,
    .v2-sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: min(280px, calc(100vw - 48px)); height: 100vh; flex-basis: auto; transform: translateX(-102%); box-shadow: var(--shadow-lg); transition: transform var(--transition); }
    .v2-sidebar.is-open { transform: translateX(0); }
    .v2-sidebar-close { display: block; }
    html[data-sidebar="collapsed"] .v2-brand > span,
    html[data-sidebar="collapsed"] .v2-nav-label,
    html[data-sidebar="collapsed"] .v2-nav-text,
    html[data-sidebar="collapsed"] .v2-account-copy,
    html[data-sidebar="collapsed"] .v2-account > svg { display: flex; }
    html[data-sidebar="collapsed"] .v2-nav-item { justify-content: flex-start; padding: 7px 9px; }
    html[data-sidebar="collapsed"] .v2-nav-section + .v2-nav-section { margin-top: 16px; padding-top: 0; border-top: 0; }
    html[data-sidebar="collapsed"] .v2-account { justify-content: flex-start; padding: 7px; }
    html[data-sidebar="collapsed"] .v2-account-menu { right: 9px; bottom: calc(100% + 7px); left: 9px; width: auto; }
    .dc-side-backdrop { position: fixed; inset: 0; border: 0; background: rgba(18, 27, 25, .42); z-index: 80; }
    body.dc-nav-open { overflow: hidden; }
}
@media (max-width: 760px) {
    :root { --content-pad: 16px; }
    .v2-topbar { padding: 0 12px; }
    .v2-org-switcher { max-width: 180px; min-width: 0; }
    .v2-search-trigger { width: 34px; padding: 0; justify-content: center; border-color: transparent; background: transparent; }
    .v2-search-trigger > span,
    .v2-search-trigger kbd { display: none; }
    .v2-page-header,
    body.v2-console .page-header { align-items: stretch; flex-direction: column; gap: 12px; }
    body.v2-console .page-header-actions { justify-content: flex-start; }
    body.v2-console .selector-row,
    body.v2-console .toolbar { align-items: stretch; flex-direction: column; }
    body.v2-console .selector-group,
    body.v2-console .selector-group .form-control { width: 100%; }
    body.v2-console .modal-backdrop { align-items: flex-end; padding: 0; }
    body.v2-console .modal,
    body.v2-console .modal.lg,
    body.v2-console .modal.xl { width: 100%; max-height: calc(100vh - 20px); border-right: 0; border-bottom: 0; border-left: 0; border-radius: 8px 8px 0 0; }
    body.v2-console .drawer { width: 100%; }
    .dc-env-badge { display: none; }
    .dc-mobile-nav { position: fixed; z-index: 65; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); left: 10px; display: grid; grid-template-columns: repeat(5, 1fr); min-height: 58px; padding: 5px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.96); box-shadow: 0 10px 32px rgba(22,34,31,.18); backdrop-filter: blur(14px); }
    .dc-mobile-nav a, .dc-mobile-nav button { display: flex; min-width: 0; min-height: 46px; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 4px 2px; border: 0; border-radius: 8px; color: var(--text-muted); background: transparent; font: inherit; font-size: .58rem; font-weight: 650; text-decoration: none; }
    .dc-mobile-nav svg { width: 17px; height: 17px; }
    .dc-mobile-nav .is-active { color: var(--accent); background: var(--accent-subtle); }
    .v2-main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}

/* Endpoints */
.v2-endpoints .ep-scope { margin-bottom: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 7px; background: #fff; }
.v2-endpoints .ep-scope .selector-group { width: min(100%, 340px); }
.v2-endpoints .ep-stats { gap: 8px; margin-bottom: 14px; }
.v2-endpoints .ep-stat { min-height: 66px; padding: 10px 12px; border-radius: 6px; box-shadow: none; }
.v2-endpoints .ep-stat:hover { transform: none; box-shadow: none; }
.v2-endpoints .ep-stat.active { border-color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); background: var(--accent-subtle); }
.v2-endpoints .ep-stat.active::before { display: none; }
.v2-endpoints .ep-stat-label { font-size: .65rem; letter-spacing: 0; text-transform: none; }
.v2-endpoints .ep-stat-value { margin-top: 4px; font-size: 1.18rem; }
.v2-endpoints .ep-filter-card { border-radius: 7px; }
.v2-endpoints .ep-filters { gap: 9px; }
.v2-endpoints .ep-filters .filter-group label { letter-spacing: 0; text-transform: none; }
.v2-endpoints .ep-os-avatar { border-radius: 6px; }
.v2-endpoints .ep-status-pill,
.v2-endpoints .ep-gchip { border-radius: 4px; }
.v2-endpoints .ep-bulkbar { position: sticky; top: 64px; z-index: 25; flex-wrap: wrap; border-radius: 6px; background: #f0f8f5; }
.v2-endpoints #ep-table tbody tr:hover { background: #f7faf9; }
.v2-endpoints #ep-table .col-actions { text-align: right; }
@media (max-width: 900px) {
    .v2-endpoints .ep-stats { grid-template-columns: repeat(3, 1fr); }
    .v2-endpoints .ep-filters .grow { flex-basis: 100%; }
}

/* Endpoint detail */
.v2-endpoint-detail .ep-back { margin-bottom: 12px; color: var(--accent); font-size: .74rem; font-weight: 650; }
.v2-endpoint-detail .ep-back::before { content: "<"; margin-right: 5px; }
.v2-endpoint-detail .ep-hero { grid-template-columns: 58px minmax(0, 1fr) auto; gap: 16px; }
.v2-endpoint-detail .ep-hero-avatar { width: 58px; height: 58px; border-radius: 7px; }
.v2-endpoint-detail .ep-hero-avatar svg { width: 29px; height: 29px; }
.v2-endpoint-detail .ep-hero-avatar img { width: 38px; height: 38px; }
.v2-endpoint-detail .ep-hero-avatar .pulse { right: -3px; bottom: -3px; width: 15px; height: 15px; border-width: 2px; }
.v2-endpoint-detail .ep-hero-host { font-size: 1.2rem; letter-spacing: 0; }
.v2-endpoint-detail .ep-hero-sub { gap: 5px 14px; font-size: .74rem; }
.v2-endpoint-detail .ep-hero-actions .row { flex-wrap: wrap; justify-content: flex-end; }
.v2-endpoint-detail .ep-status-pill,
.v2-endpoint-detail .ep-hero-gchip { border-radius: 4px; }
.v2-endpoint-detail .metric-grid { gap: 10px; margin-bottom: 14px; }
.v2-endpoint-detail .ep-grid { gap: 12px; margin-bottom: 14px; }
.v2-endpoint-detail .panel-title { margin-bottom: 12px; letter-spacing: 0; text-transform: none; }
@media (max-width: 900px) {
    .v2-endpoint-detail .ep-hero { grid-template-columns: 48px minmax(0, 1fr); }
    .v2-endpoint-detail .ep-hero-avatar { width: 48px; height: 48px; }
    .v2-endpoint-detail .ep-hero-actions { grid-column: 1 / -1; align-items: flex-start; }
    .v2-endpoint-detail .ep-hero-actions .row { justify-content: flex-start; }
}

/* Policies */
.v2-policies .pol-scope { margin-bottom: 16px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 7px; background: #fff; }
.v2-policies .pol-scope .selector-group { width: min(100%, 340px); }
.v2-policies .pol-tabs { margin-bottom: 16px; }
.v2-policies .pol-tab { min-height: 38px; padding: 8px 12px; letter-spacing: 0; }
.v2-policies .pol-tab .cnt { border-radius: 4px; }
.v2-policies .pol-insights { margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.v2-policies .pol-insights > summary { width: max-content; margin-bottom: 12px; color: var(--accent); cursor: pointer; font-size: .72rem; font-weight: 650; }
.v2-policies .pol-insights .viz-grid { padding-bottom: 14px; }
.v2-policies .toolbar { align-items: flex-end; padding: 0; border: 0; background: transparent; }
.v2-policies .pol-toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.pol-actions-menu { position: relative; }
.pol-actions-menu > summary { list-style: none; cursor: pointer; }
.pol-actions-menu > summary::-webkit-details-marker { display: none; }
.pol-actions-popover { position: absolute; z-index: 45; top: calc(100% + 6px); right: 0; display: grid; width: 210px; padding: 6px; border: 1px solid var(--border); border-radius: 6px; background: #fff; box-shadow: var(--shadow-md); }
.pol-actions-popover .btn { justify-content: flex-start; width: 100%; }
.v2-policies .chip { border-radius: 4px; }
#modal-policy .modal { height: min(820px, calc(100vh - 48px)); }
#modal-policy .modal-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
#modal-policy .section-label { margin-top: 24px; letter-spacing: 0; text-transform: none; color: var(--text-primary); font-size: .8rem; }
#modal-policy .inline-form { border-radius: 6px; background: #f7f9f8; }
#modal-policy .inline-form label { letter-spacing: 0; text-transform: none; }
#modal-policy .manage-rules-card { margin-bottom: 6px; }
#modal-policy .manage-rules-card .table-wrap { max-height: none; overflow-x: auto; }

/* Groups */
.v2-groups .grp-scope { margin-bottom: 16px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 7px; background: #fff; }
.v2-groups .grp-scope .selector-group { width: min(100%, 340px); }
.v2-groups .grp-insights { margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.v2-groups .grp-insights > summary { width: max-content; margin-bottom: 12px; color: var(--accent); cursor: pointer; font-size: .72rem; font-weight: 650; }
.v2-groups .grp-insights .viz-grid { padding-bottom: 14px; }
.v2-groups .toolbar { padding: 0; border: 0; background: transparent; }
.grp-actions-menu { position: relative; }
.grp-actions-menu > summary { list-style: none; cursor: pointer; }
.grp-actions-menu > summary::-webkit-details-marker { display: none; }
.grp-actions-popover { position: absolute; z-index: 45; top: calc(100% + 6px); right: 0; display: grid; width: 170px; padding: 6px; border: 1px solid var(--border); border-radius: 6px; background: #fff; box-shadow: var(--shadow-md); }
.grp-actions-popover .btn { justify-content: flex-start; }
#modal-group .modal { height: min(740px, calc(100vh - 48px)); }
#modal-group .modal-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
#modal-group .section-label { letter-spacing: 0; text-transform: none; color: var(--text-primary); font-size: .8rem; }
#modal-group .inline-form { border-radius: 6px; background: #f7f9f8; }
@media (max-width: 760px) {
    .v2-policies .pol-toolbar-actions { width: 100%; justify-content: flex-start; }
    .v2-policies #pol-search { width: 100% !important; }
    #modal-policy .modal { height: calc(100vh - 20px); }
}
@media (max-width: 480px) {
    body.v2-console { font-size: 13px; }
    .v2-main { padding-top: 16px; }
    .v2-org-switcher { max-width: 145px; }
    body.v2-console .page-header-actions .btn { flex: 1 1 auto; }
    body.v2-console .card-body { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}

/* R11-05: coarse pointers get WCAG-sized interactive targets without making
   the denser desktop console feel oversized. */
@media (pointer: coarse) {
    body.v2-console .btn,
    body.v2-console .btn-sm,
    body.v2-console .btn-icon,
    body.v2-console .v2-icon-button,
    body.v2-console .tab,
    body.v2-console .pol-tab,
    body.v2-console .seg-btn,
    body.v2-console .seg-control button,
    body.v2-console summary { min-width: 44px; min-height: 44px; }
    body.v2-console input[type="checkbox"],
    body.v2-console input[type="radio"] { width: 20px; height: 20px; }
}

/* R11-06: the persistent connection state stays above drawers and remains
   readable on narrow screens. */
.dc-offline-bar { position: fixed; z-index: 10020; right: 16px; bottom: 16px; left: 16px; max-width: 680px; margin-inline: auto; padding: 11px 15px; border: 1px solid #e4c480; border-radius: 6px; color: #62430f; background: #fff7e6; box-shadow: var(--shadow-md); font-size: .76rem; line-height: 1.45; text-align: center; }
.dc-offline-bar strong { margin-right: 4px; color: #51370d; }

/* Authentication */
body.v2-auth { min-height: 100vh; margin: 0; display: grid; grid-template-rows: 72px 1fr 56px; color: var(--text-primary); background: #f6f8f7; font-family: Inter, system-ui, sans-serif; }
.v2-auth-header { display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(20px, 4vw, 56px); border-bottom: 1px solid var(--border); background: #fff; }
.v2-auth-brand { display: inline-flex; align-items: center; gap: 10px; color: #15211e; font-size: .94rem; font-weight: 700; text-decoration: none; }
.v2-auth-brand img { width: 27px; height: 27px; object-fit: contain; }
.v2-auth-product { color: var(--text-muted); font-size: .74rem; font-weight: 600; }
.v2-auth-main { display: grid; place-items: center; width: 100%; padding: 40px 20px; }
.v2-auth-panel { width: min(100%, 420px); padding: 34px 36px 30px; border: 1px solid var(--border); border-radius: 8px; background: #fff; box-shadow: 0 12px 35px rgba(20, 37, 32, .07); }
.v2-auth-panel .auth-brand { margin: 0 0 9px; padding: 0; text-align: left; }
.v2-auth-eyebrow { margin: 0; color: var(--accent); font-size: .7rem; font-weight: 700; text-transform: uppercase; }
.v2-auth-panel .auth-title { margin: 0; color: #15211e; font-size: 1.58rem; line-height: 1.25; letter-spacing: 0; }
.v2-auth-panel .auth-subtitle { margin: 8px 0 26px; color: var(--text-secondary); font-size: .84rem; line-height: 1.55; }
.v2-auth-panel .form-group { margin-bottom: 17px; }
.v2-auth-panel .form-group label { color: var(--text-primary); font-size: .74rem; font-weight: 600; }
.v2-auth-panel .form-control { min-height: 42px; border-color: #cfd8d5; border-radius: 5px; background: #fff; }
.v2-auth-panel .form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }
.v2-auth-panel .pw-toggle { right: 8px; color: var(--accent); font-size: .7rem; font-weight: 700; text-transform: none; }
.v2-caps-warning { margin-top: 6px; color: var(--warning); }
.v2-auth-panel .auth-alert { margin-bottom: 18px; border-radius: 5px; font-size: .78rem; line-height: 1.45; }
.v2-auth-panel .btn-lg { min-height: 42px; border-radius: 5px; font-size: .8rem; }
.v2-auth-panel .btn-ms { display: inline-flex; align-items: center; justify-content: center; gap: 10px; color: var(--text-primary); border: 1px solid var(--border); background: #fff; font-weight: 600; }
.v2-auth-panel .btn-ms:hover { border-color: #bdc9c5; background: var(--bg-hover); }
.v2-auth-panel .auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text-muted); font-size: .68rem; }
.v2-auth-panel .auth-divider::before,
.v2-auth-panel .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.v2-auth-footer { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: .76rem; text-align: center; }
.v2-auth-footer a { color: var(--accent); font-weight: 650; }
.v2-auth-legal { display: grid; place-items: center; color: var(--text-muted); font-size: .67rem; }
body.v2-auth .auth-aside[hidden] { display: none !important; }
.v2-auth-panel.wlc-card { width: min(100%, 520px); }
.wlc-panel { padding: 16px; border: 1px solid var(--border); border-radius: 6px; background: #fbfcfc; }
.wlc-panel h2 { margin: 3px 0 5px; color: var(--text-primary); font-size: .9rem; letter-spacing: 0; }
.wlc-panel p { margin: 0 0 12px; color: var(--text-secondary); font-size: .78rem; line-height: 1.5; }
.wlc-step { color: var(--text-muted); font-size: .64rem; font-weight: 700; text-transform: uppercase; }
.wlc-id { display: flex; align-items: stretch; gap: 8px; }
.wlc-id code { min-width: 0; flex: 1; padding: 9px 10px; overflow-wrap: anywhere; border: 1px solid var(--border); border-radius: 5px; background: #fff; font-family: var(--font-mono); font-size: .76rem; }
.wlc-meta { margin-top: 9px; color: var(--text-muted); font-size: .69rem; line-height: 1.45; }
.wlc-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--text-muted); font-size: .65rem; font-weight: 650; text-transform: uppercase; }
.wlc-or::before, .wlc-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Dashboard */
.v2-dashboard .dashboard-scope { margin-bottom: 18px; padding: 14px 16px 12px; border: 1px solid var(--border); border-radius: 7px; background: #fff; }
.v2-dashboard .selector-card { padding: 0; border: 0; background: transparent; }
.v2-dashboard .selector-card .selector-group { min-width: 170px; }
.v2-dashboard .selector-meta-note { padding: 7px 10px; border-radius: 5px; color: var(--text-secondary); background: var(--bg-subtle); font-size: .7rem; font-weight: 650; white-space: nowrap; }
.v2-dashboard .selector-card .selector-meta { margin-left: auto; }
.v2-dashboard .log-chips { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--border); }
.v2-dashboard .log-chip { min-height: 28px; padding: 5px 9px; border: 0; border-radius: 4px; color: var(--text-secondary); background: var(--bg-subtle); font-size: .69rem; font-weight: 600; }
.v2-dashboard .log-chip:hover { color: var(--accent); background: var(--accent-subtle); }
.v2-dashboard .kpi-windowbar { margin: 0 0 9px; }
.v2-dashboard .metric-grid { gap: 10px; margin-bottom: 10px; }
.v2-dashboard .metric-card { min-width: 0; padding: 14px; border-radius: 6px; }
.v2-dashboard .section-heading { margin-top: 30px; padding-bottom: 9px; border-bottom: 1px solid var(--border); }
.v2-dashboard .section-title { padding-left: 0; }
.v2-dashboard .section-title::before { display: none; }
.v2-dashboard .section-sub { margin-top: 3px; color: var(--text-muted); font-size: .7rem; }
.v2-dashboard .dash-grid { gap: 12px; margin-bottom: 12px; }
.v2-dashboard .card,
.v2-dashboard .chart-card { border-radius: 7px; }
.v2-dashboard .chart-icon { display: none; }
.v2-dashboard .chart-hint { color: var(--accent); font-size: .69rem; font-weight: 600; }
@media (max-width: 760px) {
    .v2-dashboard .dashboard-scope { padding: 12px; }
    .v2-dashboard .selector-card .selector-meta { margin-left: 0; }
    .v2-dashboard .log-chips { overflow-x: auto; flex-wrap: nowrap; }
    .v2-dashboard .log-chip { flex: 0 0 auto; }
}
@media (max-width: 520px) {
    body.v2-auth { grid-template-rows: 64px 1fr 44px; background: #fff; }
    .v2-auth-header { padding: 0 18px; }
    .v2-auth-main { align-items: start; padding: 34px 18px 20px; }
    .v2-auth-panel { padding: 0; border: 0; box-shadow: none; }
}

/* Event log */
.obs-scope { margin-bottom: 16px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 7px; background: #fff; }
.obs-scope .selector-group { width: min(100%, 340px); }
.v2-events .filters-bar { gap: 9px; }
.v2-events .filter-group label,
.v2-events .log-chips-lbl { letter-spacing: 0; text-transform: none; }
.obs-actions-menu { position: relative; align-self: flex-end; }
.obs-actions-menu > summary { list-style: none; cursor: pointer; }
.obs-actions-menu > summary::-webkit-details-marker { display: none; }
.obs-actions-popover { position: absolute; z-index: 45; top: calc(100% + 6px); right: 0; display: grid; width: 200px; padding: 6px; border: 1px solid var(--border); border-radius: 6px; background: #fff; box-shadow: var(--shadow-md); }
.obs-actions-popover .btn { justify-content: flex-start; width: 100%; }
.obs-insights { margin: 12px 0 18px; padding-top: 10px; border-top: 1px solid var(--border); }
.obs-insights > summary { width: max-content; margin-bottom: 12px; color: var(--accent); cursor: pointer; font-size: .72rem; font-weight: 650; }
.v2-events .log-stats { margin-bottom: 8px; }
@media (max-width: 760px) { .v2-events .filter-group, .v2-events .filter-group .form-control { width: 100%; } }

/* Activity */
.v2-activity .act-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 7px; background: #fff; }
.v2-activity .act-chips { gap: 0; padding: 3px; border: 1px solid var(--border); border-radius: 6px; background: #eef1f0; }
.v2-activity .act-chip { min-height: 30px; padding: 5px 10px; border: 0; border-radius: 4px; color: var(--text-muted); background: transparent; font-size: .69rem; }
.v2-activity .act-chip.active { color: var(--text-primary); background: #fff; box-shadow: var(--shadow-xs); }
.v2-activity .act-feed { padding: 0 4px; }
.v2-activity .act-item { grid-template-columns: 26px minmax(0, 1fr) auto; padding: 13px 2px; }
.v2-activity .act-ico { width: 24px; height: 24px; border-radius: 5px; font-size: .65rem; font-weight: 750; }
.v2-activity .act-kind { letter-spacing: 0; }
@media (max-width: 760px) {
    .v2-activity .act-controls { align-items: stretch; flex-direction: column; }
    .v2-activity .act-controls > div:last-child { align-items: stretch !important; flex-direction: column; }
    .v2-activity #act-search, .v2-activity #act-range { width: 100% !important; }
    .v2-activity .act-item { grid-template-columns: 24px minmax(0, 1fr); }
    .v2-activity .act-meta { grid-column: 2; align-items: flex-start; flex-direction: row; }
}

/* Audit trail */
.v2-audit .filters-bar { gap: 9px; }
.v2-audit .filter-group label { letter-spacing: 0; text-transform: none; }
.v2-audit .log-stats { margin-bottom: 8px; }
@media (max-width: 760px) { .v2-audit .filter-group, .v2-audit .filter-group .form-control { width: 100%; } }

/* Alerts */
.v2-alerts .alert-scope .selector-row { justify-content: space-between; }
.v2-alerts .stat-row { gap: 10px; }
.v2-alerts .stat-card { border-radius: 6px; box-shadow: none; }
.v2-alerts .form-group label { letter-spacing: 0; text-transform: none; }
.v2-alerts #al-triage-card { border-color: var(--danger); }
@media (max-width: 760px) { .v2-alerts .alert-scope-actions { width: 100%; justify-content: flex-start; } }

/* Alert rules */
.v2-alert-rules .alert-rules-scope .selector-row { justify-content: space-between; }
.v2-alert-rules #rules-content > .card { border-radius: 7px; }
.v2-alert-rules .col-actions { text-align: right; }
#modal-rule .modal { height: min(820px, calc(100vh - 48px)); }
#modal-rule .modal-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
#modal-rule .section-title { display: flex; align-items: center; gap: 8px; margin: 24px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); color: var(--text-primary); font-size: .82rem; letter-spacing: 0; text-transform: none; }
#modal-rule .section-title span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 4px; color: var(--accent); background: var(--accent-subtle); font-size: .68rem; }
@media (max-width: 760px) { .v2-alert-rules .alert-rules-actions { width: 100%; flex-wrap: wrap; } #modal-rule .modal { height: calc(100vh - 20px); } }

/* Compliance */
.v2-compliance .compliance-actions { display: flex; align-items: center; gap: 8px; }
.v2-compliance #open-checklist-btn { gap: 8px; }
.v2-compliance .checklist-trigger-dot { border: 1px solid rgba(255,255,255,.7); }
.v2-compliance .section-heading { margin-top: 28px; }
.v2-compliance .score-panel { padding: 4px 0; }
#modal-checklist .modal { height: min(780px, calc(100vh - 48px)); }
#modal-checklist .modal-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 760px) {
    .v2-compliance .compliance-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
    .v2-compliance .section-heading > div:last-child { width: 100%; flex-wrap: wrap; }
    .v2-compliance #analytics-dept { width: 100% !important; }
    .v2-compliance .seg-control { max-width: 100%; overflow-x: auto; }
    #modal-checklist .modal { height: calc(100vh - 20px); }
}

/* Risk */
.v2-risk .metric-grid { gap: 10px; }
.v2-risk .metric-card { border-radius: 6px; }
.v2-risk #risk-ep-table a { font-weight: 650; }
.v2-risk .panel-title { letter-spacing: 0; text-transform: none; }

/* Reports */
.v2-reports .rep-grid { gap: 12px; }
.v2-reports .rep-kpis { gap: 10px; }
.v2-reports .rep-kpi { border-radius: 6px; background: #fff; }
.v2-reports .rep-kpi .l { letter-spacing: 0; text-transform: none; }
.v2-reports .panel-title { letter-spacing: 0; text-transform: none; }
.v2-reports #rep-window { margin-bottom: 14px; }
@media print { .obs-actions-menu { display: none !important; } }

/* Organisation */
.v2-org .org-scope .selector-row { justify-content: space-between; }
.v2-org .card-header .icon { display: none; }
.v2-org .card-header h2 { letter-spacing: 0; }
.v2-org .section-title { letter-spacing: 0; text-transform: none; color: var(--text-primary); }
.v2-org .setting-row { gap: 20px; }
.v2-org .key-display { flex-wrap: wrap; }
.v2-org .org-danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 28px; padding: 18px; border: 1px solid #e6c7c7; border-radius: 7px; background: var(--danger-subtle); }
.v2-org .org-danger-zone h2 { margin: 0 0 4px; color: var(--danger); font-size: .9rem; letter-spacing: 0; }
.v2-org .org-danger-zone p { margin: 0; color: var(--text-secondary); font-size: .74rem; }
@media (max-width: 760px) {
    .v2-org .org-danger-zone { align-items: stretch; flex-direction: column; }
    .v2-org .setting-row { align-items: stretch; flex-direction: column; gap: 10px; }
    .v2-org .setting-value { align-items: stretch; flex-wrap: wrap; }
    .v2-org .setting-value .form-control { width: 100% !important; }
    .deploy-agent-actions { display: grid !important; grid-template-columns: 1fr 1fr; }
    .deploy-agent-actions .btn { width: 100%; min-height: 38px; }
}
@media (max-width: 440px) {
    .deploy-agent-actions { grid-template-columns: 1fr; }
}

/* Console-wide responsive hardening: charts stay fluid, dense control rows
   wrap, and data tables scroll within the viewport instead of the page. */
body.v2-console svg { max-width: 100%; }
body.v2-console .card,
body.v2-console .card-body,
body.v2-console .viz-grid > *,
body.v2-console .dash-grid > * { min-width: 0; }
body.v2-console .table-wrap { max-width: 100%; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
@media (max-width: 760px) {
    body.v2-console .section-heading { align-items: stretch; flex-direction: column; gap: 10px; }
    body.v2-console .section-heading > div:last-child { justify-content: flex-start; }
    body.v2-console .modal-footer { flex-wrap: wrap; }
    body.v2-console .modal-footer .btn { min-height: 40px; }
    body.v2-console .form-control { max-width: 100%; }
    .v2-reports .rep-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 440px) {
    .v2-reports .rep-kpis { grid-template-columns: 1fr; }
}

/* Users */
.v2-users .users-card-header { align-items: center; }
.v2-users .users-card-header h2 { margin-bottom: 3px; letter-spacing: 0; }
.v2-users .users-card-header p { margin: 0; }
.v2-users .users-primary-actions { display: flex; align-items: center; gap: 8px; }
.v2-users .users-toolbar { display: grid; grid-template-columns: minmax(190px, 1fr) 150px 160px; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: #f8faf9; }
.v2-users .users-toolbar .form-control { width: 100%; font-size: .76rem; }
.v2-users #member-stats { padding-top: 10px !important; }
.v2-users .col-actions { text-align: right; }
.obs-actions-popover > button { display: flex; align-items: center; width: 100%; min-height: 34px; padding: 7px 9px; border: 0; border-radius: 4px; color: var(--text-primary); background: transparent; cursor: pointer; font: inherit; font-size: .74rem; text-align: left; }
.obs-actions-popover > button:hover,
.obs-actions-popover > button:focus-visible { background: var(--accent-subtle); outline: none; }
.obs-actions-popover,
.pol-actions-popover,
.grp-actions-popover,
.policy-actions-popover,
.dc-colchooser-menu { max-width: calc(100vw - 32px); max-height: min(420px, calc(100vh - 96px)); overflow-y: auto; overscroll-behavior: contain; }
.modal-compact { width: min(100%, 520px); }
.field-help { margin: 6px 0 0; color: var(--text-muted); font-size: .7rem; line-height: 1.45; }
@media (max-width: 760px) {
    .v2-users .users-card-header { align-items: stretch; flex-direction: column; }
    .v2-users .users-primary-actions { justify-content: space-between; width: 100%; }
    .v2-users .users-toolbar { grid-template-columns: 1fr; }
    .v2-users .table-wrap { overflow-x: auto; }
}

/* Single sign-on */
.v2-sso { display: flex; flex-direction: column; gap: 16px; max-width: 920px; }
.v2-sso .card { border-radius: 7px; }
.v2-sso .card-header h2 { margin-bottom: 3px; letter-spacing: 0; }
.v2-sso .card-header p { margin: 0; }
.sso-scope { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 0; }
.sso-scope form { width: min(100%, 340px); }
.sso-status { display: inline-flex; align-items: center; gap: 7px; margin: 0; color: var(--text-secondary); font-size: .74rem; font-weight: 650; }
.sso-dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; }
.sso-on { background: var(--success); }
.sso-off { background: var(--text-muted); }
.sso-form { display: grid; gap: 16px; }
.sso-form .form-group { margin: 0; }
.sso-row { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 14px; }
.sso-tenant { display: grid; gap: 5px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 6px; background: #f8faf9; }
.sso-tenant span { color: var(--text-muted); font-size: .67rem; font-weight: 650; }
.sso-tenant code { overflow-wrap: anywhere; color: var(--text-primary); font-family: var(--font-mono); font-size: .73rem; }
.sso-switches { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sso-check { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.sso-check input { margin-top: 2px; }
.sso-check span { display: grid; gap: 3px; }
.sso-check strong { color: var(--text-primary); font-size: .75rem; }
.sso-check small { color: var(--text-muted); font-size: .68rem; line-height: 1.4; }
.sso-kv { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sso-danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 18px; border-top: 1px solid #e8cdcd; background: var(--danger-subtle); }
.sso-danger-zone strong { color: var(--danger); font-size: .75rem; }
.sso-danger-zone p { margin: 3px 0 0; color: var(--text-secondary); font-size: .68rem; }
.sso-empty { padding-block: 28px; }
.sso-empty h3 { margin: 0 0 6px; font-size: .88rem; }
.sso-empty > p { max-width: 620px; margin: 0 0 16px; color: var(--text-secondary); font-size: .75rem; line-height: 1.55; }
.sso-connect-form { margin: 0; }
.sso-reference { border: 1px solid var(--border); border-radius: 7px; background: #fff; }
.sso-reference > summary { padding: 14px 16px; color: var(--text-primary); cursor: pointer; font-size: .76rem; font-weight: 650; }
.sso-reference-body { padding: 0 18px 18px; border-top: 1px solid var(--border); }
.sso-reference-body > p { color: var(--text-secondary); font-size: .74rem; }
.sso-steps { margin: 0; padding-left: 20px; color: var(--text-secondary); font-size: .73rem; line-height: 1.75; }
.sso-steps code { padding: 1px 4px; border-radius: 3px; background: #edf1ef; font-family: var(--font-mono); font-size: .7rem; }
.sso-uri { margin: 7px 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 5px; background: #f8faf9; font-family: var(--font-mono); font-size: .7rem; overflow-wrap: anywhere; }
@media (max-width: 760px) {
    .sso-scope { align-items: stretch; flex-direction: column; }
    .sso-scope form { width: 100%; }
    .sso-row, .sso-switches { grid-template-columns: 1fr; }
    .sso-danger-zone { align-items: stretch; flex-direction: column; }
}

/* Settings */
.v2-settings { display: grid; gap: 16px; max-width: 960px; }
.v2-settings .settings-section { margin: 0; border-radius: 7px; }
.v2-settings .card-header { padding: 15px 18px; }
.v2-settings .card-header h2 { margin: 0 0 3px; font-size: .86rem; letter-spacing: 0; }
.v2-settings .card-header p { margin: 0; color: var(--text-muted); font-size: .7rem; }
.v2-settings .settings-grid { padding: 0 18px; }
.v2-settings .set-row { min-height: 66px; padding: 13px 0; border-color: var(--border); }
.v2-settings .set-row-top { align-items: flex-start; }
.v2-settings .set-label { color: var(--text-primary); font-size: .76rem; }
.v2-settings .set-hint { margin-top: 3px; color: var(--text-muted); font-size: .69rem; line-height: 1.45; }
.v2-settings .set-control { width: min(100%, 250px); }
.v2-settings .set-control > .form-control { width: 100%; }
.v2-settings .set-control:has(.toggle-switch) { width: auto; }
.settings-fixed-value { display: inline-flex; align-items: center; min-height: 32px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 5px; color: var(--text-secondary); background: #f8faf9; font-size: .72rem; font-weight: 650; }
.settings-button-group { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.v2-settings .pin-list { gap: 5px; max-height: 190px; }
.v2-settings .pin-row { min-height: 34px; padding: 7px 9px; border-radius: 5px; color: var(--text-secondary); background: #fff; }
.v2-settings .pin-row input { margin: 0; accent-color: var(--accent); }
.v2-settings .pin-row.pinned { border-color: #9bbcb0; color: var(--text-primary); background: var(--accent-subtle); }
@media (max-width: 720px) {
    .v2-settings .set-row { align-items: stretch; flex-direction: column; gap: 10px; }
    .v2-settings .set-control { width: 100%; }
    .v2-settings .set-control:has(.toggle-switch) { width: auto; }
    .settings-button-group { justify-content: flex-start; }
}

/* ── 2026-07-20 audit: no coloured edge pills on cards/divs ──────────────
   Tone/severity is carried by a uniform 1px border colour (and existing
   icons/badges) instead of a thicker coloured left edge. */
body.v2-console .section-heading .section-title { padding-left: 0; }
body.v2-console .section-heading .section-title::before { display: none; }
body.v2-console .toast { border-left-width: 1px; }
body.v2-console .toast.success { border-color: var(--success); }
body.v2-console .toast.error   { border-color: var(--danger); }
body.v2-console .toast.warning { border-color: var(--warning); }
body.v2-console .toast.info    { border-color: var(--accent); }
body.v2-console .dc-notice { border-left-width: 1px; }
body.v2-console .ep-peer-row.tone-danger  { border-left-width: 1px; border-color: var(--danger); }
body.v2-console .ep-peer-row.tone-success { border-left-width: 1px; border-color: var(--success); }
body.v2-console .ep-peer-row.tone-muted   { border-left-width: 1px; border-color: var(--border-strong); }
