:root {
    color-scheme: light dark;
    --bg: #f4f5f8;
    --fg: #16181d;
    --card: #ffffff;
    --card-hover: #fbfbfd;
    --border: #e6e8ec;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-soft: #eef0ff;
    --danger: #dc2626;
    --danger-soft: #fdecec;
    --success: #16a34a;
    --success-soft: #e8f8ee;
    --warning: #b45309;
    --warning-soft: #fdf3dd;
    --muted: #6b7280;
    --sidebar-bg: #14161f;
    --sidebar-fg: #cbd0dc;
    --sidebar-active: #232640;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
    --radius: 10px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1117;
        --fg: #e6e8ee;
        --card: #171923;
        --card-hover: #1c1f2b;
        --border: #262a38;
        --primary: #6366f1;
        --primary-hover: #818cf8;
        --primary-soft: #1e2049;
        --danger-soft: #3a1616;
        --success-soft: #123422;
        --warning-soft: #3a2a0d;
        --muted: #9198a8;
        --sidebar-bg: #0a0b10;
        --sidebar-fg: #a9afc0;
        --sidebar-active: #1c1f36;
        --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 6px rgba(0, 0, 0, 0.25);
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--fg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

h1, h2, h3 { font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 18px; margin: 28px 0 12px; }

.container { max-width: 1100px; margin: 0 auto; padding: 24px; }

/* Public site navbar (frontend only) */
.navbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 24px; border-bottom: 1px solid var(--border); background: var(--card);
}
.navbar a { font-weight: 600; color: var(--fg); }
.navbar a:hover { color: var(--primary); }

/* Promotional banners (additional_promos_enabled) */
.promo-banner-slot { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px auto 0; }
.promo-banner { display: block; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.promo-banner img { display: block; max-width: 100%; height: auto; }

/* Homepage hero carousel (hero_rotation_enabled) */
.hero-carousel { position: relative; overflow: hidden; height: 280px; background: var(--sidebar-bg); }
.hero-carousel-track { display: flex; height: 100%; transition: transform 0.5s ease; }
.hero-carousel-slide {
    flex: 0 0 100%; height: 100%; background-size: cover; background-position: center;
    display: flex; align-items: flex-end; text-decoration: none; position: relative;
}
.hero-carousel-slide::after {
    content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.65), transparent 60%);
}
.hero-carousel-caption {
    position: relative; z-index: 1; padding: 24px; color: #fff; max-width: 1100px; margin: 0 auto; width: 100%;
}
.hero-carousel-caption strong { display: block; font-size: 20px; }
.hero-carousel-caption span { font-size: 13.5px; opacity: 0.85; }
.hero-carousel-dots { position: absolute; bottom: 12px; right: 20px; display: flex; gap: 6px; z-index: 2; }
.hero-carousel-dot { width: 8px; height: 8px; border-radius: 999px; background: rgba(255,255,255,0.4); cursor: pointer; }
.hero-carousel-dot.active { background: #fff; }

.site-footer {
    margin-top: 40px; padding: 24px 0; border-top: 1px solid var(--border);
    text-align: center; color: var(--muted); font-size: 13px;
}
.site-footer p { margin: 4px 0; }

/* Admin/Developer dashboard shell */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 232px; flex-shrink: 0; background: var(--sidebar-bg); color: var(--sidebar-fg);
    display: flex; flex-direction: column; padding: 20px 12px; position: sticky; top: 0; height: 100vh;
    overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; transition: width 0.15s ease;
}

/* Collapsed state (sidebar_toggle_enabled) — icons only, labels hidden */
.app-shell.sidebar-collapsed .sidebar { width: 64px; }
.app-shell.sidebar-collapsed .sidebar-brand-text,
.app-shell.sidebar-collapsed .sidebar-group-label,
.app-shell.sidebar-collapsed .sidebar-link span:not(.sidebar-icon) {
    display: none;
}
.app-shell.sidebar-collapsed .sidebar-link { justify-content: center; }
.sidebar-toggle-btn {
    display: flex; align-items: center; justify-content: center; width: 28px; height: 28px;
    border-radius: 6px; border: none; background: transparent; color: var(--sidebar-fg); cursor: pointer;
    margin-left: auto;
}
.sidebar-toggle-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }

.sidebar-brand {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px 20px; color: #fff;
}
.sidebar-brand-mark {
    width: 28px; height: 28px; border-radius: 8px; background: var(--primary);
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: #fff;
}
.sidebar-brand-text { font-weight: 700; font-size: 15px; }

.sidebar-nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.sidebar-group-label {
    font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
    color: rgba(255,255,255,0.35); padding: 14px 12px 5px;
}
.sidebar-group-label:first-child { padding-top: 4px; }

.sidebar-link {
    display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 7px;
    color: var(--sidebar-fg); font-size: 13.5px; font-weight: 500; position: relative;
    transition: background 0.1s ease, color 0.1s ease;
}
.sidebar-link:hover { background: rgba(255,255,255,0.055); color: #fff; }
.sidebar-link.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.sidebar-link.active::before {
    content: ''; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--primary);
}
.sidebar-icon { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; opacity: 0.8; flex-shrink: 0; }
.sidebar-link.active .sidebar-icon, .sidebar-link:hover .sidebar-icon { opacity: 1; }
.sidebar-logout { margin-top: 6px; border-top: 1px solid rgba(255,255,255,0.08); padding-top: 12px; }

.app-main { flex: 1; min-width: 0; }

.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 28px; background: var(--card); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 5;
}
.topbar-title { margin: 0; font-size: 20px; }
.topbar-identity { color: var(--muted); font-size: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }

/* Topbar dropdowns (notifications bell + profile menu) */
.topbar-dropdown { position: relative; }
.topbar-icon-btn {
    display: flex; align-items: center; justify-content: center; width: 36px; height: 36px;
    border-radius: 8px; border: none; background: transparent; color: var(--fg); cursor: pointer;
    position: relative;
}
.topbar-icon-btn:hover { background: var(--card-hover); }
.topbar-badge {
    position: absolute; top: 4px; right: 4px; min-width: 15px; height: 15px; padding: 0 3px;
    border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; line-height: 1;
}
.topbar-profile-btn {
    display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px;
    border: none; background: transparent; color: var(--fg); cursor: pointer; font-size: 13.5px; font-weight: 600;
}
.topbar-profile-btn:hover { background: var(--card-hover); }
.topbar-avatar {
    width: 26px; height: 26px; border-radius: 999px; background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.topbar-menu {
    position: absolute; top: calc(100% + 8px); right: 0; min-width: 220px; background: var(--card);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg, var(--shadow));
    z-index: 30; display: none; overflow: hidden;
}
.topbar-menu.open { display: block; }
.topbar-menu-header { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.topbar-menu-header strong { font-size: 13px; }
.topbar-menu-link {
    display: flex; align-items: center; gap: 9px; padding: 10px 14px; font-size: 13.5px; color: var(--fg);
    cursor: pointer;
}
.topbar-menu-link:hover { background: var(--card-hover); }
.topbar-menu-link.danger { color: var(--danger); }
.topbar-menu-sep { border-top: 1px solid var(--border); margin: 4px 0; }
.topbar-notif-list { max-height: 360px; overflow-y: auto; }
.topbar-notif-item { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; cursor: pointer; }
.topbar-notif-item:last-child { border-bottom: none; }
.topbar-notif-item:hover { background: var(--card-hover); }
.topbar-notif-item.unread { background: var(--primary-soft); }
.topbar-notif-item strong { display: block; font-size: 13px; }
.topbar-notif-item .muted { font-size: 11.5px; }
.topbar-menu-footer { padding: 9px 14px; text-align: center; border-top: 1px solid var(--border); font-size: 12.5px; }
.topbar-menu-footer a { color: var(--primary); font-weight: 600; }

/* Row action menu (kebab "..." dropdown on list cards — companies, listings, etc.) */
.row-menu-wrap { position: relative; display: inline-block; }
.row-menu-btn {
    display: flex; align-items: center; justify-content: center; width: 32px; height: 32px;
    border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--fg);
    cursor: pointer; font-size: 18px; line-height: 1; letter-spacing: 1px;
}
.row-menu-btn:hover { background: var(--card-hover); }
.row-menu {
    position: absolute; top: calc(100% + 6px); right: 0; min-width: 200px; background: var(--card);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg, var(--shadow));
    z-index: 30; display: none; overflow: hidden;
}
.row-menu.open { display: block; }
.row-menu-link {
    display: flex; align-items: center; gap: 9px; padding: 9px 14px; font-size: 13.5px; color: var(--fg);
    cursor: pointer; white-space: nowrap;
}
.row-menu-link:hover { background: var(--card-hover); }
.row-menu-link.danger { color: var(--danger); }
.row-menu-link.success { color: var(--success, #16a34a); }
.row-menu-link.disabled { color: var(--muted); cursor: not-allowed; opacity: 0.6; pointer-events: none; }
.row-menu-sep { border-top: 1px solid var(--border); margin: 4px 0; }

/* Advanced filters panel */
.filters-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.filters-grid label { display: block; font-size: 12.5px; margin-bottom: 4px; color: var(--muted); }
.filters-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }

/* Settings groups */
.settings-row {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
    padding: 16px 0; border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-row-label { max-width: 320px; flex-shrink: 0; }
.settings-row-label strong { display: block; font-size: 13.5px; font-weight: 600; }
.settings-row-label p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.settings-row-control { flex: 1; max-width: 360px; }
.settings-row-control .input, .settings-row-control select, .settings-row-control textarea { margin-bottom: 0; }
.settings-radio-group { display: flex; flex-direction: column; gap: 6px; }
.settings-radio-group label { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--fg); margin: 0; font-size: 13.5px; }
.settings-toggle { display: flex; align-items: center; gap: 8px; }

/* API docs viewer */
.docs-layout { display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .docs-layout { grid-template-columns: 1fr; } }
.docs-sidebar { max-height: 80vh; overflow-y: auto; padding: 8px; }
.docs-endpoint-item {
    display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 7px; cursor: pointer;
    font-size: 12.5px;
}
.docs-endpoint-item:hover { background: var(--card-hover); }
.docs-endpoint-item.active { background: var(--primary-soft); }
.docs-endpoint-item .docs-path { color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docs-group-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 12px 10px 4px; }
.method-badge {
    display: inline-flex; align-items: center; justify-content: center; min-width: 46px; padding: 2px 6px;
    border-radius: 5px; font-size: 10.5px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.method-badge.get { background: #0ea5e9; }
.method-badge.post { background: #16a34a; }
.method-badge.put { background: #b45309; }
.method-badge.patch { background: #7c3aed; }
.method-badge.delete { background: #dc2626; }
.docs-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.docs-tab { padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.docs-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.docs-code-pane { display: none; }
.docs-code-pane.active { display: block; }
.docs-code-pane pre {
    background: var(--sidebar-bg); color: #e6e8ee; padding: 14px 16px; border-radius: 8px; overflow-x: auto;
    font-size: 12.5px; line-height: 1.6; margin: 0;
}

/* Modal */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(15, 18, 25, 0.5); z-index: 100;
    display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto;
}
.modal-box {
    background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-lg, var(--shadow));
    width: 100%; max-width: 560px; margin-bottom: 5vh;
}
.modal-box.modal-lg { max-width: 860px; }
.modal-header {
    display: flex; align-items: center; justify-content: space-between; padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; font-size: 16px; }
.modal-close-btn {
    border: none; background: transparent; cursor: pointer; color: var(--muted); font-size: 20px;
    line-height: 1; padding: 2px 6px; border-radius: 6px;
}
.modal-close-btn:hover { background: var(--card-hover); color: var(--fg); }
.modal-body { padding: 20px; max-height: 74vh; overflow-y: auto; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

.app-content { padding: 24px 28px; max-width: 1200px; }
.app-content .container { max-width: none; margin: 0; padding: 0; }

@media (max-width: 860px) {
    .sidebar { display: none; }
    .app-content { padding: 16px; }
}

/* Cards & grids */
.card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px 20px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.card > *:first-child { margin-top: 0; }
.card > *:last-child { margin-bottom: 0; }

.card-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin: -18px -20px 16px; padding: 14px 20px; border-bottom: 1px solid var(--border);
}
.card-header h3 { margin: 0; font-size: 14px; font-weight: 700; }
.card-header .muted { font-size: 12.5px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 14px; }

/* Compact multi-column form layout (e.g. numeric fields on one row) */
.form-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 14px; align-items: start;
}
.form-grid > div { display: flex; flex-direction: column; }

/* Empty / placeholder states */
.empty-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 40px 20px; color: var(--muted);
}
.empty-state svg { opacity: 0.35; margin-bottom: 10px; }
.empty-state-title { font-weight: 600; color: var(--fg); margin-bottom: 2px; font-size: 14px; }
.empty-state-hint { font-size: 13px; }

/* Field help tooltips ("?" icon next to a label) */
.field-hint {
    display: inline-flex; align-items: center; justify-content: center;
    width: 15px; height: 15px; border-radius: 50%; background: var(--border); color: var(--muted);
    font-size: 10.5px; font-weight: 700; line-height: 1; cursor: help; position: relative;
    flex-shrink: 0; vertical-align: middle; margin-left: 2px;
}
.field-hint:hover, .field-hint:focus { background: var(--primary); color: #fff; outline: none; }
.field-hint:hover::after, .field-hint:focus::after {
    content: attr(data-hint); position: absolute; top: 135%; left: 50%; transform: translateX(-50%);
    background: #1f2937; color: #fff; padding: 7px 10px; border-radius: 6px; font-size: 12px;
    font-weight: 400; white-space: normal; width: 220px; z-index: 80; line-height: 1.4;
    box-shadow: var(--shadow); text-align: left; cursor: auto;
}
.field-hint:hover::before, .field-hint:focus::before {
    content: ''; position: absolute; top: 122%; left: 50%; transform: translateX(-50%);
    border: 5px solid transparent; border-bottom-color: #1f2937; z-index: 80;
}

/* Stat tiles */
.stat-tile {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px 20px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat-tile::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent, var(--primary));
}
.stat-tile-label { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.stat-tile-value { font-size: 30px; font-weight: 700; margin-top: 6px; color: var(--fg); }
a.stat-tile { display: block; color: inherit; text-decoration: none; transition: transform 0.08s ease, box-shadow 0.12s ease; }
a.stat-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.08); }

/* BI dashboard widget layout */
.widget-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 14px; margin-top: 14px; }
.widget-grid .card { margin-bottom: 0; }
.bar-chart { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.bar-chart-bar { flex: 1; background: var(--primary); border-radius: 3px 3px 0 0; min-height: 2px; }
.hbar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.hbar-label { width: 120px; flex-shrink: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { flex: 1; background: var(--border); border-radius: 4px; height: 10px; overflow: hidden; }
.hbar-fill { height: 100%; background: var(--primary); border-radius: 4px; }
.hbar-value { width: 34px; text-align: right; flex-shrink: 0; font-weight: 600; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 15px; border-radius: 7px; border: none;
    background: var(--primary); color: #fff; cursor: pointer; font-weight: 600; font-size: 13.5px;
    transition: background 0.12s ease, transform 0.08s ease; line-height: 1.3;
}
.btn:hover { background: var(--primary-hover); }
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { filter: brightness(1.1); }
.btn.success { background: var(--success); }
.btn.success:hover { filter: brightness(1.1); }
.btn.secondary { background: var(--card); color: var(--fg); border: 1px solid var(--border); }
.btn.secondary:hover { background: var(--card-hover); border-color: var(--muted); }

/* Forms */
label { display: block; font-size: 12.5px; font-weight: 600; margin: 12px 0 5px; color: var(--muted); }
label:first-child { margin-top: 0; }
.input, textarea, select, input[type="file"] {
    width: 100%; padding: 8px 11px; border-radius: 7px; border: 1px solid var(--border);
    background: var(--bg); color: var(--fg); margin-bottom: 2px; font-size: 13.5px; font-family: inherit;
    transition: border-color 0.1s ease, box-shadow 0.1s ease;
}
.input:focus, textarea:focus, select:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.7; }

/* Scrollable table wrapper (long lists inside a fixed-height card) */
.scroll-box { max-height: 360px; overflow-y: auto; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab-btn {
    border: none; background: transparent; padding: 10px 14px; font-size: 13px; font-weight: 600;
    color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; font-family: inherit;
}
.tab-btn:hover { color: var(--fg); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Listing wizard */
.wizard-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.wizard-header h2 { margin: 0; }
.wizard-autosave { font-size: 12px; color: var(--muted); }
.wizard-stepper { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.wizard-step {
    display: flex; align-items: center; gap: 8px; padding: 10px 16px; border: none; background: transparent;
    cursor: pointer; white-space: nowrap; font-family: inherit; border-bottom: 2px solid transparent; color: var(--muted);
}
.wizard-step:disabled { cursor: not-allowed; opacity: 0.5; }
.wizard-step.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.wizard-step-num {
    width: 20px; height: 20px; border-radius: 50%; background: var(--card-hover); color: var(--muted);
    display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.wizard-step.complete .wizard-step-num { background: var(--success, #16a34a); color: #fff; }
.wizard-step.active .wizard-step-num { background: var(--primary); color: #fff; }
.wizard-progress-text { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.wizard-footer {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 24px;
    padding-top: 16px; border-top: 1px solid var(--border); flex-wrap: wrap;
}
.wizard-footer-right { display: flex; gap: 8px; margin-left: auto; }

.wizard-md-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 780px) { .wizard-md-grid { grid-template-columns: 1fr; } }
.wizard-md-preview { border: 1px solid var(--border); border-radius: 7px; padding: 10px 12px; min-height: 120px; background: var(--bg); font-size: 13.5px; }
.wizard-md-preview-label { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }

.dynamic-list-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.dynamic-list-row .input { margin-bottom: 0; }
.dynamic-list-remove { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 16px; padding: 4px 8px; border-radius: 6px; flex-shrink: 0; }
.dynamic-list-remove:hover { background: var(--card-hover); color: var(--fg); }

.dropzone {
    border: 2px dashed var(--border); border-radius: var(--radius); padding: 24px; text-align: center;
    color: var(--muted); cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: var(--primary-soft); }
.dropzone input[type=file] { display: none; }

.screenshot-item { position: relative; cursor: grab; }
.screenshot-item.dragging { opacity: 0.4; }
.screenshot-item img { width: 100%; border-radius: 6px; display: block; }

/* Markdown editor toolbar */
.markdown-toolbar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.markdown-toolbar { display: flex; gap: 2px; border: 1px solid var(--border); border-radius: 7px; padding: 2px; background: var(--bg); }
.markdown-toolbar-btn {
    border: none; background: transparent; cursor: pointer; color: var(--fg); font-size: 12.5px; font-weight: 600;
    padding: 5px 9px; border-radius: 5px; min-width: 28px; font-family: inherit;
}
.markdown-toolbar-btn:hover { background: var(--card-hover); }

/* Badges */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
    background: var(--border); color: var(--muted);
}
.badge.approved { background: var(--success-soft); color: var(--success); }
.badge.pending { background: var(--warning-soft); color: var(--warning); }
.badge.rejected { background: var(--danger-soft); color: var(--danger); }
.badge.draft, .badge.archived, .badge.hidden { background: var(--border); color: var(--muted); }
.badge.spam { background: var(--danger-soft); color: var(--danger); }

.error-text { color: var(--danger); font-size: 13px; min-height: 1em; }
.muted { color: var(--muted); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; }
tbody tr:hover { background: var(--card-hover); }
tr:last-child td { border-bottom: none; }

/* A card wrapping a header + table with no card padding of its own —
   the table cells carry the usual inset instead so content isn't flush
   to the card edge. */
.card-flush { padding: 0; }
.card-flush .card-header { margin: 0; padding: 16px 20px; }
.card-flush table th:first-child,
.card-flush table td:first-child { padding-left: 20px; }
.card-flush table th:last-child,
.card-flush table td:last-child { padding-right: 20px; }
