/* =========================================================
   Interix Systeme – Statusseite
   Corporate Identity: Schwarz/Dunkelgrau, Orange #ff9900
   ========================================================= */

:root {
    --ix-orange:       #ff9900;
    --ix-orange-dark:  #e08600;
    --ix-orange-soft:  #fff4e0;

    --text:            #16181d;
    --text-muted:      #626873;
    --text-soft:       #8a919e;

    --bg:              #f5f6f8;
    --surface:         #ffffff;
    --surface-alt:     #fafbfc;
    --border:          #e4e7ec;
    --border-strong:   #d3d8e0;

    --ok:              #17a34a;
    --ok-soft:         #e8f7ee;
    --maint:           #2563eb;
    --maint-soft:      #e8f0fe;
    --warn:            #d99e00;
    --warn-soft:       #fdf5e0;
    --down:            #dc2626;
    --down-soft:       #fdecec;

    --radius:          14px;
    --radius-sm:       9px;
    --shadow:          0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -12px rgba(16, 24, 40, .12);
    --shadow-lg:       0 2px 4px rgba(16, 24, 40, .04), 0 18px 40px -18px rgba(16, 24, 40, .2);
    --maxw:            1000px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15.5px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--ix-orange-dark); }

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; font-weight: 650; letter-spacing: -.015em; }
h1 { font-size: 1.85rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p  { margin: 0 0 1em; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- Kopfzeile ---------- */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
}
.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 66px;
    flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 680; font-size: 1.02rem; letter-spacing: -.01em; }
.brand .mark {
    width: 30px; height: 30px; border-radius: 8px; flex: 0 0 auto;
    background: linear-gradient(135deg, var(--ix-orange) 0%, var(--ix-orange-dark) 100%);
    display: grid; place-items: center; color: #fff; font-size: 15px; font-weight: 800;
}
.brand small { display: block; font-weight: 450; color: var(--text-muted); font-size: .78rem; line-height: 1.1; }

.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a {
    padding: 7px 13px; border-radius: 999px; font-size: .9rem; font-weight: 520; color: var(--text-muted);
}
.nav a:hover { background: var(--surface-alt); color: var(--text); }
.nav a.active { background: var(--ix-orange-soft); color: var(--ix-orange-dark); }

/* ---------- Gesamtstatus ---------- */
.overall {
    border-radius: var(--radius);
    padding: 26px 28px;
    margin: 28px 0 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: var(--shadow);
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 5px solid var(--ok);
}
.overall.is-operational { border-left-color: var(--ok);    background: linear-gradient(90deg, var(--ok-soft) 0%, var(--surface) 55%); }
.overall.is-maintenance { border-left-color: var(--maint); background: linear-gradient(90deg, var(--maint-soft) 0%, var(--surface) 55%); }
.overall.is-degraded    { border-left-color: var(--warn);  background: linear-gradient(90deg, var(--warn-soft) 0%, var(--surface) 55%); }
.overall.is-outage      { border-left-color: var(--down);  background: linear-gradient(90deg, var(--down-soft) 0%, var(--surface) 55%); }

.overall .icon {
    width: 46px; height: 46px; border-radius: 50%; flex: 0 0 auto;
    display: grid; place-items: center; color: #fff; font-size: 22px; font-weight: 700;
}
.is-operational .icon { background: var(--ok); }
.is-maintenance .icon { background: var(--maint); }
.is-degraded    .icon { background: var(--warn); }
.is-outage      .icon { background: var(--down); }

.overall h1 { margin: 0; font-size: 1.42rem; }
.overall .meta { color: var(--text-muted); font-size: .87rem; margin: 3px 0 0; }

/* ---------- Karten ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 22px;
    overflow: hidden;
}
.card > header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: var(--surface-alt);
}
.card > header h2 { margin: 0; font-size: .95rem; letter-spacing: .01em; text-transform: uppercase; color: var(--text-muted); font-weight: 640; }
.card .body { padding: 20px; }

/* ---------- Dienstliste ---------- */
.service-list { list-style: none; margin: 0; padding: 0; }
.service-list > li {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
}
.service-list > li:last-child { border-bottom: 0; }
.service-list .name { font-weight: 560; }
.service-list .desc { color: var(--text-muted); font-size: .85rem; margin-top: 1px; }
.service-list .grow { flex: 1 1 auto; min-width: 0; }
.service-list .note { font-size: .82rem; color: var(--text-muted); margin-top: 3px; }
.service-list .note a { color: var(--ix-orange-dark); text-decoration: underline; text-underline-offset: 2px; }

.dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.dot.is-operational { background: var(--ok); }
.dot.is-maintenance { background: var(--maint); }
.dot.is-degraded    { background: var(--warn); }
.dot.is-outage      { background: var(--down); }

.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 11px; border-radius: 999px;
    font-size: .795rem; font-weight: 600; white-space: nowrap;
}
.badge.is-operational { background: var(--ok-soft);    color: #0f7a37; }
.badge.is-maintenance { background: var(--maint-soft); color: #1d4ed8; }
.badge.is-degraded    { background: var(--warn-soft);  color: #9a7100; }
.badge.is-outage      { background: var(--down-soft);  color: #b91c1c; }
.badge.is-neutral     { background: #eef0f3;           color: var(--text-muted); }

/* ---------- Uptime-Balken ---------- */
.uptime { display: flex; gap: 2px; align-items: stretch; height: 30px; }
.uptime .bar {
    flex: 1 1 0; min-width: 2px; border-radius: 2px; background: var(--ok);
    position: relative; transition: transform .1s ease;
}
.uptime .bar.is-maintenance { background: var(--maint); }
.uptime .bar.is-degraded    { background: var(--warn); }
.uptime .bar.is-outage      { background: var(--down); }
.uptime .bar:hover { transform: scaleY(1.12); }

.uptime-row { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.uptime-row:last-child { border-bottom: 0; }
.uptime-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.uptime-head .name { font-weight: 560; }
.uptime-head .pct { font-size: .82rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.uptime-legend { display: flex; justify-content: space-between; font-size: .76rem; color: var(--text-soft); margin-top: 7px; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li { padding: 18px 20px; border-bottom: 1px solid var(--border); }
.timeline > li:last-child { border-bottom: 0; }
.timeline .day { font-size: .8rem; font-weight: 650; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.timeline .entry { padding-left: 18px; border-left: 2px solid var(--border-strong); margin-bottom: 14px; }
.timeline .entry:last-child { margin-bottom: 0; }
.timeline .entry.is-outage      { border-left-color: var(--down); }
.timeline .entry.is-degraded    { border-left-color: var(--warn); }
.timeline .entry.is-maintenance { border-left-color: var(--maint); }
.timeline .entry h3 { margin: 0 0 4px; font-size: 1rem; }
.timeline .entry .meta { font-size: .83rem; color: var(--text-muted); }
.timeline .entry .services { font-size: .82rem; color: var(--text-muted); margin-top: 5px; }

.update-list { list-style: none; margin: 0; padding: 0; }
.update-list > li { position: relative; padding: 0 0 22px 26px; border-left: 2px solid var(--border); margin-left: 6px; }
.update-list > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.update-list > li::before {
    content: ""; position: absolute; left: -7px; top: 5px;
    width: 12px; height: 12px; border-radius: 50%; background: var(--ix-orange); border: 2px solid var(--surface);
}
.update-list .phase { font-weight: 640; font-size: .93rem; }
.update-list .when { font-size: .8rem; color: var(--text-soft); margin-left: 8px; font-weight: 450; }
.update-list .msg { margin-top: 4px; white-space: pre-line; }

/* ---------- Formulare / Buttons ---------- */
label { display: block; font-size: .87rem; font-weight: 560; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=datetime-local], select, textarea {
    width: 100%; padding: 10px 12px; font: inherit; color: var(--text);
    background: var(--surface); border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm); outline: none;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--ix-orange);
    box-shadow: 0 0 0 3px rgba(255, 153, 0, .18);
}
textarea { min-height: 110px; resize: vertical; }
.field { margin-bottom: 16px; }
.hint { font-size: .8rem; color: var(--text-muted); margin-top: 5px; }
.check { display: flex; align-items: flex-start; gap: 9px; font-weight: 450; font-size: .89rem; }
.check input { margin-top: 3px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn {
    display: inline-flex; align-items: center; gap: 8px; justify-content: center;
    padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
    font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer;
    background: var(--ix-orange); color: #1a1205;
    transition: background .12s ease, box-shadow .12s ease;
}
.btn:hover { background: var(--ix-orange-dark); color: #fff; }
.btn.secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn.secondary:hover { background: var(--surface-alt); color: var(--text); }
.btn.danger { background: var(--down-soft); color: #b91c1c; border-color: #f6c9c9; }
.btn.danger:hover { background: #f9d9d9; color: #991b1b; }
.btn.small { padding: 6px 12px; font-size: .84rem; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.alert { padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: .92rem; border: 1px solid; }
.alert.success { background: var(--ok-soft);  border-color: #bfe6cd; color: #0f7a37; }
.alert.error   { background: var(--down-soft); border-color: #f6c9c9; color: #b91c1c; }
.alert.info    { background: var(--maint-soft); border-color: #c8dbfc; color: #1d4ed8; }
.alert.warning { background: var(--warn-soft); border-color: #f0dda6; color: #8a6500; }

/* ---------- Tabellen ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { padding: 11px 20px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); background: var(--surface-alt); font-weight: 640; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.right, table.data th.right { text-align: right; }

/* ---------- Fußzeile ---------- */
.site-footer {
    margin-top: 46px; padding: 26px 0 40px;
    border-top: 1px solid var(--border);
    color: var(--text-muted); font-size: .85rem;
    background: var(--surface);
}
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }
.site-footer a:hover { color: var(--ix-orange-dark); }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .8rem; color: var(--text-muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

.muted { color: var(--text-muted); }
.small { font-size: .85rem; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.cta-band {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px 24px; display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; box-shadow: var(--shadow);
}

/* ---------- Admin ---------- */
.admin-bar { background: var(--text); color: #fff; font-size: .85rem; }
.admin-bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 46px; flex-wrap: wrap; }
.admin-bar a { color: #d7dae0; padding: 5px 10px; border-radius: 7px; }
.admin-bar a:hover, .admin-bar a.active { background: rgba(255, 255, 255, .12); color: #fff; }
.admin-bar form { display: inline; }
.admin-bar .btn { background: transparent; color: #d7dae0; border-color: rgba(255,255,255,.25); padding: 5px 12px; font-size: .84rem; }
.admin-bar .btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.login-wrap { max-width: 400px; margin: 8vh auto; }

.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px 18px; }
.checkbox-grid label { font-weight: 450; font-size: .88rem; display: flex; gap: 8px; align-items: center; margin: 0; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; margin: 0 0 16px; }
legend { font-size: .82rem; font-weight: 640; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; padding: 0 6px; }

@media (max-width: 640px) {
    body { font-size: 15px; }
    .overall { padding: 20px; gap: 14px; }
    .overall h1 { font-size: 1.16rem; }
    .grid2 { grid-template-columns: 1fr; }
    .service-list > li { flex-wrap: wrap; }
    table.data th, table.data td { padding: 10px 12px; }
    .uptime { height: 26px; }
}
