/* The Tchoum Consulting — Status Page */
:root {
    --brand: #bf1e2e;
    --brand-dark: #981724;
    --brand-soft: #fff0f2;
    --text: #2f323b;
    --muted: #6d7280;
    --line: #e6e8ec;
    --bg: #f7f8fa;
    --surface: #ffffff;
    --success: #16a34a;
    --success-soft: #ecfdf3;
    --warning: #d97706;
    --danger: #dc2626;
    --danger-soft: #fff1f2;
    --shadow: 0 10px 28px rgba(27, 31, 42, .08);
    --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: "Segoe UI", ui-sans-serif, -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--brand); }

.topline { height: 5px; background: var(--brand); }
.shell { max-width: 1440px; margin: 0 auto; padding: 0 34px; }

.site-header {
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(12px);
}
.header-inner {
    min-height: 108px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}
.brand { display: flex; align-items: center; min-width: 250px; text-decoration: none; }
.brand img { width: 315px; max-width: 100%; height: auto; display: block; }
.nav { display: flex; align-items: stretch; gap: 14px; align-self: stretch; }
.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 18px;
    color: #424652;
    font-weight: 650;
    text-decoration: none;
}
.nav-item.active { color: var(--brand); }
.nav-item.active::after {
    content: "";
    position: absolute;
    left: 16px; right: 16px; bottom: 0;
    height: 3px;
    border-radius: 99px 99px 0 0;
    background: var(--brand);
}
.icon { width: 19px; height: 19px; display: inline-block; flex: 0 0 auto; }

main { padding: 42px 0 54px; }
.hero {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 30px;
    align-items: end;
    margin-bottom: 30px;
}
h1 { font-size: clamp(2rem, 3vw, 3rem); line-height: 1.08; letter-spacing: -.03em; margin-bottom: 10px; }
.hero p { color: var(--muted); font-size: 1.08rem; }

.global-banner {
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.global-banner.ok { background: var(--success-soft); color: var(--success); border: 1px solid #bbf7d0; }
.global-banner.down { background: var(--danger-soft); color: var(--danger); border: 1px solid #fecaca; }
.global-banner.warn { background: #fff7ed; color: var(--warning); border: 1px solid #fed7aa; }
.global-banner.info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

.last-update-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 13px;
    min-width: 320px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 4px 14px rgba(27,31,42,.04);
}
.last-update-copy { flex: 1; }
.last-update-label { font-size: .8rem; color: var(--muted); margin-bottom: 3px; }
.last-update-value { font-weight: 750; font-size: .98rem; }
.live-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 5px rgba(191,30,46,.08); }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 34px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: var(--shadow);
    min-height: 132px;
}
.stat-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    display: grid; place-items: center;
    flex: 0 0 auto;
    background: var(--brand-soft);
    color: var(--brand);
}
.stat-card.success .stat-icon { background: var(--success-soft); color: var(--success); }
.stat-card.danger .stat-icon { background: var(--danger-soft); color: var(--danger); }
.stat-card.neutral .stat-icon { background: #f0f2f5; color: #3f4552; }
.stat-label { font-size: .94rem; color: #454a55; margin-bottom: 4px; }
.stat-value { font-size: 2rem; line-height: 1; font-weight: 800; margin-bottom: 8px; letter-spacing: -.025em; }
.stat-meta { color: var(--muted); font-size: .84rem; }
.success-text { color: var(--success); }
.danger-text { color: var(--danger); }

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.search-box { width: min(360px, 100%); position: relative; }
.search-box .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #747a87; }
.search-box input, .filter-select {
    height: 52px;
    border: 1px solid #dfe2e8;
    border-radius: 11px;
    padding: 0 16px;
    background: #fff;
    color: var(--text);
    outline: none;
}
.search-box input { width: 100%; padding-left: 48px; }
.search-box input:focus, .filter-select:focus {
    border-color: rgba(191,30,46,.55);
    box-shadow: 0 0 0 4px rgba(191,30,46,.08);
}
.toolbar-actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

.btn {
    height: 52px;
    border-radius: 10px;
    padding: 0 19px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 750;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-outline { background: #fff; color: var(--brand); border-color: var(--brand); }
.btn-outline:hover { background: var(--brand-soft); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 18px rgba(191,30,46,.18); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-light { background: #f3f4f6; color: #424652; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { height: 38px; padding: 0 14px; font-size: .9rem; }
.btn:disabled { opacity: .58; cursor: not-allowed; transform: none; }

.table-card, .panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}
.panel { padding: 22px; }
.panel h2, .section-title { font-size: 1.2rem; margin-bottom: 14px; }
table { width: 100%; border-collapse: collapse; }
thead th {
    text-align: left;
    padding: 18px 20px;
    font-size: .82rem;
    color: #4f5561;
    font-weight: 800;
    background: #fff;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
tbody td { padding: 17px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfcfd; }

.site-cell { display: flex; align-items: center; gap: 14px; min-width: 240px; }
.site-icon {
    width: 46px; height: 46px; border-radius: 10px; background: #f1f3f6;
    display: grid; place-items: center; color: #48505e; flex: 0 0 auto;
}
.domain { font-weight: 800; margin-bottom: 4px; color: #252933; }
.url { color: #79808d; font-size: .82rem; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-header {
    padding: 14px 20px;
    background: #fafbfc;
    border-bottom: 1px solid var(--line);
    font-weight: 800;
    color: #3f4552;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 8px;
    padding: 6px 10px;
    font-weight: 750;
    font-size: .82rem;
    border: 1px solid currentColor;
    white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.online { color: var(--success); background: var(--success-soft); }
.badge.offline { color: var(--danger); background: var(--danger-soft); }
.badge.checking { color: var(--warning); background: #fff7ed; }

.uptime-wrap { min-width: 140px; }
.uptime-number { font-weight: 700; font-size: .85rem; margin-bottom: 6px; }
.uptime-periods { display: flex; flex-direction: column; gap: 4px; font-size: .75rem; color: var(--muted); }
.progress { height: 5px; background: #e7e9ed; border-radius: 99px; overflow: hidden; }
.progress > span { height: 100%; display: block; border-radius: inherit; background: var(--success); }
.progress > span.bad { background: var(--danger); }
.response { font-weight: 650; color: #4d5360; white-space: nowrap; }
.response.fast { color: var(--success); }
.response.medium { color: var(--warning); }
.response.slow { color: var(--danger); }
.http {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 54px; padding: 5px 9px; border-radius: 8px; font-weight: 800;
    border: 1px solid; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem;
}
.http.success { color: var(--success); background: var(--success-soft); }
.http.redirect { color: var(--warning); background: #fff7ed; }
.http.error { color: var(--danger); background: var(--danger-soft); }
.empty { padding: 56px 24px; text-align: center; color: var(--muted); }

.incident-item, .maint-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}
.incident-item:last-child, .maint-item:last-child { border-bottom: 0; }
.incident-meta { color: var(--muted); font-size: .85rem; margin-top: 6px; }

.site-footer { border-top: 1px solid var(--line); background: #fff; }
.footer-inner {
    min-height: 140px;
    display: grid;
    grid-template-columns: 260px 1fr auto;
    gap: 26px;
    align-items: center;
}
.footer-brand img { width: 205px; height: auto; display: block; }
.footer-center { text-align: center; color: #666d79; font-size: .83rem; line-height: 1.8; }
.footer-center .automatic { display: inline-flex; align-items: center; gap: 7px; }
.footer-links { display: flex; gap: 0; align-items: center; }
.footer-links a {
    color: #626874; text-decoration: none; font-size: .84rem;
    padding: 0 15px; border-right: 1px solid #dddfe3;
}
.footer-links a:last-child { border-right: 0; padding-right: 0; }

.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: .92rem;
}
.alert-success { background: var(--success-soft); color: var(--success); border: 1px solid #bbf7d0; }
.alert-error { background: var(--danger-soft); color: var(--danger); border: 1px solid #fecaca; }
.alert-warning { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

.form-grid { display: grid; gap: 16px; }
.form-row { display: grid; gap: 6px; }
.form-row label { font-weight: 700; font-size: .9rem; }
.form-row input, .form-row select, .form-row textarea {
    border: 1px solid #dfe2e8;
    border-radius: 10px;
    padding: 12px 14px;
    outline: none;
    width: 100%;
}
.form-row textarea { min-height: 110px; resize: vertical; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
    border-color: rgba(191,30,46,.55);
    box-shadow: 0 0 0 4px rgba(191,30,46,.08);
}
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.form-inline { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.checkbox-list { display: grid; gap: 8px; max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.checkbox-list label { display: flex; gap: 8px; align-items: center; font-weight: 500; }

/* Admin layout */
.admin-body { display: flex; min-height: 100vh; background: var(--bg); }
.admin-sidebar {
    width: 260px;
    background: #1f232b;
    color: #fff;
    padding: 24px 0;
    flex-shrink: 0;
}
.admin-sidebar .logo {
    padding: 0 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: 16px;
}
.admin-sidebar .logo img { width: 180px; max-width: 100%; height: auto; filter: brightness(0) invert(1); }
.admin-sidebar a {
    display: block;
    color: rgba(255,255,255,.78);
    text-decoration: none;
    padding: 12px 22px;
    font-weight: 600;
    font-size: .94rem;
}
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(191,30,46,.25); color: #fff; }
.admin-main { flex: 1; min-width: 0; }
.admin-top {
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 16px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.admin-content { padding: 28px; }
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.admin-stat {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
}
.admin-stat .label { color: var(--muted); font-size: .82rem; margin-bottom: 6px; }
.admin-stat .value { font-size: 1.6rem; font-weight: 800; }
.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(160deg, #fff0f2 0%, #f7f8fa 45%, #eef0f4 100%);
}
.login-card {
    width: min(420px, 100%);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--shadow);
}
.login-card h1 { font-size: 1.5rem; margin-bottom: 8px; }
.login-card p { color: var(--muted); margin-bottom: 20px; }

@media (max-width: 1050px) {
    .nav { display: none; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-inner { grid-template-columns: 1fr; text-align: center; padding: 30px 0; }
    .footer-brand { display: flex; justify-content: center; }
    .footer-links { justify-content: center; }
    .admin-body { flex-direction: column; }
    .admin-sidebar { width: 100%; }
}
@media (max-width: 800px) {
    .shell { padding: 0 18px; }
    .header-inner { min-height: 88px; }
    .brand img { width: 255px; }
    .hero { grid-template-columns: 1fr; align-items: start; }
    .last-update-card { min-width: 0; width: 100%; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .search-box { width: 100%; }
    .table-card { overflow-x: auto; }
    table { min-width: 900px; }
    .admin-content { padding: 18px; }
}
@media (max-width: 560px) {
    main { padding-top: 28px; }
    .stats-grid { grid-template-columns: 1fr; }
}
