/*
 * Workspace UI
 * Copyright (c) 2026 Rene Jedtke. Alle Rechte vorbehalten.
 *
 * Wartungshinweis:
 * Designwerte liegen als CSS-Variablen vor. Komponenten verwenden flache,
 * sprechende Klassen und benötigen kein CSS-Framework.
 */

:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-soft: #f8f9fc;
  --surface-alt: #f8f9fc;
  --surface-strong: #111827;
  --border: #e3e7ef;
  --border-strong: #cbd2df;
  --text: #182033;
  --muted: #697386;
  --primary: #5b5cf0;
  --primary-hover: #4849d8;
  --primary-soft: #eeeeff;
  --success: #14855f;
  --success-soft: #e5f7ef;
  --warning: #a25c08;
  --warning-soft: #fff2d9;
  --danger: #c43d4d;
  --danger-soft: #ffeaed;
  --info: #2563a9;
  --info-soft: #e9f3ff;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.05);
  --shadow-md: 0 14px 40px rgba(30, 41, 59, 0.12);
  --shadow-lg: 0 26px 80px rgba(17, 24, 39, 0.2);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --sidebar-width: 264px;
  --transition: 160ms ease;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100vh; margin: 0; color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.55; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }

h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(1.8rem, 3vw, 2.35rem); line-height: 1.15; letter-spacing: -0.04em; }
h2 { margin-bottom: 8px; font-size: 1.45rem; line-height: 1.25; letter-spacing: -0.025em; }
h3 { margin-bottom: 6px; font-size: 1.02rem; }
p { margin-bottom: 14px; }
.muted { color: var(--muted); }
.eyebrow { margin-bottom: 6px; color: var(--primary); font-size: 0.73rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

:focus-visible { outline: 3px solid rgba(91, 92, 240, 0.35); outline-offset: 2px; }

/* Login */
.login-page { background: #0d1324; color: #fff; }
.login-layout { min-height: calc(100vh - 52px); display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr); align-items: center; gap: clamp(42px, 8vw, 120px); max-width: 1280px; margin: 0 auto; padding: clamp(30px, 6vw, 80px); }
.login-brand { max-width: 680px; }
.login-brand .brand-mark { margin-bottom: 36px; }
.login-brand h1 { max-width: 620px; font-size: clamp(3rem, 6.5vw, 6rem); line-height: 0.95; color: #fff; }
.login-brand > p:not(.eyebrow) { max-width: 600px; color: #aeb8cf; font-size: 1.08rem; }
.login-feature-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.login-feature-grid span { padding: 9px 13px; border: 1px solid rgba(255,255,255,.13); border-radius: 99px; color: #d7dcef; background: rgba(255,255,255,.055); }
.login-card { width: 100%; max-width: 480px; justify-self: end; padding: clamp(28px, 4vw, 46px); border: 1px solid rgba(255,255,255,.09); border-radius: 26px; background: #fff; color: var(--text); box-shadow: 0 30px 100px rgba(0,0,0,.35); }
.login-card form { display: grid; gap: 18px; margin-top: 30px; }
.login-security { margin: 22px 0 0; color: var(--muted); font-size: .82rem; text-align: center; }
.login-footer { height: 52px; color: #7f8aa4; font-size: .8rem; text-align: center; }

/* App shell */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; z-index: 30; height: 100vh; display: flex; flex-direction: column; padding: 22px 16px 16px; color: #e9edfa; background: var(--surface-strong); border-right: 1px solid rgba(255,255,255,.07); }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; color: #fff; text-decoration: none; }
.brand > span:last-child { display: grid; line-height: 1.2; }
.brand small, .user-chip small { color: #8f9ab2; font-size: .72rem; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; color: #fff; font-weight: 900; background: linear-gradient(145deg, #7475ff, #4c4dd8); box-shadow: 0 8px 30px rgba(91,92,240,.35); }
.main-nav { display: grid; gap: 4px; overflow: auto; padding-right: 2px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: 10px; color: #aeb7cb; background: transparent; text-align: left; transition: color var(--transition), background var(--transition); }
.nav-item span { width: 22px; color: #7f8aa2; font-size: 1.12rem; text-align: center; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.is-active { color: #fff; background: rgba(91,92,240,.22); }
.nav-item.is-active span { color: #9fa0ff; }
.nav-divider { height: 1px; margin: 16px 8px 10px; background: rgba(255,255,255,.08); }
.nav-label { margin: 0 12px 5px; color: #69758f; font-size: .68rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.sidebar-footer { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 14px 6px 0; border-top: 1px solid rgba(255,255,255,.08); }
.user-chip { min-width: 0; display: flex; align-items: center; gap: 10px; flex: 1; }
.user-chip > span:last-child { min-width: 0; display: grid; line-height: 1.25; }
.user-chip strong { overflow: hidden; font-size: .86rem; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #fff; font-weight: 800; background: #38435a; }
.workspace { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: 70px; display: flex; align-items: center; gap: 18px; padding: 0 clamp(18px, 3vw, 38px); background: rgba(244,246,251,.88); border-bottom: 1px solid rgba(203,210,223,.75); backdrop-filter: blur(16px); }
.global-search { width: min(620px, 52vw); display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow-sm); }
.global-search input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--text); background: transparent; }
.global-search kbd { padding: 2px 6px; border: 1px solid var(--border); border-radius: 5px; color: var(--muted); background: var(--surface-soft); font-size: .68rem; }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.live-status { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: .76rem; }
.live-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 4px var(--warning-soft); }
.live-status.is-live i { background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.live-status.is-fallback i { background: var(--warning); box-shadow: 0 0 0 4px var(--warning-soft); }
.live-status.is-offline i { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.notification-button { position: relative; }
.notification-count { position: absolute; top: -5px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; display: grid; place-items: center; border: 2px solid var(--bg); border-radius: 99px; color: #fff; background: var(--danger); font-size: .64rem; font-weight: 800; }
.notification-popover { position: fixed; z-index: 80; top: 64px; right: 22px; width: min(420px, calc(100vw - 28px)); overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-lg); }
.popover-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.notification-list { max-height: min(560px, 70vh); overflow: auto; }
.notification-item { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); transition: background var(--transition); }
.notification-item:hover { background: var(--surface-soft); }
.notification-item .dot { width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: transparent; }
.notification-item.is-unread .dot { background: var(--primary); }
.notification-item strong { display: block; margin-bottom: 2px; font-size: .88rem; }
.notification-item p { margin: 0; color: var(--muted); font-size: .8rem; }
.notification-item time { color: #929bae; font-size: .7rem; }
.content { width: 100%; max-width: 1560px; flex: 1; margin: 0 auto; padding: clamp(24px, 4vw, 50px); }
.content-header { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.content-header p:last-child { margin-bottom: 0; }
.page-actions { display: flex; align-items: flex-start; gap: 8px; }
.app-footer { padding: 18px 30px 24px; color: #8c95a8; font-size: .72rem; text-align: center; }

/* Buttons and forms */
.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border: 1px solid transparent; border-radius: 9px; font-weight: 750; transition: transform var(--transition), background var(--transition), border-color var(--transition); }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.button-primary { color: #fff; background: var(--primary); box-shadow: 0 7px 20px rgba(91,92,240,.22); }
.button-primary:hover { background: var(--primary-hover); }
.button-secondary { color: var(--text); border-color: var(--border); background: var(--surface); }
.button-danger { color: #fff; background: var(--danger); }
.button-compact { min-height: 36px; padding: 7px 13px; font-size: .84rem; }
.button-block { width: 100%; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: 10px; color: var(--text); background: var(--surface); }
.sidebar .icon-button { color: #c8d0e2; border-color: rgba(255,255,255,.1); background: rgba(255,255,255,.05); }
.text-button { padding: 2px; border: 0; color: var(--primary); background: transparent; font-weight: 700; }
.button-spinner { width: 14px; height: 14px; display: none; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.is-submitting .button-spinner { display: block; }
.is-submitting .button-label { opacity: .7; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: grid; gap: 6px; }
.field > span, .field-label { color: #374054; font-size: .8rem; font-weight: 760; }
.field input, .field select, .field textarea, .input { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 9px; outline: 0; color: var(--text); background: var(--surface); transition: border-color var(--transition), box-shadow var(--transition); }
.field textarea { min-height: 130px; resize: vertical; }
.field textarea.editor { min-height: 280px; line-height: 1.65; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91,92,240,.12); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.field-error { min-height: 0; color: var(--danger); font-size: .74rem; }
.compact-field { min-width: 130px; }
.compact-field select { min-height: 34px; padding: 6px 28px 6px 9px; }
.field-hint { color: var(--muted); font-size: .74rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.dashboard-grid .span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }
.form-summary { padding: 11px 13px; border: 1px solid #f0adb5; border-radius: 9px; color: #9b2635; background: var(--danger-soft); font-size: .82rem; }
.check-row { display: flex; align-items: center; gap: 9px; min-height: 38px; }
.check-row input { width: 17px; height: 17px; accent-color: var(--primary); }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.filter-bar .input { width: auto; min-width: 220px; }

/* Cards, tables and states */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { position: relative; overflow: hidden; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.stat-card::after { content: ""; position: absolute; width: 110px; height: 110px; right: -45px; bottom: -55px; border-radius: 50%; background: var(--primary-soft); }
.stat-card span { color: var(--muted); font-size: .78rem; font-weight: 700; }
.stat-card strong { display: block; margin-top: 6px; font-size: 2rem; letter-spacing: -.05em; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.panel { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 19px; border-bottom: 1px solid var(--border); }
.panel-header h2, .panel-header h3 { margin: 0; }
.panel-body { padding: 18px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 16px; }
.entity-card { padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition); }
.entity-card:hover { transform: translateY(-2px); border-color: #c9c9ff; box-shadow: var(--shadow-md); }
.entity-card button.card-link { width: 100%; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; }
.entity-card-header { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.entity-card p { color: var(--muted); font-size: .86rem; }
.entity-meta { display: flex; flex-wrap: wrap; gap: 7px 12px; margin-top: 14px; color: var(--muted); font-size: .74rem; }
.list { display: grid; }
.list-row { min-width: 0; display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(120px, .7fr) minmax(110px, .55fr) auto; align-items: center; gap: 14px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--surface-soft); }
.list-row button.row-link { min-width: 0; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; }
.list-row strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row small { color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 5px; width: max-content; padding: 4px 8px; border-radius: 99px; color: #4a5365; background: #eef1f6; font-size: .69rem; font-weight: 800; }
.badge-success { color: var(--success); background: var(--success-soft); }
.badge-warning { color: var(--warning); background: var(--warning-soft); }
.badge-danger { color: var(--danger); background: var(--danger-soft); }
.badge-info { color: var(--info); background: var(--info-soft); }
.empty-state, .loading-state, .error-state { min-height: 280px; display: grid; place-items: center; align-content: center; padding: 30px; color: var(--muted); text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: rgba(255,255,255,.5); }
.loading-orb { width: 34px; height: 34px; border: 3px solid #dfe3f4; border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
.activity-list { display: grid; }
.activity-item { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 11px 0; }
.activity-item::before { content: ""; position: absolute; left: 13px; top: 34px; bottom: -10px; width: 1px; background: var(--border); }
.activity-item:last-child::before { display: none; }
.activity-icon { width: 27px; height: 27px; display: grid; place-items: center; z-index: 1; border-radius: 50%; color: var(--primary); background: var(--primary-soft); font-size: .72rem; font-weight: 900; }
.activity-item p { margin: 0; font-size: .82rem; }
.activity-item time { color: var(--muted); font-size: .7rem; }

/* Modals and full-page details */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(13,19,36,.58); backdrop-filter: blur(5px); }
.modal { width: min(760px, 100%); max-height: min(900px, calc(100vh - 40px)); display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(255,255,255,.35); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg); }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.modal-header h2 { margin: 0; }
.modal-body { overflow: auto; padding: 22px; }
.detail-page { width: 100%; padding: clamp(20px, 3vw, 34px); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.detail-page > .button { margin-right: 8px; }
.detail-page .detail-copy { max-width: 1100px; font-size: .96rem; line-height: 1.7; }
.detail-section { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--border); }
.detail-properties { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.property { padding: 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft); }
.property small { display: block; color: var(--muted); }
.comment-list { display: grid; gap: 10px; }
.comment { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 13px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-soft); }
.comment p { margin: 4px 0 0; white-space: pre-wrap; }
.comment-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .72rem; }
.mention-menu { position: absolute; z-index: 120; width: min(360px, 90vw); max-height: 240px; overflow: auto; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-md); }
.mention-option { width: 100%; display: flex; gap: 9px; padding: 9px; border: 0; border-radius: 8px; color: var(--text); background: transparent; text-align: left; }
.mention-option:hover, .mention-option.is-active { background: var(--primary-soft); }

/* Settings and audit */
.settings-groups { display: grid; gap: 18px; }
.setting-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(220px, .8fr) auto; align-items: center; gap: 18px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: 0; }
.setting-row p { margin: 0; }
.setting-row .input { width: 100%; }
.notification-preference { grid-template-columns: minmax(190px,1fr) repeat(4,auto) minmax(130px,auto); }
.module-grid { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.workflow-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.planner-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px,1fr); gap: 12px; overflow-x: auto; padding: 2px 2px 16px; scroll-snap-type: x proximity; }
.planner-day { min-height: 420px; padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); scroll-snap-align: start; }
.planner-day > header { display: flex; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--border); text-transform: capitalize; }
.planner-items { display: grid; gap: 9px; margin-top: 12px; }
.planner-item { display: grid; gap: 4px; width: 100%; padding: 11px; border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 10px; text-align: left; background: var(--surface-alt); color: var(--text); cursor: pointer; }
.planner-item.priority-critical { border-left-color: var(--danger); }.planner-item.priority-high { border-left-color: var(--warning); }
.planner-item small,.planner-item span { color: var(--muted); font-size: .74rem; }
.toggle { position: relative; width: 46px; height: 26px; display: inline-block; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle span { position: absolute; inset: 0; border-radius: 99px; background: #c9cfda; transition: background var(--transition); }
.toggle span::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.18); transition: transform var(--transition); }
.toggle input:checked + span { background: var(--primary); }
.toggle input:checked + span::after { transform: translateX(20px); }
.audit-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.audit-table th, .audit-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.audit-table th { position: sticky; top: 0; color: var(--muted); background: var(--surface-soft); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; }
.audit-table code { font-size: .72rem; }
.table-wrap { max-width: 100%; overflow: auto; }

/* Toasts */
.toast-region { position: fixed; z-index: 200; right: 18px; bottom: 18px; width: min(380px, calc(100vw - 36px)); display: grid; gap: 10px; }
.toast { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 13px 14px; border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow-md); animation: toast-in .2s ease-out; }
.toast.is-success { border-left-color: var(--success); }
.toast.is-error { border-left-color: var(--danger); }
.toast.is-warning { border-left-color: var(--warning); }
.toast p { margin: 0; font-size: .82rem; }
.toast small { display: block; margin-top: 3px; color: var(--muted); }
.toast button { border: 0; color: var(--muted); background: transparent; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

.mobile-menu { display: none; }

@media (max-width: 1100px) {
  :root { --sidebar-width: 228px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live-status span { display: none; }
}

@media (max-width: 820px) {
  .login-layout { grid-template-columns: 1fr; padding: 28px 20px 50px; }
  .login-brand { display: none; }
  .login-card { justify-self: center; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-105%); width: min(300px, 86vw); box-shadow: var(--shadow-lg); transition: transform 200ms ease; }
  .sidebar.is-open { transform: translateX(0); }
  .mobile-menu { display: grid; }
  .topbar { gap: 9px; padding: 0 14px; }
  .global-search { width: auto; min-width: 0; flex: 1; }
  .global-search kbd { display: none; }
  .quick-create-label { display: none; }
  .content { padding: 24px 16px; }
  .content-header { align-items: flex-start; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .list-row { grid-template-columns: minmax(0, 1fr) auto; }
  .list-row > :nth-child(2), .list-row > :nth-child(3) { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .setting-row { grid-template-columns: 1fr; gap: 8px; }
}

@media (max-width: 540px) {
  .stat-grid { grid-template-columns: 1fr; }
  .topbar .button-primary { width: 38px; padding: 0; font-size: 0; }
  .topbar .button-primary::before { content: "+"; font-size: 1.25rem; }
  .content-header { display: grid; }
  .page-actions { justify-content: flex-start; }
  .detail-properties { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { max-height: 94vh; border-radius: 20px 20px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
