/* MeinSeo – Premium Dark UI
   Optional selbst gehostete Schrift: Inter-*.woff2 in public/assets/fonts/ ablegen (keine Google-Fonts-Einbindung, DSGVO). */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/InterVariable.woff2") format("woff2"); }

:root {
    --bg: #080D1C;
    --bg-2: #0B1224;
    --surface: #111A2E;
    --surface-2: #16213A;
    --border: #1F2B45;
    --border-strong: #2A3958;
    --primary: #0E9AA7;
    --primary-hover: #12B3C1;
    --primary-soft: rgba(14, 154, 167, .14);
    --good: #2DD4BF;
    --warn: #FBBF24;
    --bad: #F87171;
    --orange: #FB923C;
    --text: #F1F5F9;
    --text-2: #94A3B8;
    --text-3: #64748B;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --font: "Inter", "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--primary-hover); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: .98rem; }
p { margin: 0 0 .75rem; }
code { font: 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; color: var(--text); }
small, .small { font-size: .82rem; }
.muted { color: var(--text-2); }
.text-good { color: var(--good); }
.text-warn { color: var(--warn); }
.text-bad { color: var(--bad); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pre { white-space: pre-line; }

.icon { width: 18px; height: 18px; flex: none; }
.icon-lg { width: 32px; height: 32px; color: var(--primary); }
.icon-xl { width: 48px; height: 48px; color: var(--primary); }

/* ---------- App-Shell ---------- */
.app-shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--bg-2); border-right: 1px solid var(--border); padding: 18px 12px; overflow-y: auto; z-index: 40; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.12rem; color: var(--text); padding: 4px 10px 18px; }
.brand:hover { text-decoration: none; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; font-size: .93rem; }
.nav-link:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.nav-link.is-active { background: var(--primary-soft); color: var(--text); box-shadow: inset 2px 0 0 var(--primary); }
.nav-link.is-active .icon { color: var(--primary-hover); }
.nav-soon { margin-left: auto; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); border: 1px solid var(--border); padding: 0 6px; border-radius: 99px; }
.nav-sep { height: 1px; background: var(--border); margin: 10px 8px; }
.nav-admin .icon { color: var(--warn); }
.sidebar-foot { margin-top: auto; padding: 14px 12px 0; color: var(--text-3); font-size: .75rem; }
.sidebar-backdrop { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 28px; background: rgba(8, 13, 28, .85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; }
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); text-decoration: none; }
.dot-count { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; }
.org-switch select { min-width: 200px; max-width: 320px; }

.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 4px 6px; border-radius: 10px; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--surface); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), #1E5BB8); font-weight: 700; font-size: .9rem; }
.user-name { font-weight: 500; font-size: .92rem; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; }
.menu-head { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; display: flex; flex-direction: column; }
.menu-head small { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 8px; color: var(--text); background: none; border: 0; font: inherit; font-size: .92rem; cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--surface-2); text-decoration: none; }

.content { padding: 28px; max-width: 1400px; width: 100%; }

/* ---------- Bausteine ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 0; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.crumbs { color: var(--text-3); font-size: .85rem; margin-bottom: 4px !important; }
.crumbs a { color: var(--text-2); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.card-head-spaced { margin-top: 24px; }
.card-narrow { max-width: 640px; }
.card-danger { border-color: rgba(248, 113, 113, .35); }
.section-title { margin-top: 22px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-audit { display: grid; grid-template-columns: 260px repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-tasks { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.grid-2 > .card, .grid-3 > .card, .grid-audit > .card { margin-bottom: 0; }
.grid-2, .grid-3, .grid-audit { margin-bottom: 20px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.kpi-label { color: var(--text-2); font-size: .82rem; font-weight: 500; }
.kpi-value { font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; }
.kpi-value small { font-size: .95rem; color: var(--text-3); font-weight: 500; margin-left: 2px; }
.kpi-sub { color: var(--text-3); font-size: .78rem; }

.score-good { color: var(--good); }
.score-warn { color: var(--warn); }
.score-bad { color: var(--bad); }
.score-muted { color: var(--text-3); }
.score-pill { display: inline-grid; place-items: center; min-width: 42px; height: 28px; padding: 0 8px; border-radius: 8px; font-weight: 700; font-size: .88rem; background: var(--surface-2); border: 1px solid var(--border); }
.score-pill.score-good { background: rgba(45, 212, 191, .12); border-color: rgba(45, 212, 191, .3); }
.score-pill.score-warn { background: rgba(251, 191, 36, .12); border-color: rgba(251, 191, 36, .3); }
.score-pill.score-bad { background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .3); }
.score-card { display: flex; flex-direction: column; align-items: center; text-align: center; }
.score-ring .score-track { fill: none; stroke: var(--surface-2); stroke-width: 10; }
.score-ring .score-value { fill: none; stroke: currentColor; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.score-ring .score-text { fill: var(--text); font-size: 28px; font-weight: 700; font-family: var(--font); }
.score-ring { margin: 6px 0 10px; }

.sparkline { width: 120px; height: 32px; display: block; }
.spark-lg .sparkline { width: 100%; height: 80px; }

.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 6px 0 2px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--good)); border-radius: 99px; transition: width .4s ease; }
.progress span.is-warn { background: var(--warn); }
.progress span.is-bad { background: var(--bad); }
.progress-lg { height: 10px; margin: 14px 0; }
.progress-card { border-color: rgba(14, 154, 167, .4); }
.progress-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

.usage { margin-bottom: 14px; }
.usage-head { display: flex; justify-content: space-between; font-size: .88rem; color: var(--text-2); }

/* Tabellen */
.table-wrap { overflow-x: auto; margin: 0 -6px; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; color: var(--text-3); font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(255, 255, 255, .015); }
.table tr.is-selected td { background: var(--primary-soft); }
.table-compact td { padding: 8px 10px; }
.num { text-align: right; white-space: nowrap; }
.truncate { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.truncate-lg { max-width: 520px; overflow-wrap: anywhere; }

/* Badges & Status */
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 99px; font-size: .74rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge-critical { background: rgba(248, 113, 113, .16); color: var(--bad); border-color: rgba(248, 113, 113, .35); }
.badge-high { background: rgba(251, 146, 60, .14); color: var(--orange); border-color: rgba(251, 146, 60, .3); }
.badge-medium { background: rgba(251, 191, 36, .13); color: var(--warn); border-color: rgba(251, 191, 36, .3); }
.badge-low { background: rgba(148, 163, 184, .12); color: var(--text-2); border-color: rgba(148, 163, 184, .25); }
.badge-info { background: var(--primary-soft); color: var(--primary-hover); border-color: rgba(14, 154, 167, .35); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-queued { color: var(--text-2); }
.status-running { color: var(--primary-hover); }
.status-running::before { animation: pulse 1.2s infinite; }
.status-completed { color: var(--good); }
.status-failed { color: var(--bad); }
.status-canceled { color: var(--text-3); }
@keyframes pulse { 50% { opacity: .3; } }

.severity-list, .plain-list, .notice-list, .task-list, .project-list, .issue-list { list-style: none; margin: 0; padding: 0; }
.severity-list li { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.severity-list li:last-child { border-bottom: 0; }
.plain-list li { padding: 6px 0; }
.task-list li { padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: baseline; }
.notice-list li { padding: 10px 0 10px 14px; border-bottom: 1px solid var(--border); position: relative; display: flex; flex-direction: column; }
.notice-list li.unread::before { content: ""; position: absolute; left: 0; top: 18px; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.notice-list p { margin: 2px 0; }

.project-row { display: flex; align-items: center; gap: 14px; padding: 12px 8px; border-radius: 10px; color: var(--text); }
.project-row:hover { background: var(--surface-2); text-decoration: none; }
.project-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.project-meta small { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spark { flex: none; }

.issue { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.issue:last-child { border-bottom: 0; }
.issue-main { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.issue-main > div { min-width: 0; }
.issue-main .badge { margin-top: 2px; }
.issue-url { display: block; font-size: .85rem; overflow-wrap: anywhere; margin-top: 2px; }
.issue-details { color: var(--text-2); font-size: .86rem; margin: 6px 0 0; overflow-wrap: anywhere; }
.issue-rec { margin-top: 6px; font-size: .86rem; }
.issue-rec summary { cursor: pointer; color: var(--primary-hover); }
.issue-rec p { color: var(--text-2); margin: 6px 0 0; }

.stat-list { margin: 0; }
.stat-list div { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--border); }
.stat-list div:last-child { border-bottom: 0; }
.stat-list dt { color: var(--text-2); }
.stat-list dd { margin: 0; font-weight: 600; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab { padding: 10px 14px; color: var(--text-2); font-weight: 500; font-size: .9rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.is-active { color: var(--text); border-bottom-color: var(--primary); }

.pagination { display: flex; justify-content: center; align-items: center; gap: 16px; padding-top: 16px; color: var(--text-2); font-size: .88rem; }

.empty { text-align: center; padding: 36px 20px; color: var(--text-2); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty p { max-width: 460px; margin: 0; }
.coming-soon h2 { margin: 6px 0 0; }

.plan-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.plan { margin-bottom: 0; }
.plan-current { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.plan-price { font-size: 1.7rem; font-weight: 700; margin: 4px 0 8px; }
.plan-price small { font-size: .85rem; color: var(--text-3); font-weight: 500; }

/* Alerts */
.alert { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; border: 1px solid; font-size: .92rem; }
.alert-success { background: rgba(45, 212, 191, .1); border-color: rgba(45, 212, 191, .35); color: #A7F3E8; }
.alert-error { background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .35); color: #FECACA; }
.alert-info { background: var(--primary-soft); border-color: rgba(14, 154, 167, .4); color: #BDEFF3; }
.alert-warning { background: rgba(251, 191, 36, .1); border-color: rgba(251, 191, 36, .35); color: #FDE68A; }
.alert-link:hover { text-decoration: none; filter: brightness(1.1); }
.alert-close { background: none; border: 0; color: inherit; cursor: pointer; opacity: .7; padding: 2px; display: grid; }
.alert-close:hover { opacity: 1; }

/* Formulare */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { font-size: .86rem; font-weight: 550; color: var(--text); display: flex; justify-content: space-between; align-items: baseline; }
.label-link { font-weight: 500; font-size: .82rem; }
.optional { color: var(--text-3); font-weight: 400; font-size: .78rem; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=search], select, textarea {
    width: 100%; background: var(--bg-2); color: var(--text); border: 1px solid var(--border-strong); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: .93rem; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
select { padding-right: 32px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input:disabled { opacity: .6; }
.field-error { color: var(--bad); font-size: .82rem; margin: 0; }
.hint { color: var(--text-3); font-size: .82rem; margin: 0; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--text-2); justify-content: flex-start; }
.checkbox input { margin-top: 4px; accent-color: var(--primary); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; }
.inline-form select { width: auto; }
.form-inline-grid { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: end; }
.form-inline-grid:has(> :nth-child(3):last-child) { grid-template-columns: 1fr auto; }
.search-form { display: flex; gap: 10px; margin-bottom: 18px; max-width: 520px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 10px; font: inherit; font-weight: 600; font-size: .9rem; border: 1px solid transparent; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 18px rgba(14, 154, 167, .25); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--primary); }
.btn-danger { background: var(--bad); color: #1B0B0B; }
.btn-danger-ghost { background: transparent; color: var(--bad); border-color: rgba(248, 113, 113, .4); }
.btn-danger-ghost:hover { background: rgba(248, 113, 113, .1); }
.btn-sm { padding: 6px 11px; font-size: .82rem; border-radius: 8px; }
.btn-lg { padding: 13px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }
.link { font-size: .88rem; font-weight: 500; }

/* ---------- Gast-Bereich ---------- */
body.guest { min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
.guest-glow { position: fixed; inset: -20% -10% auto; height: 70vh; background: radial-gradient(ellipse at 30% 20%, rgba(14, 154, 167, .22), transparent 60%), radial-gradient(ellipse at 80% 0%, rgba(45, 212, 191, .12), transparent 55%); pointer-events: none; z-index: 0; }
.guest-header { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; padding: 18px 32px; }
.guest-header .brand { padding: 0; }
.guest-nav { display: flex; align-items: center; gap: 18px; font-weight: 500; }
.guest-nav a:not(.btn) { color: var(--text-2); }
.guest-main { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; padding: 24px 20px 60px; }
.guest-alert { width: 100%; max-width: 440px; }
.guest-footer { position: relative; z-index: 1; display: flex; gap: 18px; justify-content: center; padding: 20px; color: var(--text-3); font-size: .82rem; }
.guest-footer a { color: var(--text-2); }

.auth-card { width: 100%; max-width: 440px; background: rgba(17, 26, 46, .9); border: 1px solid var(--border); border-radius: 18px; padding: 32px; box-shadow: var(--shadow); backdrop-filter: blur(8px); }
.auth-card h1 { font-size: 1.45rem; }
.auth-card > .muted { margin-bottom: 22px; }
.auth-foot { margin: 22px 0 0; text-align: center; color: var(--text-2); font-size: .88rem; line-height: 1.9; }

.hero { max-width: 980px; text-align: center; padding-top: 40px; }
.eyebrow { display: inline-block; padding: 5px 12px; border-radius: 99px; background: var(--primary-soft); color: var(--primary-hover); font-size: .8rem; font-weight: 600; margin-bottom: 18px; border: 1px solid rgba(14, 154, 167, .35); }
.hero h1 { font-size: clamp(2rem, 5vw, 3.3rem); letter-spacing: -.03em; margin-bottom: 18px; }
.accent { background: linear-gradient(90deg, var(--primary-hover), var(--good)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.12rem; color: var(--text-2); max-width: 680px; margin: 0 auto 28px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 56px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; text-align: left; }
.feature { background: rgba(17, 26, 46, .75); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.feature h3 { margin-top: 12px; }
.feature p { color: var(--text-2); font-size: .92rem; margin: 0; }

.error-page { text-align: center; padding: 60px 20px; max-width: 520px; margin: 0 auto; }
.error-code { font-size: 4.5rem; font-weight: 800; letter-spacing: -.04em; background: linear-gradient(90deg, var(--primary-hover), var(--good)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
    .kpi-grid, .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-audit { grid-template-columns: 1fr 1fr; }
    .grid-audit > .score-card { grid-column: span 2; }
}
@media (max-width: 960px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow); }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 35; }
    .menu-btn { display: inline-grid; }
    .topbar { padding: 0 16px; }
    .content { padding: 20px 16px; }
    .grid-2, .grid-3, .grid-tasks { grid-template-columns: 1fr; }
    .feature-grid { grid-template-columns: 1fr; }
    .user-name { display: none; }
    .org-switch select { min-width: 0; max-width: 46vw; }
}
@media (max-width: 600px) {
    .kpi-grid, .plan-grid, .grid-audit { grid-template-columns: 1fr; }
    .grid-audit > .score-card { grid-column: auto; }
    .field-row, .form-inline-grid { grid-template-columns: 1fr; }
    .issue { flex-direction: column; }
    .guest-header { padding: 16px; }
    .guest-nav a:not(.btn) { display: none; }
    .auth-card { padding: 24px 20px; }
    h1 { font-size: 1.35rem; }
    .kpi-value { font-size: 1.6rem; }
}
