:root {
  /* Grundfarbpalette in Weiß / Grün / Bronze */
  --bg: #0f172a;
  --bg-elevated: #111827;
  --bg-elevated-soft: #111827;
  --accent: #16a34a; /* Grün */
  --accent-soft: rgba(22, 163, 74, 0.12);
  --accent-strong: #15803d;
  --accent-bronze: #b45309; /* Bronze */
  --accent-bronze-soft: rgba(180, 83, 9, 0.14);
  --border-subtle: rgba(148, 163, 184, 0.35);
  --text: #f9fafb;
  --text-muted: #9ca3af;
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.16);
  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.7);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-full: 999px;
  --transition-fast: 150ms ease-out;
  --transition-med: 220ms ease;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  background: #dac081;
  color: var(--text);
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  backdrop-filter: blur(22px);
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.78));
  border-bottom: 1px solid rgba(51, 65, 85, 0.85);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.75);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo-wrapper {
  width: 42px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo {
  max-width: 100%;
  max-height: 100%;
}

.brand-text-block {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-text-main {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--accent-bronze);
}

.brand-text-sub {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.area-toggle {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.6);
}

.area-toggle-button {
  border: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.area-toggle-button-active {
  background: var(--accent-soft);
  color: #ecfdf3;
}

.app-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(330px, 1fr);
  gap: 18px;
  padding: 18px 22px 22px;
}

.floorplan-panel,
.details-panel {
  background: linear-gradient(to bottom right, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.96));
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
}

.details-panel {
  border-color: rgba(22, 163, 74, 0.55);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.panel-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e5e7eb;
}

.panel-actions {
  display: flex;
  gap: 8px;
}

.floorplan-canvas {
  flex: 1;
  position: relative;
  border-radius: 14px;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  background: radial-gradient(circle at top, rgba(22, 163, 74, 0.07), transparent 58%),
    linear-gradient(to right, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.98));
  overflow: hidden;
  padding: 10px;
}

.details-content {
  flex: 1;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: radial-gradient(circle at top left, rgba(22, 163, 74, 0.16), transparent 60%),
    linear-gradient(to bottom right, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.96));
  padding: 12px 13px;
  font-size: 14px;
  color: var(--text-muted);
  overflow: auto;
}

.btn {
  border: none;
  border-radius: var(--radius-full);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition-med);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #ecfdf3;
  box-shadow: 0 12px 30px rgba(22, 163, 74, 0.55);
}

.btn-primary:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 16px 38px rgba(22, 163, 74, 0.7);
}

.btn-ghost {
  background: rgba(15, 23, 42, 0.7);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.btn-ghost:hover {
  background: rgba(15, 23, 42, 0.98);
  border-color: rgba(226, 232, 240, 0.65);
  color: #e5e7eb;
}

.icon-button {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-full);
  padding: 5px 7px;
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.icon-button:hover {
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  transform: scale(1.05);
}

.table-node {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: grab;
  transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.table-node:hover {
  transform: translateY(-1px);
  border-color: rgba(148, 163, 184, 0.95);
}

.table-node.selected {
  border-color: var(--accent);
  background: rgba(22, 163, 74, 0.16);
}

.table-number {
  font-size: 18px;
  font-weight: 600;
  color: #f9fafb;
}

.table-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.table-res-count {
  margin-top: 3px;
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(34, 197, 94, 0.6);
  color: #bbf7d0;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.15), transparent 55%),
    rgba(15, 23, 42, 0.86);
  backdrop-filter: blur(10px);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  border-radius: 20px;
  background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.18), transparent 60%),
    linear-gradient(to bottom right, rgba(15, 23, 42, 0.99), rgba(15, 23, 42, 0.97));
  border: 1px solid rgba(34, 197, 94, 0.55);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.95);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  border-bottom: 1px solid rgba(55, 65, 81, 0.8);
}

.modal-header h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e5e7eb;
}

.modal-body {
  padding: 12px 15px 14px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 9px;
}

.form-field label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.form-field input {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(15, 23, 42, 0.95);
  color: var(--text);
  padding: 7px 11px;
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.form-field input:focus {
  border-color: rgba(34, 197, 94, 0.85);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.85);
  background: rgba(15, 23, 42, 0.98);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.details-content h3 {
  margin: 0 0 6px;
  font-size: 14px;
  color: #e5e7eb;
}

.details-content .table-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.reservation-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.reservation-item {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.98));
  padding: 7px 8px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.reservation-item-day {
  border-color: rgba(56, 189, 248, 0.6);
}

.reservation-main {
  display: flex;
  flex-direction: column;
}

.reservation-main strong {
  color: #e5e7eb;
}

.reservation-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.reservation-header-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.reservation-name {
  font-weight: 600;
  color: #e5e7eb;
}

.reservation-table-label {
  font-size: 11px;
  color: #a5b4fc;
}

.reservation-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.res-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  border: 1px solid rgba(34, 197, 94, 0.7);
  color: #bbf7d0;
  background: rgba(22, 163, 74, 0.12);
}

.btn-small {
  padding: 3px 8px;
  font-size: 10px;
}

.time-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #fed7aa;
  background: rgba(248, 171, 120, 0.18);
  border: 1px solid rgba(249, 115, 22, 0.8);
}

.btn-danger {
  background: var(--danger-soft);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.7);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.2);
}

.empty-state {
  margin-top: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px dashed rgba(148, 163, 184, 0.65);
  font-size: 11px;
  color: var(--text-muted);
}

@media (max-width: 960px) {
  .app-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .details-panel {
    order: -1;
  }
}

@media (max-width: 640px) {
  .app-header {
    padding-inline: 16px;
  }

  .app-main {
    padding-inline: 14px;
  }

  .brand-text {
    font-size: 16px;
  }
}
