/* ═══════════════════════════════════════════════════════════
   Web-Designes Admin – Styles
   ═══════════════════════════════════════════════════════════ */

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

/* hidden-Attribut muss IMMER gewinnen (sonst ueberschreibt display:flex es) */
[hidden] { display: none !important; }

:root {
  --navy:      #16213A;
  --navy-mid:  #1F2E4D;
  --blue:      #3B6EF5;
  --blue-dark: #2B57CC;
  --blue-lt:   #EEF3FE;
  --green:     #16A34A;
  --green-lt:  #ECFDF3;
  --amber:     #D97706;
  --amber-lt:  #FFF8EC;
  --red:       #DC2626;
  --red-lt:    #FEF2F2;
  --gray:      #64748B;
  --border:    #E4E8EF;
  --border-mid:#D3D9E3;
  --bg:        #F4F6FA;
  --surface:   #FFFFFF;
  --text:      #16213A;
  --text-sm:   #4A5568;
  --text-mut:  #8A94A6;
  --radius:    10px;
  --shadow:    0 1px 3px rgba(22,33,58,.06), 0 4px 16px rgba(22,33,58,.05);
  --shadow-lg: 0 12px 48px rgba(22,33,58,.22);
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ─── DEMO BANNER ─── */
.demo-banner {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--amber-lt);
  color: #92500A;
  border-bottom: 1px solid #F2D9A8;
  padding: 8px 20px;
  font-size: 12.5px;
}
.demo-banner code {
  background: rgba(146,80,10,.12);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: "SF Mono", "Cascadia Code", monospace;
  font-size: 11.5px;
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .13s, border-color .13s, transform .08s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-dark); }
.btn--ghost { background: transparent; color: var(--text-sm); border-color: var(--border-mid); }
.btn--ghost:hover { background: var(--bg); border-color: var(--gray); }
.btn--danger { background: var(--red); color: #fff; }
.btn--danger:hover { background: #B91C1C; }
.btn--full { width: 100%; }

/* ─── LOGIN ─── */
.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 20%, rgba(59,110,245,.10) 0%, transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(59,110,245,.08) 0%, transparent 40%),
    var(--navy);
}
.login__card {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 36px 34px;
  width: 100%;
  max-width: 380px;
}
.login__brand { display: flex; align-items: center; gap: 13px; margin-bottom: 28px; }
.login__logo {
  width: 44px; height: 44px;
  background: var(--blue);
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.login__logo svg { width: 24px; height: 24px; }
.login__title { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.login__sub { font-size: 12.5px; color: var(--text-mut); margin-top: 1px; }
.login__form { display: flex; flex-direction: column; gap: 16px; }
.login__error {
  background: var(--red-lt);
  color: var(--red);
  border: 1px solid #F6C9C9;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12.5px;
  font-weight: 500;
}

/* ─── FIELDS ─── */
.field { display: flex; flex-direction: column; gap: 5px; }
.field__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sm);
  letter-spacing: .01em;
}
.field input, .field select, .field textarea {
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: 8px;
  padding: 9px 11px;
  width: 100%;
  transition: border-color .13s, box-shadow .13s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-lt);
}
.field textarea { resize: vertical; line-height: 1.5; }
.field__pw { position: relative; display: flex; align-items: center; }
.field__pw input { padding-right: 42px; }
.field__pw-toggle {
  position: absolute;
  right: 6px;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; border-radius: 6px;
  color: var(--text-mut); cursor: pointer;
}
.field__pw-toggle:hover { color: var(--text); background: var(--bg); }
.field__pw-toggle.is-on { color: var(--blue); }

/* ─── TOPBAR ─── */
.topbar {
  background: var(--navy);
  padding: 0 24px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar__brand { display: flex; align-items: center; gap: 12px; }
.topbar__logo {
  width: 36px; height: 36px;
  background: var(--blue);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
}
.topbar__logo svg { width: 20px; height: 20px; }
.topbar__title { color: #fff; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.topbar__sub { color: #8FA0BE; font-size: 11.5px; }
.topbar__right { display: flex; align-items: center; gap: 14px; }
.topbar__user { color: #B4C1D8; font-size: 12.5px; }
.topbar .btn--ghost { color: #C6D1E4; border-color: rgba(255,255,255,.16); }
.topbar .btn--ghost:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.3); }

/* ─── PAGE ─── */
.page { max-width: 1240px; margin: 0 auto; padding: 26px 24px 60px; }

/* ─── STATS ─── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent, var(--blue));
}
.stat__label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-mut);
  text-transform: uppercase;
  letter-spacing: .05em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat__value {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-top: 7px;
  font-variant-numeric: tabular-nums;
}
.stat__sub { font-size: 12px; color: var(--text-mut); margin-top: 2px; }
.stat--blue  { --accent: var(--blue); }
.stat--green { --accent: var(--green); }
.stat--amber { --accent: var(--amber); }
.stat--red   { --accent: var(--red); }
.stat--amber .stat__value { color: var(--amber); }
.stat--red .stat__value { color: var(--red); }

/* ─── TOOLBAR ─── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar__search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 200px;
  max-width: 340px;
}
.toolbar__search svg { position: absolute; left: 12px; color: var(--text-mut); pointer-events: none; }
.toolbar__search input {
  width: 100%;
  font-family: inherit;
  font-size: 13.5px;
  padding: 9px 12px 9px 36px;
  border: 1px solid var(--border-mid);
  border-radius: 8px;
  background: var(--surface);
}
.toolbar__search input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-lt); }
.toolbar__filters { display: flex; gap: 6px; }
.chip-filter {
  padding: 8px 13px;
  border: 1px solid var(--border-mid);
  background: var(--surface);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sm);
  cursor: pointer;
  font-family: inherit;
  transition: all .13s;
}
.chip-filter:hover { border-color: var(--gray); }
.chip-filter.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }
.sort-select {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sm);
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
}
.sort-select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-lt); }

/* SEO-Faellig Badge - auffaellig rot mit Punkt */
.seo-due {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 8px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--red-lt);
  color: var(--red);
}
.seo-due__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: seo-pulse 1.8s ease-in-out infinite; }
@keyframes seo-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .seo-due__dot { animation: none; } }

/* ─── TABLE ─── */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 940px; }
thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-mut);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: #FafBfD;
}
thead th.num { text-align: right; }
tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--blue-lt); }
.cell-firma { font-weight: 600; color: var(--navy); }
.cell-contact { color: var(--text-sm); }
.cell-contact small { display: block; color: var(--text-mut); font-size: 11.5px; }
.cell-domain a { color: var(--blue); text-decoration: none; }
.cell-domain a:hover { text-decoration: underline; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-muted { color: var(--text-mut); }
.date-red   { color: var(--red); font-weight: 600; }
.date-amber { color: var(--amber); font-weight: 600; }
.date-ok    { color: var(--text); }

/* ─── STATUS PILL ─── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 8px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
}
.pill__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill--aktiv { background: var(--green-lt); color: var(--green); }
.pill--pausiert { background: var(--amber-lt); color: var(--amber); }
.pill--gekuendigt { background: var(--red-lt); color: var(--red); }

/* ─── ROW ACTIONS ─── */
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.icon-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 7px;
  color: var(--text-mut);
  cursor: pointer;
  transition: all .12s;
}
.icon-btn:hover { background: var(--bg); color: var(--text); border-color: var(--border-mid); }
.icon-btn--danger:hover { background: var(--red-lt); color: var(--red); border-color: #F6C9C9; }

/* ─── EMPTY ─── */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 56px 20px;
  color: var(--text-mut);
  text-align: center;
}
.empty p { font-size: 13.5px; }

/* ─── MODAL ─── */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(22,33,58,.5); backdrop-filter: blur(2px); }
.modal__panel {
  position: relative;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 620px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal__panel--small { max-width: 420px; }
.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal__head h2 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.modal__close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; border-radius: 7px;
  color: var(--text-mut); cursor: pointer;
}
.modal__close:hover { background: var(--bg); color: var(--text); }
.modal__form { overflow-y: auto; padding: 22px 24px; }
.modal__body { padding: 20px 24px; color: var(--text-sm); }
.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.modal__form .modal__actions { border-top: none; padding: 20px 0 0; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.field--wide { grid-column: 1 / -1; }

/* ─── TOAST ─── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--navy);
  color: #fff;
  padding: 11px 20px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  opacity: 0;
  transition: opacity .2s, transform .2s;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast--error { background: var(--red); }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .toolbar__search { max-width: none; }
  .topbar__sub { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
