/* =====================================================================
 * WPManager Admin — Design System v0.7
 * Vanilla CSS + CSS custom properties, zero build step.
 * Breakpoints: sm 640 · md 768 · lg 1024 · xl 1280 · 2xl 1536
 * Every interactive component MUST declare: default / hover / focus-visible / active / disabled.
 * ===================================================================== */

/* ── Reset ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
table { border-collapse: collapse; }

/* ── Design tokens ────────────────────────────────────────────────── */
:root {
    /* Surfaces */
    --bg: #F6F5F2;
    --surface: #FFFFFF;
    --surface-2: #F0EEE9;
    --surface-3: #E8E5DC;
    --border: #E2DFD8;
    --border-strong: #C8C4BB;
    --border-disabled: #EEEBE3;

    /* Text */
    --text-primary: #1A1916;
    --text-secondary: #6B6860;
    --text-muted: #9A9790;
    --text-disabled: #B7B4AC;
    --text-on-accent: #FFFFFF;

    /* Accent (deep charcoal) + interactive states */
    --accent: #1A1916;
    --accent-hover: #2D2C28;
    --accent-active: #0E0D0B;
    --accent-fg: #FFFFFF;

    /* Semantic colors with bg + text + hover */
    --teal: #0F6E56;
    --teal-hover: #0B5743;
    --teal-bg: #E1F5EE;
    --teal-bg-hover: #CFEDE2;
    --teal-text: #085041;

    --amber: #854F0B;
    --amber-hover: #6B3F08;
    --amber-bg: #FAEEDA;
    --amber-bg-hover: #F3E0BF;
    --amber-text: #633806;

    --red: #A32D2D;
    --red-hover: #8A2323;
    --red-bg: #FCEBEB;
    --red-bg-hover: #F7D6D6;
    --red-text: #791F1F;

    --blue: #185FA5;
    --blue-hover: #124B82;
    --blue-bg: #E6F1FB;
    --blue-bg-hover: #D1E4F7;
    --blue-text: #0C447C;

    --gray-bg: #F1EFE8;
    --gray-text: #444441;

    /* Row / nav / ghost hover surfaces */
    --bg-hover: #FAFAF8;
    --bg-active: var(--surface-2);

    /* Focus ring (teal for form) + (neutral for button) */
    --focus-ring: 0 0 0 3px rgba(15, 110, 86, 0.22);
    --focus-ring-neutral: 0 0 0 3px rgba(26, 25, 22, 0.14);
    --focus-ring-danger: 0 0 0 3px rgba(163, 45, 45, 0.22);

    /* Spacing scale */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-8: 32px;
    --sp-10: 40px;
    --sp-12: 48px;

    /* Radius */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-pill: 9999px;

    /* Shadow */
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.06);

    /* Container widths */
    --w-form: 960px;
    --w-form-narrow: 680px;
    --w-content: 1440px;

    /* Layout constants */
    --sidebar-w: 220px;
    --sidebar-w-mini: 64px;
    --header-h: 60px;

    /* Typography */
    --font-display: 'Syne', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'DM Mono', monospace;

    /* Motion */
    --transition-fast: 0.12s ease;
    --transition: 0.18s ease;
    --transition-slow: 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Global typography ───────────────────────────────────────────── */
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.3px; }

/* Default link reset; admin uses buttons/btn-ghost for nav */
a:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }

/* ═════════════════════════════════════════════════════════════════
 * LOGIN PAGE (standalone layout — no sidebar)
 * ════════════════════════════════════════════════════════════════ */
body.login {
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-4);
}

body.login .card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: var(--sp-8);
}

body.login .brand {
    display: flex; align-items: center; gap: var(--sp-2);
    margin-bottom: var(--sp-4);
}
body.login .brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
body.login .brand h1 { font-family: var(--font-display); font-size: 18px; }

body.login h2 { font-size: 22px; margin-bottom: 6px; }
body.login p { color: var(--text-secondary); font-size: 13.5px; margin-bottom: var(--sp-5); }

body.login .group { margin-bottom: var(--sp-4); }
body.login label { font-size: 12.5px; color: var(--text-secondary); display: block; margin-bottom: 6px; }

body.login input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
body.login input:hover:not(:disabled) { border-color: var(--border-strong); }
body.login input:focus-visible,
body.login input:focus {
    background: var(--surface);
    border-color: var(--accent);
    box-shadow: var(--focus-ring-neutral);
}

body.login .error { font-size: 12px; color: var(--red); margin-top: 5px; display: none; }

/* Login submit button — only bare button selector on login, kept scoped */
body.login button[type="submit"] {
    width: 100%;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: var(--accent-fg);
    font-weight: 600;
    font-size: 14px;
    transition: background var(--transition), box-shadow var(--transition), transform var(--transition-fast);
    margin-top: var(--sp-2);
}
body.login button[type="submit"]:hover:not(:disabled) { background: var(--accent-hover); }
body.login button[type="submit"]:focus-visible { outline: none; box-shadow: var(--focus-ring-neutral); }
body.login button[type="submit"]:active:not(:disabled) { background: var(--accent-active); transform: translateY(1px); }
body.login button[type="submit"]:disabled { opacity: 0.45; cursor: not-allowed; }

body.login .strength { height: 6px; background: var(--surface-2); border-radius: var(--radius-pill); overflow: hidden; margin-top: 6px; }
body.login .strength-bar { height: 100%; width: 0%; transition: width 0.2s ease, background 0.2s ease; }
body.login .weak { background: var(--red); }
body.login .medium { background: var(--amber); }
body.login .strong { background: var(--teal); }
body.login .helper { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* ═════════════════════════════════════════════════════════════════
 * LAYOUT — Sidebar · Header · Main · Page
 * ════════════════════════════════════════════════════════════════ */
.sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.25s ease, width 0.25s ease;
}

.sidebar-logo { padding: var(--sp-6) var(--sp-5) var(--sp-5); border-bottom: 1px solid var(--border); }
.sidebar-logo .brand {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text-primary);
    display: flex; align-items: center; gap: var(--sp-2);
}
.sidebar-logo .brand-dot { width: 8px; height: 8px; background: var(--text-primary); border-radius: 50%; display: inline-block; }

.sidebar-nav { padding: var(--sp-3) 10px; flex: 1; overflow-y: auto; }
.nav-label {
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: var(--sp-2) 10px 6px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 400;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    position: relative;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item:focus-visible { outline: none; box-shadow: var(--focus-ring-neutral); color: var(--text-primary); }
.nav-item.active { background: var(--accent); color: var(--accent-fg); font-weight: 500; }
.nav-item.active:hover { background: var(--accent-hover); }
.nav-item:disabled, .nav-item[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.nav-item .nav-icon { font-size: 15px; width: 18px; text-align: center; opacity: 0.85; flex-shrink: 0; }
.nav-item.active .nav-icon { opacity: 1; }
.nav-item .nav-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 var(--sp-8);
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    gap: var(--sp-3);
}
.header-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.2px;
}
.header-actions { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }

/* Page content — list pages go full-width up to --w-content */
.page { padding: var(--sp-6) var(--sp-8); flex: 1; width: 100%; }
.page-content { width: 100%; max-width: var(--w-content); margin: 0 auto; }
.page--form .page-content { max-width: var(--w-form); }

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--sp-5);
    gap: var(--sp-4);
    flex-wrap: wrap;
}
.page-header-left h1 { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.4px; margin-bottom: 2px; }
.page-header-left p { color: var(--text-secondary); font-size: 13.5px; }
.page-header-right { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }

/* ═════════════════════════════════════════════════════════════════
 * BUTTON — 5 states enforced on every variant
 * ════════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.25;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
    background: transparent;
    color: inherit;
    -webkit-appearance: none;
    appearance: none;
    user-select: none;
}
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring-neutral); }
.btn:active:not(:disabled):not([aria-disabled="true"]) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* Primary */
.btn-primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); color: var(--accent-fg); border-color: var(--accent-hover); }
.btn-primary:active:not(:disabled) { background: var(--accent-active); border-color: var(--accent-active); }

/* Secondary (outline) */
.btn-secondary { background: var(--surface); color: var(--text-primary); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--text-secondary); color: var(--text-primary); }
.btn-secondary:active:not(:disabled) { background: var(--surface-3); }

/* Ghost */
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: transparent; padding: 7px 10px; }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text-primary); }
.btn-ghost:active:not(:disabled) { background: var(--surface-3); }

/* Danger */
.btn-danger { background: var(--red-bg); color: var(--red-text); border-color: transparent; }
.btn-danger:hover:not(:disabled) { background: var(--red-bg-hover); color: var(--red-text); }
.btn-danger:active:not(:disabled) { background: var(--red); color: #fff; }
.btn-danger:focus-visible { box-shadow: var(--focus-ring-danger); }

/* Success (publish actions) */
.btn-success { background: var(--teal-bg); color: var(--teal-text); border-color: transparent; }
.btn-success:hover:not(:disabled) { background: var(--teal-bg-hover); }
.btn-success:active:not(:disabled) { background: var(--teal); color: #fff; }

/* Size + icon variants */
.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn-lg { padding: 11px 22px; font-size: 14.5px; }
.btn-icon { padding: 7px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }
.btn-group { display: inline-flex; gap: var(--sp-2); flex-wrap: wrap; }

/* Anchor used as button keeps same visuals */
a.btn { text-decoration: none; }

/* ═════════════════════════════════════════════════════════════════
 * FORMS — card · row · group · label · input · textarea · select · toggle
 * ════════════════════════════════════════════════════════════════ */
.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: var(--w-form);
    margin: 0 auto;
}
.form-card--narrow { max-width: var(--w-form-narrow); }

.form-section { padding: var(--sp-6) var(--sp-8); border-bottom: 1px solid var(--border); }
.form-section:last-child { border-bottom: none; }
.form-section-title {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: var(--sp-4);
}

.form-row { display: grid; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.form-row:last-child { margin-bottom: 0; }
.form-row.cols-1 { grid-template-columns: 1fr; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-row.split-2-1 { grid-template-columns: 2fr 1fr; }

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

.form-label, label {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}
.form-required, label .required {
    color: var(--red);
    font-size: 11px;
    margin-left: 2px;
}

input[type="text"], input[type="url"], input[type="email"],
input[type="password"], input[type="date"], input[type="number"],
input[type="search"], input[type="tel"],
select, textarea, .form-input {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    appearance: none;
    -webkit-appearance: none;
}
input:hover:not(:disabled):not(:focus),
select:hover:not(:disabled):not(:focus),
textarea:hover:not(:disabled):not(:focus) { border-color: var(--border-strong); }
input:focus-visible, select:focus-visible, textarea:focus-visible,
input:focus, select:focus, textarea:focus {
    border-color: var(--teal);
    background: var(--surface);
    box-shadow: var(--focus-ring);
}
input:disabled, select:disabled, textarea:disabled {
    background: var(--surface-2);
    color: var(--text-disabled);
    border-color: var(--border-disabled);
    cursor: not-allowed;
}
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] {
    border-color: var(--red);
}
input[aria-invalid="true"]:focus, textarea[aria-invalid="true"]:focus { box-shadow: var(--focus-ring-danger); }
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input.mono, textarea.mono { font-family: var(--font-mono); font-size: 13px; }

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B6860' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
    cursor: pointer;
}
textarea { resize: vertical; min-height: 80px; line-height: 1.6; }

.field-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.field-error { font-size: 11.5px; color: var(--red); margin-top: 3px; }

/* Toggle */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-3) 0;
}
.toggle-row + .toggle-row { border-top: 1px solid var(--border); }
.toggle-info { flex: 1; }
.toggle-info strong { display: block; font-size: 13.5px; font-weight: 500; margin-bottom: 2px; color: var(--text-primary); }
.toggle-info span { font-size: 12px; color: var(--text-secondary); }

.toggle { position: relative; width: 36px; height: 20px; flex-shrink: 0; margin-left: var(--sp-3); }
.toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border-strong);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: background var(--transition), box-shadow var(--transition);
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 14px; height: 14px;
    left: 3px; top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--transition);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.toggle input:checked + .toggle-slider { background: var(--teal); }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); }
.toggle input:focus-visible + .toggle-slider { box-shadow: var(--focus-ring); }
.toggle input:disabled + .toggle-slider { opacity: 0.5; cursor: not-allowed; }

.form-footer {
    padding: var(--sp-5) var(--sp-8);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--sp-3);
    background: var(--bg);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    flex-wrap: wrap;
}
.form-footer-right { margin-left: auto; display: flex; gap: var(--sp-2); flex-wrap: wrap; }

/* ═════════════════════════════════════════════════════════════════
 * TOOLBAR · SEARCH · FILTER
 * ════════════════════════════════════════════════════════════════ */
.toolbar {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-4);
    flex-wrap: wrap;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--sp-3) var(--sp-4);
    box-shadow: var(--shadow);
}
.toolbar--flush { background: transparent; border: 0; padding: 0; box-shadow: none; margin-bottom: var(--sp-4); }

.search-wrap { position: relative; flex: 1 1 260px; max-width: 360px; min-width: 200px; display: flex; align-items: center; }
.search-wrap > svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px !important;
    height: 16px !important;
    max-width: 16px;
    pointer-events: none;
    z-index: 1;
}
input.search-input {
    width: 100%;
    padding: 8px 12px 8px 40px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 13.5px;
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
input.search-input:hover:not(:focus) { border-color: var(--border-strong); }
input.search-input:focus-visible, input.search-input:focus {
    border-color: var(--teal);
    background: var(--surface);
    box-shadow: var(--focus-ring);
}
input.search-input::placeholder { color: var(--text-muted); }

.filter-select {
    width: auto;
    min-width: 180px;
    flex: 0 0 auto;
    padding: 8px 34px 8px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 13.5px;
    color: var(--text-secondary);
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B6860' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.filter-select:hover:not(:disabled) { border-color: var(--border-strong); }
.filter-select:focus-visible { border-color: var(--teal); box-shadow: var(--focus-ring); }

/* ═════════════════════════════════════════════════════════════════
 * TABLE
 * ════════════════════════════════════════════════════════════════ */
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    width: 100%;
}
table { width: 100%; }
thead tr { border-bottom: 1px solid var(--border); background: var(--surface); }
thead th {
    padding: 11px 16px;
    text-align: left;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    white-space: nowrap;
    user-select: none;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition-fast); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }
tbody td { padding: 13px 16px; vertical-align: middle; }

.domain-name { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--text-primary); }
.domain-registrar { font-size: 12.5px; color: var(--text-secondary); }
.expiry-date { font-size: 13px; color: var(--text-secondary); }
.expiry-soon { color: var(--amber); font-weight: 500; }
.expiry-expired { color: var(--red); font-weight: 500; }

.row-actions { display: flex; align-items: center; gap: var(--sp-1); justify-content: flex-end; flex-wrap: wrap; }
.row-actions-stack { display: flex; flex-direction: column; align-items: flex-end; gap: var(--sp-1); }
.row-actions-stack .row-actions { justify-content: flex-end; }

/* ═════════════════════════════════════════════════════════════════
 * BADGE · ALERT · EMPTY · STATS
 * ════════════════════════════════════════════════════════════════ */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    font-size: 11.5px;
    font-weight: 500;
    white-space: nowrap;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; }
.badge-active   { background: var(--teal-bg);  color: var(--teal-text); }
.badge-active   .badge-dot { background: var(--teal); }
.badge-expiring { background: var(--amber-bg); color: var(--amber-text); }
.badge-expiring .badge-dot { background: var(--amber); }
.badge-expired  { background: var(--red-bg);   color: var(--red-text); }
.badge-expired  .badge-dot { background: var(--red); }
.badge-inactive { background: var(--gray-bg);  color: var(--gray-text); }
.badge-inactive .badge-dot { background: #888780; }
.badge-info     { background: var(--blue-bg);  color: var(--blue-text); }
.badge-info     .badge-dot { background: var(--blue); }

.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-2);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    line-height: 1.5;
    border: 1px solid transparent;
    margin-bottom: var(--sp-4);
}
.alert-success { background: var(--teal-bg);  color: var(--teal-text);  border-color: #C8E8DD; }
.alert-error   { background: var(--red-bg);   color: var(--red-text);   border-color: #F2C8C8; }
.alert-warning { background: var(--amber-bg); color: var(--amber-text); border-color: #EED9AE; }
.alert-info    { background: var(--blue-bg);  color: var(--blue-text);  border-color: #C5DDF3; }

.empty-state { text-align: center; padding: var(--sp-10) var(--sp-5); }
.empty-icon { font-size: 40px; margin-bottom: var(--sp-3); opacity: 0.6; }
.empty-state h3 { font-family: var(--font-display); font-size: 16px; margin-bottom: 6px; }
.empty-state p { color: var(--text-secondary); font-size: 13.5px; }

.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); margin-bottom: var(--sp-5); }
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--sp-4) 18px;
    transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-label { font-size: 11.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; font-weight: 500; }
.stat-value { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -0.5px; }
.stat-value.green { color: var(--teal); }
.stat-value.amber { color: var(--amber); }
.stat-value.red { color: var(--red); }

/* ═════════════════════════════════════════════════════════════════
 * PAGINATION
 * ════════════════════════════════════════════════════════════════ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
    flex-wrap: wrap;
    gap: var(--sp-3);
    background: var(--surface);
}
.pagination-btns { display: flex; gap: var(--sp-1); flex-wrap: wrap; }
.page-btn {
    padding: 5px 11px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 13px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
    font-family: var(--font-body);
}
.page-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text-primary); border-color: var(--border-strong); }
.page-btn:focus-visible { outline: none; box-shadow: var(--focus-ring-neutral); }
.page-btn:active:not(:disabled) { background: var(--surface-3); }
.page-btn.active { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.page-btn.active:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.page-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* List / form page swap (classic pattern: show/hide) */
.form-page { display: none; }
.form-page.visible { display: block; }
.list-page { display: block; }
.list-page.hidden { display: none; }

/* ═════════════════════════════════════════════════════════════════
 * MODAL
 * ════════════════════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-5);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}
.modal-overlay.visible { opacity: 1; pointer-events: all; }
.modal {
    background: var(--surface);
    border-radius: var(--radius);
    padding: var(--sp-8);
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    transform: translateY(8px);
    transition: transform var(--transition);
}
.modal-overlay.visible .modal { transform: translateY(0); }
.modal-icon {
    width: 44px; height: 44px;
    background: var(--red-bg);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    margin-bottom: var(--sp-4);
}
.modal h3 { font-family: var(--font-display); font-size: 17px; font-weight: 700; margin-bottom: var(--sp-2); }
.modal p { color: var(--text-secondary); font-size: 13.5px; line-height: 1.6; margin-bottom: 6px; }
.modal .domain-highlight {
    font-family: var(--font-mono);
    font-size: 13px;
    background: var(--surface-2);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin: 10px 0;
    word-break: break-all;
}
.modal-actions { display: flex; gap: var(--sp-2); justify-content: flex-end; margin-top: var(--sp-5); flex-wrap: wrap; }

/* ═════════════════════════════════════════════════════════════════
 * TOAST
 * ════════════════════════════════════════════════════════════════ */
.toast {
    position: fixed;
    bottom: var(--sp-6); right: var(--sp-6);
    background: var(--text-primary);
    color: #fff;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    box-shadow: var(--shadow-lg);
    z-index: 300;
    transform: translateY(80px);
    opacity: 0;
    transition: transform var(--transition-slow), opacity var(--transition-slow);
    pointer-events: none;
    max-width: calc(100vw - var(--sp-8));
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ═════════════════════════════════════════════════════════════════
 * MOBILE HAMBURGER + SIDEBAR OVERLAY
 * ════════════════════════════════════════════════════════════════ */
.menu-btn {
    display: none;
    padding: 7px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-primary);
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.menu-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.menu-btn:focus-visible { outline: none; box-shadow: var(--focus-ring-neutral); }
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 90;
}

/* ═════════════════════════════════════════════════════════════════
 * SITE SWITCHER (M2)
 * ════════════════════════════════════════════════════════════════ */
.site-switcher { position: relative; display: inline-block; }
.site-switcher .site-switcher-btn {
    display: inline-flex; align-items: center; gap: var(--sp-2);
    width: auto; margin: 0;
    padding: 6px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text-primary);
    font-weight: 500; font-size: 13px; cursor: pointer; line-height: 1.2;
    max-width: 280px;
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.site-switcher .site-switcher-btn:hover:not(:disabled) {
    background: var(--surface-2); color: var(--text-primary);
    border-color: var(--text-secondary);
}
.site-switcher .site-switcher-btn:focus-visible { outline: none; box-shadow: var(--focus-ring-neutral); }
.site-switcher .site-switcher-btn:active:not(:disabled) { background: var(--surface-3); }
.site-switcher .site-switcher-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.site-switcher-btn > span:first-child {
    max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-family: var(--font-mono);
}
.site-switcher-btn .chev { color: var(--text-muted); font-size: 11px; }
.site-switcher-panel {
    position: absolute; top: calc(100% + 4px); right: 0;
    background: var(--surface); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: var(--sp-2); min-width: 320px; z-index: 9999;
}
.site-switcher-panel input {
    width: 100%; padding: 6px 10px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    margin-bottom: 6px; font-size: 13px;
    color: var(--text-primary); background: var(--surface);
}
.site-switcher-panel ul { list-style: none; max-height: 280px; overflow-y: auto; }
.site-switcher-panel li {
    padding: 6px 10px; cursor: pointer; border-radius: var(--radius-sm);
    font-family: var(--font-mono); font-size: 12px; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
    color: var(--text-primary);
    transition: background var(--transition);
}
.site-switcher-panel li:hover { background: var(--surface-2); }
.site-switcher-panel li:focus-visible { outline: none; background: var(--surface-2); box-shadow: var(--focus-ring-neutral) inset; }
.site-switcher-panel li.is-active { background: var(--accent); color: var(--accent-fg); font-weight: 500; }
.site-switcher-empty { color: var(--text-muted); font-size: 12px; padding: var(--sp-2); }

/* ═════════════════════════════════════════════════════════════════
 * UTILITIES
 * ════════════════════════════════════════════════════════════════ */
.u-flex { display: flex; }
.u-flex-col { display: flex; flex-direction: column; }
.u-items-center { align-items: center; }
.u-justify-between { justify-content: space-between; }
.u-gap-1 { gap: var(--sp-1); } .u-gap-2 { gap: var(--sp-2); } .u-gap-3 { gap: var(--sp-3); } .u-gap-4 { gap: var(--sp-4); }
.u-mt-2 { margin-top: var(--sp-2); } .u-mt-3 { margin-top: var(--sp-3); } .u-mt-4 { margin-top: var(--sp-4); } .u-mt-6 { margin-top: var(--sp-6); }
.u-mb-2 { margin-bottom: var(--sp-2); } .u-mb-3 { margin-bottom: var(--sp-3); } .u-mb-4 { margin-bottom: var(--sp-4); } .u-mb-6 { margin-bottom: var(--sp-6); }
.u-text-muted { color: var(--text-muted); }
.u-text-center { text-align: center; }
.u-mono { font-family: var(--font-mono); }
.u-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-full { width: 100%; }

/* Visually hidden but accessible to screen readers */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}

/* ═════════════════════════════════════════════════════════════════
 * RESPONSIVE — sm 640 · md 768 · lg 1024 · xl 1280 · 2xl 1536
 * ════════════════════════════════════════════════════════════════ */

/* xl+ (≥ 1280px) — cap content width, give main more air */
@media (min-width: 1280px) {
    .page { padding: var(--sp-8) var(--sp-10); }
}

/* 2xl (≥ 1536px) — keep content centered, not edge-aligned */
@media (min-width: 1536px) {
    .page { padding: var(--sp-10) var(--sp-12); }
}

/* lg- (< 1024px) — stats collapse to 2 cols */
@media (max-width: 1023.98px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .form-row.cols-3 { grid-template-columns: 1fr 1fr; }
}

/* md- (< 768px) — mobile: sidebar becomes drawer, single-column forms */
@media (max-width: 767.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .sidebar-overlay { display: block; opacity: 0; pointer-events: none; transition: opacity var(--transition); }
    .sidebar-overlay.visible { opacity: 1; pointer-events: all; }
    .menu-btn { display: inline-flex; align-items: center; }
    .main { margin-left: 0; }
    .header { padding: 0 var(--sp-4); }
    .page { padding: var(--sp-4); }

    .stats-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-value { font-size: 22px; }

    .toolbar { gap: var(--sp-2); padding: var(--sp-3); }
    .search-wrap { max-width: 100%; flex: 1 1 100%; }
    .filter-select { flex: 1 1 100%; min-width: 0; width: 100%; }

    .table-wrap { overflow-x: auto; }
    table { min-width: 560px; }

    .form-row.cols-2, .form-row.cols-3, .form-row.split-2-1 { grid-template-columns: 1fr; }
    .form-section { padding: var(--sp-4) var(--sp-4); }
    .form-footer { padding: var(--sp-4); flex-wrap: wrap; }
    .form-footer-right { margin-left: 0; width: 100%; }

    .page-header { flex-direction: column; align-items: stretch; gap: var(--sp-3); }
    .page-header-right { justify-content: flex-start; }
}

/* sm- (< 640px) — phone: stack stats, full-width buttons, compact header */
@media (max-width: 639.98px) {
    .stats-row { grid-template-columns: 1fr; }
    .header-title { font-size: 14px; }
    .btn-text-hide { display: none; }
    .btn { padding: 9px 14px; }
    .form-footer .btn { flex: 1 1 auto; }
    .toast { left: var(--sp-3); right: var(--sp-3); bottom: var(--sp-3); max-width: none; }
    .modal { padding: var(--sp-5); }
    .site-switcher-panel { min-width: calc(100vw - var(--sp-6)); }
}

/* ═════════════════════════════════════════════════════════════════
 * BULK IMPORT — fleet onboarding console (websites.tpl)
 * 4 stages: file · preview · run · summary
 * ════════════════════════════════════════════════════════════════ */
.bulk-import {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: var(--sp-6);
}

/* — Top stepper rail ——————————————————————————————— */
.bulk-rail {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-4) var(--sp-6);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.bulk-rail-eyebrow {
    font-family: var(--font-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-muted);
    margin-right: var(--sp-3);
}
.bulk-stepper {
    display: flex;
    align-items: center;
    gap: 0;
    list-style: none;
    flex: 1;
    flex-wrap: wrap;
}
.bulk-stepper li {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: 12.5px;
    color: var(--text-muted);
    padding: 4px 10px 4px 4px;
    transition: color var(--transition);
    position: relative;
}
.bulk-stepper li::after {
    content: '';
    width: 24px;
    height: 1px;
    background: var(--border-strong);
    margin-left: var(--sp-2);
}
.bulk-stepper li:last-child::after { display: none; }
.bulk-stepper .step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    transition: all var(--transition);
}
.bulk-stepper li.active { color: var(--text-primary); font-weight: 600; }
.bulk-stepper li.active .step-num {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-fg);
    box-shadow: 0 0 0 4px rgba(26,25,22,0.08);
}
.bulk-stepper li.done { color: var(--teal-text); }
.bulk-stepper li.done .step-num {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
}
.bulk-stepper li.done .step-num::before { content: '✓'; font-size: 12px; }
.bulk-stepper li.done .step-num span { display: none; }

.bulk-rail-close {
    margin-left: auto;
    font-size: 18px;
    line-height: 1;
    color: var(--text-muted);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.bulk-rail-close:hover { background: var(--surface-3); color: var(--text-primary); }

/* — Stage container —————————————————————————————— */
.bulk-stage { padding: var(--sp-6) var(--sp-8); }
.bulk-stage[hidden] { display: none; }

/* — Stage 1: dropzone ——————————————————————————— */
.dropzone {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg);
    padding: var(--sp-12) var(--sp-6);
    text-align: center;
    transition: all var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.dropzone::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(15,110,86,0.04), transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(26,25,22,0.03), transparent 40%);
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition);
}
.dropzone:hover { border-color: var(--accent); background: var(--surface); }
.dropzone:hover::before { opacity: 1; }
.dropzone.is-dragover {
    border-color: var(--teal);
    background: var(--teal-bg);
    transform: scale(1.005);
}
.dropzone.is-dragover::before { opacity: 1; }
.dropzone-icon {
    font-family: var(--font-display);
    font-size: 44px;
    line-height: 1;
    color: var(--text-secondary);
    margin-bottom: var(--sp-3);
    transition: color var(--transition);
}
.dropzone:hover .dropzone-icon { color: var(--accent); }
.dropzone.is-dragover .dropzone-icon { color: var(--teal); }
.dropzone-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.4px;
    color: var(--text-primary);
    margin-bottom: var(--sp-2);
}
.dropzone-hint {
    font-size: 13.5px;
    color: var(--text-secondary);
    margin-bottom: var(--sp-4);
}
.dropzone-hint .pick-link {
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
    cursor: pointer;
}
.dropzone-meta {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 6px 14px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-top: var(--sp-2);
}
.dropzone-meta strong { color: var(--text-primary); font-weight: 600; }

.dropzone-foot {
    display: flex;
    justify-content: center;
    gap: var(--sp-3);
    margin-top: var(--sp-4);
    flex-wrap: wrap;
}
.lock-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--teal-bg);
    color: var(--teal-text);
    border-radius: var(--radius-pill);
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
}
.lock-pill::before {
    content: '🔒';
    font-size: 12px;
}

/* — Stat shelf (stages 2 + 4) —————————————————— */
.bulk-shelf {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    margin-bottom: var(--sp-5);
}
.shelf-cell {
    padding: var(--sp-4) var(--sp-5);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.shelf-cell:last-child { border-right: none; }
.shelf-label {
    font-family: var(--font-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}
.shelf-value {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.6px;
    color: var(--text-primary);
    line-height: 1;
}
.shelf-value.green { color: var(--teal); }
.shelf-value.amber { color: var(--amber); }
.shelf-value.red { color: var(--red); }
.shelf-cell-extra {
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* — Filter tabs (segmented) ——————————————————— */
.bulk-tabs {
    display: inline-flex;
    background: var(--surface-2);
    border-radius: var(--radius-pill);
    padding: 3px;
    gap: 2px;
    margin-bottom: var(--sp-3);
}
.bulk-tabs button {
    padding: 6px 14px;
    font-size: 12.5px;
    color: var(--text-secondary);
    border-radius: var(--radius-pill);
    transition: all var(--transition);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.bulk-tabs button:hover:not(.active) { color: var(--text-primary); }
.bulk-tabs button.active {
    background: var(--surface);
    color: var(--text-primary);
    box-shadow: var(--shadow);
    font-weight: 600;
}
.bulk-tabs button .count {
    font-family: var(--font-mono);
    font-size: 11px;
    background: var(--surface-3);
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    min-width: 22px;
    text-align: center;
}
.bulk-tabs button.active .count { background: var(--accent); color: var(--accent-fg); }

/* — Tables (preview + run + summary) ——————————— */
.bulk-table-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: var(--sp-4);
    max-height: 480px;
    overflow-y: auto;
}
.bulk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.bulk-table thead {
    position: sticky;
    top: 0;
    background: var(--surface-2);
    z-index: 1;
}
.bulk-table th {
    text-align: left;
    padding: 10px var(--sp-4);
    font-family: var(--font-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.bulk-table td {
    padding: 10px var(--sp-4);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.bulk-table tbody tr:last-child td { border-bottom: none; }
.bulk-table tbody tr { transition: background var(--transition-fast); }
.bulk-table tbody tr:hover { background: var(--bg-hover); }
.bulk-table .col-idx { width: 48px; color: var(--text-muted); font-family: var(--font-mono); font-size: 12px; }
.bulk-table .col-url { font-family: var(--font-mono); font-size: 12.5px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulk-table .col-mono { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-secondary); }
.bulk-table .col-status { width: 200px; }

/* row state highlight */
.bulk-table tr.row-invalid { background: rgba(133, 79, 11, 0.04); }
.bulk-table tr.row-invalid:hover { background: rgba(133, 79, 11, 0.08); }
.bulk-table tr.row-success td { color: var(--text-primary); }
.bulk-table tr.row-warning { background: rgba(133, 79, 11, 0.04); }
.bulk-table tr.row-error { background: rgba(163, 45, 45, 0.05); }
.bulk-table tr.row-error:hover { background: rgba(163, 45, 45, 0.09); }
.bulk-table tr.row-running { background: rgba(15, 110, 86, 0.04); }
.bulk-table tr.row-active { box-shadow: inset 3px 0 0 var(--accent); }

.row-issues {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}
.row-issue-chip {
    display: inline-block;
    background: var(--amber-bg);
    color: var(--amber-text);
    font-family: var(--font-mono);
    font-size: 10.5px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    line-height: 1.5;
}

/* row status badge (mini) */
.row-state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
}
.row-state-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
}
.row-state.is-pending .row-state-dot { background: var(--text-muted); }
.row-state.is-running .row-state-dot {
    background: var(--blue);
    animation: rowPulse 1.2s ease-in-out infinite;
}
.row-state.is-success { color: var(--teal-text); }
.row-state.is-success .row-state-dot { background: var(--teal); }
.row-state.is-warning { color: var(--amber-text); }
.row-state.is-warning .row-state-dot { background: var(--amber); }
.row-state.is-error { color: var(--red-text); }
.row-state.is-error .row-state-dot { background: var(--red); }
.row-state.is-skipped { color: var(--text-muted); }
.row-state.is-skipped .row-state-dot { background: transparent; border: 1px dashed var(--border-strong); }
@keyframes rowPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.4); }
}

/* — Pipeline ribbon (per-row 6 dots) ———————————— */
.pipeline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
}
.pipeline-step {
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--surface);
    border: 1.5px solid var(--border-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: transparent;
    transition: all var(--transition);
    flex-shrink: 0;
    position: relative;
}
.pipeline-step[data-done="1"] {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
}
.pipeline-step[data-done="1"]::after {
    content: '';
    position: absolute;
    width: 4px; height: 7px;
    border: solid #fff;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg) translate(-1px, -1px);
}
.pipeline-step[data-warn="1"] {
    background: var(--amber);
    border-color: var(--amber);
}
.pipeline-step[data-warn="1"]::after {
    content: '!';
    color: #fff;
    font-weight: 700;
    font-size: 9px;
}
.pipeline-step[data-fail="1"] {
    background: var(--red);
    border-color: var(--red);
}
.pipeline-step[data-fail="1"]::after {
    content: '×';
    color: #fff;
    font-weight: 700;
    font-size: 11px;
    line-height: 1;
}
.pipeline-step[data-active="1"] {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 0 0 rgba(26,25,22,0.4);
    animation: pipelinePulse 1.1s ease-out infinite;
}
.pipeline-step[data-skip="1"] {
    border-style: dashed;
    border-color: var(--border-disabled);
    background: transparent;
}
@keyframes pipelinePulse {
    0% { box-shadow: 0 0 0 0 rgba(26,25,22,0.35); }
    100% { box-shadow: 0 0 0 7px rgba(26,25,22,0); }
}
.pipeline-rail {
    display: flex;
    align-items: center;
    gap: 12px;
}
.pipeline-rail .pipeline-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    min-width: 80px;
}

/* Pipeline legend (under run table) */
.pipeline-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: var(--sp-4);
}
.pipeline-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.pipeline-legend-item span:first-child {
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* — Runtime progress meter ————————————————————— */
.runtime-meter {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--sp-4) var(--sp-5);
    margin-bottom: var(--sp-4);
}
.meter-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: var(--sp-2);
    gap: var(--sp-3);
    flex-wrap: wrap;
}
.meter-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text-primary);
}
.meter-title .meter-status-text { font-family: var(--font-body); font-weight: 500; font-size: 13.5px; color: var(--text-secondary); margin-left: var(--sp-2); }
.meter-count {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--text-secondary);
}
.meter-count strong { color: var(--text-primary); font-weight: 600; }
.meter-bar {
    height: 8px;
    background: var(--surface-3);
    border-radius: var(--radius-pill);
    overflow: hidden;
    position: relative;
}
.meter-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--teal) 100%);
    border-radius: var(--radius-pill);
    transition: width 0.4s ease;
    position: relative;
    overflow: hidden;
}
.meter-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255,255,255,0.25) 50%,
        transparent 100%);
    transform: translateX(-100%);
    animation: meterShimmer 1.6s linear infinite;
}
.meter-fill.is-done::after { animation: none; }
@keyframes meterShimmer {
    to { transform: translateX(100%); }
}
.meter-tally {
    display: flex;
    gap: var(--sp-4);
    margin-top: var(--sp-2);
    font-family: var(--font-mono);
    font-size: 12px;
}
.meter-tally span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}
.meter-tally span::before {
    content: '';
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}
.meter-tally span.t-ok::before { background: var(--teal); }
.meter-tally span.t-warn::before { background: var(--amber); }
.meter-tally span.t-fail::before { background: var(--red); }
.meter-tally span.t-pending::before { background: var(--text-muted); }

/* — Foot (action bar) ———————————————————————— */
.bulk-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-3);
    padding-top: var(--sp-4);
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.bulk-foot-left, .bulk-foot-right {
    display: flex;
    gap: var(--sp-2);
    flex-wrap: wrap;
}

/* — Section labels —————————————————————————— */
.bulk-section-title {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: var(--text-primary);
    margin-bottom: var(--sp-2);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}
.bulk-section-title .eyebrow {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-muted);
    font-weight: 500;
}

/* — Auth method chip in preview ——————————————— */
.auth-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: var(--radius-pill);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
}
.auth-chip[data-auth="password"] { background: var(--surface-3); color: var(--text-secondary); }
.auth-chip[data-auth="key"] { background: var(--blue-bg); color: var(--blue-text); }
.auth-chip[data-auth="invalid"] { background: var(--red-bg); color: var(--red-text); }

/* secret indicator (preview only — confirms presence, not value) */
.secret-dot {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}
.secret-dot::before {
    content: '';
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--teal);
    flex-shrink: 0;
}
.secret-dot.is-empty::before { background: var(--red); }
.secret-dot.is-empty { color: var(--red-text); }

/* responsive */
@media (max-width: 1023.98px) {
    .bulk-stage { padding: var(--sp-5); }
    .bulk-rail { padding: var(--sp-3) var(--sp-4); }
}
@media (max-width: 767.98px) {
    .bulk-shelf { grid-template-columns: repeat(2, 1fr); }
    .shelf-cell:nth-child(2n) { border-right: none; }
    .shelf-cell:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
    .shelf-value { font-size: 24px; }
    .dropzone { padding: var(--sp-8) var(--sp-4); }
    .dropzone-icon { font-size: 32px; }
    .dropzone-title { font-size: 18px; }
    .pipeline-rail .pipeline-label { display: none; }
    .bulk-stepper li { font-size: 11.5px; padding: 4px 6px 4px 4px; }
    .bulk-stepper li::after { width: 12px; margin-left: 6px; }
    .bulk-rail-eyebrow { display: none; }
}
