/* 9CXO Betreiber-Portal — app shell styles.
 * Baltasaar/9CXO CI: petrol authority (#0E5561), lime accent (#C8D400 — earns
 * its appearances), near-white base (#F2F5F6). Light theme default. IBM Plex.
 * No horizontal scroll at 400px. Vanilla — no framework, no build step. */
:root {
  --petrol: #0E5561;
  --petrol-700: #0b4450;
  --petrol-900: #07171A;
  --petrol-50: #e3eef0;
  --lime: #C8D400;
  --lime-700: #a9b400;
  --base: #F2F5F6;
  --card: #ffffff;
  --ink: #132226;
  --muted: #5a6a6e;
  --line: #d8e0e2;
  --line-2: #c6d4d6;
  --soft: #eaf1f2;
  --success: #2e7d5b;
  --success-soft: #e2f0ea;
  --danger: #b3402f;
  --danger-soft: #f6e5e2;
  --warn: #d98a00;
  --warn-soft: #fbeed4;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(11, 68, 80, .06), 0 8px 24px rgba(11, 68, 80, .06);
  --font: "IBM Plex Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "IBM Plex Serif", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--base);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: var(--petrol); }
button { font-family: inherit; }

/* ---- Boot splash ---- */
.boot { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; gap: 20px; }
.boot-mark { font-family: var(--serif); font-weight: 600; font-size: 30px; letter-spacing: .04em; color: var(--petrol); }
.boot-spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--petrol); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   LOGIN
   ============================================================ */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(120% 120% at 50% 0%, #0e5561 0%, #0b4450 45%, #07171A 100%); }
.auth-card { width: 100%; max-width: 420px; background: var(--card); border-radius: 16px; box-shadow: 0 24px 60px rgba(7, 23, 26, .35); overflow: hidden; }
.auth-head { padding: 34px 32px 8px; }
.auth-mark { font-family: var(--serif); font-weight: 600; font-size: 28px; color: var(--petrol); letter-spacing: .03em; }
.auth-mark .dot { color: var(--lime); }
.auth-head h1 { font-size: 20px; margin: 18px 0 6px; font-weight: 700; }
.auth-head p { color: var(--muted); font-size: 14px; margin: 0; }
.auth-body { padding: 20px 32px 34px; }
.auth-body label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 7px; }
.field {
  width: 100%; padding: 12px 14px; font-size: 15px; border: 1.5px solid var(--line-2); border-radius: 10px;
  background: #fff; color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s;
}
.field:focus { border-color: var(--petrol); box-shadow: 0 0 0 3px var(--petrol-50); }
.auth-note { font-size: 12.5px; color: var(--muted); margin: 14px 0 0; text-align: center; }
.auth-err { background: var(--danger-soft); color: var(--danger); font-size: 13px; border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; }
.auth-ok { text-align: center; padding: 8px 0 4px; }
.auth-ok .ok-ic { width: 56px; height: 56px; border-radius: 50%; background: var(--success-soft); color: var(--success); display: grid; place-items: center; margin: 0 auto 18px; }
.auth-ok h2 { font-size: 19px; margin: 0 0 8px; }
.auth-ok p { color: var(--muted); font-size: 14px; margin: 0 0 4px; }
.auth-ok .em { color: var(--ink); font-weight: 600; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 16px; font-size: 14px; font-weight: 600; border-radius: 10px;
  border: 1.5px solid var(--line-2); background: #fff; color: var(--ink); cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--petrol); color: var(--petrol); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--petrol); border-color: var(--petrol); color: #fff; }
.btn.primary:hover { background: var(--petrol-700); border-color: var(--petrol-700); color: #fff; }
.btn.lime { background: var(--lime); border-color: var(--lime); color: var(--petrol-900); }
.btn.lime:hover { background: var(--lime-700); border-color: var(--lime-700); color: var(--petrol-900); }
.btn.block { width: 100%; padding: 13px 16px; font-size: 15px; }
.btn.sm { padding: 7px 11px; font-size: 12.5px; border-radius: 8px; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--soft); border-color: transparent; color: var(--ink); }
.btn svg { width: 16px; height: 16px; }

/* ============================================================
   PORTAL SHELL
   ============================================================ */
.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; min-height: 100dvh; }
.side { background: var(--petrol-900); color: #cfe0e2; display: flex; flex-direction: column; min-width: 0; }
.side-head { padding: 22px 20px 16px; }
.side-mark { font-family: var(--serif); font-weight: 600; font-size: 24px; color: #fff; letter-spacing: .03em; }
.side-mark .dot { color: var(--lime); }
.side-sub { font-size: 11.5px; color: #7fa2a7; margin-top: 3px; letter-spacing: .08em; text-transform: uppercase; }
.nav { padding: 6px 12px 12px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; flex: 1; }
.nav-group { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #6d9096; padding: 14px 10px 6px; font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 10px 11px; border-radius: 9px; border: none; background: transparent;
  color: #cfe0e2; font-size: 14px; font-weight: 500; cursor: pointer; position: relative;
}
.nav-item .ic { width: 19px; height: 19px; display: inline-flex; flex: 0 0 auto; color: #9fc0c4; }
.nav-item .ic svg { width: 19px; height: 19px; }
.nav-item .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-item:hover:not(:disabled) { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: var(--petrol); color: #fff; }
.nav-item.active .ic { color: var(--lime); }
.nav-item:disabled { color: #5f7f84; cursor: default; }
.nav-item:disabled .ic { color: #48666b; }
.soon { font-size: 9.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: rgba(200, 212, 0, .14); color: #c8d400; padding: 2px 6px; border-radius: 6px; flex: 0 0 auto; }
.side-foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.user-mini { display: flex; align-items: center; gap: 10px; padding: 6px 8px; min-width: 0; }
.user-mini .av { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%; background: var(--petrol); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.user-mini .who { min-width: 0; flex: 1; }
.user-mini .who b { display: block; font-size: 13px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-mini .who span { display: block; font-size: 11.5px; color: #7fa2a7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-mini .logout { flex: 0 0 auto; background: transparent; border: none; color: #7fa2a7; cursor: pointer; padding: 6px; border-radius: 8px; display: inline-flex; }
.user-mini .logout:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.user-mini .logout svg { width: 18px; height: 18px; }

/* Main column */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; align-items: center; gap: 12px; padding: 12px 16px; background: var(--petrol-900); color: #fff; position: sticky; top: 0; z-index: 20; }
.topbar .burger { background: transparent; border: none; color: #fff; cursor: pointer; padding: 6px; display: inline-flex; }
.topbar .burger svg { width: 24px; height: 24px; }
.topbar .tb-mark { font-family: var(--serif); font-weight: 600; font-size: 20px; }
.topbar .tb-mark .dot { color: var(--lime); }
.page-head { padding: 26px 32px 18px; border-bottom: 1px solid var(--line); background: var(--card); }
.page-head h1 { font-size: 22px; margin: 0 0 4px; font-weight: 700; }
.page-head p { margin: 0; color: var(--muted); font-size: 14px; }
.content { padding: 24px 32px 48px; flex: 1; min-width: 0; }

/* Backdrop for mobile nav */
.backdrop { display: none; position: fixed; inset: 0; background: rgba(7, 23, 26, .5); z-index: 25; }
.backdrop.open { display: block; }

/* ============================================================
   CARDS / TABLES / FORMS
   ============================================================ */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 20px; }
.card + .card { margin-top: 20px; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.card-head .count { margin-left: auto; font-size: 12.5px; color: var(--muted); background: var(--soft); padding: 3px 10px; border-radius: 20px; }

.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .spacer { flex: 1; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
table.tbl th { text-align: left; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
table.tbl td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl tbody tr.blocked td { background: var(--danger-soft); }
.cell-name { font-weight: 600; }
.cell-name small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 20px; }
.pill .d { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.green { background: var(--success-soft); color: var(--success); }
.pill.gray { background: var(--soft); color: var(--muted); }
.pill.blue { background: var(--petrol-50); color: var(--petrol); }
.pill.gold { background: var(--warn-soft); color: var(--warn); }
.pill.red { background: var(--danger-soft); color: var(--danger); }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.form-field input, .form-field select {
  padding: 10px 12px; font-size: 14px; border: 1.5px solid var(--line-2); border-radius: 9px;
  background: #fff; color: var(--ink); outline: none; width: 100%; font-family: inherit;
}
.form-field input:focus, .form-field select:focus { border-color: var(--petrol); box-shadow: 0 0 0 3px var(--petrol-50); }
.form-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

/* Empty / error states */
.empty { text-align: center; padding: 48px 20px; }
.empty .ic { width: 56px; height: 56px; border-radius: 16px; background: var(--petrol-50); color: var(--petrol); display: grid; place-items: center; margin: 0 auto 16px; }
.empty .ic svg { width: 26px; height: 26px; }
.empty h3 { margin: 0 0 8px; font-size: 16px; }
.empty p { color: var(--muted); max-width: 380px; margin: 0 auto 20px; font-size: 14px; }

/* File upload row */
.upload { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.upload input[type=file] { font-size: 13px; color: var(--muted); max-width: 100%; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--petrol-900); color: #fff; padding: 12px 20px; border-radius: 10px; font-size: 14px;
  box-shadow: 0 12px 30px rgba(7, 23, 26, .35); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); }

/* Coming-soon placeholder view */
.soon-view { text-align: center; padding: 60px 20px; }
.soon-view .ic { width: 64px; height: 64px; border-radius: 18px; background: var(--petrol-50); color: var(--petrol); display: grid; place-items: center; margin: 0 auto 18px; }
.soon-view .ic svg { width: 30px; height: 30px; }
.soon-view h2 { margin: 0 0 10px; font-size: 20px; }
.soon-view p { color: var(--muted); max-width: 420px; margin: 0 auto; font-size: 14.5px; }
.soon-view .tag { display: inline-block; margin-bottom: 18px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: var(--warn-soft); color: var(--warn); padding: 5px 12px; border-radius: 20px; }

/* ============================================================
   RESPONSIVE — no horizontal scroll at 400px
   ============================================================ */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .topbar { display: flex; }
  .side {
    position: fixed; top: 0; bottom: 0; left: 0; width: 270px; max-width: 84vw; z-index: 30;
    transform: translateX(-100%); transition: transform .22s ease; overflow-y: auto;
  }
  .side.open { transform: translateX(0); }
  .page-head { padding: 20px 16px 14px; }
  .content { padding: 18px 16px 40px; }
}
@media (max-width: 520px) {
  .form-grid { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 19px; }
  .content { padding: 16px 14px 36px; }
}
