:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --text: #172033;
  --muted: #667085;
  --line: #d8e0ea;
  --primary: #0073AB;
  --primary-dark: #005f8f;
  --accent: #a65f00;
  --danger: #b42318;
  --shadow: 0 14px 35px rgba(29, 41, 57, .08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

a {
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: none;
}

h1, h2, p {
  margin-top: 0;
}

h1 {
  margin-bottom: .25rem;
  font-size: 1.9rem;
}

h2 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

button, input, select {
  min-height: 40px;
  border-radius: 6px;
  font: inherit;
}

button {
  border: 0;
  padding: .65rem .95rem;
  background: var(--primary);
  color: white;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--primary-dark);
}

button.secondary {
  background: var(--surface-2);
  color: var(--text);
}

button.danger {
  background: var(--danger);
}

input, select {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
  padding: .55rem .65rem;
}

code {
  font-family: Consolas, monospace;
}

.logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.logo.large {
  width: 90px;
  height: 90px;
  margin-bottom: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .85rem;
}

.eyebrow {
  margin-bottom: .35rem;
  color: var(--primary-dark);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f7fafc 0%, #e6f2f8 100%);
}

.login-shell {
  width: min(460px, calc(100vw - 32px));
}

.login-panel {
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-form {
  display: grid;
  gap: .85rem;
  margin-top: 1.2rem;
}

.login-form label {
  display: grid;
  gap: .35rem;
  color: var(--muted);
  font-weight: 700;
}

.hint {
  color: var(--muted);
  line-height: 1.45;
}

.success {
  color: #157347;
  font-weight: 700;
}

.error {
  color: var(--danger);
  font-weight: 700;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar nav,
.mobile-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
}

.admin-shell {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.admin-shell.single {
  grid-template-columns: 1fr;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.panel.wide {
  grid-column: 1 / -1;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .6rem;
  margin-bottom: 1rem;
}

.inline-form.three {
  grid-template-columns: minmax(180px, 280px) 1fr auto;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: .6rem;
  margin-bottom: 1rem;
  align-items: center;
}

.order-form {
  grid-template-columns: repeat(7, minmax(130px, 1fr));
}

.check {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-height: 40px;
  color: var(--muted);
}

.check input {
  width: auto;
}

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

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

th, td {
  padding: .7rem .65rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
}

td.actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

td.actions button {
  min-height: 34px;
  padding: .45rem .65rem;
}

.icon-actions {
  align-items: center;
}

.icon-button {
  width: 36px;
  min-height: 36px;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: .2rem .5rem;
  border-radius: 999px;
  background: #edf2f7;
  color: #344054;
  font-size: .78rem;
  font-weight: 800;
}

.status-offen { background: #e0f2fe; color: #075985; }
.status-angefragt { background: #fef3c7; color: #92400e; }
.status-angenommen { background: #dcfce7; color: #166534; }
.status-abgelehnt { background: #fee2e2; color: #991b1b; }
.status-abgeschlossen { background: #e5e7eb; color: #374151; }
.status-storniert { background: #f3e8ff; color: #6b21a8; }

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  max-width: min(420px, calc(100vw - 32px));
  padding: .85rem 1rem;
  border-radius: 8px;
  background: #172033;
  color: white;
  box-shadow: var(--shadow);
  z-index: 10;
}

.mobile-body {
  background: #f8fafc;
}

.mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.mobile-header h1 {
  font-size: 1.35rem;
}

.mobile-shell {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 1rem;
}

.identity {
  margin-bottom: 1.25rem;
  padding: .9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.identity label {
  display: block;
  margin-bottom: .4rem;
  color: var(--muted);
  font-weight: 700;
}

.card-list {
  display: grid;
  gap: .85rem;
  margin-bottom: 1.5rem;
}

.order-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 1rem;
  box-shadow: 0 8px 20px rgba(29, 41, 57, .06);
}

.order-card h3 {
  margin: .65rem 0 .35rem;
  font-size: 1.15rem;
}

.order-card p {
  margin-bottom: .45rem;
  color: var(--muted);
  line-height: 1.4;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
}

.card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem;
  margin-top: .9rem;
}

.card-actions.single {
  grid-template-columns: 1fr;
}

.card-actions button {
  min-height: 48px;
}

.empty {
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
}

@media (max-width: 960px) {
  .admin-shell,
  .grid-form,
  .order-form {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .inline-form {
    grid-template-columns: 1fr;
  }

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

  .mobile-header,
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .mobile-shell {
    padding: .75rem;
  }
}
