/* flyerngehn – admin UI */

:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-2: #f9fafb;
    --border: #e5e7eb;
    --border-strong: #d1d5db;
    --text: #111827;
    --text-2: #4b5563;
    --muted: #6b7280;
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-soft: #eef2ff;
    --accent-text: #4338ca;
    --green: #059669; --green-soft: #ecfdf5;
    --amber: #b45309; --amber-soft: #fffbeb;
    --red: #dc2626;   --red-soft: #fef2f2;
    --blue: #2563eb;  --blue-soft: #eff6ff;
    --violet: #7c3aed; --violet-soft: #f5f3ff;
    --gray-soft: #f3f4f6;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
    --shadow-lg: 0 10px 30px -10px rgba(16, 24, 40, .25);
    --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b0d12;
        --surface: #12151c;
        --surface-2: #171b23;
        --border: #232833;
        --border-strong: #2f3542;
        --text: #e8eaef;
        --text-2: #b4bac6;
        --muted: #8b93a3;
        --accent: #6366f1;
        --accent-hover: #818cf8;
        --accent-soft: rgba(99, 102, 241, .14);
        --accent-text: #a5b4fc;
        --green: #34d399; --green-soft: rgba(16, 185, 129, .12);
        --amber: #fbbf24; --amber-soft: rgba(245, 158, 11, .12);
        --red: #f87171;   --red-soft: rgba(239, 68, 68, .12);
        --blue: #60a5fa;  --blue-soft: rgba(59, 130, 246, .12);
        --violet: #a78bfa; --violet-soft: rgba(139, 92, 246, .14);
        --gray-soft: rgba(148, 163, 184, .12);
        --shadow: 0 1px 2px rgba(0, 0, 0, .3);
        --shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, .6);
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font: 14px/1.5 var(--font);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 650; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h2 { font-size: 15px; font-weight: 600; }
h3 { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
p { margin: 0; }
code { font-family: var(--mono); font-size: .9em; background: var(--gray-soft); padding: 1px 5px; border-radius: 4px; }
[hidden] { display: none !important; }
.icon { flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }

/* ---------- Layout ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 232px; flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    padding: 18px 12px;
    position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--text); padding: 4px 10px 22px; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 30px; height: 30px; border-radius: 9px;
    display: grid; place-items: center; color: #fff;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    box-shadow: 0 4px 12px -4px rgba(99, 102, 241, .6);
}
.brand-lg { justify-content: center; font-size: 22px; padding-bottom: 26px; }
.brand-lg .brand-mark { width: 38px; height: 38px; border-radius: 11px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a, .nav-btn {
    display: flex; align-items: center; gap: 11px;
    padding: 8px 10px; border-radius: var(--radius-sm);
    color: var(--text-2); font-weight: 500;
    background: none; border: 0; font: inherit; font-weight: 500; cursor: pointer; width: 100%; text-align: left;
}
.sidebar nav a:hover, .nav-btn:hover { background: var(--gray-soft); color: var(--text); text-decoration: none; }
.sidebar nav a.active { background: var(--accent-soft); color: var(--accent-text); }
.sidebar-foot { margin-top: auto; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { padding: 32px 40px 64px; max-width: 1320px; width: 100%; display: flex; flex-direction: column; gap: 20px; }

@media (max-width: 900px) {
    .sidebar { position: fixed; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
    .sidebar.open { transform: none; }
    .topbar {
        display: flex; align-items: center; gap: 10px;
        position: sticky; top: 0; z-index: 40;
        padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
    }
    .topbar-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .content { padding: 20px 16px 48px; }
}

/* ---------- Page header ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form { display: contents; }

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    min-width: 0;
}
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card.flush .card-head.padded, .padded { padding: 16px 20px; margin: 0; }
.card.flush .card-head.padded { border-bottom: 1px solid var(--border); }
.card.help { background: var(--surface-2); box-shadow: none; }
.card.help h3 { margin-bottom: 8px; }
.card.help p + p { margin-top: 8px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.narrow { max-width: 560px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.grid-2.wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
@media (max-width: 1000px) { .grid-2, .grid-2.wide-left { grid-template-columns: 1fr; } }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; color: var(--text); box-shadow: var(--shadow);
}
a.stat:hover { text-decoration: none; border-color: var(--border-strong); }
.stat-label { color: var(--muted); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 26px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-sub { color: var(--muted); font-size: 12px; }
.stats-compact { margin: 18px 0 4px; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 0; }
.stats-compact .stat { border: 0; box-shadow: none; padding: 4px 0; background: none; }
.stats-compact .stat-value { font-size: 22px; }

.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.bar { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.bar span { display: block; width: 100%; height: max(var(--h), 2px); background: var(--accent); opacity: .85; border-radius: 3px 3px 1px 1px; }
.bar:hover span { opacity: 1; }
.bars-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 6px; }

.worker-status { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-green { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.dot-amber { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.checklist li.done { opacity: .6; }
.checklist li.done a { text-decoration: line-through; color: var(--muted); }
.check-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; flex-shrink: 0; }
.done .check-dot { background: var(--green); border-color: var(--green); color: #fff; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 36px; padding: 0 14px;
    font: inherit; font-weight: 550; white-space: nowrap;
    color: var(--text); background: var(--surface);
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    cursor: pointer; transition: background .12s, border-color .12s, box-shadow .12s;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--gray-soft); }
.btn-danger-text { color: var(--red); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; pointer-events: none; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-sm); background: none; border: 0; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--gray-soft); color: var(--text); }
.link { font-size: 13px; font-weight: 500; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.field > span { font-weight: 550; font-size: 13px; color: var(--text); }
.field small { font-weight: 400; }
.field-row { display: flex; gap: 14px; flex-wrap: wrap; }
.field-row > .field { min-width: 180px; }
.field-row.three > .field { min-width: 150px; }
.small-field { flex: 0 0 140px; min-width: 120px !important; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=search],
input[type=datetime-local], input[type=file], select, textarea {
    width: 100%; font: inherit; color: var(--text);
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    padding: 8px 11px; min-height: 36px;
    transition: border-color .12s, box-shadow .12s;
}
input[type=file] { padding: 6px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[readonly] { background: var(--surface-2); }
textarea { resize: vertical; line-height: 1.5; }
textarea.code, .mono { font-family: var(--mono); font-size: 12.5px; }
textarea.code { tab-size: 2; white-space: pre; overflow-wrap: normal; overflow-x: auto; }
select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
.input-group { display: flex; gap: 8px; flex-wrap: wrap; }
.input-group input { flex: 1 1 180px; min-width: 0; }
.input-suffix { display: flex; align-items: center; gap: 8px; }
.input-suffix span { color: var(--muted); }
.check-line { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.check-line input { margin: 3px 0 0; accent-color: var(--accent); width: 15px; height: 15px; }
input[type=checkbox] { accent-color: var(--accent); }
.hint { display: flex; align-items: center; gap: 8px; color: var(--text-2); background: var(--surface-2); border: 1px dashed var(--border-strong); padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-check { position: relative; cursor: pointer; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-strong);
    font-weight: 500; font-size: 13px; color: var(--text-2); background: var(--surface);
    transition: all .12s;
}
.chip-check span small { color: var(--muted); font-weight: 400; }
.chip-check input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.chip-check input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- Alerts / badges ---------- */
.alert {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid transparent;
    font-weight: 500;
}
.alert > span { flex: 1; }
.alert.compact { padding: 8px 12px; font-size: 13px; margin-bottom: 10px; }
.alert-success { background: var(--green-soft); color: var(--green); border-color: color-mix(in srgb, var(--green) 25%, transparent); }
.alert-error { background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 25%, transparent); }
.alert-warning { background: var(--amber-soft); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 25%, transparent); }
.alert-info { background: var(--blue-soft); color: var(--blue); border-color: color-mix(in srgb, var(--blue) 25%, transparent); }
.alert a { color: inherit; text-decoration: underline; }
.alert-close { background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; padding: 2px; display: grid; }
.alert-close:hover { opacity: 1; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; letter-spacing: 0; }
.badge-gray { background: var(--gray-soft); color: var(--muted); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-violet { background: var(--violet-soft); color: var(--violet); }
.badge-violet[data-status-badge]::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.tag { display: inline-block; white-space: nowrap; padding: 1px 8px; margin: 1px 2px 1px 0; border-radius: 6px; background: var(--gray-soft); color: var(--text-2); font-size: 12px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.card:not(.flush) .table td:first-child, .card:not(.flush) .table th:first-child { padding-left: 0; }
.card:not(.flush) .table td:last-child { padding-right: 0; }
.table .check { width: 40px; padding-right: 0; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.break { word-break: break-word; }
.strong { font-weight: 600; color: var(--text); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.text-green { color: var(--green); }
.text-red { color: var(--red); }

.progress { height: 6px; background: var(--gray-soft); border-radius: 999px; overflow: hidden; flex: 1; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, #6366f1, #8b5cf6); border-radius: inherit; transition: width .4s ease; }
.progress-lg { height: 10px; }
.progress-inline { display: flex; align-items: center; gap: 10px; justify-content: flex-end; min-width: 160px; }
.progress-inline .progress { max-width: 100px; }

.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--border); }
.meta dt { color: var(--muted); font-size: 12px; }
.meta dd { margin: 2px 0 0; font-weight: 500; }
.meta.vertical { grid-template-columns: 1fr; border: 0; padding: 0; margin: 0; }

/* ---------- Toolbar, filters, pagination ---------- */
.toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.segmented { display: inline-flex; background: var(--gray-soft); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented a { padding: 6px 12px; border-radius: 8px; color: var(--text-2); font-weight: 500; font-size: 13px; }
.segmented a span { color: var(--muted); font-weight: 400; margin-left: 3px; }
.segmented a:hover { text-decoration: none; color: var(--text); }
.segmented a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters select { width: auto; min-width: 140px; }
.search { position: relative; display: flex; align-items: center; }
.search .icon { position: absolute; left: 10px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 32px; width: 240px; }
.bulkbar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 10px 14px; margin-bottom: 12px; border-radius: var(--radius);
    background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.bulkbar select { width: auto; min-height: 30px; padding-top: 4px; padding-bottom: 4px; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 14px; }

/* ---------- Tabs ---------- */
.tabs { display: inline-flex; background: var(--gray-soft); border-radius: 8px; padding: 2px; gap: 2px; }
.tab { background: none; border: 0; font: inherit; font-size: 12.5px; font-weight: 550; color: var(--muted); padding: 4px 10px; border-radius: 6px; cursor: pointer; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---------- Editor ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.editor-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.editor-main > .card { display: flex; flex-direction: column; gap: 14px; }
.editor-main > .card > .card-head { margin-bottom: 0; }
.editor-preview { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 1100px) { .editor { grid-template-columns: 1fr; } .editor-preview { position: static; } }
.placeholders { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ph { font-family: var(--mono); font-size: 11.5px; padding: 3px 8px; border-radius: 6px; border: 1px dashed var(--border-strong); background: var(--surface-2); color: var(--text-2); cursor: pointer; }
.ph:hover { border-color: var(--accent); color: var(--accent-text); }
.savebar {
    position: sticky; bottom: 16px; z-index: 5;
    display: flex; gap: 10px; justify-content: flex-end;
    padding: 12px; border-radius: var(--radius);
    background: color-mix(in srgb, var(--surface) 85%, transparent);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.send-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }

.send-box { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.ph-list { margin: 0 0 10px; display: grid; gap: 6px; }
.ph-list div { display: flex; gap: 10px; align-items: baseline; }
.ph-list dt { min-width: 150px; }
.ph-list dd { margin: 0; color: var(--text-2); font-size: 13px; }

.preview-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.preview-meta { padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.preview-meta .muted { display: inline-block; width: 56px; }
.preview-body { background: #f4f4f7; display: flex; justify-content: center; }
.preview-body iframe { width: 100%; height: 70vh; min-height: 480px; border: 0; background: #fff; display: block; transition: width .25s ease; }
.preview-body iframe.tall { height: 80vh; }
.preview-body.mobile iframe { width: 390px; max-width: 100%; box-shadow: 0 0 0 1px var(--border); }
.preview-text { margin: 0; width: 100%; padding: 20px; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; background: var(--surface); color: var(--text); min-height: 300px; max-height: 70vh; overflow: auto; }

/* ---------- Templates grid ---------- */
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.template-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); color: var(--text); transition: transform .15s, box-shadow .15s; }
.template-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.template-thumb { height: 220px; overflow: hidden; background: #f4f4f7; position: relative; border-bottom: 1px solid var(--border); }
.template-thumb iframe { width: 200%; height: 200%; transform: scale(.5); transform-origin: 0 0; border: 0; pointer-events: none; }
.template-info { padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }

/* ---------- Settings ---------- */
.settings { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 28px; align-items: start; }
.settings-nav { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav a { padding: 7px 12px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; }
.settings-nav a:hover { background: var(--gray-soft); text-decoration: none; color: var(--text); }
.settings-body { display: flex; flex-direction: column; gap: 20px; max-width: 820px; min-width: 0; }
.settings-body section { scroll-margin-top: 20px; }
.settings-body h3 { margin-top: 6px; }
@media (max-width: 900px) { .settings { grid-template-columns: 1fr; } .settings-nav { position: static; flex-direction: row; flex-wrap: wrap; } }
.codeblock { margin: 0; padding: 12px 14px; background: #0f172a; color: #e2e8f0; border-radius: var(--radius-sm); font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; word-break: break-all; position: relative; cursor: copy; }
.codeblock.copied::after { content: "Copied"; position: absolute; top: 8px; right: 10px; font-size: 11px; color: #a5b4fc; font-family: var(--font); }
.endpoint { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--border); }
.endpoint:last-of-type { border-bottom: 0; }
.endpoint code { background: none; padding: 0; font-weight: 600; color: var(--text); }
.method { font-family: var(--mono); font-size: 10.5px; font-weight: 700; padding: 2px 6px; border-radius: 5px; min-width: 56px; text-align: center; }
.method.get { background: var(--blue-soft); color: var(--blue); }
.method.post { background: var(--green-soft); color: var(--green); }
.method.patch { background: var(--amber-soft); color: var(--amber); }
.method.delete { background: var(--red-soft); color: var(--red); }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 56px 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 8px; }
.empty p { color: var(--muted); max-width: 420px; }
.empty .btn { margin-top: 12px; }

/* ---------- Auth ---------- */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), transparent 70%), var(--bg); }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 16px; }

@media (max-width: 640px) {
    .filters, .search { width: 100%; }
    .search { flex: 1; }
    .search input { width: 100%; }
    .page-head .actions { width: 100%; }
}
