:root {
  --splash-duration: 4s;
  --bg: #cfe0f0;
  --panel: rgba(255, 255, 255, 0.82);
  --ink: #091e3a;
  --muted: #446b83;
  --brand: #0089e3;
  --brand-dark: #003d8e;
  --ok: #1fb24d;
  --warn: #ff7f22;
  --border: rgba(125, 160, 187, 0.55);
  --shadow: 0 16px 48px rgba(8, 30, 52, 0.2);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Manrope", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 8% 10%, rgba(0, 132, 199, 0.22), transparent 35%),
    radial-gradient(circle at 88% 80%, rgba(10, 63, 120, 0.2), transparent 38%),
    linear-gradient(145deg, #ebf4fa 0%, #d8e6f1 52%, #f4fbff 100%);
  position: relative;
  opacity: 0;
  transition: opacity 0.2s ease-in;
}

body.loaded {
  opacity: 1;
}

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    radial-gradient(circle at 18% 20%, rgba(0, 137, 227, 0.24), transparent 36%),
    radial-gradient(circle at 82% 82%, rgba(0, 61, 142, 0.24), transparent 36%),
    linear-gradient(145deg, #edf6fc 0%, #d5e5f2 55%, #eff7fc 100%);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.splash-content {
  width: min(540px, 92vw);
  border-radius: 22px;
  border: 1px solid rgba(130, 164, 191, 0.42);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 24px 64px rgba(8, 30, 52, 0.2);
  backdrop-filter: blur(8px);
  text-align: center;
  padding: 2rem 1.4rem 1.6rem;
}

.splash-mixer-wrap {
  width: min(520px, 92vw);
  margin: 0 auto 0.2rem;
}

.splash-mixer-wrap img {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(10, 46, 86, 0.28));
}

.splash-logo-wrap {
  width: min(250px, 62vw);
  height: 76px;
  margin: 0 auto 0.75rem;
  display: grid;
  place-items: center;
}

.splash-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(10, 46, 86, 0.35));
}

#splashLogoPlaceholder {
  color: #0b3456;
  font-size: clamp(1.3rem, 4.2vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow: 0 4px 10px rgba(10, 46, 86, 0.35);
}

.splash-content h2 {
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: clamp(1.25rem, 3.8vw, 1.9rem);
  margin: 0;
}

.splash-content p {
  margin-top: 0.45rem;
  color: #446b83;
  font-size: 0.96rem;
}

.splash-percent {
  margin-top: 0.35rem;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-weight: 700;
  color: #0f3656;
  font-size: 0.95rem;
}

.splash-progress {
  height: 10px;
  width: min(420px, 82vw);
  margin: 1rem auto 0;
  border-radius: 999px;
  background: rgba(180, 207, 227, 0.5);
  overflow: hidden;
}

.splash-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #00a0e6 0%, #0062bf 100%);
  animation: splashLoad var(--splash-duration) linear forwards;
}

.splash-branding {
  margin-top: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: -0.08rem;
  flex-wrap: nowrap;
  width: fit-content;
  margin-left: 0;
  margin-right: auto;
}

.splash-branding img {
  width: min(300px, 72vw);
  height: 92px;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(10, 46, 86, 0.25));
}

.splash-branding small {
  color: #365978;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  margin-left: -0.05rem;
}

body.splash-done .splash-screen {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@keyframes splashLoad {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 28vw;
  height: 28vw;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.35;
  pointer-events: none;
  z-index: -1;
  animation: floatBlob 14s ease-in-out infinite;
}

body::before {
  left: -6vw;
  top: -10vw;
  background: #7cc8ec;
}

body::after {
  right: -6vw;
  bottom: -10vw;
  background: #8db4e8;
  animation-delay: -7s;
}

@keyframes floatBlob {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, -18px, 0) scale(1.09);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
}

h1,
h2,
p {
  margin: 0;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 1.1rem;
  border-bottom: 1px solid rgba(16, 35, 54, 0.08);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  box-shadow: 0 1px 12px rgba(8, 30, 52, 0.07);
  position: sticky;
  top: 0;
  z-index: 12;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.header-widget {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
  background: #f4f8fc;
  border: 1px solid rgba(130, 164, 191, 0.35);
  font-size: 0.8rem;
}

.header-clock {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0b3456;
}

.header-weather {
  font-size: 0.75rem;
  color: #5a7a93;
}

.db-status-widget {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
  background: #f4f8fc;
  border: 1px solid rgba(130, 164, 191, 0.35);
  font-size: 0.78rem;
  color: #5a7a93;
  white-space: nowrap;
}
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
  background: #eaf4ff;
  border: 1px solid rgba(62, 126, 177, 0.35);
  color: #13466d;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.is-hidden {
  display: none !important;
}

.db-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.db-status-dot[data-status="connected"] {
  background-color: #22c55e;
}

.db-status-dot[data-status="disconnected"] {
  background-color: #ef4444;
}

.db-status-dot[data-status="checking"] {
  background-color: #f59e0b;
}

.planner-controls {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.planner-controls input {
  border: 1px solid rgba(119, 154, 181, 0.45);
  border-radius: 8px;
  padding: 0.3rem 0.42rem;
  font: inherit;
  font-size: 0.82rem;
  background: #f4f8fc;
  color: #0b3456;
}

.plan-info-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.6rem 1rem 0;
}

.plan-lock-info {
  display: inline-block;
  font-size: 0.8rem;
  color: #7a3a00;
  background: #fff5e8;
  border: 1px solid #f2cf9f;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
}

.logo-wrap {
  width: 210px;
  height: 76px;
  display: grid;
  place-items: center;
  overflow: visible;
}

.logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#logoPlaceholder,
.subline {
  color: var(--muted);
}

.title-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.selected-plan-date {
  display: inline;
  font-size: 1.34rem;
  font-weight: 800;
  color: #0f3656;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 0.32rem 0.72rem;
  background: linear-gradient(125deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn.secondary {
  background: #f4f8fc;
  color: #1a4a6b;
  border: 1px solid rgba(130, 164, 191, 0.45);
  font-weight: 600;
}

.layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0.8rem;
  padding: 0 1rem 1rem;
}

.column {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 0.7rem;
}

.pool-column {
  display: grid;
  grid-template-rows: 1fr 1fr 1fr;
  gap: 0.7rem;
  height: calc(100vh - 165px);
  max-height: calc(100vh - 165px);
}

.pool-column > div {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(145, 173, 194, 0.48);
  border-radius: 14px;
  padding: 0.55rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.pool-column > div > .column-head {
  flex-shrink: 0;
}

.pool-column > div > .dropzone,
.pool-column > div > #carriersContainer {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.compact-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.pool-column .column-head {
  display: block;
}

.pool-column .column-head > div {
  display: grid;
  gap: 0.15rem;
}

.column-head h2 {
  font-size: 0.97rem;
}

.pool-note {
  color: var(--muted);
  font-size: 0.8rem;
}

.pool-count {
  color: #0089e3;
  font-weight: 700;
  font-size: 0.85rem;
  margin-left: 0.3rem;
}

.chat-headline-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

@keyframes chatShake {
  0%   { transform: rotate(0deg); }
  15%  { transform: rotate(-8deg); }
  30%  { transform: rotate(8deg); }
  45%  { transform: rotate(-6deg); }
  60%  { transform: rotate(6deg); }
  75%  { transform: rotate(-3deg); }
  90%  { transform: rotate(3deg); }
  100% { transform: rotate(0deg); }
}

@keyframes pulseDot {
  0%   { box-shadow: 0 0 0 0 rgba(255, 60, 60, 0.75); }
  70%  { box-shadow: 0 0 0 8px rgba(255, 60, 60, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 60, 60, 0); }
}

.chat-toggle-btn {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 25;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 58px;
  padding: 0.8rem 1.2rem;
  border-radius: 16px;
  font-size: 0.98rem;
  font-weight: 800;
  background: linear-gradient(135deg, #007fce 0%, #004f96 100%);
  box-shadow: 0 20px 46px rgba(0, 71, 129, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.chat-toggle-btn.has-unread {
  animation: chatShake 0.7s ease;
}

.chat-toggle-btn::after {
  content: "";
  position: absolute;
  top: -5px;
  right: -5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff3c3c;
  border: 2px solid #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.chat-toggle-btn.has-unread::after {
  opacity: 1;
  animation: pulseDot 1.4s ease-in-out infinite;
}

.chat-popup {
  position: fixed;
  right: 1rem;
  bottom: 4.5rem;
  z-index: 24;
  width: min(420px, calc(100vw - 2rem));
  height: min(620px, calc(100vh - 7rem));
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.7rem;
  padding: 1rem;
  border: 1px solid rgba(126, 168, 199, 0.38);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(0, 162, 230, 0.18), transparent 34%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.98) 0%, rgba(236, 246, 252, 0.98) 100%);
  backdrop-filter: blur(20px);
  box-shadow: 0 30px 70px rgba(8, 30, 52, 0.28);
  overflow: hidden;
}

.chat-popup.is-hidden {
  display: none;
}

.chat-popup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.15rem 0.1rem 0;
}

.chat-popup-header h2 {
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.chat-hero-copy {
  margin: 0.28rem 0 0.22rem;
  font-size: 0.83rem;
  line-height: 1.4;
  color: #3f6883;
}

.chat-close-btn {
  padding-inline: 0.62rem;
}

.chat-new-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  padding: 0.22rem 0.56rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff3c3c 0%, #c0000 100%);
  background: linear-gradient(135deg, #ff5e5e 0%, #d40000 100%);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(255, 60, 60, 0.45);
  letter-spacing: 0.01em;
}

.chat-shell {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.6rem;
  min-height: 0;
}

.chat-load-older {
  justify-self: start;
  padding: 0.34rem 0.7rem;
  font-size: 0.76rem;
  border-radius: 999px;
}

.chat-messages {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.65rem;
  padding: 0.55rem;
  border: 1px solid rgba(145, 173, 194, 0.42);
  border-radius: 18px;
  background:
    radial-gradient(circle at top, rgba(0, 149, 217, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(249, 253, 255, 0.98) 0%, rgba(232, 243, 250, 0.95) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.chat-entry,
.chat-empty {
  border-radius: 18px;
  padding: 0.7rem 0.8rem;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(180, 205, 224, 0.44);
  box-shadow: 0 12px 24px rgba(15, 54, 86, 0.08);
  position: relative;
}

.chat-entry::before {
  content: "";
  position: absolute;
  left: 0.7rem;
  top: -4px;
  width: 42px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(0, 137, 227, 0.55), rgba(0, 61, 142, 0.18));
}

.chat-entry-own {
  background: linear-gradient(135deg, rgba(0, 137, 227, 0.12) 0%, rgba(255, 255, 255, 0.96) 100%);
  border-color: rgba(68, 149, 209, 0.42);
}

.chat-entry-own::before {
  left: auto;
  right: 0.7rem;
  background: linear-gradient(90deg, rgba(0, 61, 142, 0.18), rgba(0, 137, 227, 0.55));
}

.chat-empty {
  color: var(--muted);
  font-size: 0.84rem;
  text-align: center;
  border-style: dashed;
}

.chat-entry-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.28rem;
}

.chat-entry-author {
  font-size: 0.83rem;
  font-weight: 800;
  color: #0f3656;
}

.chat-entry-time {
  font-size: 0.71rem;
  color: #67839a;
  white-space: nowrap;
}

.chat-entry-text {
  font-size: 0.84rem;
  line-height: 1.5;
  color: #14324e;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-form {
  display: grid;
  gap: 0.2rem;
  padding: 0.35rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(242, 249, 253, 0.95) 100%);
  border: 1px solid rgba(165, 192, 212, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.chat-form input,
.chat-form textarea {
  width: 100%;
  border: 1px solid rgba(119, 154, 181, 0.34);
  border-radius: 12px;
  padding: 0.44rem 0.52rem;
  font: inherit;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.96);
  color: #0b3456;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.chat-form input:focus,
.chat-form textarea:focus {
  outline: none;
  border-color: rgba(0, 137, 227, 0.55);
  box-shadow: 0 0 0 4px rgba(0, 137, 227, 0.12);
}

.chat-form input {
  min-height: 28px;
  height: 28px;
}

.chat-form textarea {
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  resize: none;
}

.chat-emoji-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
}

.chat-emoji-btn {
  border: 1px solid rgba(157, 187, 209, 0.42);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(239, 247, 252, 0.95) 100%);
  border-radius: 10px;
  min-width: 34px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  padding: 0;
}

.chat-emoji-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 137, 227, 0.45);
  box-shadow: 0 8px 16px rgba(15, 54, 86, 0.1);
}

.chat-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
}

.chat-status {
  font-size: 0.75rem;
  color: #52738c;
}

.chat-status.has-unread {
  color: #8b3b00;
  font-weight: 700;
}

#carriersContainer {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.plants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.55rem;
}

.plant-card {
  border: 1px solid rgba(110, 160, 190, 0.55);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  overflow: hidden;
}

.plant-card.plant-drop-target {
  border-color: #1e88e5;
  box-shadow: 0 0 0 2px rgba(30, 136, 229, 0.22);
}

.plant-card.plant-is-dragging {
  opacity: 0.55;
}

.plant-head {
  padding: 0.4rem 0.55rem;
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(120deg, #f0f8ff 0%, #e8f3fb 100%);
  border-bottom: 1px solid rgba(132, 167, 192, 0.48);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plant-drag-handle {
  cursor: grab;
}

.plant-drag-handle:active {
  cursor: grabbing;
}

.dropzone {
  min-height: 74px;
  border: 2px dashed #8caec7;
  border-radius: 12px;
  padding: 0.3rem;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.5rem;
  background: linear-gradient(160deg, rgba(243, 250, 255, 0.72) 0%, rgba(235, 245, 252, 0.62) 100%);
}

.dropzone.is-over {
  border-color: var(--brand);
  background: linear-gradient(160deg, #e0f4ff 0%, #d8ecff 100%);
}

.pool-column .dropzone {
  min-height: 200px;
}

.pool-footer {
  flex-basis: 100%;
  order: 999;
  padding: 0.25rem 0.35rem;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}

.vehicle-card,
.carrier-card {
  width: 88px;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(110, 150, 180, 0.58);
  border-top: 5px solid var(--card-border-color, var(--ok));
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.96);
  padding: 0.2rem;
  display: grid;
  grid-template-rows: 46px auto;
  gap: 0.18rem;
  position: relative;
}

.carrier-card {
  border-top-color: var(--card-border-color, #eed651);
  position: relative;
}

.vehicle-card.fremd {
  border-top-color: var(--card-border-color, var(--warn));
  background: #fff7ed;
}

.vehicle-card.vertrag {
  border-top-color: var(--card-border-color, #1e88e5);
  background: #f0f7ff;
}

.vehicle-card.locked,
.carrier-card.locked {
  opacity: 0.86;
  cursor: default;
}

.vehicle-card.leihgabe {
  border-top-color: #d32f2f !important;
  background: #fff0f0 !important;
  cursor: not-allowed;
  opacity: 0.9;
}

.vehicle-card.leihgabe::after {
  content: "Leihgabe";
  position: absolute;
  bottom: 2px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.55rem;
  font-weight: 700;
  color: #d32f2f;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.carrier-delete-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #d32f2f;
  background: #f44336;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  z-index: 2;
}

.vehicle-image-wrap {
  width: 100%;
  height: 46px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #bbd1e1;
  background: linear-gradient(160deg, #d8eaf6 0%, #f8fcff 100%);
}

.vehicle-image,
.carrier-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carrier-image {
  object-fit: contain;
  padding: 0.2rem;
}

.vehicle-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 0.62rem;
  color: #4a5f70;
  text-align: center;
}

.vehicle-content {
  display: grid;
  gap: 0.1rem;
  align-content: start;
  text-align: center;
}

.vehicle-name {
  font-size: 0.64rem;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.carrier-name {
  font-size: 0.78rem;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: normal;
}

.carrier-plate {
  margin: 0;
  font-size: 0.6rem;
  font-weight: 700;
  color: #000;
}

.carrier-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.62rem;
}

.vehicle-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.62rem;
}

.start-time-badge {
  display: inline-block;
  padding: 0.04rem 0.28rem;
  border-radius: 999px;
  background: #fff2cc;
  color: #b54708;
  border: 1px solid #f4b400;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.vehicle-plate {
  margin: 0;
  font-size: 0.6rem;
  font-weight: 700;
  color: #000;
}

.notes-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  margin-top: 0.08rem;
  flex-shrink: 0;
}

.notes-indicator.has-notes {
  background: #007db8;
}

.notes-indicator.has-appointment {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  z-index: 2;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.notes-indicator.has-appointment::after {
  content: "!";
}

/* Zeilenansicht */
body.layout-rows .plants-grid {
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

.plant-row-card {
  border: 1px solid rgba(110, 160, 190, 0.55);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  overflow: hidden;
  display: grid;
  grid-template-columns: 210px 1fr;
}

.plant-row-card.plant-drop-target {
  border-color: #1e88e5;
  box-shadow: 0 0 0 2px rgba(30, 136, 229, 0.22);
}

.plant-row-card.plant-is-dragging {
  opacity: 0.55;
}

.plant-row-head {
  padding: 0.45rem 0.55rem;
  border-right: 1px solid rgba(132, 167, 192, 0.48);
  background: linear-gradient(120deg, #f0f8ff 0%, #e8f3fb 100%);
  display: grid;
  align-content: center;
  gap: 0.1rem;
}

.plant-row-name {
  font-size: 0.92rem;
  font-weight: 700;
}

.plant-row-count {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--brand);
}

.row-dropzone {
  min-height: 0;
  border: none;
  border-radius: 0;
  background: linear-gradient(160deg, rgba(243, 250, 255, 0.72) 0%, rgba(235, 245, 252, 0.62) 100%);
  padding: 0.2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.22rem;
  overflow-x: hidden;
  overflow-y: visible;
}

.row-dropzone .empty-hint {
  min-width: 150px;
  align-self: center;
}

.vehicle-card--row {
  width: max-content;
  min-width: 0;
  min-height: 0;
  aspect-ratio: auto;
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 0.2rem;
  padding: 0.14rem;
}

.vehicle-card--row .vehicle-image-wrap {
  width: 90px;
  height: 58px;
}

.vehicle-card--row .vehicle-content {
  text-align: left;
  display: grid;
  align-content: center;
  gap: 0.08rem;
  overflow: hidden;
}

.vehicle-card--row .vehicle-name {
  font-size: 0.82rem;
  font-weight: 600;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vehicle-card--row .vehicle-plate {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vehicle-card--row .vehicle-meta {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vehicle-card--row .notes-indicator {
  display: none;
}

.vehicle-card--row .notes-indicator.has-appointment {
  display: flex;
}

/* Fremdfahrzeuge – Zeilenansicht */
.carrier-card--row {
  width: max-content;
  min-width: 0;
  min-height: 0;
  aspect-ratio: auto;
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 0.2rem;
  padding: 0.14rem;
  position: relative;
}

.carrier-card--row .vehicle-image-wrap {
  width: 90px;
  height: 58px;
}

.carrier-card--row .vehicle-content {
  text-align: left;
  display: grid;
  align-content: center;
  gap: 0.08rem;
  overflow: hidden;
}

.carrier-card--row .carrier-plate {
  margin: 0;
  font-size: 0.68rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.carrier-card--row .carrier-meta {
  margin: 0;
  font-size: 0.66rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.carrier-card--row .carrier-name {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

dialog {
  border: none;
  padding: 0;
  border-radius: 12px;
  box-shadow: var(--shadow);
  width: min(420px, 92vw);
}

dialog::backdrop {
  background: rgba(8, 19, 30, 0.45);
}
.access-dialog {
  width: min(420px, calc(100vw - 2rem));
  border: 1px solid rgba(126, 168, 199, 0.4);
}

.access-form {
  gap: 0.75rem;
}

.access-error {
  margin: 0;
  color: #b42318;
  font-size: 0.85rem;
  font-weight: 700;
}

.dialog-form {
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
  background: #fff;
}

.notes-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.notes-dialog-header h3 {
  margin: 0;
}

.leihgabe-toggle-btn {
  background: #fff5f5;
  border-color: #f1b3b3;
  color: #8f1f1f;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
}

.leihgabe-toggle-btn.is-active {
  background: #d32f2f;
  border-color: #d32f2f;
  color: #fff;
}

.alert-form {
  display: grid;
  gap: 0.7rem;
  padding: 1.5rem;
  background: #fff;
  min-width: 300px;
  text-align: center;
}

.dialog-form label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.9rem;
}

.time-fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.time-fields-row label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.9rem;
}

.dialog-form input,
.dialog-form textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem;
  font: inherit;
}

menu {
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
}

.tomorrow-plan-dialog {
  width: min(1200px, 97vw);
  max-width: 1200px;
  border-radius: 14px;
}

.tomorrow-plan-shell {
  background: #fff;
  padding: 0.9rem;
  display: grid;
  gap: 0.8rem;
}

.tomorrow-plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.tomorrow-plan-head h3 {
  margin: 0;
}

.tomorrow-plan-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.tomorrow-plan-page-info {
  font-size: 0.86rem;
  color: #234c6b;
  font-weight: 700;
  padding: 0 0.2rem;
}

.tomorrow-plan-preview {
  border: 1px solid #c4d3e0;
  border-radius: 10px;
  padding: 0.75rem;
  max-height: min(72vh, 860px);
  overflow: auto;
  background: #f6f9fc;
}

.tp-sheet {
  width: 100%;
  background: #fff;
  border: 1px solid #ccd8e4;
  border-radius: 8px;
  padding: 0.6rem;
  box-shadow: 0 4px 14px rgba(11, 52, 86, 0.08);
}

.tp-head {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 0.7rem;
}

.tp-logo-wrap {
  height: 74px;
  display: grid;
  place-items: center;
}

.tp-logo-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.tp-logo-fallback {
  font-size: 1.05rem;
  font-weight: 800;
  color: #1d4566;
}

.tp-meta h2 {
  margin: 0 0 0.2rem;
  font-size: 1.35rem;
}

.tp-meta p {
  margin: 0.1rem 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.tp-meta-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.tp-meta-date {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
}

.tp-meta-plant {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.tp-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.tp-table th,
.tp-table td {
  border: 1px solid #9ab0c2;
  padding: 0.3rem;
  font-size: 0.88rem;
  vertical-align: middle;
}

.tp-table th {
  background: #e9f0f7;
  font-weight: 700;
  text-align: left;
}

.tp-col-no {
  width: 34px;
  text-align: center;
}

.tp-col-start {
  width: 116px;
}

.tp-col-capacity {
  width: 86px;
}

.tp-col-note {
  width: 330px;
}

.tp-input {
  width: 100%;
  border: 1px solid #bdd0df;
  border-radius: 6px;
  padding: 0.28rem 0.36rem;
  font: inherit;
  background: #fff;
  color: #112f49;
}

@media (max-width: 900px) {
  .tp-head {
    grid-template-columns: 1fr;
  }

  .tomorrow-plan-dialog {
    width: 98vw;
  }
}

.empty-hint {
  color: var(--muted);
  font-size: 0.75rem;
  border: 1px dashed #94b5cc;
  border-radius: 8px;
  padding: 0.35rem;
  background: rgba(246, 251, 255, 0.85);
}

@media (max-width: 1160px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .pool-column {
    height: auto;
    max-height: none;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .pool-column .dropzone {
    min-height: 94px;
  }

  .chat-popup {
    width: min(400px, calc(100vw - 1.5rem));
    right: 0.75rem;
    bottom: 4.25rem;
  }
}

@media (max-width: 760px) {
  .app-header {
    padding: 0.7rem 0.75rem;
  }

  .logo-wrap {
    width: 146px;
    height: 58px;
  }

  .title-row {
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .selected-plan-date {
    font-size: 1.08rem;
  }

  .layout {
    padding: 0 0.75rem 0.75rem;
  }

  .chat-toggle-btn {
    right: 0.75rem;
    bottom: 0.75rem;
  }

  .chat-popup {
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
    bottom: 4.25rem;
    height: min(70vh, calc(100vh - 5.5rem));
  }

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

  .chat-actions .btn {
    width: 100%;
  }

  .plant-row-card {
    grid-template-columns: 1fr;
  }

  .plant-row-head {
    border-right: none;
    border-bottom: 1px solid rgba(132, 167, 192, 0.48);
  }

  .vehicle-card--row {
    width: max-content;
    min-width: 0;
    grid-template-columns: 70px 1fr;
    gap: 0.16rem;
    padding: 0.1rem;
  }

  .vehicle-card--row .vehicle-image-wrap {
    width: 70px;
    height: 46px;
  }

  .vehicle-card--row .vehicle-content {
    gap: 0.05rem;
  }

  .vehicle-card--row .vehicle-name {
    font-size: 0.66rem;
  }

  .vehicle-card--row .vehicle-plate {
    font-size: 0.62rem;
  }

  .vehicle-card--row .vehicle-meta {
    font-size: 0.6rem;
  }

  .carrier-card--row {
    width: max-content;
    min-width: 0;
    grid-template-columns: 70px 1fr;
    gap: 0.16rem;
    padding: 0.1rem;
  }

  .carrier-card--row .vehicle-image-wrap {
    width: 70px;
    height: 46px;
  }

  .carrier-card--row .carrier-name {
    font-size: 0.66rem;
  }
}
