/* Mailumzug – Gestaltung im Stil von id4web.de (Manrope, #004077 / #1472c4) */

@font-face {
  font-family: "Manrope";
  src: url("/static/fonts/manrope-latin-wght.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --id4-blue: #004077;        /* Hauptfarbe (Logo, Überschriften, Buttons) */
  --id4-blue-light: #1472c4;  /* Akzent, Links, Hover */
  --id4-blue-soft: rgba(0, 64, 119, .08);
  --bg: #f2f4f6;
  --card: #fff;
  --text: #444;
  --muted: #6c7684;
  --line: #e3e7ec;
  --danger: #d4403a;
  --ok: #15803d;
  --warn: #b45309;
  --radius: 10px;
  --radius-btn: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(0, 64, 119, .06);
  --sky: linear-gradient(90deg, #2f4a9a 0%, #7a4fa6 35%, #c8577f 65%, #f0a35e 100%);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font: 400 16px/1.6 "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text);
}
a { color: var(--id4-blue-light); text-decoration: none; }
a:hover { text-decoration: underline; }
main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 32px 20px 64px; flex: 1; }
h1, h2, h3, h4 { color: var(--id4-blue); line-height: 1.25; }
h1 { font-size: 2rem; font-weight: 800; margin: 0 0 12px; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; font-weight: 700; margin: 0 0 14px; }
h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 6px; }
h4 { font-size: .95rem; font-weight: 700; margin: 0 0 6px; }
code { background: var(--id4-blue-soft); color: var(--id4-blue); padding: 1px 5px; border-radius: 4px; font-size: .88em; }
.muted { color: var(--muted); }
.ok { color: var(--ok); font-weight: 700; }

/* --- Kopfzeile wie auf id4web.de -------------------------------------------- */
.topbar { background: #fff; box-shadow: 0 1px 0 var(--line); position: relative; }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; background: var(--sky); }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 14px 20px; display: flex; flex-wrap: wrap;
  align-items: center; justify-content: space-between; gap: 14px 24px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none !important; }
.brand img { height: 40px; width: auto; display: block; }
.brand .product { color: var(--id4-blue); font-weight: 700; font-size: 1.05rem; padding-left: 14px;
  border-left: 2px solid var(--line); line-height: 1.2; }
.brand .product small { display: block; color: var(--muted); font-weight: 500; font-size: .75rem; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; }
.topbar nav a { color: var(--text); font-weight: 600; text-decoration: none; padding: 4px 0;
  border-bottom: 2px solid transparent; }
.topbar nav a:hover, .topbar nav a.active { color: var(--id4-blue); border-bottom-color: var(--id4-blue-light); }
.topbar .link { color: var(--muted); font-weight: 500; }

/* --- Fußzeile ------------------------------------------------------------------ */
.footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 24px 20px 32px; }
.footer strong { color: var(--id4-blue); font-weight: 700; }

/* --- Karten und Layout ----------------------------------------------------------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; margin-bottom: 22px; }
.card:has(> table) { overflow-x: auto; }  /* breite Tabellen auf dem Handy seitlich scrollen */
.narrow { max-width: 520px; }
.headline { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.two-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 22px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }

/* --- Formulare ------------------------------------------------------------------- */
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px 18px; margin: 0 0 18px; background: #fbfcfd; }
legend { font-weight: 700; color: var(--id4-blue); padding: 0 8px; }
label { display: block; margin: 0 0 14px; font-weight: 600; font-size: .95rem; }
label.check { font-weight: 400; display: flex; gap: 10px; align-items: flex-start; }
label.check input { margin-top: 5px; accent-color: var(--id4-blue); }
input:not([type=checkbox]), select {
  display: block; width: 100%; margin-top: 5px; padding: 10px 12px; font: inherit; font-weight: 400; color: var(--text);
  border: 1px solid #cdd4dc; border-radius: var(--radius-btn); background: #fff; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { outline: none; border-color: var(--id4-blue-light); box-shadow: 0 0 0 3px rgba(20, 114, 196, .18); }
input[type=file] { padding: 8px; }

/* --- Buttons wie auf id4web.de ------------------------------------------------------ */
button, .button {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; font: inherit; font-weight: 700;
  border-radius: var(--radius-btn); border: 2px solid var(--id4-blue); background: #fff; color: var(--id4-blue);
  cursor: pointer; text-decoration: none !important; transition: background .15s, border-color .15s, color .15s;
}
button:hover, .button:hover { background: var(--id4-blue-soft); }
button.primary, .button.primary { background: var(--id4-blue); color: #fff; }
button.primary:hover, .button.primary:hover { background: var(--id4-blue-light); border-color: var(--id4-blue-light); }
button.danger { border-color: var(--danger); color: var(--danger); background: #fff; }
button.danger:hover { background: rgba(212, 64, 58, .08); }
button.link { background: none; border: none; padding: 0; font-weight: 500; text-decoration: underline; }
button:disabled { opacity: .6; cursor: wait; }
form.inline { display: inline; }
.danger-zone { text-align: right; }

/* --- Tabellen ----------------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
tbody tr:hover { background: #f8fafc; }
table.compact th, table.compact td { padding: 6px 10px; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.wrap { max-width: 420px; }
tfoot th { color: var(--id4-blue); text-transform: none; letter-spacing: 0; font-size: .9rem; }

/* --- Status ---------------------------------------------------------------------------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #eef1f4; color: #475467; white-space: nowrap; }
.s-queued { background: #eef2ff; color: #3730a3; }
.s-running { background: rgba(20, 114, 196, .12); color: var(--id4-blue); }
.s-done { background: #dcfce7; color: #166534; }
.s-warning { background: #fef3c7; color: #92400e; }
.s-failed { background: #fde4e3; color: #a1251f; }
.s-cancelled { background: #f1f3f5; color: #4b5563; }

.progress { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; min-width: 190px; }
.progress progress { flex: 1; height: 8px; appearance: none; border: none; border-radius: 999px; background: #e6ebf1; overflow: hidden; accent-color: var(--id4-blue-light); }
.progress progress::-webkit-progress-bar { background: #e6ebf1; border-radius: 999px; }
.progress progress::-webkit-progress-value { background: var(--id4-blue-light); border-radius: 999px; }
.progress progress::-moz-progress-bar { background: var(--id4-blue-light); border-radius: 999px; }
.ptext { font-size: .82rem; color: var(--muted); white-space: nowrap; }

.alert { padding: 12px 16px; border-radius: var(--radius-btn); margin-bottom: 16px; border: 1px solid; }
.alert.error { background: #fef2f2; border-color: #fbcfcd; color: #7f1d1d; }
.alert.warn { background: #fffbeb; border-color: #fde68a; color: #78350f; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.stats { padding-left: 20px; }
details summary { cursor: pointer; font-weight: 700; color: var(--id4-blue); margin: 8px 0; }
.pwform { margin-top: 8px; }
.testline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.testline button { padding: 7px 14px; font-size: .9rem; }
.test-result { font-size: .9rem; }
.test-result.ok { color: var(--ok); font-weight: 700; }
.test-result.err { color: var(--danger); }

/* --- Login-Seite mit Himmelsverlauf ---------------------------------------------------------- */
body.login { background: linear-gradient(160deg, #1d2f6b 0%, #5b3f8f 45%, #b9567f 75%, #ee9d5c 100%) fixed; }
body.login .topbar { display: none; }
body.login main { display: flex; align-items: center; justify-content: center; }
body.login .content { width: 100%; max-width: 420px; }
body.login .card { width: 100%; max-width: 420px; padding: 32px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
body.login .footer { color: rgba(255, 255, 255, .8); }
body.login .footer strong { color: #fff; }
.login-logo { display: block; height: 52px; width: auto; margin: 0 auto 6px; }
.login-sub { text-align: center; color: var(--muted); margin: 0 0 22px; font-weight: 600; }
body.login button.primary { width: 100%; justify-content: center; }

@media (max-width: 720px) {
  main { padding: 22px 16px 48px; }
  h1 { font-size: 1.6rem; }
  .brand .product { display: none; }
  table.jobs th:nth-child(4), table.jobs td:nth-child(4) { display: none; }
}
