:root {
    --sidebar-width: 244px;
    --sidebar-collapsed-width: 68px;
    --header-height: 56px;

    --admin-bg: #f4f6f9;
    --admin-surface: #ffffff;
    --admin-surface-muted: #fafbfc;
    --admin-border: #e4e7ec;
    --admin-border-soft: #eef0f4;
    --admin-border-strong: #d6d9e0;

    --admin-text: #0f1729;
    --admin-text-strong: #0a0f1c;
    --admin-text-muted: #5b6373;
    --admin-text-subtle: #8a90a0;
    --admin-text-faint: #aab0bd;

    --admin-accent: #3b5bdb;
    --admin-accent-hover: #2f4ac0;
    --admin-accent-soft: #eef0fb;
    --admin-accent-soft-strong: #d8def5;

    --tone-positive: #047a55;
    --tone-positive-bg: #e8f6f0;
    --tone-warning: #946000;
    --tone-warning-bg: #fdf3e1;
    --tone-critical: #b1322c;
    --tone-critical-bg: #fdeaea;
    --tone-neutral: #475467;
    --tone-neutral-bg: #f1f3f7;

    --shadow-card: 0 1px 0 rgba(15, 23, 41, 0.02), 0 1px 2px rgba(15, 23, 41, 0.04);
    --shadow-elevated: 0 4px 12px rgba(15, 23, 41, 0.06), 0 1px 2px rgba(15, 23, 41, 0.04);

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius-xl: 12px;

    /* Typography scale */
    --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    --font-mono: 'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, monospace;

    --fs-body: 13px;
    --fs-small: 12px;
    --fs-tiny: 11.5px;
    --fs-h1: 22px;
    --fs-h2: 16px;
    --fs-h3: 15px;
    --fs-metric: 24px;

    --lh-base: 1.5;
    --lh-tight: 1.25;
    --lh-flat: 1.1;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--fs-body);
    line-height: var(--lh-base);
    color: var(--admin-text);
    background-color: var(--admin-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    color: var(--admin-text-strong);
    letter-spacing: -0.01em;
}

a {
    color: var(--admin-accent);
    text-decoration: none;
}

a:hover {
    color: var(--admin-accent-hover);
}

code {
    font-family: var(--font-mono);
    font-size: var(--fs-small);
    background: var(--admin-surface-muted);
    border: 1px solid var(--admin-border-soft);
    color: var(--admin-text);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
}

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

.admin-main {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.18s ease;
    display: flex;
    flex-direction: column;
}

.admin-shell.is-sidebar-collapsed .admin-main {
    margin-left: var(--sidebar-collapsed-width);
}

.admin-content {
    padding: 24px 28px 32px;
    flex: 1;
}

/* Sidebar */
.admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    background: var(--admin-surface);
    border-right: 1px solid var(--admin-border-soft);
    display: flex;
    flex-direction: column;
    transition: width 0.18s ease, transform 0.2s ease;
    z-index: 1030;
}

.admin-shell.is-sidebar-collapsed .admin-sidebar {
    width: var(--sidebar-collapsed-width);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--header-height);
    padding: 0 18px;
    border-bottom: 1px solid var(--admin-border-soft);
    color: var(--admin-text-strong);
    text-decoration: none;
    font-weight: 600;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.brand-logo img {
    max-height: 24px;
    width: auto;
    display: block;
}

.brand-logo-icon {
    display: none;
}

.brand-logo-icon img {
    max-height: 22px;
}

.logo-placeholder {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--admin-accent-soft);
    color: var(--admin-accent);
    font-weight: 700;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.logo-placeholder.small {
    width: 22px;
    height: 22px;
    font-size: 11px;
    border-radius: 6px;
}

.brand-meta {
    margin-left: auto;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    color: var(--admin-text-subtle);
    background: var(--admin-surface-muted);
    border: 1px solid var(--admin-border-soft);
    padding: 2px 7px;
    border-radius: 999px;
}

.admin-shell.is-sidebar-collapsed .brand {
    justify-content: center;
    padding: 0;
}

.admin-shell.is-sidebar-collapsed .brand-logo-full,
.admin-shell.is-sidebar-collapsed .brand-meta {
    display: none;
}

.admin-shell.is-sidebar-collapsed .brand-logo-icon {
    display: inline-flex;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scrollbar-width: thin;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.sidebar-section-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--admin-text-faint);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 6px 12px 4px;
}

.admin-shell.is-sidebar-collapsed .sidebar-section-label {
    visibility: hidden;
    height: 4px;
    padding: 0;
}

.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    margin: 0 2px;
    border-radius: var(--radius-md);
    color: var(--admin-text-muted);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.12s ease, color 0.12s ease;
    white-space: nowrap;
}

.sidebar-link i {
    font-size: 15px;
    width: 18px;
    text-align: center;
    color: var(--admin-text-faint);
    transition: color 0.12s ease;
}

.sidebar-link:hover {
    background: var(--admin-surface-muted);
    color: var(--admin-text-strong);
}

.sidebar-link:hover i {
    color: var(--admin-text-muted);
}

.sidebar-link.active {
    background: var(--admin-accent-soft);
    color: var(--admin-accent-hover);
    font-weight: 600;
}

.sidebar-link.active i {
    color: var(--admin-accent);
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--admin-accent);
}

.sidebar-link.disabled-link {
    cursor: not-allowed;
    color: var(--admin-text-faint);
}

.sidebar-link.disabled-link:hover {
    background: transparent;
    color: var(--admin-text-faint);
}

.sidebar-tag {
    margin-left: auto;
    font-size: 10px;
    font-weight: 600;
    color: var(--admin-text-subtle);
    background: var(--admin-surface-muted);
    border: 1px solid var(--admin-border-soft);
    padding: 1px 6px;
    border-radius: 999px;
    text-transform: none;
    letter-spacing: 0;
}

.admin-shell.is-sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: 8px 0;
}

.admin-shell.is-sidebar-collapsed .sidebar-link span:not(.sidebar-tag),
.admin-shell.is-sidebar-collapsed .sidebar-tag {
    display: none;
}

.admin-shell.is-sidebar-collapsed .sidebar-link.active::before {
    display: none;
}

.sidebar-footer {
    border-top: 1px solid var(--admin-border-soft);
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
}

.sidebar-footer-label {
    color: var(--admin-text-faint);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.sidebar-footer-value {
    color: var(--admin-text-muted);
    font-weight: 500;
    font-feature-settings: 'tnum';
}

.admin-shell.is-sidebar-collapsed .sidebar-footer {
    display: none;
}

/* Header */
.admin-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 0 22px;
    background: var(--admin-surface);
    border-bottom: 1px solid var(--admin-border-soft);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid transparent;
    color: var(--admin-text-muted);
}

.btn-icon:hover {
    background: var(--admin-surface-muted);
    color: var(--admin-text-strong);
}

.header-logo img {
    max-height: 22px;
}

.header-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--admin-bg);
    border: 1px solid var(--admin-border-soft);
    padding: 0 10px;
    border-radius: var(--radius-md);
    min-width: 320px;
    max-width: 440px;
    height: 34px;
    color: var(--admin-text-subtle);
    flex: 1;
    transition: border-color 0.12s ease, background 0.12s ease;
}

.header-search:focus-within {
    background: var(--admin-surface);
    border-color: var(--admin-accent-soft-strong);
    box-shadow: 0 0 0 3px var(--admin-accent-soft);
}

.header-search i {
    font-size: 14px;
}

.header-search input {
    border: 0;
    outline: none;
    background: transparent;
    flex: 1;
    color: var(--admin-text-strong);
    font-size: 13px;
}

.header-search input::placeholder {
    color: var(--admin-text-subtle);
}

.header-search-kbd {
    font-family: var(--font-sans);
    font-size: 10px;
    color: var(--admin-text-subtle);
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 4px;
    padding: 1px 5px;
    box-shadow: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-alert {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.alert-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tone-warning);
    box-shadow: 0 0 0 3px rgba(244, 162, 35, 0.18);
    display: inline-block;
}

.env-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--tone-neutral-bg);
    color: var(--tone-neutral);
    border: 1px solid var(--admin-border-soft);
}

.env-badge.env-local {
    background: var(--tone-warning-bg);
    color: var(--tone-warning);
    border-color: rgba(148, 96, 0, 0.18);
}

.user-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 4px 4px;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid transparent;
    color: var(--admin-text-strong);
    font-weight: 500;
    font-size: 13px;
}

.user-button:hover {
    background: var(--admin-surface-muted);
    border-color: var(--admin-border-soft);
}

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--admin-accent-soft);
    color: var(--admin-accent-hover);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    text-align: left;
}

.user-name {
    font-weight: 600;
    color: var(--admin-text-strong);
    font-size: 12.5px;
}

.user-role {
    font-size: 10.5px;
    color: var(--admin-text-subtle);
    font-weight: 500;
}

/* Page header */
.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--admin-border-soft);
}

.page-header-text {
    min-width: 0;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.page-header h1 {
    margin: 0 0 4px;
    font-size: var(--fs-h1);
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: var(--lh-tight);
    color: var(--admin-text-strong);
}

.page-header p {
    margin: 0;
    color: var(--admin-text-muted);
    font-size: var(--fs-body);
    max-width: 640px;
    line-height: 1.5;
}

/* Buttons */
.btn {
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 13px;
    padding: 6px 12px;
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12.5px;
}

.btn-primary {
    background: var(--admin-text-strong);
    border-color: var(--admin-text-strong);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
    background: #1f2937;
    border-color: #1f2937;
    color: #fff;
}

.btn-light {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    color: var(--admin-text-strong);
}

.btn-light:hover {
    background: var(--admin-surface-muted);
    border-color: var(--admin-border-strong);
    color: var(--admin-text-strong);
}

/* Self-contained ghost button — works with or without Bootstrap .btn.
   Provides its own height, padding, radius, font so removing .btn
   from the markup never produces an unstyled native <button>. */
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid var(--admin-border);
    color: var(--admin-text-strong);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn-ghost.btn-sm,
.btn-ghost-sm {
    height: 30px;
    padding: 0 12px;
    font-size: 12.5px;
}

.btn-ghost:hover,
.btn-ghost:focus {
    background: var(--admin-surface-muted);
    border-color: var(--admin-border-strong);
    color: var(--admin-text-strong);
}

.btn-outline-primary {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    color: var(--admin-text-strong);
}

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

.btn-outline-secondary,
.btn-outline-danger {
    background: var(--admin-surface);
    border-color: var(--admin-border);
    color: var(--admin-text-strong);
}

.btn-outline-danger {
    color: var(--tone-critical);
}

.btn-outline-danger:hover {
    background: var(--tone-critical-bg);
    border-color: var(--tone-critical-bg);
    color: var(--tone-critical);
}

/* Eyebrow */
.eyebrow {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--admin-text-subtle);
    margin-bottom: 6px;
}

/* Summary cards — fixed column layout per breakpoint, no widget chaos */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

@media (max-width: 1199.98px) {
    .summary-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767.98px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 419.98px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
}

.summary-card {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border-soft);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
    position: relative;
}

.summary-card:hover {
    border-color: var(--admin-border);
    box-shadow: var(--shadow-card);
}

.summary-label {
    font-size: var(--fs-small);
    font-weight: 500;
    color: var(--admin-text-muted);
    letter-spacing: 0;
}

.summary-value {
    font-size: var(--fs-metric);
    font-weight: 600;
    color: var(--admin-text-strong);
    letter-spacing: -0.02em;
    font-feature-settings: 'tnum';
    line-height: var(--lh-flat);
    margin-top: 2px;
}

.summary-delta {
    font-size: var(--fs-tiny);
    font-weight: 500;
    color: var(--admin-text-subtle);
}

.summary-card.tone-positive .summary-delta {
    color: var(--tone-positive);
}

.summary-card.tone-warning .summary-delta {
    color: var(--tone-warning);
}

.summary-card.tone-critical .summary-delta {
    color: var(--tone-critical);
}

/* Operations panel */
.ops-panel {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border-soft);
    border-radius: var(--radius-lg);
    padding: 16px 20px 0;
    margin-bottom: 16px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.ops-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.ops-panel-head h2 {
    margin: 0 0 2px;
    font-size: var(--fs-h3);
    font-weight: 600;
    color: var(--admin-text-strong);
    letter-spacing: -0.01em;
}

.ops-panel-head p {
    margin: 0;
    color: var(--admin-text-muted);
    font-size: var(--fs-small);
}

.ops-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin: 0 -20px;
    border-top: 1px solid var(--admin-border-soft);
}

@media (max-width: 991.98px) {
    .ops-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575.98px) {
    .ops-grid {
        grid-template-columns: 1fr;
    }
}

.ops-item {
    padding: 12px 20px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--admin-surface);
    position: relative;
}

.ops-grid > .ops-item:not(:nth-child(3n)) {
    border-right: 1px solid var(--admin-border-soft);
}

.ops-grid > .ops-item:nth-child(n + 4) {
    border-top: 1px solid var(--admin-border-soft);
}

@media (max-width: 991.98px) {
    .ops-grid > .ops-item:not(:nth-child(3n)) {
        border-right: 0;
    }

    .ops-grid > .ops-item:not(:nth-child(2n)) {
        border-right: 1px solid var(--admin-border-soft);
    }

    .ops-grid > .ops-item:nth-child(n + 4) {
        border-top: 0;
    }

    .ops-grid > .ops-item:nth-child(n + 3) {
        border-top: 1px solid var(--admin-border-soft);
    }
}

@media (max-width: 575.98px) {
    .ops-grid > .ops-item {
        border-right: 0 !important;
    }

    .ops-grid > .ops-item + .ops-item {
        border-top: 1px solid var(--admin-border-soft);
    }
}

.ops-item::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 20px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--admin-text-faint);
}

.ops-item.tone-positive::before {
    background: var(--tone-positive);
}

.ops-item.tone-warning::before {
    background: var(--tone-warning);
}

.ops-item.tone-critical::before {
    background: var(--tone-critical);
}

.ops-label {
    font-size: 11px;
    color: var(--admin-text-subtle);
    margin-left: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.ops-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--admin-text-strong);
    margin-left: 14px;
    letter-spacing: -0.005em;
    font-feature-settings: 'tnum';
}

/* Content grid */
.content-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 16px;
}

@media (max-width: 1199.98px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

/* Panels */
.panel {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border-soft);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--admin-border-soft);
    min-height: 52px;
}

.panel-header h2 {
    margin: 0 0 2px;
    font-size: var(--fs-h3);
    font-weight: 600;
    color: var(--admin-text-strong);
    letter-spacing: -0.01em;
}

.panel-header p {
    margin: 0;
    color: var(--admin-text-muted);
    font-size: var(--fs-small);
}

/* Filter panel — flat row, sits above the data panel without competing */
.filter-panel {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 10px;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0 0 12px;
    margin-bottom: 12px;
    box-shadow: none;
}

.filter-control {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-control label {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--admin-text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

@media (max-width: 991.98px) {
    .filter-panel {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 575.98px) {
    .filter-panel {
        grid-template-columns: 1fr;
    }
}

/* Form controls */
.form-control,
.form-select {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-md);
    color: var(--admin-text-strong);
    font-size: 13px;
    padding: 6px 10px;
    height: 34px;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

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

.form-control:focus,
.form-select:focus {
    border-color: var(--admin-accent-soft-strong);
    box-shadow: 0 0 0 3px var(--admin-accent-soft);
    outline: none;
}

/* ==========================================================
   Data table — universal admin table system
   ========================================================== */

.admin-table {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.admin-table thead th {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--admin-text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: transparent;
    border-bottom: 1px solid var(--admin-border);
    border-top: 0;
    padding: 0 14px;
    height: 36px;
    white-space: nowrap;
    line-height: 1;
    vertical-align: middle;
}

.admin-table tbody td {
    height: 56px;
    padding: 0 14px;
    border-top: 1px solid var(--admin-border-soft);
    border-bottom: 0;
    color: var(--admin-text);
    font-size: var(--fs-body);
    line-height: 1.35;
    vertical-align: middle;
    background: var(--admin-surface);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-table tbody tr:first-child td {
    border-top: 0;
}

.admin-table tbody tr {
    transition: background-color 0.1s ease;
}

.admin-table tbody tr:hover td {
    background: #f7f9fc;
}

.admin-table tbody tr:hover .table-title,
.admin-table tbody tr:hover .customer-name {
    color: var(--admin-accent-hover);
}

.admin-table .nowrap {
    white-space: nowrap;
}

/* Standard column widths (use with <colgroup>) */
.admin-table colgroup .col-customer { width: 24%; }
.admin-table colgroup .col-slug { width: 13%; }
.admin-table colgroup .col-pill { width: 9%; }
.admin-table colgroup .col-status { width: 11%; }
.admin-table colgroup .col-time { width: 11%; }
.admin-table colgroup .col-mono { width: 12%; }
/* Action column widths must hold the buttons + td padding (14px each
   side). "Detay" (~60px) + 4px gap + 28px icon button + 28px padding
   = ~120px. Add ~12px breathing room. col-actions-sm holds a single
   "Detay" button (~60px) + 28px padding = ~88px; bump to 100px. */
.admin-table colgroup .col-actions { width: 132px; }
.admin-table colgroup .col-actions-sm { width: 100px; }
.admin-table colgroup .col-num { width: 8%; }

/* Title link inside any table cell */
.table-title {
    display: inline-block;
    font-weight: 600;
    color: var(--admin-text-strong);
    text-decoration: none;
    transition: color 0.12s ease;
    font-size: 13px;
}

.table-title:hover {
    color: var(--admin-accent-hover);
}

.table-subtle {
    display: block;
    font-size: 11.5px;
    color: var(--admin-text-subtle);
    font-weight: 400;
    margin-top: 2px;
}

/* Customer / monogram cell — used in any table */
.customer-cell,
.tenant-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.tenant-monogram {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--admin-accent-soft);
    color: var(--admin-accent-hover);
    font-weight: 700;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--admin-accent-soft-strong);
    text-transform: uppercase;
    line-height: 1;
}

.customer-meta,
.tenant-cell > div {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    line-height: 1.25;
}

.customer-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--admin-text-strong);
    text-decoration: none;
    transition: color 0.12s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-name:hover {
    color: var(--admin-accent-hover);
}

.customer-domain {
    font-size: 11.5px;
    color: var(--admin-text-subtle);
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Slug chip — replaces raw <code> in tables */
.tenant-slug {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 6px;
    background: var(--admin-surface-muted);
    border: 1px solid var(--admin-border-soft);
    font-family: var(--font-mono);
    font-size: var(--fs-tiny);
    color: var(--admin-text-muted);
    font-weight: 500;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Plan / categorical pill */
.plan-pill {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    background: var(--admin-surface-muted);
    border: 1px solid var(--admin-border-soft);
    font-size: 12px;
    font-weight: 600;
    color: var(--admin-text-strong);
    line-height: 1;
}

/* Time cell — tabular figures, muted */
.admin-table .cell-time {
    color: var(--admin-text-muted);
    font-size: 12.5px;
    font-feature-settings: 'tnum';
}

/* Mono cell (codes / IPs) */
.admin-table .cell-mono {
    font-family: var(--font-mono);
    font-size: var(--fs-tiny);
    color: var(--admin-text-muted);
}

/* Status / health badges — locked sizing inside any data table */
.admin-table .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    padding: 0 9px;
    min-width: 78px;
    justify-content: center;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1;
    text-transform: capitalize;
    letter-spacing: 0;
    white-space: nowrap;
}

.admin-table .status-badge .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.85;
    flex-shrink: 0;
}

/* Number cell — right aligned tabular figures */
.admin-table .cell-num {
    font-feature-settings: 'tnum';
    color: var(--admin-text-strong);
    font-weight: 600;
}

/* Status badges — base palette (size locked inside .admin-table) */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    text-transform: capitalize;
    white-space: nowrap;
    border: 1px solid transparent;
    line-height: 1;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.85;
    flex-shrink: 0;
}

.status-badge.active,
.status-badge.healthy {
    background: var(--tone-positive-bg);
    color: var(--tone-positive);
    border-color: var(--admin-border-soft);
}

.status-badge.warning {
    background: var(--tone-warning-bg);
    color: var(--tone-warning);
    border-color: var(--admin-border-soft);
}

.status-badge.critical,
.status-badge.failed {
    background: var(--tone-critical-bg);
    color: var(--tone-critical);
    border-color: var(--admin-border-soft);
}

.status-badge.suspended,
.status-badge.unknown {
    background: var(--tone-neutral-bg);
    color: var(--tone-neutral);
    border-color: var(--admin-border-soft);
}

/* ==========================================================
   Row actions — universal action group for any data table
   ========================================================== */

.row-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.row-actions > .dropdown {
    display: inline-flex;
    align-items: center;
}

.btn-row,
.btn-row-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    border-radius: 6px;
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    color: var(--admin-text-strong);
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1;
    padding: 0;
    box-shadow: none;
    text-decoration: none;
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
    white-space: nowrap;
}

.btn-row {
    padding: 0 12px;
}

.btn-row-icon {
    width: 28px;
    color: var(--admin-text-muted);
    flex-shrink: 0;
}

.btn-row-icon i {
    font-size: 14px;
    line-height: 1;
}

.btn-row:hover,
.btn-row-icon:hover {
    background: var(--admin-surface-muted);
    border-color: var(--admin-border-strong);
    color: var(--admin-text-strong);
}

.btn-row:focus-visible,
.btn-row-icon:focus-visible {
    outline: none;
    border-color: var(--admin-accent-soft-strong);
    box-shadow: 0 0 0 3px var(--admin-accent-soft);
}

.btn-row-icon[aria-expanded="true"] {
    background: var(--admin-surface-muted);
    border-color: var(--admin-border-strong);
    color: var(--admin-text-strong);
}

.row-actions .dropdown-menu {
    min-width: 200px;
    margin-top: 4px;
}

.row-actions .dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    font-size: 12.5px;
}

.row-actions .dropdown-item i {
    font-size: 13px;
    color: var(--admin-text-muted);
    width: 14px;
    text-align: center;
}

.row-actions .dropdown-item.text-danger i {
    color: var(--tone-critical);
}

/* Legacy .table-actions kept as alias of .row-actions */
.table-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
    flex-wrap: nowrap;
    white-space: nowrap;
}

/* Stack list (audit) — sade operasyon listesi, pseudo-table değil */
.stack-list {
    display: flex;
    flex-direction: column;
    padding: 6px;
}

.stack-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.1s ease;
    width: 100%;
}

.stack-item:hover {
    background: var(--admin-surface-muted);
}

.stack-item:focus-visible {
    outline: none;
    background: var(--admin-surface-muted);
    box-shadow: 0 0 0 2px var(--admin-accent-soft);
}

.stack-item > span {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.stack-item strong {
    font-weight: 600;
    color: var(--admin-text-strong);
    font-size: var(--fs-body);
    line-height: 1.3;
}

.stack-item small {
    font-size: var(--fs-tiny);
    color: var(--admin-text-subtle);
    line-height: 1.3;
}

.stack-item em {
    font-style: normal;
    font-size: var(--fs-tiny);
    color: var(--admin-text-subtle);
    white-space: nowrap;
    font-feature-settings: 'tnum';
}

/* Offcanvas */
.admin-offcanvas {
    width: 420px !important;
    border-left: 1px solid var(--admin-border) !important;
    box-shadow: -8px 0 24px rgba(15, 23, 41, 0.06);
}

.admin-offcanvas .offcanvas-header {
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--admin-border-soft);
    align-items: flex-start;
    gap: 12px;
}

.offcanvas-heading {
    flex: 1;
    min-width: 0;
}

.offcanvas-eyebrow {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--admin-text-subtle);
    margin-bottom: 4px;
}

.offcanvas-title {
    margin: 0;
    font-size: var(--fs-h2);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--admin-text-strong);
}

.offcanvas-subtitle {
    margin: 4px 0 0;
    font-size: var(--fs-small);
    color: var(--admin-text-subtle);
}

.admin-offcanvas .offcanvas-body {
    padding: 18px 22px 22px;
}

/* Offcanvas detail panel — base is sans-serif for normal/operation
   detail. Triggers opt-in to monospace by setting data-detail-mode
   to "tech" / "json" / "log". Prose/normal mode keeps the default. */
.detail-panel {
    background: var(--admin-surface-muted);
    border: 1px solid var(--admin-border-soft);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    color: var(--admin-text);
    font-family: var(--font-sans);
    font-size: var(--fs-small);
    line-height: 1.65;
    word-break: break-word;
}

.detail-panel--prose,
.detail-panel--normal {
    color: var(--admin-text);
    font-family: var(--font-sans);
}

.detail-panel--tech,
.detail-panel--json,
.detail-panel--log {
    background: var(--admin-bg);
    color: var(--admin-text-strong);
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.7;
    white-space: pre-wrap;
}

.detail-panel--log {
    max-height: 360px;
    overflow-y: auto;
}

/* Detail page (tenant show) */
.detail-summary {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border-soft);
    border-radius: var(--radius-lg);
    padding: 18px 22px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-card);
}

.detail-summary h2 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--admin-text-strong);
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: var(--admin-text-subtle);
    font-size: 12.5px;
    margin-top: 8px;
}

.detail-meta span strong {
    color: var(--admin-text-strong);
    font-weight: 600;
    margin-right: 4px;
}

/* Confirm modal */
.modal-content {
    border-radius: var(--radius-xl);
    border: 1px solid var(--admin-border);
    box-shadow: var(--shadow-elevated);
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--admin-border-soft);
}

.modal-title {
    font-size: var(--fs-h3);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--admin-text-strong);
}

.modal-body {
    padding: 16px 20px;
    color: var(--admin-text-muted);
    font-size: var(--fs-body);
}

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--admin-border-soft);
    gap: 8px;
}

.modal-footer > * {
    margin: 0;
}

.admin-confirm .modal-body {
    color: var(--admin-text);
    line-height: 1.55;
}

.admin-confirm .modal-title {
    font-size: 15px;
}

.admin-confirm .btn-close {
    opacity: 0.55;
}

.admin-confirm .btn-close:hover {
    opacity: 1;
}

/* Auth (login) */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--admin-bg);
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 380px;
    background: var(--admin-surface);
    border: 1px solid var(--admin-border-soft);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-elevated);
}

.auth-card h1 {
    margin: 12px 0 4px;
    font-size: var(--fs-h1);
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: var(--lh-tight);
}

.auth-card p {
    margin: 0 0 18px;
    color: var(--admin-text-muted);
    font-size: var(--fs-body);
}

.auth-env {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--tone-warning-bg);
    color: var(--tone-warning);
}

/* Dropdown */
.dropdown-menu {
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-elevated);
    padding: 6px;
    min-width: 180px;
    font-size: 13px;
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    color: var(--admin-text);
    font-size: 13px;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--admin-surface-muted);
    color: var(--admin-text-strong);
}

.dropdown-item.text-danger:hover {
    background: var(--tone-critical-bg);
    color: var(--tone-critical);
}

.dropdown-divider {
    margin: 4px 0;
    border-color: var(--admin-border-soft);
}

/* Tabs */
.nav-tabs {
    border-bottom: 1px solid var(--admin-border-soft);
    margin-bottom: 14px;
    gap: 2px;
}

.nav-tabs .nav-link {
    border: 0;
    color: var(--admin-text-muted);
    font-weight: 500;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.nav-tabs .nav-link:hover {
    background: var(--admin-surface-muted);
    color: var(--admin-text-strong);
}

.nav-tabs .nav-link.active {
    background: transparent;
    color: var(--admin-text-strong);
    box-shadow: inset 0 -2px 0 var(--admin-accent);
}

/* Mobile */
@media (max-width: 991.98px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-shell.is-sidebar-open .admin-sidebar {
        transform: translateX(0);
        box-shadow: var(--shadow-elevated);
    }

    .admin-main {
        margin-left: 0 !important;
    }

    .header-search {
        display: none !important;
    }
}

/* Misc helpers */
.text-end {
    text-align: right;
}

.nowrap {
    white-space: nowrap;
}

/* Fallback: secondary span after .table-title gets subtle styling */
.admin-table tbody td .table-title + span {
    display: block;
    font-size: 11.5px;
    color: var(--admin-text-subtle);
    font-weight: 400;
    margin-top: 2px;
}

/* Tenant detail (show) */
.tenant-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.tenant-hero h2 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: var(--lh-tight);
    color: var(--admin-text-strong);
}

.tenant-hero p {
    margin: 0;
    color: var(--admin-text-muted);
    font-size: var(--fs-body);
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.plain-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11.5px;
    font-weight: 500;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--admin-surface-muted);
    color: var(--admin-text-muted);
    border: 1px solid var(--admin-border-soft);
}

.admin-tabs {
    padding: 0 20px;
    margin-bottom: 0;
}

.admin-tabs.nav-tabs {
    margin-bottom: 0;
    border-bottom: 1px solid var(--admin-border-soft);
}

.tab-content {
    padding: 20px 24px 24px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.detail-grid > div {
    background: var(--admin-surface-muted);
    border: 1px solid var(--admin-border-soft);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-grid > div span {
    font-size: 11px;
    color: var(--admin-text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.detail-grid > div strong {
    font-size: 13.5px;
    color: var(--admin-text-strong);
    font-weight: 600;
}

.empty-state {
    /* Legacy alias — matches .state-card.state-card--info */
    background: var(--admin-surface-muted);
    border: 1px solid var(--admin-border-soft);
    border-style: dashed;
    border-radius: var(--radius-md);
    padding: 22px;
    text-align: left;
    color: var(--admin-text-muted);
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.empty-state strong {
    font-size: 14px;
    color: var(--admin-text-strong);
    font-weight: 600;
}

.empty-state p {
    margin: 0;
    font-size: 13px;
}

/* Login screen */
.login-body {
    background: var(--admin-bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-shell {
    width: 100%;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--admin-surface);
    border: 1px solid var(--admin-border-soft);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-elevated);
}

.login-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.login-brand img {
    max-height: 26px;
    width: auto;
}

.login-copy h1 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: var(--lh-tight);
    color: var(--admin-text-strong);
}

.login-copy p {
    margin: 0 0 18px;
    color: var(--admin-text-muted);
    font-size: var(--fs-body);
}

.login-form .form-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--admin-text-muted);
    margin-bottom: 4px;
}

.form-check-label {
    font-size: 12.5px;
    color: var(--admin-text-muted);
}

.form-check-input:checked {
    background-color: var(--admin-text-strong);
    border-color: var(--admin-text-strong);
}

.form-check-input:focus {
    border-color: var(--admin-accent-soft-strong);
    box-shadow: 0 0 0 3px var(--admin-accent-soft);
}

.login-link {
    font-size: 12px;
    color: var(--admin-text-muted);
}

.login-link:hover {
    color: var(--admin-text-strong);
}

.login-note {
    margin: 16px 0 0;
    text-align: center;
    font-size: 11.5px;
    color: var(--admin-text-faint);
}

/* Bootstrap table reset */
.table {
    --bs-table-bg: var(--admin-surface);
    --bs-table-color: var(--admin-text);
    --bs-table-border-color: var(--admin-border-soft);
}

/* Row dropdown clipping fix (defense-in-depth)
   ---------------------------------------------------------------
   The JS portal in app.js moves .dropdown-menu to <body> on open,
   which is the primary fix. The CSS rules below guarantee the menu
   stays visible even when the portal cannot run (e.g. cached JS,
   small JS error, future regression). They neutralise every clip
   layer between the panel and the menu without breaking ellipsis
   on regular cell content. */
.panel > .table-responsive {
    overflow: visible;
}

@media (max-width: 1199.98px) {
    .panel > .table-responsive {
        overflow-x: auto;
        overflow-y: visible;
    }
}

/* Action cell: never clip its row dropdown. Only the action column
   uses .text-end on tbody td, so scoping to .row-actions guarantees
   we don't disable ellipsis on text columns. */
.admin-table tbody td:has(.row-actions),
.admin-table tbody td.text-end {
    overflow: visible;
}

.row-actions,
.row-actions > .dropdown {
    overflow: visible;
}

/* Dropdown menus inside data tables must float above row content,
   even when something happens to add a transform/contain to an
   ancestor (which would otherwise turn position:fixed into a local
   coordinate system). */
.dropdown-menu {
    z-index: 1080;
}

.panel-header-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Keep .admin-table from collapsing on narrow screens — horizontal scroll */
@media (max-width: 1199.98px) {
    .admin-table {
        min-width: 980px;
    }
}

/* ===================================================================
   Sprint C — Action / feedback / detail polish
   ------------------------------------------------------------------
   Refines:
   1. Button reset for header chrome (no Bootstrap .btn inheritance)
   2. Destructive confirm button bound to --tone-critical
   3. Sidebar active indicator + "Yakında" tag + scrollbar
   =================================================================== */

/* 1. Reset for elements that previously relied on Bootstrap .btn.
   We keep the visual styles defined further up, but ensure browser
   default <button> chrome doesn't bleed through (font, line-height,
   focus outline). */
.user-button,
.btn-icon,
.btn-row,
.btn-row-icon,
.btn-ghost,
.btn-confirm-danger,
.header-alert {
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
}

.user-button:focus-visible,
.btn-icon:focus-visible,
.header-alert:focus-visible {
    outline: none;
    border-color: var(--admin-accent-soft-strong);
    box-shadow: 0 0 0 3px var(--admin-accent-soft);
}

/* Header alert: small ghost pill, no Bootstrap .btn / .btn-sm. */
.header-alert {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid var(--admin-border-soft);
    color: var(--admin-text-strong);
    font-size: 12.5px;
    font-weight: 500;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.header-alert:hover {
    background: var(--admin-surface-muted);
    border-color: var(--admin-border-strong);
}

.user-button {
    height: 36px;
    line-height: 1.1;
}

/* 2. Destructive confirm button — bound to project's --tone-critical
   token. Replaces Bootstrap .btn-danger so confirm modals match the
   rest of the SaaS palette. */
.btn-confirm-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 14px;
    border-radius: var(--radius-md);
    background: var(--tone-critical);
    border: 1px solid var(--tone-critical);
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.005em;
    transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.btn-confirm-danger:hover,
.btn-confirm-danger:focus {
    background: #962820;
    border-color: #962820;
    color: #fff;
}

.btn-confirm-danger:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(177, 50, 44, 0.22);
}

/* Match modal "Vazgeç" ghost button height to confirm button. */
.admin-confirm .modal-footer .btn-ghost {
    height: 32px;
    padding: 0 14px;
    font-size: 12.5px;
    font-weight: 500;
}

/* 3. Sidebar active indicator: keep it inside the link, no negative
   inset, so it never collides with the sidebar edge or appears to
   slide on hover. */
.sidebar-link.active::before {
    left: 0;
    top: 7px;
    bottom: 7px;
    width: 3px;
    border-radius: 0 3px 3px 0;
}

/* "Yakında" tag — quieter, type-only treatment. Removes pill chrome
   which read as visual noise next to actual nav items. */
.sidebar-tag {
    margin-left: auto;
    font-size: 10px;
    font-weight: 500;
    color: var(--admin-text-faint);
    background: transparent;
    border: 0;
    padding: 0;
    border-radius: 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Sidebar scrollbar — only visible when the user is interacting
   with the sidebar; otherwise blends into the surface. */
.sidebar-nav {
    scrollbar-color: transparent transparent;
}

.sidebar-nav:hover,
.sidebar-nav:focus-within {
    scrollbar-color: var(--admin-border) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 999px;
}

.sidebar-nav:hover::-webkit-scrollbar-thumb,
.sidebar-nav:focus-within::-webkit-scrollbar-thumb {
    background: var(--admin-border);
}

/* ===================================================================
   Sprint D — Empty / loading / error / banner (operasyon dili)
   =================================================================== */

@keyframes state-skeleton-pulse {
    0%,
    100% {
        opacity: 0.55;
    }
    50% {
        opacity: 0.9;
    }
}

@media (prefers-reduced-motion: reduce) {
    @keyframes state-skeleton-pulse {
        0%,
        100% {
            opacity: 0.75;
        }
    }
}

.admin-content.has-page-banner .page-header {
    margin-bottom: 10px;
}

.alert-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--admin-border-soft);
    background: var(--admin-surface-muted);
    margin-bottom: 16px;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--admin-text-strong);
}

.alert-banner--critical {
    border-color: rgba(177, 50, 44, 0.22);
    background: var(--tone-critical-bg);
    color: var(--tone-critical);
}

.alert-banner--warning {
    border-color: rgba(148, 96, 0, 0.2);
    background: var(--tone-warning-bg);
    color: var(--tone-warning);
}

.alert-banner--success {
    border-color: rgba(15, 118, 110, 0.22);
    background: var(--tone-positive-bg);
    color: var(--tone-positive);
}

.alert-banner--info {
    border-color: var(--admin-border);
    background: var(--admin-surface-muted);
    color: var(--admin-text);
}

.alert-banner-icon {
    flex: 0 0 auto;
    display: inline-flex;
    margin-top: 1px;
    font-size: 15px;
}

.alert-banner-text {
    flex: 1;
    min-width: 0;
    margin: 0;
    color: inherit;
    font-weight: 500;
}

.alert-banner-actions {
    flex: 0 0 auto;
}

.alert-banner-dismiss {
    flex: 0 0 auto;
    margin-left: auto;
    align-self: flex-start;
    text-decoration: none;
    color: var(--admin-text-subtle);
    font-size: 18px;
    line-height: 1;
    padding: 0 2px;
}

.alert-banner-dismiss:hover {
    color: var(--admin-text-strong);
}

.alert-banner--critical .alert-banner-dismiss,
.alert-banner--warning .alert-banner-dismiss {
    color: inherit;
    opacity: 0.7;
}

.alert-banner--critical .alert-banner-dismiss:hover,
.alert-banner--warning .alert-banner-dismiss:hover {
    opacity: 1;
}

.state-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--admin-border-soft);
    background: var(--admin-surface-muted);
    color: var(--admin-text-muted);
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
}

.state-card--embed {
    border: 0;
    background: transparent;
    padding: 0;
    gap: 10px;
}

.state-card-icon {
    flex: 0 0 auto;
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--admin-surface);
    border: 1px solid var(--admin-border-soft);
    font-size: 14px;
    color: var(--admin-text-subtle);
}

.state-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.state-card-title {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--admin-text-strong);
    letter-spacing: -0.01em;
}

.state-card-text {
    margin: 0;
    font-size: 12.5px;
    color: var(--admin-text-muted);
    line-height: 1.55;
}

.state-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.state-card--empty .state-card-icon {
    color: var(--admin-text-faint);
}

.state-card--no-result {
    padding: 11px 13px;
    background: var(--admin-surface-muted);
    border-style: solid;
}

.state-card--no-result .state-card-title {
    font-size: 12.5px;
    font-weight: 600;
}

.state-card--no-result .state-card-text {
    font-size: 12px;
}

.state-card--warning {
    border-color: rgba(148, 96, 0, 0.2);
    background: var(--tone-warning-bg);
}

.state-card--warning .state-card-title,
.state-card--warning .state-card-text {
    color: var(--tone-warning);
}

.state-card--warning .state-card-icon {
    background: var(--admin-surface);
    border-color: rgba(148, 96, 0, 0.2);
    color: var(--tone-warning);
}

.state-card--error {
    border-color: rgba(177, 50, 44, 0.22);
    background: var(--tone-critical-bg);
}

.state-card--error .state-card-title,
.state-card--error .state-card-text {
    color: var(--tone-critical);
}

.state-card--error .state-card-icon {
    background: var(--admin-surface);
    border-color: rgba(177, 50, 44, 0.22);
    color: var(--tone-critical);
}

.state-card--info {
    border-style: dashed;
}

.state-card--empty {
    border-style: dashed;
}

.state-table-cell {
    padding: 36px 20px !important;
    vertical-align: middle !important;
    border-top-color: transparent !important;
    background: var(--admin-surface) !important;
}

.state-table-cell .state-card--embed {
    max-width: 520px;
}

.state-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
    margin: 0;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    line-height: 1.45;
    border: 1px solid transparent;
}

.state-inline > i:first-child {
    font-size: 14px;
    margin-top: 1px;
    color: var(--admin-text-subtle);
}

.state-inline-actions {
    margin-left: auto;
}

.state-inline--muted {
    border-color: var(--admin-border-soft);
    background: var(--admin-bg);
    color: var(--admin-text-muted);
}

.state-inline--info {
    border-color: var(--admin-border-soft);
    background: var(--admin-surface-muted);
    color: var(--admin-text-muted);
}

.state-inline--success {
    border-color: rgba(15, 118, 110, 0.2);
    background: var(--tone-positive-bg);
    color: var(--tone-positive);
}

.state-inline--warning {
    border-color: rgba(148, 96, 0, 0.2);
    background: var(--tone-warning-bg);
    color: var(--tone-warning);
}

.state-inline--critical {
    border-color: rgba(177, 50, 44, 0.22);
    background: var(--tone-critical-bg);
    color: var(--tone-critical);
}

.skeleton-line,
.skeleton-bar,
.skeleton-chip {
    display: inline-block;
    border-radius: 4px;
    background: var(--admin-surface-muted);
    border: 1px solid var(--admin-border-soft);
    animation: state-skeleton-pulse 2.2s ease-in-out infinite;
}

.skeleton-row-static .skeleton-bar,
.skeleton-row-static .skeleton-chip,
.skeleton-metric-static .skeleton-line,
.skeleton-stack-static .skeleton-line,
.skeleton-ops-static .skeleton-line {
    animation: none;
    opacity: 0.74;
}

.skeleton-chip {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.skeleton-chip-action {
    width: 54px;
    height: 28px;
    border-radius: var(--radius-md);
}

.skeleton-bar {
    height: 9px;
    margin-right: 8px;
    vertical-align: middle;
}

.skeleton-bar-full {
    display: inline-block;
    width: calc(72% - 32px);
    min-width: 120px;
}

.skeleton-bar-md {
    width: 44%;
    min-width: 80px;
    display: inline-block;
    margin-top: 6px;
}

.skeleton-bar-sm {
    width: 104px;
}

.skeleton-bar-lg {
    width: 68%;
    min-width: 140px;
}

.skeleton-bar-xs {
    width: 48px;
}

.skeleton-bar-time {
    width: 112px;
}

.skeleton-bar-ip {
    width: 96px;
}

.summary-card.skeleton-metric {
    overflow: hidden;
}

.skeleton-line-label {
    display: inline-block;
    width: 70px;
    height: 10px;
    margin-bottom: 6px;
}

.skeleton-line-value {
    display: block;
    width: 112px;
    height: 18px;
    margin-bottom: 4px;
}

.skeleton-line-delta {
    display: inline-block;
    width: 88px;
    height: 9px;
}

.ops-item.skeleton-ops .skeleton-ops-label {
    width: 120px;
    height: 9px;
    margin-bottom: 6px;
    display: inline-block;
}

.ops-item.skeleton-ops .skeleton-ops-value {
    width: 72px;
    height: 14px;
    display: inline-block;
}

.stack-item.skeleton-stack {
    pointer-events: none;
}

.skeleton-stack {
    justify-content: space-between !important;
}

.skeleton-stack-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.skeleton-stack-title {
    height: 12px;
    width: min(380px, 66vw);
}

.skeleton-stack-sub {
    height: 10px;
    width: min(260px, 48vw);
}

.skeleton-stack-time {
    flex: 0 0 auto;
    width: 84px;
    height: 10px;
}

.skeleton-detail-label {
    width: 88px;
    height: 9px;
    margin-bottom: 8px;
    display: block;
}

.skeleton-detail-value {
    width: min(260px, 55vw);
    height: 14px;
    display: block;
    font-weight: 400 !important;
}

.state-card--compact {
    gap: 8px;
    padding: 8px 10px;
    margin-top: 10px;
    border-style: dotted;
}

.state-card--compact .state-card-title {
    font-size: 12px;
}

.state-card--compact .state-card-text {
    font-size: 11.5px;
}

/* ===================================================================
   UX-1 — Unified Badge System
   =================================================================== */

.ubadge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 20px;
    padding: 0 7px;
    border-radius: 4px;
    border: 0;
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    vertical-align: middle;
    letter-spacing: 0.01em;
}

.ubadge-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.ubadge-positive { background: var(--tone-positive-bg); color: var(--tone-positive); }
.ubadge-critical { background: var(--tone-critical-bg); color: var(--tone-critical); }
.ubadge-warning  { background: var(--tone-warning-bg); color: var(--tone-warning); }
.ubadge-accent   { background: var(--admin-accent-soft); color: var(--admin-accent); }
.ubadge-neutral  { background: var(--tone-neutral-bg); color: var(--admin-text-muted); }
.ubadge-muted    { background: var(--tone-neutral-bg); color: var(--admin-text-subtle); }
.ubadge-plain    { background: var(--tone-neutral-bg); color: var(--admin-text-muted); font-weight: 500; }

.ubadge-accent .ubadge-dot { animation: state-skeleton-pulse 1.6s ease-in-out infinite; }

/* ===================================================================
   UX-1 — Provisioning Run Detail Layout
   =================================================================== */

/* --- Hero --- */
.provision-run-hero.tenant-hero {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px 24px;
    align-items: start;
    padding: 22px 24px 20px;
    margin-bottom: 0;
}

.provision-run-hero h2 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 2px;
}

.provision-run-hero .hero-info {
    margin: 0;
    font-size: var(--fs-small);
    color: var(--admin-text-muted);
    line-height: 1.5;
}

.provision-run-hero .hero-info .tenant-slug {
    font-family: var(--font-mono);
    font-size: 11px;
    background: var(--admin-surface-muted);
    padding: 1px 5px;
    border-radius: 3px;
}

.provision-run-hero .hero-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.provision-run-hero .hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    justify-content: flex-end;
}

.provision-run-hero .hero-progress {
    width: 160px;
    height: 4px;
    background: var(--admin-border-soft);
    border-radius: 2px;
    overflow: hidden;
}

.provision-run-hero .hero-progress-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--tone-positive);
    transition: width 0.4s ease;
}

.provision-run-hero .hero-progress-label {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--admin-text-subtle);
    text-align: right;
    margin-top: 1px;
}

@media (max-width: 767.98px) {
    .provision-run-hero.tenant-hero {
        grid-template-columns: 1fr;
    }
    .provision-run-hero .hero-right {
        align-items: flex-start;
    }
    .provision-run-hero .hero-badges {
        justify-content: flex-start;
    }
    .provision-run-hero .hero-progress {
        width: 100%;
    }
}

/* --- Section spacing --- */
.prov-section {
    margin-bottom: 14px;
}

.prov-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px 8px;
}

.prov-section-header .eyebrow {
    margin-bottom: 0;
}

.prov-section-header p {
    margin: 0;
    font-size: 11px;
    color: var(--admin-text-faint);
}

.prov-section-body {
    padding: 0 18px 14px;
}

/* --- Provisioning Timeline --- */
.ptimeline {
    display: flex;
    flex-direction: column;
    padding: 0;
    position: relative;
}

.ptimeline-item {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 0;
    align-items: stretch;
    position: relative;
}

.ptimeline-track {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding-top: 18px;
}

.ptimeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2.5px solid var(--admin-border);
    background: var(--admin-surface);
    flex-shrink: 0;
    z-index: 1;
    box-shadow: 0 0 0 3px var(--admin-surface);
}

.ptimeline-dot-positive  { background: var(--tone-positive); border-color: var(--tone-positive); box-shadow: 0 0 0 3px var(--admin-surface), 0 0 0 5px var(--tone-positive-bg); }
.ptimeline-dot-critical  { background: var(--tone-critical); border-color: var(--tone-critical); box-shadow: 0 0 0 3px var(--admin-surface), 0 0 0 5px var(--tone-critical-bg); }
.ptimeline-dot-warning   { background: var(--tone-warning); border-color: var(--tone-warning); box-shadow: 0 0 0 3px var(--admin-surface), 0 0 0 5px var(--tone-warning-bg); }
.ptimeline-dot-accent    { background: var(--admin-accent); border-color: var(--admin-accent); box-shadow: 0 0 0 3px var(--admin-surface), 0 0 0 5px var(--admin-accent-soft); animation: ptimeline-pulse 2s ease-in-out infinite; }
.ptimeline-dot-neutral   { background: var(--admin-border); border-color: var(--admin-border); }

@keyframes ptimeline-pulse {
    0%, 100% { box-shadow: 0 0 0 3px var(--admin-surface), 0 0 0 5px var(--admin-accent-soft); }
    50%      { box-shadow: 0 0 0 3px var(--admin-surface), 0 0 0 7px var(--admin-accent-soft); }
}

.ptimeline-connector {
    width: 2px;
    flex: 1;
    background: var(--admin-border-soft);
    margin-top: 4px;
}

.ptimeline-item:last-child .ptimeline-connector {
    background: transparent;
}

/* card container for each step */
.ptimeline-card {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border-soft);
    border-radius: var(--radius-md);
    margin: 6px 0;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ptimeline-card:hover {
    border-color: var(--admin-border);
}

.ptimeline-item--succeeded .ptimeline-card {
    border-left: 3px solid var(--tone-positive);
}

.ptimeline-item--failed .ptimeline-card {
    border-left: 3px solid var(--tone-critical);
    background: color-mix(in srgb, var(--tone-critical-bg) 30%, var(--admin-surface));
}

.ptimeline-item--running .ptimeline-card {
    border-left: 3px solid var(--admin-accent);
    box-shadow: 0 0 0 1px var(--admin-accent-soft);
}

.ptimeline-item--waiting .ptimeline-card {
    border-left: 3px solid var(--tone-warning);
}

.ptimeline-item--pending .ptimeline-card {
    opacity: 0.55;
    border-left: 3px solid var(--admin-border-soft);
}

.ptimeline-item--pending .ptimeline-card:hover {
    opacity: 0.75;
}

.ptimeline-card-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
}

.ptimeline-card-content {
    flex: 1;
    min-width: 0;
}

.ptimeline-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--admin-text-strong);
    line-height: 1.35;
    margin: 0;
}

.ptimeline-item--pending .ptimeline-title {
    color: var(--admin-text-subtle);
    font-weight: 500;
}

.ptimeline-summary {
    margin-top: 3px;
    font-size: 11px;
    color: var(--admin-text-subtle);
    line-height: 1.4;
    font-feature-settings: 'tnum';
}

.ptimeline-summary code {
    font-family: var(--font-mono);
    font-size: 10px;
    background: var(--admin-surface-muted);
    padding: 1px 4px;
    border-radius: 3px;
}

.ptimeline-card-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
    padding-top: 1px;
}

.ptimeline-duration {
    font-size: 11px;
    font-weight: 500;
    color: var(--admin-text-subtle);
    font-feature-settings: 'tnum';
    font-family: var(--font-mono);
}

.ptimeline-embed {
    padding: 0 14px 12px;
    border-top: 1px solid var(--admin-border-soft);
}

.ptimeline-embed .state-card,
.ptimeline-embed .state-inline {
    margin-top: 10px;
}

/* action row inside embed */
.ptimeline-action-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding-top: 8px;
}

.ptimeline-action-row .btn-ghost {
    font-size: 11px;
    padding: 4px 10px;
}

.ptimeline-action-row .btn-confirm-danger {
    font-size: 11px;
    padding: 4px 10px;
}

.ptimeline-action-row .form-control-sm {
    height: 28px;
    font-size: 11px;
    max-width: 160px;
}

.ptimeline-action-row form {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* --- Alert density control --- */
.prov-alert-strip {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 16px;
}

.prov-alert-strip .state-inline {
    margin: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
}

.prov-alert-strip .state-inline:first-child {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border-top: 1px solid var(--admin-border-soft);
}

.prov-alert-strip .state-inline:last-child {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    border-bottom: 1px solid var(--admin-border-soft);
}

.prov-alert-strip .state-inline:only-child {
    border-radius: var(--radius-md);
    border: 1px solid var(--admin-border-soft);
}

/* --- Technical details collapse --- */
.technical-collapse-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 1px solid var(--admin-border-soft);
    border-radius: var(--radius-sm);
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--admin-text-subtle);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.technical-collapse-toggle:hover {
    background: var(--admin-surface-muted);
    color: var(--admin-text-muted);
}

.technical-collapse-toggle i {
    font-size: 11px;
    transition: transform 0.2s;
}

.technical-collapse-toggle[aria-expanded="true"] i {
    transform: rotate(90deg);
}

/* --- Responsive timeline --- */
@media (max-width: 767.98px) {
    .ptimeline-item {
        grid-template-columns: 28px 1fr;
    }
    .ptimeline-card-main {
        flex-direction: column;
        gap: 6px;
    }
    .ptimeline-card-right {
        flex-direction: row;
        align-items: center;
    }
    .ptimeline-action-row {
        flex-direction: column;
        align-items: stretch;
    }
    .ptimeline-action-row form {
        flex-wrap: wrap;
    }
    .ptimeline-action-row .form-control-sm {
        max-width: 100%;
    }
    .prov-section-body {
        padding: 0 12px 12px;
    }
    .prov-section-header {
        padding: 12px 12px 8px;
        flex-wrap: wrap;
    }
}

/* ===================================================================
   Sprint E1 — Provisioning Console (legacy, retained for compatibility)
   =================================================================== */

.run-state-pill,
.step-state-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    border: 1px solid var(--admin-border-soft);
    background: var(--admin-surface-muted);
    color: var(--admin-text-muted);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.run-state-pill .status-dot,
.step-state-pill .status-dot {
    background: currentColor;
}

.run-state-pill--completed,
.step-state-pill--succeeded {
    background: var(--tone-positive-bg);
    color: var(--tone-positive);
    border-color: rgba(15, 118, 110, 0.18);
}

.run-state-pill--failed,
.step-state-pill--failed {
    background: var(--tone-critical-bg);
    color: var(--tone-critical);
    border-color: rgba(177, 50, 44, 0.22);
}

.run-state-pill--waiting,
.run-state-pill--partially_failed,
.step-state-pill--waiting,
.step-state-pill--skipped,
.step-state-pill--rolled-back {
    background: var(--tone-warning-bg);
    color: var(--tone-warning);
    border-color: rgba(148, 96, 0, 0.2);
}

.run-state-pill--provisioning,
.run-state-pill--retrying,
.run-state-pill--validating,
.step-state-pill--running {
    background: var(--admin-accent-soft);
    color: var(--admin-accent);
    border-color: var(--admin-accent-soft-strong);
}

.run-state-pill--draft,
.run-state-pill--ready,
.run-state-pill--archived,
.step-state-pill--pending {
    background: var(--admin-surface-muted);
    color: var(--admin-text-muted);
}

.stack-item-meta,
.provision-step-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.stack-item-meta em,
.provision-step-meta em {
    font-style: normal;
    color: var(--admin-text-subtle);
    font-size: var(--fs-tiny);
}

.provision-console-panel {
    margin-bottom: 16px;
}

.provision-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 14px;
    align-items: start;
}

@media (max-width: 1199.98px) {
    .provision-form-grid {
        grid-template-columns: 1fr;
    }
}

.provision-form-main,
.provision-validation-panel {
    overflow: hidden;
}

.provision-form-sections {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.provision-form-section {
    padding: 16px 18px;
    border-top: 1px solid var(--admin-border-soft);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.provision-form-section:first-child {
    border-top: 0;
}

.provision-field-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 991.98px) {
    .provision-field-grid {
        grid-template-columns: 1fr;
    }
}

.provision-field-grid label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 0;
}

.provision-field-grid label > span {
    color: var(--admin-text-muted);
    font-size: 11px;
    font-weight: 600;
}

.provision-field-grid label > .form-hint {
    font-size: 10.5px;
    color: var(--admin-text-faint);
    font-weight: 400;
    margin-top: -2px;
}

.provision-run-hero {
    margin-bottom: 16px;
}

.provision-step-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.provision-step-toolbar p {
    margin: 0;
    color: var(--admin-text-muted);
    font-size: var(--fs-small);
}

.provision-step-list {
    padding: 0;
    gap: 6px;
}

.provision-step-row {
    border: 1px solid var(--admin-border-soft);
    border-radius: var(--radius-md);
    background: var(--admin-surface);
    overflow: hidden;
}

.provision-step-row--failed {
    border-color: rgba(177, 50, 44, 0.22);
}

.provision-step-row--waiting {
    border-color: rgba(148, 96, 0, 0.2);
}

.provision-step-row--running {
    border-color: var(--admin-accent-soft-strong);
}

.provision-step-main {
    width: 100%;
    border-radius: 0;
    padding: 11px 12px;
}

.provision-step-embed {
    padding: 0 12px 12px;
}

.provision-step-embed .state-inline,
.provision-step-embed .state-card {
    margin-top: 0;
}

.provision-step-row--running .provision-step-main strong::after,
.run-state-pill--provisioning::after,
.run-state-pill--retrying::after,
.step-state-pill--running::after {
    content: '';
    width: 5px;
    height: 5px;
    margin-left: 2px;
    border-radius: 50%;
    background: currentColor;
    animation: state-skeleton-pulse 1.6s ease-in-out infinite;
}

.provision-advanced-section {
    border: 1px solid var(--admin-border-soft);
    border-radius: var(--admin-radius);
    padding: 12px 14px;
}

.provision-advanced-section summary {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--admin-text-sub);
}

.provision-advanced-section[open] summary {
    margin-bottom: 4px;
}

.provision-validation-panel .stack-list {
    gap: 8px;
}

.provision-validation-panel .state-card {
    margin-top: 4px;
}

/* --- Provision summary sidebar --- */
.provision-summary {
    position: sticky;
    top: calc(var(--header-height) + 14px);
}

.provision-summary-list {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.provision-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    font-size: 12px;
    line-height: 1.4;
}

.provision-summary-row dt {
    color: var(--admin-text-faint);
    font-weight: 500;
    white-space: nowrap;
}

.provision-summary-row dd {
    margin: 0;
    color: var(--admin-text-strong);
    font-weight: 600;
    text-align: right;
    word-break: break-all;
}

.provision-summary-row dd:empty::after {
    content: '—';
    color: var(--admin-text-faint);
    font-weight: 400;
}

.provision-summary-divider {
    border: 0;
    border-top: 1px solid var(--admin-border-soft);
    margin: 4px 0;
}

/* CTA bar */
.provision-cta {
    padding: 14px 16px;
    border-top: 1px solid var(--admin-border-soft);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.provision-cta .btn {
    width: 100%;
    justify-content: center;
}

.provision-cta .btn-ghost {
    width: 100%;
    justify-content: center;
    text-align: center;
}

/* form field 2-col variant */
.provision-field-grid--2col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 991.98px) {
    .provision-field-grid--2col {
        grid-template-columns: 1fr;
    }
}

/* form section eyebrow with description */
.provision-section-intro {
    margin-bottom: 2px;
}

.provision-section-intro .eyebrow {
    margin-bottom: 2px;
}

.provision-section-intro p {
    margin: 0;
    font-size: 11px;
    color: var(--admin-text-faint);
}

@media (max-width: 1199.98px) {
    .provision-summary {
        position: static;
    }
}

/* ===================================================================
   UX-1D — Layout Stabilization & Visual Hierarchy
   =================================================================== */

/* --- Hub grid: equal weight columns --- */
.prov-hub-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 14px;
}

@media (max-width: 1199.98px) {
    .prov-hub-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Borderless panel variant for hub --- */
.panel--flush > .prov-section-header {
    padding: 16px 18px 8px;
}

/* --- Run card row --- */
.prov-run-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    text-decoration: none;
    color: inherit;
    transition: background 0.1s;
}

.prov-run-card + .prov-run-card {
    border-top: 1px solid var(--admin-border-soft);
}

.prov-run-card:hover {
    background: var(--tone-neutral-bg);
}

.prov-run-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.prov-run-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--admin-text-strong);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prov-run-card-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    font-size: 11px;
    color: var(--admin-text-faint);
    line-height: 1.3;
}

.prov-run-card-meta .tenant-slug {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--admin-text-subtle);
}

.prov-run-card-meta .sep {
    color: var(--admin-border);
    font-size: 8px;
}

.prov-run-card-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.prov-run-card-badges {
    display: flex;
    align-items: center;
    gap: 6px;
}

.prov-run-card-progress {
    width: 56px;
    height: 3px;
    background: var(--admin-border-soft);
    border-radius: 2px;
    overflow: hidden;
}

.prov-run-card-progress-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--tone-positive);
    transition: width 0.3s;
}

.prov-run-card-progress-fill--active { background: var(--admin-accent); }
.prov-run-card-progress-fill--failed { background: var(--tone-critical); }

.prov-run-card-duration {
    font-size: 10.5px;
    color: var(--admin-text-faint);
    font-family: var(--font-mono);
    font-feature-settings: 'tnum';
    min-width: 48px;
    text-align: right;
}

/* --- Attention item (compact incident row) --- */
.prov-attention-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    text-decoration: none;
    color: inherit;
    transition: background 0.1s;
}

.prov-attention-item + .prov-attention-item {
    border-top: 1px solid var(--admin-border-soft);
}

.prov-attention-item:hover {
    background: var(--tone-neutral-bg);
}

.prov-attention-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.prov-attention-dot--failed  { background: var(--tone-critical); }
.prov-attention-dot--waiting { background: var(--tone-warning); }
.prov-attention-dot--partial { background: var(--tone-warning); }

.prov-attention-body {
    flex: 1;
    min-width: 0;
}

.prov-attention-body strong {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--admin-text-strong);
    line-height: 1.3;
}

.prov-attention-body small {
    font-size: 10.5px;
    color: var(--admin-text-faint);
}

.prov-attention-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.prov-attention-right em {
    font-style: normal;
    font-size: 10.5px;
    color: var(--admin-text-faint);
    font-family: var(--font-mono);
    font-feature-settings: 'tnum';
}

/* --- Queue item (compact step row) --- */
.prov-queue-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    cursor: pointer;
    border: 0;
    background: none;
    width: 100%;
    text-align: left;
    transition: background 0.1s;
}

.prov-queue-item + .prov-queue-item {
    border-top: 1px solid var(--admin-border-soft);
}

.prov-queue-item:hover {
    background: var(--tone-neutral-bg);
}

.prov-queue-item-body {
    flex: 1;
    min-width: 0;
}

.prov-queue-item-body strong {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--admin-text-strong);
}

.prov-queue-item-body small {
    font-size: 10.5px;
    color: var(--admin-text-faint);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Responsive --- */
@media (max-width: 767.98px) {
    .prov-run-card {
        flex-wrap: wrap;
    }
    .prov-run-card-right {
        width: 100%;
        justify-content: space-between;
    }
    .prov-run-card-progress {
        flex: 1;
        width: auto;
    }
    .prov-attention-item {
        flex-wrap: wrap;
    }
    .prov-attention-right {
        width: 100%;
        justify-content: flex-end;
        padding-top: 4px;
    }
}