/* Droneshine Hub — Brand Styles */
@font-face { font-family: 'Nasalization'; src: url('/assets/nasalization.otf') format('opentype'); font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/assets/inter-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/assets/inter-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/assets/inter-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --green: #004225;
  --evergreen: #002518;
  --offwhite: #F7F7F2;
  --lightgreen: #B5F78A;
  --accent: #26C257;
  --blue: #8FC2F5;
  --lightblue: #DBF0FF;
  --panel: rgba(0, 37, 24, .86);
  --panel-border: rgba(181, 247, 138, .18);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--evergreen);
  color: var(--offwhite);
  overflow: hidden;
}
.display { font-family: 'Nasalization', 'Inter', sans-serif; letter-spacing: .04em; }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ---------- Login ---------- */
.login-wrap {
  height: 100%; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1200px 700px at 70% 20%, rgba(38, 194, 87, .14), transparent 60%),
    radial-gradient(900px 600px at 20% 85%, rgba(143, 194, 245, .10), transparent 60%),
    var(--evergreen);
}
.login-card {
  width: 360px; padding: 42px 38px;
  background: rgba(0, 66, 37, .45);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  backdrop-filter: blur(8px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
  text-align: center;
}
.login-card img { height: 30px; margin-bottom: 10px; }
.login-card h1 { font-size: 15px; font-weight: 400; color: var(--lightgreen); margin-bottom: 30px; letter-spacing: .18em; text-transform: uppercase; }
.field { text-align: left; margin-bottom: 14px; }
.field label { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: rgba(247, 247, 242, .55); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 11px 13px; border-radius: 10px;
  border: 1px solid rgba(247, 247, 242, .16);
  background: rgba(0, 0, 0, .25); color: var(--offwhite); font-size: 15px; outline: none;
}
.field input:focus { border-color: var(--accent); }
.btn {
  display: inline-block; width: 100%; padding: 12px; border: none; border-radius: 10px;
  background: var(--accent); color: #00160d; font-weight: 700; font-size: 15px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(38, 194, 87, .35); }
.btn.secondary { background: transparent; color: var(--lightgreen); border: 1px solid var(--panel-border); font-weight: 600; }
.err { color: #ff9d9d; font-size: 13px; margin-top: 12px; min-height: 18px; }

/* ---------- App-Layout ---------- */
#map { position: fixed; inset: 0; background: var(--evergreen); }
#map .leaflet-container { background: var(--evergreen); }

.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 58px; z-index: 1000;
  display: flex; align-items: center; gap: 18px; padding: 0 20px;
  background: linear-gradient(180deg, rgba(0, 22, 13, .92), rgba(0, 22, 13, .55) 75%, transparent);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.topbar img { height: 22px; }
.topbar .spacer { flex: 1; }
.navlink {
  color: rgba(247, 247, 242, .75); text-decoration: none; font-size: 13px; font-weight: 600;
  padding: 8px 12px; border-radius: 8px;
}
.navlink:hover, .navlink.active { color: var(--lightgreen); background: rgba(181, 247, 138, .08); }
.userchip {
  display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--offwhite);
  background: rgba(0, 66, 37, .6); border: 1px solid var(--panel-border);
  padding: 6px 12px; border-radius: 999px;
}
.userchip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }

/* ---------- Filter-Chips ---------- */
.chips {
  position: fixed; top: 68px; left: 16px; z-index: 900;
  display: flex; flex-wrap: wrap; gap: 7px; max-width: 620px;
}
.chip {
  border: 1px solid var(--panel-border); border-radius: 999px; padding: 6px 13px;
  background: var(--panel); color: rgba(247, 247, 242, .8); font-size: 12px; font-weight: 600;
  display: flex; align-items: center; gap: 7px;
  backdrop-filter: blur(6px);
}
.chip .cdot { width: 9px; height: 9px; border-radius: 50%; }
.chip.off { opacity: .38; }
.chip:hover { border-color: var(--accent); }

.searchbox {
  position: fixed; top: 68px; right: 396px; z-index: 900; width: 240px;
}
.searchbox input {
  width: 100%; padding: 9px 14px; border-radius: 999px; font-size: 13px;
  border: 1px solid var(--panel-border); background: var(--panel); color: var(--offwhite);
  outline: none; backdrop-filter: blur(6px);
}
.searchbox input:focus { border-color: var(--accent); }

/* ---------- Seitenpanel (Heute) ---------- */
.sidepanel {
  position: fixed; top: 68px; right: 16px; bottom: 16px; width: 364px; z-index: 950;
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 16px;
  backdrop-filter: blur(10px);
  display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
.sidepanel.hidden { transform: translateX(400px); }
.panel-toggle {
  position: fixed; top: 74px; right: 16px; z-index: 951;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent); border: none; color: #00160d; font-size: 17px; font-weight: 700;
  display: none;
}
.sidepanel-head { padding: 18px 20px 12px; }
.sidepanel-head .day { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--lightgreen); }
.sidepanel-head h2 { font-size: 21px; margin-top: 3px; font-weight: 700; }
.sidepanel-body { flex: 1; overflow-y: auto; padding: 0 20px 20px; }
.sidepanel-body::-webkit-scrollbar { width: 6px; }
.sidepanel-body::-webkit-scrollbar-thumb { background: rgba(181, 247, 138, .2); border-radius: 3px; }

.sect { margin-top: 16px; }
.sect h3 {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(247, 247, 242, .5); margin-bottom: 9px;
  display: flex; align-items: center; justify-content: space-between;
}
.sect h3 .mini { font-size: 10px; letter-spacing: 0; text-transform: none; color: var(--blue); cursor: pointer; }

.event {
  display: flex; gap: 12px; padding: 9px 11px; border-radius: 10px; margin-bottom: 6px;
  background: rgba(0, 66, 37, .5); border: 1px solid rgba(143, 194, 245, .12);
}
.event .time { font-size: 12px; font-weight: 700; color: var(--blue); white-space: nowrap; min-width: 44px; }
.event .what { font-size: 13px; }
.event .where { font-size: 11px; color: rgba(247, 247, 242, .5); margin-top: 2px; }

.todo {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 11px; border-radius: 10px; margin-bottom: 5px;
  background: rgba(0, 66, 37, .5); border: 1px solid rgba(181, 247, 138, .1);
}
.todo input[type=checkbox] { margin-top: 2px; accent-color: var(--accent); width: 15px; height: 15px; }
.todo .t { font-size: 13px; flex: 1; }
.todo .t .src { font-size: 10px; color: rgba(247, 247, 242, .45); display: block; margin-top: 1px; }
.todo.done .t { text-decoration: line-through; opacity: .45; }
.todo .del { background: none; border: none; color: rgba(247, 247, 242, .3); font-size: 14px; }
.todo .del:hover { color: #ff9d9d; }

.addrow { display: flex; gap: 7px; margin-top: 8px; }
.addrow input {
  flex: 1; padding: 9px 12px; border-radius: 9px; font-size: 13px;
  border: 1px solid rgba(247, 247, 242, .14); background: rgba(0, 0, 0, .25); color: var(--offwhite); outline: none;
}
.addrow input:focus { border-color: var(--accent); }
.addrow button {
  width: 38px; border-radius: 9px; border: none; background: var(--accent); color: #00160d; font-size: 19px; font-weight: 700;
}
.hint { font-size: 12px; color: rgba(247, 247, 242, .5); padding: 10px 2px; line-height: 1.5; }
.hint a { color: var(--blue); }
.connect-btn {
  width: 100%; padding: 10px; border-radius: 10px; border: 1px solid var(--panel-border);
  background: rgba(143, 194, 245, .1); color: var(--lightblue); font-weight: 600; font-size: 13px;
}
.connect-btn:hover { background: rgba(143, 194, 245, .2); }

/* ---------- Topbar-Trenner vor den Tool-Links ---------- */
.navsep {
  width: 1px; height: 20px; background: rgba(247, 247, 242, .18); margin: 0 4px;
  align-self: center;
}

/* ---------- Kategorie-Liste ---------- */
.listpanel {
  position: fixed; top: 118px; left: 16px; bottom: 16px; width: 384px; z-index: 940;
  background: rgba(0, 25, 16, .96); border: 1px solid var(--panel-border); border-radius: 16px;
  backdrop-filter: blur(10px);
  display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  transform: translateX(-380px); opacity: 0; pointer-events: none;
  transition: all .35s cubic-bezier(.2, .8, .2, 1);
}
.listpanel.show { transform: none; opacity: 1; pointer-events: auto; }
.listpanel-head { padding: 16px 18px 10px; position: relative; }
.listpanel-head .close { position: absolute; top: 12px; right: 14px; background: none; border: none; color: rgba(247, 247, 242, .5); font-size: 17px; }
.listpanel-head .kat { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; }
.listpanel-head h2 { font-size: 19px; margin-top: 4px; }
.listpanel-head .lphint { font-size: 11px; color: rgba(247, 247, 242, .5); margin-top: 3px; }
.listpanel-body { flex: 1; overflow-y: auto; padding: 4px 10px 14px; }
.listpanel-body::-webkit-scrollbar { width: 6px; }
.listpanel-body::-webkit-scrollbar-thumb { background: rgba(181, 247, 138, .2); border-radius: 3px; }
.lpitem {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 11px 12px; border-radius: 10px;
  background: transparent; border: none; border-bottom: 1px solid rgba(247, 247, 242, .07);
  color: var(--offwhite);
}
.lpitem:hover { background: rgba(38, 194, 87, .1); }
.lpitem .lpmain { flex: 1; min-width: 0; }
.lpitem .lpfirma {
  display: block; font-size: 14px; font-weight: 700; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lpitem .lpsub {
  display: block; font-size: 12px; color: rgba(247, 247, 242, .6); line-height: 1.35; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lpitem .lpkm {
  font-size: 12px; font-weight: 700; color: var(--lightgreen);
  white-space: nowrap; min-width: 56px; text-align: right; flex-shrink: 0;
}

/* ---------- Lead-Karte ---------- */
.leadcard {
  position: fixed; left: 16px; bottom: 16px; z-index: 960; width: 360px;
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 16px;
  backdrop-filter: blur(10px); padding: 18px 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  transform: translateY(20px); opacity: 0; pointer-events: none;
  transition: all .3s cubic-bezier(.2, .8, .2, 1);
}
.leadcard.show { transform: none; opacity: 1; pointer-events: auto; }
.leadcard .close { position: absolute; top: 10px; right: 14px; background: none; border: none; color: rgba(247, 247, 242, .5); font-size: 18px; }
.leadcard .kat { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; }
.leadcard h3 { font-size: 18px; margin: 5px 0 2px; }
.leadcard .who { font-size: 13px; color: rgba(247, 247, 242, .75); }
.leadcard .meta { font-size: 12px; color: rgba(247, 247, 242, .55); margin-top: 8px; line-height: 1.55; max-height: 130px; overflow-y: auto; }
.leadcard .meta b { color: var(--lightgreen); font-weight: 600; }
.leadcard .actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.leadcard .actions a {
  font-size: 12px; font-weight: 600; color: var(--lightblue); text-decoration: none;
  border: 1px solid rgba(143, 194, 245, .25); padding: 6px 11px; border-radius: 999px;
}
.leadcard .actions a:hover { background: rgba(143, 194, 245, .12); }

/* ---------- Lead-Status (Mini-CRM) ---------- */
.statusrow { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.stpill {
  border: 1px solid rgba(247, 247, 242, .18); background: rgba(0, 0, 0, .2);
  color: rgba(247, 247, 242, .65); font-size: 11px; font-weight: 700;
  padding: 5px 11px; border-radius: 999px; cursor: pointer;
}
.stpill.on { color: #00160d; border-color: transparent; }
.noterow { display: flex; gap: 7px; margin-top: 10px; }
.noterow textarea {
  flex: 1; padding: 8px 11px; border-radius: 9px; font-size: 12px; resize: none;
  border: 1px solid rgba(247, 247, 242, .14); background: rgba(0, 0, 0, .25); color: var(--offwhite); outline: none;
  font-family: inherit;
}
.noterow textarea:focus { border-color: var(--accent); }
.noterow button {
  width: 44px; border-radius: 9px; border: none; background: var(--accent); color: #00160d; font-weight: 700; font-size: 12px;
}
.statusmeta { font-size: 10px; color: rgba(247, 247, 242, .4); margin-top: 7px; min-height: 13px; }
.stbadge { font-size: 9px; font-weight: 700; padding: 2px 7px; border-radius: 999px; color: #00160d; flex-shrink: 0; }

/* ---------- Opener ---------- */
#opener {
  position: fixed; inset: 0; z-index: 2000; pointer-events: none;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  background: transparent;
}
#opener .big {
  font-size: clamp(28px, 5vw, 58px); color: var(--offwhite);
  text-shadow: 0 4px 40px rgba(0, 0, 0, .6);
  opacity: 0; animation: fadeup 1.1s ease .2s forwards;
}
#opener .sub {
  margin-top: 10px; font-size: 14px; letter-spacing: .3em; text-transform: uppercase; color: var(--lightgreen);
  opacity: 0; animation: fadeup 1.1s ease .55s forwards;
}
#opener.gone { animation: openerout 1s ease forwards; }
@keyframes fadeup { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes openerout { to { opacity: 0; } }

/* ---------- Einstellungen ---------- */
.settings-wrap { height: 100%; overflow-y: auto; padding: 90px 20px 60px; }
.settings {
  max-width: 660px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px;
}
.card {
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 16px; padding: 24px 26px;
}
.card h2 { font-size: 17px; margin-bottom: 4px; }
.card p.sub { font-size: 13px; color: rgba(247, 247, 242, .55); margin-bottom: 16px; line-height: 1.5; }
.card .row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.card .field { flex: 1; min-width: 180px; margin-bottom: 10px; }
.card .btn { width: auto; padding: 11px 22px; font-size: 13px; }
.ok { color: var(--lightgreen); font-size: 13px; margin-top: 10px; min-height: 17px; }
.userlist { font-size: 13px; margin-top: 6px; }
.userlist .u { display: flex; justify-content: space-between; padding: 7px 4px; border-bottom: 1px solid rgba(247, 247, 242, .07); }
.badge { font-size: 10px; background: rgba(38, 194, 87, .18); color: var(--lightgreen); padding: 2px 8px; border-radius: 999px; }

.leaflet-tile-pane { filter: none; }
.brandtiles .leaflet-tile-pane { filter: hue-rotate(75deg) saturate(.65) brightness(.85); }

@media (max-width: 900px) {
  .topbar { overflow-x: auto; gap: 6px; padding: 0 12px; }
  .topbar::-webkit-scrollbar { display: none; }
  .sidepanel { width: calc(100vw - 32px); }
  .searchbox { top: 64px; left: 16px; right: 16px; width: auto; }
  .chips { top: 112px; max-width: calc(100vw - 90px); }
  .panel-toggle { display: block; top: 120px; }
  .listpanel { width: calc(100vw - 32px); }
}
/* Listpanel unter beiden Chip-Reihen halten (Desktop) */
@media (min-width: 901px) {
  .listpanel { top: 144px; }
}
