/* ============================================================
   CronJob Server - app.css
   ============================================================ */
:root {
  --surface: #13131a;
  --surface2: #1c1c26;
  --border: rgba(255,255,255,0.07);
  --accent2: #a78bfa;
  --green: #34d399;
  --red: #f87171;
  --yellow: #fbbf24;
  --text: #e8e8f0;
  --muted: #6b6b80;
  --radius: 16px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg, #07070f);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 60% 40% at 20% 0%, color-mix(in srgb, var(--accent) 18%, transparent) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 80% 90%, rgba(52,211,153,0.08) 0%, transparent 50%);
}
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
.page { position: relative; z-index: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem 4rem; flex: 1; }
.page-narrow { max-width: 560px; }

/* ── Header ── */
.site-header {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: 1.2rem 2rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(12px);
}
.logo { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.3rem; color: var(--text); display: flex; align-items: center; gap: 0.6rem; }
.logo:hover { text-decoration: none; }
.logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--green));
  display: flex; align-items: center; justify-content: center; font-size: 1.05rem;
  box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 45%, transparent);
}
.nav { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.nav-link { color: var(--muted); font-size: 0.88rem; padding: 0.4rem 0.7rem; border-radius: 8px; transition: all 0.15s; }
.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.05); text-decoration: none; }
.nav-link.active { color: var(--accent2); font-weight: 600; }
.nav-user { font-size: 0.82rem; color: var(--muted); padding: 0 0.5rem; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.7rem 1.4rem; border-radius: 10px; border: none; cursor: pointer;
  font-family: 'Syne', sans-serif; font-size: 0.9rem; font-weight: 700;
  transition: all 0.15s; text-decoration: none; line-height: 1.2;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #000)); color: #fff; box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-success { background: linear-gradient(135deg, #059669, #047857); color: #fff; }
.btn-danger  { background: linear-gradient(135deg, #ef4444, #b91c1c); color: #fff; }
.btn-ghost   { background: rgba(255,255,255,0.06); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: rgba(255,255,255,0.1); }
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.8rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Forms ── */
.form-group { margin-bottom: 1.2rem; }
label.form-label { display: block; font-size: 0.72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.4rem; }
input[type="text"], input[type="password"], input[type="email"], input[type="url"], input[type="number"], input[type="datetime-local"],
select, textarea {
  width: 100%; background: rgba(28,28,38,0.9); border: 1px solid var(--border); color: var(--text);
  padding: 0.75rem 1rem; border-radius: 10px; font-size: 0.9rem; font-family: inherit; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus { border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
textarea { min-height: 90px; resize: vertical; }
select { appearance: none; background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3e%3cpath fill='%236b6b80' d='M6 8 0 0h12z'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 1rem center; }
.check { display: flex; align-items: center; gap: 0.6rem; font-size: 0.88rem; color: #c8c8e0; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.hint { font-size: 0.75rem; color: var(--muted); margin-top: 0.35rem; display: block; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.form-actions { display: flex; gap: 0.8rem; justify-content: flex-end; margin-top: 1.5rem; flex-wrap: wrap; }

/* ── Card ── */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.6rem; margin-bottom: 1.4rem;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.card-title { font-family: 'Syne', sans-serif; font-size: 1.15rem; font-weight: 700; margin-bottom: 0.3rem; }
.card-sub { color: var(--muted); font-size: 0.85rem; margin-bottom: 1.2rem; }

/* ── Alerts ── */
.alert { padding: 0.85rem 1rem; border-radius: 10px; font-size: 0.88rem; margin-bottom: 1.2rem; line-height: 1.5; }
.alert-error   { background: rgba(239,68,68,0.08);   border: 1px solid rgba(239,68,68,0.2);   color: var(--red); }
.alert-success { background: rgba(52,211,153,0.08);  border: 1px solid rgba(52,211,153,0.2);  color: var(--green); }
.alert-info    { background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); color: var(--accent2); }
.alert-warn    { background: rgba(251,191,36,0.08);  border: 1px solid rgba(251,191,36,0.2);  color: var(--yellow); }
.alert ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }

/* ── Badges ── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.74rem; font-weight: 600; white-space: nowrap; }
.badge-ok     { background: rgba(52,211,153,0.1); color: var(--green); }
.badge-warn   { background: rgba(251,191,36,0.1); color: var(--yellow); }
.badge-danger { background: rgba(239,68,68,0.1); color: var(--red); }
.badge-muted  { background: rgba(255,255,255,0.06); color: var(--muted); }
.badge-info   { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent2); }

.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.dot-ok   { background: var(--green); box-shadow: 0 0 8px rgba(52,211,153,0.6); }
.dot-warn { background: var(--yellow); box-shadow: 0 0 8px rgba(251,191,36,0.5); }
.dot-danger { background: var(--red); box-shadow: 0 0 8px rgba(239,68,68,0.5); }
.dot-off  { background: #4a4a60; }
.dot-running { background: var(--accent2); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ── Stats ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.6rem; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
}
.stat-label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.stat-value { font-family: 'Syne', sans-serif; font-size: 1.7rem; font-weight: 800; margin-top: 0.2rem; }
.stat-sub { font-size: 0.76rem; color: var(--muted); margin-top: 0.15rem; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
table.data th {
  text-align: left; padding: 0.6rem 0.8rem; background: var(--surface2); color: var(--muted);
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data td { padding: 0.75rem 0.8rem; border-bottom: 1px solid rgba(255,255,255,0.04); color: #c8c8e0; vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: rgba(255,255,255,0.02); }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 0.8rem; word-break: break-all; }
.truncate { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }

/* ── Job row actions ── */
.actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.action-btn {
  padding: 0.32rem 0.7rem; border-radius: 7px; font-size: 0.76rem; font-weight: 600;
  border: 1px solid var(--border); background: rgba(255,255,255,0.05); color: #c8c8e0; cursor: pointer;
  transition: all 0.15s; font-family: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 0.3rem;
}
.action-btn:hover { background: rgba(255,255,255,0.1); color: var(--text); text-decoration: none; }
.action-danger:hover { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.3); color: var(--red); }
.action-primary:hover { background: color-mix(in srgb, var(--accent) 15%, transparent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent2); }

/* ── Filters / toolbar ── */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.tabs { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.tab {
  padding: 0.45rem 1rem; border-radius: 8px; font-size: 0.84rem; font-weight: 600;
  color: var(--muted); background: rgba(255,255,255,0.04); border: 1px solid var(--border); cursor: pointer;
}
.tab.active, .tab:hover { color: var(--text); background: rgba(255,255,255,0.09); text-decoration: none; }

/* ── Sparkline ── */
.sparkline { display: flex; align-items: flex-end; gap: 2px; height: 34px; margin: 0.4rem 0; }
.spark-bar { flex: 1; background: linear-gradient(to top, color-mix(in srgb, var(--accent) 30%, transparent), var(--accent)); border-radius: 2px 2px 0 0; min-width: 2px; }
.spark-bar.fail { background: linear-gradient(to top, rgba(239,68,68,0.3), var(--red)); }

/* ── Landing ── */
.hero { text-align: center; padding: 3.5rem 0 2.5rem; }
.hero h1 { font-family: 'Syne', sans-serif; font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -0.5px; line-height: 1.15; }
.hero h1 span { background: linear-gradient(135deg, var(--accent2), var(--green)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero p.lead { color: var(--muted); font-size: 1.05rem; max-width: 620px; margin: 1.1rem auto 1.8rem; line-height: 1.6; }
.hero .cta { display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }
.hero-stats { display: flex; justify-content: center; gap: 2.5rem; margin-top: 2.6rem; flex-wrap: wrap; }
.hero-stat .num { font-family: 'Syne', sans-serif; font-size: 1.6rem; font-weight: 800; color: var(--accent2); }
.hero-stat .lbl { font-size: 0.78rem; color: var(--muted); }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; margin: 2.5rem 0; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; }
.feature .icon { font-size: 1.5rem; margin-bottom: 0.6rem; }
.feature h3 { font-family: 'Syne', sans-serif; font-size: 1rem; font-weight: 700; margin-bottom: 0.4rem; }
.feature p { color: var(--muted); font-size: 0.85rem; line-height: 1.55; }

.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.2rem; margin: 2.5rem 0; }
.how-step { text-align: center; padding: 1.5rem 1rem; }
.how-num { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--green)); color: #fff; font-family: 'Syne', sans-serif; font-weight: 800; display: flex; align-items: center; justify-content: center; margin: 0 auto 0.8rem; }
.how-step h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.4rem; }
.how-step p { color: var(--muted); font-size: 0.84rem; line-height: 1.5; }

.section-title { text-align: center; font-family: 'Syne', sans-serif; font-size: 1.6rem; font-weight: 800; margin: 2.8rem 0 0.4rem; }
.section-sub { text-align: center; color: var(--muted); font-size: 0.92rem; margin-bottom: 1.6rem; }

/* ── Auth cards (login/register) ── */
.auth-wrap { display: flex; justify-content: center; padding-top: 2rem; }
.auth-card { width: 100%; max-width: 440px; }
.auth-headline { text-align: center; margin-bottom: 1.4rem; }
.auth-headline h2 { font-family: 'Syne', sans-serif; font-size: 1.4rem; font-weight: 800; margin-bottom: 0.3rem; }
.auth-headline p { color: var(--muted); font-size: 0.88rem; }

/* ── Detail rows ── */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.9rem; margin: 1rem 0; }
.detail { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 10px; padding: 0.7rem 0.9rem; }
.detail .k { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600; }
.detail .v { font-size: 0.9rem; margin-top: 0.15rem; word-break: break-all; }

/* ── Code blocks ── */
pre.code {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 10px;
  padding: 1rem 1.2rem; overflow-x: auto; font-size: 0.82rem; font-family: ui-monospace, Consolas, monospace;
  color: #c4b5fd; line-height: 1.6; margin: 0.6rem 0;
}
code.inline { background: var(--surface2); border: 1px solid var(--border); padding: 1px 7px; border-radius: 5px; font-size: 0.8rem; color: #c4b5fd; }

/* ── Preview box (run response) ── */
.preview-box {
  background: #0a0a12; border: 1px solid var(--border); border-radius: 10px;
  padding: 0.9rem 1rem; max-height: 320px; overflow: auto; font-family: ui-monospace, Consolas, monospace;
  font-size: 0.78rem; color: #b8b8d0; white-space: pre-wrap; word-break: break-word;
}

/* ── Pagination ── */
.pagination { display: flex; gap: 0.4rem; align-items: center; justify-content: center; margin-top: 1.2rem; }
.pagination a, .pagination span { padding: 0.4rem 0.8rem; border-radius: 8px; font-size: 0.82rem; border: 1px solid var(--border); color: #c8c8e0; }
.pagination .cur { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Footer ── */
.site-footer { border-top: 1px solid var(--border); padding: 1.4rem 2rem; margin-top: auto; }
.footer-inner { max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: 0.8rem; color: var(--muted); }
.footer-links { display: flex; gap: 1.1rem; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }

/* ═══ GUI-Überarbeitung ═══ */

/* ── Nav: Icons + User-Pill ── */
.nav-link { display: inline-flex; align-items: center; gap: 0.35rem; }
.nav-link span { line-height: 1; }
.nav-user-pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  padding: 0.25rem 0.8rem 0.25rem 0.3rem; border-radius: 999px;
  font-size: 0.8rem; font-weight: 600; color: #c8c8e0; margin: 0 0.3rem;
}
.nav-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--green));
  color: #fff; font-size: 0.72rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

/* ── Einheitlicher Seitenkopf ── */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem;
}
.page-head h1 { font-family: 'Syne', sans-serif; font-size: 1.55rem; font-weight: 800; letter-spacing: -0.3px; }
.page-head p { color: var(--muted); font-size: 0.88rem; margin-top: 0.2rem; max-width: 640px; }
.page-head-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }

/* ── Scheduler-Statusleiste ── */
.sys-strip {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.75rem 1rem; border-radius: 12px; margin-bottom: 1.4rem;
  border: 1px solid var(--border); font-size: 0.86rem;
}
.sys-strip .sys-ico { font-size: 1.05rem; }
.sys-strip .sys-label { font-weight: 700; white-space: nowrap; }
.sys-strip .sys-txt { color: var(--muted); }
.sys-ok   { background: rgba(52,211,153,0.07); border-color: rgba(52,211,153,0.25); }
.sys-ok .sys-label { color: var(--green); }
.sys-warn { background: rgba(251,191,36,0.07); border-color: rgba(251,191,36,0.3); }
.sys-warn .sys-label { color: var(--yellow); }
.sys-err  { background: rgba(239,68,68,0.07); border-color: rgba(239,68,68,0.3); }
.sys-err .sys-label { color: var(--red); }

/* ── Stat-Karten mit Icon & Akzent ── */
.stat { position: relative; display: flex; flex-direction: column; gap: 0.3rem; overflow: hidden; }
.stat::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.stat .stat-ico { font-size: 1.25rem; }
.stat .stat-label { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; }
.stat .stat-value { margin-top: 0; }
.stat.stat-green::after { background: linear-gradient(90deg, var(--green), transparent); }
.stat.stat-green .stat-ico { color: var(--green); }
.stat.stat-red::after { background: linear-gradient(90deg, var(--red), transparent); }
.stat.stat-red .stat-ico { color: var(--red); }
.stat.stat-yellow::after { background: linear-gradient(90deg, var(--yellow), transparent); }
.stat.stat-yellow .stat-ico { color: var(--yellow); }
.stat.stat-accent .stat-ico { color: var(--accent2); }

/* ── Fehlgeschlagene Tabellenzeilen ── */
table.data tr.row-fail td { background: rgba(239,68,68,0.05); }
table.data tr.row-fail:hover td { background: rgba(239,68,68,0.09); }

/* ── Aufklappbare Settings-Sektionen ── */
.settings-section { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 0.9rem; background: rgba(255,255,255,0.015); }
.settings-section summary {
  cursor: pointer; list-style: none; padding: 0.9rem 1.1rem; font-weight: 700;
  font-family: 'Syne', sans-serif; font-size: 0.92rem; border-radius: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; user-select: none;
}
.settings-section summary::-webkit-details-marker { display: none; }
.settings-section summary::after { content: '▾'; color: var(--muted); font-size: 0.8rem; transition: transform 0.2s; }
.settings-section[open] summary::after { transform: rotate(180deg); }
.settings-section summary:hover { background: rgba(255,255,255,0.04); }
.settings-section .settings-body { padding: 0.4rem 1.1rem 1.1rem; border-top: 1px solid var(--border); }
.settings-section .settings-body .grid2, .settings-section .settings-body .grid3 { margin-top: 1rem; }
.settings-section .desc { font-size: 0.8rem; color: var(--muted); margin: 0.4rem 0 0; }

/* ── Karte mit Kopfzeile ── */
.card .card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.2rem; }
.card .card-head .card-title { margin-bottom: 0; }

/* ── Countdown-Pill (nächster Lauf) ── */
.countdown { font-size: 0.75rem; color: var(--muted); }

@media (max-width: 720px) {
  .site-header { padding: 1rem; }
  .page { padding: 1.4rem 1rem 3rem; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .hero { padding-top: 2.2rem; }
  .nav-user-pill { display: none; }
  .page-head h1 { font-size: 1.3rem; }
}
