/* ============================================================
   Structure Viewer 2.2 – Core Stylesheet
   Slate-950 dark theme with violet accent.
   ============================================================ */

/* ── CSS Custom Properties ─────────────────────────────────── */
:root {
    --sv-bg:            #020617;
    --sv-surface:       #0f172a;
    --sv-surface-2:     #1e293b;
    --sv-surface-3:     rgba(30,41,59,0.5);
    --sv-surface-hover: rgba(30,41,59,0.7);
    --sv-border:        rgba(30,41,59,0.5);
    --sv-border-2:      #334155;
    --sv-accent:        #7c3aed;
    --sv-accent-light:  #8b5cf6;
    --sv-accent-text:   #a78bfa;
    --sv-accent-hover:  #6d28d9;
    --sv-accent-dim:    rgba(139,92,246,0.2);
    --sv-accent-glow:   rgba(124,58,237,0.3);
    --sv-text:          #f1f5f9;
    --sv-text-2:        #94a3b8;
    --sv-text-3:        #64748b;
    --sv-blue:          #3b82f6;
    --sv-green:         #10b981;
    --sv-amber:         #f59e0b;
    --sv-red:           #ef4444;
    --sv-pro:           #f59e0b;
    --sv-radius:        10px;
    --sv-radius-sm:     6px;
    --sv-radius-lg:     16px;
    --sv-shadow:        0 4px 24px rgba(0,0,0,0.5);
    --sv-shadow-lg:     0 8px 48px rgba(0,0,0,0.7);
    --sv-transition:    0.2s ease;
}

/* ── Scoped page styles (sidebar + admin bar remain visible) ── */
body.tools_page_structure-viewer,
body.toplevel_page_structure-viewer {
    background: #020617 !important;
}
body.tools_page_structure-viewer .wrap,
body.toplevel_page_structure-viewer .wrap { max-width: none !important; }


/* ── Light mode overrides ──────────────────────────────────── */
.sv-app.sv-light-mode {
    --sv-bg:            #f8fafc;
    --sv-surface:       #ffffff;
    --sv-surface-2:     #f1f5f9;
    --sv-surface-3:     rgba(241,245,249,0.8);
    --sv-surface-hover: rgba(226,232,240,0.8);
    --sv-border:        rgba(203,213,225,0.7);
    --sv-border-2:      #cbd5e1;
    --sv-text:          #0f172a;
    --sv-text-2:        #475569;
    --sv-text-3:        #94a3b8;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #f8fafc 100%);
}

.sv-app.sv-light-mode .sv-header {
    background: rgba(255,255,255,0.9);
    border-bottom-color: #e2e8f0;
}

.sv-app.sv-light-mode .sv-settings-sidebar {
    background: rgba(248,250,252,0.8);
    border-right-color: #e2e8f0;
}

.sv-app.sv-light-mode .sv-welcome-card {
    background: linear-gradient(135deg, rgba(241,245,249,0.8), rgba(255,255,255,0.8));
    border-color: #e2e8f0;
}

.sv-app.sv-light-mode .sv-action-card,
.sv-app.sv-light-mode .sv-stat-card {
    background: rgba(255,255,255,0.8);
    border-color: #e2e8f0;
}

.sv-app.sv-light-mode .sv-action-card:hover {
    background: rgba(241,245,249,0.9);
    border-color: #cbd5e1;
}

/* ── Dashboard: stat tiles ──────────────────────────────────── */
.sv-app.sv-light-mode .sv-dash-stat {
    background: #ffffff;
    border-color: #e2e8f0;
}
.sv-app.sv-light-mode .sv-dash-stat-label { color: #0f172a; }
.sv-app.sv-light-mode .sv-dash-stat-value { color: #0f172a; }

/* ── Dashboard: largest plugins table ───────────────────────── */
.sv-app.sv-light-mode .sv-largest-table {
    background: #ffffff;
    border-color: #e2e8f0;
}
.sv-app.sv-light-mode .sv-largest-row {
    border-bottom-color: #f1f5f9;
}
.sv-app.sv-light-mode .sv-largest-row:hover {
    background: #f8fafc;
}
.sv-app.sv-light-mode .sv-largest-name {
    color: #0f172a;
}
.sv-app.sv-light-mode .sv-largest-bar-wrap {
    background: #e2e8f0;
}
.sv-app.sv-light-mode .sv-largest-meta {
    color: #64748b;
}
.sv-app.sv-light-mode .sv-largest-size {
    color: #475569;
}

/* ── Dashboard: recently viewed panel ───────────────────────── */
.sv-app.sv-light-mode .sv-recent-panel {
    background: #ffffff;
    border-color: #e2e8f0;
}
.sv-app.sv-light-mode .sv-recent-panel .sv-recent-item {
    border-bottom-color: #f1f5f9;
}
.sv-app.sv-light-mode .sv-recent-panel .sv-recent-item:hover {
    background: #f8fafc;
}
.sv-app.sv-light-mode .sv-recent-list-inline .sv-recent-item {
    border-bottom-color: #f1f5f9;
}
.sv-app.sv-light-mode .sv-recent-list-inline .sv-recent-item:hover {
    background: #f8fafc;
}
.sv-app.sv-light-mode .sv-recent-name { color: #0f172a; }
.sv-app.sv-light-mode .sv-recent-type { color: #94a3b8; }
.sv-app.sv-light-mode .sv-recent-icon {
    background: rgba(139,92,246,0.1);
    border-color: rgba(139,92,246,0.15);
}

/* ── Dashboard: WordPress environment strip ─────────────────── */
.sv-app.sv-light-mode .sv-env-strip {
    background: #ffffff;
    border-color: #e2e8f0;
}
.sv-app.sv-light-mode .sv-env-item {
    border-right-color: #f1f5f9;
}
.sv-app.sv-light-mode .sv-env-value {
    color: #0f172a;
}

/* ── Dashboard: section headers ─────────────────────────────── */
.sv-app.sv-light-mode .sv-section-header {
    color: #0f172a;
}

/* ── Dashboard: stat tile loading (tree-loading spinner) ─────── */
.sv-app.sv-light-mode .sv-tree-loading {
    color: #64748b;
}

.sv-app.sv-light-mode .sv-form-input,
.sv-app.sv-light-mode .sv-search-box input {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

.sv-app.sv-light-mode .sv-number-input {
    background-color: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

/* ── Light mode settings group overrides ──────────────────── */
.sv-app.sv-light-mode .sv-settings-group {
    background: #ffffff;
    border-color: #e2e8f0;
}

.sv-app.sv-light-mode .sv-settings-group-header {
    background: #f8fafc;
    border-bottom-color: #e2e8f0;
    color: #0f172a;
}

.sv-app.sv-light-mode .sv-settings-group .sv-settings-row {
    border-bottom-color: #f1f5f9;
    background: transparent;
}

.sv-app.sv-light-mode .sv-settings-group .sv-settings-row:hover {
    background: #f8fafc;
}

.sv-app.sv-light-mode .sv-settings-actions {
    border-top-color: #e2e8f0;
}

.sv-app.sv-light-mode .sv-security-features {
    background: transparent;
    border-color: #e2e8f0;
}

.sv-app.sv-light-mode .sv-security-feature-item {
    color: #475569;
}

.sv-app.sv-light-mode .sv-patterns-container {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.sv-app.sv-light-mode .sv-pattern-tag {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

.sv-app.sv-light-mode .sv-add-pattern {
    border-color: #cbd5e1;
    color: #64748b;
}

.sv-app.sv-light-mode .sv-export-format-btn {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #475569;
}

.sv-app.sv-light-mode .sv-export-format-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}


.sv-app {
    min-height: 100vh;
    background: linear-gradient(135deg, #020617 0%, #0f172a 50%, #020617 100%);
    color: var(--sv-text);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

/* ── Header ────────────────────────────────────────────────── */
.sv-header {
    background: rgba(15,23,42,0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(30,41,59,0.5);
    position: sticky;
    top: 32px; /* WordPress admin bar is 32px tall */
    z-index: 1000;
}

.sv-header-inner {
    display: flex;
    align-items: center;
    padding: 0 28px;
    height: 64px;
    gap: 0;
    overflow: hidden;  /* clip the fade mask to the header bounds */
}

/* Logo — fixed width, never shrinks, never scrolls */
.sv-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    padding-right: 24px;
}

/* Logo — flex-shrink:0 keeps logo from being squeezed, already set above */

.sv-logo-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* PNG logos — displayed as-is, no tile background needed.
   The images already have their own background and rounded corners.
   Dark logo shown by default; light logo hidden until .sv-light-mode is toggled. */
.sv-logo-mark {
    display: block;
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 8px;
}
.sv-logo-mark-dark   { display: block; }
.sv-logo-mark-light  { display: none; }

/* In light mode: swap which logo is visible */
.sv-app.sv-light-mode .sv-logo-mark-dark  { display: none; }
.sv-app.sv-light-mode .sv-logo-mark-light { display: block; }

.sv-logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.sv-logo-name { font-size: 15px; font-weight: 700; color: var(--sv-text); letter-spacing: -0.02em; }
.sv-logo-sub  { font-size: 11px; color: var(--sv-text-3); font-weight: 400; }

/* Nav — scrolls horizontally when tabs overflow the available width.
   The logo is fixed; only this strip scrolls.
   A fade mask on the right edge signals that more tabs may be hidden. */
.sv-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;       /* IE/Edge */
    /* Right-edge fade: transparent → header background */
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 32px), transparent 100%);
    mask-image:         linear-gradient(to right, black calc(100% - 32px), transparent 100%);
    /* Extra right padding so the last tab isn't swallowed by the fade */
    padding-right: 32px;
}
.sv-nav::-webkit-scrollbar { display: none; }  /* Chrome/Safari */

.sv-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--sv-radius-sm);
    color: var(--sv-text-2);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: transparent;
    transition: all var(--sv-transition);
    text-decoration: none;
    white-space: nowrap;
}
.sv-nav-item svg { width: 16px; height: 16px; opacity: 0.7; flex-shrink: 0; }
.sv-nav-item:hover { color: var(--sv-text); background: var(--sv-surface-2); }
.sv-nav-item.active { color: var(--sv-accent-text); background: var(--sv-accent-dim); }
.sv-nav-item.active svg { opacity: 1; color: var(--sv-accent-text); }

/* PRO badge – amber gradient */
.sv-pro-badge {
    background: linear-gradient(90deg, #f59e0b, #f97316);
    color: #000;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 20px;
    letter-spacing: 0.04em;
    line-height: 1.4;
}

/* ── Tab panes – hidden until JS assigns active class ──────── */
/* All panes invisible on initial render; JS sets active immediately */
.sv-tab-pane {
    display: none;
    padding: 28px 32px;
    max-width: 1280px;
}
.sv-tab-pane.active { display: block; }
/* Make the app invisible until JS has run, preventing tab flash */
.sv-app { visibility: hidden; }
.sv-app.sv-ready { visibility: visible; }

.sv-page-title  { font-size: 22px; font-weight: 700; color: var(--sv-text); margin: 0 0 4px; letter-spacing: -0.02em; }
.sv-page-subtitle { font-size: 13px; color: var(--sv-text-3); margin: 0 0 24px; }

/* ══════════════════════════════════════════════════════════════
   DASHBOARD
══════════════════════════════════════════════════════════════ */
.sv-welcome-card {
    border-radius: var(--sv-radius-lg);
    border: 1px solid rgba(30,41,59,0.5);
    background: linear-gradient(135deg, rgba(30,41,59,0.5), rgba(15,23,42,0.5));
    padding: 32px;
    margin-bottom: 28px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}
.sv-welcome-card h2 { font-size: 22px; font-weight: 700; color: var(--sv-text); margin: 0 0 8px; letter-spacing: -0.02em; }
.sv-welcome-card p  { color: var(--sv-text-2); font-size: 13.5px; margin: 0; max-width: 520px; line-height: 1.7; }

.sv-version-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--sv-accent-dim);
    border: 1px solid rgba(139,92,246,0.3);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px;
    color: var(--sv-accent-text);
    white-space: nowrap;
    flex-shrink: 0;
}
.sv-version-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--sv-accent-text);
    animation: sv-pulse 2s ease-in-out infinite;
}
@keyframes sv-pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

.sv-section-header { font-size: 16px; font-weight: 600; color: var(--sv-text); margin: 0 0 16px; }

/* Quick Actions */
.sv-quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 28px;
}

.sv-action-card {
    background: rgba(30,41,59,0.3);
    border: 1px solid rgba(30,41,59,0.5);
    border-radius: var(--sv-radius);
    padding: 20px;
    cursor: pointer;
    text-decoration: none;
    display: block;
    transition: all var(--sv-transition);
    position: relative;
}
.sv-action-card:hover {
    border-color: var(--sv-border-2);
    background: rgba(30,41,59,0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    text-decoration: none;
}
.sv-action-card-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.sv-action-card-icon svg { width: 22px; height: 22px; color: #fff; }

.sv-action-icon-violet  { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.sv-action-icon-amber   { background: linear-gradient(135deg, #f59e0b, #f97316); }
.sv-action-icon-emerald { background: linear-gradient(135deg, #10b981, #0d9488); }
.sv-action-icon-blue    { background: linear-gradient(135deg, #3b82f6, #06b6d4); }

.sv-action-card h4 { font-size: 14px; font-weight: 600; color: var(--sv-text); margin: 0 0 4px; transition: color var(--sv-transition); }
.sv-action-card:hover h4 { color: var(--sv-accent-text); }
.sv-action-card p  { font-size: 12px; color: var(--sv-text-3); margin: 0 0 14px; line-height: 1.6; }

.sv-action-card-arrow {
    font-size: 12px; color: var(--sv-accent-text);
    display: flex; align-items: center; gap: 4px;
    opacity: 0; transition: opacity var(--sv-transition);
}
.sv-action-card:hover .sv-action-card-arrow { opacity: 1; }
.sv-action-card-arrow svg { width: 14px; height: 14px; }

.sv-action-pro-badge {
    position: absolute; top: 14px; right: 14px;
    background: linear-gradient(90deg, #f59e0b, #f97316);
    color: #000; font-size: 9px; font-weight: 800;
    padding: 2px 6px; border-radius: 20px; letter-spacing: 0.04em;
}

/* ── Stat tiles ─────────────────────────────────────────────── */
.sv-dash-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 28px;
}

.sv-dash-stat {
    background: rgba(30,41,59,0.35);
    border: 1px solid var(--sv-border-2);
    border-radius: var(--sv-radius);
    padding: 20px 22px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
}

.sv-dash-stat-icon {
    width: 46px; height: 46px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.sv-dsi-violet  { background: linear-gradient(135deg, #7c3aed, #6d28d9); color: #fff; }
.sv-dsi-emerald { background: linear-gradient(135deg, #10b981, #0d9488); color: #fff; }
.sv-dsi-blue    { background: linear-gradient(135deg, #3b82f6, #06b6d4); color: #fff; }

.sv-dash-stat-body  { flex: 1; min-width: 0; }
.sv-dash-stat-label { font-size: 13px; font-weight: 600; color: var(--sv-text); margin-bottom: 3px; }
.sv-dash-stat-sub   { font-size: 11px; color: var(--sv-text-3); }
.sv-dash-active     { color: var(--sv-green); font-weight: 600; }
.sv-dash-inactive   { color: var(--sv-text-3); }

/* Number pushed to the far right */
.sv-dash-stat-value {
    font-size: 30px;
    font-weight: 800;
    color: var(--sv-text);
    line-height: 1;
    letter-spacing: -0.03em;
    flex-shrink: 0;
    margin-left: auto;
    text-align: right;
}

.sv-dash-stat-arrow {
    color: var(--sv-accent-text);
    opacity: 0;
    transition: opacity var(--sv-transition);
    flex-shrink: 0;
}

/* Quick actions in 4-col mode (dashboard default) */
.sv-quick-actions-4col {
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: 28px;
}

/* Quick actions in 3-col mode */
.sv-quick-actions-3col {
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 28px;
}

/* Quick actions in 2-col mode (kept for any reuse) */
.sv-quick-actions-2col {
    grid-template-columns: 1fr 1fr;
    margin-bottom: 0;
}

/* ── Largest Plugins + Recently Viewed split ───────────────── */
.sv-dash-section-split {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 14px;
    align-items: start;
    margin-bottom: 28px;
}

/* Recently Viewed panel */
.sv-recent-panel {
    background: rgba(30,41,59,0.3);
    border: 1px solid var(--sv-border-2);
    border-radius: var(--sv-radius);
    overflow: hidden;
}
.sv-recent-panel .sv-recent-list-inline {
    margin-top: 0;
    padding: 4px 0;
}
.sv-recent-panel .sv-recent-empty {
    padding: 14px 16px;
    font-size: 12px;
    color: var(--sv-text-3);
    display: block;
}
.sv-recent-panel .sv-recent-item {
    padding: 9px 14px;
    border-bottom: 1px solid var(--sv-border);
    border-radius: 0;
    gap: 10px;
}
.sv-recent-panel .sv-recent-item:last-child { border-bottom: none; }

/* Recently Viewed card – inline list inside action card */
.sv-action-card-recent {
    cursor: default;
}
.sv-action-card-recent:hover {
    transform: none;
    box-shadow: none;
}

.sv-recent-list-inline {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
}

.sv-recent-list-inline .sv-recent-empty {
    font-size: 12px;
    color: var(--sv-text-3);
    padding: 4px 0;
    display: flex;
    gap: 6px;
    align-items: center;
}

.sv-recent-list-inline .sv-recent-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--sv-border);
    cursor: pointer;
    border-radius: 0;
    transition: background var(--sv-transition);
}
.sv-recent-list-inline .sv-recent-item:last-child { border-bottom: none; }
.sv-recent-list-inline .sv-recent-item:hover { background: rgba(124,58,237,0.08); }

.sv-recent-list-inline .sv-recent-icon {
    width: 22px; height: 22px;
    border-radius: 4px;
    background: var(--sv-accent-dim);
    border: 1px solid rgba(124,58,237,0.2);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: var(--sv-accent-text);
}
.sv-recent-list-inline .sv-recent-name { font-size: 12px; font-weight: 600; color: var(--sv-text); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.sv-recent-list-inline .sv-recent-type { font-size: 10px; color: var(--sv-text-3); text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Largest Plugins ────────────────────────────────────────── */
.sv-dash-section { margin-bottom: 28px; }

.sv-largest-table {
    background: rgba(30,41,59,0.3);
    border: 1px solid var(--sv-border-2);
    border-radius: var(--sv-radius);
    overflow: hidden;
}

.sv-largest-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--sv-border);
    cursor: pointer;
    transition: background var(--sv-transition);
}
.sv-largest-row:last-child { border-bottom: none; }
.sv-largest-row:hover { background: rgba(124,58,237,0.07); }
.sv-largest-row:hover .sv-dash-stat-arrow { opacity: 1; }

.sv-largest-name {
    font-size: 13px; font-weight: 600; color: var(--sv-text);
    width: 180px; flex-shrink: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sv-largest-bar-wrap {
    flex: 1;
    height: 5px;
    background: var(--sv-border);
    border-radius: 3px;
    overflow: hidden;
}
.sv-largest-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--sv-accent), var(--sv-accent-light));
    border-radius: 3px;
    min-width: 4px;
    transition: width 0.6s ease;
}

.sv-largest-meta {
    display: flex;
    gap: 10px;
    font-size: 11.5px;
    color: var(--sv-text-3);
    flex-shrink: 0;
    text-align: right;
    width: 140px;
    justify-content: flex-end;
}
.sv-largest-size { color: var(--sv-text-2); font-weight: 500; }

/* ── WP Environment strip ───────────────────────────────────── */
.sv-env-strip {
    display: flex;
    gap: 0;
    background: rgba(30,41,59,0.3);
    border: 1px solid var(--sv-border-2);
    border-radius: var(--sv-radius);
    overflow: hidden;
}

.sv-env-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-right: 1px solid var(--sv-border);
    min-width: 0;
}
.sv-env-item:last-child { border-right: none; }

.sv-env-icon {
    width: 30px; height: 30px;
    border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.sv-env-icon-wp    { background: rgba(33,128,192,0.15);  color: #21a0c0; }
.sv-env-icon-php   { background: rgba(97,78,163,0.15);   color: #614ea3; }
.sv-env-icon-theme { background: rgba(245,158,11,0.15);  color: var(--sv-amber); }
.sv-env-icon-site  { background: rgba(16,185,129,0.15);  color: var(--sv-green); }
.sv-env-icon-mem   { background: rgba(59,130,246,0.15);  color: var(--sv-blue); }

.sv-env-label { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--sv-text-3); margin-bottom: 2px; }
.sv-env-value { font-size: 13px; font-weight: 700; color: var(--sv-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-env-item > div { min-width: 0; overflow: hidden; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .sv-dash-stats { grid-template-columns: repeat(3, 1fr); }
    .sv-quick-actions-4col { grid-template-columns: repeat(2, 1fr); }
    .sv-quick-actions-3col { grid-template-columns: repeat(2, 1fr); }
    .sv-dash-section-split { grid-template-columns: 1fr; }
    .sv-env-strip  { flex-wrap: wrap; }
    .sv-env-item   { flex: 1 1 45%; min-width: 160px; border-right: none; border-bottom: 1px solid var(--sv-border); }
    .sv-env-item:last-child { border-bottom: none; }
    .sv-largest-name { width: 130px; }
    .sv-largest-meta { width: 110px; }
}
@media (max-width: 768px) {
    .sv-dash-stats { grid-template-columns: 1fr; }
    .sv-quick-actions-4col { grid-template-columns: 1fr; }
    .sv-quick-actions-3col { grid-template-columns: 1fr; }
    .sv-largest-meta .sv-largest-size { display: none; }
    .sv-largest-name { width: 100px; }
}

/* ══════════════════════════════════════════════════════════════
   COMPARATOR PLACEHOLDER
══════════════════════════════════════════════════════════════ */
.sv-pro-placeholder {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; min-height: 60vh; text-align: center; gap: 16px;
}
.sv-pro-placeholder-icon {
    width: 72px; height: 72px;
    background: linear-gradient(135deg, var(--sv-accent), #4f46e5);
    border-radius: var(--sv-radius-lg);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 40px var(--sv-accent-glow);
    margin-bottom: 8px;
}
.sv-pro-placeholder-icon svg { width: 36px; height: 36px; color: #fff; }
.sv-pro-placeholder h2 { font-size: 24px; font-weight: 700; color: var(--sv-text); margin: 0; letter-spacing: -0.02em; }
.sv-pro-placeholder p  { color: var(--sv-text-2); font-size: 15px; max-width: 420px; margin: 0; line-height: 1.7; }
.sv-pro-placeholder .sv-pro-badge-lg {
    background: linear-gradient(90deg, #f59e0b, #f97316);
    color: #000; font-size: 12px; font-weight: 800;
    padding: 4px 14px; border-radius: 20px; letter-spacing: 0.06em; display: inline-block;
}

/* Feature checklist inside upsell placeholders */
.sv-upsell-features {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    max-width: 400px;
    width: 100%;
}

.sv-upsell-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    color: var(--sv-text-2);
    line-height: 1.5;
}

.sv-upsell-features li svg {
    flex-shrink: 0;
    color: var(--sv-green);
    opacity: 0.9;
}

/* Actions row — holds the upgrade button (and any future secondary link) */
.sv-upsell-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 4px;
}

/* Upgrade CTA button shown in Pro placeholders on the free version */
.sv-upsell-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 26px;
    background: var(--sv-accent);
    color: #fff;
    border-radius: var(--sv-radius-sm);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background var(--sv-transition), box-shadow var(--sv-transition), transform var(--sv-transition);
    letter-spacing: -0.01em;
    white-space: nowrap;
}
.sv-upsell-btn:hover {
    background: var(--sv-accent-hover);
    color: #fff;
    box-shadow: 0 4px 16px var(--sv-accent-glow);
    transform: translateY(-1px);
}
.sv-upsell-btn svg { flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════
   SETTINGS PAGE – grouped card layout (no sidebar)
══════════════════════════════════════════════════════════════ */
#sv-tab-settings { padding: 28px 32px; max-width: 900px; }

.sv-settings-page-header { margin-bottom: 24px; }

/* One group = one card */
.sv-settings-group {
    background: rgba(30,41,59,0.4);
    border: 1px solid var(--sv-border-2);
    border-radius: var(--sv-radius-lg);
    padding: 0;
    margin-bottom: 20px;
    overflow: hidden;
}

/* Group header – icon + title strip */
.sv-settings-group-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--sv-border-2);
    background: rgba(15,23,42,0.4);
    font-size: 15px;
    font-weight: 700;
    color: var(--sv-text);
    letter-spacing: -0.01em;
}

.sv-settings-group-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sv-settings-group-icon svg { width: 18px; height: 18px; color: #fff; }

.sv-sgi-violet  { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.sv-sgi-emerald { background: linear-gradient(135deg, #10b981, #0d9488); }
.sv-sgi-blue    { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.sv-sgi-amber   { background: linear-gradient(135deg, #f59e0b, #f97316); }

/* Rows inside groups */
.sv-settings-group .sv-settings-row {
    border: none;
    border-bottom: 1px solid var(--sv-border);
    border-radius: 0;
    background: transparent;
    padding: 16px 22px;
    margin-bottom: 0;
}
.sv-settings-group .sv-settings-row:last-child { border-bottom: none; }
.sv-settings-group .sv-settings-row:hover { background: rgba(30,41,59,0.3); }

.sv-settings-group .sv-security-features {
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 16px 22px;
    margin-bottom: 0;
}

.sv-settings-group .sv-settings-placeholder {
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 24px 22px;
}

/* All-settings wrapper */
.sv-settings-all { max-width: 820px; }

/* Save button row */
.sv-settings-actions {
    margin-top: 8px;
    padding-top: 0;
    border-top: none;
    display: flex;
    justify-content: flex-end;
}

/* Settings rows */
.sv-settings-row {
    background: rgba(30,41,59,0.5);
    border: 1px solid #334155;
    border-radius: var(--sv-radius);
    padding: 16px 20px;
    display: flex; align-items: center; gap: 16px;
    margin-bottom: 10px;
    transition: border-color var(--sv-transition);
}
.sv-settings-row:hover { border-color: #475569; }

.sv-settings-row-icon {
    width: 36px; height: 36px; border-radius: var(--sv-radius-sm);
    background: var(--sv-accent-dim);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sv-settings-row-icon svg { width: 18px; height: 18px; color: var(--sv-accent-text); }
.sv-settings-row-info { flex: 1; }
.sv-settings-row-label { font-size: 14px; font-weight: 600; color: var(--sv-text); display: block; margin-bottom: 2px; }
.sv-settings-row-desc  { font-size: 12px; color: var(--sv-text-3); }

/* ── Licence card status indicators ──────────────────── */
.sv-licence-active   { color: var(--sv-green) !important; }
.sv-licence-inactive { color: var(--sv-amber) !important; }

/* ── Licence action buttons ───────────────────────────── */
/* ── Licence card actions row ─────────────────────────────── */
.sv-licence-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* The deactivate <form> must be inline-flex so it sits in the
   flex row alongside the anchor/button siblings. Without this,
   the form is a block element and drops onto its own line. */
.sv-deactivate-form {
    display: inline-flex;
}

.sv-licence-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding: 8px 16px;
    border-radius: var(--sv-radius-sm);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--sv-transition);
    border: 1px solid transparent;
}

.sv-licence-btn--primary {
    background: var(--sv-accent);
    color: #fff;
    border-color: var(--sv-accent);
}
.sv-licence-btn--primary:hover {
    background: var(--sv-accent-hover);
    color: #fff;
    box-shadow: 0 4px 12px var(--sv-accent-glow);
    transform: translateY(-1px);
}

.sv-licence-btn--secondary {
    background: var(--sv-surface-2);
    color: var(--sv-text-2);
    border-color: var(--sv-border-2);
}
.sv-licence-btn--secondary:hover {
    background: var(--sv-surface-3);
    color: var(--sv-text);
    border-color: var(--sv-border-2);
}

/* Light mode overrides */
.sv-app.sv-light-mode .sv-licence-btn--secondary {
    background: #f1f5f9;
    color: #475569;
    border-color: #cbd5e1;
}
.sv-app.sv-light-mode .sv-licence-btn--secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Accent licence button (What's Next?) */
.sv-licence-btn--accent {
    background: var(--sv-accent-dim);
    color: var(--sv-accent-text);
    border-color: var(--sv-accent-text);
}
.sv-licence-btn--accent:hover {
    background: var(--sv-accent);
    color: #fff;
    border-color: var(--sv-accent);
    box-shadow: 0 3px 10px var(--sv-accent-glow);
}

.sv-licence-btn--danger {
    background: rgba(239,68,68,0.12);
    color: #f87171;
    border-color: rgba(239,68,68,0.35);
}
.sv-licence-btn--danger:hover {
    background: rgba(239,68,68,0.22);
    color: #fca5a5;
    border-color: rgba(239,68,68,0.6);
}

/* ── Post-purchase welcome modal ──────────────────────────── */
/* Reuses .sv-export-modal-overlay / .sv-export-modal-dialog  */

.sv-welcome-modal-dialog {
    max-width: 560px;
}

.sv-welcome-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sv-welcome-modal-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--sv-radius-sm);
    background: var(--sv-accent-dim);
    border: 1px solid var(--sv-accent-text);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sv-accent-text);
    flex-shrink: 0;
}

.sv-welcome-modal-subtitle {
    color: var(--sv-text-2);
    font-size: 13.5px;
    margin: 0 0 22px;
    line-height: 1.6;
}

/* Steps list */
.sv-welcome-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sv-welcome-step {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--sv-border);
}

.sv-welcome-step:last-child {
    border-bottom: none;
}

.sv-welcome-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--sv-accent-dim);
    border: 1px solid var(--sv-accent-text);
    color: var(--sv-accent-text);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.sv-welcome-step-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sv-welcome-step-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--sv-text);
}

.sv-welcome-step-desc {
    font-size: 13px;
    color: var(--sv-text-2);
    line-height: 1.6;
}

.sv-welcome-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 8px;
    padding: 9px 18px;
    background: var(--sv-accent);
    color: #fff;
    border-radius: var(--sv-radius-sm);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background var(--sv-transition), box-shadow var(--sv-transition), transform var(--sv-transition);
    width: fit-content;
}

.sv-welcome-download-btn:hover {
    background: var(--sv-accent-hover);
    color: #fff;
    box-shadow: 0 4px 14px var(--sv-accent-glow);
    transform: translateY(-1px);
}

.sv-welcome-modal-note {
    margin: 18px 0 0;
    font-size: 12px;
    color: var(--sv-text-3);
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid var(--sv-border);
}

/* Light mode overrides */
.sv-app.sv-light-mode .sv-welcome-step {
    border-bottom-color: #e2e8f0;
}

.sv-app.sv-light-mode .sv-welcome-modal-note {
    border-top-color: #e2e8f0;
}

/* ── Copy format pills (Settings tab) ────────────────────────── */
.sv-copy-format-pills {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.sv-copy-format-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: var(--sv-radius-sm);
    border: 1px solid var(--sv-border-2);
    background: var(--sv-surface-2);
    color: var(--sv-text-2);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--sv-transition);
    user-select: none;
}

.sv-copy-format-pill input[type="radio"] {
    display: none;
}

.sv-copy-format-pill:hover {
    background: var(--sv-surface-hover);
    color: var(--sv-text);
    border-color: var(--sv-border-2);
}

.sv-copy-format-pill.active {
    background: var(--sv-accent-dim);
    border-color: var(--sv-accent-text);
    color: var(--sv-accent-text);
    font-weight: 600;
}

/* Light mode */
.sv-app.sv-light-mode .sv-copy-format-pill {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}
.sv-app.sv-light-mode .sv-copy-format-pill:hover {
    background: #e2e8f0;
    color: #0f172a;
}
.sv-app.sv-light-mode .sv-copy-format-pill.active {
    background: rgba(5,150,105,0.08);
    border-color: #059669;
    color: #047857;
}

/* Number input — scoped under .sv-app to beat WP admin specificity */
.sv-app .sv-number-input {
    width: 70px;
    background-color: var(--sv-surface-2) !important;
    border: 1px solid var(--sv-border-2) !important;
    border-radius: var(--sv-radius-sm);
    color: var(--sv-text) !important;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 10px;
    text-align: center;
    outline: none;
    transition: border-color var(--sv-transition), background-color var(--sv-transition);
    -moz-appearance: textfield;
    box-shadow: none !important;
}
.sv-app .sv-number-input::-webkit-outer-spin-button,
.sv-app .sv-number-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.sv-app .sv-number-input:focus {
    border-color: var(--sv-border-2) !important;
    box-shadow: none !important;
}

/* Toggle switch */
.sv-toggle-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; cursor: pointer; }
.sv-toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.sv-toggle-track {
    position: absolute; inset: 0; background: #334155; border-radius: 12px;
    transition: background var(--sv-transition); cursor: pointer;
}
.sv-toggle-track::after {
    content: ''; position: absolute; left: 3px; top: 3px;
    width: 18px; height: 18px; background: #fff; border-radius: 50%;
    transition: transform var(--sv-transition);
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.sv-toggle-switch input:checked + .sv-toggle-track { background: var(--sv-accent-light); }
.sv-toggle-switch input:checked + .sv-toggle-track::after { transform: translateX(20px); }

/* Patterns */
.sv-section-subtitle { font-size: 15px; font-weight: 600; color: var(--sv-text); margin: 28px 0 6px; }
.sv-section-desc     { font-size: 12px; color: var(--sv-text-3); margin: 0 0 14px; }

.sv-patterns-container {
    background: rgba(30,41,59,0.5); border: 1px solid #334155;
    border-radius: var(--sv-radius); padding: 16px;
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.sv-pattern-tag {
    background: var(--sv-surface-2); border: 1px solid #334155; border-radius: 6px;
    padding: 4px 10px; font-size: 12px; color: var(--sv-text-2);
    display: inline-flex; align-items: center; gap: 6px;
    font-family: 'Courier New', monospace;
}
.sv-pattern-remove {
    width: 14px; height: 14px; border-radius: 50%;
    background: #334155; border: none; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--sv-text-3); font-size: 11px; line-height: 1;
    transition: all var(--sv-transition); padding: 0;
}
.sv-pattern-remove:hover { background: var(--sv-red); color: #fff; }
.sv-add-pattern {
    background: transparent; border: 1px dashed #334155; border-radius: 6px;
    padding: 4px 10px; font-size: 12px; color: var(--sv-text-3);
    cursor: pointer; transition: all var(--sv-transition);
}
.sv-add-pattern:hover { border-color: var(--sv-accent-light); color: var(--sv-accent-text); }

/* Save button */
.sv-btn-save {
    background: linear-gradient(90deg, #7c3aed, #6d28d9);
    color: #fff; border: none; border-radius: var(--sv-radius-sm);
    padding: 10px 24px; font-size: 14px; font-weight: 600; cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    transition: all var(--sv-transition);
    box-shadow: 0 4px 16px rgba(124,58,237,0.35);
}
.sv-btn-save:hover {
    background: linear-gradient(90deg, #6d28d9, #5b21b6);
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(124,58,237,0.45);
}
.sv-btn-save svg { width: 15px; height: 15px; }

/* ── Security features ─────────────────────────────────────── */
.sv-security-features {
    background: rgba(30,41,59,0.5); border: 1px solid #334155;
    border-radius: var(--sv-radius); padding: 20px; margin-bottom: 16px;
}
.sv-security-features h4 { font-size: 14px; font-weight: 600; color: var(--sv-text); margin: 0 0 14px; }
.sv-security-feature-item {
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; color: var(--sv-text-2); padding: 5px 0;
}
.sv-security-feature-item svg { width: 16px; height: 16px; color: var(--sv-green); flex-shrink: 0; }

/* ── Export format selector ────────────────────────────────── */
.sv-export-format-grid {
    display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-top: 10px;
}
.sv-export-format-btn {
    border-radius: var(--sv-radius-sm); border: 1px solid #334155;
    background: rgba(30,41,59,0.5); color: var(--sv-text-2);
    padding: 12px; text-align: center; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all var(--sv-transition);
    text-transform: uppercase; letter-spacing: 0.04em;
}
.sv-export-format-btn:hover { border-color: #475569; color: var(--sv-text); }
.sv-export-format-btn.active {
    border-color: var(--sv-accent-light); background: var(--sv-accent-dim); color: var(--sv-accent-text);
}

/* ── Export options ────────────────────────────────────────── */
.sv-export-options {
    background: rgba(30,41,59,0.5); border: 1px solid #334155;
    border-radius: var(--sv-radius); padding: 20px; margin-bottom: 16px;
}
.sv-export-options h4 { font-size: 14px; font-weight: 600; color: var(--sv-text); margin: 0 0 14px; }
.sv-export-option-item {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 0; cursor: pointer; font-size: 13px; color: var(--sv-text-2);
    user-select: none;
}
.sv-export-option-item input[type="checkbox"] {
    width: 16px; height: 16px; accent-color: var(--sv-accent-light);
    cursor: pointer; border-radius: 4px;
}

/* ── Accent colour swatches ────────────────────────────────── */
.sv-accent-colors { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.sv-accent-swatch {
    width: 36px; height: 36px; border-radius: 50%;
    border: 3px solid transparent; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--sv-transition); outline: none; padding: 0;
}
.sv-accent-swatch:hover { transform: scale(1.1); }
.sv-accent-swatch.active {
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
}
.sv-accent-swatch svg { width: 16px; height: 16px; color: #fff; display: none; }
.sv-accent-swatch.active svg { display: block; }
.sv-swatch-violet  { background: #7c3aed; }
.sv-swatch-blue    { background: #3b82f6; }
.sv-swatch-emerald { background: #10b981; }
.sv-swatch-amber   { background: #f59e0b; }
.sv-swatch-rose    { background: #f43f5e; }

/* Notifications placeholder */
.sv-settings-placeholder {
    background: rgba(30,41,59,0.3); border: 1px solid rgba(30,41,59,0.5);
    border-radius: var(--sv-radius); padding: 40px; text-align: center; color: var(--sv-text-3);
}

/* ── Settings saved toast ──────────────────────────────────── */
.sv-toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: #10b981;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: var(--sv-radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(16,185,129,0.4);
    z-index: 999999;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.sv-toast.sv-toast-visible {
    opacity: 1;
    transform: translateY(0);
}
.sv-app ::-webkit-scrollbar { width: 6px; height: 6px; }
.sv-app ::-webkit-scrollbar-track { background: var(--sv-surface); }
.sv-app ::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
.sv-app ::-webkit-scrollbar-thumb:hover { background: #475569; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .sv-quick-actions { grid-template-columns: repeat(2,1fr); }
    .sv-stats-grid    { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 900px) {
    .sv-header-inner { padding: 0 16px; }
    .sv-logo { padding-right: 16px; }
    .sv-tab-pane { padding: 20px 16px; }
    .sv-welcome-card { flex-direction: column; }
    #sv-tab-settings { padding: 20px 16px; }
}
/* WP admin bar is 46px on mobile (≤782px) */
@media (max-width: 782px) {
    .sv-header { top: 46px; }
}
@media (max-width: 720px) {
    .sv-logo-text { display: none; }
    /* Labels stay visible — users scroll the tab bar horizontally to reach overflow tabs */
    .sv-quick-actions { grid-template-columns: 1fr; }
    .sv-stats-grid    { grid-template-columns: repeat(2,1fr); }
}