/* ==========================================================================
   AI Ready — Catalog IQ — Stylesheet
   Aesthetic: refined editorial with sharp accents. Off-white + graphite +
   a single saturated signal color (electric lime for AI/status cues).
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,wght@0,400;0,600;0,700;1,400&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap');

:root {
    /* Palette */
    --bg: #f5f3ee;
    --bg-panel: #ffffff;
    --bg-elevated: #fbfaf6;
    --ink: #1a1a1a;
    --ink-soft: #4a4a4a;
    --ink-mute: #8b8880;
    --rule: #e5e1d7;
    --rule-strong: #d4cfc0;

    /* Signal */
    --signal: #c5f547;         /* electric lime — AI ready */
    --signal-deep: #84a62f;
    --warn: #f4a73b;
    --critical: #e3502d;
    --good: #3fa07a;

    /* Scales */
    --radius: 4px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(20, 20, 20, 0.04);
    --shadow-md: 0 4px 12px rgba(20, 20, 20, 0.06), 0 1px 3px rgba(20, 20, 20, 0.04);

    /* Typography */
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 28px; letter-spacing: -0.02em; }
h3 { font-size: 18px; }

/* ==========================================================================
   Shell
   ========================================================================== */
.app-shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 40px 80px;
}

/* ==========================================================================
   Header
   ========================================================================== */
.app-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 32px;
    padding: 0 0 24px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--rule);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    background: var(--ink);
    color: var(--signal);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
}

.brand-sub {
    font-weight: 400;
    color: var(--ink-mute);
    font-size: 0.75em;
    letter-spacing: -0.01em;
}

.brand-tag {
    font-size: 11px;
    color: var(--ink-mute);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

.app-nav {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.nav-link {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-soft);
    border-radius: var(--radius);
    transition: all 0.15s;
}
.nav-link:hover { color: var(--ink); background: var(--bg-elevated); }
.nav-link.active {
    background: var(--ink);
    color: var(--bg);
}

.shop-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}
.shop-domain { color: var(--ink-mute); font-family: var(--font-mono); font-size: 12px; }

.plan-chip {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.plan-trial { background: var(--rule); color: var(--ink-soft); }
.plan-starter { background: var(--ink); color: var(--bg); }
.plan-growth { background: var(--signal-deep); color: white; }
.plan-plus {
    background: var(--ink);
    color: var(--signal);
    border: 1px solid var(--signal);
}

/* Credits badge (in header) */
.credits-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--rule);
    color: var(--ink-soft);
    font-family: var(--font-mono);
    transition: all 0.2s ease;
}
.credits-badge.low {
    background: #fdf3de;
    color: #8a600c;
    border-color: #f4dcac;
}
.credits-badge.exhausted {
    background: #fde8e1;
    color: #a4310f;
    border-color: #f4b8a3;
}
.credits-badge.pulse {
    animation: credit-pulse 0.6s ease;
}
.credits-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}
@keyframes credit-pulse {
    0% { transform: scale(1); }
    30% { transform: scale(1.1); background: var(--signal); }
    100% { transform: scale(1); }
}

/* Trial chip (replaces plan chip during trial) */
.trial-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 20px;
    background: linear-gradient(135deg, #fef6dc, #fdeaad);
    border: 1px solid #f1cd6e;
    color: #7a5600;
    font-family: var(--font-mono);
}
.trial-chip.urgent {
    background: linear-gradient(135deg, #fde8e1, #f9c6b0);
    border-color: #e6a183;
    color: #8a2d0a;
    animation: trial-pulse 2s ease-in-out infinite;
}
.trial-chip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}
@keyframes trial-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(166, 49, 15, 0.4); }
    50%      { box-shadow: 0 0 0 6px rgba(166, 49, 15, 0); }
}

/* ==========================================================================
   Banners & Empty States
   ========================================================================== */
.banner {
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    display: flex;
    gap: 14px;
    align-items: center;
}
.banner-running {
    background: var(--ink);
    color: var(--bg);
}
.banner-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(197, 245, 71, 0.3);
    border-top-color: var(--signal);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Trial banner on dashboard */
.trial-banner {
    background: linear-gradient(135deg, #fefaf0, #fdf0d2);
    border: 1px solid #f1cd6e;
    border-radius: var(--radius);
    padding: 18px 22px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: relative;
    overflow: hidden;
}
.trial-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: #e6a133;
}
.trial-banner.urgent {
    background: linear-gradient(135deg, #fdf0eb, #f9d7c4);
    border-color: #e6a183;
}
.trial-banner.urgent::before { background: #c14220; }
.trial-banner-body { flex: 1; }
.trial-banner-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px;
    color: var(--ink);
}
.trial-banner-title .days-left {
    color: #a4310f;
    font-weight: 700;
}
.trial-banner-detail {
    font-size: 14px;
    color: var(--ink-soft);
    line-height: 1.5;
}
.trial-banner-actions {
    flex-shrink: 0;
    display: flex;
    gap: 10px;
}

/* Catalog limit banner */
.limit-banner {
    background: var(--bg-panel);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: 240px 1fr auto;
    gap: 28px;
    align-items: center;
    position: relative;
    overflow: hidden;
}
.limit-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: linear-gradient(180deg, var(--signal), #8cb4d8);
}
.limit-banner-stats { display: flex; flex-direction: column; gap: 12px; }
.limit-banner-fraction {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    font-family: var(--font-mono);
}
.limit-banner-scanned {
    font-size: 36px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1;
}
.limit-banner-divider { font-size: 14px; color: var(--ink-mute); }
.limit-banner-total {
    font-size: 20px;
    font-weight: 500;
    color: var(--ink-soft);
}
.limit-banner-label {
    width: 100%;
    font-family: var(--font-body);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin-top: 2px;
}
.limit-banner-progress {
    height: 6px;
    background: var(--bg-elevated);
    border-radius: 3px;
    overflow: hidden;
}
.limit-banner-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--signal), #8cb4d8);
    border-radius: 3px;
    transition: width 0.6s ease;
}
.limit-banner-body { min-width: 0; }
.limit-banner-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px;
    color: var(--ink);
}
.limit-banner-detail {
    font-size: 14px;
    color: var(--ink-soft);
    line-height: 1.5;
    margin: 0;
}
.limit-banner-actions { flex-shrink: 0; }

/* Empty state */
.empty-state {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    padding: 80px 40px;
    text-align: center;
    border: 1px solid var(--rule);
    position: relative;
    overflow: hidden;
}
.empty-state h2 { font-family: var(--font-display); margin-bottom: 12px; }
.empty-state p { max-width: 480px; margin: 0 auto; color: var(--ink-soft); }
.empty-state-animation {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 40px auto 0;
}
.pulse-ring {
    position: absolute;
    inset: 0;
    border: 2px solid var(--signal);
    border-radius: 50%;
    animation: pulse 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.pulse-ring.delay-1 { animation-delay: 0.66s; }
.pulse-ring.delay-2 { animation-delay: 1.33s; }
@keyframes pulse {
    0% { transform: scale(0.3); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* ==========================================================================
   Score Hero
   ========================================================================== */
.score-hero {
    background: var(--ink);
    color: var(--bg);
    border-radius: var(--radius-lg);
    padding: 48px;
    margin-bottom: 32px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 40px;
    position: relative;
    overflow: hidden;
}
.score-hero::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, var(--signal) 0%, transparent 70%);
    opacity: 0.08;
    pointer-events: none;
}

.score-label {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin-bottom: 12px;
}

.score-big {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 0.9;
    letter-spacing: -0.04em;
    display: flex;
    align-items: baseline;
    gap: 4px;
}
.score-big .score-number { font-size: 96px; }
.score-big .score-of { font-size: 28px; color: var(--ink-mute); font-weight: 400; }

.score-big.score-excellent .score-number { color: var(--signal); }
.score-big.score-good .score-number { color: var(--good); }
.score-big.score-warn .score-number { color: var(--warn); }
.score-big.score-critical .score-number { color: var(--critical); }

.score-status {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 20px;
    margin-top: 8px;
    color: var(--bg);
}

.score-meta {
    font-size: 13px;
    color: var(--ink-mute);
    margin-top: 20px;
}

.score-actions {
    margin-top: 32px;
    display: flex;
    gap: 12px;
}

/* Score ring */
.score-ring-wrap {
    width: 200px;
    height: 200px;
    flex-shrink: 0;
}
.score-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.ring-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 12;
}
.ring-value {
    fill: none;
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.ring-value.score-excellent { stroke: var(--signal); }
.ring-value.score-good { stroke: var(--good); }
.ring-value.score-warn { stroke: var(--warn); }
.ring-value.score-critical { stroke: var(--critical); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all 0.15s;
    cursor: pointer;
}
.btn-primary {
    background: var(--signal);
    color: var(--ink);
    font-weight: 600;
}
.btn-primary:hover {
    background: white;
    transform: translateY(-1px);
}
.btn-secondary {
    background: var(--bg-panel);
    color: var(--ink);
    border: 1px solid var(--rule-strong);
}
.btn-secondary:hover {
    border-color: var(--ink);
}
.btn-ghost {
    color: var(--bg);
    padding-left: 0;
    padding-right: 0;
}
.btn-ghost:hover {
    color: var(--signal);
}
.btn-block { width: 100%; }
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 6px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: btn-spin 0.7s linear infinite;
    vertical-align: -2px;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Stats Grid
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}
.stat-card {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--rule);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--rule);
}
.stat-excellent::before { background: var(--signal); }
.stat-good::before { background: var(--good); }
.stat-warn::before { background: var(--warn); }
.stat-critical::before { background: var(--critical); }

.stat-num {
    font-family: var(--font-display);
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
}
.stat-label { font-weight: 600; margin-top: 8px; }
.stat-sub { font-size: 12px; color: var(--ink-mute); margin-top: 2px; }

/* ==========================================================================
   Panels
   ========================================================================== */
.panel {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    padding: 28px;
    border: 1px solid var(--rule);
    margin-bottom: 24px;
}
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}
.panel-sub {
    font-size: 13px;
    color: var(--ink-mute);
    margin: 4px 0 0;
}
.link-arrow {
    font-size: 13px;
    color: var(--ink-soft);
    font-weight: 500;
}
.link-arrow:hover { color: var(--ink); }

/* ==========================================================================
   Product List (dashboard)
   ========================================================================== */
.product-list {
    display: flex;
    flex-direction: column;
}
.product-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--rule);
    transition: padding 0.15s;
}
.product-row:hover {
    padding-left: 8px;
    padding-right: 8px;
    background: var(--bg-elevated);
}
.product-row:last-child { border-bottom: none; }

.product-title { font-weight: 500; margin-bottom: 4px; }
.product-issues {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.issue-chip {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 500;
    font-family: var(--font-mono);
    text-transform: lowercase;
}
.issue-high { background: #fde8e1; color: #a4310f; }
.issue-medium { background: #fdf3de; color: #8a600c; }
.issue-low { background: #eae8e0; color: #55504a; }
.issue-more { background: var(--rule); color: var(--ink-mute); }

.product-score {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    min-width: 50px;
    text-align: right;
}
.product-score.score-excellent { color: var(--signal-deep); }
.product-score.score-good { color: var(--good); }
.product-score.score-warn { color: var(--warn); }
.product-score.score-critical { color: var(--critical); }

/* Credits panel (dashboard widget) */
.credits-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
}
.credits-count {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--ink-soft);
}
.credits-bar {
    height: 6px;
    background: var(--rule);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}
.credits-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--signal) 0%, var(--signal-deep) 100%);
    transition: width 0.6s ease;
}
.credits-meta { font-size: 12px; color: var(--ink-mute); }
.link-subtle {
    color: var(--ink-soft);
    text-decoration: underline;
    text-decoration-color: var(--rule);
    text-underline-offset: 3px;
}
.link-subtle:hover {
    color: var(--ink);
    text-decoration-color: var(--ink);
}

/* Credits exhausted notice (product detail) */
.credits-exhausted-notice {
    background: #fdf0eb;
    border: 1px solid #e6a183;
    border-left: 4px solid #c14220;
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 16px 0;
    display: flex;
    align-items: center;
    gap: 16px;
}
.credits-exhausted-notice-body {
    flex: 1;
    color: #8a2d0a;
    font-size: 14px;
    line-height: 1.5;
}
.credits-exhausted-notice-body strong {
    display: block;
    font-size: 15px;
    margin-bottom: 2px;
}

/* ==========================================================================
   Products Table
   ========================================================================== */
.page-header {
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}
.page-header-meta {
    font-size: 13px;
    color: var(--ink-mute);
}
.breadcrumb {
    font-size: 13px;
    color: var(--ink-mute);
    margin-bottom: 8px;
    display: inline-block;
}
.breadcrumb:hover { color: var(--ink); }

.filter-bar {
    background: var(--bg-panel);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.filter-tabs { display: flex; gap: 4px; }
.filter-tab {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-soft);
    border-radius: var(--radius);
}
.filter-tab:hover { background: var(--bg-elevated); }
.filter-tab.active {
    background: var(--ink);
    color: var(--bg);
}
.filter-controls { display: flex; gap: 8px; }
.search-input, .sort-select {
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius);
    font-family: var(--font-body);
    background: var(--bg-panel);
}
.search-input:focus, .sort-select:focus {
    outline: none;
    border-color: var(--ink);
}

.product-table {
    background: var(--bg-panel);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.product-table-head, .product-table-row {
    display: grid;
    grid-template-columns: 2.5fr 1fr 1fr 1fr 1fr 1fr 1fr;
    align-items: center;
    padding: 14px 20px;
    gap: 16px;
}
.product-table-head {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--rule);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-mute);
}
.product-table-row {
    border-bottom: 1px solid var(--rule);
    transition: background 0.15s;
}
.product-table-row:last-child { border-bottom: none; }
.product-table-row:hover { background: var(--bg-elevated); }

.pt-title { font-weight: 500; margin-bottom: 2px; }
.pt-vendor { font-size: 12px; color: var(--ink-mute); }

.mini-score {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 3px;
    background: var(--bg-elevated);
}
.mini-score.score-excellent { background: #e6f4c6; color: var(--signal-deep); }
.mini-score.score-good { background: #d8eee0; color: #28754d; }
.mini-score.score-warn { background: #fbe8c5; color: #835203; }
.mini-score.score-critical { background: #fbd9ce; color: #8a2c10; }

.big-score {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.big-score.score-excellent { color: var(--signal-deep); }
.big-score.score-good { color: var(--good); }
.big-score.score-warn { color: var(--warn); }
.big-score.score-critical { color: var(--critical); }

.empty-row {
    padding: 40px;
    text-align: center;
    color: var(--ink-mute);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    font-size: 13px;
}
.page-link {
    padding: 8px 14px;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
}
.page-link:hover {
    border-color: var(--ink);
}
.page-indicator { color: var(--ink-mute); }

/* Locked product section (end of products list) */
.locked-section-header {
    margin-top: 32px;
    margin-bottom: 16px;
    padding: 20px 24px;
    background: var(--bg-elevated);
    border-radius: var(--radius);
    border-left: 4px solid var(--ink-mute);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.locked-section-header-body { flex: 1; }
.locked-section-header-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px;
    color: var(--ink);
}
.locked-section-header-title::before { content: '🔒 '; }
.locked-section-header-detail {
    font-size: 14px;
    color: var(--ink-soft);
    margin: 0;
}

/* ==========================================================================
   Product Detail
   ========================================================================== */
.detail-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.detail-score-panel {
    background: var(--bg-panel);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    padding: 32px;
    position: sticky;
    top: 20px;
    height: fit-content;
}
.overall-score {
    font-family: var(--font-display);
    font-weight: 700;
    display: flex;
    align-items: baseline;
    gap: 4px;
    letter-spacing: -0.04em;
}
.overall-score.score-excellent { color: var(--signal-deep); }
.overall-score.score-good { color: var(--good); }
.overall-score.score-warn { color: var(--warn); }
.overall-score.score-critical { color: var(--critical); }
.overall-num { font-size: 72px; line-height: 0.9; }
.overall-of { font-size: 24px; color: var(--ink-mute); font-weight: 400; }
.overall-label {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin-top: 8px;
}

.sub-scores {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--rule);
}
.sub-score-row {
    display: grid;
    grid-template-columns: 1fr 80px 32px;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}
.sub-score-label {
    font-size: 13px;
    font-weight: 500;
}
.sub-score-weight {
    font-size: 10px;
    color: var(--ink-mute);
    font-weight: 400;
    margin-left: 6px;
    font-family: var(--font-mono);
}
.sub-score-bar {
    height: 4px;
    background: var(--rule);
    border-radius: 2px;
    overflow: hidden;
}
.sub-score-fill {
    height: 100%;
    transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.sub-score-fill.score-excellent { background: var(--signal-deep); }
.sub-score-fill.score-good { background: var(--good); }
.sub-score-fill.score-warn { background: var(--warn); }
.sub-score-fill.score-critical { background: var(--critical); }
.sub-score-value {
    font-family: var(--font-mono);
    font-size: 13px;
    text-align: right;
    color: var(--ink-soft);
}

.detail-actions {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--rule);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-issues-panel {
    background: var(--bg-panel);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    padding: 28px;
}
.detail-issues-panel h3 { margin-bottom: 20px; }

.issue-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.issue-item {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--rule);
}
.issue-item:last-child { border-bottom: none; }
.issue-severity-mark {
    flex-shrink: 0;
    width: 4px;
    border-radius: 2px;
}
.issue-item.issue-high .issue-severity-mark { background: var(--critical); }
.issue-item.issue-medium .issue-severity-mark { background: var(--warn); }
.issue-item.issue-low .issue-severity-mark { background: var(--ink-mute); }

.issue-content { flex: 1; }
.issue-type {
    font-weight: 600;
    margin-bottom: 4px;
    text-transform: capitalize;
}
.issue-detail {
    font-size: 14px;
    color: var(--ink-soft);
    line-height: 1.5;
}
.issue-fix-available {
    font-size: 12px;
    color: var(--signal-deep);
    margin-top: 6px;
    font-weight: 500;
    font-family: var(--font-mono);
}

.zero-issues {
    text-align: center;
    padding: 40px 20px;
}
.zero-issues-icon {
    width: 60px;
    height: 60px;
    background: var(--signal);
    color: var(--ink);
    font-size: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-weight: 700;
}

.description-preview {
    padding: 20px;
    background: var(--bg-elevated);
    border-radius: var(--radius);
    font-size: 14px;
    line-height: 1.7;
    max-height: 300px;
    overflow-y: auto;
}
.description-preview p { margin: 0 0 12px; }
.description-preview ul { margin: 0 0 12px; padding-left: 20px; }

.fix-history {
    list-style: none;
    margin: 0;
    padding: 0;
}
.fix-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--rule);
    font-size: 13px;
}
.fix-item:last-child { border-bottom: none; }
.fix-type { font-weight: 500; }
.fix-time { color: var(--ink-mute); font-family: var(--font-mono); font-size: 12px; }

/* ==========================================================================
   Toast
   ========================================================================== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--ink);
    color: var(--bg);
    padding: 14px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 1000;
    max-width: 360px;
    font-size: 14px;
}
.toast.show {
    transform: translateY(0);
    opacity: 1;
}
.toast.toast-success { background: var(--ink); border-left: 3px solid var(--signal); }
.toast.toast-error { background: var(--ink); border-left: 3px solid var(--critical); }

/* ==========================================================================
   Modal (custom confirm dialog)
   ========================================================================== */
.ai-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 20, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.ai-modal-backdrop.active {
    display: flex;
    opacity: 1;
}

.ai-modal {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    max-width: 440px;
    width: calc(100% - 40px);
    padding: 32px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
    transform: translateY(16px) scale(0.98);
    transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
}
.ai-modal-backdrop.active .ai-modal {
    transform: translateY(0) scale(1);
}
.ai-modal::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--signal);
}
.ai-modal h3 {
    font-family: var(--font-display);
    font-size: 22px;
    margin: 0 0 12px;
    color: var(--ink);
}
.ai-modal-body {
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 1.55;
    margin-bottom: 20px;
}
.ai-modal-meta {
    background: var(--bg-elevated);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}
.ai-modal-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ai-modal-meta-label {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-mute);
}
.ai-modal-meta-value {
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--ink);
}
.ai-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.ai-modal-actions .btn { min-width: 100px; }

/* ==========================================================================
   Processing overlay (during AI operations)
   ========================================================================== */
.ai-processing {
    position: fixed;
    inset: 0;
    background: rgba(250, 248, 242, 0.92);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.ai-processing.active {
    display: flex;
    opacity: 1;
}
.ai-processing-card {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    padding: 40px 48px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--rule);
    position: relative;
    overflow: hidden;
}
.ai-processing-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--signal) 20%,
        var(--signal) 80%,
        transparent 100%);
    background-size: 200% 100%;
    animation: progress-bar 1.5s ease-in-out infinite;
}
@keyframes progress-bar {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.ai-processing-orbit {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
}
.ai-processing-orbit::before,
.ai-processing-orbit::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
}
.ai-processing-orbit::before {
    border-top-color: var(--signal);
    border-right-color: var(--signal);
    animation: orbit-spin 1.2s linear infinite;
}
.ai-processing-orbit::after {
    border-bottom-color: var(--ink);
    border-left-color: var(--ink);
    animation: orbit-spin 1.8s linear infinite reverse;
    inset: 10px;
}
@keyframes orbit-spin { to { transform: rotate(360deg); } }
.ai-processing-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--ink);
}
.ai-processing-subtitle {
    font-size: 14px;
    color: var(--ink-soft);
    line-height: 1.5;
}
.ai-processing-elapsed {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--rule);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--ink-mute);
}

/* ==========================================================================
   Billing — plan cards grid
   ========================================================================== */

/* Support both .plan-grid and .plan-cards class names */
.plan-grid,
.plan-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 24px;
}

.plan-card {
    background: var(--bg-panel);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    padding: 32px;
    display: flex;
    flex-direction: column;
    position: relative;
}
.plan-card.current {
    border-color: var(--ink);
    box-shadow: 0 0 0 1px var(--ink);
}
.plan-card.featured {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
}
.plan-card.featured h3,
.plan-card.featured .plan-card-name { color: var(--signal); }

.plan-card-tag {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--signal);
    color: var(--ink);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Support both naming conventions for plan card elements */
.plan-name,
.plan-card-name {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.plan-price,
.plan-card-price {
    font-family: var(--font-display);
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 16px 0 4px;
    line-height: 1;
}
.plan-price-period,
.plan-card-price-period {
    font-size: 14px;
    color: var(--ink-mute);
    font-weight: 400;
}
.plan-card.featured .plan-card-price-period,
.plan-card.featured .plan-price-period { color: rgba(255,255,255,0.6); }

.plan-features,
.plan-card-features {
    list-style: none;
    margin: 24px 0;
    padding: 24px 0 0;
    border-top: 1px solid var(--rule);
    flex: 1;
}
.plan-card.featured .plan-features,
.plan-card.featured .plan-card-features { border-top-color: rgba(255,255,255,0.1); }

.plan-features li,
.plan-card-features li {
    padding: 6px 0;
    font-size: 14px;
    display: flex;
    gap: 10px;
    align-items: start;
}
.plan-features li::before,
.plan-card-features li::before {
    content: '→';
    color: var(--signal-deep);
    font-weight: 700;
    flex-shrink: 0;
}
.plan-card.featured .plan-features li::before,
.plan-card.featured .plan-card-features li::before { color: var(--signal); }
.plan-card.featured .plan-card-features li strong { color: var(--signal); }

.current-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 11px;
    background: var(--ink);
    color: var(--bg);
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.billing-footnote {
    text-align: center;
    font-size: 13px;
    color: var(--ink-mute);
    margin-top: 32px;
    margin-bottom: 24px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
    .app-shell { padding: 20px; }
    .app-header {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .app-nav { justify-content: flex-start; overflow-x: auto; }
    .score-hero {
        grid-template-columns: 1fr;
        padding: 32px 24px;
    }
    .score-ring-wrap { margin: 0 auto; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-score-panel { position: static; }
    .product-table-head, .product-table-row {
        grid-template-columns: 1fr 60px;
    }
    .product-table-head .col-type,
    .product-table-head .col-score,
    .product-table-row .col-type,
    .product-table-row .col-score { display: none; }
    .plan-grid, .plan-cards { grid-template-columns: 1fr; }
    .limit-banner { grid-template-columns: 1fr; gap: 16px; }
}
/* ==========================================================================
   Bulk mode UI (append to public_html/assets/css/app.css)
   ========================================================================== */

/* Overall bulk overlay (extends .ai-processing) */
.bulk-overlay {
    /* inherits ai-processing styles */
}

.bulk-processing-card {
    min-width: 440px;
    max-width: 520px;
    padding: 32px 36px;
}

.bulk-progress-header {
    text-align: center;
    margin-bottom: 20px;
}

.bulk-progress-bar-wrap {
    height: 8px;
    background: var(--bg-elevated);
    border-radius: 4px;
    overflow: hidden;
    margin: 8px 0 6px;
    border: 1px solid var(--rule);
}

.bulk-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--signal-deep), var(--signal));
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    min-width: 2px;
}

.bulk-progress-text {
    text-align: center;
    margin-bottom: 16px;
}

.bulk-progress-count {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

.bulk-current-product {
    padding: 10px 14px;
    background: var(--bg-elevated);
    border-radius: var(--radius);
    margin-bottom: 16px;
    display: flex;
    gap: 8px;
    align-items: baseline;
    font-size: 13px;
    min-height: 36px;
}
.bulk-current-label {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-mute);
    flex-shrink: 0;
}
.bulk-current-title {
    font-weight: 500;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.bulk-progress-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}
.bulk-stat {
    background: var(--bg-elevated);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.bulk-stat-label {
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-mute);
}
.bulk-stat-value {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
}

.bulk-actions {
    display: flex;
    justify-content: center;
    margin-top: 4px;
}

/* Preview results list (shown in modal) */
.bulk-preview-list {
    background: var(--bg-elevated);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 4px 0;
    margin: 12px 0;
    max-height: 240px;
    overflow-y: auto;
}
.bulk-preview-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    font-size: 13px;
    gap: 12px;
    border-bottom: 1px solid var(--rule);
}
.bulk-preview-row:last-child {
    border-bottom: none;
}
.bulk-preview-title {
    flex: 1;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ink);
}
.bulk-preview-score {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--ink-soft);
    flex-shrink: 0;
}
.bulk-preview-score strong {
    color: var(--signal-deep);
    font-weight: 700;
}
.bulk-preview-row.err .bulk-preview-title {
    color: var(--ink-mute);
}
.bulk-preview-err {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--critical);
    flex-shrink: 0;
}
.bulk-preview-hint {
    font-size: 13px;
    color: var(--ink-mute);
    margin: 8px 0 0;
}
.bulk-errors-summary {
    font-size: 14px;
    color: var(--critical);
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--rule);
}
.bulk-warning {
    background: #fdf3de;
    border: 1px solid #f4dcac;
    border-radius: var(--radius);
    padding: 10px 12px;
    font-size: 13px;
    color: #8a600c;
    margin: 12px 0 0;
}

/* ==========================================================================
   Dashboard bulk CTA card
   ========================================================================== */

.bulk-cta-card {
    background: var(--bg-panel);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    position: relative;
    overflow: hidden;
}
.bulk-cta-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: var(--signal);
}
.bulk-cta-body {
    flex: 1;
}
.bulk-cta-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px;
    color: var(--ink);
}
.bulk-cta-title strong {
    color: var(--critical);
}
.bulk-cta-detail {
    font-size: 14px;
    color: var(--ink-soft);
    margin: 0;
    line-height: 1.5;
}
.bulk-cta-actions {
    flex-shrink: 0;
    display: flex;
    gap: 10px;
}

/* ==========================================================================
   Products page bulk-select bar + checkboxes
   ========================================================================== */

/* The bulk action bar (appears when products are selected) */
.bulk-select-bar {
    background: var(--ink);
    color: var(--bg);
    border-radius: var(--radius-lg);
    padding: 14px 20px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 12px rgba(20, 20, 20, 0.08);
    animation: slideInDown 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes slideInDown {
    from { transform: translateY(-8px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
.bulk-select-bar-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}
.bulk-select-count {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
}
.bulk-select-all-matching {
    font-size: 13px;
    color: var(--signal);
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}
.bulk-select-all-matching:hover {
    color: white;
}
.bulk-select-clear {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}
.bulk-select-clear:hover {
    color: white;
}
.bulk-select-actions {
    display: flex;
    gap: 8px;
}
.bulk-select-actions .btn-primary {
    background: var(--signal);
}
.bulk-select-actions .btn-secondary {
    background: transparent;
    color: var(--bg);
    border-color: rgba(255, 255, 255, 0.2);
}
.bulk-select-actions .btn-secondary:hover {
    border-color: var(--signal);
}

/* Checkbox column in products table */
.product-table-head,
.product-table-row {
    grid-template-columns: 36px 2.5fr 1fr 1fr 1fr 1fr 1fr 1fr;
}
.col-check {
    display: flex;
    align-items: center;
    justify-content: center;
}
.bulk-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--ink);
}

/* Row becomes clickable anywhere EXCEPT the checkbox column */
.product-table-row {
    cursor: pointer;
}
.product-table-row .col-check {
    cursor: default;
}
.product-table-row.selected {
    background: #f5fadf;
}
.product-table-row.selected:hover {
    background: #eef5d0;
}

@media (max-width: 900px) {
    .product-table-head, .product-table-row {
        grid-template-columns: 36px 1fr 60px;
    }
}
/* ==========================================================================
   Draft review modal (side-by-side current vs AI draft)
   Append to public_html/assets/css/app.css
   ========================================================================== */

.draft-review-backdrop .ai-modal.draft-review-modal {
    max-width: 960px;
    width: calc(100% - 40px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 32px;
}

.draft-review-modal h3 {
    flex-shrink: 0;
}

.draft-review-modal .ai-modal-body {
    flex-shrink: 0;
    margin-bottom: 16px;
}

.draft-review-list {
    flex: 1;
    overflow-y: auto;
    margin: 0 -8px 20px;
    padding: 4px 8px;
}

.draft-review-item {
    background: var(--bg-elevated);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 12px;
}
.draft-review-item:last-child {
    margin-bottom: 0;
}

.draft-review-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--rule);
}

.draft-review-num {
    width: 22px;
    height: 22px;
    background: var(--ink);
    color: var(--bg);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-mono);
    flex-shrink: 0;
}

.draft-review-title {
    font-weight: 600;
    color: var(--ink);
    font-size: 14px;
}

.draft-review-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.draft-review-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.draft-review-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-mute);
}

.draft-review-content {
    background: var(--bg-panel);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--ink-soft);
    max-height: 280px;
    overflow-y: auto;
    flex: 1;
}

.draft-review-content.current {
    background: #fafaf5;
}
.draft-review-content.draft {
    background: #fbfdee;
    border-color: #d8e6a4;
}

.draft-review-content .empty {
    color: var(--ink-mute);
    font-style: italic;
}

.draft-review-content p {
    margin: 0 0 8px;
}
.draft-review-content p:last-child { margin-bottom: 0; }

.draft-review-content ul,
.draft-review-content ol {
    margin: 0 0 8px;
    padding-left: 20px;
}

.draft-review-content h1,
.draft-review-content h2,
.draft-review-content h3,
.draft-review-content h4 {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 6px;
    letter-spacing: 0;
    color: var(--ink);
}

.draft-review-failed {
    background: #fdf0eb;
    border: 1px solid #e6a183;
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 13px;
    color: #8a2d0a;
    margin-top: 10px;
}

.draft-review-actions {
    flex-shrink: 0;
    padding-top: 16px;
    border-top: 1px solid var(--rule);
}

@media (max-width: 720px) {
    .draft-review-compare {
        grid-template-columns: 1fr;
    }
    .draft-review-content {
        max-height: 200px;
    }
}

/* Append to public_html/assets/css/app.css */

/* Error list in bulk completion dialog */
.bulk-errors-summary {
    background: #fdf0eb;
    border: 1px solid #e6a183;
    border-left: 4px solid #c14220;
    border-radius: var(--radius);
    padding: 14px 16px;
    margin: 12px 0 0;
    font-size: 13px;
    color: #8a2d0a;
}
.bulk-errors-summary strong {
    display: block;
    font-size: 14px;
    margin-bottom: 6px;
    color: #a4310f;
}

.bulk-errors-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 180px;
    overflow-y: auto;
}
.bulk-errors-list li {
    padding: 6px 0;
    border-bottom: 1px solid rgba(166, 49, 15, 0.15);
    line-height: 1.5;
}
.bulk-errors-list li:last-child {
    border-bottom: none;
}

.bulk-err-title {
    font-weight: 500;
    color: var(--ink);
}
.bulk-err-msg {
    font-family: var(--font-mono);
    font-size: 12px;
    color: #8a2d0a;
}
.bulk-err-more {
    font-style: italic;
    color: var(--ink-mute);
}
/* ==========================================================================
   Activity tab — success / failure visual distinction
   Append to public_html/assets/css/app.css
   ========================================================================== */

/* Upgrade from the plain flex layout to a 3-col grid: marker | body | time */
.fix-history {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fix-item {
    display: grid;
    grid-template-columns: 4px 1fr auto;
    gap: 14px;
    align-items: start;
    padding: 14px 0 14px 2px;
    border-bottom: 1px solid var(--rule);
}
.fix-item:last-child {
    border-bottom: none;
}

.fix-item-marker {
    width: 4px;
    align-self: stretch;
    border-radius: 2px;
    background: var(--ink-mute);
    margin-top: 4px;
}

.fix-item-success .fix-item-marker {
    background: var(--signal-deep);
}
.fix-item-failure .fix-item-marker {
    background: var(--critical);
}

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

.fix-type {
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.fix-item-meta {
    font-size: 13px;
    color: var(--ink-mute);
    margin-top: 2px;
}

.fix-item-error {
    font-family: var(--font-mono);
    font-size: 12px;
    color: #8a2d0a;
    background: #fdf0eb;
    border: 1px solid #f4c1ae;
    border-radius: var(--radius);
    padding: 6px 10px;
    margin-top: 6px;
    overflow-wrap: break-word;
    max-width: 100%;
}

.fix-status-chip {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 10px;
    font-family: var(--font-mono);
}
.fix-status-failure {
    background: #fdf0eb;
    color: #a4310f;
    border: 1px solid #f4b8a3;
}

.fix-time {
    color: var(--ink-mute);
    font-family: var(--font-mono);
    font-size: 12px;
    white-space: nowrap;
    padding-top: 2px;
}

/* Subtle background tint for failure rows */
.fix-item-failure {
    background: linear-gradient(90deg, rgba(253, 240, 235, 0.35), transparent 60%);
}
/* ==========================================================================
   Product detail: credits-exhausted banner (full-width, above detail grid)
   Append to public_html/assets/css/app.css
   ========================================================================== */

.credits-exhausted-banner {
    background: linear-gradient(135deg, #fdf0eb, #f9d7c4);
    border: 1px solid #e6a183;
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: relative;
    overflow: hidden;
}
.credits-exhausted-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: #c14220;
}

.credits-exhausted-banner-body {
    flex: 1;
    min-width: 0;
}

.credits-exhausted-banner-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px;
    color: #8a2d0a;
}

.credits-exhausted-banner-detail {
    font-size: 14px;
    color: #6a2f1c;
    line-height: 1.5;
    margin: 0;
}

.credits-exhausted-banner-actions {
    flex-shrink: 0;
}

@media (max-width: 720px) {
    .credits-exhausted-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }
    .credits-exhausted-banner-actions .btn {
        width: 100%;
    }
}

/* "Locked" state inside the detail score panel when out of credits */
.detail-actions-locked {
    padding: 16px 12px;
    background: var(--bg-elevated);
    border: 1px dashed var(--rule-strong);
    border-radius: var(--radius);
    text-align: center;
    font-size: 13px;
    color: var(--ink-mute);
    line-height: 1.5;
}

/* ==========================================================================
   Recent changes / fix-history list — explicit grid, no more overlap
   ========================================================================== */

.fix-history {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fix-item {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--rule);
    font-size: 13px;
}
.fix-item:last-child {
    border-bottom: none;
}

.fix-item .fix-type {
    font-weight: 500;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.fix-item .fix-time {
    color: var(--ink-mute);
    font-family: var(--font-mono);
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}
/* ==========================================================================
   Feature divider on plan cards (for "Everything in X, plus:" line)
   Append to public_html/assets/css/app.css
   ========================================================================== */

.plan-card-features li.feature-divider,
.plan-features li.feature-divider {
    margin-top: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--rule);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.02em;
    color: var(--ink-mute);
    text-transform: none;
}

/* Remove the arrow bullet from dividers */
.plan-card-features li.feature-divider::before,
.plan-features li.feature-divider::before {
    content: '';
    display: none;
}

/* On the featured (black) card, use a lighter divider line */
.plan-card.featured .plan-card-features li.feature-divider,
.plan-card.featured .plan-features li.feature-divider {
    border-top-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.65);
}

/* ==========================================================================
   Export page
   Append to public_html/assets/css/app.css
   ========================================================================== */

/* ─── Upsell for non-Plus users ──────────────────────────────────────── */
.export-upsell {
    background: var(--bg-panel);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    max-width: 640px;
    margin: 40px auto;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.export-upsell::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, var(--signal) 0%, transparent 70%);
    opacity: 0.12;
    pointer-events: none;
}

.export-upsell-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: var(--ink);
    color: var(--signal);
    border-radius: 16px;
    margin-bottom: 20px;
}

.export-upsell-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--ink);
    letter-spacing: -0.02em;
}

.export-upsell-body {
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink-soft);
    max-width: 460px;
    margin: 0 auto 24px;
}

.export-upsell-features {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    margin: 0 auto 28px;
    text-align: left;
}
.export-upsell-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--ink);
}
.export-upsell-check {
    width: 22px;
    height: 22px;
    background: var(--signal);
    color: var(--ink);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.export-upsell-actions .btn {
    min-width: 180px;
}

/* ─── Export form (Plus users) ───────────────────────────────────────── */
.export-form {
    max-width: 720px;
}

.export-section {
    background: var(--bg-panel);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 20px;
}

.export-section-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--ink);
}

.export-section-help {
    font-size: 13px;
    color: var(--ink-mute);
    margin: 0 0 20px;
    line-height: 1.5;
}

/* Include options (checkboxes) */
.export-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.export-option {
    display: flex;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
    background: var(--bg-elevated);
}
.export-option:hover {
    border-color: var(--ink);
    background: white;
}
.export-option input[type="checkbox"] {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: var(--ink);
    cursor: pointer;
}
.export-option-body {
    flex: 1;
}
.export-option-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--ink);
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.export-option-count {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    background: var(--rule);
    color: var(--ink-soft);
    border-radius: 10px;
}
.export-option-desc {
    font-size: 13px;
    color: var(--ink-soft);
    line-height: 1.5;
}

/* Snapshot option — highlight as recommended for ERP users */
.export-option-snapshot {
    border-color: var(--signal-deep);
    background: #fbfdee;
}
.export-option-snapshot:hover {
    border-color: var(--signal-deep);
    background: #f3faea;
}

/* Date range & format radios */
.export-daterange,
.export-format {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.export-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--ink);
    cursor: pointer;
    padding: 6px 0;
}
.export-radio input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--ink);
    cursor: pointer;
}

.export-daterange-custom {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 26px;
    margin-top: -4px;
}
.export-daterange-custom input[type="date"] {
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius);
    font-family: var(--font-body);
    background: var(--bg-panel);
}
.export-daterange-custom input[type="date"]:disabled {
    background: var(--bg-elevated);
    color: var(--ink-mute);
    cursor: not-allowed;
}
.export-date-sep {
    font-size: 13px;
    color: var(--ink-mute);
}
.export-date-hint {
    font-size: 12px;
    color: var(--ink-mute);
    margin-top: 12px;
    font-family: var(--font-mono);
}

.export-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
.export-actions .btn {
    min-width: 160px;
}
/* ==========================================================================
   Activity list — Recent activity panel on fixes.php
   Append to public_html/assets/css/app.css

   Note: This replaces the old .fix-item / .fix-type / .fix-time rules.
   The old rules can stay (they no longer match anything) but if you want,
   search for `.fix-history`, `.fix-item`, `.fix-type`, `.fix-time` and
   remove those blocks. Not required — they're dead code now.
   ========================================================================== */

.activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.activity-item {
    position: relative;
    padding: 16px 0 16px 20px;
    border-bottom: 1px solid var(--rule);
}
.activity-item:last-child {
    border-bottom: none;
}

/* Colored status bar on the left of each row */
.activity-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 18px;
    bottom: 18px;
    width: 3px;
    border-radius: 2px;
    background: var(--signal-deep);
}
.activity-item-failure::before {
    background: var(--critical);
}

.activity-item-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Top row: type + optional chip (left), timestamp (right) */
.activity-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--ink-mute);
}

.activity-item-type {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    font-size: 11px;
    color: var(--ink-soft);
}

.activity-item-chip {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: #fde8e1;
    color: #a4310f;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.activity-item-time {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--ink-mute);
    white-space: nowrap;
}

/* Main row: the product name */
.activity-item-product {
    font-size: 15px;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.4;
}
.activity-item-product a {
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s;
}
.activity-item-product a:hover {
    border-bottom-color: var(--ink);
}

/* Error line shown below (for failures) */
.activity-item-error {
    font-family: var(--font-mono);
    font-size: 12px;
    color: #8a2d0a;
    background: #fdf0eb;
    border-left: 3px solid #c14220;
    padding: 8px 12px;
    border-radius: var(--radius);
    margin-top: 6px;
    line-height: 1.5;
}

/* Responsive: timestamp drops to second row on narrow screens */
@media (max-width: 640px) {
    .activity-item-header {
        flex-wrap: wrap;
    }
    .activity-item-time {
        margin-left: 0;
        width: 100%;
        order: 3;
    }
}
/* ─── Locked-feature button styling ───────────────────────────────────── */
.btn-locked {
    opacity: 0.65;
    background: #e8e8e8 !important;
    color: #555 !important;
    border-color: #ccc !important;
    cursor: pointer;
    position: relative;
}
.btn-locked:hover {
    opacity: 0.85;
    background: #ddd !important;
}
 
.lock-badge {
    display: inline-block;
    margin-left: 0.5em;
    padding: 1px 7px;
    background: #4a4a4a;
    color: #fff;
    font-size: 0.72em;
    font-weight: 600;
    border-radius: 10px;
    vertical-align: middle;
    letter-spacing: 0.02em;
}
 
.btn-primary.btn-locked .lock-badge {
    background: #4a4a4a;
}
 
/* Optional subtle visual cue for the bulk CTA card when locked */
.bulk-cta-card--locked {
    border-left-color: #ccc;
}
 
/* Optional subtle visual cue for the products page bulk bar when locked */
.bulk-select-bar--locked .bulk-select-actions .btn-locked {
    /* nothing extra — the button styling above is enough */
}

