/* =========================================================
   CodexSec Global Design System
   File: static/css/base.css
   ========================================================= */

:root {
    color-scheme: dark;

    --cs-bg: #0b0f1a;
    --cs-bg-deep: #070a12;
    --cs-surface: #101725;
    --cs-surface-2: #111827;
    --cs-surface-3: #182235;
    --cs-card: #121b2b;
    --cs-card-hover: #162238;

    --cs-primary: #a3e635;
    --cs-primary-hover: #bef264;
    --cs-primary-strong: #84cc16;
    --cs-primary-soft: rgba(163, 230, 53, 0.12);
    --cs-primary-ring: rgba(163, 230, 53, 0.3);

    --cs-text: #f8fafc;
    --cs-text-soft: #dbe4f0;
    --cs-muted: #94a3b8;
    --cs-muted-2: #64748b;

    --cs-border: rgba(148, 163, 184, 0.16);
    --cs-border-strong: rgba(163, 230, 53, 0.28);

    --cs-success: #22c55e;
    --cs-success-soft: rgba(34, 197, 94, 0.12);
    --cs-warning: #f59e0b;
    --cs-warning-soft: rgba(245, 158, 11, 0.12);
    --cs-danger: #ef4444;
    --cs-danger-soft: rgba(239, 68, 68, 0.12);
    --cs-info: #38bdf8;
    --cs-info-soft: rgba(56, 189, 248, 0.12);

    --font-body: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-heading: "Space Grotesk", "Inter", system-ui, sans-serif;

    --container: 1400px;
    --header-height: 74px;

    --radius-xs: 8px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --radius-pill: 999px;

    --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.18);
    --shadow-md: 0 14px 38px rgba(0, 0, 0, 0.28);
    --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.4);
    --shadow-primary: 0 14px 36px rgba(132, 204, 22, 0.16);

    --transition-fast: 160ms ease;
    --transition: 240ms ease;
    --transition-slow: 380ms ease;
}

/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 24px);
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
    margin: 0;
}

ul[role="list"],
ol[role="list"] {
    list-style: none;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% -10%, rgba(163, 230, 53, 0.08), transparent 28rem),
        radial-gradient(circle at 90% 10%, rgba(56, 189, 248, 0.05), transparent 26rem),
        var(--cs-bg);
    color: var(--cs-text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body.nav-open {
    overflow: hidden;
}

img,
picture,
svg,
canvas,
video {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

input,
button,
textarea,
select {
    font: inherit;
}

button,
[role="button"] {
    cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

a {
    color: inherit;
    text-decoration: none;
}

::selection {
    background: var(--cs-primary);
    color: #111a08;
}

::-webkit-scrollbar {
    width: 11px;
    height: 11px;
}

::-webkit-scrollbar-track {
    background: var(--cs-bg-deep);
}

::-webkit-scrollbar-thumb {
    background: #2a3547;
    border: 3px solid var(--cs-bg-deep);
    border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--cs-primary-strong);
}

:focus-visible {
    outline: 3px solid var(--cs-primary-ring);
    outline-offset: 3px;
}

/* Accessibility */
.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 9999;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--cs-primary);
    color: #101806;
    font-weight: 800;
    transform: translateY(-160%);
    transition: transform var(--transition-fast);
}

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

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

/* Layout */
.site-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-main {
    flex: 1;
    min-width: 0;
}

.container {
    width: min(calc(100% - 40px), var(--container));
    margin-inline: auto;
}

.container--narrow {
    width: min(calc(100% - 40px), 900px);
    margin-inline: auto;
}

.container--wide {
    width: min(calc(100% - 32px), 1560px);
    margin-inline: auto;
}

.section {
    padding-block: clamp(4rem, 8vw, 7rem);
}

.section--sm {
    padding-block: clamp(2.5rem, 5vw, 4rem);
}

.section--lg {
    padding-block: clamp(5rem, 10vw, 9rem);
}

.stack > * + * {
    margin-top: var(--stack-space, 1rem);
}

.cluster {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--cluster-gap, 0.75rem);
}

.grid {
    display: grid;
    gap: var(--grid-gap, 1.5rem);
}

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

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

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

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--cs-text);
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.16;
    letter-spacing: -0.025em;
}

h1 { font-size: clamp(2.35rem, 5vw, 4.8rem); }
h2 { font-size: clamp(1.9rem, 3.5vw, 3.2rem); }
h3 { font-size: clamp(1.35rem, 2vw, 1.8rem); }
h4 { font-size: 1.2rem; }
h5 { font-size: 1.05rem; }
h6 { font-size: 0.95rem; }

p {
    color: var(--cs-muted);
}

.lead {
    color: var(--cs-text-soft);
    font-size: clamp(1.05rem, 1.8vw, 1.25rem);
    line-height: 1.8;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--cs-primary);
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.eyebrow::before {
    content: "";
    width: 28px;
    height: 2px;
    border-radius: var(--radius-pill);
    background: var(--cs-primary);
}

.text-muted { color: var(--cs-muted) !important; }
.text-soft { color: var(--cs-text-soft) !important; }
.text-primary { color: var(--cs-primary) !important; }
.text-success { color: var(--cs-success) !important; }
.text-warning { color: var(--cs-warning) !important; }
.text-danger { color: var(--cs-danger) !important; }
.text-center { text-align: center !important; }

/* Header and navigation */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
    border-bottom: 1px solid transparent;
    background: rgba(11, 15, 26, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition:
        border-color var(--transition),
        background var(--transition),
        box-shadow var(--transition);
}

.site-header.is-scrolled {
    border-bottom-color: var(--cs-border);
    background: rgba(7, 10, 18, 0.94);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.site-header__inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.72rem;
    flex-shrink: 0;
}

.brand__mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(163, 230, 53, 0.35);
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(163, 230, 53, 0.17), rgba(163, 230, 53, 0.05));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.brand__mark svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: var(--cs-primary);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.brand__text {
    color: var(--cs-text);
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.brand__text span {
    color: var(--cs-primary);
}

.primary-nav {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
}

.primary-nav__link {
    position: relative;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    color: var(--cs-muted);
    font-size: 0.92rem;
    font-weight: 600;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.primary-nav__link:hover,
.primary-nav__link.is-active {
    color: var(--cs-text);
    background: rgba(255, 255, 255, 0.04);
}

.primary-nav__link.is-active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 2px;
    width: 18px;
    height: 2px;
    border-radius: var(--radius-pill);
    background: var(--cs-primary);
    transform: translateX(-50%);
}

.primary-nav__actions {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-left: 0.8rem;
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--cs-border);
    border-radius: var(--radius-md);
    background: var(--cs-surface);
}

.nav-toggle span {
    width: 20px;
    height: 2px;
    display: block;
    margin: 4px auto;
    border-radius: var(--radius-pill);
    background: var(--cs-text);
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.55rem 0.35rem 0.35rem;
    border: 1px solid var(--cs-border);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.025);
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.user-chip:hover {
    border-color: var(--cs-border-strong);
    background: var(--cs-primary-soft);
}

.user-chip__avatar {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    background: var(--cs-primary);
    color: #111a08;
    font-size: 0.78rem;
    font-weight: 800;
}

.user-chip__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-chip__name {
    max-width: 120px;
    overflow: hidden;
    color: var(--cs-text-soft);
    font-size: 0.84rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Buttons */
.btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.78rem 1.15rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    transition:
        transform var(--transition-fast),
        background var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast),
        box-shadow var(--transition-fast);
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.btn--primary {
    border-color: var(--cs-primary);
    background: var(--cs-primary);
    color: #111a08;
    box-shadow: var(--shadow-primary);
}

.btn--primary:hover {
    border-color: var(--cs-primary-hover);
    background: var(--cs-primary-hover);
}

.btn--secondary {
    border-color: var(--cs-border-strong);
    background: var(--cs-primary-soft);
    color: var(--cs-primary);
}

.btn--secondary:hover {
    border-color: var(--cs-primary);
    background: rgba(163, 230, 53, 0.18);
}

.btn--ghost {
    border-color: var(--cs-border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--cs-text-soft);
}

.btn--ghost:hover {
    border-color: rgba(148, 163, 184, 0.32);
    background: rgba(255, 255, 255, 0.055);
    color: var(--cs-text);
}

.btn--danger {
    border-color: rgba(239, 68, 68, 0.3);
    background: var(--cs-danger-soft);
    color: #fca5a5;
}

.btn--sm {
    min-height: 38px;
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
}

.btn--lg {
    min-height: 52px;
    padding: 0.95rem 1.45rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
}

.btn--block {
    width: 100%;
}

/* Cards */
.card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--cs-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(145deg, rgba(18, 27, 43, 0.97), rgba(16, 23, 37, 0.97));
    box-shadow: var(--shadow-sm);
}

.card--interactive {
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.card--interactive:hover {
    transform: translateY(-5px);
    border-color: var(--cs-border-strong);
    box-shadow: var(--shadow-md);
}

.card__header,
.card__body,
.card__footer {
    padding: 1.35rem;
}

.card__header {
    border-bottom: 1px solid var(--cs-border);
}

.card__footer {
    border-top: 1px solid var(--cs-border);
}

.card__title {
    font-size: 1.1rem;
}

.card__description {
    margin-top: 0.55rem;
    font-size: 0.92rem;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.72rem;
    border: 1px solid var(--cs-border);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.025);
    color: var(--cs-text-soft);
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.01em;
}

.badge--primary {
    border-color: rgba(163, 230, 53, 0.28);
    background: var(--cs-primary-soft);
    color: var(--cs-primary);
}

.badge--success {
    border-color: rgba(34, 197, 94, 0.28);
    background: var(--cs-success-soft);
    color: #86efac;
}

.badge--warning {
    border-color: rgba(245, 158, 11, 0.28);
    background: var(--cs-warning-soft);
    color: #fcd34d;
}

.badge--danger {
    border-color: rgba(239, 68, 68, 0.28);
    background: var(--cs-danger-soft);
    color: #fca5a5;
}

.badge--info {
    border-color: rgba(56, 189, 248, 0.28);
    background: var(--cs-info-soft);
    color: #7dd3fc;
}

/* Forms */
.form-group {
    display: grid;
    gap: 0.5rem;
}

.form-label {
    color: var(--cs-text-soft);
    font-size: 0.88rem;
    font-weight: 700;
}

.form-help {
    color: var(--cs-muted-2);
    font-size: 0.8rem;
}

.form-control,
.form-select,
.form-textarea {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--cs-border);
    border-radius: var(--radius-md);
    background: #0c1320;
    color: var(--cs-text);
    padding: 0.78rem 0.92rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

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

.form-control::placeholder,
.form-textarea::placeholder {
    color: #536176;
}

.form-control:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: rgba(148, 163, 184, 0.28);
}

.form-control:focus,
.form-select:focus,
.form-textarea:focus {
    outline: 0;
    border-color: var(--cs-primary);
    background: #0e1624;
    box-shadow: 0 0 0 4px var(--cs-primary-ring);
}

.form-control.is-invalid,
.form-select.is-invalid,
.form-textarea.is-invalid {
    border-color: var(--cs-danger);
}

.form-error {
    color: #fca5a5;
    font-size: 0.82rem;
}

.checkbox,
.radio {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.65rem;
    color: var(--cs-text-soft);
    cursor: pointer;
}

.checkbox input,
.radio input {
    width: 18px;
    height: 18px;
    margin-top: 0.18rem;
    accent-color: var(--cs-primary);
}

/* Alerts and Django messages */
.flash-stack {
    position: fixed;
    top: calc(var(--header-height) + 18px);
    left: 50%;
    z-index: 1100;
    width: min(calc(100% - 32px), 720px);
    display: grid;
    gap: 0.75rem;
    transform: translateX(-50%);
    pointer-events: none;
}

.alert {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem 1rem;
    border: 1px solid var(--cs-border);
    border-radius: var(--radius-md);
    background: rgba(16, 23, 37, 0.97);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(14px);
    pointer-events: auto;
    animation: alert-in 240ms ease both;
    transition: opacity 180ms ease, transform 180ms ease;
}

.alert.is-leaving {
    opacity: 0;
    transform: translateY(-8px);
}

.alert__icon {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--cs-info-soft);
    color: var(--cs-info);
    font-weight: 800;
}

.alert__content {
    color: var(--cs-text-soft);
    font-size: 0.9rem;
}

.alert__close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--cs-muted);
    font-size: 1.2rem;
}

.alert__close:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--cs-text);
}

.alert--success { border-color: rgba(34, 197, 94, 0.28); }
.alert--success .alert__icon { background: var(--cs-success-soft); color: var(--cs-success); }
.alert--warning { border-color: rgba(245, 158, 11, 0.28); }
.alert--warning .alert__icon { background: var(--cs-warning-soft); color: var(--cs-warning); }
.alert--error,
.alert--danger { border-color: rgba(239, 68, 68, 0.28); }
.alert--error .alert__icon,
.alert--danger .alert__icon { background: var(--cs-danger-soft); color: var(--cs-danger); }

/* Breadcrumb */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    color: var(--cs-muted);
    font-size: 0.84rem;
}

.breadcrumb a:hover {
    color: var(--cs-primary);
}

.breadcrumb__separator {
    color: #465268;
}

.breadcrumb__current {
    color: var(--cs-text-soft);
}

/* Progress */
.progress {
    width: 100%;
    height: 10px;
    overflow: hidden;
    border-radius: var(--radius-pill);
    background: #080d16;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.09);
}

.progress__bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--cs-primary-strong), var(--cs-primary));
    box-shadow: 0 0 18px rgba(163, 230, 53, 0.35);
    transition: width 500ms ease;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--cs-border);
    border-radius: var(--radius-lg);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(16, 23, 37, 0.65);
}

.table th,
.table td {
    padding: 0.95rem 1rem;
    border-bottom: 1px solid var(--cs-border);
    text-align: left;
    vertical-align: middle;
}

.table th {
    color: var(--cs-text-soft);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.table td {
    color: var(--cs-muted);
    font-size: 0.9rem;
}

.table tbody tr:last-child td {
    border-bottom: 0;
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
}

/* Empty state */
.empty-state {
    padding: clamp(2.5rem, 6vw, 5rem) 1.5rem;
    border: 1px dashed rgba(148, 163, 184, 0.22);
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.015);
    text-align: center;
}

.empty-state__icon {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    margin: 0 auto 1.1rem;
    border: 1px solid var(--cs-border-strong);
    border-radius: 18px;
    background: var(--cs-primary-soft);
    color: var(--cs-primary);
    font-size: 1.7rem;
}

.empty-state p {
    max-width: 520px;
    margin: 0.7rem auto 0;
}

/* Code */
code,
kbd,
samp,
pre {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

code {
    padding: 0.16rem 0.38rem;
    border: 1px solid rgba(148, 163, 184, 0.13);
    border-radius: 6px;
    background: #080d16;
    color: #c4f47f;
    font-size: 0.88em;
}

pre {
    overflow-x: auto;
    padding: 1rem 1.1rem;
    border: 1px solid var(--cs-border);
    border-radius: var(--radius-md);
    background: #070b12;
    color: #dce8f7;
    line-height: 1.7;
}

pre code {
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
}

/* Dividers */
.divider {
    width: 100%;
    height: 1px;
    border: 0;
    background: var(--cs-border);
}

/* Footer */
.site-footer {
    position: relative;
    margin-top: clamp(4rem, 8vw, 7rem);
    border-top: 1px solid var(--cs-border);
    background: rgba(7, 10, 18, 0.75);
}

.site-footer::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 12% 0%, rgba(163, 230, 53, 0.06), transparent 24rem);
}

.site-footer__grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(280px, 1.8fr) repeat(3, minmax(130px, 0.7fr));
    gap: 2.5rem;
    padding-block: 4rem 3rem;
}

.site-footer__brand p {
    max-width: 470px;
    margin-top: 1rem;
    font-size: 0.92rem;
}

.site-footer__column {
    display: grid;
    align-content: start;
    gap: 0.7rem;
}

.site-footer__column h2 {
    margin-bottom: 0.25rem;
    color: var(--cs-text-soft);
    font-size: 0.88rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.site-footer__column a {
    width: fit-content;
    color: var(--cs-muted);
    font-size: 0.88rem;
}

.site-footer__column a:hover {
    color: var(--cs-primary);
}

.site-footer__bottom {
    position: relative;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-top: 1px solid var(--cs-border);
}

.site-footer__bottom p {
    font-size: 0.82rem;
}

.site-footer__status {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.site-footer__status span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cs-success);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.65);
}

/* Utilities */
.w-full { width: 100% !important; }
.h-full { height: 100% !important; }
.min-w-0 { min-width: 0 !important; }
.hidden { display: none !important; }
.block { display: block !important; }
.inline-flex { display: inline-flex !important; }
.flex { display: flex !important; }
.items-center { align-items: center !important; }
.items-start { align-items: flex-start !important; }
.justify-between { justify-content: space-between !important; }
.justify-center { justify-content: center !important; }
.flex-wrap { flex-wrap: wrap !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 0.75rem !important; }
.gap-4 { gap: 1rem !important; }
.gap-6 { gap: 1.5rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 0.75rem !important; }
.mt-4 { margin-top: 1rem !important; }
.mt-6 { margin-top: 1.5rem !important; }
.mt-8 { margin-top: 2rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-4 { margin-bottom: 1rem !important; }
.p-0 { padding: 0 !important; }
.p-4 { padding: 1rem !important; }
.p-6 { padding: 1.5rem !important; }
.rounded { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.border { border: 1px solid var(--cs-border) !important; }

/* Animations */
@keyframes alert-in {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(0.82); }
}

.animate-pulse-dot {
    animation: pulse-dot 1.8s ease-in-out infinite;
}

/* Responsive */
@media (max-width: 1100px) {
    .grid--4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .site-footer__grid {
        grid-template-columns: minmax(260px, 1.5fr) repeat(2, minmax(140px, 0.7fr));
    }

    .site-footer__column:last-child {
        grid-column: 2;
    }
}

@media (max-width: 900px) {
    :root {
        --header-height: 68px;
    }

    .nav-toggle {
        display: block;
    }

    .primary-nav {
        position: fixed;
        top: var(--header-height);
        right: 0;
        bottom: 0;
        width: min(88vw, 390px);
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0.35rem;
        padding: 1rem;
        border-left: 1px solid var(--cs-border);
        background: rgba(7, 10, 18, 0.98);
        box-shadow: -24px 0 60px rgba(0, 0, 0, 0.42);
        transform: translateX(105%);
        visibility: hidden;
        transition: transform var(--transition), visibility var(--transition);
        overflow-y: auto;
    }

    .primary-nav.is-open {
        transform: translateX(0);
        visibility: visible;
    }

    .primary-nav__link {
        padding: 0.9rem 1rem;
    }

    .primary-nav__link.is-active::after {
        left: 1rem;
        bottom: 0.35rem;
        transform: none;
    }

    .primary-nav__actions {
        display: grid;
        gap: 0.75rem;
        margin: 1rem 0 0;
        padding-top: 1rem;
        border-top: 1px solid var(--cs-border);
    }

    .primary-nav__actions .btn,
    .primary-nav__actions .user-chip {
        width: 100%;
        justify-content: center;
    }

    .grid--3,
    .grid--2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .container,
    .container--narrow,
    .container--wide {
        width: min(calc(100% - 28px), var(--container));
    }

    .section {
        padding-block: 3.6rem;
    }

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

    .site-footer__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2rem 1.5rem;
        padding-block: 3rem 2.5rem;
    }

    .site-footer__brand {
        grid-column: 1 / -1;
    }

    .site-footer__column:last-child {
        grid-column: auto;
    }

    .site-footer__bottom {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        padding-block: 1rem;
    }

    .card__header,
    .card__body,
    .card__footer {
        padding: 1.1rem;
    }
}

@media (max-width: 480px) {
    .brand__text {
        font-size: 1.18rem;
    }

    .brand__mark {
        width: 35px;
        height: 35px;
    }

    .site-footer__grid {
        grid-template-columns: 1fr;
    }

    .site-footer__brand {
        grid-column: auto;
    }

    .flash-stack {
        top: calc(var(--header-height) + 10px);
    }

    .alert {
        align-items: start;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media print {
    .site-header,
    .site-footer,
    .flash-stack,
    .btn,
    .nav-toggle {
        display: none !important;
    }

    body {
        background: #fff;
        color: #111;
    }

    .site-main {
        display: block;
    }
}