:root {
    --bg: #0a0a0a;
    --bg-elevated: #121212;
    --card: #161616;
    --card-2: #1c1c1c;
    --border: #262626;
    --border-strong: #333333;
    --text: #fafafa;
    --muted: #a1a1aa;
    --muted-2: #71717a;
    --up: #22c55e;        /* operacional (verde) */
    --up-dim: #14241a;
    --down: #ef4444;      /* fora do ar (vermelho) */
    --none: #2a2a2a;      /* sem dados (cinza) */
    --radius: 14px;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

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

a { color: inherit; }

.container {
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---- Header ---- */
.site-header {
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 20;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    font-size: 22px;
    text-decoration: none;
}
.brand .logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 2px solid var(--text);
    border-radius: 9px;
    font-size: 15px;
    font-weight: 900;
}
.brand .logo-img {
    height: 40px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
    display: block;
}
.header-actions { display: flex; align-items: center; gap: 10px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 10px;
    border: 1px solid var(--border-strong);
    background: var(--card-2);
    color: var(--text);
    padding: 11px 18px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s;
}
.btn:hover { background: #242424; border-color: #444; }
.btn-primary { background: var(--text); color: #000; border-color: var(--text); }
.btn-primary:hover { background: #d4d4d4; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-danger { border-color: #4a2222; color: #f5b5b5; }
.btn-danger:hover { background: #2a1414; }

/* ---- Nav tabs ---- */
.nav-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--border);
    margin-top: 22px;
}
.nav-tabs a {
    padding: 12px 14px;
    text-decoration: none;
    color: var(--muted);
    font-weight: 600;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.nav-tabs a.active { color: var(--text); border-bottom-color: var(--text); }
.nav-tabs a:hover { color: var(--text); }

/* ---- Status banner ---- */
.status-banner {
    margin: 28px 0;
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: var(--radius);
    padding: 28px 26px;
    display: flex;
    align-items: center;
    gap: 18px;
}
.status-banner h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.status-dot {
    width: 30px; height: 30px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
}
.status-dot svg { width: 30px; height: 30px; }
.dot-operational { color: var(--up); }
.dot-degraded { color: #f59e0b; }
.dot-down { color: var(--down); }
.dot-maintenance { color: #f59e0b; }

/* ---- Group card ---- */
.group {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 18px;
    overflow: hidden;
}
.group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}
.group-title { font-size: 16px; font-weight: 700; color: var(--muted); }
.group-pill {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--card-2);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 14px; font-weight: 600;
}

.service { padding: 20px 22px; border-bottom: 1px solid var(--border); }
.service:last-child { border-bottom: none; }
.service-top {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 12px;
}
.service-name { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; }
.service-uptime { color: var(--muted); font-size: 14px; font-weight: 600; }

.check-icon { width: 20px; height: 20px; flex-shrink: 0; }
.check-up { color: var(--up); }
.check-down { color: var(--down); }
.check-unknown { color: var(--muted-2); }

/* ---- Uptime bars ---- */
.bars { display: flex; gap: 3px; align-items: stretch; height: 38px; }
.bar {
    flex: 1 1 0;
    border-radius: 3px;
    min-width: 4px;
}
.bar-up { background: var(--up); }
.bar-down { background: var(--down); }
.bar-none { background: var(--none); }
.bars-legend {
    display: flex; justify-content: space-between;
    color: var(--muted-2); font-size: 13px; margin-top: 8px;
}

/* ---- Generic cards / lists ---- */
.section-title { font-size: 20px; font-weight: 700; margin: 26px 0 14px; }
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 16px;
}
.card h3 { margin: 0 0 6px; font-size: 17px; }
.meta { color: var(--muted-2); font-size: 13px; }
.badge {
    display: inline-block; font-size: 12px; font-weight: 700;
    padding: 3px 10px; border-radius: 999px;
    border: 1px solid var(--border-strong); background: var(--card-2);
    color: var(--muted);
}
.badge-resolved, .badge-completed { color: var(--up); border-color: #3a3a3a; }
.badge-open { color: var(--text); border-color: #555; }
.empty { color: var(--muted-2); text-align: center; padding: 40px 0; }

.timeline { margin-top: 14px; border-left: 2px solid var(--border); padding-left: 18px; }
.timeline .item { margin-bottom: 16px; }
.timeline .item .t-status { font-weight: 700; font-size: 14px; }
.timeline .item .t-time { color: var(--muted-2); font-size: 12px; }

/* ---- Footer ---- */
.site-footer {
    border-top: 1px solid var(--border);
    margin-top: 50px;
    padding: 26px 0 40px;
    text-align: center;
    color: var(--muted-2);
    font-size: 13px;
}
.site-footer .brand-mini { color: var(--muted); font-weight: 700; }

/* ---- Forms / Admin ---- */
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--muted); }
.input, .select, textarea.input {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    color: var(--text);
    padding: 11px 13px;
    font-size: 15px;
    font-family: inherit;
}
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: #666; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); font-size: 14px; }
.table th { color: var(--muted-2); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }

.admin-shell { display: flex; min-height: 100vh; }
.admin-side {
    width: 240px; flex-shrink: 0; background: var(--bg-elevated);
    border-right: 1px solid var(--border); padding: 22px 14px;
}
.admin-side .brand { font-size: 18px; margin-bottom: 22px; padding: 0 8px; }
.admin-nav a {
    display: block; padding: 11px 14px; border-radius: 9px;
    color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; margin-bottom: 4px;
}
.admin-nav a:hover { background: var(--card); color: var(--text); }
.admin-nav a.active { background: var(--card-2); color: var(--text); }
.admin-main { flex: 1; padding: 30px 34px; max-width: 1000px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.admin-head h1 { font-size: 24px; margin: 0; }

.alert { padding: 12px 16px; border-radius: 9px; margin-bottom: 18px; font-size: 14px; }
.alert-success { background: #14241a; border: 1px solid #285039; color: #b9f0cd; }
.alert-error { background: #2a1414; border: 1px solid #50282a; color: #f3b9b9; }

.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
.login-card .brand { justify-content: center; margin-bottom: 8px; }

.actions-inline { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 680px) {
    .admin-shell { flex-direction: column; }
    .admin-side { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
    .admin-nav { display: flex; flex-wrap: wrap; gap: 4px; }
    .admin-main { padding: 22px 18px; }
    .row-2 { grid-template-columns: 1fr; }
    .status-banner h1 { font-size: 22px; }
}
