@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

/* ─── Design Tokens ───────────────────────────────────────────── */
:root {
    /* Palette — Warm-tinted neutrals with a teal accent */
    --surface-50:  #fafaf9;
    --surface-100: #f5f4f2;
    --surface-200: #e8e6e3;
    --surface-300: #d4d1cc;
    --surface-400: #a8a29e;
    --surface-500: #78716c;
    --surface-600: #57534e;
    --surface-700: #44403c;
    --surface-800: #292524;
    --surface-900: #1c1917;

    --accent:        #0d9488;
    --accent-hover:  #0f766e;
    --accent-soft:   #ccfbf1;
    --accent-muted:  #99f6e4;

    --info:    #0ea5e9;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger:  #ef4444;

    --text-primary:   var(--surface-900);
    --text-secondary: var(--surface-500);
    --text-muted:     var(--surface-400);

    /* Sidebar */
    --sidebar-bg:     #1a1d23;
    --sidebar-hover:  rgba(255,255,255,0.06);
    --sidebar-active: rgba(13,148,136,0.18);
    --sidebar-text:   #a1a1aa;
    --sidebar-text-active: #f4f4f5;
    --sidebar-width:  260px;

    /* Type */
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;

    /* Radius */
    --radius-sm: 6px;
    --radius:    8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Shadows */
    --shadow-xs:  0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:  0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg:  0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --duration: 200ms;
}

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

html, body {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--surface-100);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--surface-800);
    letter-spacing: -0.01em;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3, h5 { font-size: 1.125rem; }
h4, h6 { font-size: 0.9375rem; }

*:focus { outline: none; }

a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.nav-link:focus-visible,
.page-link:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(13,148,136,0.35);
    border-radius: var(--radius-sm);
}

h1:focus-visible,
h2:focus-visible,
h3:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: 4px;
}

a, .btn-link {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--duration) var(--ease-out);
}
a:hover, .btn-link:hover {
    color: var(--accent-hover);
}

code, pre {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
}

pre {
    background: var(--surface-900);
    color: #e2e8f0;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    overflow-x: auto;
    line-height: 1.65;
}

code {
    background: var(--surface-200);
    color: var(--surface-700);
    padding: 0.125em 0.35em;
    border-radius: 4px;
    font-size: 0.85em;
}

pre code {
    background: none;
    color: inherit;
    padding: 0;
}

hr {
    border: none;
    border-top: 1px solid var(--surface-200);
    margin: 1.5rem 0;
}

/* ─── Content Area ────────────────────────────────────────────── */
.content {
    padding-top: 0;
}

.container-fluid {
    max-width: 1440px;
}

/* ─── Page Header ─────────────────────────────────────────────── */
.page-header {
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--surface-200);
    position: relative;
}

.page-header h1 {
    margin-bottom: 0.25rem;
    font-size: clamp(1.625rem, 2.4vw, 2rem);
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--surface-900);
    line-height: 1.15;
}

.page-header h1 em {
    font-style: normal;
    color: var(--accent);
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.85em;
    letter-spacing: -0.01em;
}

.page-header .lead,
.page-header .text-muted {
    color: var(--text-secondary) !important;
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* Mono uppercase kicker shared across pages (Landing vocabulary). */
.page-kicker {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.625rem;
}

/* Section eyebrows — smaller, for intra-page section labels. */
.section-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Footer rail (mono labels with border). */
.page-footer-rail {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding-top: 1rem;
    border-top: 1px solid var(--surface-200);
    margin-top: 2rem;
}

/* Reusable dark panel with teal glow + subtle grid (same as Landing brand panel). */
.panel-dark {
    position: relative;
    background: var(--sidebar-bg);
    color: #e4e4e7;
    border-radius: var(--radius-lg);
    padding: clamp(1.5rem, 3vw, 2.25rem);
    overflow: hidden;
    isolation: isolate;
    border: 1px solid #111418;
}

.panel-dark::before {
    content: "";
    position: absolute;
    inset: -30% -20% auto auto;
    width: 420px;
    height: 420px;
    background: radial-gradient(closest-side, rgba(13,148,136,0.32), transparent 70%);
    filter: blur(4px);
    z-index: -1;
    pointer-events: none;
}

.panel-dark::after {
    content: "";
    position: absolute;
    inset: auto -30% -40% -20%;
    height: 320px;
    background:
        linear-gradient(transparent 0 calc(100% - 1px), rgba(255,255,255,0.04) calc(100% - 1px)) 0 0 / 100% 48px,
        linear-gradient(to right, transparent 0 calc(100% - 1px), rgba(255,255,255,0.04) calc(100% - 1px)) 0 0 / 48px 100%;
    mask-image: radial-gradient(circle at 0% 100%, rgba(0,0,0,0.8), transparent 70%);
    z-index: -1;
    pointer-events: none;
}

.panel-dark h1, .panel-dark h2, .panel-dark h3, .panel-dark h4 {
    color: #f4f4f5;
}

.panel-dark .panel-kicker {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-muted);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.panel-dark .panel-kicker::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34,197,94,0.2);
}

/* Hero stat strip — matches Landing's brand-stats. */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--surface-200);
    margin-top: 1.25rem;
}

.panel-dark .hero-stats {
    border-top-color: rgba(255,255,255,0.08);
}

.hero-stat-label {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.panel-dark .hero-stat-label { color: #71717a; }

.hero-stat-value {
    font-family: var(--font-mono);
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--surface-900);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.panel-dark .hero-stat-value { color: #f4f4f5; }

.display-4 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.display-5 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.lead {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ─── Cards ───────────────────────────────────────────────────── */
.card {
    background: #fff;
    border: 1px solid var(--surface-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    transition: box-shadow var(--duration) var(--ease-out);
}

.card:hover {
    box-shadow: var(--shadow-sm);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--surface-200);
    padding: 0.875rem 1.25rem;
    font-weight: 600;
}

.card-header h5,
.card-header h6 {
    margin-bottom: 0;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--surface-600);
}

.card-header.bg-primary,
.card-header.bg-secondary,
.card-header.bg-dark,
.card-header.bg-info {
    background: var(--surface-800) !important;
    color: var(--surface-50) !important;
    border-bottom-color: var(--surface-700);
}

.card-header.bg-primary h5,
.card-header.bg-primary h6,
.card-header.bg-secondary h5,
.card-header.bg-secondary h6,
.card-header.bg-dark h5,
.card-header.bg-dark h6,
.card-header.bg-info h5,
.card-header.bg-info h6 {
    color: var(--surface-50) !important;
}

.card-body {
    padding: 1.25rem;
}

/* ─── Metric Cards (Dashboard) ────────────────────────────────── */
/* Flat, restrained KPIs. Accent only on the primary metric via a left rule.
   Color lives in the small helper classes (.metric-accent-*) if you want to
   flag a specific card without repainting the whole surface. */
.card.text-white.bg-info,
.card.text-white.bg-primary,
.card.text-white.bg-success,
.card.text-white.bg-danger {
    background: #fff !important;
    color: var(--surface-800) !important;
    border: 1px solid var(--surface-200);
    position: relative;
    overflow: hidden;
}

.card.text-white.bg-primary {
    box-shadow: inset 3px 0 0 var(--accent), var(--shadow-xs);
}
.card.text-white.bg-info    { box-shadow: inset 3px 0 0 var(--info),    var(--shadow-xs); }
.card.text-white.bg-success { box-shadow: inset 3px 0 0 var(--success), var(--shadow-xs); }
.card.text-white.bg-danger  { box-shadow: inset 3px 0 0 var(--surface-300), var(--shadow-xs); }

.card.text-white .card-body h6 {
    color: var(--text-secondary) !important;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
    margin-bottom: 0.625rem;
}

.card.text-white .card-body h2 {
    color: var(--surface-900) !important;
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.card.text-white .card-body small {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

/* Failed card goes "hot" only when the value is non-zero (fallback: leave
   styling to the markup; see .metric-alert modifier). */
.card.text-white.bg-danger.metric-alert {
    box-shadow: inset 3px 0 0 var(--danger), var(--shadow-xs);
}
.card.text-white.bg-danger.metric-alert .card-body h2 {
    color: var(--danger) !important;
}

/* ─── Tables ──────────────────────────────────────────────────── */
.table {
    font-size: 0.8125rem;
    margin-bottom: 0;
    --bs-table-bg: transparent;
    font-variant-numeric: tabular-nums;
}

.table > thead > tr > th {
    background: var(--surface-100);
    border-bottom: 2px solid var(--surface-200);
    padding: 0.625rem 0.75rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--surface-500);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}

.table > tbody > tr > td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--surface-100);
    vertical-align: middle;
    color: var(--surface-700);
}

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

.table-hover > tbody > tr:hover > td {
    background: var(--surface-50);
}

/* Table status rows */
.table > tbody > tr.table-success > td { background: #f0fdf4; }
.table > tbody > tr.table-danger > td  { background: #fef2f2; }
.table > tbody > tr.table-warning > td { background: #fffbeb; }

/* Compact detail tables inside cards */
.table-sm > tbody > tr > td {
    padding: 0.375rem 0.5rem;
}

.table-bordered {
    border: 1px solid var(--surface-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.table-bordered > :not(caption) > * > * {
    border-width: 0;
    border-bottom: 1px solid var(--surface-100);
}

.table-bordered > tbody > tr > th {
    background: var(--surface-50);
    color: var(--surface-500);
    font-weight: 500;
    font-size: 0.8125rem;
    white-space: nowrap;
}

.table-borderless > tbody > tr > td {
    border-bottom: 1px solid var(--surface-100);
}

/* ─── Buttons ─────────────────────────────────────────────────── */
.btn {
    font-family: var(--font-body);
    font-weight: 500;
    border-radius: var(--radius);
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    transition: all var(--duration) var(--ease-out);
    border: 1px solid transparent;
    letter-spacing: 0.01em;
}

.btn-sm {
    padding: 0.3125rem 0.625rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.625rem 1.375rem;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(13,148,136,0.15);
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}
.btn-success:hover { background: #16a34a; border-color: #16a34a; color: #fff; }

.btn-warning {
    background: var(--warning);
    border-color: var(--warning);
    color: var(--surface-900);
}
.btn-warning:hover { background: #d97706; border-color: #d97706; }

.btn-outline-primary {
    color: var(--accent);
    border-color: var(--surface-300);
}
.btn-outline-primary:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent-hover);
}

.btn-outline-secondary {
    color: var(--surface-600);
    border-color: var(--surface-300);
}
.btn-outline-secondary:hover {
    background: var(--surface-100);
    border-color: var(--surface-400);
    color: var(--surface-800);
}

.btn-outline-success {
    color: var(--success);
    border-color: var(--surface-300);
}
.btn-outline-success:hover {
    background: #f0fdf4;
    border-color: var(--success);
    color: #16a34a;
}

.btn-secondary {
    background: var(--surface-200);
    border-color: var(--surface-200);
    color: var(--surface-700);
}
.btn-secondary:hover { background: var(--surface-300); border-color: var(--surface-300); }

/* Outline light: for use on .panel-dark and other dark surfaces. */
.btn-outline-light {
    color: #e4e4e7;
    border-color: rgba(255,255,255,0.18);
    background: transparent;
}
.btn-outline-light:hover,
.btn-outline-light:focus {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.32);
    color: #fff;
}

/* ─── Badges ──────────────────────────────────────────────────── */
.badge {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.6875rem;
    letter-spacing: 0.03em;
    padding: 0.25em 0.625em;
    border-radius: 100px;
}

.badge.bg-primary { background: var(--accent) !important; }
.badge.bg-info    { background: var(--info) !important; }
.badge.bg-success { background: var(--success) !important; }
.badge.bg-danger  { background: var(--danger) !important; }
.badge.bg-warning { background: var(--warning) !important; color: var(--surface-900) !important; }
.badge.bg-secondary { background: var(--surface-200) !important; color: var(--surface-600) !important; }
.badge.bg-dark    { background: var(--surface-800) !important; }

.badge.bg-light {
    background: var(--surface-100) !important;
    color: var(--surface-600) !important;
    border: 1px solid var(--surface-200);
}

/* ─── Form Controls ───────────────────────────────────────────── */
.form-control, .form-select {
    font-family: var(--font-body);
    font-size: 0.8125rem;
    border: 1px solid var(--surface-300);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    color: var(--surface-800);
    background: #fff;
    transition: border-color var(--duration) var(--ease-out),
                box-shadow var(--duration) var(--ease-out);
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(13,148,136,0.1);
    outline: none;
}

.form-control-sm, .form-select-sm {
    font-size: 0.75rem;
    padding: 0.375rem 0.625rem;
}

.form-label {
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--surface-600);
    margin-bottom: 0.375rem;
}

.form-label.fw-bold {
    font-weight: 600;
    color: var(--surface-700);
}

.form-range {
    accent-color: var(--accent);
}

.input-group-text {
    background: var(--surface-100);
    border-color: var(--surface-300);
    color: var(--surface-500);
    font-size: 0.8125rem;
}

/* ─── Alerts ──────────────────────────────────────────────────── */
.alert {
    border-radius: var(--radius);
    border: 1px solid;
    font-size: 0.8125rem;
    padding: 0.75rem 1rem;
}

.alert-info {
    background: #f0f9ff;
    border-color: #bae6fd;
    color: #0369a1;
}

.alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.alert-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.alert-secondary {
    background: var(--surface-50);
    border-color: var(--surface-200);
    color: var(--surface-600);
}

/* ─── Progress Bars ───────────────────────────────────────────── */
.progress {
    border-radius: 100px;
    background: var(--surface-200);
    overflow: hidden;
}

.progress-bar {
    font-size: 0.6875rem;
    font-weight: 500;
    transition: width 600ms var(--ease-out);
}

.progress-bar.bg-primary { background: var(--accent) !important; }
.progress-bar.bg-info    { background: var(--info) !important; }

/* ─── Tabs ────────────────────────────────────────────────────── */
.nav-tabs {
    border-bottom: 2px solid var(--surface-200);
}

.nav-tabs .nav-link {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--surface-500);
    border: none;
    padding: 0.625rem 1rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--duration) var(--ease-out);
}

.nav-tabs .nav-link:hover {
    color: var(--surface-800);
    border-bottom-color: var(--surface-300);
}

.nav-tabs .nav-link.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: transparent;
}

.tab-content {
    border-radius: 0 0 var(--radius) var(--radius);
    border-color: var(--surface-200) !important;
}

/* ─── Pagination ──────────────────────────────────────────────── */
.pagination {
    gap: 0.25rem;
}

.page-link {
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--surface-200);
    color: var(--surface-600);
    padding: 0.375rem 0.75rem;
}

.page-link:hover {
    background: var(--surface-100);
    border-color: var(--surface-300);
    color: var(--surface-800);
}

.page-item.active .page-link {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.page-item.disabled .page-link {
    background: var(--surface-50);
    border-color: var(--surface-200);
    color: var(--surface-400);
}

/* ─── Modal ───────────────────────────────────────────────────── */
.modal-content {
    border-radius: var(--radius-xl);
    border: none;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,0.04);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--surface-200);
    padding: 1.25rem 1.5rem;
}

.modal-header .modal-title {
    font-size: 1rem;
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--surface-200);
    padding: 1rem 1.5rem;
}

/* ─── Borders for E2E steps ───────────────────────────────────── */
.border-success { border-color: var(--success) !important; }
.border-danger  { border-color: var(--danger) !important; }
.border-warning { border-color: var(--warning) !important; }
.border-2 { border-width: 2px !important; }

/* ─── Spinner ─────────────────────────────────────────────────── */
.spinner-border {
    color: var(--accent);
}

.text-primary .spinner-border,
.btn-warning .spinner-border {
    color: inherit;
}

/* ─── Validation States ───────────────────────────────────────── */
.valid.modified:not([type=checkbox]) {
    outline: none;
    border-color: var(--success);
    box-shadow: 0 0 0 3px rgba(34,197,94,0.1);
}

.invalid {
    outline: none;
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}

.validation-message {
    color: var(--danger);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* ─── Error UI ────────────────────────────────────────────────── */
#blazor-error-ui {
    background: #fef2f2;
    border-top: 2px solid var(--danger);
    bottom: 0;
    display: none;
    left: 0;
    padding: 0.75rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-size: 0.8125rem;
    color: #991b1b;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: var(--danger);
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: var(--radius);
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* ─── Utility Overrides ───────────────────────────────────────── */
.text-muted { color: var(--text-secondary) !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-primary { color: var(--accent) !important; }
.text-info { color: var(--info) !important; }

.bg-light { background: var(--surface-50) !important; }

small, .small { font-size: 0.8125rem; }

/* ─── Animations ──────────────────────────────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Page reveal animation — opt-in via `.page-reveal` on a wrapper, so it
   doesn't replay on every Blazor re-render of rows inside a .container-fluid. */
.page-reveal > * {
    animation: fadeInUp 360ms var(--ease-out) both;
}
.page-reveal > *:nth-child(2) { animation-delay: 40ms; }
.page-reveal > *:nth-child(3) { animation-delay: 80ms; }
.page-reveal > *:nth-child(4) { animation-delay: 120ms; }
.page-reveal > *:nth-child(5) { animation-delay: 160ms; }

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

/* ─── Scrollbar ───────────────────────────────────────────────── */
:root {
    scrollbar-width: thin;
    scrollbar-color: var(--surface-300) transparent;
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--surface-300);
    border-radius: 100px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--surface-400);
}

/* ─── Status dot (for live indicators) ────────────────────────── */
.status-dot {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--surface-600);
    letter-spacing: 0.02em;
}

.status-dot::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--surface-400);
    box-shadow: 0 0 0 3px var(--surface-200);
}

.status-dot.is-running { color: var(--surface-800); }
.status-dot.is-running::before {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(34,197,94,0.18);
    animation: status-pulse 1.8s var(--ease-out) infinite;
}

.status-dot.is-paused::before    { background: var(--surface-400); box-shadow: 0 0 0 3px var(--surface-200); }
.status-dot.is-pausing { color: var(--warning); }
.status-dot.is-pausing::before   { background: var(--warning); box-shadow: 0 0 0 3px rgba(245,158,11,0.2); }

@keyframes status-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(34,197,94,0.18); }
    50%      { box-shadow: 0 0 0 5px rgba(34,197,94,0.08); }
}

/* Stable-width action buttons to avoid layout shift on label changes. */
.btn-action {
    min-width: 7rem;
    justify-content: center;
}

/* Numeric polish for metric headings anywhere in the app. */
h1, h2, h3,
.metric-num,
.card .card-body h2 {
    font-variant-numeric: tabular-nums;
}

/* ─── Table Responsive ────────────────────────────────────────── */
.table-responsive {
    border-radius: var(--radius);
    border: 1px solid var(--surface-200);
    overflow: auto;
}

.table-responsive > .table {
    margin-bottom: 0;
}
