:root {
  --blue: #00436b;
  --blue-2: #0b5a86;
  --red: #e30613;
  --ink: #17212b;
  --muted: #6b7785;
  --line: #d9e0e7;
  --surface: #ffffff;
  --soft: #f3f6f8;
  --ok: #137a4a;
  --warn: #a65f00;
  --bad: #ad1d2b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #f7fafc 0, #eef3f6 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 18px;
  align-content: center;
  color: var(--muted);
}

.boot img {
  width: 132px;
  border-radius: 8px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 460px) 1fr;
  background: var(--surface);
}

.login-panel {
  padding: 48px;
  display: grid;
  align-content: center;
  border-right: 1px solid var(--line);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 42px;
}

.brand-row img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
}

.brand-row h1 {
  font-size: 28px;
  line-height: 1.05;
  margin: 0;
}

.brand-row p {
  margin: 6px 0 0;
  color: var(--muted);
}

.login-art {
  position: relative;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(0, 67, 107, .98), rgba(0, 67, 107, .68)),
    url("/assets/idee.png") center / cover;
  overflow: hidden;
}

.login-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 0 74%, var(--red) 74% 79%, transparent 79%),
    radial-gradient(circle at 86% 14%, rgba(255,255,255,.18), transparent 28%);
}

.login-art-content {
  position: relative;
  z-index: 1;
  min-height: 100%;
  padding: 64px;
  display: grid;
  align-content: end;
  color: white;
}

.login-art-content h2 {
  max-width: 680px;
  font-size: clamp(42px, 5vw, 74px);
  line-height: 1;
  margin: 0 0 20px;
}

.login-art-content p {
  max-width: 620px;
  font-size: 19px;
  line-height: 1.5;
  margin: 0;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.mobile-header,
.nav-backdrop {
  display: none;
}

.sidebar {
  background: var(--blue);
  color: white;
  min-height: 100vh;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.sidebar-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 8px 8px 18px;
  border-bottom: 1px solid rgba(255,255,255,.16);
}

.sidebar-brand img {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
}

.sidebar-brand strong {
  display: block;
  font-size: 18px;
  line-height: 1.05;
}

.sidebar-brand span {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: rgba(255,255,255,.72);
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button,
.logout-btn {
  border: 0;
  color: white;
  background: transparent;
  border-radius: 7px;
  padding: 12px 12px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav button:hover,
.nav button.active,
.logout-btn:hover {
  background: rgba(255,255,255,.13);
}

.user-strip {
  margin-top: auto;
  display: grid;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.16);
}

.user-strip small {
  color: rgba(255,255,255,.74);
}

.content {
  min-width: 0;
}

.topbar {
  min-height: 92px;
  background: linear-gradient(90deg, var(--blue), #083553);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 34px;
  border-bottom: 6px solid var(--red);
}

.topbar h2 {
  margin: 0;
  font-size: 30px;
}

.topbar p {
  margin: 6px 0 0;
  color: rgba(255,255,255,.78);
}

.topbar img {
  max-width: 280px;
  width: 32vw;
  min-width: 180px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.notification-btn {
  width: 42px;
  height: 42px;
  position: relative;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 7px;
  background: rgba(255,255,255,.09);
  color: white;
  display: grid;
  place-items: center;
}

.notification-btn:hover,
.notification-btn.has-unread {
  background: rgba(255,255,255,.18);
}

.bell-symbol {
  font-size: 18px;
  line-height: 1;
}

.notification-count {
  min-width: 20px;
  height: 20px;
  position: absolute;
  top: -7px;
  right: -7px;
  border: 2px solid var(--blue);
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  background: var(--red);
  color: white;
  font-size: 11px;
  font-weight: 700;
}

.notification-panel {
  width: min(420px, calc(100vw - 24px));
  max-height: min(620px, calc(100vh - 96px));
  position: fixed;
  top: 76px;
  right: 22px;
  z-index: 40;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 24px 52px rgba(0, 35, 58, .22);
}

.notification-head {
  min-height: 56px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.notification-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.danger-text {
  color: var(--bad) !important;
}

.notification-list {
  max-height: calc(min(620px, calc(100vh - 96px)) - 56px);
  overflow-y: auto;
  padding: 8px;
}

.notification-item {
  width: 100%;
  border: 0;
  border-left: 4px solid #c8d2dc;
  border-radius: 7px;
  display: grid;
  gap: 5px;
  padding: 10px 10px 10px 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.notification-item:hover,
.notification-item.unread {
  background: #f3f7fa;
}

.notification-item.pending {
  border-left-color: var(--warn);
}

.notification-item.open,
.notification-item.approved {
  border-left-color: var(--ok);
}

.notification-item.rejected,
.notification-item.withdrawn,
.notification-item.cancelled {
  border-left-color: var(--bad);
}

.notification-item.pending.unread {
  background: #fff9ec;
}

.notification-item.open.unread,
.notification-item.approved.unread {
  background: #eef9f2;
}

.notification-item.rejected.unread,
.notification-item.withdrawn.unread,
.notification-item.cancelled.unread {
  background: #fff1f2;
}

.notification-item strong,
.notification-item span,
.notification-item small {
  min-width: 0;
}

.notification-item small {
  color: var(--muted);
}

.page {
  padding: 28px 34px 48px;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0, 35, 58, .06);
}

.panel {
  padding: 20px;
}

.card {
  padding: 18px;
}

.stat {
  display: grid;
  gap: 6px;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.stat strong {
  font-size: 34px;
}

.section-head {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-head h3 {
  margin: 0;
  font-size: 20px;
}

.section-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

.request-history {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: #f8fafb;
}

form {
  display: grid;
  gap: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.check-option {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  line-height: 1.25;
}

.check-option input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;
}

.check-option span {
  min-width: 0;
}

.check-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 9px 14px;
  align-items: start;
}

.check-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 11px;
}

.check-stack strong {
  margin-bottom: 2px;
}

input,
select,
textarea {
  border: 1px solid #c7d1db;
  border-radius: 7px;
  padding: 10px 11px;
  background: white;
  color: var(--ink);
  min-width: 0;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.btn {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: white;
  border-radius: 7px;
  padding: 10px 13px;
  min-height: 40px;
}

.btn.secondary {
  background: white;
  color: var(--blue);
}

.btn.danger {
  border-color: var(--bad);
  background: var(--bad);
}

.btn.ghost {
  border-color: transparent;
  color: var(--blue);
  background: transparent;
}

.btn:disabled {
  opacity: .52;
  cursor: not-allowed;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 3px 9px;
  background: #e9eef3;
  color: #405061;
  font-size: 12px;
  white-space: nowrap;
}

.badge.pending {
  color: var(--warn);
  background: #fff4df;
}

.badge.approved,
.badge.open {
  color: var(--ok);
  background: #e8f6ee;
}

.badge.rejected,
.badge.cancelled,
.badge.withdrawn {
  color: var(--bad);
  background: #ffe9ec;
}

.badge.closed {
  color: #555;
  background: #eceff2;
}

.badge.completed {
  color: #315064;
  background: #e5edf3;
}

.notice {
  border-left: 4px solid var(--red);
  background: white;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 18px;
  box-shadow: 0 10px 24px rgba(0, 35, 58, .05);
}

.muted {
  color: var(--muted);
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tabs button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  padding: 9px 13px;
}

.tabs button.active {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

.footer-logo {
  max-width: 430px;
  width: 100%;
  margin-top: 26px;
  opacity: .8;
}

.error {
  color: var(--bad);
  background: #fff1f2;
  border: 1px solid #ffd6dc;
  padding: 10px 12px;
  border-radius: 7px;
}

.success {
  color: var(--ok);
  background: #eef9f2;
  border: 1px solid #cdebd9;
  padding: 10px 12px;
  border-radius: 7px;
}

.compact {
  font-size: 13px;
}

@media (max-width: 960px) {
  .login-page,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .login-art {
    display: none;
  }

  .mobile-header {
    min-height: 60px;
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: 40px 1fr 42px 40px;
    gap: 10px;
    align-items: center;
    padding: 8px 14px;
    color: white;
    background: linear-gradient(90deg, var(--blue), #083553);
    border-bottom: 4px solid var(--red);
    box-shadow: 0 8px 22px rgba(0, 35, 58, .16);
  }

  .mobile-header strong,
  .mobile-header small {
    display: block;
    line-height: 1.15;
  }

  .mobile-header small {
    margin-top: 3px;
    color: rgba(255,255,255,.74);
    font-size: 12px;
  }

  .mobile-header img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
  }

  .menu-btn {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 7px;
    background: rgba(255,255,255,.08);
    display: grid;
    place-content: center;
    gap: 5px;
  }

  .menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: white;
  }

  .sidebar {
    width: min(86vw, 320px);
    min-height: 100vh;
    position: fixed;
    inset: 0 auto 0 0;
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: 18px 0 34px rgba(0, 23, 38, .26);
    overflow-y: auto;
  }

  .app-shell.nav-open .sidebar {
    transform: translateX(0);
  }

  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 15;
    border: 0;
    background: rgba(8, 24, 38, .44);
  }

  .app-shell.nav-open .nav-backdrop {
    display: block;
  }

  .nav button,
  .logout-btn {
    min-height: 46px;
  }

  .topbar {
    min-height: auto;
    padding-top: 20px;
    padding-bottom: 18px;
  }

  .topbar img {
    display: none;
  }

  .topbar-actions {
    display: none;
  }

  .notification-panel {
    top: 68px;
    right: 10px;
    left: 10px;
    width: auto;
  }

  .topbar h2 {
    font-size: 24px;
  }

  .topbar p {
    font-size: 14px;
  }

  .grid.two,
  .grid.three,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .page,
  .topbar,
  .login-panel {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (max-width: 720px) {
  body {
    background: #eef3f6;
  }

  body,
  button,
  input,
  select,
  textarea {
    font-size: 15px;
  }

  .login-panel {
    padding-top: 34px;
    padding-bottom: 34px;
  }

  .brand-row {
    margin-bottom: 28px;
  }

  .brand-row h1 {
    font-size: 24px;
  }

  .page {
    padding: 14px 10px 28px;
  }

  .panel,
  .card {
    padding: 12px;
    box-shadow: 0 8px 18px rgba(0, 35, 58, .05);
  }

  .topbar {
    display: none;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 10px;
  }

  .section-head h3 {
    font-size: 17px;
  }

  .section-head p {
    font-size: 13px;
  }

  .stat {
    grid-template-columns: 1fr auto;
    align-items: center;
    min-height: 58px;
  }

  .stat span {
    font-size: 11px;
  }

  .stat strong {
    font-size: 25px;
  }

  input,
  select,
  textarea,
  .btn,
  .tabs button {
    min-height: 42px;
  }

  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .actions .btn,
  form > .btn {
    width: 100%;
  }

  .tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tabs button {
    border-radius: 7px;
  }

  .check-list {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    overflow: visible;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  table {
    min-width: 0;
  }

  thead {
    display: none;
  }

  tr {
    margin-bottom: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    box-shadow: 0 8px 18px rgba(0, 35, 58, .05);
    overflow: hidden;
  }

  td {
    min-height: 36px;
    display: grid;
    grid-template-columns: minmax(94px, 34%) minmax(0, 1fr);
    gap: 8px;
    padding: 7px 9px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
  }

  td:last-child {
    border-bottom: 0;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    align-self: start;
  }

  td.actions {
    display: flex;
    gap: 8px;
    min-height: 48px;
  }

  td.actions::before {
    width: 100%;
  }

  td.actions .btn {
    min-height: 38px;
  }

  .ff-overview tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 8px;
  }

  .ff-overview td {
    width: auto;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 3px;
    padding: 6px 5px;
    border-bottom: 0;
  }

  .ff-overview td:first-child,
  .ff-overview td[data-label="Notiz"],
  .ff-overview td[data-label="Aktion"] {
    grid-column: 1 / -1;
  }

  .ff-overview td:first-child {
    padding-bottom: 9px;
    border-bottom: 1px solid var(--line);
  }

  .ff-overview td:first-child::before,
  .ff-overview td[data-label="Aktion"]::before {
    display: none;
  }

  .ff-overview td[data-label="Notiz"]:empty {
    display: none;
  }

  .ff-overview td[data-label="Aktion"] {
    min-height: 0;
    padding-top: 7px;
  }

  .ff-overview td[data-label="Aktion"] .btn {
    width: auto;
    min-height: 34px;
    justify-self: start;
    padding: 7px 11px;
  }

  .footer-logo {
    max-width: 260px;
  }
}

@media (max-width: 420px) {
  .mobile-header {
    grid-template-columns: 40px 1fr 40px 36px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .topbar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .tabs {
    grid-template-columns: 1fr;
  }
}
