/* ==========================================================================
   PERICLES — Apple-Inspired Design System
   Soft, smooth, white & grey palette
   ========================================================================== */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---- CSS Variables ---- */
:root {
    /* Primary — Soft dark slate */
    --color-primary: #1d1d1f;
    --color-primary-light: #424245;
    --color-primary-lighter: #6e6e73;

    /* Surfaces */
    --card-bg: #ffffff;

    /* Greys — Apple-like progression */
    --grey-50: #fbfbfd;
    --grey-100: #f5f5f7;
    --grey-200: #e8e8ed;
    --grey-300: #d2d2d7;
    --grey-400: #b0b0b6;
    --grey-500: #86868b;
    --grey-600: #6e6e73;
    --grey-700: #424245;
    --grey-800: #1d1d1f;

    /* Accent — Subtle blue */
    --color-accent: #0071e3;
    --color-accent-hover: #0077ed;
    --color-accent-soft: rgba(0, 113, 227, 0.08);

    /* Status */
    --color-success: #30d158;
    --color-success-soft: #e8fbef;
    --color-danger: #ff3b30;
    --color-danger-soft: #fff0ef;
    --color-warning: #ff9f0a;
    --color-warning-soft: #fff8eb;
    --color-info: #64d2ff;
    --color-info-soft: #eef9ff;

    /* Surfaces */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f7;
    --bg-tertiary: #fbfbfd;
    --bg-glass: rgba(255, 255, 255, 0.72);
    --bg-glass-dark: rgba(29, 29, 31, 0.72);

    /* Text */
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-tertiary: #86868b;
    --text-inverse: #f5f5f7;

    /* Borders */
    --border-color: #d2d2d7;
    --border-light: #e8e8ed;
    --border-focus: var(--color-accent);

    /* Shadows — Ultra soft Apple-like */
    --shadow-xs: 0 0.5px 1px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.04), 0 0 1px rgba(0, 0, 0, 0.06);
    --shadow-card-hover: 0 8px 30px rgba(0, 0, 0, 0.08), 0 0 1px rgba(0, 0, 0, 0.08);

    /* Radius */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 0.3s var(--ease-smooth);
    --transition-fast: 0.15s var(--ease-smooth);
    --transition-slow: 0.5s var(--ease-smooth);

    /* Layout */
    --max-width: 1200px;
    --max-width-narrow: 980px;
    --header-height: 48px;
    --section-padding: 120px;
}

/* ---- Dark Mode ---- */
[data-theme="dark"] {
    --color-primary: #f5f5f7;
    --color-primary-light: #d2d2d7;
    --color-primary-lighter: #b0b0b6;

    --card-bg: #1c1c1e;

    --bg-primary: #1d1d1f;
    --bg-secondary: #2c2c2e;
    --bg-tertiary: #242426;
    --bg-glass: rgba(29, 29, 31, 0.82);

    --text-primary: #f5f5f7;
    --text-secondary: #b0b0b6;
    --text-tertiary: #86868b;
    --text-inverse: #1d1d1f;

    --border-color: #424245;
    --border-light: #3a3a3c;

    --shadow-xs: 0 0.5px 1px rgba(0, 0, 0, 0.12);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.16);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.24);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.32);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.4);
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.16), 0 0 1px rgba(0, 0, 0, 0.2);
    --shadow-card-hover: 0 8px 30px rgba(0, 0, 0, 0.32), 0 0 1px rgba(0, 0, 0, 0.3);

    --color-accent-soft: rgba(0, 113, 227, 0.15);
    --color-success-soft: rgba(48, 209, 88, 0.15);
    --color-danger-soft: rgba(255, 59, 48, 0.15);
    --color-warning-soft: rgba(255, 159, 10, 0.15);
    --color-info-soft: rgba(100, 210, 255, 0.15);
}

/* ---- Accessibility: Focus Visible ---- */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-accent-hover);
}

img {
    max-width: 100%;
    display: block;
}

ul, ol {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--text-primary);
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 700; }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.text-center { text-align: center; }

/* ---- Container ---- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.container-narrow {
    max-width: var(--max-width-narrow);
    margin: 0 auto;
    padding: 0 24px;
}

/* ---- Section spacing ---- */
.section {
    padding: var(--section-padding) 0;
}

.section-grey {
    background-color: var(--bg-secondary);
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 64px;
}

.section-header h2 {
    margin-bottom: 16px;
}

.section-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.section-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 12px;
}

/* ==========================================================================
   Navigation / Header
   ========================================================================== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    z-index: 1000;
    background: var(--bg-glass);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
    transition: background var(--transition);
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.nav-logo img {
    height: 28px;
    width: auto;
}

.nav-logo .logo-icon {
    width: 28px;
    height: 28px;
    background: var(--color-primary);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 14px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--text-primary);
    opacity: 0.8;
    transition: opacity var(--transition-fast);
}

.nav-links a:hover {
    opacity: 1;
    color: var(--text-primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-lang {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
    position: relative;
}

.nav-lang:hover {
    background: var(--grey-100);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    border: 0.5px solid var(--border-light);
    min-width: 160px;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all var(--transition-fast);
    z-index: 100;
}

.lang-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 0.8125rem;
    color: var(--text-primary);
    border-radius: 6px;
    transition: background var(--transition-fast);
}

.lang-dropdown a:hover {
    background: var(--grey-100);
}

.lang-dropdown a.active {
    color: var(--color-accent);
    font-weight: 500;
    background: rgba(0, 113, 227, 0.06);
}

/* ---- User Dropdown ---- */
.nav-user {
    position: relative;
}

.nav-user-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background var(--transition-fast);
    user-select: none;
}

.nav-user-trigger:hover {
    background: var(--grey-100);
}

.nav-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.nav-user-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-user-chevron {
    color: var(--text-tertiary);
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}

.nav-user.open .nav-user-chevron {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    border: 0.5px solid var(--border-light);
    min-width: 256px;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all var(--transition-fast);
    z-index: 200;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    padding: 16px;
    border-bottom: 1px solid var(--grey-200);
}

.user-dropdown-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.user-dropdown-email {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.user-dropdown-role {
    margin-top: 8px;
    display: inline-block;
}

.user-dropdown-section {
    padding: 6px;
    border-bottom: 1px solid var(--grey-200);
}

.user-dropdown-section:last-child {
    border-bottom: none;
}

.user-dropdown-label {
    padding: 6px 12px 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    font-size: 0.8125rem;
    color: var(--text-primary);
    border-radius: 6px;
    transition: background var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
}

.user-dropdown-item:hover {
    background: var(--grey-100);
}

.user-dropdown-item svg {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.user-dropdown-empty {
    color: var(--text-tertiary);
    font-style: italic;
    cursor: default;
}

.user-dropdown-empty:hover {
    background: none;
}

.user-dropdown-logout {
    color: var(--color-danger);
}

.user-dropdown-logout svg {
    color: var(--color-danger);
}

.user-dropdown-logout:hover {
    background: var(--color-danger-soft);
}

/* Mobile menu */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    cursor: pointer;
}

.nav-toggle span {
    width: 18px;
    height: 1.5px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.9375rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
    line-height: 1;
}

.btn-primary {
    background: var(--color-accent);
    color: white;
    padding: 14px 28px;
}

.btn-primary:hover {
    background: var(--color-accent-hover);
    color: white;
    transform: scale(1.02);
}

.btn-secondary {
    background: transparent;
    color: var(--color-accent);
    padding: 14px 28px;
}

.btn-secondary:hover {
    color: var(--color-accent-hover);
    background: var(--color-accent-soft);
}

.btn-dark {
    background: var(--color-primary);
    color: white;
    padding: 14px 28px;
}

.btn-dark:hover {
    background: var(--color-primary-light);
    color: white;
    transform: scale(1.02);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1.5px solid var(--border-color);
    padding: 12px 24px;
}

.btn-outline:hover {
    border-color: var(--text-primary);
    background: var(--grey-50);
}

.btn-ghost {
    background: transparent;
    color: var(--color-accent);
    font-weight: 500;
}

.btn-ghost::after {
    content: '\2192';
    display: inline-block;
    transition: transform var(--transition-fast);
}

.btn-ghost:hover::after {
    transform: translateX(4px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 18px 36px;
    font-size: 1.0625rem;
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-card);
    border: 0.5px solid var(--border-light);
    transition: all var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-card-hover);
}

.card-flat {
    box-shadow: none;
    background: var(--bg-secondary);
    border: none;
}

.card-flat:hover {
    background: var(--grey-200);
    box-shadow: none;
}

.card-icon {
    width: 56px;
    height: 56px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 1.375rem;
    color: var(--text-primary);
    transition: all var(--transition);
}

.card:hover .card-icon {
    background: var(--color-primary);
    color: white;
}

.card h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.card p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==========================================================================
   Page Header
   ========================================================================== */
.page-header {
    padding: 160px 0 80px;
    text-align: center;
    background: var(--bg-secondary);
}

.page-header h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    margin-bottom: 16px;
}

.page-header p {
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    background: #1e293b;
    padding: 64px 0 32px;
    color: #e2e8f0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

.footer .nav-logo {
    color: #f1f5f9;
}

.footer .logo-icon {
    background: #334155;
}

.footer-brand p {
    font-size: 0.875rem;
    color: #94a3b8;
    margin-top: 12px;
    max-width: 280px;
    line-height: 1.6;
}

.footer-col h5 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin-bottom: 20px;
}

.footer-col ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-col a {
    font-size: 0.875rem;
    color: #94a3b8;
    transition: color var(--transition-fast);
}

.footer-col a:hover {
    color: #f1f5f9;
}

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid #334155;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-bottom p {
    font-size: 0.75rem;
    color: #64748b;
}

.footer-social {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-social a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #64748b;
    transition: all var(--transition-fast);
}

.footer-social a:hover {
    color: #f1f5f9;
    background: #334155;
}

/* ==========================================================================
   Dashboard Info
   ========================================================================== */
.dashboard-info {
    margin-top: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--grey-200);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.info-value {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

.role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-full, 100px);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.role-superadmin {
    background: rgba(255, 59, 48, 0.12);
    color: #c62828;
}

.role-manager {
    background: rgba(255, 149, 0, 0.12);
    color: #e65100;
}

.role-viewer {
    background: rgba(0, 113, 227, 0.10);
    color: #1565c0;
}

[data-theme="dark"] .role-superadmin {
    background: rgba(255, 59, 48, 0.18);
    color: #ff8a80;
}

[data-theme="dark"] .role-manager {
    background: rgba(255, 167, 38, 0.18);
    color: #ffb74d;
}

[data-theme="dark"] .role-viewer {
    background: rgba(66, 165, 245, 0.18);
    color: #64b5f6;
}

/* ==========================================================================
   Alerts / Flash Messages
   ========================================================================== */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-lg, 12px);
    font-size: 0.9375rem;
    line-height: 1.5;
    margin-bottom: 24px;
    border: 1px solid transparent;
}

.alert-success {
    background: var(--color-success-soft);
    color: #1a7a34;
    border-color: rgba(48, 209, 88, 0.2);
}

.alert-danger {
    background: var(--color-danger-soft);
    color: #c62828;
    border-color: rgba(255, 59, 48, 0.2);
}

.alert-warning {
    background: var(--color-warning-soft);
    color: #8a6d00;
    border-color: rgba(255, 159, 10, 0.2);
}

.alert-info {
    background: var(--color-info-soft);
    color: #0c5a82;
    border-color: rgba(100, 210, 255, 0.2);
}

/* Brute Force Alert */
.brute-force-alert {
    display: none;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
}
.brute-force-alert.active {
    display: flex;
    animation: bruteForceShake 0.5s ease-in-out;
}
.brute-force-alert strong {
    display: block;
    margin-bottom: 4px;
}
.brute-force-alert .brute-force-icon {
    flex-shrink: 0;
}
.form-blocked {
    opacity: 0.5;
    pointer-events: none;
    user-select: none;
}

/* Login utility classes (CSP-safe, no inline styles) */
.login-2fa-section { margin-top: 16px; }
.login-btn-full { width: 100%; }
.login-btn-verify { width: 100%; margin-top: 8px; }
.login-back-link { text-align: center; margin-top: 16px; }
.login-back-link a { font-size: 0.875rem; color: var(--text-secondary); }

@keyframes bruteForceShake {
    0%, 100% { transform: translateX(0); }
    10%, 50%, 90% { transform: translateX(-4px); }
    30%, 70% { transform: translateX(4px); }
}

/* ==========================================================================
   Security Page
   ========================================================================== */

/* ---- KPI Grid (horizontal layout like db-kpi) ---- */
.sec-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}
.sec-kpi-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    border: 0.5px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition);
}
.sec-kpi-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}
.sec-kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sec-icon-blocked-ip { background: rgba(255, 59, 48, 0.1); color: #ff3b30; }
.sec-icon-blocked-user { background: rgba(255, 159, 10, 0.1); color: #ff9f0a; }
.sec-icon-tracked { background: rgba(0, 113, 227, 0.1); color: #0071e3; }
.sec-icon-attempts { background: rgba(94, 92, 230, 0.1); color: #5e5ce6; }
.sec-kpi-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sec-kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    line-height: 1.1;
}
.sec-kpi-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.sec-val-danger { color: var(--color-danger); }
.sec-val-warning { color: var(--color-warning); }
.sec-val-success { color: var(--color-success); }

/* ---- Controls bar ---- */
.sec-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.sec-control-left,
.sec-control-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ---- Tabs — Apple segmented control ---- */
.sec-tabs {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    border: 0.5px solid var(--border-light);
}
.sec-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    font-size: 0.8125rem;
    font-weight: 500;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}
.sec-tab:hover {
    color: var(--text-primary);
    background: var(--grey-200);
}
.sec-tab.active {
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 0 0.5px rgba(0,0,0,0.12);
    font-weight: 600;
}
.sec-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--radius-full);
    background: var(--grey-100);
    color: var(--text-tertiary);
    font-size: 0.6875rem;
    font-weight: 700;
}
.sec-tab.active .sec-tab-count {
    background: var(--color-accent-soft);
    color: var(--color-accent);
}

/* ---- Panels ---- */
.sec-panel {
    display: none;
}
.sec-panel.active {
    display: block;
    animation: secFadeIn 0.35s var(--ease-smooth);
}
@keyframes secFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- Card wrapper ---- */
.sec-card {
    padding: 0;
    overflow: hidden;
}
.sec-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    gap: 16px;
    flex-wrap: wrap;
}
.sec-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-tertiary);
}
.sec-card-title h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}
.sec-card-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: var(--radius-full);
    background: var(--grey-100);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
}

/* ---- Table ---- */
.sec-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}
.sec-table th,
.sec-table td {
    padding: 12px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}
.sec-table th {
    font-weight: 600;
    color: var(--text-tertiary);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--bg-secondary);
}
.sec-table tbody tr {
    transition: background var(--transition-fast);
}
.sec-table tbody tr:hover {
    background: var(--grey-50);
}
.sec-table tbody tr:last-child td {
    border-bottom: none;
}

.sec-identifier {
    background: var(--grey-100);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
    color: var(--text-primary);
    border: none;
}
.sec-attempt-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    padding: 0 8px;
    border-radius: var(--radius-full);
    background: var(--grey-100);
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-primary);
}
.sec-date {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    white-space: nowrap;
}
.sec-reason {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
}
.sec-countdown {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--color-danger);
    font-size: 0.875rem;
}

/* ---- Badges ---- */
.sec-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}
.sec-badge-blocked {
    background: var(--color-danger-soft);
    color: var(--color-danger);
}
.sec-badge-monitoring {
    background: var(--color-success-soft);
    color: var(--color-success);
}
.sec-badge-ip {
    background: var(--color-info-soft);
    color: #0c5a82;
}
.sec-badge-username {
    background: rgba(94, 92, 230, 0.1);
    color: #5e5ce6;
}

/* ---- Empty State ---- */
.sec-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}
.sec-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--grey-100);
    color: var(--text-tertiary);
    margin-bottom: 16px;
}
.sec-empty-icon.sec-empty-success {
    background: var(--color-success-soft);
    color: var(--color-success);
}
.sec-empty-state h4 {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-tertiary);
    margin: 0;
}

/* ---- Search ---- */
.sec-search-wrap {
    position: relative;
}
.sec-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}
.sec-search {
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.8125rem;
    width: 240px;
    transition: all 0.2s;
}
.sec-search:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-soft);
}

/* ---- Modal description ---- */
.sec-modal-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* ---- Button danger ---- */
.btn-danger {
    background: var(--color-danger);
    color: #fff;
    border: none;
}
.btn-danger:hover {
    background: #e0342a;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .sec-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 640px) {
    .sec-kpi-grid {
        grid-template-columns: 1fr;
    }
    .sec-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .sec-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .sec-tab {
        white-space: nowrap;
        padding: 7px 14px;
        font-size: 0.75rem;
    }
    .sec-search {
        width: 100%;
    }
    .sec-kpi-value {
        font-size: 1.5rem;
    }
    .sec-card-header {
        padding: 16px;
    }
    .sec-table th,
    .sec-table td {
        padding: 10px 16px;
    }
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 14px 20px;
    background: var(--bg-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 0.5px solid var(--border-light);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 360px;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.3s var(--ease-smooth), transform 0.3s var(--ease-smooth);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.toast-exit {
    opacity: 0;
    transform: translateX(60px);
}

.toast.success, .toast.toast-success { border-left: 3px solid var(--color-success); }
.toast.error, .toast.toast-error { border-left: 3px solid var(--color-danger); }
.toast.warning, .toast.toast-warning { border-left: 3px solid var(--color-warning); }

/* ==========================================================================
   Animations — Scroll reveal
   ========================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease-smooth), transform 0.7s var(--ease-smooth);
}

.reveal.visible,
.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Scrollbar
   ========================================================================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--grey-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--grey-400);
}

/* ==========================================================================
   Utility
   ========================================================================== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.mb-0 { margin-bottom: 0; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 32px; }
.mt-xl { margin-top: 64px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 20px; }

/* ---- Admin utility classes ---- */
.clients-filter-actions { display: flex; gap: 8px; align-items: center; }
.filter-select { width: auto; padding: 10px 14px; font-size: 0.875rem; }
.modal-sm { max-width: 420px; }
.btn-danger { background: var(--color-danger) !important; color: white !important; }
.btn-danger:hover { background: #e63329 !important; }
.btn-outline-danger { color: var(--color-danger); border-color: var(--color-danger); }
.btn-outline-danger:hover { background: var(--color-danger-soft); color: #c62828; }
.card-narrow { max-width: 600px; }
.text-muted { color: var(--text-tertiary); }
.p-lg { padding: 24px; }
.pwd-hint { display: none; color: var(--text-tertiary); font-weight: 400; }
.user-login-cell { font-size: 0.8125rem; color: var(--text-tertiary); }
.hidden { display: none; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ==========================================================================
   ADMIN LAYOUT — Sidebar + Content Wrapper
   ========================================================================== */

/* ---- Navbar adjustments ---- */
.nav-inner {
    max-width: none;
    margin: 0;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: none;
    border: none;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.sidebar-toggle:hover {
    background: var(--grey-100);
    color: var(--text-primary);
}

.nav-badge-mgmt {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    background: var(--color-accent-soft);
    color: var(--color-accent);
    border-radius: var(--radius-full);
}

/* ---- Sidebar ---- */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: 240px;
    background: var(--bg-primary);
    border-right: 0.5px solid var(--border-light);
    z-index: 900;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s var(--ease-smooth);
    overflow-y: auto;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-section-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    padding: 0 12px 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    text-decoration: none;
}

.sidebar-link:hover {
    background: var(--grey-100);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--color-accent-soft);
    color: var(--color-accent);
}

.sidebar-link.active svg {
    color: var(--color-accent);
}

.sidebar-link svg {
    flex-shrink: 0;
    color: var(--text-tertiary);
    transition: color var(--transition-fast);
}

.sidebar-link:hover svg {
    color: var(--text-primary);
}

.sidebar-link-muted {
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.sidebar-footer {
    padding: 12px;
    border-top: 0.5px solid var(--border-light);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 899;
}

/* ---- Content wrapper ---- */
.mgmt-content {
    margin-left: 240px;
    min-height: calc(100vh - var(--header-height));
    transition: margin-left 0.25s var(--ease-smooth);
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed ~ .mgmt-content,
.sidebar.collapsed ~ #sidebarOverlay ~ .mgmt-content {
    margin-left: 0;
}

.mgmt-content .page-header {
    padding: 84px 0 24px;
}

.mgmt-content .section {
    padding: 28px 0 48px;
    flex: 1;
}

.footer {
    background: #1e293b;
    padding: 64px 0 32px;
    color: #e2e8f0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

.footer .nav-logo {
    color: #f1f5f9;
}

.footer .logo-icon {
    background: #334155;
}

.footer-brand p {
    font-size: 0.875rem;
    color: #94a3b8;
    margin-top: 12px;
    max-width: 280px;
    line-height: 1.6;
}

.footer-col h5 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin-bottom: 20px;
}

.footer-col ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-col a {
    font-size: 0.875rem;
    color: #94a3b8;
    transition: color var(--transition-fast);
}

.footer-col a:hover {
    color: #f1f5f9;
}

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid #334155;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-bottom p {
    font-size: 0.75rem;
    color: #64748b;
}

.footer-social {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-social a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #64748b;
    transition: all var(--transition-fast);
}

.footer-social a:hover {
    color: #f1f5f9;
    background: #334155;
}

/* ==========================================================================
   Forms
   ========================================================================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1.5px solid transparent;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--text-primary);
    transition: all var(--transition-fast);
    outline: none;
}

.form-control:focus {
    background: var(--bg-primary);
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.form-control::placeholder {
    color: var(--text-tertiary);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

/* ==========================================================================
   CLIENTS MANAGEMENT
   ========================================================================== */

/* ---- Page Controls ---- */
.clients-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.clients-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 400px;
}

.clients-search .form-control {
    padding: 10px 14px;
    font-size: 0.875rem;
}

/* ---- Clients Count ---- */
.clients-count {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    font-weight: 500;
    white-space: nowrap;
}

/* ---- Table Loading Skeleton ---- */
.table-loading {
    padding: 16px;
}

.skeleton-row {
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    margin-bottom: 8px;
    animation: skeleton-pulse 1.2s ease-in-out infinite;
}

.skeleton-row:nth-child(2) { animation-delay: 0.1s; }
.skeleton-row:nth-child(3) { animation-delay: 0.2s; }
.skeleton-row:nth-child(4) { animation-delay: 0.3s; }
.skeleton-row:nth-child(5) { animation-delay: 0.4s; }

@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ---- Clients Table ---- */
.clients-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.clients-table thead th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

.clients-table tbody td {
    padding: 14px 16px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.clients-table tbody tr {
    transition: background var(--transition-fast);
    cursor: pointer;
}

.clients-table tbody tr:hover {
    background: var(--bg-secondary);
}

.clients-table tbody tr:last-child td {
    border-bottom: none;
}

.client-name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.client-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--color-accent-soft);
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
    flex-shrink: 0;
}

.client-avatar.avatar-color-0 { background: var(--color-accent-soft); color: var(--color-accent); }
.client-avatar.avatar-color-1 { background: rgba(48, 209, 88, 0.12); color: #1a7a34; }
.client-avatar.avatar-color-2 { background: rgba(255, 149, 0, 0.12); color: #c76a00; }
.client-avatar.avatar-color-3 { background: rgba(175, 82, 222, 0.12); color: #7b2fa0; }
.client-avatar.avatar-color-4 { background: rgba(255, 59, 48, 0.12); color: #c62828; }
.client-avatar.avatar-color-5 { background: rgba(0, 199, 190, 0.12); color: #00897b; }

.client-name-text h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1px;
    line-height: 1.2;
}

.client-name-text p {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin: 0;
    line-height: 1.2;
}

/* ---- Status Badges ---- */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.status-active {
    background: var(--color-success-soft);
    color: #1a7a34;
}

.status-inactive {
    background: var(--grey-100);
    color: var(--grey-600);
}

.status-suspended {
    background: var(--color-danger-soft);
    color: #c62828;
}

/* ---- Product Tags ---- */
.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.product-tag {
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 600;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.product-tag-ad { background: rgba(0, 113, 227, 0.1); color: #0071e3; }
.product-tag-cyber { background: rgba(48, 209, 88, 0.1); color: #1a7a34; }

.product-tag-none {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-style: italic;
}

/* ---- Date Cell ---- */
.cell-date {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    white-space: nowrap;
}

/* ---- Button Loading State ---- */
.btn-loading {
    opacity: 0.65;
    cursor: wait !important;
    pointer-events: none;
}

/* ---- Button Success State ---- */
.btn-success {
    background: var(--color-success) !important;
    border-color: var(--color-success) !important;
    color: white !important;
    pointer-events: none;
}

/* ---- Actions ---- */
.table-actions {
    display: flex;
    gap: 4px;
}

.table-action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    background: none;
    border: none;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.table-action-btn:hover {
    background: var(--grey-100);
    color: var(--text-primary);
}

.table-action-btn.danger:hover {
    background: var(--color-danger-soft);
    color: var(--color-danger);
}

/* ---- Modals ---- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.2s var(--ease-smooth);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px 0;
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: none;
    border: none;
    color: var(--text-tertiary);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.modal-close:hover {
    background: var(--grey-100);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px 28px;
}

.modal-body .form-group {
    margin-bottom: 16px;
}

.modal-body .form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.modal-body .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 0 28px 24px;
}

/* ---- Client Detail ---- */
.client-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.client-detail-left {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.client-back-btn {
    align-self: flex-start;
}

.client-detail-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.client-detail-avatar {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    background: var(--color-accent-soft);
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
}

.client-detail-name-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.client-detail-meta h2 {
    font-size: 1.5rem;
    margin: 0;
}

.client-detail-meta p {
    font-size: 0.875rem;
    margin-top: 4px;
}

.client-detail-actions {
    display: flex;
    align-items: center;
    align-self: center;
    gap: 8px;
}

/* ---- Tabs ---- */
.mgmt-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 24px;
}

.mgmt-tab {
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    cursor: pointer;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

.mgmt-tab:hover {
    color: var(--text-primary);
}

.mgmt-tab.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ---- Product Access Toggles ---- */
.access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.access-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: var(--bg-primary);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    transition: all var(--transition-fast);
}

.access-card.enabled {
    border-color: rgba(0, 113, 227, 0.3);
    background: var(--color-accent-soft);
}

.access-card-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.access-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.access-card.enabled .access-card-icon {
    background: rgba(0, 113, 227, 0.12);
    color: var(--color-accent);
}

.access-card-info h4 {
    font-size: 0.9375rem;
    margin-bottom: 2px;
}

.access-card-info p {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin: 0;
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--grey-300);
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform var(--transition-fast);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--color-accent);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.toggle-loading {
    opacity: 0.5;
    pointer-events: none;
}

.toggle-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border: 2px solid transparent;
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: toggle-spin 0.6s linear infinite;
}

@keyframes toggle-spin {
    to { transform: rotate(360deg); }
}

/* ---- Users Table in Detail ---- */
.users-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.users-section-header h3 {
    font-size: 1rem;
}

.role-viewer {
    background: rgba(0, 113, 227, 0.10);
    color: #1565c0;
}

.role-manager {
    background: rgba(255, 149, 0, 0.12);
    color: #e65100;
}

.role-superadmin {
    background: rgba(255, 59, 48, 0.12);
    color: #c62828;
}

[data-theme="dark"] .role-viewer {
    background: rgba(66, 165, 245, 0.18);
    color: #64b5f6;
}

[data-theme="dark"] .role-manager {
    background: rgba(255, 167, 38, 0.18);
    color: #ffb74d;
}

[data-theme="dark"] .role-superadmin {
    background: rgba(255, 82, 82, 0.18);
    color: #ff8a80;
}

/* ---- Empty state ---- */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-tertiary);
}

.empty-state svg {
    margin-bottom: 16px;
    color: var(--grey-300);
}

.empty-state h4 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.875rem;
    margin-bottom: 20px;
}

/* ==========================================================================
   SERVER MONITORING — Dashboard Styles
   ========================================================================== */

/* ---- Controls Bar ---- */
.srv-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.srv-range-selector {
    display: flex;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    padding: 3px;
    gap: 2px;
    border: 0.5px solid var(--border-light);
}

.srv-range-btn {
    padding: 7px 16px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
    background: transparent;
    border: none;
    cursor: pointer;
}

.srv-range-btn:hover {
    color: var(--text-primary);
    background: var(--grey-200);
}

.srv-range-btn.active {
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

.srv-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.srv-auto-refresh {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.srv-auto-refresh input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--color-accent);
    cursor: pointer;
}

.srv-last-update {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    min-width: 80px;
}

/* ---- Metrics Grid ---- */
.srv-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.srv-metric-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    border: 0.5px solid var(--border-light);
    transition: all var(--transition);
}

.srv-metric-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.srv-metric-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.srv-metric-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.srv-icon-cpu { background: rgba(0, 113, 227, 0.1); color: #0071e3; }
.srv-icon-ram { background: rgba(48, 209, 88, 0.1); color: #30d158; }
.srv-icon-disk { background: rgba(255, 159, 10, 0.1); color: #ff9f0a; }
.srv-icon-net { background: rgba(94, 92, 230, 0.1); color: #5e5ce6; }
.srv-icon-load { background: rgba(255, 55, 95, 0.1); color: #ff375f; }
.srv-icon-uptime { background: rgba(100, 210, 255, 0.1); color: #64d2ff; }
.srv-icon-swap { background: rgba(175, 82, 222, 0.1); color: #af52de; }
.srv-icon-temp { background: rgba(255, 69, 58, 0.1); color: #ff453a; }

.srv-metric-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.srv-metric-value {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.1;
}

.srv-metric-uptime {
    font-size: 1.25rem;
    font-weight: 600;
}

/* ---- Metric Bars ---- */
.srv-metric-bar {
    height: 6px;
    background: var(--grey-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 10px;
}

.srv-metric-bar-fill {
    height: 100%;
    width: 0;
    border-radius: var(--radius-full);
    transition: width 0.6s var(--ease-smooth), background-color 0.3s;
}

.srv-bar-ok { background: var(--color-success); }
.srv-bar-warn { background: var(--color-warning); }
.srv-bar-danger { background: var(--color-danger); }

.srv-bar-cpu { background: #0071e3; }
.srv-bar-ram { background: #30d158; }
.srv-bar-disk { background: #ff9f0a; }
.srv-bar-swap { background: #af52de; }

.srv-metric-value + .srv-metric-details {
    margin-top: 12px;
}
.srv-metric-details {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.srv-metric-details b {
    color: var(--text-secondary);
    font-weight: 600;
}

/* ---- Charts Grid ---- */
.srv-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.srv-chart-card {
    padding: 28px;
}

.srv-chart-card:hover {
    transform: none;
}

.srv-chart-card h3 {
    font-size: 1rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.srv-chart-card canvas {
    height: 220px !important;
}

/* ---- Section Grid (2 columns) ---- */
.srv-section-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.srv-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

/* ---- Tables ---- */
.srv-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.srv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.srv-table thead th {
    text-align: left;
    padding: 10px 14px;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

.srv-table tbody td {
    padding: 10px 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.srv-table tbody tr:last-child td {
    border-bottom: none;
}

.srv-table tbody tr:hover {
    background: var(--bg-secondary);
}

.srv-table code {
    font-family: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
    font-size: 0.75rem;
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-primary);
}

.srv-cmd {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'SF Mono', 'Fira Code', 'Fira Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ---- Mini Bars (partitions) ---- */
.srv-mini-bar {
    display: inline-block;
    width: 60px;
    height: 4px;
    background: var(--grey-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    vertical-align: middle;
    margin-right: 6px;
}

.srv-mini-bar-fill {
    height: 100%;
    background: var(--color-accent);
    border-radius: var(--radius-full);
}

/* ---- Process Badges ---- */
.srv-proc-summary {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.srv-proc-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.srv-proc-badge b {
    font-weight: 700;
    color: var(--text-primary);
}

.srv-badge-success {
    background: var(--color-success-soft);
    color: #1a7a34;
}

.srv-badge-success b { color: #1a7a34; }

.srv-badge-info {
    background: var(--color-info-soft);
    color: #0c5a82;
}

.srv-badge-info b { color: #0c5a82; }

.srv-badge-warning {
    background: var(--color-warning-soft);
    color: #8a6d00;
}

.srv-badge-warning b { color: #8a6d00; }

/* ---- Status Indicators ---- */
.srv-status-success {
    color: var(--color-success);
    font-size: 1.125rem;
}

.srv-status-failed {
    color: var(--color-danger);
    font-size: 1.125rem;
}

/* ==========================================================================
   Login Page
   ========================================================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    box-shadow: var(--shadow-lg);
    border: 0.5px solid var(--border-light);
}

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.login-header .login-logo {
    display: block;
    max-height: 56px;
    width: auto;
    margin: 0 auto 20px;
}

.login-header h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.login-header p {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.login-form .form-group {
    margin-bottom: 16px;
}

.login-form .btn {
    width: 100%;
    margin-top: 8px;
}

.login-extras {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    font-size: 0.8125rem;
}

.login-extras label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    cursor: pointer;
}

.login-extras a {
    font-size: 0.8125rem;
}

.login-divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
}

.login-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-light);
}

.login-divider span {
    position: relative;
    padding: 0 16px;
    background: var(--bg-primary);
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

/* ==========================================================================
   Database Management Page
   ========================================================================== */

/* ---- Utility classes ---- */
.db-modal-detail { max-width: 900px; }
.db-grid-placeholder { grid-column: 1 / -1; padding: 60px 20px; }
.db-tfoot-total td { font-weight: 600; background: var(--bg-tertiary); }
.db-text-small { font-size: .8125rem; }
.db-text-danger { color: var(--color-danger); }
.srv-metric-bar-fill { width: 0; }

/* ---- Controls bar ---- */
.db-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.db-controls-left,
.db-controls-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.db-last-update {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    min-width: 80px;
}

/* ---- Tabs — Apple segmented control ---- */
.db-tabs {
    display: inline-flex;
    gap: 2px;
    margin-bottom: 32px;
    padding: 3px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    border: 0.5px solid var(--border-light);
}

.db-tab {
    padding: 8px 24px;
    font-size: 0.8125rem;
    font-weight: 500;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.db-tab:hover {
    color: var(--text-primary);
    background: var(--grey-200);
}

.db-tab.active {
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 0 0.5px rgba(0,0,0,0.12);
    font-weight: 600;
}

.db-tab-content {
    display: none;
}

.db-tab-content.active {
    display: block;
    animation: dbFadeIn 0.35s var(--ease-smooth);
}

@keyframes dbFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- KPI Cards ---- */
.db-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.db-kpi-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    border: 0.5px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition);
}

.db-kpi-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.db-kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.db-icon-db    { background: rgba(0, 113, 227, 0.1); color: #0071e3; }
.db-icon-table { background: rgba(48, 209, 88, 0.1); color: #30d158; }
.db-icon-size  { background: rgba(255, 159, 10, 0.1); color: #ff9f0a; }
.db-icon-rows  { background: rgba(94, 92, 230, 0.1); color: #5e5ce6; }

.db-kpi-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.db-kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    line-height: 1.1;
}

.db-kpi-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ---- Server stats 2x2 grid ---- */
.db-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.db-stats-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 0.5px solid var(--border-light);
    overflow: hidden;
    transition: all var(--transition);
}

.db-stats-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.db-stats-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-tertiary);
}

.db-stats-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

.db-stats-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.db-stats-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.db-sicon-mysql   { background: rgba(0, 113, 227, 0.1); color: #0071e3; }
.db-sicon-buffer  { background: rgba(255, 159, 10, 0.1); color: #ff9f0a; }
.db-sicon-query   { background: rgba(48, 209, 88, 0.1); color: #30d158; }
.db-sicon-traffic { background: rgba(94, 92, 230, 0.1); color: #5e5ce6; }

.db-stats-body {
    padding: 8px 24px 20px;
}

.db-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.db-info-row:last-child {
    border-bottom: none;
}

.db-info-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.db-info-value {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.db-metric-bar-wrap {
    padding: 4px 0 8px;
}

/* ---- Query breakdown pills ---- */
.db-query-breakdown {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 14px;
}

.db-query-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 16px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.db-query-item span:first-child {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.db-q-select { background: rgba(0, 113, 227, 0.08); color: #0071e3; }
.db-q-insert { background: rgba(48, 209, 88, 0.08); color: #30d158; }
.db-q-update { background: rgba(255, 159, 10, 0.08); color: #ff9f0a; }
.db-q-delete { background: rgba(255, 55, 95, 0.08); color: #ff375f; }

[data-theme="dark"] .db-q-select { background: rgba(0, 113, 227, 0.15); }
[data-theme="dark"] .db-q-insert { background: rgba(48, 209, 88, 0.15); }
[data-theme="dark"] .db-q-update { background: rgba(255, 159, 10, 0.15); }
[data-theme="dark"] .db-q-delete { background: rgba(255, 55, 95, 0.15); }

/* ---- Charts section ---- */
.db-charts-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.db-chart-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 0.5px solid var(--border-light);
    position: relative;
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition);
}

.db-chart-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

/* ---- Empty state (dashboard placeholder) ---- */
.card-empty-state {
    padding: 48px;
    text-align: center;
}
.card-empty-state svg {
    margin: 0 auto 16px;
    display: block;
}
.card-empty-state p {
    color: var(--text-tertiary);
    font-size: 1.05rem;
}

/* ==========================================================================
   ISO & Standards Catalog (srv-metric-card pattern)
   ========================================================================== */

/* ---- Metrics grid (top KPIs) ---- */
.iso-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

/* ---- Metric card (matches srv-metric-card) ---- */
.iso-metric-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-card);
    border: 0.5px solid var(--border-light);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Card entrance animation (CSP-safe) */
.iso-card-initial {
    opacity: 0;
    transform: translateY(16px);
}
.iso-card-entered {
    opacity: 1;
    transform: translateY(0);
}

/* Tab filter states (CSP-safe) */
.iso-card-filter-hide {
    display: none !important;
}
.iso-card-filter-enter {
    opacity: 0;
    transform: translateY(12px);
}
.iso-card-filter-show {
    opacity: 1;
    transform: translateY(0);
}
.iso-metric-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-4px);
}
.iso-card-owned {
    border-color: rgba(48, 209, 88, 0.35);
    background: linear-gradient(145deg, var(--bg-primary) 0%, rgba(48, 209, 88, 0.04) 100%);
}

/* ---- Metric header ---- */
.iso-metric-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.iso-metric-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.iso-metric-card:hover .iso-metric-icon {
    transform: scale(1.1);
}
.iso-metric-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

/* ---- Icon color variants ---- */
.iso-icon-accent  { background: rgba(0, 113, 227, 0.1);  color: #0071e3; }
.iso-icon-success { background: rgba(48, 209, 88, 0.1);  color: #30d158; }
.iso-icon-warning { background: rgba(255, 159, 10, 0.1); color: #ff9f0a; }
.iso-icon-purple  { background: rgba(94, 92, 230, 0.1);  color: #5e5ce6; }

/* ---- Category color variants ---- */
.iso-cat-iso   { background: rgba(0, 113, 227, 0.1);  color: #0071e3; }
.iso-cat-nist  { background: rgba(94, 92, 230, 0.1);  color: #5e5ce6; }
.iso-cat-gdpr  { background: rgba(48, 209, 88, 0.1);  color: #30d158; }
.iso-cat-soc   { background: rgba(255, 159, 10, 0.1); color: #ff9f0a; }
.iso-cat-pci   { background: rgba(255, 59, 48, 0.1);  color: #ff3b30; }
.iso-cat-hipaa { background: rgba(175, 82, 222, 0.1); color: #af52de; }
.iso-cat-dora  { background: rgba(0, 199, 190, 0.1);  color: #00c7be; }
.iso-cat-other { background: rgba(134, 134, 139, 0.1); color: #86868b; }

/* ---- Metric value ---- */
.iso-metric-value {
    font-size: 2.125rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: var(--text-primary);
    margin-bottom: 14px;
    line-height: 1.1;
}
.iso-val-success { color: var(--color-success); }
.iso-val-warning { color: var(--color-warning); }

/* ---- Metric bar ---- */
.iso-metric-bar {
    height: 6px;
    background: var(--grey-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 14px;
}
.iso-metric-bar-fill {
    height: 100%;
    width: 0;
    border-radius: var(--radius-full);
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.iso-metric-bar-fill.iso-bar-animated {
    width: var(--bar-w);
}
.iso-bar-success { background: #30d158; }
.iso-bar-warning { background: #ff9f0a; }
.iso-bar-cat-iso   { background: #0071e3; }
.iso-bar-cat-nist  { background: #5e5ce6; }
.iso-bar-cat-gdpr  { background: #30d158; }
.iso-bar-cat-soc   { background: #ff9f0a; }
.iso-bar-cat-pci   { background: #ff3b30; }
.iso-bar-cat-hipaa { background: #af52de; }
.iso-bar-cat-dora  { background: #00c7be; }
.iso-bar-cat-other { background: #86868b; }

/* ---- Metric details ---- */
.iso-metric-details {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}
.iso-metric-details b {
    color: var(--text-secondary);
    font-weight: 600;
}
.iso-metric-details svg {
    vertical-align: -1px;
}

/* ---- Controls / filter bar ---- */
.iso-controls {
    margin-bottom: 32px;
    overflow-x: auto;
}

/* ---- Standards grid ---- */
.iso-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 48px;
}

/* ---- Standard card extensions ---- */
.iso-std-card {
    display: flex;
    flex-direction: column;
}
.iso-badge-owned {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #30d158;
    background: rgba(48, 209, 88, 0.1);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    margin-left: auto;
}
.iso-std-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    letter-spacing: -0.015em;
}
.iso-std-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 18px 0;
    flex: 1;
}

/* ---- Standard card footer ---- */
.iso-std-footer {
    margin-top: auto;
}
.iso-std-footer .iso-metric-details {
    justify-content: space-between;
    margin-bottom: 16px;
    padding-top: 14px;
    border-top: 0.5px solid var(--border-light);
}
.iso-std-price {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.8125rem;
}
.iso-std-action {
    display: flex;
    flex-direction: column;
}
.iso-btn-subscribe {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
}
.iso-btn-owned {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 600;
    color: #30d158;
    background: rgba(48, 209, 88, 0.06);
    border: 1px solid rgba(48, 209, 88, 0.2);
    transition: background 0.25s ease;
}
.iso-btn-owned:hover {
    background: rgba(48, 209, 88, 0.1);
}
.iso-btn-viewer {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-tertiary);
    background: var(--grey-100);
    border: 1px solid var(--border-light);
    transition: background 0.25s ease;
}
.iso-btn-viewer:hover {
    background: var(--grey-200);
}

/* ---- Cancel / Cancelling states ---- */
.iso-card-cancelling {
    border-color: rgba(255, 159, 10, 0.35);
    background: linear-gradient(145deg, var(--bg-primary) 0%, rgba(255, 159, 10, 0.04) 100%);
}
.iso-badge-cancelling {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--color-warning);
    background: rgba(255, 159, 10, 0.1);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    margin-left: auto;
}
.iso-next-month-price {
    display: block;
    color: var(--color-warning);
    font-size: 0.8rem;
    margin-top: 2px;
}
.iso-cancel-notice {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--color-warning);
    background: rgba(255, 159, 10, 0.06);
    border: 1px solid rgba(255, 159, 10, 0.15);
    border-radius: var(--radius);
    padding: 8px 12px;
    margin: 0 0 14px 0;
    line-height: 1.4;
}
.iso-btn-cancelling {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-warning);
    background: rgba(255, 159, 10, 0.06);
    border: 1px solid rgba(255, 159, 10, 0.2);
}
.iso-btn-reactivate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.75rem;
    margin-top: 6px;
    width: 100%;
}
.iso-btn-cancel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.75rem;
    margin-top: 6px;
    width: 100%;
    color: var(--text-tertiary);
}
.iso-btn-cancel:hover {
    color: var(--color-danger);
    border-color: rgba(255, 59, 48, 0.3);
    background: rgba(255, 59, 48, 0.04);
}
.iso-modal-icon-danger {
    background: var(--color-danger-soft) !important;
    color: var(--color-danger) !important;
}
.iso-modal-icon-success {
    background: rgba(52, 199, 89, 0.12) !important;
    color: #34c759 !important;
}
.iso-modal-price-danger {
    color: var(--color-danger) !important;
    font-weight: 700;
}
.btn-danger {
    background: var(--color-danger);
    color: #fff;
    border: none;
}
.btn-danger:hover {
    background: #e0342a;
}

/* ---- CTA section ---- */
.iso-cta {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 0.5px solid var(--border-light);
    text-align: center;
    padding: 56px 40px;
    margin-bottom: 48px;
}
.iso-cta-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--color-accent-soft);
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}
.iso-cta h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}
.iso-cta p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin: 0 auto 32px;
    max-width: 520px;
    line-height: 1.6;
}

/* ---- Request form inside CTA ---- */
.iso-rq-hidden {
    display: none !important;
}
.iso-rq-form {
    margin-top: 32px;
    text-align: left;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.iso-rq-form.iso-rq-visible {
    opacity: 1;
    transform: translateY(0);
}
.iso-rq-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}
.iso-rq-full {
    grid-column: 1 / -1;
}
.iso-rq-field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}
.iso-rq-field input,
.iso-rq-field textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.875rem;
    font-family: inherit;
    border: 1px solid var(--grey-300);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    box-sizing: border-box;
}
.iso-rq-field input:focus,
.iso-rq-field textarea:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-soft);
}
.iso-rq-field textarea {
    resize: vertical;
    min-height: 100px;
}
.iso-rq-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}
@media (max-width: 600px) {
    .iso-rq-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- Confirmation modal ---- */
.iso-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.iso-modal-overlay.active {
    display: flex;
}
body.modal-open {
    overflow: hidden;
}
.iso-modal {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
    max-width: 460px;
    width: 100%;
    padding: 40px 36px 32px;
    text-align: center;
    animation: isoModalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes isoModalIn {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.iso-modal-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--color-accent-soft);
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
}
.iso-modal-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px 0;
    letter-spacing: -0.01em;
}
.iso-modal-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 24px 0;
    line-height: 1.5;
}
.iso-modal-detail {
    background: var(--grey-50);
    border-radius: var(--radius);
    padding: 18px 22px;
    margin-bottom: 22px;
    text-align: left;
}
.iso-modal-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
}
.iso-modal-row + .iso-modal-row {
    border-top: 0.5px solid var(--border-light);
}
.iso-modal-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.iso-modal-value {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 600;
}
.iso-modal-price {
    color: var(--color-accent);
    font-weight: 700;
}
.iso-modal-warning {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--color-warning);
    margin-bottom: 22px;
}
.iso-modal-actions {
    display: flex;
    gap: 12px;
}
.iso-modal-cancel {
    flex: 1;
}
.iso-modal-confirm {
    flex: 1;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .iso-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .iso-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 640px) {
    .iso-metrics-grid {
        grid-template-columns: 1fr;
    }
    .iso-grid {
        grid-template-columns: 1fr;
    }
    .iso-controls {
        -webkit-overflow-scrolling: touch;
    }
}

.db-chart-wide {
    grid-column: 1 / -1;
}

.db-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 0;
    gap: 12px;
}

.db-chart-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.db-chart-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.db-chart-icon-size  { background: rgba(0, 113, 227, 0.1); color: #0071e3; }
.db-chart-icon-query { background: rgba(48, 209, 88, 0.1); color: #30d158; }
.db-chart-icon-ratio { background: rgba(94, 92, 230, 0.1); color: #5e5ce6; }

.db-chart-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}

.db-chart-subtitle {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    font-weight: 400;
}

.db-chart-badge {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--color-accent);
    background: var(--color-accent-soft);
    padding: 5px 12px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    letter-spacing: -0.02em;
}

.db-chart-legend-inline {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.db-legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    margin-right: 4px;
}

.db-legend-data  { background: rgba(0, 113, 227, 0.75); }
.db-legend-index { background: rgba(94, 92, 230, 0.65); }

.db-chart-body {
    padding: 16px 24px 20px;
    position: relative;
}

.db-chart-body canvas {
    height: 230px !important;
}

.db-chart-body-bar {
    padding: 16px 24px 16px;
}

.db-chart-body-bar canvas {
    height: 180px !important;
}

/* ---- Databases table (card wrapper) ---- */
.db-table-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 0.5px solid var(--border-light);
    overflow: hidden;
}

.db-table-card .table-responsive {
    margin: 0;
}

/* Database table — same style as clients-table */
.db-table-card .mgmt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    margin: 0;
}

.db-table-card .mgmt-table thead th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-tertiary);
    white-space: nowrap;
}

.db-table-card .mgmt-table tbody td {
    padding: 14px 16px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

.db-table-card .mgmt-table tbody tr {
    transition: background var(--transition-fast);
}

.db-table-card .mgmt-table tbody tr:hover {
    background: var(--bg-secondary);
}

.db-table-card .mgmt-table tbody tr:last-child td {
    border-bottom: none;
}

.db-table-card .mgmt-table tfoot td {
    padding: 14px 16px;
    font-weight: 600;
    font-size: 0.8125rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    color: var(--text-primary);
}

/* Detail button inside table */
.db-table-card .btn-sm {
    padding: 6px 14px;
    font-size: 0.75rem;
}

/* ---- Detail Modal enhancements ---- */
.db-modal-detail .modal-header {
    border-bottom: 1px solid var(--border-light);
}

.db-modal-detail .mgmt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.db-modal-detail .mgmt-table thead th {
    text-align: left;
    padding: 10px 14px;
    font-weight: 600;
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-tertiary);
    white-space: nowrap;
}

.db-modal-detail .mgmt-table tbody td {
    padding: 10px 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    font-variant-numeric: tabular-nums;
}

.db-modal-detail .mgmt-table tbody tr:hover {
    background: var(--bg-secondary);
}

.db-modal-detail .mgmt-table tbody tr:last-child td {
    border-bottom: none;
}

/* ---- Clients DB grid ---- */
.db-clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}

.db-client-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 0.5px solid var(--border-light);
    padding: 24px;
    transition: all var(--transition);
}

.db-client-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.db-client-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.db-client-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.db-client-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--color-accent-soft);
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
    flex-shrink: 0;
}

.db-client-info h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.db-client-total {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-accent);
    white-space: nowrap;
}

.db-client-products {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.db-client-dbs {
    border-top: 1px solid var(--border-light);
    padding-top: 14px;
}

.db-client-dbs-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}

.db-client-db-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.db-client-db-row:last-child {
    border-bottom: none;
}

.db-client-db-name {
    font-weight: 500;
    color: var(--text-primary);
    font-family: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
    font-size: 0.75rem;
}

.db-client-db-size {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Responsive — Management
   ========================================================================== */
@media (max-width: 1024px) {
    :root {
        --section-padding: 80px;
    }

    .srv-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .srv-charts-grid {
        grid-template-columns: 1fr;
    }

    .srv-section-grid {
        grid-template-columns: 1fr;
    }

    .clients-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .clients-search {
        max-width: 100%;
    }

    .access-grid {
        grid-template-columns: 1fr;
    }

    .db-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .db-stats-grid {
        grid-template-columns: 1fr;
    }

    .db-charts-section {
        grid-template-columns: 1fr;
    }

    .db-chart-wide {
        grid-column: auto;
    }
}

@media (max-width: 768px) {
    :root {
        --section-padding: 60px;
        --header-height: 56px;
    }

    /* Sidebar becomes overlay on mobile */
    .sidebar {
        transform: translateX(-100%);
        z-index: 1001;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-overlay {
        display: block;
    }

    .mgmt-content {
        margin-left: 0;
    }

    .srv-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .srv-range-selector {
        flex-wrap: wrap;
        justify-content: center;
    }

    .srv-actions {
        justify-content: center;
        flex-wrap: wrap;
    }

    .srv-metrics-grid {
        grid-template-columns: 1fr;
    }

    .srv-metric-value {
        font-size: 1.5rem;
    }

    .mgmt-content .page-header {
        padding: 72px 0 20px;
    }

    .srv-section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .client-detail-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .client-detail-actions {
        align-self: flex-start;
    }

    .modal-body .form-row {
        grid-template-columns: 1fr;
    }

    /* Responsive table horizontal scroll */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .db-kpi-grid {
        grid-template-columns: 1fr;
    }

    .db-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .db-clients-grid {
        grid-template-columns: 1fr;
    }

    .db-query-breakdown {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .srv-range-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .card {
        padding: 24px;
    }

    .srv-chart-card canvas {
        height: 180px !important;
    }

    .db-chart-card canvas,
    .db-chart-body canvas {
        height: 180px !important;
    }

    .db-chart-body-bar canvas {
        height: 140px !important;
    }

    .mgmt-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mgmt-tab {
        white-space: nowrap;
        padding: 10px 14px;
        font-size: 0.8125rem;
    }
}

/* ==========================================================================
   ISO 27001 AUDIT — Initialization & Audit Table
   ========================================================================== */

/* ── Initialization Phase ─────────────────────────────────────────────── */
.iso-init-container {
    max-width: 760px;
    margin: 0 auto;
    background: var(--bg-primary);
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-lg);
    padding: 48px 44px;
    box-shadow: var(--shadow-card);
}

.iso-init-header {
    text-align: center;
    margin-bottom: 36px;
}

.iso-init-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    background: var(--color-accent-soft);
    color: var(--color-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    transition: transform 0.3s var(--ease-smooth), box-shadow 0.3s var(--ease-smooth);
}

.iso-init-icon:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 20px rgba(0, 113, 227, 0.15);
}

.iso-init-header h2 {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.iso-init-header p {
    color: var(--grey-500);
    font-size: 0.9375rem;
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.5;
}

.iso-init-progress-bar {
    height: 8px;
    background: var(--grey-200);
    border-radius: var(--radius-full);
    margin-top: 24px;
    overflow: hidden;
    position: relative;
}

.iso-init-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent), #34aadc);
    border-radius: var(--radius-full);
    transition: width 0.5s var(--ease-smooth);
    position: relative;
}

.iso-init-progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: iso-progress-shimmer 2s ease-in-out infinite;
}

@keyframes iso-progress-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.iso-init-progress-text {
    display: block;
    text-align: center;
    font-size: 0.875rem;
    color: var(--color-accent);
    margin-top: 10px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Step indicator dots */
.iso-init-step-indicator {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.iso-init-step-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--grey-300);
    transition: all 0.3s var(--ease-smooth);
}

.iso-init-step-dot.active {
    width: 24px;
    background: var(--color-accent);
}

.iso-init-step-dot.completed {
    background: var(--color-success);
}

.iso-init-step {
    animation: iso-step-fadein 0.35s var(--ease-smooth);
}

@keyframes iso-step-fadein {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.iso-init-step h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--grey-200);
    display: flex;
    align-items: center;
    gap: 10px;
}

.iso-init-step h3::before {
    content: attr(data-step-num);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--color-accent-soft);
    color: var(--color-accent);
    font-size: 0.8125rem;
    font-weight: 700;
    flex-shrink: 0;
}

.iso-init-question {
    margin-bottom: 24px;
    padding: 16px 20px;
    border-radius: var(--radius);
    background: var(--grey-50);
    border: 1px solid transparent;
    transition: border-color 0.2s var(--ease-smooth), box-shadow 0.2s var(--ease-smooth);
}

.iso-init-question:hover {
    border-color: var(--grey-200);
}

.iso-init-question:focus-within {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.iso-init-question label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.5;
}

.iso-init-upload {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.btn-upload {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s var(--ease-smooth);
}

.btn-upload:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.upload-filename {
    font-size: 0.8125rem;
    color: var(--color-success);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.upload-filename:empty { display: none; }

.iso-init-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--grey-200);
}

.iso-init-nav .btn {
    min-width: 120px;
    transition: all 0.25s var(--ease-smooth);
}

.iso-init-nav .btn:active {
    transform: scale(0.97);
}

#initSubmit {
    gap: 8px;
}

#initSubmit svg {
    transition: transform 0.2s var(--ease-smooth);
}

#initSubmit:hover svg {
    transform: scale(1.15);
}

/* ── Dashboard Header ──────────────────────────────────────────────── */
.iso-dashboard {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    background: var(--bg-primary);
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.iso-dashboard-left {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 28px 32px;
    background: linear-gradient(145deg, rgba(0, 113, 227, 0.05) 0%, rgba(48, 209, 88, 0.03) 100%);
    border-right: 1px solid var(--grey-200);
    min-width: 380px;
}

.iso-dashboard-right {
    flex: 1;
    padding: 20px 24px;
    display: flex;
    align-items: center;
}

/* ── Progress Ring ────────────────────────────────────────────────── */
.iso-ring-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.iso-progress-ring-wrap {
    position: relative;
    width: 130px;
    height: 130px;
}

.iso-progress-ring-wrap::after {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 113, 227, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.iso-progress-ring-wrap svg {
    width: 130px;
    height: 130px;
    transform: rotate(-90deg);
}

.iso-ring-bg {
    fill: none;
    stroke: var(--grey-200);
    stroke-width: 8;
}

.iso-ring-fill {
    fill: none;
    stroke: url(#ringGradient);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 6px rgba(0, 113, 227, 0.3));
}

.iso-ring-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.iso-ring-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.iso-ring-value::after {
    content: '%';
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--grey-400);
    margin-left: 1px;
}

.iso-ring-caption {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--grey-500);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 8px;
    text-align: center;
}

/* ── Status Breakdown (legend) ────────────────────────────────────── */
.iso-status-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 160px;
}

.iso-breakdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
    cursor: pointer;
}

.iso-breakdown-item:hover {
    background: rgba(0, 0, 0, 0.04);
    transform: translateX(2px);
}

.iso-break-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.iso-break-dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
    box-shadow: 0 0 6px currentColor;
}

.iso-break-verified .iso-break-dot { background: #0071e3; color: rgba(0, 113, 227, 0.3); }
.iso-break-implemented .iso-break-dot { background: #30d158; color: rgba(48, 209, 88, 0.3); }
.iso-break-in_progress .iso-break-dot { background: #ff9f0a; color: rgba(255, 159, 10, 0.3); }
.iso-break-not_started .iso-break-dot { background: var(--grey-400); color: transparent; }
.iso-break-non_compliant .iso-break-dot { background: #ff3b30; color: rgba(255, 59, 48, 0.3); }

.iso-break-label {
    font-size: 0.75rem;
    color: var(--grey-600);
    font-weight: 500;
}

.iso-break-count {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    min-width: 20px;
    text-align: right;
}

/* ── KPI Cards Row ────────────────────────────────────────────────── */
.iso-kpi-row {
    display: flex;
    gap: 14px;
    flex: 1;
    flex-wrap: wrap;
}

.iso-kpi-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-radius: var(--radius);
    background: var(--bg-primary);
    border: 1px solid var(--grey-150, var(--grey-200));
    flex: 1;
    min-width: 150px;
    transition: transform 0.2s var(--ease-smooth), box-shadow 0.2s var(--ease-smooth), border-color 0.2s;
    position: relative;
    overflow: hidden;
}

.iso-kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.iso-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.iso-kpi-card:hover::before {
    opacity: 1;
}

.iso-kpi-total::before { background: #0071e3; }
.iso-kpi-done::before { background: #30d158; }
.iso-kpi-wip::before { background: #ff9f0a; }
.iso-kpi-avg::before { background: #5e5ce6; }
.iso-kpi-nc::before { background: #ff3b30; }

.iso-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.iso-kpi-total .iso-kpi-icon { background: rgba(0, 113, 227, 0.1); color: #0071e3; }
.iso-kpi-done .iso-kpi-icon { background: rgba(48, 209, 88, 0.1); color: #30d158; }
.iso-kpi-wip .iso-kpi-icon { background: rgba(255, 159, 10, 0.1); color: #ff9f0a; }
.iso-kpi-avg .iso-kpi-icon { background: rgba(94, 92, 230, 0.1); color: #5e5ce6; }
.iso-kpi-nc .iso-kpi-icon { background: rgba(255, 59, 48, 0.1); color: #ff3b30; }

.iso-kpi-total:hover .iso-kpi-icon { box-shadow: 0 0 12px rgba(0, 113, 227, 0.2); }
.iso-kpi-done:hover .iso-kpi-icon { box-shadow: 0 0 12px rgba(48, 209, 88, 0.2); }
.iso-kpi-wip:hover .iso-kpi-icon { box-shadow: 0 0 12px rgba(255, 159, 10, 0.2); }
.iso-kpi-avg:hover .iso-kpi-icon { box-shadow: 0 0 12px rgba(94, 92, 230, 0.2); }
.iso-kpi-nc:hover .iso-kpi-icon { box-shadow: 0 0 12px rgba(255, 59, 48, 0.2); }

.iso-kpi-data {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.iso-kpi-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.iso-kpi-label {
    font-size: 0.6875rem;
    color: var(--grey-500);
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* ── View Toggle & Toolbar Right ───────────────────────────────────── */
.iso-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.iso-results-count {
    font-size: 0.75rem;
    color: var(--grey-500);
    font-weight: 500;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.iso-view-toggle {
    display: flex;
    gap: 2px;
    background: var(--grey-100);
    border-radius: 10px;
    padding: 3px;
}

.iso-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: var(--grey-400);
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth);
}

.iso-view-btn:hover {
    color: var(--grey-600);
}

.iso-view-btn.active {
    background: var(--bg-primary);
    color: var(--color-accent);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ── Clickable row ────────────────────────────────────────────────── */
.iso-row-clickable {
    cursor: pointer;
}

.iso-row-clickable:hover {
    background: rgba(0, 113, 227, 0.03) !important;
}

.iso-row-clickable:active {
    background: rgba(0, 113, 227, 0.06) !important;
}

/* ── Cards View ───────────────────────────────────────────────────── */
.iso-audit-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 14px;
}

.iso-control-card {
    background: var(--bg-primary);
    border: 1px solid var(--grey-200);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: all 0.25s var(--ease-smooth);
    position: relative;
    overflow: hidden;
}

.iso-control-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 4px 0 0 4px;
    transition: width 0.2s;
}

.iso-control-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    border-color: transparent;
}

.iso-control-card:hover::before {
    width: 5px;
}

.iso-card-implemented::before { background: #30d158; }
.iso-card-verified::before { background: #0071e3; }
.iso-card-in_progress::before { background: #ff9f0a; }
.iso-card-non_compliant::before { background: #ff3b30; }
.iso-card-not_started::before { background: var(--grey-300); }

.card-not-applicable {
    opacity: 0.45;
}

.card-not-applicable:hover {
    opacity: 0.7;
}

.iso-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-left: 8px;
}

.iso-card-code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--grey-500);
    background: var(--grey-100);
    padding: 2px 8px;
    border-radius: 6px;
}

.iso-card-top-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.iso-card-priority {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 7px;
    border-radius: 5px;
    border: 1px solid;
}

.iso-card-responsible {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.6875rem;
    color: var(--grey-500);
    padding-left: 8px;
    margin-bottom: 12px;
}

.iso-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.45;
    padding-left: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.iso-card-desc {
    font-size: 0.75rem;
    color: var(--grey-500);
    line-height: 1.55;
    margin-bottom: 16px;
    padding-left: 8px;
}

.iso-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 8px 0;
    border-top: 1px solid var(--grey-100);
}

.iso-card-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.iso-card-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--grey-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.iso-card-progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--color-accent);
    transition: width 0.5s var(--ease-smooth);
}

.iso-card-progress span {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--grey-600);
    min-width: 28px;
    font-variant-numeric: tabular-nums;
}

/* ── Action Plan Modal ────────────────────────────────────────────── */
.iso-action-modal {
    background: var(--bg-primary);
    border-radius: 16px;
    width: 100%;
    max-width: 640px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
    animation: iso-modal-slidein 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

.iso-action-header {
    padding: 24px 28px 16px;
    border-bottom: 1px solid var(--grey-200);
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--grey-50) 100%);
    flex-shrink: 0;
}

.iso-action-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.iso-action-header-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.iso-action-code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--color-accent);
    background: var(--color-accent-soft);
    padding: 3px 10px;
    border-radius: 6px;
    display: inline-flex;
    align-self: flex-start;
    letter-spacing: 0.02em;
}

.iso-action-modal-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.iso-action-desc {
    font-size: 0.8125rem;
    color: var(--grey-500);
    line-height: 1.55;
}

/* Action progress bar */
.iso-action-progress {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 28px;
    background: linear-gradient(180deg, var(--grey-50) 0%, transparent 100%);
    flex-shrink: 0;
}

.iso-action-progress-bar {
    flex: 1;
    height: 8px;
    background: var(--grey-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.iso-action-progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, #0071e3, #30d158);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.iso-action-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: iso-shimmer 2s infinite;
}

@keyframes iso-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.iso-action-progress-text {
    font-size: 0.9375rem;
    font-weight: 800;
    color: var(--color-accent);
    min-width: 36px;
    font-variant-numeric: tabular-nums;
}

.iso-action-count {
    font-size: 0.75rem;
    color: var(--grey-500);
    font-weight: 500;
    white-space: nowrap;
}

/* Action items list (scrollable) */
.iso-action-body {
    padding: 16px 28px 20px;
    overflow-y: auto;
    flex: 1;
}

.iso-action-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

/* Connecting line between items */
.iso-action-list::before {
    content: '';
    position: absolute;
    left: 28px;
    top: 20px;
    bottom: 20px;
    width: 2px;
    background: linear-gradient(180deg, var(--grey-200) 0%, var(--color-accent-soft) 100%);
    border-radius: 1px;
    z-index: 0;
}

.iso-action-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--bg-primary);
    border: 1px solid var(--grey-200);
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth);
    user-select: none;
    position: relative;
}

.iso-action-item:hover {
    border-color: rgba(0, 113, 227, 0.3);
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.06);
}

.iso-action-num {
    font-size: 0.625rem;
    font-weight: 800;
    color: var(--grey-400);
    min-width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border: 2px solid var(--grey-200);
    border-radius: var(--radius-full);
    flex-shrink: 0;
    z-index: 1;
    transition: all 0.25s;
}

.iso-action-check {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.iso-action-checkmark {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    border: 2px solid var(--grey-300);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    color: transparent;
}

.iso-action-check:checked ~ .iso-action-checkmark {
    background: linear-gradient(135deg, #0071e3, #30d158);
    border-color: transparent;
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.25);
}

.iso-action-item .iso-action-title {
    flex: 1;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.5;
    transition: all 0.2s;
}

.iso-action-done .iso-action-title {
    text-decoration: line-through;
    color: var(--grey-400);
    font-weight: 400;
}

.iso-action-done {
    background: var(--grey-50);
    border-color: var(--grey-100);
}

.iso-action-done .iso-action-num {
    background: #30d158;
    border-color: #30d158;
    color: #fff;
}

.iso-action-saving {
    opacity: 0.5;
    pointer-events: none;
}

.iso-action-loading {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.iso-action-empty {
    text-align: center;
    color: var(--grey-400);
    padding: 32px 0;
    font-size: 0.875rem;
}

/* Action footer */
.iso-action-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 28px;
    border-top: 1px solid var(--grey-200);
    background: var(--bg-primary);
    flex-shrink: 0;
}

/* Button spinner for loading states */
.iso-btn-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--grey-300);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: iso-spin 0.6s linear infinite;
}

@keyframes iso-spin {
    to { transform: rotate(360deg); }
}

/* Action plan button pair */
.btn-action-plan {
    padding: 5px 8px;
}

.btn-action-plan:hover {
    background: rgba(48, 209, 88, 0.1);
    color: #30d158;
    border-color: #30d158;
}

/* ── Audit Toolbar / Filters ──────────────────────────────────────── */
.iso-audit-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
    background: var(--bg-primary);
    padding: 14px 20px;
    border-radius: 12px;
    border: 1px solid var(--grey-200);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.iso-audit-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
    align-items: center;
}

.iso-filter-group {
    min-width: 160px;
}

.iso-search-group {
    flex: 1;
    min-width: 200px;
    max-width: 320px;
    position: relative;
}

.iso-search-group .form-input-sm {
    padding-left: 32px;
}

.iso-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--grey-400);
    pointer-events: none;
}

.form-select-sm,
.form-input-sm {
    padding: 8px 12px;
    font-size: 0.8125rem;
    border-radius: 10px;
    border: 1px solid var(--grey-200);
    background: var(--bg-primary);
    color: var(--text-primary);
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-select-sm:focus,
.form-input-sm:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-soft);
}

/* ── Audit Table ──────────────────────────────────────────────────── */
.iso-audit-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--grey-200);
    border-radius: 12px;
    background: var(--bg-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.iso-audit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.iso-audit-table thead th {
    background: linear-gradient(180deg, var(--grey-50) 0%, var(--bg-primary) 100%);
    padding: 13px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--grey-600);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    border-bottom: 2px solid var(--grey-200);
    position: sticky;
    top: 0;
    z-index: 1;
}

.iso-audit-table thead th:first-child {
    border-radius: 12px 0 0 0;
}

.iso-audit-table thead th:last-child {
    border-radius: 0 12px 0 0;
}

.iso-audit-table tbody tr {
    border-bottom: 1px solid var(--grey-100);
    transition: background 0.15s;
}

.iso-audit-table tbody tr:last-child {
    border-bottom: none;
}

.iso-audit-table tbody tr:hover {
    background: rgba(0, 113, 227, 0.035);
}

.iso-audit-table tbody tr:hover td:first-child {
    box-shadow: inset 3px 0 0 var(--color-accent);
}

.iso-audit-table tbody tr.row-not-applicable {
    opacity: 0.45;
}

.iso-audit-table tbody tr.row-not-applicable:hover {
    opacity: 0.7;
}

.iso-audit-table td {
    padding: 12px 14px;
    vertical-align: middle;
}

.col-id {
    width: 72px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-accent);
}
.col-category { width: 120px; }
.col-applicable { width: 72px; text-align: center; }
.col-status { width: 130px; }
.col-dates { width: 110px; }
.col-responsible { width: 110px; }
.col-progress { width: 110px; }
.col-relevance { width: 80px; text-align: center; }
.col-actions { width: 64px; text-align: center; }

.col-control {
    min-width: 220px;
}

.control-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
    line-height: 1.4;
}

.control-desc {
    color: var(--grey-500);
    font-size: 0.75rem;
    line-height: 1.45;
}

/* Category badge */
.cat-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

/* Status pill */
.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.6875rem;
    font-weight: 600;
    white-space: nowrap;
    gap: 5px;
}

.status-pill::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.status-not_started .status-pill::before,
.status-pill.status-not_started::before { background: var(--grey-500); }
.status-in_progress .status-pill::before,
.status-pill.status-in_progress::before { background: #e68a00; }
.status-implemented .status-pill::before,
.status-pill.status-implemented::before { background: #1fa347; }
.status-verified .status-pill::before,
.status-pill.status-verified::before { background: #0071e3; }
.status-non_compliant .status-pill::before,
.status-pill.status-non_compliant::before { background: var(--color-danger); }

/* Applicable badge */
.applicable-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 600;
}

.applicable-yes { background: var(--color-success-soft); color: var(--color-success); }
.applicable-no { background: var(--grey-200); color: var(--grey-500); }

/* Dates stack */
.dates-stack {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.date-label {
    font-size: 0.6875rem;
    color: var(--grey-500);
    font-variant-numeric: tabular-nums;
}

/* Progress mini bar */
.progress-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mini-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--grey-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    min-width: 40px;
}

.mini-progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-cell span {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--grey-600);
    min-width: 32px;
    font-variant-numeric: tabular-nums;
}

/* Relevance badge */
.relevance-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    min-width: 44px;
}

.relevance-high { background: rgba(255,59,48,0.08); color: #ff3b30; }
.relevance-medium { background: rgba(255,159,10,0.08); color: #ff9f0a; }
.relevance-low { background: rgba(48,209,88,0.08); color: #30d158; }

/* Action buttons */
.btn-xs {
    padding: 6px 10px;
    font-size: 0.6875rem;
    border-radius: 8px;
    transition: all 0.2s var(--ease-smooth);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-xs:hover {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
    transform: scale(1.05);
}

.col-actions {
    width: 80px;
    text-align: center;
}

.col-actions .btn-xs + .btn-xs {
    margin-left: 4px;
}

/* Loading skeleton */
.iso-table-loading td {
    position: relative;
    overflow: hidden;
}

.iso-skeleton {
    display: inline-block;
    height: 14px;
    border-radius: 4px;
    background: var(--grey-200);
    animation: iso-skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes iso-skeleton-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* Empty state */
.iso-empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--grey-500);
}

.iso-empty-state svg {
    margin-bottom: 16px;
    color: var(--grey-300);
}

.iso-empty-state p {
    font-size: 0.9375rem;
    margin-top: 8px;
}

/* ── Edit Modal ───────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: iso-overlay-fadein 0.2s var(--ease-smooth);
}

@keyframes iso-overlay-fadein {
    from { opacity: 0; }
    to { opacity: 1; }
}

.iso-edit-modal {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 920px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
    animation: iso-modal-slidein 0.3s var(--ease-smooth);
}

@keyframes iso-modal-slidein {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 28px;
    border-bottom: 1px solid var(--grey-200);
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    z-index: 2;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--grey-100);
    color: var(--grey-600);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s var(--ease-smooth);
}

.modal-close:hover {
    background: var(--color-danger-soft);
    color: var(--color-danger);
}

.modal-body {
    padding: 28px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 24px;
    border-top: 1px solid var(--grey-200);
    margin-top: 24px;
}

.modal-footer .btn {
    min-width: 100px;
}

.iso-edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

.iso-edit-col {
    display: flex;
    flex-direction: column;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--grey-600);
    margin-bottom: 6px;
}

.form-select,
.form-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--grey-300);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-select:focus,
.form-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.form-textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--grey-300);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--text-primary);
    background: var(--bg-primary);
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    line-height: 1.5;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.form-range {
    width: calc(100% - 50px);
    vertical-align: middle;
    accent-color: var(--color-accent);
}

#editProgressValue {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--color-accent);
    margin-left: 10px;
    font-variant-numeric: tabular-nums;
}

/* Evidence list in modal */
.iso-evidence-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.evidence-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: var(--grey-50);
    border: 1px solid var(--grey-100);
    transition: border-color 0.15s;
}

.evidence-item:hover {
    border-color: var(--grey-300);
}

.evidence-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--color-accent);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.evidence-link:hover {
    text-decoration: underline;
}

.evidence-size {
    font-size: 0.6875rem;
    color: var(--grey-400);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.btn-evidence-delete {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--grey-400);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
    transition: all 0.15s var(--ease-smooth);
}

.btn-evidence-delete:hover {
    background: var(--color-danger-soft);
    color: var(--color-danger);
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 1200px) {
    .iso-kpi-row {
        flex-wrap: wrap;
    }
    .iso-kpi-card {
        min-width: calc(50% - 8px);
    }
}

@media (max-width: 1024px) {
    .iso-dashboard {
        flex-direction: column;
    }

    .iso-dashboard-left {
        border-right: none;
        border-bottom: 1px solid var(--grey-200);
        min-width: auto;
        justify-content: center;
    }

    .iso-kpi-card {
        min-width: calc(50% - 8px);
    }

    .iso-edit-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .iso-dashboard-left {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    .iso-status-breakdown {
        min-width: auto;
        width: 100%;
    }

    .iso-kpi-row {
        flex-direction: column;
    }

    .iso-kpi-card {
        min-width: 100%;
    }

    .iso-dashboard-right {
        padding: 16px;
    }

    .iso-audit-cards {
        grid-template-columns: 1fr;
    }

    .iso-init-container {
        padding: 28px 20px;
    }

    .iso-init-question {
        padding: 14px 16px;
    }

    .iso-audit-toolbar {
        padding: 12px 14px;
    }

    .iso-audit-filters {
        flex-direction: column;
    }

    .iso-filter-group,
    .iso-search-group {
        min-width: 100%;
        max-width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-body {
        padding: 20px;
    }

    .iso-action-header,
    .iso-action-body,
    .iso-action-footer,
    .iso-action-progress {
        padding-left: 16px;
        padding-right: 16px;
    }

    .iso-action-modal {
        max-width: calc(100% - 20px);
    }

    .iso-init-nav {
        flex-wrap: wrap;
    }

    .iso-init-nav .btn {
        flex: 1;
    }
}

/* ── Category Progress Strip ───────────────────────────────────── */
.iso-category-strip {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
    background: var(--bg-primary);
    border: 1px solid var(--grey-200);
    border-radius: 12px;
    padding: 16px 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.iso-cat-strip-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--grey-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    flex-shrink: 0;
}

.iso-cat-strip-bars {
    display: flex;
    gap: 16px;
    flex: 1;
    flex-wrap: wrap;
}

.iso-cat-bar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 160px;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}

.iso-cat-bar-item:hover {
    background: var(--grey-50);
    transform: translateY(-1px);
}

.iso-cat-bar-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--grey-600);
    white-space: nowrap;
    min-width: 80px;
}

.iso-cat-bar-track {
    flex: 1;
    height: 6px;
    background: var(--grey-200);
    border-radius: 10px;
    overflow: hidden;
    min-width: 60px;
}

.iso-cat-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0;
}

.iso-cat-fill-org { background: linear-gradient(90deg, #0071e3, #34aadc); }
.iso-cat-fill-organizational { background: linear-gradient(90deg, #0071e3, #34aadc); }
.iso-cat-fill-people { background: linear-gradient(90deg, #30d158, #63e085); }
.iso-cat-fill-physical { background: linear-gradient(90deg, #ff9f0a, #ffcc00); }
.iso-cat-fill-tech { background: linear-gradient(90deg, #5e5ce6, #8685ef); }
.iso-cat-fill-technological { background: linear-gradient(90deg, #5e5ce6, #8685ef); }
.iso-cat-fill-context { background: linear-gradient(90deg, #0071e3, #34aadc); }
.iso-cat-fill-leadership { background: linear-gradient(90deg, #30d158, #63e6be); }
.iso-cat-fill-planning { background: linear-gradient(90deg, #ff9f0a, #ffcc00); }
.iso-cat-fill-support { background: linear-gradient(90deg, #5e5ce6, #8685ef); }
.iso-cat-fill-operation { background: linear-gradient(90deg, #ff375f, #ff6b81); }
.iso-cat-fill-performance { background: linear-gradient(90deg, #bf5af2, #d99afa); }
.iso-cat-fill-improvement { background: linear-gradient(90deg, #64d2ff, #9ae4ff); }

.iso-cat-bar-pct {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 32px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ── Quick Filter Chips ───────────────────────────────────────── */
.iso-quick-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
    padding: 0 2px;
}

.iso-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 10px;
    border: 1px solid var(--grey-200);
    background: var(--bg-primary);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--grey-500);
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth);
    white-space: nowrap;
    user-select: none;
}

.iso-chip:hover {
    border-color: var(--grey-300);
    background: var(--grey-50);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.iso-chip.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.25);
}

.iso-chip.active .iso-chip-count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.iso-chip-count {
    font-size: 0.625rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 6px;
    background: var(--grey-100);
    color: var(--grey-500);
    font-variant-numeric: tabular-nums;
    transition: all 0.2s;
}

.iso-chip-nc:hover,
.iso-chip-nc.active { border-color: #ff3b30; }
.iso-chip-nc.active { background: #ff3b30; box-shadow: 0 2px 8px rgba(255, 59, 48, 0.25); }

.iso-chip-wip:hover,
.iso-chip-wip.active { border-color: #ff9f0a; }
.iso-chip-wip.active { background: #ff9f0a; box-shadow: 0 2px 8px rgba(255, 159, 10, 0.25); }

.iso-chip-ns:hover,
.iso-chip-ns.active { border-color: var(--grey-400); }
.iso-chip-ns.active { background: var(--grey-500); box-shadow: 0 2px 8px rgba(134, 134, 139, 0.25); }

.iso-chip-done:hover,
.iso-chip-done.active { border-color: #30d158; }
.iso-chip-done.active { background: #30d158; box-shadow: 0 2px 8px rgba(48, 209, 88, 0.25); }

/* ── Sort & Export ────────────────────────────────────────────── */
.iso-sort-select {
    width: auto;
    min-width: 110px;
    padding-right: 28px;
}

.iso-export-btn {
    gap: 5px;
    white-space: nowrap;
    padding: 7px 14px !important;
    font-size: 0.75rem !important;
    border-radius: 10px !important;
}

.iso-export-btn:hover {
    background: var(--color-success) !important;
    border-color: var(--color-success) !important;
    color: #fff !important;
}

/* ── Sortable Table Headers ─────────────────────────────────── */
.iso-sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}

.iso-sortable:hover {
    color: var(--color-accent);
}

.iso-sort-icon {
    opacity: 0.3;
    transition: opacity 0.2s, transform 0.2s;
    vertical-align: middle;
    margin-left: 2px;
}

.iso-sortable:hover .iso-sort-icon {
    opacity: 0.6;
}

.iso-sortable.sort-active .iso-sort-icon {
    opacity: 1;
    color: var(--color-accent);
}

.iso-sortable.sort-asc .iso-sort-icon {
    transform: rotate(180deg);
}

/* ── Responsive: Category strip + chips ──────────────────────── */
@media (max-width: 1024px) {
    .iso-category-strip {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .iso-cat-strip-bars {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .iso-cat-strip-bars {
        flex-direction: column;
        gap: 10px;
    }
    .iso-cat-bar-item {
        min-width: 100%;
    }
    .iso-quick-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }
    .iso-chip {
        flex-shrink: 0;
    }
    .iso-toolbar-right {
        flex-wrap: wrap;
        gap: 8px;
    }
    .iso-sort-select {
        min-width: 100px;
    }
}

/* ── Dark Theme Support ───────────────────────────────────────────── */
[data-theme="dark"] .iso-init-container,
[data-theme="dark"] .iso-audit-table-wrap,
[data-theme="dark"] .iso-edit-modal,
[data-theme="dark"] .iso-action-modal {
    background: var(--bg-primary);
    border-color: var(--grey-700);
}

[data-theme="dark"] .iso-dashboard {
    background: var(--bg-primary);
    border-color: var(--grey-700);
}

[data-theme="dark"] .iso-dashboard-left {
    background: linear-gradient(135deg, rgba(0, 113, 227, 0.06) 0%, rgba(94, 92, 230, 0.06) 100%);
    border-color: var(--grey-700);
}

[data-theme="dark"] .iso-kpi-card {
    background: var(--bg-secondary);
    border-color: var(--grey-700);
}

[data-theme="dark"] .iso-control-card {
    background: var(--bg-primary);
    border-color: var(--grey-700);
}

[data-theme="dark"] .iso-card-bottom {
    border-color: var(--grey-800);
}

[data-theme="dark"] .iso-card-code {
    background: var(--grey-700);
}

[data-theme="dark"] .iso-action-item {
    background: var(--bg-primary);
    border-color: var(--grey-700);
}

[data-theme="dark"] .iso-action-done {
    background: var(--bg-secondary);
    border-color: var(--grey-800);
}

[data-theme="dark"] .iso-action-num {
    background: var(--bg-primary);
    border-color: var(--grey-600);
}

[data-theme="dark"] .iso-action-header,
[data-theme="dark"] .iso-action-footer {
    border-color: var(--grey-700);
    background: var(--bg-primary);
}

[data-theme="dark"] .iso-action-list::before {
    background: linear-gradient(180deg, var(--grey-700) 0%, rgba(0, 113, 227, 0.2) 100%);
}

[data-theme="dark"] .iso-action-progress {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, transparent 100%);
}

[data-theme="dark"] .iso-breakdown-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .iso-ring-bg {
    stroke: var(--grey-700);
}

[data-theme="dark"] .iso-view-toggle {
    background: var(--grey-800);
}

[data-theme="dark"] .iso-view-btn.active {
    background: var(--grey-700);
}

[data-theme="dark"] .iso-audit-toolbar {
    background: var(--bg-primary);
    border-color: var(--grey-700);
}

[data-theme="dark"] .iso-init-question {
    background: var(--bg-secondary);
    border-color: transparent;
}

[data-theme="dark"] .iso-init-question:hover {
    border-color: var(--grey-600);
}

[data-theme="dark"] .iso-audit-table thead th {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-color: var(--grey-700);
    color: var(--grey-400);
}

[data-theme="dark"] .iso-audit-table tbody tr:hover td:first-child {
    box-shadow: inset 3px 0 0 var(--color-accent);
}

[data-theme="dark"] .cat-organizational,
[data-theme="dark"] .cat-people,
[data-theme="dark"] .cat-physical,
[data-theme="dark"] .cat-technological {
    border-color: transparent;
}

[data-theme="dark"] .status-not_started,
[data-theme="dark"] .status-in_progress,
[data-theme="dark"] .status-implemented,
[data-theme="dark"] .status-verified,
[data-theme="dark"] .status-non_compliant {
    border-color: transparent;
}

[data-theme="dark"] .iso-audit-table tbody tr {
    border-color: var(--grey-800);
}

[data-theme="dark"] .iso-audit-table tbody tr:hover {
    background: rgba(0, 113, 227, 0.06);
}

[data-theme="dark"] .form-select,
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-textarea,
[data-theme="dark"] .form-select-sm,
[data-theme="dark"] .form-input-sm {
    background: var(--grey-800);
    border-color: var(--grey-700);
    color: var(--text-primary);
}

[data-theme="dark"] .modal-header {
    border-color: var(--grey-700);
    background: var(--bg-primary);
}

[data-theme="dark"] .modal-close {
    background: var(--grey-700);
    color: var(--grey-400);
}

[data-theme="dark"] .iso-init-step h3 {
    border-color: var(--grey-700);
}

[data-theme="dark"] .iso-init-progress-bar {
    background: var(--grey-700);
}

[data-theme="dark"] .mini-progress-bar {
    background: var(--grey-700);
}

[data-theme="dark"] .evidence-item {
    border-color: var(--grey-700);
    background: var(--bg-secondary);
}

[data-theme="dark"] .iso-skeleton {
    background: var(--grey-700);
}

[data-theme="dark"] .iso-category-strip {
    background: var(--bg-primary);
    border-color: var(--grey-700);
}

[data-theme="dark"] .iso-cat-bar-item:hover {
    background: var(--bg-secondary);
}

[data-theme="dark"] .iso-cat-bar-track {
    background: var(--grey-700);
}

[data-theme="dark"] .iso-chip {
    background: var(--bg-primary);
    border-color: var(--grey-700);
    color: var(--grey-400);
}

[data-theme="dark"] .iso-chip:hover {
    background: var(--bg-secondary);
    border-color: var(--grey-600);
}

[data-theme="dark"] .iso-chip-count {
    background: var(--grey-700);
    color: var(--grey-400);
}

/* ── CSP-compliant utility & variant classes ─────────── */
.iso-hidden { display: none !important; }

/* Metric icon variants */
.iso-icon-progress { background: rgba(94, 92, 230, 0.1); color: #5e5ce6; }

/* Category badge variants (audit table) */
.cat-organizational { background: rgba(0, 113, 227, 0.08); color: #0071e3; border: 1px solid rgba(0, 113, 227, 0.12); }
.cat-people         { background: rgba(48, 209, 88, 0.08); color: #1fa347; border: 1px solid rgba(48, 209, 88, 0.12); }
.cat-physical       { background: rgba(255, 159, 10, 0.08); color: #d97706; border: 1px solid rgba(255, 159, 10, 0.12); }
.cat-technological  { background: rgba(94, 92, 230, 0.08); color: #5e5ce6; border: 1px solid rgba(94, 92, 230, 0.12); }

/* Status pill variants (audit table) */
.status-not_started    { background: var(--grey-100); color: var(--grey-600); border: 1px solid var(--grey-200); }
.status-in_progress    { background: rgba(255, 159, 10, 0.08); color: #d97706; border: 1px solid rgba(255, 159, 10, 0.15); }
.status-implemented    { background: rgba(48, 209, 88, 0.08); color: #1fa347; border: 1px solid rgba(48, 209, 88, 0.15); }
.status-verified       { background: rgba(0, 113, 227, 0.08); color: #0071e3; border: 1px solid rgba(0, 113, 227, 0.15); }
.status-non_compliant  { background: rgba(255, 59, 48, 0.08); color: #ff3b30; border: 1px solid rgba(255, 59, 48, 0.15); }

/* Progress bar color variants */
.progress-color-success { background: linear-gradient(90deg, #0071e3, #30d158); }
.progress-color-warning { background: linear-gradient(90deg, #ff9f0a, #ffcc00); }
.progress-color-accent  { background: var(--color-accent); }

/* ── Staggered entrance animations ────────────────────────────────── */
@keyframes iso-fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes iso-scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

.iso-audit-table tbody tr {
    animation: iso-fadeInUp 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Stagger rows — first 20 rows get individual delays */
.iso-audit-table tbody tr:nth-child(1)  { animation-delay: 0.02s; }
.iso-audit-table tbody tr:nth-child(2)  { animation-delay: 0.04s; }
.iso-audit-table tbody tr:nth-child(3)  { animation-delay: 0.06s; }
.iso-audit-table tbody tr:nth-child(4)  { animation-delay: 0.08s; }
.iso-audit-table tbody tr:nth-child(5)  { animation-delay: 0.10s; }
.iso-audit-table tbody tr:nth-child(6)  { animation-delay: 0.12s; }
.iso-audit-table tbody tr:nth-child(7)  { animation-delay: 0.14s; }
.iso-audit-table tbody tr:nth-child(8)  { animation-delay: 0.16s; }
.iso-audit-table tbody tr:nth-child(9)  { animation-delay: 0.18s; }
.iso-audit-table tbody tr:nth-child(10) { animation-delay: 0.20s; }
.iso-audit-table tbody tr:nth-child(n+11) { animation-delay: 0.22s; }

.iso-control-card {
    animation: iso-scaleIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.iso-control-card:nth-child(1)  { animation-delay: 0.02s; }
.iso-control-card:nth-child(2)  { animation-delay: 0.05s; }
.iso-control-card:nth-child(3)  { animation-delay: 0.08s; }
.iso-control-card:nth-child(4)  { animation-delay: 0.11s; }
.iso-control-card:nth-child(5)  { animation-delay: 0.14s; }
.iso-control-card:nth-child(6)  { animation-delay: 0.17s; }
.iso-control-card:nth-child(7)  { animation-delay: 0.20s; }
.iso-control-card:nth-child(8)  { animation-delay: 0.23s; }
.iso-control-card:nth-child(n+9) { animation-delay: 0.26s; }

.iso-action-item {
    animation: iso-fadeInUp 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.iso-action-item:nth-child(1) { animation-delay: 0.03s; }
.iso-action-item:nth-child(2) { animation-delay: 0.06s; }
.iso-action-item:nth-child(3) { animation-delay: 0.09s; }
.iso-action-item:nth-child(4) { animation-delay: 0.12s; }

/* ==========================================================================
   ISO 27001 — Gantt Chart & Review Calendar
   ========================================================================== */

/* ── Utility ── */
.iso27k-hidden { display: none !important; }

/* ── Input / Select — shared controls ── */
.input {
    padding: 9px 14px;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-primary);
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}
.input:hover {
    border-color: var(--grey-300, #bbb);
}
.input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}
.input::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}
/* Select arrow */
select.input {
    padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    cursor: pointer;
}
select.input:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230071e3' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}
/* Small variant */
.input-sm {
    padding: 6px 11px;
    font-size: 0.75rem;
    border-radius: 8px;
}
select.input-sm {
    padding-right: 30px;
    background-position: right 10px center;
    background-size: 11px;
}
/* Dark mode */
[data-theme="dark"] .input {
    background: var(--grey-800, #1c1c1e);
    border-color: var(--grey-700, #38383a);
    color: var(--text-primary);
}
[data-theme="dark"] .input:hover {
    border-color: var(--grey-600, #48484a);
}
[data-theme="dark"] select.input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

/* ── Sidebar sub-links ── */
.sidebar-link-sub {
    padding-left: 38px;
    font-size: 0.7625rem;
    opacity: 0.85;
}
.sidebar-link-sub svg { width: 15px; height: 15px; }
.sidebar-link-sub.active { opacity: 1; }

/* ── Sidebar collapsible groups ── */
.sidebar-group { position: relative; }
.sidebar-link-parent {
    display: flex;
    align-items: center;
}
.sidebar-link-parent .sidebar-link {
    flex: 1;
    min-width: 0;
}
.sidebar-toggle-sub {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    margin-right: 6px;
    border: none;
    background: transparent;
    color: var(--text-tertiary, #888);
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s ease, color 0.15s ease, background 0.15s ease;
}
.sidebar-toggle-sub svg {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    transform: rotate(-90deg);
}
.sidebar-toggle-sub.open svg {
    transform: rotate(0deg);
}
.sidebar-toggle-sub:hover {
    color: var(--text-primary, #222);
    background: var(--grey-100, rgba(0,0,0,0.04));
}
[data-theme="dark"] .sidebar-toggle-sub:hover {
    color: var(--text-primary, #eee);
    background: var(--grey-800, rgba(255,255,255,0.06));
}
.sidebar-submenu {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}
.sidebar-submenu.open {
    max-height: 500px;
    opacity: 1;
}

/* ── Shared header ── */
.gantt-header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.gantt-header-left { display: flex; align-items: center; gap: 16px; }
.gantt-header-right { display: flex; align-items: center; gap: 8px; }
.gantt-back-btn { display: flex; align-items: center; gap: 4px; white-space: nowrap; }

/* ── Gantt search ── */
.gantt-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.gantt-search-icon {
    position: absolute;
    left: 10px;
    color: var(--text-muted, #94a3b8);
    pointer-events: none;
}
.gantt-search-input {
    padding-left: 32px !important;
    min-width: 180px;
}

/* ── Separator ── */
.gantt-separator {
    width: 1px;
    height: 20px;
    background: var(--border-light);
    flex-shrink: 0;
}

/* ── Gantt toolbar (filters + sort + zoom) ── */
.gantt-toolbar {
    margin-bottom: 16px;
    padding: 16px 20px;
    background: var(--bg-primary, var(--card-bg));
    border: 0.5px solid var(--border-light);
    border-radius: var(--radius-lg, 14px);
    box-shadow: var(--shadow-card, 0 1px 3px rgba(0,0,0,0.04));
}
.gantt-toolbar-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.gantt-toolbar-filters {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}
.gantt-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* Filter groups with labels */
.gantt-filter-group {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}
.gantt-filter-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.gantt-filter-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .675rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    user-select: none;
    padding-left: 2px;
}
.gantt-filter-label svg {
    opacity: 0.5;
    flex-shrink: 0;
}

/* Clear filters button */
.gantt-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    font-size: .72rem;
    font-weight: 500;
    color: var(--color-danger, #ff453a);
    background: transparent;
    border: 1px solid var(--color-danger, #ff453a);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    align-self: flex-end;
}
.gantt-clear-btn:hover {
    background: var(--color-danger, #ff453a);
    color: #fff;
}
.gantt-clear-btn svg { flex-shrink: 0; }

/* Active filter tags row */
.gantt-active-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}
.gantt-active-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px 4px 12px;
    font-size: .7rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-secondary, var(--grey-50));
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full, 50px);
    white-space: nowrap;
    animation: ganttTagIn .2s ease;
}
.gantt-active-tag-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-tertiary);
    padding: 0;
    transition: all .15s ease;
}
.gantt-active-tag-close:hover {
    background: var(--grey-200, #e5e5ea);
    color: var(--text-primary);
}
.gantt-active-tag-close svg { width: 10px; height: 10px; }
@keyframes ganttTagIn {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}

/* Legacy compat aliases */
.gantt-filters-left, .gantt-filters-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gantt-zoom-group {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--bg-secondary, var(--grey-50));
    border-radius: var(--radius-full, 50px);
    padding: 3px;
    border: 0.5px solid var(--border-light);
}
.gantt-zoom-label { font-size: .75rem; color: var(--text-tertiary); font-weight: 500; margin-right: 6px; }
.gantt-zoom-btn {
    padding: 5px 14px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-full, 50px);
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}
.gantt-zoom-btn:hover {
    color: var(--text-primary);
    background: var(--grey-200, #e5e5ea);
}
.gantt-zoom-btn.active {
    background: var(--bg-primary, #fff);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    font-weight: 600;
}

/* ── Zoom slider ── */
.gantt-zoom-slider-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 4px;
    padding-left: 10px;
    border-left: 1px solid var(--border-light);
}
.gantt-zoom-slider-group svg { opacity: 0.4; flex-shrink: 0; }
.gantt-zoom-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 90px;
    height: 4px;
    border-radius: 2px;
    background: var(--grey-200, #ddd);
    outline: none;
    cursor: pointer;
}
.gantt-zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-accent);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    transition: transform 0.1s ease;
}
.gantt-zoom-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.gantt-zoom-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-accent);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.gantt-zoom-value {
    font-size: .65rem;
    font-weight: 700;
    color: var(--text-tertiary);
    min-width: 28px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* ── Gantt legend bar ── */
.gantt-legend-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    padding: 10px 20px;
    background: var(--bg-primary, var(--card-bg));
    border: 0.5px solid var(--border-light);
    border-radius: var(--radius-lg, 14px);
    box-shadow: var(--shadow-card, 0 1px 3px rgba(0,0,0,0.04));
}
.gantt-legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: .72rem;
    color: var(--text-secondary);
}
.gantt-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
    font-size: .72rem;
    color: var(--text-secondary);
}
.gantt-legend-item { display: flex; align-items: center; gap: 6px; }
.gantt-legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.gantt-dot-not_started { background: #8e8e93; }
.gantt-dot-in_progress { background: #0071e3; }
.gantt-dot-implemented { background: #30d158; }
.gantt-dot-verified { background: #5e5ce6; }
.gantt-dot-non_compliant { background: #ff453a; }
.gantt-today-line { width: 16px; height: 2px; background: #ff453a; display: inline-block; vertical-align: middle; }
.gantt-legend-line { display: inline-block; }

/* ── Gantt wrapper ── */
.gantt-wrapper {
    background: var(--bg-primary, var(--card-bg));
    border: 0.5px solid var(--border-light);
    border-radius: var(--radius-lg, 14px);
    overflow-x: auto;
    min-height: 200px;
    position: relative;
    padding: 0;
    cursor: grab;
    scroll-behavior: auto;
    box-shadow: var(--shadow-card, 0 1px 3px rgba(0,0,0,0.04));
}
.gantt-wrapper.g-grabbing { cursor: grabbing; }
.gantt-wrapper::-webkit-scrollbar { width: 0; height: 8px; }
.gantt-wrapper::-webkit-scrollbar-track { background: var(--grey-50); border-radius: 4px; }
.gantt-wrapper::-webkit-scrollbar-thumb {
    background: var(--grey-300, #bbb);
    border-radius: 4px;
    border: 1px solid var(--grey-50);
}
.gantt-wrapper::-webkit-scrollbar-thumb:hover { background: var(--grey-400, #999); }
.gantt-wrapper::-webkit-scrollbar-corner { background: var(--grey-50); }

.gantt-loading, .gantt-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
    gap: 16px;
}

/* ── Skeleton loading ── */
.gantt-loading-skeleton {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.gantt-skel-row {
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(90deg,
        var(--border-light, rgba(226,232,240,0.4)) 25%,
        rgba(226,232,240,0.08) 50%,
        var(--border-light, rgba(226,232,240,0.4)) 75%);
    background-size: 200% 100%;
    animation: ganttSkelPulse 1.8s ease-in-out infinite;
}
.gantt-skel-row-2 { width: 85%; animation-delay: 0.1s; }
.gantt-skel-row-3 { width: 92%; animation-delay: 0.2s; }
.gantt-skel-row-4 { width: 78%; animation-delay: 0.3s; }
.gantt-skel-row-5 { width: 88%; animation-delay: 0.4s; opacity: 0.5; }
@keyframes ganttSkelPulse {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.gantt-loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--grey-200, #e0e0e0);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: gantt-spin 0.7s linear infinite;
}
@keyframes gantt-spin {
    to { transform: rotate(360deg); }
}
.gantt-loading p, .gantt-empty p {
    font-size: .82rem;
    font-weight: 500;
    margin: 0;
}
/* ── Empty state ── */
.gantt-empty-icon {
    width: 88px; height: 88px;
    border-radius: 50%;
    background: var(--surface-alt, rgba(148, 163, 184, 0.06));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}
.gantt-empty svg { opacity: 0.3; stroke: var(--text-tertiary); }
.gantt-empty h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
}
.gantt-empty p { max-width: 360px; text-align: center; line-height: 1.5; }

/* ── Timeline header (dual-row) ── */
.gantt-timeline-header {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 4;
    background: var(--grey-50, #fbfbfd);
    border-bottom: 1px solid var(--border-light);
    height: 56px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    min-width: fit-content;
}
.g-labels {
    flex-shrink: 0;
    background: var(--grey-50, #fbfbfd);
    border-right: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    position: sticky;
    left: 0;
    z-index: 5;
    height: 56px;
}
.g-labels-text {
    font-size: .7rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.g-hdr-timeline {
    flex-shrink: 0;
    position: relative;
    z-index: 0;
    height: 56px;
}

/* Shared row */
.g-hdr-row {
    position: absolute;
    left: 0;
    right: 0;
}
.g-hdr-row-top {
    top: 0;
    height: 24px;
    border-bottom: 0.5px solid var(--border-light);
}
.g-hdr-row-bot {
    top: 24px;
    height: 32px;
}

/* Cells */
.g-hcell {
    position: absolute;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-right: 0.5px solid var(--border-light);
}
.g-hcell-top {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}
.g-hcell-bot {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: capitalize;
}
.g-hcell-lbl {
    position: relative;
    z-index: 1;
    white-space: nowrap;
}
.g-hcell-cur {
    background: rgba(0, 113, 227, 0.06);
    color: var(--color-accent);
    font-weight: 700;
}

/* Week ticks in header */
.g-wtick {
    position: absolute;
    top: 20px;
    width: 1px;
    height: 10px;
    background: var(--border-light);
    opacity: 0.5;
}
.g-wtick-lbl {
    top: 16px;
    height: 14px;
}
.g-wtick-lbl span {
    position: absolute;
    top: -12px;
    left: 3px;
    font-size: .55rem;
    color: var(--text-tertiary);
    font-weight: 500;
    pointer-events: none;
}

/* Today marker in header */
.g-hdr-today {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ff453a;
    z-index: 2;
    border-radius: 1px;
}

/* ── Resize handle ── */
.g-resize {
    position: absolute;
    top: 0;
    right: -2px;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    z-index: 5;
    background: transparent;
    transition: background 0.15s ease;
}
.g-resize:hover,
.g-resize:active {
    background: var(--color-accent);
    opacity: 0.4;
}

/* ── Gantt body ── */
.gantt-body {
    padding-bottom: 12px;
    position: relative;
}

.g-cat-sec + .g-cat-sec { border-top: 1px solid var(--border-light); }
.g-cat-sec { position: relative; z-index: 1; }

/* Category label — clickable to collapse */
.g-cat-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px 8px;
    font-size: .72rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease, padding 0.2s ease;
    position: sticky;
    left: 0;
    z-index: 3;
    background: var(--card-bg, #fff);
    width: fit-content;
    min-width: 100%;
    border-bottom: 1px solid transparent;
}
.g-cat-label:hover {
    background: var(--grey-50, #fbfbfd);
    border-bottom-color: var(--border-light);
}

.g-cat-chev {
    flex-shrink: 0;
    transition: transform 0.2s ease;
    opacity: 0.5;
}
.g-cat-chev.g-cat-col { transform: rotate(-90deg); }

.g-cat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.g-cat-count { font-weight: 700; color: var(--text-tertiary); font-size: .65rem; background: var(--grey-100); padding: 2px 8px; border-radius: 10px; }
.g-cat-bar { width: 80px; height: 4px; background: var(--grey-100); border-radius: 2px; overflow: hidden; }
.g-cat-fill { height: 100%; border-radius: 2px; transition: width 0.6s cubic-bezier(.4,0,.2,1); }
.g-cat-pct { font-size: .62rem; font-weight: 700; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }

.g-row {
    display: flex;
    align-items: center;
    height: 38px;
    border-bottom: 0.5px solid var(--border-lighter, var(--border-light));
    transition: background 0.15s ease;
    position: relative;
    z-index: 1;
    background: var(--card-bg, #fff);
    min-width: fit-content;
}
.g-row-even { background: var(--grey-50, #fbfbfd); }
.g-row:hover { background: rgba(0, 113, 227, 0.04); }
.g-row:hover .g-bar { filter: brightness(1.03); }

.g-row-label {
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--card-bg, #fff);
    border-right: 1px solid var(--border-light);
    height: 100%;
}
.g-row-even .g-row-label { background: var(--grey-50, #fbfbfd); }
.g-row:hover .g-row-label {
    background-color: var(--card-bg, #fff);
    background-image: linear-gradient(rgba(0, 113, 227, 0.06), rgba(0, 113, 227, 0.06));
}
.g-row-even:hover .g-row-label {
    background-color: var(--grey-50, #fbfbfd);
    background-image: linear-gradient(rgba(0, 113, 227, 0.06), rgba(0, 113, 227, 0.06));
}

.g-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.6);
}

.g-ctrl-id {
    font-size: .7rem;
    font-weight: 700;
    color: var(--color-accent);
    white-space: nowrap;
}
.g-ctrl-name {
    font-size: .7rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}
.g-ctrl-resp {
    font-size: .6rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--grey-100);
    flex-shrink: 0;
}

/* ── Gantt timeline area ── */
.g-row-timeline {
    position: relative;
    height: 100%;
    flex-shrink: 0;
    z-index: 0;
}

.g-bar {
    position: absolute;
    top: 7px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid;
    display: flex;
    align-items: center;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.15);
    transition: transform 0.18s cubic-bezier(.4,0,.2,1), box-shadow 0.18s cubic-bezier(.4,0,.2,1), filter 0.18s ease;
    z-index: 1;
}
.g-bar:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 6px 20px rgba(0,0,0,0.16), 0 2px 6px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.2);
    z-index: 2;
    filter: brightness(1.05);
}
.g-bar:active {
    transform: translateY(0) scale(1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.g-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s cubic-bezier(.4,0,.2,1);
    background-image: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 100%);
}

.g-bar-id {
    position: absolute;
    left: 8px;
    font-size: .58rem;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 0 4px var(--card-bg), 0 0 8px var(--card-bg);
    z-index: 1;
    opacity: 0.7;
}

.g-bar-text {
    position: absolute;
    right: 6px;
    font-size: .6rem;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 0 4px var(--card-bg), 0 0 8px var(--card-bg);
    z-index: 1;
}

.g-bar-overdue {
    animation: gantt-pulse 2.5s ease-in-out infinite;
}
@keyframes gantt-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 0 0 0 rgba(255,69,58,0); }
    50% { opacity: 0.75; box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 0 0 4px rgba(255,69,58,0.12); }
}

/* ── Duration labels ── */
.g-dur {
    position: absolute;
    top: 12px;
    font-size: .58rem;
    font-weight: 600;
    color: var(--text-tertiary);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0.8;
}
.g-dur-over { color: #ff453a; font-weight: 700; opacity: 1; }

/* ── Tooltip ── */
.gantt-tooltip {
    position: fixed;
    z-index: 9999;
    background: var(--card-bg);
    border: 0.5px solid var(--border-light);
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.16), 0 4px 16px rgba(0,0,0,0.08), 0 0 0 0.5px rgba(0,0,0,0.04);
    padding: 0;
    min-width: 260px;
    max-width: 350px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px) scale(0.98);
    transition: opacity 0.18s cubic-bezier(.4,0,.2,1), transform 0.18s cubic-bezier(.4,0,.2,1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow: hidden;
}
.g-tt-show { opacity: 1; transform: translateY(0) scale(1); }
.g-tt-hdr {
    padding: 10px 14px;
    font-size: .72rem;
    color: var(--text-primary);
    border-bottom: 0.5px solid var(--border-light);
    border-left: 3px solid;
    line-height: 1.4;
}
.g-tt-id { font-size: .78rem; font-weight: 700; display: block; margin-bottom: 1px; color: var(--text-primary); }
.g-tt-name { font-size: .68rem; color: var(--text-secondary); display: block; line-height: 1.3; }
.g-tt-sdot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.g-tt-body { padding: 10px 14px; }
.g-tt-row {
    display: flex;
    justify-content: space-between;
    font-size: .7rem;
    padding: 4px 0;
    color: var(--text-secondary);
}
.g-tt-row span:first-child { color: var(--text-tertiary); }

/* Tooltip progress bar */
.g-tt-prog {
    display: inline-block;
    width: 60px;
    height: 4px;
    background: var(--grey-100);
    border-radius: 2px;
    overflow: hidden;
    vertical-align: middle;
    margin-right: 6px;
}
.g-tt-pfill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.g-tt-alert {
    margin-top: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: .65rem;
    font-weight: 700;
    color: #ff453a;
    background: rgba(255,69,58,0.08);
    text-align: center;
}
.g-tt-info {
    margin-top: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: .65rem;
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--grey-100);
    text-align: center;
}

/* ── Zoom hint ── */
.gantt-zoom-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .65rem;
    color: var(--text-tertiary);
    opacity: 0.6;
}
.gantt-zoom-hint kbd {
    display: inline-block;
    padding: 1px 5px;
    font-size: .6rem;
    font-family: inherit;
    background: var(--grey-100);
    border: 0.5px solid var(--border-light);
    border-radius: 3px;
    box-shadow: 0 1px 0 var(--border-light);
}

/* ── Controls without dates ── */
.gantt-nodates-section {
    margin-top: 20px;
    background: var(--bg-primary, var(--card-bg));
    border: 0.5px solid var(--border-light);
    border-radius: var(--radius-lg, 14px);
    overflow: hidden;
    box-shadow: var(--shadow-card, 0 1px 3px rgba(0,0,0,0.04));
}
.gantt-nodates-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}
.gantt-nodates-header:hover { background: var(--grey-50); }
.gantt-nodate-chevron { transition: transform 0.2s ease; flex-shrink: 0; }
.gantt-nodate-count {
    font-size: .65rem;
    font-weight: 700;
    color: var(--text-tertiary);
    background: var(--grey-100);
    padding: 1px 7px;
    border-radius: 8px;
}
.gantt-nodates-body { padding: 0 16px 12px; }
.g-nodate-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 0.5px solid var(--border-lighter, var(--border-light));
    font-size: .7rem;
    border-radius: 6px;
    transition: background 0.15s ease, transform 0.15s ease;
    margin: 0 -2px;
}
.g-nodate-item:last-child { border-bottom: none; }
.g-nodate-item:hover { background: var(--grey-50); transform: translateX(2px); }
.g-nodate-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
}
.g-nodate-cat { font-weight: 600; font-size: .6rem; white-space: nowrap; }
.g-nodate-prog { font-weight: 600; color: var(--text-tertiary); white-space: nowrap; }

/* ── Gantt stats dashboard ── */
.gantt-stats-dashboard {
    margin-bottom: 24px;
}
.gantt-stats-dashboard .gantt-stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}
.gantt-stats { margin-top: 24px; }
.gantt-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}
.gantt-stat-card {
    background: var(--bg-primary, var(--card-bg));
    border: 0.5px solid var(--border-light);
    border-radius: var(--radius-lg, 14px);
    padding: 20px 18px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: var(--shadow-card, 0 1px 3px rgba(0,0,0,0.04));
    transition: box-shadow 0.3s ease, transform 0.25s cubic-bezier(.4,0,.2,1);
    position: relative;
    overflow: hidden;
}
.gantt-stat-card:hover {
    box-shadow: var(--shadow-card-hover, 0 6px 20px rgba(0,0,0,0.08));
    transform: translateY(-2px);
}
.gantt-stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}
.gantt-stat-value small {
    font-size: .75rem;
    font-weight: 600;
    opacity: 0.5;
}

/* Stat progress ring */
.gantt-stat-ring {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-primary);
    background: conic-gradient(
        var(--color, var(--color-accent)) calc(var(--pct, 0) * 1%),
        var(--grey-100) calc(var(--pct, 0) * 1%)
    );
    position: relative;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}
.gantt-stat-card-ring:hover .gantt-stat-ring { transform: scale(1.08); }
.gantt-stat-ring::before {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--card-bg);
}
.gantt-stat-ring span {
    position: relative;
    z-index: 1;
}
.gantt-stat-label {
    font-size: .75rem;
    color: var(--text-tertiary);
    font-weight: 500;
}
.gantt-stat-danger .gantt-stat-value { color: #ff453a; }
.gantt-stat-success .gantt-stat-value { color: #30d158; }

/* ── Stat card icon ── */
.gantt-stat-icon-wrap {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm, 8px);
    display: flex;
    transition: transform 0.2s ease;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.gantt-stat-icon-controls  { background: rgba(0, 113, 227, 0.1);  color: #0071e3; }
.gantt-stat-icon-nodates   { background: rgba(142, 142, 147, 0.1); color: #8e8e93; }
.gantt-stat-icon-progress  { background: rgba(94, 92, 230, 0.1);  color: #5e5ce6; }
.gantt-stat-icon-overdue   { background: rgba(255, 69, 58, 0.1);  color: #ff453a; }
.gantt-stat-icon-completed { background: rgba(48, 209, 88, 0.1);  color: #30d158; }
.gantt-stat-icon-span      { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }

.gantt-stat-card-h {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 12px;
}
.gantt-stat-card-h > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

/* ── Fullscreen mode ── */
.gantt-fullscreen {
    position: fixed !important;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 9990;
    background: var(--card-bg, #fff);
    border-radius: 0 !important;
    max-height: 100vh !important;
    padding: 0;
}
.gantt-fullscreen-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9989;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: gantt-fs-fade 0.3s ease;
}
@keyframes gantt-fs-fade { from { opacity: 0; } to { opacity: 1; } }
.gantt-fs-exit {
    position: absolute;
    top: 12px; right: 16px;
    z-index: 9991;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    transition: all 0.15s;
}
.gantt-fs-exit:hover {
    background: var(--grey-50);
    color: var(--text-primary);
}

/* ── Refresh spin animation ── */
@keyframes spinOnce { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.spin-once { animation: spinOnce 0.6s ease; }

/* ── Gantt CSP-safe color classes ── */
.g-dot-not_started { background: #8e8e93; }
.g-dot-in_progress { background: #0071e3; }
.g-dot-implemented { background: #30d158; }
.g-dot-verified { background: #5e5ce6; }
.g-dot-non_compliant { background: #ff453a; }
.g-cat-dot-organizational { background: #0071e3; }
.g-cat-dot-people { background: #bf5af2; }
.g-cat-dot-physical { background: #ff9f0a; }
.g-cat-dot-technological { background: #30d158; }
.g-cat-fill-organizational { background: #0071e3; }
.g-cat-fill-people { background: #bf5af2; }
.g-cat-fill-physical { background: #ff9f0a; }
.g-cat-fill-technological { background: #30d158; }
.g-bar-not_started { background: rgba(142,142,147,0.12); border-color: rgba(142,142,147,0.5); }
.g-bar-in_progress { background: rgba(0,113,227,0.1); border-color: rgba(0,113,227,0.45); }
.g-bar-implemented { background: rgba(48,209,88,0.1); border-color: rgba(48,209,88,0.45); }
.g-bar-verified { background: rgba(94,92,230,0.1); border-color: rgba(94,92,230,0.45); }
.g-bar-non_compliant { background: rgba(255,69,58,0.1); border-color: rgba(255,69,58,0.45); }
.g-fill-not_started { background: linear-gradient(90deg, #8e8e93, #a8a8ad); }
.g-fill-in_progress { background: linear-gradient(90deg, #0062cc, #0088ff); }
.g-fill-implemented { background: linear-gradient(90deg, #28b84c, #3de068); }
.g-fill-verified { background: linear-gradient(90deg, #4f4dcf, #7270f0); }
.g-fill-non_compliant { background: linear-gradient(90deg, #e63c32, #ff5e54); }
.g-tt-hdr-not_started { border-color: #8e8e93; }
.g-tt-hdr-in_progress { border-color: #0071e3; }
.g-tt-hdr-implemented { border-color: #30d158; }
.g-tt-hdr-verified { border-color: #5e5ce6; }
.g-tt-hdr-non_compliant { border-color: #ff453a; }
.g-nodate-cat-organizational { color: #0071e3; }
.g-nodate-cat-people { color: #bf5af2; }
.g-nodate-cat-physical { color: #ff9f0a; }
.g-nodate-cat-technological { color: #30d158; }
.gantt-nodate-chevron-open { transform: rotate(180deg); }

/* ── Bar resize handles ── */
.g-handle {
    position: absolute;
    top: 0;
    width: 10px;
    height: 100%;
    cursor: ew-resize;
    z-index: 3;
    border-radius: 4px;
    transition: background 0.15s ease, opacity 0.15s ease;
    opacity: 0;
}
.g-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 3px;
    height: 12px;
    border-radius: 2px;
    background: rgba(255,255,255,0.8);
    box-shadow: 0 0 2px rgba(0,0,0,0.15);
}
.g-handle-l { left: -3px; }
.g-handle-r { right: -3px; }
.g-bar:hover .g-handle {
    opacity: 0.7;
    background: rgba(0,0,0,0.08);
}
.g-bar:hover .g-handle:hover {
    opacity: 1;
    background: rgba(0,0,0,0.15);
}
.g-bar-dragging {
    opacity: 0.85;
    z-index: 10 !important;
    cursor: ew-resize;
    transition: none !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* ── Drag preview label ── */
.g-preview {
    position: fixed;
    z-index: 99999;
    background: var(--card-bg, #fff);
    border: 1px solid var(--color-accent);
    color: var(--text-primary);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: .65rem;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.12s ease, transform 0.12s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.g-preview-show {
    opacity: 1;
    transform: translateY(0);
}

/* ── Row label clickable ── */
.g-row-label-click {
    cursor: pointer;
    transition: background 0.12s ease;
}
.g-row-label-click:hover .g-ctrl-id {
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 2px;
}
.g-row-label-click:active {
    opacity: 0.85;
}

/* ── Toast notifications ── */
.gantt-toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.gantt-toast {
    padding: 10px 18px;
    border-radius: 12px;
    font-size: .78rem;
    font-weight: 600;
    color: #fff;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(30px) scale(0.95);
    transition: opacity 0.3s cubic-bezier(.4,0,.2,1), transform 0.3s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    max-width: 320px;
    backdrop-filter: blur(8px);
}
.gantt-toast-visible {
    opacity: 1;
    transform: translateX(0) scale(1);
}
.gantt-toast-success { background: rgba(48,209,88,0.95); }
.gantt-toast-error { background: rgba(255,69,58,0.95); }
.gantt-toast-info { background: rgba(0,113,227,0.95); }

/* ── Edit Panel (slide-in from right) ── */
.gantt-edit-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    max-width: 92vw;
    height: 100vh;
    background: var(--card-bg, #fff);
    border-left: 1px solid var(--border-light);
    box-shadow: -12px 0 48px rgba(0,0,0,0.14), -4px 0 16px rgba(0,0,0,0.06);
    z-index: 9992;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.32,0.72,0,1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.gantt-edit-panel.g-ep-open {
    transform: translateX(0);
}
.g-ep-hdr {
    padding: 22px 22px 18px;
    border-bottom: 1px solid var(--border-light);
    border-left: 4px solid;
    background: linear-gradient(135deg, rgba(0,113,227,0.02) 0%, transparent 100%);
}
.g-ep-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.g-ep-id {
    font-size: .9rem;
    font-weight: 700;
    color: var(--color-accent);
    display: block;
    margin-bottom: 4px;
}
.g-ep-name {
    font-size: .78rem;
    color: var(--text-secondary);
    display: block;
    line-height: 1.4;
}
.g-ep-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    color: var(--text-tertiary);
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.g-ep-close:hover {
    background: var(--grey-100);
    color: var(--text-primary);
}
.g-ep-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.g-ep-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.g-ep-field label {
    font-size: .72rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.g-ep-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.g-ep-pv {
    font-size: .78rem;
    font-weight: 700;
    color: var(--color-accent);
    text-transform: none;
    letter-spacing: 0;
}
.g-ep-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, var(--color-accent) var(--ep-fill, 0%), var(--grey-200, #ddd) var(--ep-fill, 0%));
    outline: none;
    cursor: pointer;
    transition: background 0.1s ease;
}
.g-ep-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-accent);
    cursor: pointer;
    border: 2.5px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.g-ep-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 10px rgba(0,0,0,0.22);
}
.g-ep-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-accent);
    cursor: pointer;
    border: 2.5px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
.g-ep-cat {
    font-size: .78rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--grey-50);
    width: fit-content;
}
.g-ep-actions {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}
.g-ep-actions .btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ── No-date assign button ── */
.g-nodate-assign {
    flex-shrink: 0;
    padding: 3px 6px !important;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.g-nodate-item:hover .g-nodate-assign {
    opacity: 1;
}
.g-nodate-item {
    cursor: pointer;
}

/* ── Tooltip edit hint ── */
.g-tt-hint {
    margin-top: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: .6rem;
    font-weight: 500;
    color: var(--text-tertiary);
    background: var(--grey-50);
    text-align: center;
    opacity: 0.7;
}

/* ── Dark mode additions ── */
[data-theme="dark"] .gantt-edit-panel {
    background: var(--grey-800, #1c1c1e);
    border-color: var(--grey-700, #38383a);
}
[data-theme="dark"] .g-ep-hdr {
    background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, transparent 100%);
}
[data-theme="dark"] .g-preview {
    background: var(--grey-800, #1c1c1e);
}
[data-theme="dark"] .g-ep-close:hover {
    background: var(--grey-700, #38383a);
}
[data-theme="dark"] .g-ep-slider {
    background: linear-gradient(to right, var(--color-accent) var(--ep-fill, 0%), var(--grey-700, #38383a) var(--ep-fill, 0%));
}
[data-theme="dark"] .g-ep-cat {
    background: var(--grey-700, #38383a);
}
[data-theme="dark"] .g-row { background: var(--card-bg); }
[data-theme="dark"] .g-row-even { background: var(--grey-900, #1c1c1e); }
[data-theme="dark"] .g-row-label { background: var(--card-bg); }
[data-theme="dark"] .g-row-even .g-row-label { background: var(--grey-900, #1c1c1e); }
[data-theme="dark"] .g-row:hover .g-row-label {
    background-color: var(--card-bg);
    background-image: linear-gradient(rgba(0,113,227,0.08), rgba(0,113,227,0.08));
}
[data-theme="dark"] .g-row-even:hover .g-row-label {
    background-color: var(--grey-900, #1c1c1e);
    background-image: linear-gradient(rgba(0,113,227,0.08), rgba(0,113,227,0.08));
}
[data-theme="dark"] .g-cat-label { background: var(--card-bg); }
[data-theme="dark"] .g-cat-label:hover { background: var(--grey-800, #2c2c2e); }
[data-theme="dark"] .g-cat-count { background: var(--grey-800, #2c2c2e); }
[data-theme="dark"] .g-nodate-item:hover { background: var(--grey-800, #2c2c2e); }
[data-theme="dark"] .gantt-wrapper { background: var(--card-bg); border-color: var(--grey-700, #38383a); }
[data-theme="dark"] .gantt-wrapper::-webkit-scrollbar-track { background: var(--grey-900, #1c1c1e); }
[data-theme="dark"] .gantt-wrapper::-webkit-scrollbar-thumb { background: var(--grey-600, #48484a); border-color: var(--grey-900); }
[data-theme="dark"] .gantt-toolbar { background: var(--card-bg); border-color: var(--grey-700, #38383a); }
[data-theme="dark"] .gantt-filter-label { color: var(--text-tertiary); }
[data-theme="dark"] .gantt-clear-btn { color: var(--color-danger, #ff453a); border-color: var(--color-danger, #ff453a); }
[data-theme="dark"] .gantt-clear-btn:hover { background: var(--color-danger, #ff453a); color: #fff; }
[data-theme="dark"] .gantt-active-filters { border-top-color: var(--grey-700, #38383a); }
[data-theme="dark"] .gantt-active-tag { background: var(--grey-800, #2c2c2e); border-color: var(--grey-700, #38383a); color: var(--text-secondary); }
[data-theme="dark"] .gantt-active-tag-close:hover { background: var(--grey-700, #38383a); color: var(--text-primary); }
[data-theme="dark"] .gantt-zoom-group { background: var(--grey-800, #2c2c2e); border-color: var(--grey-700, #38383a); }
[data-theme="dark"] .gantt-zoom-btn:hover { background: var(--grey-700, #38383a); }
[data-theme="dark"] .gantt-zoom-btn.active { background: var(--grey-700, #38383a); box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
[data-theme="dark"] .gantt-nodates-section { background: var(--card-bg); border-color: var(--grey-700, #38383a); }
[data-theme="dark"] .gantt-legend-bar { background: var(--card-bg); border-color: var(--grey-700, #38383a); }
[data-theme="dark"] .gantt-tooltip {
    background: var(--grey-800, #1c1c1e);
    border-color: var(--grey-700, #38383a);
    box-shadow: 0 16px 48px rgba(0,0,0,0.35), 0 4px 16px rgba(0,0,0,0.2);
}
[data-theme="dark"] .g-bar-id { text-shadow: 0 0 4px var(--grey-900), 0 0 8px var(--grey-900); }
[data-theme="dark"] .g-bar-text { text-shadow: 0 0 4px var(--grey-900), 0 0 8px var(--grey-900); }
[data-theme="dark"] .g-handle::after { background: rgba(255,255,255,0.5); }
[data-theme="dark"] .gantt-toast { box-shadow: 0 8px 24px rgba(0,0,0,0.35); }
[data-theme="dark"] .gantt-stat-card { background: var(--card-bg); border-color: var(--grey-700, #38383a); }
[data-theme="dark"] .gantt-stat-card:hover { border-color: var(--color-accent); box-shadow: 0 6px 20px rgba(0,0,0,0.2); }
[data-theme="dark"] .gantt-timeline-header { background: var(--grey-900, #1c1c1e); box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
[data-theme="dark"] .g-labels { background: var(--grey-900, #1c1c1e); }
[data-theme="dark"] .gantt-fullscreen-overlay { background: rgba(0,0,0,0.7); }

/* ── Gantt responsive ── */
@media (max-width: 1200px) {
    .gantt-stats-dashboard .gantt-stats-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    .gantt-stats-dashboard .gantt-stats-grid { grid-template-columns: repeat(3, 1fr); }
    .gantt-edit-panel { width: 340px; }
}
@media (max-width: 768px) {
    .gantt-toolbar-row { flex-direction: column; align-items: stretch; gap: 12px; }
    .gantt-toolbar-filters { flex-direction: column; align-items: stretch; }
    .gantt-filter-group { flex-direction: column; }
    .gantt-toolbar-actions { justify-content: flex-start; flex-wrap: wrap; }
    .gantt-zoom-slider-group { display: none; }
    .gantt-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .gantt-stats-dashboard .gantt-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .gantt-header-row { flex-direction: column; align-items: flex-start; gap: 10px; }
    .gantt-header-right { margin-top: 0; width: 100%; justify-content: flex-end; }
    .gantt-search-input { min-width: unset !important; width: 100%; }
    .gantt-legend-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
    .gantt-edit-panel { width: 100%; max-width: 100vw; }
    .g-ep-hdr { padding: 16px; }
    .g-ep-body { padding: 16px; }
    .gantt-zoom-hint { display: none; }
}
@media (max-width: 480px) {
    .gantt-stats-dashboard .gantt-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .gantt-stat-card { padding: 10px 12px; }
    .gantt-stat-value { font-size: 1.15rem; }
    .gantt-stat-icon-wrap { width: 32px; height: 32px; border-radius: 8px; }
    .gantt-stat-icon-wrap svg { width: 15px; height: 15px; }
    .gantt-zoom-group { flex-wrap: wrap; }
}

/* ==========================================================================
   Review Calendar
   ========================================================================== */

/* ── Calendar navigation ── */
.cal-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}
.cal-month-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 200px;
    text-align: center;
    text-transform: capitalize;
}
.cal-today-btn { margin-left: auto; }

/* ── Calendar legend ── */
.cal-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; font-size: .75rem; color: var(--text-secondary); }
.cal-legend-item { display: flex; align-items: center; gap: 6px; }
.cal-legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.cal-dot-overdue { background: #ff453a; }
.cal-dot-upcoming { background: #ff9f0a; }
.cal-dot-done { background: #30d158; }
.cal-dot-future { background: #0071e3; }

/* ── Calendar grid ── */
.cal-grid-wrapper {
    background: var(--card-bg);
    border: 0.5px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.cal-day-headers {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--grey-50);
    border-bottom: 0.5px solid var(--border-light);
}
.cal-day-header {
    padding: 10px;
    text-align: center;
    font-size: .7rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.cal-cell {
    min-height: 100px;
    border-right: 0.5px solid var(--border-light);
    border-bottom: 0.5px solid var(--border-light);
    padding: 6px;
    position: relative;
    transition: background var(--transition-fast);
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell:hover { background: var(--grey-50); }
.cal-cell-empty { background: var(--grey-50); opacity: 0.5; }
.cal-cell-today { background: rgba(0, 113, 227, 0.04); }

.cal-cell-day {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: inline-block;
    margin-bottom: 4px;
}
.cal-today-badge {
    background: var(--color-accent);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
}

.cal-cell-reviews { display: flex; flex-direction: column; gap: 2px; }

.cal-review-dot {
    font-size: .6rem;
    padding: 2px 4px;
    border-radius: 3px;
    border-left: 3px solid;
    background: var(--grey-100);
    color: var(--text-secondary);
    cursor: default;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: background var(--transition-fast);
}
.cal-review-dot:hover { background: var(--grey-200); }

.cal-review-overdue { background: rgba(255, 69, 58, 0.08); color: #ff453a; }
.cal-review-done { background: rgba(48, 209, 88, 0.08); color: #30d158; }
.cal-review-upcoming { background: rgba(255, 159, 10, 0.08); color: #c77800; }

.cal-review-code { font-weight: 700; }

/* Calendar category border-left colors */
.cal-review-dot-organizational { border-left-color: #0071e3; }
.cal-review-dot-people { border-left-color: #bf5af2; }
.cal-review-dot-physical { border-left-color: #ff9f0a; }
.cal-review-dot-technological { border-left-color: #30d158; }
.cal-review-dot-context { border-left-color: #0071e3; }
.cal-review-dot-leadership { border-left-color: #30d158; }
.cal-review-dot-planning { border-left-color: #ff9f0a; }
.cal-review-dot-support { border-left-color: #5e5ce6; }
.cal-review-dot-operation { border-left-color: #ff375f; }
.cal-review-dot-performance { border-left-color: #bf5af2; }
.cal-review-dot-improvement { border-left-color: #64d2ff; }

/* Calendar category text colors for upcoming codes */
.cal-upcoming-code-organizational { color: #0071e3; }
.cal-upcoming-code-people { color: #bf5af2; }
.cal-upcoming-code-physical { color: #ff9f0a; }
.cal-upcoming-code-technological { color: #30d158; }
.cal-upcoming-code-context { color: #0071e3; }
.cal-upcoming-code-leadership { color: #30d158; }
.cal-upcoming-code-planning { color: #ff9f0a; }
.cal-upcoming-code-support { color: #5e5ce6; }
.cal-upcoming-code-operation { color: #ff375f; }
.cal-upcoming-code-performance { color: #bf5af2; }
.cal-upcoming-code-improvement { color: #64d2ff; }

/* ── Upcoming list ── */
.cal-upcoming-section {
    margin-top: 32px;
}
.cal-upcoming-section h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}
.cal-upcoming-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cal-upcoming-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--card-bg);
    border: 0.5px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    gap: 12px;
}
.cal-upcoming-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

.cal-item-overdue { border-left: 3px solid #ff453a; }
.cal-item-urgent { border-left: 3px solid #ff9f0a; }
.cal-item-upcoming { border-left: 3px solid #0071e3; }
.cal-item-done { border-left: 3px solid #30d158; }
.cal-item-future { border-left: 3px solid var(--border-light); }

.cal-upcoming-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cal-upcoming-code {
    font-size: .8rem;
    font-weight: 700;
    white-space: nowrap;
}
.cal-upcoming-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-upcoming-name {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cal-upcoming-meta {
    font-size: .7rem;
    color: var(--text-tertiary);
}

.cal-upcoming-right { flex-shrink: 0; }

.cal-urgency-badge {
    font-size: .65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}
.cal-urgency-badge.cal-item-overdue { background: rgba(255,69,58,0.1); color: #ff453a; }
.cal-urgency-badge.cal-item-urgent { background: rgba(255,159,10,0.1); color: #c77800; }
.cal-urgency-badge.cal-item-upcoming { background: rgba(0,113,227,0.1); color: #0071e3; }
.cal-urgency-badge.cal-item-done { background: rgba(48,209,88,0.1); color: #30d158; }
.cal-urgency-badge.cal-item-future { background: var(--grey-100); color: var(--text-tertiary); }

.cal-empty-msg {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-tertiary);
    font-size: .85rem;
}
.cal-loading { display: flex; justify-content: center; padding: 40px; }

/* ── Dark theme overrides ── */
[data-theme="dark"] .gantt-timeline-header,
[data-theme="dark"] .g-labels { background: var(--grey-900, #1c1c1e); }
[data-theme="dark"] .g-row-label { background: var(--card-bg); }
[data-theme="dark"] .g-row:hover .g-row-label { background: var(--grey-800, #2c2c2e); background-image: none; }
[data-theme="dark"] .g-row-even .g-row-label { background: var(--grey-900, #1c1c1e); }
[data-theme="dark"] .g-row-even:hover .g-row-label { background: var(--grey-800, #2c2c2e); background-image: none; }
[data-theme="dark"] .g-mcell-cur,
[data-theme="dark"] .g-hcell-cur { background: rgba(0,113,227,0.12); }
[data-theme="dark"] .g-mcell { color: var(--text-tertiary); border-color: var(--grey-700, #3a3a3c); }
[data-theme="dark"] .g-hcell { border-color: var(--grey-700, #3a3a3c); }
[data-theme="dark"] .g-hcell-top { color: var(--text-secondary); }
[data-theme="dark"] .g-hcell-bot { color: var(--text-tertiary); }
[data-theme="dark"] .gantt-tooltip { background: var(--grey-900, #1c1c1e); border-color: var(--grey-700, #3a3a3c); box-shadow: 0 8px 30px rgba(0,0,0,0.3); }
[data-theme="dark"] .gantt-nodates-header:hover { background: var(--grey-800, #2c2c2e); }
[data-theme="dark"] .g-ctrl-resp { background: var(--grey-800, #2c2c2e); }
[data-theme="dark"] .gantt-search-input { background: var(--grey-800, #2c2c2e); border-color: var(--grey-700, #3a3a3c); color: var(--text-primary); }
[data-theme="dark"] .gantt-search-input:focus { border-color: var(--color-accent); }
[data-theme="dark"] .gantt-legend-bar { background: var(--grey-900, #1c1c1e); border-color: var(--grey-700, #3a3a3c); }
[data-theme="dark"] .gantt-skel-row { background: var(--grey-800, #2c2c2e); }
[data-theme="dark"] .gantt-empty-icon { background: var(--grey-800, #2c2c2e); }
[data-theme="dark"] .gantt-fullscreen { background: var(--grey-900, #1c1c1e); }
[data-theme="dark"] .gantt-fs-exit { background: var(--grey-800, #2c2c2e); color: var(--text-primary); border-color: var(--grey-700, #3a3a3c); }
[data-theme="dark"] .gantt-fs-exit:hover { background: var(--grey-700, #3a3a3c); }
[data-theme="dark"] .cal-day-headers { background: var(--grey-900, #1c1c1e); }
[data-theme="dark"] .cal-cell-empty { background: var(--grey-900, #1c1c1e); }
[data-theme="dark"] .cal-cell-today { background: rgba(0, 113, 227, 0.08); }
[data-theme="dark"] .cal-review-dot { background: rgba(255,255,255,0.06); }
[data-theme="dark"] .cal-review-overdue { background: rgba(255,69,58,0.12); }
[data-theme="dark"] .cal-review-done { background: rgba(48,209,88,0.12); }
[data-theme="dark"] .cal-review-upcoming { background: rgba(255,159,10,0.12); color: #ff9f0a; }
[data-theme="dark"] .gantt-wrapper::-webkit-scrollbar-corner { background: var(--grey-900, #1c1c1e); }
[data-theme="dark"] .g-cat-bar { background: var(--grey-800, #2c2c2e); }
[data-theme="dark"] .g-tt-hint { background: var(--grey-700, #3a3a3c); }
[data-theme="dark"] .g-tt-info { background: var(--grey-700, #3a3a3c); }
[data-theme="dark"] .g-tt-prog { background: var(--grey-700, #3a3a3c); }

/* ── Responsive ── */
@media (max-width: 768px) {
    .g-row-label { width: 160px; min-width: 160px; }
    .g-labels { width: 160px !important; min-width: 160px !important; }
    .g-ctrl-resp { display: none; }
    .cal-cell { min-height: 70px; }
    .cal-upcoming-item { flex-direction: column; align-items: flex-start; }
    .cal-upcoming-right { align-self: flex-end; }
    .gantt-toolbar-row { flex-direction: column; align-items: flex-start; }
}
.iso-action-item:nth-child(5) { animation-delay: 0.15s; }
.iso-action-item:nth-child(n+6) { animation-delay: 0.18s; }

/* ═══════════════════════════════════════════════════════════════════════════
   ISO 27001 — REDESIGNED LAYOUT (v2)
   Light, spacious, modern design with new functionality
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Init Section Wrapper ────────────────────────────────────────────── */
.iso-init-section {
    padding: 40px 24px 80px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ── Page Shell ──────────────────────────────────────────────────────── */
.iso-page-shell {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 32px 80px;
}

/* ── Breadcrumb ──────────────────────────────────────────────────────── */
.iso-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--grey-400);
    padding: 20px 0 0;
}

.iso-breadcrumb a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--grey-500);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.iso-breadcrumb a:hover {
    color: var(--color-accent);
}

.iso-breadcrumb > span {
    color: var(--text-primary);
    font-weight: 600;
}

/* ── Page Header ─────────────────────────────────────────────────────── */
.iso-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 0 28px;
}

.iso-page-title-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.iso-page-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(0, 113, 227, 0.1), rgba(48, 209, 88, 0.08));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-accent);
    flex-shrink: 0;
}

.iso-page-header h1 {
    font-size: 1.625rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    margin: 0;
    line-height: 1.2;
}

.iso-page-subtitle {
    font-size: 0.875rem;
    color: var(--grey-500);
    margin: 2px 0 0;
    font-weight: 400;
}

.iso-page-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ── Dashboard Grid ──────────────────────────────────────────────────── */
.iso-dash-grid {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    gap: 16px;
    margin-bottom: 20px;
}

.iso-dash-card {
    background: var(--bg-primary);
    border: 1px solid var(--grey-200);
    border-radius: 16px;
    padding: 24px;
    transition: box-shadow 0.3s var(--ease-smooth);
}

.iso-dash-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* Ring Card */
.iso-dash-ring-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.iso-dash-ring-card .iso-progress-ring-wrap {
    width: 120px;
    height: 120px;
}

.iso-dash-ring-card .iso-progress-ring-wrap svg {
    width: 120px;
    height: 120px;
}

.iso-dash-ring-card .iso-ring-value {
    font-size: 1.75rem;
}

.iso-dash-ring-card .iso-status-breakdown {
    width: 100%;
}

/* KPIs Card */
.iso-dash-kpis-card {
    display: flex;
    align-items: center;
    padding: 20px;
}

.iso-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    width: 100%;
}

.iso-kpi-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 16px 8px;
    border-radius: 12px;
    transition: transform 0.2s var(--ease-smooth), background 0.2s;
    cursor: default;
}

.iso-kpi-tile:hover {
    transform: translateY(-2px);
    background: var(--grey-50);
}

.iso-kpi-tile .iso-kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.iso-kpi-tile .iso-kpi-value {
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.iso-kpi-tile .iso-kpi-label {
    font-size: 0.6875rem;
    color: var(--grey-500);
    font-weight: 500;
    line-height: 1.3;
}

/* Category Card */
.iso-dash-cats-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.iso-dash-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--grey-500);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.iso-cat-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.iso-cat-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.iso-cat-row:hover {
    background: var(--grey-50);
}

.iso-cat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.iso-cat-dot-org { background: #0071e3; }
.iso-cat-dot-organizational { background: #0071e3; }
.iso-cat-dot-people { background: #30d158; }
.iso-cat-dot-physical { background: #ff9f0a; }
.iso-cat-dot-tech { background: #5e5ce6; }
.iso-cat-dot-technological { background: #5e5ce6; }
.iso-cat-dot-context { background: #0071e3; }
.iso-cat-dot-leadership { background: #30d158; }
.iso-cat-dot-planning { background: #ff9f0a; }
.iso-cat-dot-support { background: #5e5ce6; }
.iso-cat-dot-operation { background: #ff375f; }
.iso-cat-dot-performance { background: #bf5af2; }
.iso-cat-dot-improvement { background: #64d2ff; }

.iso-cat-name {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--grey-600);
    min-width: 70px;
    flex-shrink: 0;
}

.iso-cat-track {
    flex: 1;
    height: 6px;
    background: var(--grey-200);
    border-radius: 10px;
    overflow: hidden;
}

.iso-cat-pct {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 32px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ── Command Bar ─────────────────────────────────────────────────────── */
.iso-command-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 10px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--grey-200);
    border-radius: 14px;
    flex-wrap: wrap;
}

.iso-command-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-width: 200px;
    max-width: 280px;
    background: var(--grey-50);
    border-radius: 10px;
    padding: 0 12px;
    border: 1px solid transparent;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.iso-command-search:focus-within {
    border-color: var(--color-accent);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.iso-command-search svg {
    color: var(--grey-400);
    flex-shrink: 0;
}

.iso-command-search input {
    border: none;
    background: transparent;
    padding: 8px 4px;
    font-size: 0.8125rem;
    color: var(--text-primary);
    width: 100%;
    outline: none;
    font-family: inherit;
}

.iso-command-search input::placeholder {
    color: var(--grey-400);
}

.iso-command-chips {
    display: flex;
    gap: 6px;
    flex: 1;
    flex-wrap: wrap;
    min-width: 0;
}

.iso-command-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.iso-command-controls .form-select-sm {
    width: auto;
    min-width: 120px;
    padding-right: 28px;
}

/* ── Checkbox ────────────────────────────────────────────────────────── */
.col-check {
    width: 40px;
    text-align: center;
}

.iso-check-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.iso-check-wrap input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.iso-checkmark-sm {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1.5px solid var(--grey-300);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    background: var(--bg-primary);
}

.iso-check-wrap input:checked ~ .iso-checkmark-sm {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.iso-check-wrap input:checked ~ .iso-checkmark-sm::after {
    content: '';
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

/* ── Pagination ──────────────────────────────────────────────────────── */
.iso-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--bg-primary);
    border: 1px solid var(--grey-200);
    border-top: none;
    border-radius: 0 0 12px 12px;
    font-size: 0.8125rem;
}

.iso-pagination-info {
    color: var(--grey-500);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.iso-pagination-controls {
    display: flex;
    gap: 4px;
}

.iso-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--grey-200);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--grey-600);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-variant-numeric: tabular-nums;
}

.iso-page-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: rgba(0, 113, 227, 0.04);
}

.iso-page-btn.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}

.iso-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.iso-pagination-per-page {
    display: flex;
    align-items: center;
    gap: 6px;
}

.iso-pagination-per-page .form-select-sm {
    width: auto;
    min-width: 64px;
    padding: 6px 24px 6px 10px;
}

/* ── Bulk Actions Bar ────────────────────────────────────────────────── */
.iso-bulk-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--text-primary);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    z-index: 900;
    animation: iso-slideUp 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes iso-slideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.iso-bulk-count {
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
}

.iso-bulk-bar .form-select-sm {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    min-width: 130px;
}

.iso-bulk-bar .btn-sm {
    border-radius: 10px;
}

.iso-bulk-bar .btn-outline {
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
}

.iso-bulk-bar .btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ── Edit Modal Tabs ─────────────────────────────────────────────────── */
.iso-edit-tabs {
    display: flex;
    gap: 2px;
    background: var(--grey-100);
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 24px;
}

.iso-edit-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    justify-content: center;
    padding: 9px 14px;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--grey-500);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.iso-edit-tab:hover {
    color: var(--text-primary);
}

.iso-edit-tab.active {
    background: var(--bg-primary);
    color: var(--color-accent);
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.iso-edit-panel {
    display: none;
}

.iso-edit-panel.active {
    display: block;
    animation: iso-fadeInUp 0.25s ease;
}

/* ── Dropzone ────────────────────────────────────────────────────────── */
.iso-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 32px 24px;
    border: 2px dashed var(--grey-300);
    border-radius: 12px;
    background: var(--grey-50);
    color: var(--grey-500);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.iso-dropzone:hover,
.iso-dropzone.dragover {
    border-color: var(--color-accent);
    background: rgba(0, 113, 227, 0.04);
    color: var(--color-accent);
}

.iso-dropzone strong {
    color: var(--color-accent);
    font-weight: 600;
}

.iso-dropzone small {
    font-size: 0.75rem;
    color: var(--grey-400);
}

/* ── Keyboard Shortcuts Hint ─────────────────────────────────────────── */
.iso-shortcuts-hint {
    position: fixed;
    bottom: 20px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--grey-200);
    border-radius: 8px;
    font-size: 0.6875rem;
    color: var(--grey-500);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    z-index: 50;
}

.iso-shortcuts-hint:hover {
    opacity: 1;
}

.iso-shortcuts-hint kbd,
.iso-shortcut-row kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border: 1px solid var(--grey-300);
    border-radius: 4px;
    background: var(--grey-100);
    font-family: inherit;
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--grey-600);
}

/* ── Shortcuts Modal ─────────────────────────────────────────────────── */
.iso-shortcuts-modal {
    background: var(--bg-primary);
    border-radius: 16px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
    animation: iso-modal-slidein 0.3s var(--ease-smooth);
    overflow: hidden;
}

.iso-shortcuts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--grey-200);
}

.iso-shortcuts-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.iso-shortcuts-body {
    padding: 16px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.iso-shortcut-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8125rem;
    color: var(--grey-600);
}

.iso-shortcut-row span {
    flex: 1;
}

/* ── Responsive: New Layout ──────────────────────────────────────────── */
@media (max-width: 1280px) {
    .iso-dash-grid {
        grid-template-columns: 280px 1fr;
    }
    .iso-dash-cats-card {
        grid-column: 1 / -1;
    }
    .iso-kpi-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1024px) {
    .iso-dash-grid {
        grid-template-columns: 1fr 1fr;
    }
    .iso-dash-ring-card {
        grid-column: 1;
    }
    .iso-dash-kpis-card {
        grid-column: 2;
    }
    .iso-dash-cats-card {
        grid-column: 1 / -1;
    }
    .iso-kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .iso-command-chips {
        order: 3;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .iso-page-shell {
        padding: 0 16px 60px;
    }
    .iso-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .iso-page-actions {
        width: 100%;
    }
    .iso-page-actions .btn {
        flex: 1;
    }
    .iso-dash-grid {
        grid-template-columns: 1fr;
    }
    .iso-dash-ring-card,
    .iso-dash-kpis-card,
    .iso-dash-cats-card {
        grid-column: 1;
    }
    .iso-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .iso-command-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .iso-command-search {
        max-width: 100%;
        min-width: auto;
    }
    .iso-command-chips {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }
    .iso-command-chips .iso-chip {
        flex-shrink: 0;
    }
    .iso-command-controls {
        flex-wrap: wrap;
    }
    .iso-command-controls .form-select-sm {
        min-width: 100px;
        flex: 1;
    }
    .iso-pagination {
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
    }
    .iso-bulk-bar {
        width: calc(100% - 32px);
        flex-wrap: wrap;
        justify-content: center;
    }
    .iso-shortcuts-hint {
        display: none;
    }
    .iso-edit-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Dark Theme Support (v2 additions) ───────────────────────────────── */
[data-theme="dark"] .iso-page-icon {
    background: linear-gradient(135deg, rgba(0, 113, 227, 0.15), rgba(48, 209, 88, 0.1));
}

[data-theme="dark"] .iso-dash-card {
    background: var(--bg-primary);
    border-color: var(--grey-700);
}

[data-theme="dark"] .iso-dash-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .iso-kpi-tile:hover {
    background: var(--bg-secondary);
}

[data-theme="dark"] .iso-cat-row:hover {
    background: var(--bg-secondary);
}

[data-theme="dark"] .iso-cat-track {
    background: var(--grey-700);
}

[data-theme="dark"] .iso-command-bar {
    background: var(--bg-primary);
    border-color: var(--grey-700);
}

[data-theme="dark"] .iso-command-search {
    background: var(--bg-secondary);
}

[data-theme="dark"] .iso-command-search:focus-within {
    background: var(--bg-primary);
}

[data-theme="dark"] .iso-command-search input {
    color: var(--text-primary);
}

[data-theme="dark"] .iso-checkmark-sm {
    background: var(--bg-secondary);
    border-color: var(--grey-600);
}

[data-theme="dark"] .iso-pagination {
    background: var(--bg-primary);
    border-color: var(--grey-700);
}

[data-theme="dark"] .iso-page-btn {
    background: var(--bg-secondary);
    border-color: var(--grey-700);
    color: var(--grey-400);
}

[data-theme="dark"] .iso-page-btn:hover {
    background: rgba(0, 113, 227, 0.1);
}

[data-theme="dark"] .iso-page-btn.active {
    background: var(--color-accent);
}

[data-theme="dark"] .iso-bulk-bar {
    background: var(--grey-800);
}

[data-theme="dark"] .iso-edit-tabs {
    background: var(--grey-800);
}

[data-theme="dark"] .iso-edit-tab.active {
    background: var(--bg-primary);
}

[data-theme="dark"] .iso-dropzone {
    background: var(--bg-secondary);
    border-color: var(--grey-600);
}

[data-theme="dark"] .iso-dropzone:hover {
    background: rgba(0, 113, 227, 0.06);
    border-color: var(--color-accent);
}

[data-theme="dark"] .iso-shortcuts-hint {
    background: var(--bg-primary);
    border-color: var(--grey-700);
}

[data-theme="dark"] .iso-shortcuts-modal {
    background: var(--bg-primary);
}

[data-theme="dark"] .iso-shortcuts-header {
    border-color: var(--grey-700);
}

[data-theme="dark"] .iso-shortcut-row kbd,
[data-theme="dark"] .iso-shortcuts-hint kbd {
    background: var(--grey-700);
    border-color: var(--grey-600);
    color: var(--grey-300);
}

/* ── Print Styles ────────────────────────────────────────────────────── */
@media print {
    .nav, .sidebar, .footer, .iso-page-actions, .iso-command-bar,
    .iso-shortcuts-hint, .iso-bulk-bar, .iso-pagination, .iso-view-toggle,
    .col-actions, .col-check, .modal-overlay {
        display: none !important;
    }

    .iso-page-shell {
        padding: 0;
        max-width: 100%;
    }

    .iso-dash-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 12px;
        page-break-inside: avoid;
    }

    .iso-dash-card {
        border: 1px solid #ddd;
        box-shadow: none;
        padding: 16px;
    }

    .iso-audit-table-wrap {
        border: 1px solid #ddd;
        box-shadow: none;
    }

    .iso-audit-table tbody tr {
        animation: none !important;
        page-break-inside: avoid;
    }

    .iso-audit-table thead th {
        background: #f5f5f5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .status-pill, .cat-badge, .relevance-badge {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .iso-page-header h1::after {
        content: ' — Compliance Report';
        font-weight: 400;
        font-size: 0.75em;
        color: #888;
    }
}

/* ==========================================================================
   Risk Matrix
   ========================================================================== */

/* ── Hint ── */
.risk-hint {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .7rem;
    color: var(--text-tertiary);
}

/* ── Legend ── */
.risk-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    font-size: .72rem;
    color: var(--text-secondary);
}
.risk-legend-label { font-weight: 600; color: var(--text-tertiary); }
.risk-legend-item { display: flex; align-items: center; gap: 6px; }
.risk-legend-swatch { width: 14px; height: 14px; border-radius: 3px; }

/* ── Risk level colors ── */
.risk-level-critical { background: #ff453a; }
.risk-level-high { background: #ff9f0a; }
.risk-level-medium { background: #ffd60a; }
.risk-level-low { background: #30d158; }
.risk-level-negligible { background: #86868b; }

.risk-level-text-critical { color: #ff453a; }
.risk-level-text-high { color: #ff9f0a; }
.risk-level-text-medium { color: #c59a00; }
.risk-level-text-low { color: #30d158; }
.risk-level-text-negligible { color: #86868b; }

/* ── Matrix wrapper ── */
.risk-matrix-wrapper {
    background: var(--card-bg);
    border: 0.5px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    min-height: 200px;
}

.risk-loading, .risk-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--text-tertiary);
    gap: 16px;
}
.risk-loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--grey-200, #e0e0e0);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: gantt-spin 0.7s linear infinite;
}
.risk-loading p, .risk-empty p {
    font-size: .82rem;
    font-weight: 500;
    margin: 0;
}
.risk-empty svg { opacity: 0.3; stroke: var(--text-tertiary); }
.risk-empty p { max-width: 360px; text-align: center; line-height: 1.5; }

/* ── Matrix layout ── */
.risk-matrix-container {
    display: flex;
    align-items: center;
    gap: 12px;
}
.risk-axis-y-label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: .72rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}
.risk-matrix-inner {
    flex: 1;
    min-width: 0;
}
.risk-axis-x-label {
    text-align: center;
    font-size: .72rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 10px;
}

/* ── 5×5 Grid ── */
.risk-matrix-grid {
    display: grid;
    grid-template-columns: 80px repeat(5, 1fr);
    grid-template-rows: auto;
    gap: 3px;
    max-width: 700px;
    margin: 0 auto;
}
.risk-grid-corner {
    /* empty top-left corner */
}
.risk-grid-col-header {
    text-align: center;
    font-size: .68rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    padding: 6px 4px;
    letter-spacing: 0.3px;
}
.risk-grid-row-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-size: .68rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    padding-right: 10px;
    letter-spacing: 0.3px;
}

/* ── Grid cells ── */
.risk-cell {
    aspect-ratio: 1;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    opacity: 0.35;
    transition: opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    min-height: 70px;
}
.risk-cell-active {
    opacity: 1;
    cursor: pointer;
}
.risk-cell-active:hover {
    transform: scale(1.06);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    z-index: 1;
    position: relative;
}
.risk-cell-count {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    line-height: 1;
}
.risk-cell-label {
    font-size: .55rem;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Detail panel ── */
.risk-detail-panel {
    margin-top: 16px;
    background: var(--card-bg);
    border: 0.5px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    animation: risk-slide-in 0.2s ease;
}
@keyframes risk-slide-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.risk-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 0.5px solid var(--border-light);
    background: var(--grey-50);
}
.risk-detail-header h3 {
    font-size: .82rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}
.risk-detail-body {
    padding: 8px 16px 12px;
    max-height: 300px;
    overflow-y: auto;
}
.risk-detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 0.5px solid var(--border-lighter, var(--border-light));
    font-size: .72rem;
}
.risk-detail-item:last-child { border-bottom: none; }
.risk-detail-id {
    font-weight: 700;
    color: var(--color-accent);
    white-space: nowrap;
}
.risk-detail-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
}
.risk-detail-cat {
    font-size: .6rem;
    font-weight: 600;
    white-space: nowrap;
    padding: 2px 6px;
    border-radius: 4px;
}
.risk-cat-organizational { color: #0071e3; background: rgba(0,113,227,0.08); }
.risk-cat-people { color: #bf5af2; background: rgba(191,90,242,0.08); }
.risk-cat-physical { color: #ff9f0a; background: rgba(255,159,10,0.08); }
.risk-cat-technological { color: #30d158; background: rgba(48,209,88,0.08); }
.risk-cat-context { color: #0071e3; background: rgba(0,113,227,0.08); }
.risk-cat-leadership { color: #30d158; background: rgba(48,209,88,0.08); }
.risk-cat-planning { color: #ff9f0a; background: rgba(255,159,10,0.08); }
.risk-cat-support { color: #5e5ce6; background: rgba(94,92,230,0.08); }
.risk-cat-operation { color: #ff375f; background: rgba(255,55,95,0.08); }
.risk-cat-performance { color: #bf5af2; background: rgba(191,90,242,0.08); }
.risk-cat-improvement { color: #64d2ff; background: rgba(100,210,255,0.08); }
/* Risk matrix category dots (shared by gantt) */
.gantt-cat-dot-organizational { color: #0071e3; }
.gantt-cat-dot-people { color: #bf5af2; }
.gantt-cat-dot-physical { color: #ff9f0a; }
.gantt-cat-dot-technological { color: #30d158; }
.gantt-cat-dot-context { color: #0071e3; }
.gantt-cat-dot-leadership { color: #30d158; }
.gantt-cat-dot-planning { color: #ff9f0a; }
.gantt-cat-dot-support { color: #5e5ce6; }
.gantt-cat-dot-operation { color: #ff375f; }
.gantt-cat-dot-performance { color: #bf5af2; }
.gantt-cat-dot-improvement { color: #64d2ff; }
.risk-detail-status {
    font-size: .6rem;
    font-weight: 600;
    color: var(--text-tertiary);
    white-space: nowrap;
}

/* ── Top risks section ── */
.risk-top-section, .risk-category-section {
    margin-top: 24px;
}
.risk-section-title {
    font-size: .85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}
.risk-top-list {
    background: var(--card-bg);
    border: 0.5px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.risk-top-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-bottom: 0.5px solid var(--border-lighter, var(--border-light));
    font-size: .72rem;
    transition: background 0.12s ease;
}
.risk-top-item:last-child { border-bottom: none; }
.risk-top-item:hover { background: var(--grey-50); }
.risk-top-rank {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .6rem;
    font-weight: 800;
    color: var(--text-tertiary);
    background: var(--grey-100);
    border-radius: 50%;
    flex-shrink: 0;
}
.risk-top-badge {
    min-width: 28px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: .65rem;
    font-weight: 800;
    color: #fff;
    text-align: center;
    flex-shrink: 0;
}
.risk-top-id {
    font-weight: 700;
    color: var(--color-accent);
    white-space: nowrap;
}
.risk-top-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
}
.risk-top-progress {
    font-weight: 600;
    color: var(--text-tertiary);
    white-space: nowrap;
}

/* ── Category breakdown cards ── */
.risk-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}
.risk-cat-card {
    background: var(--card-bg);
    border: 0.5px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.risk-cat-card:hover {
    border-color: var(--color-accent);
    box-shadow: 0 2px 12px rgba(0,113,227,0.08);
}
.risk-cat-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 0.5px solid var(--border-light);
    background: var(--grey-50);
}
.risk-cat-card-title {
    font-size: .78rem;
    font-weight: 700;
    color: var(--text-primary);
}
.risk-cat-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px 14px;
}
.risk-cat-metric {
    text-align: center;
}
.risk-cat-metric-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
}
.risk-cat-metric-label {
    font-size: .6rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* ── Risk matrix responsive ── */
@media (max-width: 768px) {
    .risk-matrix-grid {
        grid-template-columns: 50px repeat(5, 1fr);
        gap: 2px;
    }
    .risk-cell { min-height: 50px; }
    .risk-cell-count { font-size: 1.1rem; }
    .risk-matrix-wrapper { padding: 12px; }
    .risk-cat-grid { grid-template-columns: 1fr; }
    .risk-axis-y-label { display: none; }
}

/* ═══════════════════════════════════════════════════
   DOCUMENT MANAGEMENT
   ═══════════════════════════════════════════════════ */

/* ── Document list wrapper ── */
/* ═══════════════════════════════════════════════════
   DOCUMENT MANAGEMENT V2
   ═══════════════════════════════════════════════════ */

/* ── Toast notifications ── */
.doc-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.doc-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.3s, transform 0.3s;
}
.doc-toast-show {
    opacity: 1;
    transform: translateX(0);
}
.doc-toast-hide {
    opacity: 0;
    transform: translateX(30px);
}
.doc-toast-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.doc-toast-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.doc-toast-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* ── Stats grid ── */
.doc-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}
.doc-stat-card {
    background: var(--card-bg, #fff);
    border: 0.5px solid var(--border-light, rgba(226, 232, 240, 0.6));
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.doc-stat-card:hover {
    border-color: var(--primary, #6366f1);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.08);
    transform: translateY(-1px);
}
.doc-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.doc-stat-icon-total    { background: rgba(99, 102, 241, 0.1);  color: #6366f1; }
.doc-stat-icon-approved { background: rgba(34, 197, 94, 0.1);   color: #22c55e; }
.doc-stat-icon-expiring { background: rgba(245, 158, 11, 0.1);  color: #f59e0b; }
.doc-stat-icon-draft    { background: rgba(148, 163, 184, 0.1); color: #94a3b8; }
.doc-stat-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.doc-stat-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary, #1e293b);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.doc-stat-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ── Toolbar ── */
.doc-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 14px 18px;
    background: var(--card-bg, #fff);
    border: 0.5px solid var(--border-light, rgba(226, 232, 240, 0.6));
    border-radius: 12px;
}
.doc-toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
}
.doc-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.doc-search-wrap {
    position: relative;
}
.doc-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted, #94a3b8);
    pointer-events: none;
}
.doc-search-input {
    padding-left: 34px !important;
    min-width: 200px;
}
.doc-result-count {
    font-size: 0.78rem;
    color: var(--text-muted, #94a3b8);
    font-weight: 500;
    white-space: nowrap;
}

/* ── Grid wrapper ── */
.doc-grid-wrapper {
    min-height: 200px;
}
.doc-loading, .doc-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    gap: 12px;
    color: var(--text-muted, #94a3b8);
    background: var(--card-bg, #fff);
    border: 0.5px solid var(--border-light, rgba(226, 232, 240, 0.6));
    border-radius: 12px;
}
.doc-loading .spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--border, #e2e8f0);
    border-top-color: var(--primary, #6366f1);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.doc-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: rgba(99, 102, 241, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #94a3b8);
}
.doc-empty-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    margin: 8px 0 0 0;
}
.doc-empty-sub {
    font-size: 0.83rem;
    color: var(--text-muted, #94a3b8);
    margin: 0 0 8px 0;
    max-width: 400px;
    text-align: center;
}

/* ── Document grid ── */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 14px;
}

/* ── Document card V2 ── */
.doc-card {
    display: flex;
    flex-direction: column;
    background: var(--card-bg, #fff);
    border: 0.5px solid var(--border-light, rgba(226, 232, 240, 0.6));
    border-radius: 12px;
    padding: 18px;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.doc-card:hover {
    border-color: var(--primary, #6366f1);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.08);
    transform: translateY(-1px);
}

/* Card header */
.doc-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}
.doc-card-icon {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    gap: 1px;
}
.doc-card-ext {
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.8;
}
.doc-card-icon.doc-type-policy    { background: rgba(99, 102, 241, 0.1);  color: #6366f1; }
.doc-card-icon.doc-type-procedure { background: rgba(14, 165, 233, 0.1);  color: #0ea5e9; }
.doc-card-icon.doc-type-record    { background: rgba(34, 197, 94, 0.1);   color: #22c55e; }
.doc-card-icon.doc-type-template  { background: rgba(245, 158, 11, 0.1);  color: #f59e0b; }
.doc-card-icon.doc-type-report    { background: rgba(168, 85, 247, 0.1);  color: #a855f7; }
.doc-card-icon.doc-type-other     { background: rgba(148, 163, 184, 0.1); color: #94a3b8; }

.doc-card-info {
    flex: 1;
    min-width: 0;
}
.doc-card-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    margin: 0 0 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.doc-card-filename {
    font-size: 0.73rem;
    color: var(--text-muted, #94a3b8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.doc-card-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* ── Status badge ── */
.doc-status-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.doc-status-draft      { background: rgba(148, 163, 184, 0.15); color: #64748b; }
.doc-status-in_review  { background: rgba(245, 158, 11, 0.15);  color: #d97706; }
.doc-status-approved   { background: rgba(34, 197, 94, 0.15);   color: #16a34a; }
.doc-status-expired    { background: rgba(239, 68, 68, 0.15);   color: #dc2626; }
.doc-status-archived   { background: rgba(107, 114, 128, 0.15); color: #6b7280; }

.doc-expiring-badge {
    font-size: 0.8rem;
    line-height: 1;
}

/* ── Card description ── */
.doc-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted, #94a3b8);
    margin: 0 0 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

/* ── Card meta row ── */
.doc-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 0;
    border-top: 1px solid var(--border-light, rgba(226, 232, 240, 0.5));
    border-bottom: 1px solid var(--border-light, rgba(226, 232, 240, 0.5));
    margin-bottom: 10px;
}
.doc-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-muted, #94a3b8);
}
.doc-meta-item svg {
    opacity: 0.6;
}
.doc-meta-version {
    font-weight: 600;
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary, #6366f1);
}
.doc-meta-cat {
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted, #94a3b8);
    font-weight: 500;
}

/* ── Linked controls tags ── */
.doc-card-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
}
.doc-ctrl-tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary, #6366f1);
}

/* ── Card actions bar ── */
.doc-card-actions {
    display: flex;
    gap: 6px;
    margin-top: auto;
}
.doc-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted, #64748b);
    font-size: 0.73rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.doc-action-btn:hover {
    border-color: var(--primary, #6366f1);
    color: var(--primary, #6366f1);
    background: rgba(99, 102, 241, 0.04);
}
.doc-action-btn.doc-action-del:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.04);
}

/* ── Dropzone ── */
.doc-dropzone {
    border: 2px dashed var(--border, #e2e8f0);
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
}
.doc-dropzone:hover,
.doc-dropzone-active {
    border-color: var(--primary, #6366f1);
    background: rgba(99, 102, 241, 0.03);
}
.doc-dropzone input[type="file"] {
    display: none;
}
.doc-dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.doc-dropzone-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}
.doc-dropzone-text {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary, #1e293b);
    margin: 0;
}
.doc-dropzone-hint {
    font-size: 0.75rem;
    color: var(--text-muted, #94a3b8);
    margin: 0;
}
.doc-dropzone-selected {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    color: var(--primary, #6366f1);
    font-size: 0.85rem;
    font-weight: 500;
}
.doc-dropzone-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted, #94a3b8);
    padding: 2px;
    border-radius: 4px;
    display: flex;
    transition: color 0.15s;
}
.doc-dropzone-remove:hover {
    color: #ef4444;
}

/* ── Upload progress ── */
.doc-upload-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}
.doc-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--border, #e2e8f0);
    border-radius: 3px;
    overflow: hidden;
}
.doc-progress-fill {
    height: 100%;
    background: var(--primary, #6366f1);
    border-radius: 3px;
    width: 0%;
    transition: width 0.2s;
}
.doc-progress-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary, #6366f1);
    min-width: 32px;
    text-align: right;
}

/* ── Modal V2 ── */
.doc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
    animation: docFadeIn 0.15s ease;
}
@keyframes docFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.doc-modal {
    background: var(--card-bg, #fff);
    border: 0.5px solid var(--border, #e2e8f0);
    border-radius: 14px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: docSlideUp 0.2s ease;
}
.doc-modal-sm {
    max-width: 420px;
}
@keyframes docSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.doc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}
.doc-modal-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary, #1e293b);
}
.doc-modal-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted, #94a3b8);
    padding: 4px;
    border-radius: 6px;
    display: flex;
    transition: color 0.15s, background 0.15s;
}
.doc-modal-close-btn:hover {
    color: var(--text-primary, #1e293b);
    background: rgba(0, 0, 0, 0.04);
}
.doc-modal-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.doc-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 0 24px 20px;
}

/* ── Delete warning ── */
.doc-delete-warning {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    padding: 12px;
}
.doc-delete-warning svg {
    color: #ef4444;
}
.doc-delete-warning p {
    font-size: 0.9rem;
    color: var(--text-primary, #1e293b);
    margin: 0;
}
.doc-delete-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    padding: 6px 12px;
    background: rgba(239, 68, 68, 0.06);
    border-radius: 6px;
    word-break: break-word;
}

/* ── Form groups ── */
.doc-form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.doc-form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
}
.doc-form-group textarea.input {
    resize: vertical;
    min-height: 52px;
}
.doc-form-row {
    display: flex;
    gap: 12px;
}

/* ── Dark mode ── */
[data-theme="dark"] .doc-stat-card,
[data-theme="dark"] .doc-toolbar {
    background: var(--card-bg, #1e293b);
    border-color: var(--border, #334155);
}
[data-theme="dark"] .doc-stat-value {
    color: var(--text, #f1f5f9);
}
[data-theme="dark"] .doc-card {
    background: var(--card-bg, #1e293b);
    border-color: var(--border, #334155);
}
[data-theme="dark"] .doc-card:hover {
    border-color: var(--primary, #818cf8);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.12);
}
[data-theme="dark"] .doc-card-title {
    color: var(--text, #f1f5f9);
}
[data-theme="dark"] .doc-card-meta {
    border-color: var(--border, #334155);
}
[data-theme="dark"] .doc-action-btn {
    border-color: var(--border, #334155);
    color: var(--text-muted, #94a3b8);
}
[data-theme="dark"] .doc-action-btn:hover {
    border-color: var(--primary, #818cf8);
    color: var(--primary, #818cf8);
    background: rgba(99, 102, 241, 0.08);
}
[data-theme="dark"] .doc-action-btn.doc-action-del:hover {
    border-color: #f87171;
    color: #f87171;
    background: rgba(239, 68, 68, 0.08);
}
[data-theme="dark"] .doc-loading,
[data-theme="dark"] .doc-empty {
    background: var(--card-bg, #1e293b);
    border-color: var(--border, #334155);
}
[data-theme="dark"] .doc-empty-title {
    color: var(--text, #f1f5f9);
}
[data-theme="dark"] .doc-modal {
    background: var(--card-bg, #1e293b);
    border-color: var(--border, #334155);
}
[data-theme="dark"] .doc-modal-header h3 {
    color: var(--text, #f1f5f9);
}
[data-theme="dark"] .doc-modal-close-btn:hover {
    color: var(--text, #f1f5f9);
    background: rgba(255, 255, 255, 0.06);
}
[data-theme="dark"] .doc-dropzone {
    border-color: var(--border, #334155);
}
[data-theme="dark"] .doc-dropzone:hover,
[data-theme="dark"] .doc-dropzone-active {
    border-color: var(--primary, #818cf8);
    background: rgba(99, 102, 241, 0.06);
}
[data-theme="dark"] .doc-dropzone-text {
    color: var(--text, #f1f5f9);
}
[data-theme="dark"] .doc-delete-warning p {
    color: var(--text, #f1f5f9);
}
[data-theme="dark"] .doc-delete-name {
    color: var(--text-muted, #94a3b8);
    background: rgba(239, 68, 68, 0.1);
}
[data-theme="dark"] .doc-toast-success {
    background: #064e3b;
    color: #a7f3d0;
    border-color: #065f46;
}
[data-theme="dark"] .doc-toast-error {
    background: #7f1d1d;
    color: #fecaca;
    border-color: #991b1b;
}
[data-theme="dark"] .doc-toast-info {
    background: #1e3a5f;
    color: #bfdbfe;
    border-color: #1e40af;
}

/* ── Document responsive ── */
@media (max-width: 1024px) {
    .doc-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .doc-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}
@media (max-width: 768px) {
    .doc-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .doc-toolbar { flex-direction: column; align-items: stretch; }
    .doc-toolbar-left { flex-direction: column; }
    .doc-toolbar-right { justify-content: space-between; }
    .doc-search-input { min-width: auto !important; width: 100%; }
    .doc-grid { grid-template-columns: 1fr; }
    .doc-card-actions { flex-wrap: wrap; }
    .doc-action-btn span { display: none; }
    .doc-form-row { flex-direction: column; gap: 14px; }
    .doc-modal { max-width: 100%; margin: 12px; }
    .doc-toast-container { left: 12px; right: 12px; }
}

/* ═══════════════════════════════════════════════════
   ACTIVITY LOG
   ═══════════════════════════════════════════════════ */

/* ── Stats grid ── */
.act-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
.act-stat-card {
    background: var(--card-bg, #fff);
    border: 0.5px solid var(--border-light, rgba(226, 232, 240, 0.6));
    border-radius: var(--radius-md, 16px);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.act-stat-card:hover {
    border-color: var(--color-accent, #0071e3);
    box-shadow: 0 4px 20px rgba(0,113,227,0.08);
    transform: translateY(-2px);
}
.act-stat-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.act-stat-icon-total    { background: rgba(99, 102, 241, 0.1);  color: #6366f1; }
.act-stat-icon-today    { background: rgba(34, 197, 94, 0.1);   color: #22c55e; }
.act-stat-icon-week     { background: rgba(14, 165, 233, 0.1);  color: #0ea5e9; }
.act-stat-icon-month    { background: rgba(245, 158, 11, 0.1);  color: #f59e0b; }
.act-stat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.act-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    line-height: 1;
}
.act-stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ── Quick chips ── */
.act-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.act-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    font-size: 0.78rem;
    font-weight: 500;
    border: 1px solid var(--border-light, rgba(226, 232, 240, 0.6));
    border-radius: 999px;
    background: var(--card-bg, #fff);
    color: var(--text-secondary, #64748b);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.act-chip:hover {
    border-color: var(--color-accent, #0071e3);
    color: var(--color-accent, #0071e3);
    background: rgba(0, 113, 227, 0.04);
}
.act-chip.active {
    background: var(--color-accent, #0071e3);
    color: #fff;
    border-color: var(--color-accent, #0071e3);
}
.act-chip.active svg { stroke: #fff; }
.act-chip-control.active  { background: #0ea5e9; border-color: #0ea5e9; }
.act-chip-evidence.active { background: #6366f1; border-color: #6366f1; }
.act-chip-document.active { background: #8b5cf6; border-color: #8b5cf6; }
.act-chip-action.active   { background: #f59e0b; border-color: #f59e0b; }
.act-chip-init.active     { background: #22c55e; border-color: #22c55e; }

/* ── Filters bar ── */
.act-filters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--card-bg, #fff);
    border: 0.5px solid var(--border-light, rgba(226, 232, 240, 0.6));
    border-radius: var(--radius-md, 16px);
}
.act-filters-left, .act-filters-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.act-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.act-search-icon {
    position: absolute;
    left: 10px;
    color: var(--text-muted, #94a3b8);
    pointer-events: none;
}
.act-search-input {
    padding-left: 32px !important;
    min-width: 200px;
}

/* ── Wrapper ── */
.act-wrapper {
    background: var(--card-bg, #fff);
    border: 0.5px solid var(--border-light, rgba(226, 232, 240, 0.6));
    border-radius: var(--radius-md, 16px);
    padding: 24px;
    min-height: 200px;
}

/* ── Loading skeleton ── */
.act-loading {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px 0;
}
.act-loading p {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted, #94a3b8);
    margin: 8px 0 0;
}
.act-loading-pulse {
    height: 64px;
    border-radius: 12px;
    background: linear-gradient(90deg,
        var(--border-light, rgba(226,232,240,0.4)) 25%,
        rgba(226,232,240,0.1) 50%,
        var(--border-light, rgba(226,232,240,0.4)) 75%);
    background-size: 200% 100%;
    animation: actPulse 1.5s ease-in-out infinite;
}
.act-loading-pulse-2 { animation-delay: 0.15s; opacity: 0.7; }
.act-loading-pulse-3 { animation-delay: 0.3s;  opacity: 0.4; }
@keyframes actPulse {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Empty state ── */
.act-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    gap: 8px;
    text-align: center;
}
.act-empty-icon {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: var(--surface-alt, rgba(148, 163, 184, 0.06));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    color: var(--text-muted, #94a3b8);
    opacity: 0.5;
}
.act-empty h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    margin: 0;
}
.act-empty p {
    font-size: 0.85rem;
    color: var(--text-muted, #94a3b8);
    margin: 0;
    max-width: 320px;
}

/* ── Date label in filters ── */
.act-date-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted, #94a3b8);
    white-space: nowrap;
}

/* ── Timeline spine ── */
.act-timeline {
    position: relative;
    padding-left: 24px;
}
.act-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(
        to bottom,
        var(--border-light, rgba(226, 232, 240, 0.6)),
        var(--color-accent, #0071e3) 10%,
        var(--color-accent, #0071e3) 90%,
        var(--border-light, rgba(226, 232, 240, 0.6))
    );
    border-radius: 2px;
    opacity: 0.3;
}

/* ── Day groups ── */
.act-day-group {
    margin-bottom: 4px;
    position: relative;
}
.act-day-group:last-child {
    margin-bottom: 0;
}
.act-day-header {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #94a3b8);
    padding: 12px 0 8px;
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--card-bg, #fff);
    display: flex;
    align-items: center;
    gap: 8px;
}
.act-day-header::before {
    content: '';
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--color-accent, #0071e3);
    border: 2px solid var(--card-bg, #fff);
    position: absolute;
    left: -20px;
    box-shadow: 0 0 0 2px rgba(0,113,227,0.15);
}
.act-day-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light, rgba(226, 232, 240, 0.5));
}

/* ── Entry ── */
.act-entry {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 4px;
    position: relative;
    transition: background 0.15s, box-shadow 0.15s;
    animation: actEntryIn 0.35s ease both;
}
.act-entry::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--border, #e2e8f0);
    position: absolute;
    left: -22px;
    top: 22px;
    transition: background 0.2s;
}
.act-entry:hover::before {
    background: var(--color-accent, #0071e3);
}
.act-entry:hover {
    background: var(--surface-hover, rgba(99, 102, 241, 0.03));
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.03);
}
@keyframes actEntryIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Entry icon ── */
.act-entry-icon {
    flex-shrink: 0;
    width: 36px; height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--primary-alpha, rgba(99, 102, 241, 0.08));
    color: var(--primary, #6366f1);
    transition: transform 0.2s;
}
.act-entry:hover .act-entry-icon {
    transform: scale(1.08);
}
.act-action-updated .act-entry-icon  { background: rgba(14, 165, 233, 0.1);  color: #0ea5e9; }
.act-action-created .act-entry-icon  { background: rgba(34, 197, 94, 0.1);   color: #22c55e; }
.act-action-uploaded .act-entry-icon { background: rgba(99, 102, 241, 0.1);  color: #6366f1; }
.act-action-deleted .act-entry-icon  { background: rgba(239, 68, 68, 0.1);   color: #ef4444; }
.act-action-toggled .act-entry-icon  { background: rgba(245, 158, 11, 0.1);  color: #f59e0b; }
.act-action-completed .act-entry-icon { background: rgba(34, 197, 94, 0.1);  color: #22c55e; }

/* ── Entry body ── */
.act-entry-body {
    flex: 1;
    min-width: 0;
}
.act-entry-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

/* ── Action badge ── */
.act-action-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.act-badge-updated   { background: rgba(14, 165, 233, 0.12); color: #0284c7; }
.act-badge-created   { background: rgba(34, 197, 94, 0.12);  color: #16a34a; }
.act-badge-uploaded  { background: rgba(99, 102, 241, 0.12); color: #6366f1; }
.act-badge-deleted   { background: rgba(239, 68, 68, 0.12);  color: #dc2626; }
.act-badge-toggled   { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.act-badge-completed { background: rgba(34, 197, 94, 0.12);  color: #16a34a; }

/* ── Entity tag ── */
.act-entity-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted, #64748b);
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--surface-alt, rgba(148, 163, 184, 0.08));
}

/* ── Entity label ── */
.act-entity-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text, #1e293b);
}

/* ── Details ── */
.act-entry-details {
    font-size: 0.8rem;
    color: var(--text-muted, #94a3b8);
    margin: 2px 0 6px;
    line-height: 1.5;
}

/* ── Structured changes diff table ── */
.act-changes-table {
    margin: 6px 0 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.act-change-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.025);
}
[data-theme="dark"] .act-change-row {
    background: rgba(255, 255, 255, 0.04);
}
.act-change-field {
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    min-width: 100px;
    flex-shrink: 0;
    font-size: 0.75rem;
    text-transform: capitalize;
}
.act-change-old {
    color: #e53e3e;
    background: rgba(229, 62, 62, 0.08);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', Menlo, monospace;
    font-size: 0.74rem;
    text-decoration: line-through;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.act-change-arrow {
    color: var(--text-muted, #94a3b8);
    font-size: 0.8rem;
    flex-shrink: 0;
}
.act-change-new {
    color: #38a169;
    background: rgba(56, 161, 105, 0.08);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', Menlo, monospace;
    font-size: 0.74rem;
    font-weight: 600;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.act-revert-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid rgba(0, 113, 227, 0.25);
    border-radius: 6px;
    background: transparent;
    color: #0071e3;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: auto;
    transition: all 0.2s;
    padding: 0;
}
.act-revert-btn:hover {
    background: rgba(0, 113, 227, 0.08);
    border-color: #0071e3;
}
.act-revert-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.act-revert-loading {
    animation: act-spin 0.6s linear infinite;
}
.act-revert-done {
    color: #38a169;
    border-color: rgba(56, 161, 105, 0.3);
}
.act-revert-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: #805ad5;
    background: rgba(128, 90, 213, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 2px;
}
@keyframes act-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

/* ── Revert confirmation modal ── */
.act-revert-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}
.act-revert-overlay.active {
    display: flex;
}
.act-revert-modal {
    background: var(--bg-primary, #fff);
    border-radius: var(--radius-lg, 16px);
    padding: 32px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18);
    animation: act-modal-in 0.2s ease-out;
}
@keyframes act-modal-in {
    from { opacity: 0; transform: scale(0.95) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.act-revert-modal-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: rgba(0, 113, 227, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0071e3;
}
.act-revert-modal h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--text-primary);
}
.act-revert-modal p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 16px;
    line-height: 1.5;
}
.act-revert-modal-diff {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    text-align: center;
}
.act-revert-diff-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 4px 0;
}
.act-revert-diff-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: capitalize;
    width: 100%;
}
.act-revert-diff-current {
    color: #e53e3e;
    background: rgba(229, 62, 62, 0.08);
    padding: 3px 10px;
    border-radius: 6px;
    font-family: 'SF Mono', Menlo, monospace;
    font-size: 0.82rem;
    text-decoration: line-through;
}
.act-revert-diff-arrow {
    color: var(--text-muted, #94a3b8);
    font-size: 1rem;
    flex-shrink: 0;
}
.act-revert-diff-target {
    color: #38a169;
    background: rgba(56, 161, 105, 0.08);
    padding: 3px 10px;
    border-radius: 6px;
    font-family: 'SF Mono', Menlo, monospace;
    font-size: 0.82rem;
    font-weight: 600;
}
.act-revert-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.act-revert-modal-actions .btn {
    min-width: 120px;
    padding: 10px 20px;
}
[data-theme="dark"] .act-revert-modal {
    background: var(--bg-primary, #1a1a2e);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .act-revert-modal-diff {
    background: rgba(255, 255, 255, 0.04);
}

/* ── Meta (user, time, IP) ── */
.act-entry-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.72rem;
    color: var(--text-muted, #94a3b8);
}
.act-meta-user {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
}
.act-meta-user svg {
    opacity: 0.5;
}
.act-meta-time {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.act-meta-relative {
    font-style: italic;
    opacity: 0.7;
}
.act-meta-ip {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.68rem;
    opacity: 0.5;
    padding: 1px 6px;
    background: var(--surface-alt, rgba(148, 163, 184, 0.06));
    border-radius: 4px;
}

/* ── Load more ── */
.act-load-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 0 4px;
}
.act-page-info {
    font-size: 0.72rem;
    color: var(--text-muted, #94a3b8);
}

/* ── Dark mode ── */
[data-theme="dark"] .act-wrapper {
    background: var(--card-bg, #1e293b);
    border-color: var(--border, #334155);
}
[data-theme="dark"] .act-stat-card {
    background: var(--card-bg, #1e293b);
    border-color: var(--border, #334155);
}
[data-theme="dark"] .act-filters {
    background: var(--card-bg, #1e293b);
    border-color: var(--border, #334155);
}
[data-theme="dark"] .act-chip {
    background: var(--card-bg, #1e293b);
    border-color: var(--border, #334155);
    color: var(--text-secondary, #94a3b8);
}
[data-theme="dark"] .act-entry:hover {
    background: rgba(99, 102, 241, 0.05);
}
[data-theme="dark"] .act-entity-label {
    color: var(--text, #f1f5f9);
}
[data-theme="dark"] .act-day-header {
    background: var(--card-bg, #1e293b);
}
[data-theme="dark"] .act-day-header::before {
    border-color: var(--card-bg, #1e293b);
}
[data-theme="dark"] .act-loading-pulse {
    background: linear-gradient(90deg,
        rgba(51,65,85,0.5) 25%,
        rgba(51,65,85,0.2) 50%,
        rgba(51,65,85,0.5) 75%);
    background-size: 200% 100%;
}
[data-theme="dark"] .act-empty-icon {
    background: rgba(148, 163, 184, 0.1);
}

/* ── Activity responsive ── */
@media (max-width: 1024px) {
    .act-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .act-stats-grid { grid-template-columns: 1fr; }
    .act-filters { flex-direction: column; align-items: stretch; }
    .act-filters-left, .act-filters-right { flex-direction: column; gap: 8px; }
    .act-search-input { min-width: unset !important; width: 100%; }
    .act-entry { gap: 10px; padding: 12px; }
    .act-entry-icon { width: 30px; height: 30px; border-radius: 8px; }
    .act-entry-header { gap: 4px; }
    .act-timeline { padding-left: 20px; }
    .act-timeline::before { left: 6px; }
    .act-day-header::before { left: -16px; width: 8px; height: 8px; }
    .act-entry::before { left: -18px; top: 20px; }
    .act-chips { gap: 6px; }
    .act-chip { padding: 5px 10px; font-size: 0.72rem; }
    .gantt-header-right { margin-top: 12px; }
}

/* ── Activity Log V2 additions ── */

/* Batch revert button */
.act-revert-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-top: 6px;
}
.act-revert-all-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.35);
}

/* Context tag (action item title, etc.) */
.act-context-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-secondary, #64748b);
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: 4px;
    margin-top: 4px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* File info block (evidence uploads) */
.act-file-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding: 6px 10px;
    background: rgba(99, 102, 241, 0.04);
    border: 1px solid rgba(99, 102, 241, 0.08);
    border-radius: 6px;
    font-size: 0.72rem;
}
.act-file-name {
    font-weight: 600;
    color: var(--text, #1e293b);
}
.act-file-size,
.act-file-mime {
    color: var(--text-muted, #94a3b8);
    font-size: 0.68rem;
}

/* Chip count badge */
.act-chip-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    background: var(--primary, #6366f1);
    border-radius: 9px;
    margin-left: 4px;
}
.act-chip.active .act-chip-count {
    background: #fff;
    color: var(--primary, #6366f1);
}

/* Control code badge */
.act-control-code {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    font-size: 0.68rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--primary, #6366f1);
    background: rgba(99, 102, 241, 0.08);
    border-radius: 4px;
    letter-spacing: 0.02em;
}

/* Entry ID */
.act-entry-id {
    font-size: 0.65rem;
    color: var(--text-muted, #94a3b8);
    font-family: 'JetBrains Mono', monospace;
    opacity: 0.7;
}

/* Entry dot (timeline) */
.act-entry-dot {
    position: absolute;
    left: -22px;
    top: 18px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary, #6366f1);
    border: 2px solid var(--card-bg, #fff);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
    z-index: 1;
}

/* Reverting animation */
.act-entry-reverting {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}
.act-entry-reverting::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        transparent 25%,
        rgba(99, 102, 241, 0.08) 50%,
        transparent 75%);
    background-size: 200% 100%;
    animation: actRevertPulse 1s ease-in-out infinite;
    border-radius: inherit;
}
@keyframes actRevertPulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Day count */
.act-day-count {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-muted, #94a3b8);
    margin-left: 6px;
}

/* Entity type tag colors */
.act-entity-tag-control    { color: #6366f1; background: rgba(99, 102, 241, 0.08); }
.act-entity-tag-evidence   { color: #10b981; background: rgba(16, 185, 129, 0.08); }
.act-entity-tag-document   { color: #f59e0b; background: rgba(245, 158, 11, 0.08); }
.act-entity-tag-action_item { color: #ec4899; background: rgba(236, 72, 153, 0.08); }
.act-entity-tag-init       { color: #8b5cf6; background: rgba(139, 92, 246, 0.08); }
.act-entity-tag-org_profile { color: #06b6d4; background: rgba(6, 182, 212, 0.08); }

/* Revert badge batch indicator */
.act-revert-badge-batch {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #ef4444;
    opacity: 0.8;
}

/* Auto-refresh button */
.act-auto-refresh-btn {
    transition: all 0.2s ease;
}
.act-auto-refresh-btn.active {
    color: #fff;
    background: var(--primary, #6366f1);
    border-color: var(--primary, #6366f1);
}
.act-auto-refresh-btn.active svg {
    animation: actAutoSpin 2s linear infinite;
}
@keyframes actAutoSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ── Activity V2 dark mode ── */
[data-theme="dark"] .act-revert-all-btn {
    color: #f87171;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.25);
}
[data-theme="dark"] .act-context-tag {
    color: var(--text-secondary, #94a3b8);
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
}
[data-theme="dark"] .act-file-info {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.15);
}
[data-theme="dark"] .act-file-name {
    color: var(--text, #f1f5f9);
}
[data-theme="dark"] .act-entry-dot {
    border-color: var(--card-bg, #1e293b);
}
[data-theme="dark"] .act-control-code {
    background: rgba(99, 102, 241, 0.15);
}

/* ── Activity V3: Time range presets ── */
.act-time-presets {
    display: inline-flex;
    gap: 2px;
    background: var(--surface-alt, rgba(148, 163, 184, 0.06));
    border-radius: 8px;
    padding: 2px;
    border: 1px solid var(--border-light, rgba(226, 232, 240, 0.6));
}
.act-preset-btn {
    padding: 4px 12px;
    font-size: 0.72rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary, #64748b);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.act-preset-btn:hover {
    color: var(--color-accent, #0071e3);
    background: rgba(0, 113, 227, 0.06);
}
.act-preset-btn.active {
    background: var(--color-accent, #0071e3);
    color: #fff;
    box-shadow: 0 1px 4px rgba(0, 113, 227, 0.2);
}

/* ── Activity V3: New entries badge ── */
.act-new-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.62rem;
    font-weight: 700;
    color: #fff;
    background: #ef4444;
    border-radius: 9px;
    margin-left: 4px;
}
.act-new-badge-pulse {
    animation: actNewBadgePulse 0.6s ease;
}
@keyframes actNewBadgePulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* ── Activity V3: View toggle & collapse buttons ── */
.act-view-toggle.active,
#actCollapseToggle.active {
    background: var(--color-accent, #0071e3);
    color: #fff;
    border-color: var(--color-accent, #0071e3);
}

/* ── Activity V3: Export group ── */
.act-export-group {
    display: inline-flex;
    gap: 4px;
}

/* ── Activity V3: Compact mode entries ── */
.act-entry-compact {
    padding: 8px 12px;
    margin-bottom: 2px;
}
.act-entry-compact .act-entry-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
}
.act-entry-compact .act-entry-icon svg {
    width: 13px;
    height: 13px;
}
.act-entry-compact .act-entry-meta {
    font-size: 0.68rem;
    gap: 8px;
}
.act-changes-compact .act-change-row {
    padding: 2px 6px;
    font-size: 0.72rem;
}

/* ── Activity V3: Collapsible day groups ── */
.act-day-header-toggle {
    cursor: pointer;
    user-select: none;
}
.act-day-header-toggle:hover {
    color: var(--color-accent, #0071e3);
}
.act-day-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
    flex-shrink: 0;
}
.act-day-collapsed .act-day-chevron {
    transform: rotate(-90deg);
}
.act-day-collapsed .act-day-entries {
    display: none;
}
.act-day-entries {
    animation: actDayEntriesIn 0.2s ease;
}
@keyframes actDayEntriesIn {
    from { opacity: 0; max-height: 0; }
    to   { opacity: 1; max-height: 9999px; }
}

/* ── Activity V3: Copy ID (permalink) ── */
.act-copy-id {
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
    padding: 0 4px;
    border-radius: 4px;
}
.act-copy-id:hover {
    color: var(--color-accent, #0071e3);
    background: rgba(0, 113, 227, 0.06);
}

/* ── Activity V3: Entry highlight (from permalink) ── */
.act-entry-highlight {
    background: rgba(0, 113, 227, 0.08) !important;
    box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.15) !important;
    animation: actHighlightFade 2s ease forwards;
}
@keyframes actHighlightFade {
    0%   { background: rgba(0, 113, 227, 0.12); box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.2); }
    70%  { background: rgba(0, 113, 227, 0.08); box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.15); }
    100% { background: transparent; box-shadow: none; }
}

/* ── Activity V3: Stat percentage ── */
.act-stat-pct {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted, #94a3b8);
    margin-left: 6px;
}

/* ── Activity V3: Dark mode additions ── */
[data-theme="dark"] .act-time-presets {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border, #334155);
}
[data-theme="dark"] .act-preset-btn {
    color: var(--text-secondary, #94a3b8);
}
[data-theme="dark"] .act-preset-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
}
[data-theme="dark"] .act-preset-btn.active {
    background: var(--primary, #6366f1);
    color: #fff;
}
[data-theme="dark"] .act-copy-id:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
}
[data-theme="dark"] .act-entry-highlight {
    background: rgba(99, 102, 241, 0.1) !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2) !important;
}

/* ── Activity V3: Responsive additions ── */
@media (max-width: 768px) {
    .act-time-presets {
        margin-bottom: 4px;
    }
    .act-export-group {
        flex-direction: column;
        gap: 4px;
        width: 100%;
    }
    .act-export-group .btn {
        width: 100%;
    }
}

/* ==========================================================================
   Admin Users Page
   ========================================================================== */

.admin-hidden {
    display: none !important;
}

.admin-text-muted {
    color: var(--text-muted);
}

/* Page header */
.admin-page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.admin-page-actions {
    flex-shrink: 0;
}

/* Flash */
.admin-flash {
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    font-size: 0.9rem;
    font-weight: 500;
    animation: adminFlashIn 0.3s ease;
}

.admin-flash-success {
    background: rgba(52, 199, 89, 0.12);
    color: #1b7a34;
    border: 1px solid rgba(52, 199, 89, 0.25);
}

.admin-flash-error {
    background: rgba(255, 59, 48, 0.12);
    color: #c0392b;
    border: 1px solid rgba(255, 59, 48, 0.25);
}

[data-theme="dark"] .admin-flash-success {
    background: rgba(52, 199, 89, 0.15);
    color: #6ee094;
}

[data-theme="dark"] .admin-flash-error {
    background: rgba(255, 59, 48, 0.15);
    color: #ff8a80;
}

@keyframes adminFlashIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Users card / grid */
.admin-users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.admin-users-loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.admin-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: adminSpin 0.7s linear infinite;
}

@keyframes adminSpin {
    to { transform: rotate(360deg); }
}

/* ── User card ─────────────────── */
.admin-user-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.admin-user-card:hover {
    border-color: var(--color-accent);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.admin-user-card-top {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 20px 14px;
}

.admin-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
    flex-shrink: 0;
    color: #fff;
    background: var(--color-accent);
}

.admin-user-avatar-manager {
    background: #ff9500;
}

.admin-user-avatar-superadmin {
    background: #af52de;
}

.admin-user-info {
    flex: 1;
    min-width: 0;
}

.admin-user-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-user-username {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.admin-user-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.admin-user-card-details {
    padding: 0 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-user-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.admin-user-detail svg {
    flex-shrink: 0;
    color: var(--text-muted);
}

.admin-user-detail span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-user-card-actions {
    display: flex;
    border-top: 1px solid var(--border-light);
}

.admin-card-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 8px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-right: 1px solid var(--border-light);
}

.admin-card-action-btn:last-child {
    border-right: none;
}

.admin-card-action-btn:hover {
    background: var(--bg-secondary);
}

.admin-card-action-edit:hover {
    color: var(--color-accent);
    background: var(--color-accent-soft, rgba(0, 113, 227, 0.06));
}

.admin-card-action-pw:hover {
    color: #ff9500;
    background: rgba(255, 149, 0, 0.06);
}

.admin-card-action-warn:hover {
    color: #ff9500;
    background: rgba(255, 149, 0, 0.06);
}

.admin-card-action-ok:hover {
    color: #34c759;
    background: rgba(52, 199, 89, 0.06);
}

.admin-card-action-danger:hover {
    color: #ff3b30;
    background: rgba(255, 59, 48, 0.06);
}

/* Status badge */
.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.admin-badge-active {
    background: rgba(52, 199, 89, 0.12);
    color: #1b7a34;
}

.admin-badge-inactive {
    background: rgba(255, 149, 0, 0.12);
    color: #a16207;
}

[data-theme="dark"] .admin-badge-active {
    background: rgba(52, 199, 89, 0.18);
    color: #6ee094;
}

[data-theme="dark"] .admin-badge-inactive {
    background: rgba(255, 149, 0, 0.18);
    color: #fbbf24;
}

[data-theme="dark"] .admin-delete-warning {
    background: rgba(255, 59, 48, 0.1);
    border-color: rgba(255, 59, 48, 0.25);
}

[data-theme="dark"] .admin-user-card {
    box-shadow: none;
}

[data-theme="dark"] .admin-user-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .admin-card-action-btn:hover {
    background: var(--bg-tertiary, rgba(255, 255, 255, 0.04));
}

/* Delete warning */
.admin-delete-warning {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: 10px;
    background: rgba(255, 59, 48, 0.06);
    border: 1px solid rgba(255, 59, 48, 0.15);
    color: var(--text-primary);
}

.admin-delete-warning svg {
    flex-shrink: 0;
    color: #ff3b30;
    margin-top: 2px;
}

.admin-delete-warning p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Empty state */
.admin-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.admin-empty svg {
    opacity: 0.3;
    margin-bottom: 16px;
}

.admin-empty p {
    font-size: 0.9375rem;
}

/* ── Modals ─────────────────────── */

.admin-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.admin-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.admin-modal {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    width: 95%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.25s ease;
}

.admin-modal-overlay.open .admin-modal {
    transform: translateY(0) scale(1);
}

.admin-modal-sm {
    max-width: 420px;
}

.admin-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px 0;
}

.admin-modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.admin-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color var(--transition-fast);
}

.admin-modal-close:hover {
    color: var(--text-primary);
}

.admin-modal-body {
    padding: 24px 28px;
}

.admin-modal-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.admin-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 28px 24px;
}

/* ── Form elements ─────────────── */

.admin-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.admin-form-group {
    margin-bottom: 18px;
}

.admin-form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.admin-form-group input,
.admin-form-group select {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.875rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color var(--transition-fast);
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
}

.admin-form-group input:focus,
.admin-form-group select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

.admin-form-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.admin-password-wrapper {
    position: relative;
}

.admin-password-wrapper input {
    padding-right: 42px;
}

.admin-toggle-pw {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    transition: color var(--transition-fast);
}

.admin-toggle-pw:hover {
    color: var(--text-primary);
}

.admin-password-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ── Responsive ─────────────────── */
@media (max-width: 768px) {
    .admin-page-header-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .admin-form-row {
        grid-template-columns: 1fr;
    }
    .admin-users-grid {
        grid-template-columns: 1fr;
    }
    .admin-modal {
        width: 98%;
        margin: 8px;
    }
    .admin-modal-header,
    .admin-modal-body,
    .admin-modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
}
