/* app/web/static/styles.css */
:root {
  --bg: #0b0c10;
  --card: #15171c;
  --ink: #e8eaed;
  --muted: #9aa0a6;
  --accent: #4f8cff;
  --accent-2: #24c2a4;
  --danger: #ff6b6b;
  --shadow: rgba(0,0,0,.25);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }

.topbar { position: sticky; top: 0; background: #0c0e13; border-bottom: 1px solid #222630; padding: 10px 16px; z-index: 10; display:flex; align-items:center; justify-content:space-between; gap:16px; }
.nav { display:flex; gap:10px; }
.nav a { color:#cfd3da; text-decoration:none; padding:6px 10px; border-radius:8px; }
.nav a:hover { background:#1a1d26; }

.topbar h1 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: .3px; }
.container { max-width: 1000px; margin: 26px auto; padding: 0 16px; }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }

.offer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.offer-head h2 { margin: 0 0 6px 0; font-size: 22px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { background: #222630; color: #cfd3da; font-size: 12px; padding: 3px 8px; border-radius: 999px; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 12px 0 16px; }
.card { background: var(--card); border: 1px solid #1f232d; border-radius: 14px; box-shadow: 0 3px 16px var(--shadow); padding: 14px; }
.card h3 { margin: 0 0 10px 0; font-size: 16px; }

.kv { list-style: none; padding: 0; margin: 0; }
.kv li { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 6px 0; border-bottom: 1px dashed #252a35; }
.kv li:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }

.links .btn,
a.btn { display: inline-block; margin-right: 12px; text-decoration: none; }
.btn { border: 0; background: #222630; color: var(--ink); padding: 10px 14px; border-radius: 10px; cursor: pointer; }
.btn.primary { background: var(--accent); color: white; }
.btn.ghost { background: #1b1e27; border: 1px solid #2a2f3a; color: var(--ink); }
.btn:hover { opacity: .95; }
.btn.mini { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn.bad { background: var(--danger); color: #001; }

.form .field { margin: 14px 0; }
.form label { display: block; margin: 0 0 6px 0; color: #cfd3da; }
.choices { display: flex; gap: 16px; }
textarea, select,
input[type="text"], input[type="email"] {
  width: 100%; background: #0f1117; border: 1px solid #232735; border-radius: 10px; padding: 8px; color: var(--ink);
}

.actions { margin-top: 16px; }

.potentials { margin-top: 16px; }
.hidden { display: none; }
.list { display: grid; gap: 8px; margin-top: 8px; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px; border: 1px solid #222630; border-radius: 10px; background: #12141a; }
.item .name { font-weight: 600; }
.item .sid { color: var(--muted); font-size: 12px; }
.item .phones { color: #cfd3da; font-size: 14px; }
.item .phones a { color: inherit; text-decoration: none; }
.item .phones a:hover { text-decoration: underline; }
.item .right { display:flex; align-items:center; gap:8px; flex-wrap: wrap; }
.item .save-note { color: var(--muted); font-size: 12px; min-width: 110px; text-align: right; }
.item .notes { grid-column: 1 / -1; margin-top: 8px; }
.item .notes details { background:#0f1117; border:1px solid #232735; border-radius:10px; padding:8px; }
.item .notes summary { cursor: pointer; color:#cfd3da; }
.item .notes .notes-list { margin-top:8px; display:grid; gap:6px; }
.item .notes .notes-item { display:grid; grid-template-columns: 160px 1fr; gap:8px; font-size:13px; }
.item .notes .notes-item .ts { color:var(--muted); }
.item .notes .notes-edit { margin-top:8px; display:grid; grid-template-columns: 1fr auto auto; gap:8px; align-items:center; }

.toolbar { display:flex; gap:10px; align-items:center; }
.small { font-size: 12px; }

/* KPIs, Tabellen (falls auf Dashboard) */
.kpis { display:grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap:12px; }
.kpi { background: var(--card); border: 1px solid #1f232d; border-radius: 14px; padding:14px; box-shadow: 0 3px 16px var(--shadow); }
.kpi a { color: inherit; text-decoration: none; }
.kpi h4 { margin:0 0 8px 0; font-size:13px; color: var(--muted); }
.kpi .val { font-size: 28px; font-weight: 700; }
.range-switch { margin: 16px 0; display:flex; gap:8px; }
.range-switch a { text-decoration:none; }
.range-switch .btn.active { background: var(--accent-2); color:#001; }
.table { width:100%; border-collapse: collapse; }
.table th, .table td { padding: 8px; border-bottom: 1px solid #222630; text-align:left; }
.table th { color: var(--muted); font-weight: 500; }

/* Trial-Mini-Form */
.item .trial-form {
  margin-top: 6px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  left: 50%; bottom: 18px; transform: translateX(-50%);
  background: #1b1e27; border: 1px solid #2a2f3a; color: var(--ink);
  padding: 10px 14px; border-radius: 10px; z-index: 10000;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.toast.bad { background: #2b1518; border-color: #4a1f25; color: #ffd6d6; }

/* ===== Loader / Spinner ===== */
.spinner {
  display: inline-block;
  width: 28px; height: 28px;
  border: 3px solid #2a2f3a;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-row {
  display:flex; align-items:center; gap:10px;
  padding: 14px; border: 1px solid #222630; border-radius: 10px; background: #12141a;
}

/* ===== Page Overlay Loader ===== */
.page-loader {
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  display: none; align-items: center; justify-content: center; z-index: 9999;
}
.page-loader .panel {
  background: var(--card); border: 1px solid #1f232d; border-radius: 12px;
  padding: 16px 22px; display:flex; align-items:center; gap:12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.45);
}
.page-loader .txt { color: var(--ink); font-weight: 600; }
.page-loader.show { display: flex; }

/* ===== Utilities, die bisher fehlten ===== */
.muted { color: var(--muted); }
.glid { color: var(--muted); font-size: 12px; }

.pm-toolbar { display:flex; gap:8px; align-items:center; margin:8px 0 10px; }
.pm-toolbar .search,
input.search { flex:1; width:100%; background:#0f1117; border:1px solid #232735; border-radius:10px; padding:8px; color:var(--ink); }
.pm-toolbar .count { color:var(--muted); font-size:13px; }

.kbd-help { margin-left:8px; font-size:12px; color:var(--muted); }
.kbd {
  display:inline-block; padding:2px 6px; min-width:18px;
  border:1px solid #2a2f3a; border-bottom-width:2px; border-radius:6px;
  background:#0f1117; text-align:center;
  font: 12px ui-monospace, SFMono-Regular, Menlo, monospace;
  color:#cfd3da;
}

/* Optional: Inputs vereinheitlichen, auch ohne Inline-Styles */
input[type="search"] { -webkit-appearance: none; appearance: none; }
