:root {
    --brand-bg: #0b0f1a;
    --brand-surface: #111827;
    --brand-surface-2: #0f172a;
    --brand-card: #121826;
    --brand-hover: #162033;
    --brand-border: #1f2937;
    --brand-border-subtle: #202837;
    --brand-text: #f8fafc;
    --brand-text-secondary: #94a3b8;
    --brand-text-muted: #64748b;
    --brand-accent: #2ad4a4;
    --brand-accent-strong: #1fc08f;
    --brand-accent-glow: rgba(42, 212, 164, 0.18);
    --brand-accent-contrast: #071c16;
    --brand-danger: #f87171;
    --brand-warning: #fbbf24;
    --brand-info: #60a5fa;
    --brand-cyan: #22d3ee;
    --brand-aurora-1: rgba(34, 211, 238, 0.18);
    --brand-aurora-2: rgba(42, 212, 164, 0.16);
    --brand-aurora-3: rgba(96, 165, 250, 0.12);
    --brand-glass: rgba(15, 23, 42, 0.72);
    --brand-glass-strong: rgba(11, 15, 26, 0.86);
    --brand-border-glow: rgba(56, 189, 248, 0.3);
    --brand-shadow-soft: 0 18px 40px rgba(2, 8, 23, 0.35);
    --brand-shadow-lift: 0 22px 44px rgba(2, 8, 23, 0.4);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-soft: 0 10px 30px rgba(2, 8, 23, 0.35);
    --shadow-strong: 0 20px 60px rgba(2, 8, 23, 0.45);
    --content-max: 1280px;
    --content-padding: 2.5rem;

    /* Legacy alias tokens */
    --bg-primary: var(--brand-bg);
    --bg-secondary: var(--brand-surface);
    --bg-tertiary: var(--brand-surface-2);
    --bg-card: var(--brand-card);
    --bg-hover: var(--brand-hover);
    --border-color: var(--brand-border);
    --border-subtle: var(--brand-border-subtle);
    --text-primary: var(--brand-text);
    --text-secondary: var(--brand-text-secondary);
    --text-muted: var(--brand-text-muted);
    --accent-green: var(--brand-accent);
    --accent-green-dim: var(--brand-accent-strong);
    --accent-green-glow: var(--brand-accent-glow);
    --accent-red: var(--brand-danger);
    --accent-yellow: var(--brand-warning);
    --accent-blue: var(--brand-info);
    --accent-cyan: var(--brand-cyan);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
    background: radial-gradient(circle at top left, var(--brand-aurora-2), transparent 55%),
        radial-gradient(circle at 20% 20%, var(--brand-aurora-3), transparent 50%),
        radial-gradient(circle at 80% 10%, var(--brand-aurora-1), transparent 45%),
        var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: 0.75rem;
    left: 1rem;
    z-index: 2000;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    background: var(--brand-text);
    color: var(--brand-accent-contrast);
    font-weight: 700;
    text-decoration: none;
    transform: translateY(-180%);
    transition: transform 0.2s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

:where(
    a,
    button,
    input,
    select,
    textarea,
    summary,
    [role="button"],
    [role="menuitem"],
    [tabindex]:not([tabindex="-1"])
):focus-visible {
    outline: 2px solid rgba(34, 211, 238, 0.92);
    outline-offset: 3px;
}

@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;
    }
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

body::before {
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.07) 1px, transparent 1px);
    background-size: 140px 140px;
    opacity: 0.4;
}

body::after {
    background: radial-gradient(circle at 70% 30%, rgba(34, 211, 238, 0.15), transparent 60%);
    mix-blend-mode: screen;
    opacity: 0.6;
}

.app-container,
.main-container,
.content,
.sidebar,
.header {
    position: relative;
    z-index: 1;
}

body:not(.is-loaded) .content-inner {
    opacity: 0;
    transform: translateY(6px);
}

@keyframes page-enter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes page-exit {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-8px); }
}

@keyframes count-up {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes ripple-expand {
    from { transform: scale(0); opacity: 0.4; }
    to { transform: scale(4); opacity: 0; }
}

@keyframes toast-in {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toast-out {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(120%); opacity: 0; }
}

@keyframes toast-progress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

@keyframes badge-pop {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes badge-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

@keyframes sidebar-dot-in {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

@keyframes checkmark-draw {
    from { stroke-dashoffset: 24; }
    to { stroke-dashoffset: 0; }
}

@keyframes gradient-drift-1 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(30px, -20px); }
    66% { transform: translate(-20px, 15px); }
}

@keyframes gradient-drift-2 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(-25px, 20px); }
    66% { transform: translate(15px, -30px); }
}

@keyframes gradient-drift-3 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(20px, 25px); }
    66% { transform: translate(-30px, -10px); }
}

@keyframes float-particle {
    0% { transform: translateY(100%) translateX(0); opacity: 0; }
    10% { opacity: var(--particle-opacity, 0.2); }
    90% { opacity: var(--particle-opacity, 0.2); }
    100% { transform: translateY(-100vh) translateX(var(--particle-drift, 20px)); opacity: 0; }
}

@keyframes btn-shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* Header Styles */
.header {
    background: linear-gradient(120deg, rgba(9, 16, 28, 0.88), rgba(17, 24, 39, 0.92));
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: 0 14px 30px rgba(2, 8, 23, 0.35);
    backdrop-filter: blur(16px);
    padding: 0 2.5rem;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.brand-wordmark {
    height: 28px;
    width: auto;
    opacity: 0.95;
}

.brand-subtitle {
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    padding-left: 0.75rem;
    border-left: 1px solid var(--border-subtle);
}

@media (min-width: 1024px) {
    .brand-wordmark {
        height: 36px;
    }

    .brand-subtitle {
        font-size: 12px;
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-img {
    height: 40px;
    width: auto;
    border-radius: var(--radius-md);
}

.logo-text {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.logo-text span { color: var(--accent-green); }

.header-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover { color: var(--accent-green); }

/* Environment Badge */
.env-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.env-badge.sandbox { color: var(--accent-yellow); border-color: rgba(255, 204, 0, 0.3); }
.env-badge.production { color: var(--accent-green); border-color: rgba(0, 255, 136, 0.3); }

.env-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.sandbox .env-dot { background: var(--accent-yellow); }
.production .env-dot { background: var(--accent-green); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Navbar Balance */
.navbar-balance {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-green);
    padding: 6px 12px;
    background: rgba(0, 255, 136, 0.08);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 999px;
    white-space: nowrap;
}

/* User Menu */
.user-menu-shell {
    position: relative;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
    font-family: inherit;
    appearance: none;
}

.user-menu:hover {
    background: var(--bg-hover);
}

.user-menu:focus-visible {
    outline: none;
    border-color: rgba(34, 211, 238, 0.7);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.2);
}

.user-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-green);
    color: var(--brand-accent-contrast);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    min-width: 220px;
    background: linear-gradient(180deg, rgba(18, 24, 38, 0.98), rgba(12, 18, 30, 0.98));
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-strong);
    overflow: hidden;
    z-index: 1001;
}

.user-menu-meta {
    padding: 0.9rem 1rem 0.8rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.user-menu-name {
    font-weight: 600;
    color: var(--text-primary);
}

.user-menu-org {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.user-menu-actions {
    display: flex;
    flex-direction: column;
    padding: 0.4rem;
}

.user-menu-link,
.user-menu-action {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding: 0.7rem 0.8rem;
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-family: inherit;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.user-menu-link:hover,
.user-menu-link:focus-visible,
.user-menu-action:hover,
.user-menu-action:focus-visible {
    background: rgba(56, 189, 248, 0.08);
    color: var(--text-primary);
    outline: none;
}

.user-menu-action-danger {
    color: var(--accent-red);
}

.user-menu-action-danger:hover,
.user-menu-action-danger:focus-visible {
    background: rgba(248, 113, 113, 0.12);
    color: #fecaca;
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Layout */
.main-container {
    display: flex;
    min-height: calc(100vh - 72px);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, rgba(12, 18, 30, 0.98), rgba(15, 23, 42, 0.96));
    border-right: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: inset -1px 0 0 rgba(15, 23, 42, 0.6);
    padding: 1.75rem 0;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100%;
    overflow-y: auto;
}

.sidebar-section { margin-bottom: 1.5rem; }

.sidebar-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 0 1.75rem;
    margin-bottom: 0.75rem;
}

.sidebar-nav { list-style: none; }

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 1.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav li a:hover {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.08), rgba(15, 23, 42, 0));
    color: var(--text-primary);
    transform: translateX(2px);
}

.sidebar-nav li a.active {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.2), rgba(42, 212, 164, 0.05));
    color: var(--accent-green);
    border-left-color: var(--accent-cyan);
}

.sidebar-nav li a svg { width: 18px; height: 18px; opacity: 0.7; }
.sidebar-nav li a.active svg { opacity: 1; }

/* Content */
.content {
    flex: 1;
    padding: var(--content-padding);
    overflow-y: auto;
}

.content-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    animation: page-enter 0.5s ease both;
}

.page-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.625rem;
    margin-bottom: 2rem;
}

.page-header > div:first-child {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.625rem;
}

.page-header--split {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.page-actions {
    display: inline-flex;
    gap: 0.75rem;
    align-items: center;
}

[data-animate="fade"] {
    animation: fade-rise 0.55s ease both;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    font-family: 'Sora', sans-serif;
    letter-spacing: -0.5px;
    margin: 0;
    text-shadow: 0 8px 30px rgba(15, 23, 42, 0.35);
}

.page-description {
    color: var(--text-secondary);
    font-size: 15px;
    margin: 0;
}

.page-hero {
    background: linear-gradient(120deg, rgba(12, 20, 36, 0.7), rgba(11, 15, 26, 0.92)),
        url("/static/img/brand/pattern.webp");
    background-size: cover;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-lg);
    padding: 2.25rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--brand-shadow-soft);
}

.page-hero-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(42, 212, 164, 0.12);
    color: var(--accent-green);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.hero-actions .btn {
    min-width: 160px;
}

/* Card */
.card {
    background: linear-gradient(160deg, rgba(18, 24, 38, 0.98), rgba(12, 18, 30, 0.98));
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--brand-shadow-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    min-width: 0;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--brand-shadow-lift);
    border-color: rgba(56, 189, 248, 0.3);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.card-actions {
    display: inline-flex;
    gap: 0.75rem;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title svg { width: 20px; height: 20px; color: var(--accent-cyan); }

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.form-grid > * {
    min-width: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-width { grid-column: 1 / -1; }

.form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-label .required { color: var(--accent-red); }

.form-input, .form-select, .form-textarea {
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.88), rgba(12, 18, 30, 0.88));
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: rgba(34, 211, 238, 0.7);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.2);
}

.form-input::placeholder { color: var(--text-muted); }

.form-textarea {
    min-height: 120px;
    resize: vertical;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}

.form-select {
    cursor: pointer;
    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='%23666666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-select option { background: var(--bg-secondary); color: var(--text-primary); }
select.form-input {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-input option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    border: none;
}

.btn svg { width: 16px; height: 16px; }

.btn-primary {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.9), rgba(42, 212, 164, 0.9));
    color: var(--bg-primary);
    box-shadow: 0 16px 30px rgba(34, 211, 238, 0.18);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 36px rgba(34, 211, 238, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.9), rgba(12, 18, 30, 0.9));
    color: var(--text-primary);
    border: 1px solid rgba(148, 163, 184, 0.2);
}
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--text-muted); }

.btn-danger {
    background: rgba(255, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(255, 68, 68, 0.3);
}
.btn-danger:hover {
    background: rgba(255, 68, 68, 0.25);
    transform: translateY(-2px);
}

.btn-group { display: flex; gap: 0.75rem; margin-top: 1.5rem; }

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-sm);
}

.status-issued { background: rgba(0, 255, 136, 0.15); color: var(--accent-green); }
.status-pending { background: rgba(255, 204, 0, 0.15); color: var(--accent-yellow); }
.status-revoked { background: rgba(255, 68, 68, 0.15); color: var(--accent-red); }
.status-validating { background: rgba(68, 136, 255, 0.15); color: var(--accent-blue); }

/* Tables */
.table-container { overflow-x: auto; }

.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }

.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.9), rgba(12, 18, 30, 0.9));
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.data-table tr:hover td {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.08), rgba(15, 23, 42, 0));
}

.data-table .mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--accent-green);
}

.data-table .clickable-ref {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}

.data-table .clickable-ref:hover {
    color: var(--accent-cyan);
}

/* Truncate text in table cells */
.data-table .truncate {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table td code {
    display: inline-block;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

/* Response Panel */
.response-panel {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.response-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.response-title { font-size: 13px; font-weight: 500; }
.response-status { font-size: 12px; font-weight: 500; }
.response-status.success { color: var(--accent-green); }
.response-status.error { color: var(--accent-red); }

.response-body { padding: 16px; max-height: 400px; overflow-y: auto; }

.response-body pre {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-secondary);
}

.response-body pre .key { color: var(--accent-blue); }
.response-body pre .string { color: var(--accent-green); }
.response-body pre .number { color: var(--accent-yellow); }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(160deg, rgba(18, 24, 38, 0.98), rgba(12, 18, 30, 0.98));
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--brand-shadow-soft);
}

.stat-label {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.stat-value { font-size: 28px; font-weight: 600; color: var(--text-primary); }
.stat-value.green { color: var(--accent-green); }

.stat-card-action {
    color: var(--brand-accent);
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.75rem;
    display: inline-block;
    text-decoration: none;
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 1rem;
    backdrop-filter: blur(8px);
    box-shadow: 0 14px 26px rgba(2, 8, 23, 0.2);
}

.alert svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }

.alert-success { background: rgba(0, 255, 136, 0.1); border: 1px solid rgba(0, 255, 136, 0.3); color: var(--accent-green); }
.alert-error { background: rgba(255, 68, 68, 0.1); border: 1px solid rgba(255, 68, 68, 0.3); color: var(--accent-red); }
.alert-warning { background: rgba(255, 204, 0, 0.1); border: 1px solid rgba(255, 204, 0, 0.3); color: var(--accent-yellow); }
.alert-info { background: rgba(68, 136, 255, 0.1); border: 1px solid rgba(68, 136, 255, 0.3); color: var(--accent-blue); }

/* Utility Classes */
.hidden { display: none !important; }
.text-mono { font-family: 'JetBrains Mono', monospace; }
.text-green { color: var(--accent-green); }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 10% 20%, rgba(42, 212, 164, 0.12), transparent 45%),
        radial-gradient(circle at 90% 10%, rgba(96, 165, 250, 0.12), transparent 45%),
        var(--bg-primary);
    padding: 2.5rem;
    position: relative;
    z-index: 1;
}

.login-hero {
    width: 100%;
    max-width: 1140px;
    display: grid;
    grid-template-columns: minmax(320px, 1.1fr) minmax(320px, 0.9fr);
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-strong);
    background: var(--bg-card);
    min-height: 580px;
}

.login-visual {
    position: relative;
    background-color: #0b0f1a;
    background-image: linear-gradient(140deg, rgba(11, 15, 26, 0.45), rgba(11, 15, 26, 0.9)),
        url("/static/img/brand/hero.webp");
    background-size: cover, contain;
    background-position: center, center top;
    background-repeat: no-repeat;
    padding: 3.5rem;
    display: flex;
    align-items: flex-end;
}

.login-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url("/static/img/brand/pattern.webp");
    opacity: 0.08;
    mix-blend-mode: screen;
    pointer-events: none;
}

.login-visual-content {
    position: relative;
    z-index: 1;
    color: var(--text-primary);
    max-width: 420px;
}

.login-visual-content h1 {
    font-family: 'Sora', sans-serif;
    font-size: 32px;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.login-visual-content p {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 1.5rem;
}

.login-mark {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    box-shadow: 0 14px 30px rgba(2, 8, 23, 0.4);
    margin-bottom: 1.5rem;
}

.login-trust-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.5rem;
}

.login-trust-list li {
    font-size: 13px;
    color: var(--text-secondary);
    padding-left: 18px;
    position: relative;
}

.login-trust-list li::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    position: absolute;
    left: 0;
    top: 6px;
}

.login-panel {
    padding: 3.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(160deg, rgba(18, 24, 38, 0.95), rgba(12, 18, 30, 0.95));
    border-left: 1px solid rgba(148, 163, 184, 0.15);
}

.login-logo-img {
    max-width: 220px;
    height: auto;
    margin-bottom: 0.75rem;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.login-header {
    margin-bottom: 2.25rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.login-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.login-form .form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.login-form .form-input,
.login-form .form-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
}

.login-form .form-input:focus,
.login-form .form-select:focus {
    outline: none;
    border-color: var(--accent-green);
    background: var(--bg-secondary);
}

.login-form .btn-primary {
    margin-top: 0.75rem;
}

/* =========================================
   TOAST NOTIFICATIONS
   ========================================= */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    min-width: 320px;
    max-width: 420px;
    background: var(--brand-card);
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-md);
    box-shadow: var(--brand-shadow-lift);
    backdrop-filter: blur(12px);
    animation: toast-in 0.3s ease forwards;
    position: relative;
    overflow: hidden;
}

.toast.removing {
    animation: toast-out 0.3s ease forwards;
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-body {
    flex: 1;
    font-size: 14px;
    color: var(--brand-text);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--brand-text-muted);
    cursor: pointer;
    padding: 0;
    font-size: 18px;
    line-height: 1;
    transition: color 0.15s;
}

.toast-close:hover { color: var(--brand-text); }

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    transform-origin: left;
    animation: toast-progress 4s linear forwards;
}

.toast-success { border-left: 3px solid var(--brand-accent); }
.toast-success .toast-icon { color: var(--brand-accent); }
.toast-success .toast-progress { background: var(--brand-accent); }

.toast-error { border-left: 3px solid var(--brand-danger); }
.toast-error .toast-icon { color: var(--brand-danger); }
.toast-error .toast-progress { background: var(--brand-danger); }

.toast-info { border-left: 3px solid var(--brand-cyan); }
.toast-info .toast-icon { color: var(--brand-cyan); }
.toast-info .toast-progress { background: var(--brand-cyan); }

.toast-warning { border-left: 3px solid var(--accent-yellow); }
.toast-warning .toast-icon { color: var(--accent-yellow); }
.toast-warning .toast-progress { background: var(--accent-yellow); }

/* =========================================
   PAGE TRANSITIONS
   ========================================= */
.content-inner.is-leaving {
    animation: page-exit 0.2s ease forwards;
}

/* =========================================
   ENHANCED CARD HOVER
   ========================================= */
.card {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-3px) scale(1.005);
    box-shadow: var(--brand-shadow-lift), 0 0 20px rgba(42, 212, 164, 0.08);
    border-color: rgba(34, 211, 238, 0.3);
}

/* =========================================
   STATUS BADGE ANIMATIONS
   ========================================= */
.status-pending,
.status-pending_validation,
.status-waiting_validation {
    animation: pulse 2s ease-in-out infinite;
}

.status-badge.pop {
    animation: badge-pop 0.3s ease;
}

.status-revoked {
    animation: badge-shake 0.4s ease 0.5s;
}

/* =========================================
   STAGGERED FADE-IN
   ========================================= */
[data-stagger] > * {
    opacity: 0;
    animation: fade-rise 0.4s ease forwards;
}

[data-stagger] > *:nth-child(1) { animation-delay: 0.05s; }
[data-stagger] > *:nth-child(2) { animation-delay: 0.10s; }
[data-stagger] > *:nth-child(3) { animation-delay: 0.15s; }
[data-stagger] > *:nth-child(4) { animation-delay: 0.20s; }
[data-stagger] > *:nth-child(5) { animation-delay: 0.25s; }
[data-stagger] > *:nth-child(6) { animation-delay: 0.30s; }
[data-stagger] > *:nth-child(7) { animation-delay: 0.35s; }
[data-stagger] > *:nth-child(8) { animation-delay: 0.40s; }
[data-stagger] > *:nth-child(9) { animation-delay: 0.45s; }
[data-stagger] > *:nth-child(10) { animation-delay: 0.50s; }

/* =========================================
   SCROLL REVEAL
   ========================================= */
[data-reveal] {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   BUTTON RIPPLE
   ========================================= */
.btn {
    position: relative;
    overflow: hidden;
}

.btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    width: 20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    animation: ripple-expand 0.4s ease-out forwards;
    pointer-events: none;
}

/* =========================================
   SIDEBAR GLOW DOT
   ========================================= */
.sidebar-nav li a {
    position: relative;
}

.sidebar-nav li a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--brand-accent);
    transform: scale(0) translateY(-50%);
    transition: transform 0.15s ease;
}

.sidebar-nav li a:hover::before {
    transform: scale(1) translateY(-50%);
}

.sidebar-nav li a.active::before {
    display: none;
}

/* =========================================
   SKELETON BASE
   ========================================= */
.skeleton-cell {
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(148,163,184,0.08) 0%, rgba(148,163,184,0.14) 50%, rgba(148,163,184,0.08) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-cell-sm { width: 60px; }
.skeleton-cell-md { width: 80px; }
.skeleton-cell-lg { width: 140px; }

/* =========================================
   INLINE FORM VALIDATION
   ========================================= */
.form-group {
    position: relative;
}

.field-error {
    font-size: 12px;
    color: var(--brand-danger);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease, opacity 0.2s ease;
    opacity: 0;
}

.field-error.visible {
    max-height: 30px;
    opacity: 1;
    margin-top: 4px;
}

.form-input.field-invalid,
.form-select.field-invalid,
.form-control.field-invalid {
    border-color: var(--brand-danger) !important;
    animation: badge-shake 0.3s ease;
}

.form-input.field-valid,
.form-select.field-valid,
.form-control.field-valid {
    border-color: var(--brand-accent) !important;
}

/* =========================================
   SUCCESS CELEBRATION MODAL
   ========================================= */
.success-checkmark-svg {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
}

.success-checkmark-svg .circle {
    fill: none;
    stroke: var(--brand-accent);
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: checkmark-draw 0.6s ease forwards;
}

.success-checkmark-svg .check {
    fill: none;
    stroke: var(--brand-accent);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 24;
    stroke-dashoffset: 24;
    animation: checkmark-draw 0.4s ease 0.4s forwards;
}

/* =========================================
   EXPIRY HEATMAP BAR
   ========================================= */
.expiry-bar {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(148, 163, 184, 0.1);
    margin-top: 4px;
    overflow: hidden;
}

.expiry-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.4s ease;
    width: calc(var(--pct, 0) * 1%);
}

.expiry-bar-fill.expiry-green { background: var(--brand-accent); }
.expiry-bar-fill.expiry-amber { background: var(--brand-warning); }
.expiry-bar-fill.expiry-red { background: var(--brand-danger); }

/* =========================================
   FILTER PILLS
   ========================================= */
.filter-pills {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    overflow-x: auto;
    padding-bottom: 4px;
}

.filter-pill {
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--brand-border);
    background: transparent;
    color: var(--brand-text-secondary);
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
}

.filter-pill:hover {
    border-color: var(--brand-text-muted);
    color: var(--brand-text);
}

.filter-pill.active {
    background: var(--brand-accent);
    border-color: var(--brand-accent);
    color: var(--brand-bg);
    font-weight: 600;
}

/* =========================================
   ROW HOVER ACTIONS
   ========================================= */
.row-actions {
    opacity: 0;
    transition: opacity 0.15s ease;
}

tr:hover .row-actions {
    opacity: 1;
}

/* =========================================
   SORTABLE COLUMNS
   ========================================= */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 20px !important;
}

.sortable::after {
    content: '';
    position: absolute;
    right: 6px;
    top: 50%;
    border: 4px solid transparent;
    border-top-color: var(--brand-text-muted);
    transform: translateY(-25%);
    transition: transform 0.2s ease;
}

.sortable.asc::after {
    border-top-color: var(--brand-accent);
}

.sortable.desc::after {
    border-top-color: var(--brand-accent);
    transform: translateY(-75%) rotate(180deg);
}

/* =========================================
   ROW EXPANSION
   ========================================= */
.expandable-row {
    cursor: pointer;
}

.expansion-panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease;
}

.expansion-panel.open {
    grid-template-rows: 1fr;
}

.expansion-panel-inner {
    overflow: hidden;
}

.expansion-content {
    padding: 1rem 1.5rem;
    background: rgba(15, 23, 42, 0.5);
    border-bottom: 1px solid var(--brand-border);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    font-size: 13px;
}

.expansion-content .detail-label {
    color: var(--brand-text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.expansion-content .detail-value {
    color: var(--brand-text);
}

/* =========================================
   EMPTY STATES
   ========================================= */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 1.5rem;
    animation: fade-rise 0.4s ease;
}

.empty-state-icon {
    width: 120px;
    height: 120px;
    margin-bottom: 1.5rem;
    opacity: 0.6;
}

.empty-state-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--brand-text);
    margin-bottom: 0.5rem;
}

.empty-state-description {
    font-size: 14px;
    color: var(--brand-text-muted);
    margin-bottom: 1.25rem;
    text-align: center;
    max-width: 360px;
}

.zf-trust-graph-shell {
    padding: 0;
}

.zf-trust-accessible-shell {
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.zf-trust-stream-status {
    display: grid;
    justify-items: end;
    gap: 0.25rem;
    text-align: right;
}

.zf-trust-stream-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.65rem;
    font-size: 0.8rem;
    color: var(--brand-text-muted);
}

.zf-trust-graph-stage {
    overflow: hidden;
    border-radius: 20px;
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.14), transparent 32%),
        radial-gradient(circle at bottom right, rgba(20, 184, 166, 0.16), transparent 34%),
        linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(241, 245, 249, 0.98));
    border: 1px solid rgba(148, 163, 184, 0.28);
    min-height: 720px;
}

.zf-trust-graph-svg {
    display: block;
    width: 100%;
    height: auto;
    min-height: 720px;
}

.zf-trust-fallback-banner {
    margin-bottom: 1.5rem;
    border: 1px solid rgba(245, 158, 11, 0.24);
    background: linear-gradient(135deg, rgba(255, 251, 235, 0.96), rgba(254, 243, 199, 0.82));
}

.zf-trust-fallback-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
}

.zf-trust-view-mode-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
}

.zf-trust-view-mode-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.zf-trust-view-hint {
    padding: 0.9rem 1rem 1.1rem;
}

.zf-trust-accessible-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.zf-trust-accessible-panel {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.74);
}

.zf-trust-table-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.zf-trust-table-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}

.zf-trust-table-control {
    display: grid;
    gap: 0.3rem;
    min-width: 8rem;
    color: var(--brand-text-muted);
    font-size: 0.82rem;
}

.zf-trust-table-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.85rem;
}

.zf-trust-legend {
    display: grid;
    gap: 0.65rem;
    padding: 1rem 1.25rem 1.25rem;
}

.zf-trust-legend-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #334155;
    font-size: 0.95rem;
}

.zf-trust-legend-chip {
    width: 1rem;
    height: 1rem;
    border-radius: 999px;
    border: 2px solid #0f172a;
    background: #e2e8f0;
    flex-shrink: 0;
}

.zf-trust-legend-chip.is-allow {
    background: #15803d;
    border-color: #15803d;
}

.zf-trust-legend-chip.is-healthy {
    background: #16a34a;
    border-color: #166534;
}

.zf-trust-legend-chip.is-expiring {
    background: #f59e0b;
    border-color: #b45309;
}

.zf-trust-legend-chip.is-deny {
    background: #b91c1c;
    border-color: #b91c1c;
}

.zf-trust-legend-chip.is-mtls {
    background: #0f766e;
    border-color: #0f766e;
}

.zf-trust-legend-chip.is-anomaly {
    background: #fca5a5;
    border-color: #dc2626;
}

.zf-trust-legend-chip.is-disabled {
    background: #cbd5e1;
    border-color: #64748b;
}

.zf-trust-explorer-anomaly {
    width: 100%;
    text-align: left;
    border: 1px solid rgba(226, 232, 240, 0.88);
    background: rgba(255, 255, 255, 0.84);
    border-radius: 14px;
    padding: 0.95rem 1rem;
    cursor: pointer;
}

.zf-trust-explorer-anomaly:hover {
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(239, 246, 255, 0.82);
}

.zf-trust-explorer-anomaly .activity-title,
.zf-trust-explorer-anomaly .activity-meta {
    pointer-events: none;
}

.stat-context.is-warning {
    color: #b45309;
}

.stat-context.is-live {
    color: #0f766e;
}

.stat-context.is-danger {
    color: #b91c1c;
}

.zf-trust-table-row {
    cursor: pointer;
    outline: none;
}

.zf-trust-table-row td {
    transition: background 140ms ease, box-shadow 140ms ease;
}

.zf-trust-table-row:hover td,
.zf-trust-table-row:focus td {
    background: rgba(239, 246, 255, 0.88);
}

.zf-trust-table-row.is-selected td {
    background: rgba(219, 234, 254, 0.92);
    box-shadow: inset 0 1px 0 rgba(96, 165, 250, 0.22), inset 0 -1px 0 rgba(96, 165, 250, 0.22);
}

.zf-trust-node-group.is-hot circle,
.zf-trust-edge-group.is-hot line:first-child,
.zf-trust-edge-group.is-blocked line:first-child {
    animation: zfTrustPulse 1.2s ease-in-out 2;
}

@keyframes zfTrustPulse {
    0% {
        opacity: 0.4;
        transform: scale(0.995);
    }
    50% {
        opacity: 1;
        transform: scale(1.005);
    }
    100% {
        opacity: 0.85;
        transform: scale(1);
    }
}

.zf-policy-editor-frame {
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.68), rgba(15, 23, 42, 0.52));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.zf-policy-editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(8, 15, 31, 0.46);
}

.zf-policy-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(96, 165, 250, 0.28);
    background: rgba(30, 41, 59, 0.68);
    color: #dbeafe;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.zf-policy-chip.is-ready {
    border-color: rgba(42, 212, 164, 0.28);
    color: #d1fae5;
}

.zf-policy-chip.is-warning {
    border-color: rgba(251, 191, 36, 0.28);
    color: #fde68a;
}

.zf-policy-chip.is-danger {
    border-color: rgba(248, 113, 113, 0.28);
    color: #fecaca;
}

.zf-policy-editor {
    min-height: 320px;
}

.zf-policy-editor-compact {
    min-height: 220px;
}

.zf-policy-editor-fallback {
    padding: 1rem;
}

.zf-policy-editor-fallback .form-input {
    min-height: 240px;
    resize: vertical;
}

.zf-policy-editor-fallback .form-input[id="zfPolicyDenyRules"],
.zf-policy-editor-fallback .form-input[id="zfPolicyOpaRules"] {
    min-height: 180px;
}

.zf-policy-workflow-card {
    overflow: hidden;
}

.zf-policy-workflow-intro {
    padding: 0 1.25rem;
    color: var(--brand-text-secondary);
    font-size: 0.95rem;
}

.zf-policy-gate-card,
.zf-policy-context-card {
    margin: 1rem 1.25rem 0;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(15, 23, 42, 0.3);
}

.zf-policy-gate-card {
    padding: 1rem;
    display: grid;
    gap: 1rem;
}

.zf-policy-gate-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.zf-policy-engine-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.zf-policy-engine-item {
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(8, 15, 31, 0.48);
    padding: 0.85rem 0.9rem;
    display: grid;
    gap: 0.2rem;
}

.zf-policy-engine-label {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brand-text-muted);
}

.zf-policy-engine-value {
    font-weight: 700;
    color: var(--brand-text);
}

.zf-policy-engine-meta {
    font-size: 0.84rem;
    color: var(--brand-text-secondary);
}

.zf-policy-context-card {
    padding: 0.9rem 1rem;
}

.zf-policy-context-title {
    font-weight: 700;
    color: var(--brand-text);
}

.zf-policy-context-meta {
    margin-top: 0.25rem;
    color: var(--brand-text-secondary);
    font-size: 0.9rem;
}

.zf-policy-workflow {
    display: grid;
    gap: 0.75rem;
    padding: 1rem 1.25rem 0;
}

.zf-policy-workflow-step {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.85rem;
    align-items: start;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(15, 23, 42, 0.34);
}

.zf-policy-workflow-step.is-active {
    border-color: rgba(96, 165, 250, 0.3);
    background: rgba(30, 41, 59, 0.6);
    box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.12);
}

.zf-policy-workflow-step.is-complete {
    border-color: rgba(42, 212, 164, 0.28);
    background: rgba(6, 78, 59, 0.26);
}

.zf-policy-workflow-step.is-blocked {
    border-color: rgba(248, 113, 113, 0.22);
    background: rgba(69, 10, 10, 0.26);
}

.zf-policy-workflow-index {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.24);
    color: var(--brand-text);
    font-weight: 700;
}

.zf-policy-workflow-title {
    font-weight: 700;
    color: var(--brand-text);
}

.zf-policy-workflow-meta {
    margin-top: 0.2rem;
    color: var(--brand-text-secondary);
    font-size: 0.9rem;
}

.zf-policy-validation-summary,
.zf-policy-draft-summary {
    margin: 1rem 1.25rem 1.25rem;
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(15, 23, 42, 0.3);
}

.zf-policy-validation-summary {
    display: grid;
    gap: 0.7rem;
}

.zf-policy-validation-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.zf-policy-validation-copy {
    display: grid;
    gap: 0.1rem;
}

.zf-policy-validation-label {
    font-weight: 600;
    color: var(--brand-text);
}

.zf-policy-validation-meta {
    color: var(--brand-text-secondary);
    font-size: 0.88rem;
}

.zf-policy-draft-summary {
    color: var(--brand-text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.zf-policy-diff-shell {
    padding: 0 1.25rem 1.25rem;
}

.zf-policy-diff {
    min-height: 340px;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(8, 15, 31, 0.6);
}

.zf-policy-diff-fallback {
    margin: 0;
    min-height: 340px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(8, 15, 31, 0.6);
}

.zf-policy-impact-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1rem 1rem;
}

.zf-policy-impact-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    padding: 0 1rem 1rem;
}

.zf-policy-impact-card {
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.74);
    padding: 0.95rem 1rem;
    display: grid;
    gap: 0.8rem;
}

.zf-policy-impact-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--brand-text-muted);
    font-weight: 700;
}

.zf-policy-impact-list {
    display: grid;
    gap: 0.65rem;
}

.zf-policy-impact-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.75rem;
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.92);
    border: 1px solid rgba(226, 232, 240, 0.92);
}

.zf-policy-impact-link {
    color: inherit;
    text-decoration: none;
    transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.zf-policy-impact-link:hover,
.zf-policy-impact-link:focus {
    border-color: rgba(96, 165, 250, 0.3);
    background: rgba(239, 246, 255, 0.94);
    transform: translateY(-1px);
}

.zf-policy-impact-copy {
    display: grid;
    gap: 0.1rem;
}

.zf-policy-impact-title {
    font-weight: 600;
    color: #0f172a;
    word-break: break-word;
}

.zf-policy-impact-meta {
    font-size: 0.84rem;
    color: #64748b;
    word-break: break-word;
}

.zf-policy-impact-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: rgba(219, 234, 254, 0.92);
    color: #1d4ed8;
    font-weight: 700;
    font-size: 0.82rem;
}

.zf-workload-row {
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.zf-workload-row.is-selected {
    background: rgba(59, 130, 246, 0.08);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.18);
}

.zf-workload-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.72rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.72);
    color: var(--brand-text);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.zf-workload-pill.is-healthy {
    border-color: rgba(42, 212, 164, 0.3);
    color: #d1fae5;
}

.zf-workload-pill.is-warning {
    border-color: rgba(251, 191, 36, 0.28);
    color: #fde68a;
}

.zf-workload-pill.is-critical {
    border-color: rgba(248, 113, 113, 0.28);
    color: #fecaca;
}

.zf-workload-pill.is-muted {
    border-color: rgba(148, 163, 184, 0.22);
    color: #cbd5e1;
}

.zf-workload-pill.is-neutral {
    border-color: rgba(96, 165, 250, 0.28);
    color: #dbeafe;
}

.zf-workload-focus {
    padding: 1.25rem;
    display: grid;
    gap: 1rem;
}

.zf-workload-focus-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.zf-workload-focus-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    color: var(--brand-text);
    font-size: 1.15rem;
    font-weight: 700;
}

.zf-workload-focus-meta {
    margin-top: 0.35rem;
    color: var(--brand-text-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88rem;
    word-break: break-all;
}

.zf-workload-focus-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.9rem;
}

.zf-workload-focus-card,
.zf-workload-focus-guidance {
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(15, 23, 42, 0.34);
}

.zf-workload-focus-guidance .detail-value {
    margin-top: 0.35rem;
}

@media (max-width: 960px) {
    .zf-policy-editor-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .zf-policy-gate-head,
    .zf-trust-fallback-body,
    .zf-trust-view-mode-shell,
    .zf-trust-table-panel-head,
    .zf-trust-table-pager {
        align-items: flex-start;
        flex-direction: column;
    }

    .zf-policy-engine-grid,
    .zf-policy-impact-grid {
        grid-template-columns: 1fr;
    }

    .zf-policy-editor,
    .zf-policy-diff,
    .zf-policy-diff-fallback {
        min-height: 260px;
    }

    .zf-workload-focus-header {
        flex-direction: column;
    }
}

/* =========================================
   LOGIN PAGE ENHANCEMENTS
   ========================================= */
.login-gradient-mesh {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.login-gradient-mesh .gradient-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
}

.login-gradient-mesh .gradient-blob:nth-child(1) {
    width: 400px;
    height: 400px;
    background: rgba(42, 212, 164, 0.25);
    top: -10%;
    left: -5%;
    animation: gradient-drift-1 12s ease-in-out infinite;
}

.login-gradient-mesh .gradient-blob:nth-child(2) {
    width: 350px;
    height: 350px;
    background: rgba(34, 211, 238, 0.2);
    top: 40%;
    right: -10%;
    animation: gradient-drift-2 14s ease-in-out infinite;
}

.login-gradient-mesh .gradient-blob:nth-child(3) {
    width: 300px;
    height: 300px;
    background: rgba(167, 139, 250, 0.15);
    bottom: -10%;
    left: 30%;
    animation: gradient-drift-3 16s ease-in-out infinite;
}

.login-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
}

.login-particles .particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    bottom: -10px;
    animation: float-particle var(--particle-duration, 12s) linear infinite;
    animation-delay: var(--particle-delay, 0s);
    --particle-opacity: 0.15;
}

.login-particles .particle:nth-child(1) { left: 10%; width: 3px; height: 3px; --particle-duration: 10s; --particle-delay: 0s; --particle-drift: 15px; }
.login-particles .particle:nth-child(2) { left: 25%; width: 5px; height: 5px; --particle-duration: 13s; --particle-delay: 2s; --particle-drift: -20px; background: rgba(42, 212, 164, 0.2); }
.login-particles .particle:nth-child(3) { left: 40%; width: 2px; height: 2px; --particle-duration: 9s; --particle-delay: 4s; --particle-drift: 10px; }
.login-particles .particle:nth-child(4) { left: 55%; width: 4px; height: 4px; --particle-duration: 14s; --particle-delay: 1s; --particle-drift: -15px; }
.login-particles .particle:nth-child(5) { left: 70%; width: 3px; height: 3px; --particle-duration: 11s; --particle-delay: 3s; --particle-drift: 25px; background: rgba(34, 211, 238, 0.2); }
.login-particles .particle:nth-child(6) { left: 85%; width: 6px; height: 6px; --particle-duration: 15s; --particle-delay: 5s; --particle-drift: -10px; --particle-opacity: 0.1; }
.login-particles .particle:nth-child(7) { left: 15%; width: 2px; height: 2px; --particle-duration: 8s; --particle-delay: 7s; --particle-drift: 20px; }
.login-particles .particle:nth-child(8) { left: 60%; width: 4px; height: 4px; --particle-duration: 12s; --particle-delay: 6s; --particle-drift: -25px; background: rgba(42, 212, 164, 0.15); }

.login-form-stagger > * {
    opacity: 1;
    transform: none;
}

.login-header {
    animation: fade-rise 0.4s ease 0.1s forwards;
}

.btn-shimmer {
    background-image: linear-gradient(
        110deg,
        transparent 0%,
        transparent 40%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 60%,
        transparent 100%
    );
    background-size: 200% 100%;
    background-repeat: no-repeat;
    background-position: -200% center;
    transition: background-position 0.6s ease;
}

.btn-shimmer:hover {
    background-position: 200% center;
}

.btn-primary.btn-shimmer {
    background-image: linear-gradient(
        110deg,
        transparent 0%,
        transparent 40%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 60%,
        transparent 100%
    ),
    linear-gradient(135deg, rgba(34, 211, 238, 0.9), rgba(42, 212, 164, 0.9));
    background-size: 200% 100%, 100% 100%;
    background-repeat: no-repeat;
}

.login-trust-list li {
    animation: fade-rise 0.4s ease both;
}

.login-trust-list li:nth-child(1) { animation-delay: 0.3s; }
.login-trust-list li:nth-child(2) { animation-delay: 0.4s; }
.login-trust-list li:nth-child(3) { animation-delay: 0.5s; }

/* =========================================
   REDUCED MOTION
   ========================================= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =========================================
   SHARED COMPONENT PATTERNS
   ========================================= */

/* ── Documentation Sections ─────────────────────────────────────── */
.doc-section { margin-bottom: 1.5rem; }
.doc-section:last-child { margin-bottom: 0; }
.doc-section h4 { color: var(--text-primary); font-size: 1rem; font-weight: 600; margin: 0 0 0.75rem 0; }
.doc-section p { color: var(--text-secondary); line-height: 1.6; margin: 0; font-size: 0.9rem; }
.doc-section ul { margin: 0.5rem 0; padding-left: 1.5rem; }
.doc-section ul li { color: var(--text-secondary); margin-bottom: 0.25rem; font-size: 0.9rem; }
.doc-section a { color: var(--accent-blue); text-decoration: none; }
.doc-section a:hover { text-decoration: underline; }

/* ── RFC Reference Cards ────────────────────────────────────────── */
.rfc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; }
.rfc-link { display: flex; flex-direction: column; padding: 0.75rem; background: var(--bg-secondary); border-radius: 8px; border: 1px solid var(--border-color); text-decoration: none; transition: all 0.2s; }
.rfc-link:hover { border-color: var(--accent-blue); background: var(--bg-tertiary); }
.rfc-link strong { color: var(--accent-blue); font-size: 0.85rem; margin-bottom: 0.25rem; }
.rfc-link span { color: var(--text-secondary); font-size: 0.75rem; }

/* ── Detail Grid ────────────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.detail-item { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.75rem; background: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: var(--radius-md); }
.detail-item label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.detail-item span { color: var(--text-primary); }
.detail-item.full-width { grid-column: 1 / -1; }

/* ── Pagination ─────────────────────────────────────────────────── */
.pagination { padding: 1rem; display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }

/* ── Process Steps ──────────────────────────────────────────────── */
.process-steps { display: flex; flex-direction: column; gap: 0.75rem; }
.process-step { display: flex; align-items: flex-start; gap: 0.75rem; }
.step-number { min-width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--accent-blue), var(--accent-green)); display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; color: var(--bg-primary); }
.step-content { flex: 1; }
.step-content strong { color: var(--text-primary); display: block; margin-bottom: 0.25rem; }
.step-content p { color: var(--text-secondary); font-size: 0.85rem; margin: 0; }

/* ── Tips List ──────────────────────────────────────────────────── */
.tips-list { display: flex; flex-direction: column; gap: 0.75rem; }
.tip-item { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.75rem; background: var(--bg-secondary); border-radius: 8px; border-left: 3px solid var(--accent-green); }
.tip-icon { font-size: 1.25rem; line-height: 1; }
.tip-content strong { color: var(--text-primary); display: block; margin-bottom: 0.25rem; }
.tip-content p { color: var(--text-secondary); font-size: 0.85rem; margin: 0; }

/* ── Form Section Title ─────────────────────────────────────────── */
.form-section-title { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-secondary); margin: 1.5rem 0 0.75rem; }

/* ── Progress Chip ──────────────────────────────────────────────── */
.progress-chip { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.75rem; padding: 0.35rem 0.75rem; border-radius: 999px; background: rgba(15,23,42,0.08); color: var(--text-primary); }

/* ── Privileges Grid ────────────────────────────────────────────── */
.privileges-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.5rem 0; }

/* ── Notification Bell ──────────────────────────────────────────── */
.notification-bell { position: relative; }
.bell-btn { background: none; border: none; cursor: pointer; color: var(--text-secondary); padding: 0.5rem; position: relative; transition: color 0.2s; }
.bell-btn:hover { color: var(--text-primary); }
.bell-btn:focus-visible { color: var(--text-primary); border-radius: 999px; }
.bell-btn svg { width: 20px; height: 20px; }
.bell-badge { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; border-radius: 999px; background: var(--accent-red); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; animation: bellPulse 2s ease-in-out infinite; }
.bell-badge.hidden { display: none; }
@keyframes bellPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }
.bell-dropdown { position: absolute; top: 100%; right: 0; width: 340px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); box-shadow: var(--shadow-strong); z-index: 1000; overflow: hidden; }
.bell-dropdown.hidden { display: none; }
.bell-dropdown-header { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-color); }
.bell-dropdown-header span { font-weight: 600; color: var(--text-primary); font-size: 0.9rem; }
.bell-dropdown-header a,
.bell-action-link { font-size: 0.8rem; color: var(--accent-blue); text-decoration: none; }
.bell-action-link { background: none; border: 0; font-family: inherit; cursor: pointer; }
.bell-dropdown-header a:hover,
.bell-action-link:hover { text-decoration: underline; }
.bell-dropdown-body { max-height: 320px; overflow-y: auto; }
.bell-dropdown-footer { padding: 0.75rem 1rem; border-top: 1px solid var(--border-color); text-align: center; }
.bell-dropdown-footer a { font-size: 0.85rem; color: var(--accent-blue); text-decoration: none; }
.bell-dropdown-footer a:hover { text-decoration: underline; }

.domain-picker {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.domain-picker-label {
    margin-bottom: -0.25rem;
}

.domain-picker-results {
    min-height: 10.75rem;
}

.domain-picker-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.domain-picker-controls {
    display: flex;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .domain-picker-results {
        min-height: 9.5rem;
    }

    .domain-picker-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .domain-picker-controls {
        justify-content: space-between;
    }
}
.bell-item { display: flex; gap: 0.75rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-subtle); cursor: pointer; transition: background 0.15s; color: inherit; text-decoration: none; }
.bell-item:hover,
.bell-item:focus-visible { background: var(--bg-hover); }
.bell-item:last-child { border-bottom: none; }
.bell-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.bell-dot.critical { background: var(--accent-red); }
.bell-dot.high { background: var(--accent-yellow); }
.bell-dot.medium { background: var(--accent-blue); }
.bell-dot.low { background: var(--text-muted); }
.bell-item-content { flex: 1; min-width: 0; }
.bell-item-title { font-size: 0.85rem; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bell-item-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.bell-empty { padding: 2rem; text-align: center; color: var(--text-muted); font-size: 0.85rem; }
.sidebar-badge { margin-left: auto; min-width: 18px; height: 18px; border-radius: 999px; background: var(--accent-red); color: #fff; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }

@media (max-width: 960px) {
    .login-hero {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .login-visual {
        min-height: 280px;
    }
}

/* =========================================
   WIZARD STYLES
   ========================================= */

/* Progress Steps */
.wizard-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.step-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    text-align: center;
    transition: color 0.3s ease;
}

.progress-step.active .step-number {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: var(--bg-primary);
    box-shadow: 0 0 20px var(--accent-green-glow);
}

.progress-step.active .step-label {
    color: var(--accent-green);
}

.progress-step.completed .step-number {
    background: var(--accent-green-dim);
    border-color: var(--accent-green-dim);
    color: var(--bg-primary);
}

.progress-step.completed .step-label {
    color: var(--text-secondary);
}

.progress-connector {
    width: 60px;
    height: 2px;
    background: var(--border-color);
    margin: 0 1rem;
    margin-bottom: 1.5rem;
}

/* Wizard Steps Content */
.wizard-step {
    display: none;
}

.wizard-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Wizard Navigation */
.wizard-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.wizard-navigation .btn {
    min-width: 120px;
}

/* Form Row */
.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0;
}

.form-row .form-group {
    flex: 1;
}

.col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.col-md-6 { flex: 0 0 50%; max-width: 50%; }
.col-md-8 { flex: 0 0 66.666%; max-width: 66.666%; }

/* Required Field Indicator */
.required {
    color: var(--accent-red);
    margin-left: 2px;
}

/* Form Hints */
.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Invalid Field */
.form-control.is-invalid,
.form-input.is-invalid,
textarea.is-invalid {
    border-color: var(--accent-red) !important;
}

/* Alert Boxes */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-info {
    background: rgba(68, 136, 255, 0.1);
    border: 1px solid rgba(68, 136, 255, 0.3);
    color: var(--accent-blue);
}

.alert-danger {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    color: var(--accent-red);
}

.alert-success {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    color: var(--accent-green);
}

.alert .icon {
    font-size: 18px;
    line-height: 1;
}

/* EV Fields Section */
.ev-fields-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
}

.ev-fields-section h4 {
    color: var(--accent-yellow);
    margin-bottom: 0.5rem;
}

/* Domain DCV Table */
.domain-dcv-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.domain-dcv-table th,
.domain-dcv-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.domain-dcv-table th {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
}

.domain-dcv-table td {
    color: var(--text-primary);
}

.domain-dcv-select {
    width: 100%;
}

/* DCV Info Box */
.dcv-info-box {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    margin-top: 1.5rem;
}

.dcv-info-box h5 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 14px;
}

.dcv-info-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dcv-info-box li {
    padding: 0.5rem 0;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
}

.dcv-info-box li:last-child {
    border-bottom: none;
}

.dcv-info-box li strong {
    color: var(--accent-green);
}

/* Review Section */
.review-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.review-section:last-of-type {
    border-bottom: none;
}

.review-section h4 {
    color: var(--accent-green);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.review-table {
    width: 100%;
    border-collapse: collapse;
}

.review-table th,
.review-table td {
    padding: 0.5rem 0;
    text-align: left;
    vertical-align: top;
}

.review-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 13px;
    width: 180px;
}

.review-table td {
    color: var(--text-primary);
    font-size: 14px;
}

/* CSR Preview */
.csr-preview {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 11px;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 150px;
    overflow-y: auto;
}

/* Checkbox Label */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--accent-green);
    cursor: pointer;
}

.checkbox-label a {
    color: var(--accent-green);
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: max(1rem, 5vh) 1rem 1rem;
    overflow-y: auto;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.modal-header h3 {
    color: var(--accent-green);
    font-size: 18px;
}

.modal-body {
    padding: 2rem 1.5rem;
    text-align: center;
    overflow-y: auto;
}

.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-green-dim) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--bg-primary);
    margin: 0 auto 1.5rem;
    box-shadow: 0 0 30px var(--accent-green-glow);
}

.modal-body p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.order-details {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin: 1.5rem 0;
    text-align: left;
}

.order-details p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

.order-details strong {
    color: var(--text-primary);
}

.order-details span {
    color: var(--accent-green);
}

.next-steps {
    font-size: 13px;
    color: var(--text-muted);
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-shrink: 0;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--bg-primary);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Step Error */
.step-error {
    margin-bottom: 1rem;
}

/* =========================================
   ENHANCED FORM STYLES
   ========================================= */

/* Form Controls */
.form-control {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.88), rgba(12, 18, 30, 0.88));
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: rgba(34, 211, 238, 0.7);
    background: rgba(15, 23, 42, 0.9);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.2);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

select.form-control option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.code-input {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.5;
}

.code-output {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 11px;
    line-height: 1.4;
    background: var(--bg-primary);
    color: var(--accent-green);
}

.key-output {
    color: var(--accent-yellow);
}

/* Form Groups */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* CSR Label Row */
.csr-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.csr-label-row label {
    margin-bottom: 0;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    font-family: inherit;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-primary {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.92), rgba(42, 212, 164, 0.92));
    color: var(--bg-primary);
    box-shadow: 0 16px 30px rgba(34, 211, 238, 0.18);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 36px rgba(34, 211, 238, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.9), rgba(12, 18, 30, 0.9));
    color: var(--text-primary);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.btn-success {
    background: linear-gradient(135deg, rgba(42, 212, 164, 0.9), rgba(16, 185, 129, 0.9));
    color: var(--bg-primary);
}

.btn-outline {
    background: transparent;
    color: var(--accent-cyan);
    border: 1px solid rgba(34, 211, 238, 0.6);
}

.btn-outline:hover {
    background: rgba(34, 211, 238, 0.12);
}

.btn-icon {
    font-size: 16px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Section Divider */
.section-divider {
    display: flex;
    align-items: center;
    margin: 2rem 0 1.5rem;
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.section-divider span {
    padding: 0 1rem;
    color: var(--accent-yellow);
    font-size: 14px;
    font-weight: 600;
}

/* Section Intro */
.section-intro {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 14px;
}

/* Info Card */
.info-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-top: 1.5rem;
}

.info-card h5 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 14px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.info-item {
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
}

.info-item strong {
    display: block;
    color: var(--accent-green);
    margin-bottom: 0.25rem;
    font-size: 13px;
}

.info-item p {
    color: var(--text-muted);
    font-size: 12px;
    margin: 0;
    line-height: 1.4;
}

/* Domain List */
.domain-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.domain-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.domain-name {
    flex: 1;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 13px;
    color: var(--accent-green);
}

.domain-item .form-control {
    width: 180px;
    flex-shrink: 0;
}

/* Review Grid */
.review-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.review-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.review-card h4 {
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.review-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.review-item:last-child {
    border-bottom: none;
}

.review-label {
    color: var(--text-muted);
    font-size: 12px;
}

.review-value {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    text-align: right;
}

.csr-review {
    grid-column: 1 / -1;
}

/* Terms Group */
.terms-group {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--accent-green);
    cursor: pointer;
}

.checkbox-label a {
    color: var(--accent-green);
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* Navigation Spacer */
.nav-spacer {
    flex: 1;
}

/* =========================================
   CSR GENERATOR MODAL STYLES
   ========================================= */

.modal-lg {
    max-width: 700px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-close:focus-visible {
    color: var(--text-primary);
    border-radius: 6px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    color: var(--accent-green);
    font-size: 18px;
    margin: 0;
}

.form-actions {
    text-align: center;
    margin-top: 1.5rem;
}

.output-section {
    margin-bottom: 1.5rem;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.output-header label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.output-actions {
    display: flex;
    gap: 0.5rem;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 3px;
    margin-left: 8px;
}

.badge-danger {
    background: var(--accent-red);
    color: white;
}

.badge-warning {
    background: rgba(251, 191, 36, 0.16);
    color: var(--accent-yellow);
}

.badge-secondary {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.badge-success {
    background: rgba(15, 136, 95, 0.14);
    color: var(--accent-green);
}

.key-warning {
    margin-top: 0.75rem;
}

/* Success Modal Enhancements */
.text-center {
    text-align: center;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-muted);
}

.detail-value {
    font-weight: 500;
}

.detail-value.highlight {
    color: var(--accent-green);
    font-family: 'Monaco', monospace;
}

/* Responsive */
@media (max-width: 768px) {
    .header { 
        padding: 0 1rem; 
    }
    
    .header-nav {
        gap: 0.75rem;
    }
    
    .header-nav .nav-link {
        display: none;
    }
    
    .logo-text {
        font-size: 16px;
    }
    
    .env-badge {
        padding: 4px 8px;
        font-size: 10px;
    }
    
    .env-badge span {
        display: none;
    }
    
    .user-menu {
        padding: 6px 10px;
    }
    
    .user-menu span {
        display: none;
    }
    
    /* Mobile menu toggle button */
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: var(--bg-tertiary);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        cursor: pointer;
        color: var(--text-secondary);
    }
    
    .mobile-menu-toggle:hover {
        background: var(--bg-hover);
        color: var(--text-primary);
    }

    .mobile-menu-toggle:focus-visible {
        background: var(--bg-hover);
        color: var(--text-primary);
    }
    
    .mobile-menu-toggle svg {
        width: 20px;
        height: 20px;
    }
    
    /* Sidebar as overlay on mobile */
    .sidebar {
        position: fixed;
        top: 64px;
        left: 0;
        bottom: 0;
        width: 280px;
        z-index: 99;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        display: block;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 0;
        border: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 98;
    }
    
    .sidebar-overlay.open {
        display: block;
    }
    
    .content { 
        padding: 1rem; 
    }
    
    .page-title {
        font-size: 22px;
    }
    
    .page-description {
        font-size: 14px;
    }
    
    .page-header {
        margin-bottom: 1.5rem;
    }
    
    .form-grid { 
        grid-template-columns: 1fr; 
    }
    
    /* Stats grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 22px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    /* Cards */
    .card {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: var(--radius-md);
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }
    
    .card-title {
        font-size: 14px;
    }
    
    /* Table responsive */
    .table-container {
        margin: 0 -1rem;
        padding: 0;
        border-radius: 0;
    }
    
    .data-table {
        font-size: 13px;
        min-width: 100%;
        table-layout: fixed;
    }
    
    .data-table th {
        padding: 0.625rem 0.5rem;
        font-size: 10px;
        white-space: nowrap;
    }
    
    .data-table td {
        padding: 0.75rem 0.5rem;
        vertical-align: middle;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .data-table th:first-child,
    .data-table td:first-child {
        padding-left: 1rem;
    }
    
    .data-table .truncate {
        max-width: 120px;
    }
    
    .data-table td code {
        max-width: 100px;
    }
    
    .data-table th:last-child,
    .data-table td:last-child {
        padding-right: 1rem;
    }
    
    .data-table .mono {
        font-size: 11px;
        word-break: break-all;
    }
    
    .data-table code {
        font-size: 11px;
        word-break: break-all;
    }
    
    /* Status badges in tables */
    .data-table .status-badge {
        font-size: 10px;
        padding: 0.2rem 0.4rem;
        white-space: nowrap;
    }
    
    /* Buttons */
    .btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .btn svg {
        width: 14px;
        height: 14px;
    }
    
    .btn-group {
        flex-wrap: wrap;
    }
    
    /* Wizard responsive */
    .wizard-progress {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .progress-connector {
        display: none;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .col-md-4, .col-md-6, .col-md-8 {
        flex: 1 1 100%;
        max-width: 100%;
    }
    
    .review-grid {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .domain-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .domain-item .form-control {
        width: 100%;
    }
    
    .modal-lg {
        max-width: 95%;
    }
    
    .csr-label-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    /* Form inputs */
    .form-input, .form-select, .form-textarea {
        padding: 10px 12px;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
    
    /* Alerts */
    .alert {
        padding: 12px 14px;
        font-size: 13px;
    }

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

    .zf-trust-graph-stage,
    .zf-trust-graph-svg {
        min-height: 560px;
    }

    .zf-trust-accessible-grid {
        grid-template-columns: 1fr;
    }

    .zf-trust-stream-status {
        justify-items: start;
        text-align: left;
    }

    .zf-trust-stream-meta {
        justify-content: flex-start;
    }

    .zf-trust-table-controls,
    .zf-trust-table-control {
        width: 100%;
    }

    .zf-policy-impact-bar {
        padding-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    .header {
        height: 56px;
    }
    
    .main-container {
        min-height: calc(100vh - 56px);
    }
    
    .sidebar {
        top: 56px;
        width: 100%;
    }
    
    .sidebar-overlay {
        top: 56px;
    }
    
    .logo-img {
        height: 32px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .page-title {
        font-size: 20px;
    }
    
    /* Hide less important table columns on very small screens */
    .data-table .hide-mobile {
        display: none;
    }
    
    /* Extra small screen table adjustments */
    .data-table {
        font-size: 12px;
    }
    
    .data-table th {
        font-size: 9px;
        padding: 0.5rem 0.375rem;
    }
    
    .data-table td {
        padding: 0.625rem 0.375rem;
    }
    
    .data-table th:first-child,
    .data-table td:first-child {
        padding-left: 0.75rem;
    }
    
    .data-table th:last-child,
    .data-table td:last-child {
        padding-right: 0.75rem;
    }
    
    .data-table .mono,
    .data-table code {
        font-size: 10px;
    }
    
    .data-table .status-badge {
        font-size: 9px;
        padding: 0.15rem 0.35rem;
    }
    
    /* Compact cards for very small screens */
    .card {
        padding: 0.75rem;
    }
    
    .card-header {
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
    }
}

/* Desktop: hide mobile-only elements */
@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none;
    }
    
    .sidebar-overlay {
        display: none !important;
    }
}

.stack-form {
    display: grid;
    gap: 1rem;
}

.table-subtext {
    margin-top: 0.2rem;
    color: var(--text-muted, #6b7280);
    font-size: 0.85rem;
    word-break: break-all;
}

.code-block {
    background: rgba(8, 15, 29, 0.92);
    color: #dbeafe;
    border-radius: 16px;
    padding: 1rem;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* =========================================
   PORTAL UX/UI IMPROVEMENT PASS
   ========================================= */

.header {
    padding: 0 1.5rem 0 1.75rem;
    gap: 1.25rem;
}

.header-left,
.header-nav {
    min-width: 0;
}

.brand-stack {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.brand-context {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.brand-context-chip {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.24);
    background: rgba(8, 145, 178, 0.14);
    color: var(--accent-cyan);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.brand-context-copy {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 34ch;
}

.header-link-cluster {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(8, 15, 29, 0.3);
}

.header-link-cluster .nav-link {
    padding: 0.48rem 0.8rem;
    border-radius: 999px;
}

.header-link-cluster .nav-link:hover,
.header-link-cluster .nav-link:focus-visible {
    background: rgba(56, 189, 248, 0.12);
    color: var(--text-primary);
    outline: none;
}

.header-status-cluster {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-balance {
    min-height: 34px;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(8, 15, 29, 0.35);
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.user-menu {
    background: rgba(8, 15, 29, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 999px;
    padding: 0.35rem 0.55rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.user-menu:hover,
.user-menu:focus-visible {
    border-color: rgba(56, 189, 248, 0.28);
    background: rgba(8, 15, 29, 0.65);
}

.user-icon {
    box-shadow: 0 10px 20px rgba(8, 15, 29, 0.35);
}

.sidebar {
    height: calc(100vh - 72px);
    overflow: hidden;
    padding: 0;
}

.sidebar-scroll {
    height: 100%;
    overflow-y: auto;
    padding: 1.25rem 0 2rem;
}

.sidebar-overview {
    margin: 0 1.25rem 1.25rem;
    padding: 1rem 1rem 1.05rem;
    border-radius: 18px;
    border: 1px solid rgba(56, 189, 248, 0.18);
    background: linear-gradient(155deg, rgba(8, 15, 29, 0.9), rgba(15, 23, 42, 0.94));
    box-shadow: 0 18px 34px rgba(2, 8, 23, 0.28);
}

.sidebar-overview-kicker {
    color: var(--accent-cyan);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.sidebar-overview-title {
    margin-top: 0.45rem;
    color: var(--text-primary);
    font-family: 'Sora', sans-serif;
    font-size: 1rem;
    line-height: 1.35;
}

.sidebar-overview-copy {
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.5;
}

.sidebar-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.95rem;
}

.sidebar-shortcut {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(148, 163, 184, 0.06);
    color: var(--text-primary);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.sidebar-shortcut:hover,
.sidebar-shortcut:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(56, 189, 248, 0.28);
    background: rgba(56, 189, 248, 0.12);
    outline: none;
}

.sidebar-section {
    margin-bottom: 1.1rem;
    padding-top: 0.85rem;
}

.sidebar-section + .sidebar-section {
    border-top: 1px solid rgba(148, 163, 184, 0.08);
    margin-top: 0.9rem;
}

.sidebar-title {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    margin: 0 1.25rem 0.8rem;
    padding: 0 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(148, 163, 184, 0.05);
    letter-spacing: 0.12em;
}

.sidebar-nav {
    display: grid;
    gap: 0.2rem;
}

.sidebar-nav li a {
    margin: 0 0.75rem;
    padding: 0.78rem 1rem;
    border: 1px solid transparent;
    border-left: none;
    border-radius: 14px;
}

.sidebar-nav li a:hover {
    transform: translateX(4px);
    border-color: rgba(56, 189, 248, 0.16);
    box-shadow: 0 12px 26px rgba(2, 8, 23, 0.18);
}

.sidebar-nav li a:focus-visible {
    border-color: rgba(56, 189, 248, 0.28);
    box-shadow: 0 12px 26px rgba(2, 8, 23, 0.18);
}

.sidebar-nav li a.active {
    border-left: none;
    border-color: rgba(56, 189, 248, 0.24);
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.14), 0 16px 30px rgba(2, 8, 23, 0.22);
}

.content {
    padding: 1.5rem 1.75rem 2.5rem;
    background: linear-gradient(180deg, rgba(8, 15, 29, 0.08), rgba(8, 15, 29, 0));
}

.content-inner {
    max-width: 1340px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.content-inner > * {
    min-width: 0;
}

.page-header {
    margin-bottom: 0;
}

.page-header--panel {
    position: relative;
    overflow: hidden;
    padding: 1.5rem 1.75rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: linear-gradient(155deg, rgba(18, 24, 38, 0.96), rgba(8, 15, 29, 0.94));
    box-shadow: 0 20px 36px rgba(2, 8, 23, 0.26);
}

.page-header--panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(34, 211, 238, 0.12), transparent 35%),
        radial-gradient(circle at bottom left, rgba(42, 212, 164, 0.08), transparent 45%);
    pointer-events: none;
}

.page-header-copy,
.page-actions,
.page-pills {
    position: relative;
    z-index: 1;
}

.page-kicker {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.2);
    background: rgba(8, 145, 178, 0.12);
    color: var(--accent-cyan);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.page-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
}

.page-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.16);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
}

a.page-pill {
    text-decoration: none;
    color: inherit;
}

.page-header--panel .page-description {
    max-width: 62ch;
}

.page-hero {
    position: relative;
    overflow: hidden;
    padding: 2.5rem;
    min-height: 220px;
}

.page-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(8, 15, 29, 0.1), transparent 55%);
    pointer-events: none;
}

.page-hero-inner {
    position: relative;
    z-index: 1;
    align-items: flex-end;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.4rem;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(8, 15, 29, 0.32);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
}

.hero-actions .btn {
    min-width: 0;
}

.card {
    padding: 1.35rem 1.5rem;
}

.card-header--button {
    width: 100%;
    border: 0;
    background: transparent;
    cursor: pointer;
    color: inherit;
    font: inherit;
    text-align: inherit;
}

.card-header--button:focus-visible {
    border-radius: var(--radius-md);
}

.doc-card .card-header {
    margin-bottom: 0;
}

.doc-card-content {
    padding-top: 1.35rem;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.card-subtitle {
    margin-top: 0.35rem;
    color: var(--text-muted);
    font-size: 0.87rem;
    max-width: 64ch;
}

.table-badge {
    margin-left: 0.5rem;
    font-size: 0.75rem;
}

.surface-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem 1.25rem;
    align-items: end;
}

.surface-toolbar-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    min-width: 0;
}

.surface-toolbar .form-group {
    margin: 0;
}

.surface-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
}

.table-card .table-container,
.table-card .table-responsive {
    margin-top: 0.15rem;
}

.pagination-shell {
    padding: 1rem 0 0;
    margin-top: 1rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination-page-info {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(8, 15, 29, 0.32);
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.readonly-field {
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.78), rgba(12, 18, 30, 0.72));
    border-style: dashed;
    color: var(--text-secondary);
    min-height: 44px;
    display: flex;
    align-items: center;
}

.state-card {
    padding: 0;
}

.state-card-body {
    padding: 2.5rem 1.5rem;
    text-align: center;
}

@media (max-width: 1200px) {
    .header-link-cluster {
        display: none;
    }

    .brand-context-copy {
        max-width: 24ch;
    }
}

@media (max-width: 960px) {
    .header {
        padding: 0 1rem;
    }

    .brand-context {
        display: none;
    }

    .header-status-cluster {
        display: none;
    }

    .sidebar {
        height: auto;
    }

    .sidebar-scroll {
        padding: 1rem 0 2rem;
    }

    .page-header--split {
        align-items: flex-start;
    }

    .page-pills,
    .hero-actions {
        justify-content: flex-start;
    }

    .page-header--panel {
        padding: 1.3rem;
    }

    .page-hero {
        padding: 1.6rem;
        min-height: auto;
    }

    .page-hero-inner {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .surface-toolbar-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .brand-subtitle {
        display: none;
    }

    .sidebar-overview {
        margin: 0 1rem 1rem;
    }

    .sidebar-title {
        margin: 0 1rem 0.75rem;
    }

    .sidebar-nav li a {
        margin: 0 0.5rem;
    }

    .page-pills {
        width: 100%;
    }

    .page-pill,
    .hero-pill {
        font-size: 11px;
    }

    .content-inner {
        gap: 1rem;
    }

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

    .pagination-shell {
        flex-direction: column;
        align-items: flex-start;
    }

    .pagination-controls {
        width: 100%;
        justify-content: space-between;
    }

    .table-card .table-container,
    .table-card .table-responsive {
        margin: 0 -0.75rem;
    }
}
