/* ── Design tokens (aligned with Rozetka) ─────────────── */
:root {
    --font-ui: system-ui, -apple-system, Arial, "Segoe UI", Roboto, Helvetica, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, monospace;

    --bg: #f5f5f5;
    --bg-card: #fff;
    --bg-subtle: #f0f0f0;
    --bg-inset: #e8e8e8;

    --text: #221f1f;
    --text-secondary: #797878;
    --text-muted: #999;

    --border: #e0e0e0;
    --border-strong: #c8c8c8;

    --link: #3e77aa;

    --accent: #00a046;
    --accent-hover: #008a3b;
    --accent-subtle: #e8f7ee;

    --danger: #f84147;
    --danger-subtle: #fff0f0;
    --danger-muted: #d63031;

    --success: #00a046;
    --success-subtle: #e8f7ee;

    --info: #3e77aa;
    --info-subtle: #edf6ff;

    --nav-bg: #221f1f;
    --nav-text: #e8e8e8;

    --shadow-sm: 0 1px 2px rgba(34,31,31,0.06);
    --shadow-md: 0 2px 8px rgba(34,31,31,0.08), 0 1px 2px rgba(34,31,31,0.04);
    --shadow-lg: 0 4px 16px rgba(34,31,31,0.1), 0 2px 4px rgba(34,31,31,0.05);

    --radius: 4px;
    --radius-sm: 3px;
}

/* ── Reset & base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: var(--font-ui);
    font-size: 0.925rem;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--text); }

/* ── Navigation ───────────────────────────────────────── */
nav {
    background: var(--nav-bg);
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 52px;
    position: sticky;
    top: 0;
    z-index: 50;
}
nav .brand {
    flex: 1;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.02em;
}
nav .brand::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    margin-right: 0.5rem;
    vertical-align: middle;
}
.nav-stats { display: flex; align-items: center; gap: 0.4rem; font-size: 0.75rem; color: var(--nav-text); }
.nav-stats-pill {
    padding: 0.2rem 0.6rem;
    background: rgba(255,255,255,0.08);
    border-radius: 9999px;
    white-space: nowrap;
}
#shop-brand { display: inline; margin-right: 0.75rem; }
.nav-shop-link {
    color: var(--nav-text);
    opacity: 0.7;
    font-size: 0.85rem;
    text-decoration: none;
    transition: opacity 0.15s;
}
.nav-shop-link:hover { opacity: 1; color: #fff; }
.scan-pill-running {
    background: rgba(62,119,170,0.25);
    color: #8ec4f0;
}
.scan-pill-running::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #8ec4f0;
    margin-right: 0.4rem;
    vertical-align: middle;
    animation: pulse 1.5s ease-in-out infinite;
}
.scan-pill-completed { background: rgba(0,160,70,0.2); color: #5fd38d; }
.scan-pill-failed { background: rgba(248,65,71,0.2); color: #f87171; }
nav .nav-right { flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 1rem; }
nav .nav-right span { color: var(--nav-text); font-size: 0.85rem; }
nav .nav-right a { color: var(--nav-text); font-size: 0.85rem; opacity: 0.7; }
nav .nav-right a:hover { opacity: 1; color: #fff; }
.logout-form { display: inline; }
.logout-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--nav-text);
    cursor: pointer;
    font-size: 0.8rem;
    font-family: var(--font-ui);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: border-color 0.15s, background 0.15s;
}
.logout-btn:hover { border-color: rgba(255,255,255,0.35); background: rgba(255,255,255,0.08); }

/* ── Layout ───────────────────────────────────────────── */
.container { max-width: 1400px; margin: 1.5rem auto; padding: 0 1.5rem; }

/* ── Card ─────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    border: 1px solid var(--border);
}
.card h1 {
    margin-bottom: 0.25rem;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
}
.card > p { color: var(--text-secondary); margin-bottom: 1.5rem; }

/* ── Forms ────────────────────────────────────────────── */
.form-group { margin-bottom: 1.15rem; }
.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.form-group input, .form-group select {
    width: 100%;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.925rem;
    font-family: var(--font-ui);
    background: var(--bg-card);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.seller-url-input::placeholder {
    color: var(--text-muted);
}
.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}
/* Small numeric inputs (e.g. settings "default delta") shouldn't stretch
   full-width — cap them so the field matches the value it holds. */
.inline-form input[type="number"] { width: auto; max-width: 7rem; }
/* Embedded onboarding video (settings page): responsive 16:9, capped width. */
.video-embed {
    width: 100%;
    max-width: 560px;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: var(--radius-sm);
}
.btn {
    display: inline-block;
    padding: 0.55rem 1.5rem;
    background: var(--nav-bg);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font-ui);
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.btn:hover { background: #333; }
.btn:active { transform: scale(0.98); }
.btn-small {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
}
.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover { background: #c53030; }
.btn-outline {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-outline:hover { background: rgba(0, 0, 0, 0.03); }
.btn-outline:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-disabled {
    background: var(--text-muted);
    color: #fff;
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Messages ─────────────────────────────────────────── */
.error-msg {
    color: var(--danger-muted);
    background: var(--danger-subtle);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    border-left: 3px solid var(--danger);
}
.success-msg {
    color: var(--success);
    background: var(--success-subtle);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    border-left: 3px solid var(--accent);
}
.text-muted { color: var(--text-muted); font-size: 0.875rem; margin-top: 1rem; }
.text-muted a { color: var(--link); font-weight: 500; }
.text-small { font-size: 0.8rem; }

/* ── Auth cards ───────────────────────────────────────── */
.auth-card {
    max-width: 420px;
    margin: 0 auto;
    position: relative;
    top: calc(50vh - 52px - 200px);
    border-left: 3px solid var(--nav-bg);
}
.auth-card h1 { margin-bottom: 1.5rem; }

/* ── Error pages ──────────────────────────────────────── */
.error-page {
    text-align: center;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    top: calc(50vh - 52px - 160px);
    border-left: none;
    border-top: 3px solid var(--danger);
}
.error-page h1 { margin-bottom: 0.75rem; font-size: 2rem; }
.error-page p { color: var(--text-secondary); margin-bottom: 1.5rem; }
.error-page .btn {
    background: var(--nav-bg);
    color: #fff;
    text-decoration: none;
}

/* ── Sort / filter controls ───────────────────────────── */
.controls {
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: baseline;
}
.sort-controls, .filter-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}
.sort-controls > span, .filter-controls > span {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    margin-right: 0.25rem;
}
.sort-link, .filter-link {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    font-size: 0.825rem;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: 9999px;
    background: var(--bg-card);
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
}
.sort-link:hover, .filter-link:hover {
    background: var(--bg-subtle);
    border-color: var(--border-strong);
    color: var(--text);
}
.sort-link.active, .filter-link.active {
    background: var(--nav-bg);
    color: #fff;
    border-color: var(--nav-bg);
}
.sort-link.active:hover, .filter-link.active:hover {
    background: #333;
    border-color: #333;
}
.filter-link.filter-disabled {
    color: var(--border);
    border-color: var(--border);
    background: var(--bg);
    cursor: not-allowed;
}
.filter-link.filter-disabled:hover {
    color: var(--border);
    border-color: var(--border);
    background: var(--bg);
}
.filter-link[data-tip]::after {
    top: auto;
    bottom: calc(100% + 8px);
}

/* ── Search input ─────────────────────────────────────── */
.search-input {
    padding: 0.3rem 0.7rem;
    font-size: 0.825rem;
    font-family: var(--font-ui);
    border: 1px solid var(--border);
    border-radius: 9999px;
    background: var(--bg-card);
    color: var(--text);
    min-width: 160px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}
.search-input::placeholder {
    color: var(--text-muted);
}

/* ── Product table ────────────────────────────────────── */
.product-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
}
.product-table thead th {
    background: var(--nav-bg);
    color: #fff;
    text-align: left;
    padding: 0.65rem 1rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: none;
}
.product-table thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.product-table thead th:last-child { border-radius: 0 var(--radius-sm) 0 0; }

/* Column header tooltips */
.th-tip {
    cursor: help;
}
.th-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.th-wrap--right {
    justify-content: flex-end;
}
.th-info {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    font-style: normal;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
    letter-spacing: 0;
    text-transform: none;
    cursor: help;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.th-tip:hover .th-info {
    border-color: #fff;
    background: rgba(255,255,255,0.2);
    color: #fff;
}
[data-tip] {
    position: relative;
}
[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    top: calc(100% + 8px);
    transform: translateX(-50%);
    background: var(--text);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.4;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    white-space: normal;
    width: max-content;
    max-width: 220px;
    z-index: 60;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
}
[data-tip]:hover::after {
    opacity: 1;
}
.product-table tbody tr {
    transition: background 0.1s;
}
.product-table tbody tr:not(:last-child) td { border-bottom: 1px solid var(--border); }
.product-table tbody tr:nth-child(even) { background: var(--bg-subtle); }
.product-table tbody tr:hover { background: var(--info-subtle); }
.product-table td {
    padding: 0.7rem 1rem;
    vertical-align: middle;
}
.product-table td a { color: var(--text); text-decoration: none; font-weight: 500; }
.product-table td a:hover { color: var(--link); }

/* Price cells — monospace, right-aligned */
.cell-price {
    text-align: right;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Competitor price coloring */
.price-cheaper {
    color: var(--danger);
    background: var(--danger-subtle);
    font-weight: 600;
}
.price-higher { color: var(--success); }
.price-same { color: var(--text-muted); }
.price-pct { font-size: 0.8em; opacity: 0.7; }

/* has-cheaper row — red left accent */
.product-table tbody tr.has-cheaper {
    border-left: 3px solid var(--danger);
    background: rgba(229, 72, 77, 0.03);
}
.product-table tbody tr.has-cheaper:hover { background: var(--danger-subtle); }

/* below-floor row — muted, competitor below seller's minimum price */
.product-table tbody tr.below-floor {
    border-left: 3px solid var(--text-muted);
    background: rgba(0, 0, 0, 0.02);
    opacity: 0.6;
}
.product-table tbody tr.below-floor:hover { opacity: 0.85; }
.product-table tbody tr.below-floor .price-cheaper,
.product-table tbody tr.below-floor .diff-cheaper { color: var(--text-muted); }
.badge-below-floor {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.1rem 0.35rem;
    border-radius: var(--radius-sm);
    background: var(--text-muted);
    color: #fff;
    vertical-align: middle;
    margin-left: 0.3rem;
}

/* Suggested-price cell */
.cell-suggestion {
    text-align: right;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    cursor: help;
}
.cell-suggestion.suggestion-clamped { color: var(--text-muted); }
.cell-suggestion.suggestion-blocked {
    color: var(--text-muted);
    text-decoration: line-through;
    opacity: 0.7;
}
/* Per-row Apply button + status, stacked under the suggested price. */
.suggestion-wrap {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
}
.suggestion-price { cursor: help; }
.apply-trigger {
    padding: 0.2rem 0.6rem;
    background: var(--success);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, filter 0.15s;
}
.apply-trigger:hover { filter: brightness(0.92); }
.apply-trigger:active { transform: scale(0.97); }
/* Confirm state: turns red to signal the next click commits a real price. */
.apply-trigger.is-confirming { background: var(--danger); }
.reprice-status {
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 500;
    white-space: nowrap;
}
.reprice-pending { color: var(--text-muted); }
/* "Still processing" hint (poll timeout) — longer text, so it wraps within
   the column instead of the nowrap used by reprice-status. */
.reprice-submitted {
    max-width: 12rem;
    color: var(--text-muted);
    white-space: normal;
    text-align: right;
}
.reprice-applied { color: var(--success); font-weight: 600; }
.reprice-quarantined {
    max-width: 12rem;
    color: var(--warning, #c2740c);
    white-space: normal;
    text-align: right;
}
/* Inline spinner shown while an apply is in flight. Inherits the muted
   reprice-pending colour via currentColor; the transparent top edge makes
   the rotating gap. */
.reprice-spinner {
    display: inline-block;
    width: 0.72em;
    height: 0.72em;
    margin-right: 0.4em;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    vertical-align: -0.12em;
    animation: reprice-spin 0.6s linear infinite;
}
@keyframes reprice-spin { to { transform: rotate(360deg); } }
.apply-error {
    max-width: 12rem;
    font-family: var(--font-ui);
    font-size: 0.68rem;
    font-weight: 400;
    line-height: 1.25;
    color: var(--danger);
    text-align: right;
    white-space: normal;
}

/* Trend pill badges */
.trend-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
}
.trend-down {
    color: var(--danger);
    background: var(--danger-subtle);
}
.trend-up {
    color: var(--success);
    background: var(--success-subtle);
}
.trend-stable {
    color: var(--text-muted);
    background: var(--bg-inset);
}
.trend-none { color: var(--text-muted); }

/* ── Dashboard layout ─────────────────────────────────── */
.dashboard-main {
    max-width: 1200px;
    margin: 0 auto;
}

/* Shop-level controls (auto-repricing toggle) above the product list. */
.shop-controls {
    max-width: 1200px;
    margin: 0 auto 0.75rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}
.shop-controls .inline-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}
.shop-controls-note {
    flex-basis: 100%;
    margin: 0;
    font-size: 0.85rem;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

/* ── Product detail ───────────────────────────────────── */
.product-detail {
    max-width: 900px;
    margin: 2rem auto;
    border-left: 3px solid var(--nav-bg);
}
.product-detail h1 { font-size: 1.3rem; }
.product-detail h2 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
}
.product-meta {
    display: inline-grid;
    grid-template-columns: auto auto;
    gap: 0.5rem 1.5rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border-strong);
}
.product-meta dt {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    align-self: center;
}
.product-meta dd {
    font-size: 0.875rem;
    font-weight: 500;
    text-align: right;
    align-self: center;
}
.own-price-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    font-family: var(--font-mono);
    letter-spacing: -0.02em;
}
.meta-section-start {
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}
.min-price-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.min-price-form {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
}
.min-price-input-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.min-price-input {
    width: 7rem;
    padding: 0.3rem 1.4rem 0.3rem 0.5rem;
    font-size: 0.8rem;
    font-family: var(--font-ui);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: right;
    -moz-appearance: textfield;
    appearance: textfield;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.min-price-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}
.min-price-input::placeholder {
    color: var(--text-muted);
    font-size: 0.75rem;
}
.min-price-input::-webkit-outer-spin-button,
.min-price-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.min-price-suffix {
    position: absolute;
    right: 0.4rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    pointer-events: none;
}
.min-price-clear {
    display: inline;
    margin: 0;
}
.badge-soon {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 9999px;
}
.back-link {
    display: inline-block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.825rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    transition: color 0.15s;
}
.back-link:hover { color: var(--text); }

/* Competitor diff coloring */
.diff-cheaper {
    color: var(--danger);
    font-family: var(--font-mono);
    font-weight: 500;
}
.diff-higher {
    color: var(--success);
    font-family: var(--font-mono);
    font-weight: 500;
}
.diff-same { color: var(--text-muted); }

/* Seller links */
.seller-links { white-space: nowrap; font-size: 0.825rem; }
.product-table td.seller-links a,
.seller-links a {
    color: var(--link);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}
.product-table td.seller-links a:hover,
.seller-links a:hover { color: var(--text); text-decoration: underline; }

/* Rating with star */
.rating { font-family: var(--font-mono); font-size: 0.85rem; }
.rating::after { content: " \2605"; color: #e8a230; font-size: 0.75rem; }

/* ── Dev tools (shared by dashboard + product detail) ── */
.dev-tools {
    position: fixed;
    top: 60px;
    right: 1rem;
    z-index: 100;
    padding: 0.75rem;
    background: var(--nav-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 160px;
}
.dev-tools-label {
    color: var(--danger);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.dev-tools-btn {
    display: block;
    width: 100%;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-family: var(--font-ui);
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.08);
    color: #fff;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}
.dev-tools-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
    color: #fff;
}
.dev-tools-btn-danger { border-color: var(--danger); color: var(--danger); }
.dev-tools-btn-danger:hover { background: var(--danger); color: #fff; }
.dev-tools-btn-warn { border-color: #e8a230; color: #e8a230; }
.dev-tools-btn-warn:hover { background: #e8a230; color: #fff; }
.dev-tools-btn-muted { opacity: 0.6; }
.dev-tools-btn-muted:hover { opacity: 1; }

/* ── Admin ────────────────────────────────────────────── */
.admin-card {
    max-width: 560px;
    margin: 3rem auto;
    border-left: 3px solid var(--nav-bg);
}
.admin-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.admin-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.admin-section h2 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}
.admin-section p { color: var(--text-secondary); font-size: 0.875rem; margin-bottom: 0.75rem; }
.admin-section select {
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.925rem;
    font-family: var(--font-ui);
    width: 100%;
    background: var(--bg-card);
}

/* ── Link box (admin result) ──────────────────────────── */
.link-box { margin: 1rem 0; }
.link-box input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.825rem;
    font-family: var(--font-mono);
    background: var(--bg-subtle);
    color: var(--text);
    cursor: text;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.link-box input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

/* Submit button spinner */
.btn .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ── Repricing trigger + popover ─────────────────────── */
.cell-repricing { text-align: center; }
.repricing-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 9999px;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.repricing-trigger:hover { background: var(--bg-subtle); color: var(--text); border-color: var(--text-muted); }
.repricing-trigger.is-auto {
    color: var(--success);
    border-color: var(--success);
    background: rgba(46, 160, 67, 0.08);
}
.repricing-popover {
    position: absolute;
    z-index: 200;
    min-width: 18rem;
    padding: 0.85rem;
    background: var(--nav-bg, #fff);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: 0.85rem;
}
.repricing-popover[hidden] { display: none; }
.repricing-popover-form { display: flex; flex-direction: column; gap: 0.6rem; margin: 0; }
.repricing-popover-row label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.repricing-popover-row select,
.repricing-popover-row input[type="number"] {
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    background: #fff;
}
.repricing-popover-row select:focus,
.repricing-popover-row input[type="number"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}
.repricing-delta-input-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.repricing-delta-input-wrap input { flex: 1; }
.repricing-delta-clear { padding: 0.2rem 0.5rem; font-size: 0.85rem; }
.repricing-popover-checkbox label {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text);
}
.repricing-popover-status {
    margin-top: 0.1rem;
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--bg-subtle);
    color: var(--text-muted);
}
.repricing-popover-status.is-ok { background: var(--success-subtle, #e6f4ea); color: var(--success, #1f7a3a); }
.repricing-popover-status.is-error { background: var(--danger-subtle); color: var(--danger); }
.repricing-popover-status.is-saving { color: var(--text-muted); }
