:root {
    --red: #e30613;
    --red-dark: #b5000b;
    --black: #0b0b0c;
    --black-soft: #18181b;
    --white: #fff;
    --bg: #f4f4f2;
    --panel: #fff;
    --text: #171719;
    --muted: #727278;
    --line: #dfdfe1;
    --success: #177245;
    --danger: #b4232d;
    --warning: #9b6800;
    --blue: #315cad;
    --sidebar: 248px;
    --radius: 18px;
    --shadow: 0 18px 55px rgba(0, 0, 0, .09);
    --focus: 0 0 0 4px rgba(227, 6, 19, .15);
}

* { box-sizing: border-box; }
html { background: var(--black); }
body { margin: 0; min-width: 320px; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }

.admin-shell { min-height: 100vh; }
.admin-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; display: flex; flex-direction: column; width: var(--sidebar); padding: 24px 16px 18px; color: var(--white); background: var(--black); }
.sidebar-brand { display: flex; align-items: baseline; gap: 12px; min-height: 58px; padding: 3px 9px 22px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-brand a { color: var(--white); font-size: 28px; font-weight: 950; letter-spacing: -.065em; line-height: 1; text-decoration: none; }
.sidebar-brand a span { color: var(--red); }
.sidebar-brand small { color: rgba(255,255,255,.45); font-size: 10px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.sidebar-nav { display: grid; gap: 4px; padding-top: 20px; }
.sidebar-nav a { display: flex; align-items: center; justify-content: space-between; min-height: 43px; padding: 10px 12px; border-radius: 10px; color: rgba(255,255,255,.62); font-size: 13px; font-weight: 720; text-decoration: none; transition: .17s ease; }
.sidebar-nav a:hover, .sidebar-nav a:focus-visible { color: var(--white); background: rgba(255,255,255,.07); outline: none; }
.sidebar-nav a.active { color: var(--white); background: var(--red); }
.sidebar-nav b { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; color: var(--black); background: var(--white); font-size: 10px; }
.sidebar-bottom { display: grid; gap: 5px; margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-bottom a { padding: 8px 10px; color: rgba(255,255,255,.56); font-size: 12px; font-weight: 680; text-decoration: none; }
.sidebar-bottom a:hover { color: var(--white); }
.sidebar-backdrop { display: none; }

.admin-main { min-height: 100vh; margin-left: var(--sidebar); }
.admin-topbar { position: sticky; top: 0; z-index: 35; display: flex; align-items: center; justify-content: space-between; min-height: 78px; padding: 12px 32px; border-bottom: 1px solid rgba(0,0,0,.07); background: rgba(255,255,255,.92); backdrop-filter: blur(18px); }
.admin-topbar > div:first-of-type p { margin: 0; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.admin-topbar > div:first-of-type strong { display: block; margin-top: 4px; font-size: 17px; letter-spacing: -.02em; }
.admin-user { display: flex; align-items: center; gap: 10px; }
.admin-user > span { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 50%; color: var(--white); background: var(--black); font-weight: 900; text-transform: uppercase; }
.admin-user div strong, .admin-user div small { display: block; }
.admin-user div strong { font-size: 12px; }
.admin-user div small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.menu-button { display: none; width: 42px; height: 42px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.menu-button span { display: block; height: 2px; margin: 4px 0; background: var(--black); }

.admin-content { width: min(1480px, 100%); margin-inline: auto; padding: 30px 32px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-head h1 { margin: 0; font-size: clamp(34px, 4vw, 56px); font-weight: 900; letter-spacing: -.055em; line-height: .95; }
.page-head p { max-width: 760px; margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.admin-eyebrow { margin: 0 0 9px !important; color: var(--red) !important; font-size: 10px !important; font-weight: 900 !important; letter-spacing: .15em !important; text-transform: uppercase !important; }
.page-actions { display: flex; flex-wrap: wrap; gap: 9px; }

.admin-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 14px; border: 1px solid transparent; border-radius: 10px; font-size: 12px; font-weight: 830; line-height: 1; text-decoration: none; cursor: pointer; transition: .17s ease; }
.admin-button:hover:not(:disabled) { transform: translateY(-1px); }
.admin-button:focus-visible { outline: none; box-shadow: var(--focus); }
.admin-button:disabled { opacity: .55; cursor: not-allowed; }
.admin-button-dark { color: var(--white); background: var(--black); }
.admin-button-red { color: var(--white); background: var(--red); }
.admin-button-red:hover { background: var(--red-dark); }
.admin-button-ghost { border-color: var(--line); color: var(--text); background: var(--white); }
.admin-button-danger { color: var(--danger); background: #fff0f1; }
.admin-button-small { min-height: 34px; padding: 8px 10px; font-size: 11px; }

.flash-stack { display: grid; gap: 9px; margin-bottom: 22px; }
.flash { padding: 13px 15px; border: 1px solid; border-radius: 11px; font-size: 13px; font-weight: 720; line-height: 1.45; }
.flash-success { color: #155d3a; border-color: #a4d6bc; background: #effaf4; }
.flash-error { color: #7a2028; border-color: #efb6bb; background: #fff0f1; }
.flash-warning { color: #664900; border-color: #e4ca85; background: #fff8e4; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { min-height: 150px; padding: 21px; border: 1px solid rgba(0,0,0,.06); border-radius: var(--radius); background: var(--panel); box-shadow: 0 10px 28px rgba(0,0,0,.045); }
.stat-card-red { color: var(--white); background: var(--red); }
.stat-card-black { color: var(--white); background: var(--black); }
.stat-label { display: block; color: var(--muted); font-size: 11px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.stat-card-red .stat-label, .stat-card-black .stat-label { color: rgba(255,255,255,.58); }
.stat-value { display: block; margin-top: 20px; font-size: 44px; font-weight: 920; letter-spacing: -.06em; line-height: 1; }
.stat-meta { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; }
.stat-card-red .stat-meta, .stat-card-black .stat-meta { color: rgba(255,255,255,.58); }

.admin-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr); gap: 20px; }
.panel { overflow: hidden; border: 1px solid rgba(0,0,0,.07); border-radius: var(--radius); background: var(--panel); box-shadow: 0 10px 32px rgba(0,0,0,.045); }
.panel + .panel { margin-top: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 64px; padding: 15px 19px; border-bottom: 1px solid var(--line); }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 15px; letter-spacing: -.015em; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.panel-body { padding: 20px; }
.panel-body-flush { padding: 0; }

.data-table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 13px 15px; border-bottom: 1px solid #ececee; text-align: left; vertical-align: middle; }
.data-table th { color: var(--muted); background: #fafaf9; font-size: 10px; font-weight: 880; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.data-table td { font-size: 12px; line-height: 1.45; }
.data-table tbody tr:hover { background: #fbfbfa; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.table-person strong, .table-person span { display: block; }
.table-person strong { font-size: 13px; }
.table-person span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.table-link { color: var(--red); font-weight: 820; text-decoration: none; }
.table-link:hover { text-decoration: underline; }
.table-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.status-badge { display: inline-flex; align-items: center; min-height: 25px; padding: 5px 8px; border-radius: 999px; font-size: 9px; font-weight: 880; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.status-new { color: #7b1d25; background: #ffecef; }
.status-reviewing { color: #174f8c; background: #eaf3ff; }
.status-interesting { color: #165c38; background: #e9f8ef; }
.status-contacted { color: #674400; background: #fff4d7; }
.status-on_hold { color: #5a4c7c; background: #f1ecff; }
.status-archived { color: #55555b; background: #eeeef0; }
.status-rejected { color: #6c252b; background: #f4e7e8; }
.rating { color: #d18b00; font-size: 14px; letter-spacing: .02em; white-space: nowrap; }

.filter-bar { display: grid; grid-template-columns: minmax(210px, 1.5fr) repeat(3, minmax(140px, .65fr)) auto; gap: 10px; margin-bottom: 18px; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: var(--white); }
.admin-input, .admin-select, .admin-textarea { width: 100%; border: 1px solid #cfcfd2; border-radius: 10px; color: var(--text); background: var(--white); outline: none; }
.admin-input, .admin-select { min-height: 42px; padding: 0 12px; }
.admin-textarea { min-height: 120px; padding: 12px; line-height: 1.55; resize: vertical; }
.admin-input:focus, .admin-select:focus, .admin-textarea:focus { border-color: var(--red); box-shadow: var(--focus); }

.pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 22px; }
.pagination a, .pagination span { display: grid; place-items: center; min-width: 37px; height: 37px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); font-size: 11px; font-weight: 750; text-decoration: none; }
.pagination span.active { color: var(--white); border-color: var(--red); background: var(--red); }

.empty-admin { padding: 45px 25px; color: var(--muted); text-align: center; }
.empty-admin strong { display: block; color: var(--text); font-size: 18px; }
.empty-admin span { display: block; max-width: 460px; margin: 8px auto 0; font-size: 13px; line-height: 1.55; }

.application-hero { display: grid; grid-template-columns: 1fr auto; gap: 24px; margin-bottom: 20px; padding: 25px; border-radius: var(--radius); color: var(--white); background: var(--black); }
.application-hero h1 { margin: 7px 0 0; font-size: clamp(32px, 4vw, 50px); letter-spacing: -.055em; line-height: .95; }
.application-hero p { margin: 12px 0 0; color: rgba(255,255,255,.55); font-size: 12px; }
.application-reference { color: var(--red); font-size: 11px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.application-meta { display: grid; grid-template-columns: repeat(2, minmax(160px, 1fr)); gap: 9px; align-content: start; }
.meta-chip { min-width: 160px; padding: 11px 13px; border: 1px solid rgba(255,255,255,.14); border-radius: 11px; background: rgba(255,255,255,.06); }
.meta-chip span, .meta-chip strong { display: block; }
.meta-chip span { color: rgba(255,255,255,.48); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.meta-chip strong { margin-top: 5px; font-size: 12px; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .72fr); gap: 20px; align-items: start; }
.answer-step { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--white); }
.answer-step + .answer-step { margin-top: 13px; }
.answer-step-head { padding: 13px 16px; color: var(--white); background: var(--black); }
.answer-step-head strong { font-size: 13px; }
.answer-list { margin: 0; }
.answer-row { display: grid; grid-template-columns: minmax(180px, .75fr) minmax(0, 1.4fr); gap: 20px; padding: 15px 16px; border-top: 1px solid #eeeeef; }
.answer-row:first-child { border-top: 0; }
.answer-row dt { color: var(--muted); font-size: 11px; font-weight: 760; line-height: 1.45; }
.answer-row dd { margin: 0; overflow-wrap: anywhere; font-size: 12px; line-height: 1.62; white-space: pre-wrap; }
.answer-correct { display: inline-flex; margin-top: 6px; padding: 4px 7px; border-radius: 999px; color: #155c38; background: #e8f7ee; font-size: 9px; font-weight: 850; text-transform: uppercase; }
.answer-wrong { color: #7b1e27; background: #ffedef; }

.side-stack { display: grid; gap: 15px; }
.side-card { padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--white); }
.side-card h3 { margin: 0 0 14px; font-size: 14px; }
.side-card label { display: block; margin-top: 12px; color: var(--muted); font-size: 11px; font-weight: 760; }
.side-card label:first-of-type { margin-top: 0; }
.side-card label > input, .side-card label > select, .side-card label > textarea { margin-top: 6px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.note { padding: 11px 0; border-top: 1px solid var(--line); }
.note:first-child { padding-top: 0; border-top: 0; }
.note p { margin: 0; font-size: 12px; line-height: 1.55; white-space: pre-wrap; }
.note small { display: block; margin-top: 6px; color: var(--muted); font-size: 9px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { padding: 5px 8px; border-radius: 999px; color: #4c4c51; background: #eeeef0; font-size: 9px; font-weight: 750; }

.file-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.file-card { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.file-preview { display: grid; place-items: center; aspect-ratio: 16 / 10; overflow: hidden; color: var(--muted); background: #eeeeef; font-size: 11px; }
.file-preview img { width: 100%; height: 100%; object-fit: cover; }
.file-info { padding: 10px; }
.file-info strong { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.file-info span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.file-info a { display: inline-block; margin-top: 8px; color: var(--red); font-size: 10px; font-weight: 820; text-decoration: none; }

.question-step { overflow: hidden; margin-bottom: 15px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.question-step-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; color: var(--white); background: var(--black); }
.question-step-title strong, .question-step-title span { display: block; }
.question-step-title strong { font-size: 15px; }
.question-step-title span { margin-top: 4px; color: rgba(255,255,255,.5); font-size: 10px; }
.question-list { margin: 0; padding: 0; list-style: none; }
.question-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 13px 17px; border-top: 1px solid #ececee; }
.question-row:first-child { border-top: 0; }
.question-position { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--muted); background: var(--bg); font-size: 10px; font-weight: 850; }
.question-copy strong, .question-copy span { display: block; }
.question-copy strong { font-size: 12px; line-height: 1.35; }
.question-copy span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.question-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.type-badge { display: inline-flex; padding: 5px 7px; border-radius: 7px; color: #4e4e54; background: #eeeef0; font-size: 8px; font-weight: 850; text-transform: uppercase; }
.type-badge.required { color: #7b1c24; background: #ffecef; }
.type-badge.inactive { color: #666; background: #ddd; }

.admin-form { display: grid; gap: 20px; }
.form-section { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.form-section h2 { margin: 0 0 18px; font-size: 18px; letter-spacing: -.025em; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.form-field { grid-column: 1 / -1; }
.form-field.half { grid-column: span 6; }
.form-field.third { grid-column: span 4; }
.form-field.quarter { grid-column: span 3; }
.form-field label { display: block; margin-bottom: 7px; color: #414146; font-size: 11px; font-weight: 800; }
.form-field .help { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.form-field .error { margin: 6px 0 0; color: var(--danger); font-size: 10px; font-weight: 750; }
.checkbox-line { display: flex; align-items: flex-start; gap: 10px; min-height: 42px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fafaf9; }
.checkbox-line input { width: 17px; height: 17px; margin: 0; accent-color: var(--red); }
.checkbox-line span { font-size: 11px; line-height: 1.45; }
.char-output { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; text-align: right; }
.code-field { min-height: 220px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; tab-size: 2; }
.form-footer { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; padding: 17px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }

.step-admin-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 15px 17px; border-top: 1px solid var(--line); }
.step-admin-row:first-child { border-top: 0; }
.step-admin-position { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 10px; color: var(--white); background: var(--black); font-weight: 900; }
.step-admin-copy strong, .step-admin-copy span { display: block; }
.step-admin-copy strong { font-size: 13px; }
.step-admin-copy span { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }

.settings-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .7fr); gap: 20px; }
.info-card { padding: 18px; border: 1px solid #e3ca87; border-radius: 14px; color: #5d4a16; background: #fff8e4; font-size: 11px; line-height: 1.6; }
.info-card strong { display: block; margin-bottom: 5px; color: #2f260e; font-size: 12px; }

/* Login */
.login-body { min-height: 100vh; color: var(--text); background: var(--black); }
.login-shell { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr); min-height: 100vh; }
.login-brand-panel { position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: clamp(30px, 5vw, 70px); color: var(--white); background: radial-gradient(circle at 75% 30%, rgba(227,6,19,.26), transparent 25%), linear-gradient(145deg, #080809, #17171a); }
.login-brand-panel::after { position: absolute; right: -170px; bottom: -210px; width: 560px; height: 560px; border: 70px solid var(--red); border-radius: 50%; content: ""; opacity: .8; }
.login-wordmark { position: relative; z-index: 2; color: var(--white); font-size: 35px; font-weight: 950; letter-spacing: -.065em; text-decoration: none; }
.login-wordmark span { color: var(--red); }
.login-brand-panel > div { position: relative; z-index: 2; max-width: 650px; }
.login-brand-panel p { margin: 0; color: var(--red); font-size: 11px; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
.login-brand-panel h1 { margin: 16px 0 22px; font-size: clamp(48px, 7vw, 92px); font-weight: 900; letter-spacing: -.07em; line-height: .88; }
.login-brand-panel > div > span { display: block; max-width: 560px; color: rgba(255,255,255,.58); font-size: 15px; line-height: 1.6; }
.login-form-panel { display: grid; place-items: center; padding: 30px; background: var(--white); }
.login-form { width: min(420px, 100%); }
.login-form h2 { margin: 0; font-size: 48px; font-weight: 900; letter-spacing: -.06em; }
.login-form > p:not(.admin-eyebrow) { margin: 13px 0 29px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.login-form label { display: block; margin-top: 15px; color: #414146; font-size: 11px; font-weight: 800; }
.login-form input { width: 100%; min-height: 49px; margin-top: 7px; padding: 0 13px; border: 1px solid #cccdd1; border-radius: 10px; outline: none; }
.login-form input:focus { border-color: var(--red); box-shadow: var(--focus); }
.login-form .admin-button { width: 100%; min-height: 49px; margin-top: 20px; }
.login-error { margin: 0 0 18px; padding: 12px 14px; border: 1px solid #efb4b8; border-radius: 10px; color: #7b2028; background: #fff0f1; font-size: 11px; font-weight: 750; }
.login-back { display: block; margin-top: 18px; color: var(--muted); font-size: 11px; font-weight: 700; text-align: center; text-decoration: none; }

@media (max-width: 1160px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-grid, .detail-grid, .settings-grid { grid-template-columns: 1fr; }
    .side-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-bar > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
    :root { --sidebar: 270px; }
    .admin-sidebar { transform: translateX(-105%); transition: transform .22s ease; box-shadow: 20px 0 60px rgba(0,0,0,.26); }
    .menu-open .admin-sidebar { transform: translateX(0); }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 45; display: block; pointer-events: none; opacity: 0; background: rgba(0,0,0,.5); transition: opacity .22s ease; }
    .menu-open .sidebar-backdrop { pointer-events: auto; opacity: 1; }
    .admin-main { margin-left: 0; }
    .menu-button { display: block; }
    .admin-topbar { padding-inline: 18px; }
    .admin-topbar > div:first-of-type { margin-right: auto; }
    .admin-content { padding: 22px 18px 70px; }
    .application-hero { grid-template-columns: 1fr; }
    .application-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .login-shell { grid-template-columns: 1fr; }
    .login-brand-panel { min-height: 44vh; }
    .login-brand-panel h1 { max-width: 700px; font-size: clamp(47px, 11vw, 74px); }
    .login-form-panel { min-height: 56vh; padding: 42px 24px; }
}

@media (max-width: 650px) {
    .admin-user div { display: none; }
    .page-head { align-items: flex-start; flex-direction: column; }
    .page-actions { width: 100%; }
    .page-actions .admin-button { flex: 1; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { min-height: 125px; padding: 16px; }
    .stat-value { margin-top: 16px; font-size: 36px; }
    .filter-bar { grid-template-columns: 1fr; }
    .filter-bar > :first-child { grid-column: auto; }
    .side-stack { grid-template-columns: 1fr; }
    .answer-row { grid-template-columns: 1fr; gap: 6px; }
    .file-grid { grid-template-columns: 1fr; }
    .question-row { grid-template-columns: 32px minmax(0, 1fr); }
    .question-actions { grid-column: 1 / -1; padding-left: 44px; }
    .form-field.half, .form-field.third, .form-field.quarter { grid-column: 1 / -1; }
    .form-section { padding: 17px; }
    .step-admin-row { grid-template-columns: 38px minmax(0, 1fr); }
    .step-admin-row .question-actions { grid-column: 1 / -1; padding-left: 52px; }
    .application-meta { grid-template-columns: 1fr; }
    .meta-chip { min-width: 0; }
    .login-brand-panel { min-height: 38vh; padding: 28px 22px; }
    .login-brand-panel > div > span { display: none; }
    .login-form h2 { font-size: 42px; }
}

@media (max-width: 420px) {
    .admin-topbar { min-height: 68px; }
    .admin-topbar > div:first-of-type strong { font-size: 14px; }
    .stats-grid { grid-template-columns: 1fr; }
    .admin-button { font-size: 11px; }
}

/* Componenti aggiuntivi del pannello */
.inline-form { display: inline-flex; margin: 0; }
.inline-form input[type="hidden"] { display: none; }
.application-nav { justify-content: flex-start; margin-bottom: 14px; }
.application-role-list { margin-top: 17px; }
.application-role-list .tag { color: rgba(255,255,255,.82); border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.08); }

.metric-list { display: grid; gap: 16px; }
.metric-row { display: grid; grid-template-columns: minmax(180px, .75fr) minmax(180px, 1fr); align-items: center; gap: 18px; }
.metric-row > div strong, .metric-row > div span { display: block; }
.metric-row > div strong { font-size: 12px; }
.metric-row > div span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.metric-progress { width: 100%; height: 9px; border: 0; border-radius: 999px; overflow: hidden; background: #e8e8ea; appearance: none; }
.metric-progress::-webkit-progress-bar { border-radius: 999px; background: #e8e8ea; }
.metric-progress::-webkit-progress-value { border-radius: 999px; background: var(--red); }
.metric-progress::-moz-progress-bar { border-radius: 999px; background: var(--red); }

.split-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.split-metrics > div { padding: 15px; border-radius: 12px; background: #f4f4f2; }
.split-metrics span, .split-metrics strong { display: block; }
.split-metrics span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.split-metrics strong { margin-top: 8px; font-size: 28px; letter-spacing: -.05em; }
.status-summary { display: grid; gap: 7px; }
.status-summary a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.status-summary a:last-child { border-bottom: 0; }
.status-summary a > strong { font-size: 16px; }
.availability-indicator { display: flex; align-items: center; gap: 9px; }
.availability-indicator > span { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 5px rgba(180,35,45,.09); }
.availability-indicator.is-open > span { background: var(--success); box-shadow: 0 0 0 5px rgba(23,114,69,.1); }
.availability-indicator strong { font-size: 12px; }
.activity-list { display: grid; }
.activity-item { padding: 10px 0; border-top: 1px solid var(--line); }
.activity-item:first-child { padding-top: 0; border-top: 0; }
.activity-item strong, .activity-item span { display: block; }
.activity-item strong { font-size: 11px; }
.activity-item span { margin-top: 4px; color: var(--muted); font-size: 9px; }

.structured-list { display: grid; gap: 8px; }
.structured-block { padding: 10px 12px; border-left: 3px solid var(--red); border-radius: 0 9px 9px 0; background: #f7f7f6; }
.structured-block strong, .structured-block span { display: block; }
.structured-block strong { font-size: 10px; }
.structured-block span { margin-top: 5px; color: #424247; font-size: 11px; line-height: 1.55; white-space: pre-wrap; }
.json-answer { max-width: 100%; margin: 0; overflow: auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; white-space: pre-wrap; }
.contact-list { display: grid; gap: 7px; }
.contact-list a { display: block; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; }
.contact-list a:hover { border-color: var(--red); }
.contact-list span, .contact-list strong { display: block; overflow-wrap: anywhere; }
.contact-list span { color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.contact-list strong { margin-top: 4px; font-size: 11px; }
.notes-list { margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--line); }
.side-empty { margin: 14px 0 0; font-size: 10px; }
.technical-list { margin: 0; }
.technical-list > div { display: grid; grid-template-columns: minmax(100px, .8fr) minmax(0, 1fr); gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.technical-list > div:first-child { padding-top: 0; border-top: 0; }
.technical-list dt { color: var(--muted); font-size: 9px; font-weight: 760; }
.technical-list dd { margin: 0; overflow-wrap: anywhere; font-size: 10px; text-align: right; }
.danger-card { border-color: #efc0c4; background: #fff7f7; }
.danger-card p { color: #75565a; font-size: 10px; line-height: 1.55; }

.questionnaire-info { margin-bottom: 18px; }
.question-step.is-inactive, .question-row.is-inactive { opacity: .58; }
.question-row form { flex: 0 0 auto; }
.options-field { min-height: 270px; }
.inline-settings { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fafaf9; }
.inline-settings > label { min-width: 180px; flex: 1; margin: 0; }
.inline-settings > .checkbox-line { align-self: stretch; }
.info-card + .info-card { margin-top: 12px; }
.info-card-neutral { color: #45454a; border-color: var(--line); background: #f8f8f7; }
.info-card-neutral strong { color: var(--text); }
.settings-save { margin-top: 14px; }

.step-editor-row { display: grid; grid-template-columns: 58px minmax(0, 1fr) minmax(210px, .34fr); gap: 14px; padding: 17px; border-top: 1px solid var(--line); }
.step-editor-row:first-child { border-top: 0; }
.step-admin-position { align-self: start; }
.step-admin-position input { width: 100%; height: 100%; padding: 0; border: 0; color: inherit; background: transparent; font-weight: inherit; text-align: center; outline: none; }
.step-editor-fields { display: grid; gap: 9px; }
.compact-textarea { min-height: 76px; }
.step-editor-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; color: var(--muted); font-size: 9px; }
.step-editor-meta code { padding: 4px 6px; border-radius: 6px; background: #ececee; }
.step-editor-controls { display: grid; align-content: start; gap: 9px; }
.add-step-section { margin-top: 20px; }

@media (max-width: 900px) {
    .step-editor-row { grid-template-columns: 48px minmax(0, 1fr); }
    .step-editor-controls { grid-column: 2; grid-template-columns: minmax(160px, 1fr) auto auto; align-items: center; }
}

@media (max-width: 650px) {
    .metric-row { grid-template-columns: 1fr; gap: 7px; }
    .split-metrics { grid-template-columns: 1fr 1fr; }
    .technical-list > div { grid-template-columns: 1fr; gap: 3px; }
    .technical-list dd { text-align: left; }
    .step-editor-row { grid-template-columns: 38px minmax(0, 1fr); padding: 14px; }
    .step-editor-controls { grid-column: 1 / -1; grid-template-columns: 1fr; padding-left: 52px; }
    .inline-settings { align-items: stretch; flex-direction: column; }
    .inline-settings > label { min-width: 0; width: 100%; }
}
