/* ============================================================
   dbw Angebote — Admin UI
   Editorial studio look: ink sidebar, paper canvas,
   brand gradient used surgically.
   ============================================================ */

@font-face {
  font-family: 'Aspekta';
  src: url('/assets/fonts/AspektaVF.woff2') format('woff2');
  font-weight: 100 1000;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('/assets/fonts/instrument.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --c-red: #ea2b1f;
  --c-pink: #ff3c6f;
  --c-magenta: #ff4fdd;
  --c-violet: #7e56ff;
  --c-blue: #00b2ff;
  --grad: linear-gradient(135deg, var(--c-red), var(--c-pink), var(--c-magenta), var(--c-violet), var(--c-blue));

  --ink: #131118;
  --ink-2: #4d4a55;
  --ink-3: #8d8a96;
  --paper: #f5f4f0;
  --card: #ffffff;
  --line: #e7e4dd;
  --line-strong: #d8d4cb;
  --ok: #0d9f6e;
  --warn: #d97706;

  --display: 'Aspekta', 'Avenir Next', sans-serif;
  --body: 'Instrument Sans', 'Helvetica Neue', sans-serif;

  --r: 14px;
  --r-sm: 9px;
  --shadow: 0 1px 2px rgba(19, 17, 24, .04), 0 8px 24px -12px rgba(19, 17, 24, .12);
  --shadow-lift: 0 2px 4px rgba(19, 17, 24, .05), 0 18px 40px -16px rgba(19, 17, 24, .22);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
}

::selection { background: var(--c-pink); color: #fff; }

/* ---------- Shell ---------- */

.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

.side {
  background: #0e0d13;
  color: #b8b5c2;
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
}

/* Stacked dbw media brand mark (matches the official logo) */
.brand {
  display: inline-flex;
  flex-direction: column;
  font-family: var(--display);
  font-weight: 830;
  font-size: 22px;
  letter-spacing: -.035em;
  line-height: .82;
  color: #fff;
  text-decoration: none;
  padding: 0 10px;
}
.brand .r1 { display: inline-flex; align-items: center; gap: .22em; }
.brand .dots { display: inline-flex; gap: .1em; }
.brand .dots i { width: .26em; height: .26em; border-radius: 50%; display: block; }
.brand .dots i:nth-child(1) { background: linear-gradient(135deg, var(--c-red), var(--c-pink)); }
.brand .dots i:nth-child(2) { background: linear-gradient(135deg, var(--c-pink), var(--c-violet)); }
.brand .dots i:nth-child(3) { background: linear-gradient(135deg, var(--c-violet), var(--c-blue)); }
.brand .r2 { margin-left: .95em; }
.brand.dark { color: var(--ink); }
.brand-sub {
  font-family: var(--body);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #6f6c7c;
  padding: 7px 10px 0;
  display: block;
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 9px;
  color: #a3a0af;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  position: relative;
  transition: color .15s, background .15s;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.nav a.on { color: #fff; background: rgba(255, 255, 255, .07); }
.nav a.on::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 3px;
  background: var(--grad);
}
.nav svg { width: 17px; height: 17px; opacity: .8; }

.side-foot { margin-top: auto; padding: 0 12px; font-size: 12.5px; color: #6f6c7c; }
.side-foot a { color: #a3a0af; text-decoration: none; }
.side-foot a:hover { color: #fff; }

.main { padding: 30px 40px 70px; max-width: 1240px; width: 100%; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.page-head h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: -.03em;
  line-height: 1.05;
}
.page-head .sub { color: var(--ink-3); margin-top: 5px; font-size: 14px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--body);
  font-weight: 600;
  font-size: 14px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s, box-shadow .15s, border-color .15s, background .15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  position: relative;
}
.btn-primary:hover { border-color: var(--ink); background: #26232e; box-shadow: var(--shadow-lift); }

.btn-grad {
  background: var(--grad);
  border: none;
  color: #fff;
  padding: 10px 17px;
  box-shadow: 0 6px 18px -8px rgba(234, 43, 31, .5);
}
.btn-grad:hover { filter: saturate(1.15) brightness(1.03); box-shadow: 0 10px 24px -8px rgba(126, 86, 255, .55); }

.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: rgba(19, 17, 24, .05); border-color: transparent; box-shadow: none; }

.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-danger { color: #c0261c; }
.btn-danger:hover { border-color: #c0261c; }

/* ---------- Status badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 11px 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
}
.badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.badge.draft i { background: var(--ink-3); }
.badge.sent i { background: var(--c-blue); }
.badge.viewed i { background: var(--c-violet); }
.badge.meeting i { background: var(--c-magenta); }
.badge.accepted i { background: var(--ok); }
.badge.accepted { color: var(--ok); border-color: rgba(13, 159, 110, .3); }
.badge.declined i { background: var(--c-red); }

/* ---------- Cards & tables ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}

.table-card { overflow: hidden; }

table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfaf8;
}
table.list td { padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:last-child td { border-bottom: none; }
table.list tbody tr { transition: background .12s; }
table.list tbody tr:hover { background: #fbfaf7; }
table.list .t-title { font-weight: 600; }
table.list .t-title a { color: var(--ink); text-decoration: none; }
table.list .t-title a:hover { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
table.list .muted { color: var(--ink-3); font-size: 13px; }
td.t-num { font-variant-numeric: tabular-nums; color: var(--ink-2); }

.empty {
  padding: 70px 30px;
  text-align: center;
  color: var(--ink-3);
}
.empty h2 { font-family: var(--display); font-weight: 700; font-size: 21px; color: var(--ink); letter-spacing: -.02em; margin-bottom: 6px; }

/* ---------- New offer type picker ---------- */

.type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.type-card {
  padding: 20px 18px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--card);
  text-decoration: none;
  color: var(--ink);
  transition: transform .15s, box-shadow .2s, border-color .15s;
  position: relative;
  overflow: hidden;
}
.type-card::after {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad);
  opacity: 0;
  transition: opacity .2s;
}
.type-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--line-strong); }
.type-card:hover::after { opacity: 1; }
.type-card b { font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: -.02em; display: block; margin-bottom: 4px; }
.type-card span { font-size: 13px; color: var(--ink-3); }

/* ---------- Forms ---------- */

label.f { display: block; margin-bottom: 15px; }
label.f > span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url], textarea, select {
  width: 100%;
  font-family: var(--body);
  font-size: 14.5px;
  color: var(--ink);
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--c-violet);
  box-shadow: 0 0 0 3px rgba(126, 86, 255, .16);
}
.f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.hint { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }

/* ---------- Editor layout ---------- */

.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.editor-col { display: flex; flex-direction: column; gap: 18px; }

.panel { padding: 22px; }
.panel h2 {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.panel h2 .n {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--ink);
  border-radius: 6px;
  padding: 2px 7px;
  letter-spacing: .05em;
}

/* Block rows in editor */
.blocks { display: flex; flex-direction: column; gap: 8px; }
.block-row {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s, opacity .2s;
}
.block-row.off { opacity: .5; background: #fbfaf8; }
.block-row-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  cursor: pointer;
  user-select: none;
}
.block-row-head .move { display: flex; flex-direction: column; gap: 1px; }
.block-row-head .move button {
  border: none; background: none; cursor: pointer; color: var(--ink-3);
  font-size: 9px; line-height: 1; padding: 2px 4px; border-radius: 4px;
}
.block-row-head .move button:hover { color: var(--ink); background: var(--paper); }
.block-title { font-weight: 600; font-size: 14px; flex: 1; }
.block-kind { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.block-price { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
.block-row-body { padding: 4px 14px 14px 45px; display: none; }
.block-row.open .block-row-body { display: block; }
.block-row-body .f-row { margin-bottom: 10px; }

/* Toggle switch */
.switch { position: relative; width: 34px; height: 20px; flex-shrink: 0; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; cursor: pointer; z-index: 2; margin: 0; }
.switch i {
  position: absolute; inset: 0; border-radius: 999px; background: #d9d5cd; transition: background .2s;
}
.switch i::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  background: #fff; border-radius: 50%; transition: transform .2s cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.switch input:checked + i { background: var(--ink); }
.switch input:checked + i::after { transform: translateX(14px); }

.block-price s, .summary .row s { color: var(--ink-3); font-weight: 500; margin-right: .35em; }
.gift-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-2);
  margin: 2px 0 12px;
  cursor: pointer;
}
.gift-check input { accent-color: var(--c-pink); width: 15px; height: 15px; }

/* Variant pills */
.variants { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
.variant-pill {
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.variant-pill b { display: block; font-size: 13px; }
.variant-pill span { color: var(--ink-3); font-size: 12px; }
.variant-pill.sel {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

/* Summary card */
.summary { position: sticky; top: 24px; }
.summary .rows { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.summary .row { display: flex; justify-content: space-between; gap: 14px; font-size: 13.5px; }
.summary .row span:first-child { color: var(--ink-2); }
.summary .row span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }
.summary .total {
  border-top: 2px solid var(--ink);
  margin-top: 6px;
  padding-top: 10px;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
}
.summary .monthly { color: var(--c-violet); }
.summary-actions { display: flex; flex-direction: column; gap: 9px; margin-top: 18px; }
.summary-actions .btn { justify-content: center; }

.linkbox {
  background: #0e0d13;
  color: #cfccda;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12.5px;
  margin-top: 14px;
  word-break: break-all;
}
.linkbox b { color: #fff; display: block; margin-bottom: 3px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.linkbox a { color: #9fd8ff; text-decoration: none; }

/* ---------- Login ---------- */

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(800px 500px at 15% -5%, rgba(255, 60, 111, .12), transparent 60%),
    radial-gradient(700px 500px at 90% 110%, rgba(0, 178, 255, .12), transparent 60%),
    var(--paper);
  padding: 20px;
}
.login-card {
  width: 400px;
  max-width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 36px;
  box-shadow: var(--shadow-lift);
  animation: rise .5s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.login-card h1 { font-family: var(--display); font-size: 24px; font-weight: 800; letter-spacing: -.03em; margin: 18px 0 4px; }
.login-card .sub { color: var(--ink-3); font-size: 14px; margin-bottom: 24px; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 6px; }
.login-err {
  background: rgba(234, 43, 31, .08);
  border: 1px solid rgba(234, 43, 31, .25);
  color: #b3231a;
  font-size: 13.5px;
  border-radius: 9px;
  padding: 10px 13px;
  margin-bottom: 16px;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translate(-50%, 16px);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 11px 20px;
  border-radius: 999px;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 60;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 9px; }

/* ---------- Library ---------- */

.lib-grid { display: flex; flex-direction: column; gap: 10px; }
.lib-item { border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.lib-item summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}
.lib-item summary::-webkit-details-marker { display: none; }
.lib-item summary .cat {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 6px; background: var(--paper); color: var(--ink-2);
}
.lib-item summary .spacer { flex: 1; }
.lib-item .lib-body { padding: 6px 16px 16px; border-top: 1px solid var(--line); }
.lib-body textarea.json { font-family: ui-monospace, 'SF Mono', monospace; font-size: 12.5px; min-height: 260px; }

.section-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 26px 0 10px;
}

@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; }
  .side-foot, .brand-sub { display: none; }
  .nav { flex-direction: row; }
  .main { padding: 20px; }
  .editor-grid { grid-template-columns: 1fr; }
  .type-grid { grid-template-columns: 1fr 1fr; }
}
