/* SAHP Records: shared visual layer for every application route. */
:root {
  --bg: #0b1118;
  --bg-soft: #111c25;
  --panel: #141f28;
  --panel-strong: #1b2933;
  --panel-hover: #22343e;
  --line: #30414a;
  --line-soft: rgba(172, 202, 210, .11);
  --text: #edf5f4;
  --muted: #a2b5bb;
  --blue: #80d7c7;
  --blue-soft: rgba(128, 215, 199, .13);
  --blue-text: #a4e9dc;
  --green: #6ed8a0;
  --green-text: #8be4b3;
  --red: #ff7282;
  --red-text: #ff9aa5;
  --amber: #e9bd73;
  --amber-text: #f1cb89;
  --purple-text: #d2b8ff;
  --body-background: #0d161d;
  --sidebar-background: #0b141a;
  --topbar-background: rgba(13, 22, 29, .92);
  --search-background: #15222a;
  --overlay-background: #17252d;
  --notification-background: #17252d;
  --card-background: #15232b;
  --card-hover-background: #1c2e36;
  --control-background: #101c23;
  --input-background: #101c23;
  --button-background: #1d2d35;
  --button-text: #e2efed;
  --nav-text: #a5b8bb;
  --nav-hover-background: rgba(166, 226, 216, .07);
  --nav-active-background: rgba(117, 216, 196, .13);
  --nav-active-shadow: inset 0 0 0 1px rgba(131, 222, 204, .16);
  --subtle-text: #9eb2b7;
  --heading-muted: #81969c;
  --label-text: #cbdcda;
  --table-heading: #a4b9ba;
  --tab-text: #a8bcbf;
  --neutral-badge-background: rgba(168, 203, 204, .1);
  --neutral-badge-text: #d2e1df;
  --row-hover-background: rgba(142, 213, 198, .035);
  --row-active-background: rgba(142, 213, 198, .08);
  --toast-background: #203139;
  --primary-border: #9be5d5;
  --primary-background: #9be5d5;
  --primary-text: #092721;
  --login-background: #0b141a;
  --login-card-background: #142129;
  --focus-ring: rgba(145, 233, 213, .7);
  --shadow: 0 24px 70px rgba(0, 0, 0, .3);
}

html[data-theme="light"] {
  --bg: #eff5f3; --bg-soft: #f4f8f6; --panel: #fff; --panel-strong: #e9f2ef;
  --panel-hover: #e0efea; --line: #c9dcd6; --line-soft: rgba(32, 79, 69, .11);
  --text: #142a28; --muted: #526d68; --blue: #187a69; --blue-soft: rgba(24, 122, 105, .1);
  --blue-text: #176b5d; --body-background: #eff5f3; --sidebar-background: #f9fcfb;
  --topbar-background: rgba(249, 252, 251, .94); --search-background: #edf5f2;
  --overlay-background: #fff; --notification-background: #fff; --card-background: #fff;
  --card-hover-background: #f5faf8; --control-background: #f7fbf9; --input-background: #f7fbf9;
  --button-background: #edf5f2; --button-text: #183c34; --nav-text: #4a6861;
  --nav-hover-background: #edf6f2; --nav-active-background: #deefe9;
  --nav-active-shadow: inset 0 0 0 1px #c6e5d9; --subtle-text: #536e68;
  --heading-muted: #668079; --label-text: #34534b; --table-heading: #526f67;
  --tab-text: #526f67; --neutral-badge-background: #e8f1ed; --neutral-badge-text: #3d6057;
  --row-hover-background: #f3f9f6; --row-active-background: #e9f5ef;
  --toast-background: #fff; --primary-border: #146d5d; --primary-background: #146d5d;
  --primary-text: #fff; --login-background: #e8f2ed; --login-card-background: #fff;
  --focus-ring: rgba(20, 109, 93, .55); --shadow: 0 24px 70px rgba(28, 68, 57, .12);
}

body { font-size: 14px; }
.app-shell { grid-template-columns: 264px minmax(0, 1fr); }
.sidebar { padding: 26px 16px 16px; border-color: var(--line-soft); }
.brand { gap: 12px; padding: 0 8px 23px; }
.brand-logo { width: 46px; height: 46px; }
.brand strong { font-size: 20px; font-weight: 800; letter-spacing: -.06em; }
.brand-accent { color: var(--blue-text); }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; letter-spacing: .025em; }
.sidebar-label { display: flex; justify-content: space-between; margin: 0 8px 12px; padding: 16px 0 0; border-top: 1px solid var(--line-soft); color: var(--heading-muted); font-size: 9px; font-weight: 750; letter-spacing: .13em; }
.sidebar-label span { color: var(--blue-text); }
.nav { gap: 2px; align-content: start; flex: 1; }
.nav-heading { margin-top: 15px; padding-left: 11px; font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.nav-link { min-height: 42px; border: 1px solid transparent; border-radius: 9px; font-weight: 500; }
.nav-link.active { border-color: transparent; color: var(--blue-text); }
.nav-link::before { left: -1px; width: 3px; background: var(--blue); }
.nav-icon { color: inherit; opacity: .86; }
.sidebar-footer { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; padding: 16px 8px 2px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 10px; line-height: 1.4; }
.sidebar-footer strong { color: var(--text); font-size: 11px; font-weight: 650; }
.sidebar-footer-mark { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.topbar { min-height: 76px; padding: 14px 32px; border-color: var(--line-soft); }
.search { height: 44px; max-width: 480px; border-color: var(--line-soft); border-radius: 10px; }
.search input::placeholder { color: var(--muted); opacity: .9; }
kbd { border-color: var(--line-soft); background: var(--panel-strong); }
.icon-button { width: 42px; height: 42px; border-radius: 10px; }
.user-pill { margin-left: 8px; padding-left: 16px; }
.discord-badge { width: 38px; height: 38px; border-radius: 12px; }
.content { width: min(1440px, calc(100% - 72px)); padding-top: 38px; }
.page-header { margin-bottom: 30px; }
.page-header h1 { font-size: clamp(27px, 2.5vw, 34px); font-weight: 700; letter-spacing: -.045em; }
.page-header h1::before { display: block; margin-bottom: 10px; color: var(--blue-text); content: 'SAHP / EINSATZPORTAL'; font-size: 10px; font-weight: 750; letter-spacing: .15em; }
.section-header h2, .section-header h3 { letter-spacing: -.025em; }
.card, .news-card, .news-empty, .dashboard-info-item, .department-panel, .department-summary > div { border-color: var(--line-soft); border-radius: 14px; box-shadow: 0 8px 26px rgba(0, 0, 0, .08); }
.card-pad { padding: 24px; }
.stat-card { min-height: 124px; }
.stat-card strong { font-size: 31px; font-weight: 700; }
.stat-icon { width: 44px; height: 44px; border: 1px solid color-mix(in srgb, currentColor 18%, transparent); border-radius: 12px; }
.dashboard-info-band, .dashboard-field-grid, .news-feed { gap: 16px; }
.dashboard-info-item { padding: 24px; }
.dashboard-field h2, .news-card h2 { font-size: 17px; font-weight: 650; letter-spacing: -.02em; }
.dashboard-field-grid .card { background-image: linear-gradient(135deg, rgba(138, 215, 200, .035), transparent 45%); }
.dashboard-news-header { margin-top: 34px; }
.news-card, .news-empty { padding: 26px; }
.button { min-height: 42px; border-radius: 9px; font-weight: 650; }
.button.primary { box-shadow: 0 5px 18px rgba(70, 180, 158, .12); }
.button.primary:hover:not(:disabled):not(.disabled) { border-color: var(--blue); filter: brightness(1.06); }
.button.small { min-height: 34px; }
.field input, .field select, .field textarea, .filter-input { border-radius: 9px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); }
.table-wrap { border-radius: 12px; }
th { font-size: 10px; letter-spacing: .09em; }
td { color: var(--text); }
.badge { font-weight: 650; }
.tabs { border-color: var(--line-soft); }
.tab.active { color: var(--blue-text); }
:focus-visible { outline-color: var(--focus-ring); }

/* Sign-in uses the same operational identity, with a quieter reading column. */
.login-body { padding: 24px; }
.login-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(400px, 520px); width: min(1440px, 100%); min-height: min(850px, calc(100dvh - 48px)); overflow: hidden; border: 1px solid var(--line-soft); border-radius: 24px; background: var(--login-card-background); box-shadow: var(--shadow); }
.login-intro { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; overflow: hidden; padding: clamp(32px, 5vw, 72px); color: #effbf7; background: radial-gradient(circle at 78% 24%, rgba(111, 209, 190, .17), transparent 32%), linear-gradient(145deg, #1b3b39 0%, #102a2b 52%, #0d1f25 100%); }
.login-intro::after { position: absolute; right: -170px; bottom: -310px; width: 640px; height: 640px; border: 1px solid rgba(167, 235, 218, .13); border-radius: 50%; box-shadow: 0 0 0 70px rgba(167, 235, 218, .025), 0 0 0 140px rgba(167, 235, 218, .025), 0 0 0 210px rgba(167, 235, 218, .018); content: ''; pointer-events: none; }
.intro-brand, .intro-copy, .intro-bottom { position: relative; z-index: 1; }
.intro-brand { display: flex; align-items: center; gap: 14px; }
.intro-brand img { width: 54px; height: 54px; object-fit: contain; }
.intro-brand strong, .intro-brand small { display: block; }
.intro-brand strong { font-size: 23px; font-weight: 800; letter-spacing: -.06em; line-height: 1; }
.intro-brand strong span { color: #9be5d5; }
.intro-brand small { margin-top: 6px; color: #a9c7c0; font-size: 9px; font-weight: 700; letter-spacing: .15em; }
.intro-copy { max-width: 570px; margin: 80px 0; }
.intro-kicker { display: flex; align-items: center; gap: 10px; color: #a6ded1; font-size: 10px; font-weight: 750; letter-spacing: .16em; }
.intro-kicker span { width: 28px; height: 1px; background: #a6ded1; }
.intro-copy h2 { margin: 24px 0; font-size: clamp(42px, 5.1vw, 72px); font-weight: 650; letter-spacing: -.06em; line-height: 1.08; }
.intro-copy h2 em { color: #9be5d5; font-style: normal; }
.intro-copy > p:last-child { max-width: 400px; color: #bdd2cb; font-size: 16px; line-height: 1.8; }
.intro-bottom { display: flex; justify-content: space-between; gap: 12px; padding-top: 20px; border-top: 1px solid rgba(209, 242, 231, .16); color: #a9c7c0; font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.login-shell { align-self: center; width: 100%; padding: 72px clamp(28px, 4vw, 60px) 40px; }
.login-brand { margin-bottom: 28px; }
.login-card { padding: 0; border: 0; background: none; box-shadow: none; }
.login-card h1 { font-size: 32px; font-weight: 700; }
.login-card > .eyebrow { margin-bottom: 12px; }
.login-card > .muted { line-height: 1.7; }
.login-form { margin-top: 30px; }
.login-form input { min-height: 48px; }
.login-form .button { min-height: 48px; }
.login-divider { margin: 24px 0; }
.login-footer { margin-top: 30px; }
.login-theme-toggle { z-index: 3; }

@media (max-width: 800px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { width: min(300px, 86vw); }
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; padding: 10px 14px; }
  .content { width: calc(100% - 32px); padding-top: 26px; }
  .login-layout { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
  .login-intro { min-height: 245px; padding: 32px; }
  .intro-brand img { width: 44px; height: 44px; }
  .intro-copy { margin: 35px 0 10px; }
  .intro-copy h2 { margin: 12px 0; font-size: clamp(34px, 8vw, 48px); }
  .intro-copy > p:last-child, .intro-bottom { display: none; }
  .login-shell { padding: 36px 32px 32px; }
}
@media (max-width: 560px) {
  .login-body { padding: 0; align-items: stretch; }
  .login-layout { min-height: 100dvh; border: 0; border-radius: 0; }
  .login-intro { min-height: 210px; padding: 26px 24px; }
  .login-shell { padding: 32px 24px; }
  .login-card { padding: 0; }
  .login-theme-toggle { top: 18px; right: 18px; }
  .topbar { grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; gap: 8px; }
  #menu-button { grid-column: 1; grid-row: 1; }
  .top-actions { grid-column: 3; grid-row: 1; gap: 4px; }
  .topbar .icon-button { width: 40px; height: 40px; }
  .topbar .search { grid-column: 1 / -1; grid-row: 2; max-width: none; }
  .search-results { top: 112px; }
  .content { width: calc(100% - 32px); }
  .page-header h1 { font-size: 27px; }
  .card-pad, .news-card, .news-empty, .dashboard-info-item { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Preserve a visible keyboard indicator on clickable rows and cards. */
.click-row:focus-visible, .interactive-card:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: -3px;
}
@media (max-width: 560px) {
  .topbar .icon-button, .button.small, .nav-link { min-height: 44px; }
  .topbar .icon-button { width: 44px; height: 44px; }
  .search-results { top: 116px; }
}
.login-body > .login-shell { width: min(440px, 100%); padding: 0; }

/* The authenticated workspace uses a neutral graphite palette. The sign-in retains its own identity. */
body:not(.login-body) {
  --bg: #111112; --bg-soft: #1a1a1c; --panel: #1e1e20; --panel-strong: #29292c;
  --panel-hover: #303033; --line: #3b3b3f; --line-soft: rgba(255,255,255,.09);
  --text: #f4f4f3; --muted: #b0b0b2; --blue: #c7c7c8; --blue-soft: rgba(255,255,255,.08);
  --blue-text: #e3e3e3; --body-background: #141415; --sidebar-background: #111112;
  --topbar-background: rgba(20,20,21,.94); --search-background: #202022;
  --overlay-background: #232325; --notification-background: #232325; --card-background: #1e1e20;
  --card-hover-background: #272729; --control-background: #19191b; --input-background: #19191b;
  --button-background: #28282b; --button-text: #f0f0f0; --nav-text: #b8b8ba;
  --nav-hover-background: rgba(255,255,255,.06); --nav-active-background: rgba(255,255,255,.1);
  --nav-active-shadow: inset 0 0 0 1px rgba(255,255,255,.08); --subtle-text: #adadaf;
  --heading-muted: #929295; --label-text: #d5d5d6; --table-heading: #b5b5b7;
  --tab-text: #b9b9bb; --neutral-badge-background: rgba(255,255,255,.07);
  --neutral-badge-text: #d5d5d6; --row-hover-background: rgba(255,255,255,.035);
  --row-active-background: rgba(255,255,255,.07); --toast-background: #2a2a2c;
  --primary-border: #e2e2e0; --primary-background: #e2e2e0; --primary-text: #171718;
  --focus-ring: rgba(235,235,235,.72);
}
html[data-theme="light"] body:not(.login-body) {
  --bg: #f4f4f3; --bg-soft: #f4f4f3; --panel: #fff; --panel-strong: #ebebea;
  --panel-hover: #e5e5e4; --line: #d4d4d3; --line-soft: rgba(0,0,0,.1);
  --text: #242425; --muted: #656568; --blue: #515153; --blue-soft: rgba(0,0,0,.06);
  --blue-text: #3b3b3d; --body-background: #f2f2f1; --sidebar-background: #fbfbfa;
  --topbar-background: rgba(250,250,249,.94); --search-background: #efefee; --overlay-background: #fff;
  --notification-background: #fff; --card-background: #fff; --card-hover-background: #f8f8f7;
  --control-background: #fafaf9; --input-background: #fafaf9; --button-background: #f0f0ef;
  --button-text: #29292a; --nav-text: #555558; --nav-hover-background: #f0f0ef;
  --nav-active-background: #e8e8e7; --nav-active-shadow: inset 0 0 0 1px #d7d7d6;
  --subtle-text: #626265; --heading-muted: #717174; --label-text: #414143;
  --table-heading: #626264; --tab-text: #626264; --neutral-badge-background: #efefee;
  --neutral-badge-text: #515153; --row-hover-background: #f6f6f5; --row-active-background: #eeeeed;
  --toast-background: #fff; --primary-border: #353537; --primary-background: #353537;
  --primary-text: #fff; --focus-ring: rgba(48,48,50,.6);
}
body:not(.login-body) .button.primary { box-shadow: none; }
body:not(.login-body) .sidebar-footer-mark { box-shadow: 0 0 0 4px rgba(180,180,180,.12); }

/* Dashboard: a welcome panel, grouped operational information and a compact profile rail. */
.dashboard-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.dashboard-heading h1 { margin: 7px 0 3px; font-size: clamp(28px, 2.5vw, 34px); font-weight: 700; line-height: 1.2; letter-spacing: -.045em; }
.dashboard-heading p { margin: 0; color: var(--muted); }
.dashboard-kicker, .dashboard-overline { display: block; color: var(--heading-muted); font-size: 10px; font-weight: 750; letter-spacing: .13em; line-height: 1.4; }
.dashboard-kicker span { padding: 0 4px; color: var(--line); }
.dashboard-edit { flex-shrink: 0; }
.dashboard-welcome { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 174px; overflow: hidden; margin-bottom: 20px; padding: 30px 34px; border: 1px solid rgba(255,255,255,.11); border-radius: 16px; background: linear-gradient(115deg, #333335, #252527 60%, #202022); color: #f8f8f6; }
.dashboard-welcome::after { position: absolute; right: 14%; top: -180px; width: 430px; height: 430px; border: 1px solid rgba(255,255,255,.07); border-radius: 50%; box-shadow: 0 0 0 55px rgba(255,255,255,.018), 0 0 0 110px rgba(255,255,255,.015); content: ''; pointer-events: none; }
.dashboard-welcome-copy, .dashboard-welcome-brand { position: relative; z-index: 1; }
.dashboard-welcome .dashboard-overline { color: #b9b9ba; }
.dashboard-welcome h2 { margin: 12px 0 7px; font-size: clamp(25px, 2.4vw, 34px); font-weight: 650; letter-spacing: -.045em; line-height: 1.15; overflow-wrap: anywhere; }
.dashboard-welcome h2 span { color: #b9b9ba; }
.dashboard-welcome p { margin: 0; color: #c8c8c8; }
.dashboard-welcome-brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; margin-right: 8px; color: #e8e8e7; font-size: 16px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.dashboard-welcome-brand img { width: 48px; height: 48px; object-fit: contain; }
.dashboard-welcome-brand small { display: block; margin-top: 5px; color: #bfbfc0; font-size: 9px; letter-spacing: .14em; }
.dashboard-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .8fr); align-items: start; gap: 20px; }
.dashboard-layout:has(.dashboard-side-column:empty) { grid-template-columns: 1fr; }
.dashboard-main-column, .dashboard-side-column { display: grid; gap: 20px; min-width: 0; }
.dashboard-panel { min-width: 0; padding: 24px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--card-background); box-shadow: 0 8px 26px rgba(0,0,0,.06); }
.dashboard-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.dashboard-panel-heading h2 { margin: 5px 0 0; font-size: 17px; font-weight: 680; letter-spacing: -.025em; line-height: 1.35; }
.dashboard-heading-icon, .dashboard-row-icon, .dashboard-note-icon, .dashboard-profile-avatar { display: grid; place-items: center; flex: 0 0 auto; color: var(--muted); background: var(--panel-strong); }
.dashboard-heading-icon { width: 36px; height: 36px; border: 1px solid var(--line-soft); border-radius: 10px; }
.dashboard-heading-icon .ui-icon, .dashboard-row-icon .ui-icon, .dashboard-note-icon .ui-icon, .dashboard-profile-avatar .ui-icon { width: 18px; height: 18px; }
.dashboard-duty-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.dashboard-duty-row { display: flex; gap: 13px; align-items: flex-start; min-width: 0; min-height: 100px; padding: 16px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--bg-soft); }
.dashboard-row-icon, .dashboard-note-icon { width: 36px; height: 36px; border-radius: 9px; }
.dashboard-duty-row h3 { margin: 1px 0 6px; font-size: 13px; font-weight: 650; line-height: 1.4; }
.dashboard-duty-row p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.dashboard-notes-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.dashboard-note { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.dashboard-note > div:last-child { min-width: 0; }
.dashboard-note h2 { margin: 5px 0 7px; font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.dashboard-note p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.dashboard-profile-name { display: flex; align-items: center; gap: 12px; min-width: 0; padding-bottom: 18px; border-bottom: 1px solid var(--line-soft); }
.dashboard-profile-name > div { min-width: 0; }
.dashboard-profile-avatar { width: 44px; height: 44px; border-radius: 12px; }
.dashboard-profile-name strong, .dashboard-profile-name small { display: block; overflow-wrap: anywhere; }
.dashboard-profile-name strong { font-size: 14px; }
.dashboard-profile-name small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.dashboard-profile-details { display: grid; gap: 12px; margin: 18px 0 0; }
.dashboard-profile-details div { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; }
.dashboard-profile-details dt { color: var(--muted); }
.dashboard-profile-details dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.dashboard-agencies ul { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.dashboard-agencies li { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); font-size: 12px; }
.dashboard-agencies li span { display: grid; place-items: center; flex: 0 0 38px; height: 28px; border: 1px solid var(--line-soft); border-radius: 7px; background: var(--bg-soft); color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .02em; }
@media (max-width: 1050px) { .dashboard-layout { grid-template-columns: 1fr; } .dashboard-side-column { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 560px) {
  .dashboard-heading { align-items: flex-start; flex-direction: column; margin-bottom: 22px; }
  .dashboard-edit { width: 100%; }
  .dashboard-welcome { min-height: 160px; padding: 24px; }
  .dashboard-welcome-brand { display: none; }
  .dashboard-panel { padding: 20px; }
  .dashboard-duty-list, .dashboard-notes-list, .dashboard-side-column { grid-template-columns: 1fr; }
  .dashboard-duty-row { min-height: 0; }
  .dashboard-notes-list { gap: 22px; }
}
