 :root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #172033;
    --muted: #6c7485;
    --border: #e7eaf0;
    --sidebar: #0f172a;
    --sidebar-text: #cbd5e1;
    --primary: #2563eb;
}

[data-theme="dark"] {
    --bg: #0b1020;
    --card: #111827;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --border: #243044;
    --sidebar: #020617;
    --sidebar-text: #cbd5e1;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 270px;
    background: var(--sidebar);
    color: var(--sidebar-text);
    padding: 24px 18px;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1000;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 800;
    font-size: 20px;
    margin-bottom: 30px;
}

.brand i {
    background: #2563eb;
    padding: 9px 11px;
    border-radius: 14px;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--sidebar-text);
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 14px;
    margin-bottom: 6px;
    transition: .2s;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: rgba(255,255,255,.1);
    color: #fff;
}

.main {
    margin-left: 270px;
    flex: 1;
    min-width: 0;
}

.topbar {
    height: 78px;
    background: rgba(255,255,255,.75);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 16px 28px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: sticky;
    top: 0;
    z-index: 900;
}

[data-theme="dark"] .topbar {
    background: rgba(17,24,39,.75);
}

.content {
    padding: 28px;
}

.clean-card,
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
    color: var(--text);
}

.stat-card {
    padding: 22px;
    position: relative;
    overflow: hidden;
    min-height: 130px;
}

.stat-card span {
    color: var(--muted);
    font-weight: 600;
}

.stat-card strong {
    display: block;
    margin-top: 10px;
    font-size: 34px;
}

.stat-card i {
    position: absolute;
    right: 20px;
    bottom: 18px;
    font-size: 42px;
    opacity: .14;
}

.stat-card.success { border-left: 5px solid #16a34a; }
.stat-card.danger { border-left: 5px solid #dc2626; }
.stat-card.warning { border-left: 5px solid #f59e0b; }

.table {
    color: var(--text);
}

.table thead th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 1px solid var(--border);
}

.table td,
.table th,
.card-header,
.card-footer,
.list-group-item {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

.form-control,
.form-select {
    background-color: var(--card);
    color: var(--text);
    border-color: var(--border);
}

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at top left, #dbeafe, transparent 35%), var(--bg);
    padding: 20px;
}

.auth-card {
    background: #fff;
    width: min(440px, 100%);
    padding: 34px;
    border-radius: 26px;
    box-shadow: 0 20px 60px rgba(15,23,42,.12);
}

.auth-logo {
    width: 70px;
    height: 70px;
    margin: 0 auto;
    border-radius: 22px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #14b8a6);
    font-weight: 900;
    font-size: 24px;
}

.status-body {
    background: #f8fafc;
}

.status-container {
    width: min(1050px, calc(100% - 28px));
    margin: 34px auto;
}

.status-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin-bottom: 26px;
}

.status-logo {
    max-height: 52px;
    margin-bottom: 14px;
}

.status-banner {
    color: #fff;
    padding: 22px 26px;
    border-radius: 22px;
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 24px;
}

.status-banner.success { background: linear-gradient(135deg, #16a34a, #22c55e); }
.status-banner.danger { background: linear-gradient(135deg, #dc2626, #ef4444); }
.status-banner.warning { background: linear-gradient(135deg, #d97706, #f59e0b); }

.status-list {
    background: #fff;
    border: 1px solid #e7eaf0;
    border-radius: 24px;
    overflow: hidden;
}

.status-row {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid #e7eaf0;
}

.status-row:last-child {
    border-bottom: 0;
}

.status-row small {
    display: block;
    color: #64748b;
}

@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
        transition: .2s;
    }
    body.sidebar-open .sidebar {
        transform: translateX(0);
    }
    .main {
        margin-left: 0;
    }
    .content {
        padding: 18px;
    }
    .status-header,
    .status-row {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* New public status page: dark dot-history UI */
.public-status-dark {
    min-height: 100vh;
    margin: 0;
    color: #f8fafc;
    background:
        radial-gradient(circle at 12% 20%, rgba(34, 197, 94, .08), transparent 28%),
        radial-gradient(circle at 82% 16%, rgba(59, 130, 246, .12), transparent 30%),
        linear-gradient(135deg, #09111f 0%, #0c1626 48%, #08111d 100%);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.status-dark-wrap {
    width: min(1500px, calc(100% - 48px));
    margin: 0 auto;
    padding: 28px 0 24px;
}

.status-dark-header {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 22px;
    align-items: center;
    margin-bottom: 34px;
}

.status-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.status-brand-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, .7);
    border-radius: 16px;
    background: rgba(15, 23, 42, .72);
    box-shadow: 0 0 28px rgba(34, 197, 94, .15);
    font-size: 24px;
}

.status-brand h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(26px, 3vw, 38px);
    font-weight: 850;
    letter-spacing: -.04em;
}

.status-head-right {
    text-align: right;
}

.status-head-right h2 {
    margin: 0 0 8px;
    color: #fff;
    font-size: 24px;
    font-weight: 800;
}

.status-head-right p {
    margin: 0;
    color: #94a3b8;
    font-size: 15px;
}

.bell-box {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    position: relative;
    border-radius: 14px;
    color: #e5e7eb;
    background: linear-gradient(145deg, rgba(30, 41, 59, .95), rgba(15, 23, 42, .9));
    border: 1px solid rgba(148, 163, 184, .22);
    box-shadow: 0 16px 40px rgba(0,0,0,.25);
    font-size: 22px;
}

.bell-box span {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #4ade80;
    box-shadow: 0 0 10px #4ade80;
}

.hero-status {
    min-height: 155px;
    padding: 34px 52px;
    display: grid;
    grid-template-columns: 110px 1fr auto;
    gap: 30px;
    align-items: center;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, .18);
    background:
        linear-gradient(90deg, rgba(20, 83, 45, .32), rgba(15, 23, 42, .72) 44%, rgba(15, 23, 42, .82)),
        rgba(15, 23, 42, .82);
    box-shadow: 0 22px 70px rgba(0,0,0,.32);
}

.hero-status.warning {
    background:
        linear-gradient(90deg, rgba(120, 53, 15, .34), rgba(15, 23, 42, .72) 44%, rgba(15, 23, 42, .82)),
        rgba(15, 23, 42, .82);
}

.hero-status.down {
    background:
        linear-gradient(90deg, rgba(127, 29, 29, .34), rgba(15, 23, 42, .72) 44%, rgba(15, 23, 42, .82)),
        rgba(15, 23, 42, .82);
}

.hero-glow-dot {
    width: 64px;
    height: 64px;
    border-radius: 999px;
    background: #4ade80;
    box-shadow:
        0 0 0 14px rgba(34, 197, 94, .14),
        0 0 0 28px rgba(34, 197, 94, .08),
        0 0 44px rgba(74, 222, 128, .95);
}

.hero-status.warning .hero-glow-dot {
    background: #fbbf24;
    box-shadow:
        0 0 0 14px rgba(251, 191, 36, .14),
        0 0 0 28px rgba(251, 191, 36, .08),
        0 0 44px rgba(251, 191, 36, .85);
}

.hero-status.down .hero-glow-dot {
    background: #ff5c5c;
    box-shadow:
        0 0 0 14px rgba(239, 68, 68, .14),
        0 0 0 28px rgba(239, 68, 68, .08),
        0 0 44px rgba(239, 68, 68, .85);
}

.hero-status h2 {
    margin: 0;
    font-size: clamp(34px, 5vw, 56px);
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: -.05em;
    color: #fff;
}

.hero-status h2 span {
    color: #4ade80;
}

.hero-status.warning h2 span,
.hero-status.warning h2 {
    color: #fbbf24;
}

.hero-status.down h2 span,
.hero-status.down h2 {
    color: #ff6b6b;
}

.hero-status p {
    margin: 0;
    color: #cbd5e1;
    font-size: 18px;
    white-space: nowrap;
}

.hero-status p i {
    color: #4ade80;
    margin-right: 8px;
}

.uptime-title-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin: 42px 18px 18px;
}

.uptime-title-row h2 {
    margin: 0;
    color: #fff;
    font-size: 30px;
    font-weight: 850;
}

.uptime-title-row h2 span {
    color: #94a3b8;
    font-size: 22px;
    font-weight: 700;
    margin-left: 8px;
}

.uptime-title-row a {
    color: #4ade80;
    font-size: 18px;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.status-table-dark {
    padding: 18px 26px;
    border-radius: 18px;
    background: rgba(15, 23, 42, .78);
    border: 1px solid rgba(148, 163, 184, .18);
    box-shadow: 0 22px 70px rgba(0,0,0,.32);
    backdrop-filter: blur(14px);
}

.status-service-row {
    display: grid;
    grid-template-columns: 280px 135px 1fr 120px;
    gap: 18px;
    align-items: center;
    min-height: 64px;
    border-bottom: 1px solid rgba(148, 163, 184, .13);
}

.status-service-row:last-child {
    border-bottom: 0;
}

.service-name {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.service-name strong {
    display: block;
    font-size: 18px;
    color: #f8fafc;
    font-weight: 750;
}

.service-name small {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 210px;
}

.service-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 12px;
    background: rgba(15, 23, 42, .92);
    border: 1px solid rgba(148, 163, 184, .18);
    color: #4ade80;
    font-size: 20px;
}

.service-icon.down { color: #ff5c5c; }
.service-icon.warning { color: #fbbf24; }
.service-icon.pending { color: #94a3b8; }

.service-uptime {
    color: #4ade80;
    font-size: 18px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.service-uptime.down-text {
    color: #ff5c5c;
}

.service-uptime i {
    color: #64748b;
    font-size: 15px;
    margin-left: 8px;
}

.dot-history {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    overflow: hidden;
}

.history-dot {
    width: 8px;
    height: 20px;
    border-radius: 999px;
    flex: 0 0 auto;
    background: rgba(100, 116, 139, .38);
}

.history-dot.up {
    background: #35d879;
    box-shadow: 0 0 8px rgba(53, 216, 121, .35);
}

.history-dot.warning {
    background: #fbbf24;
    box-shadow: 0 0 8px rgba(251, 191, 36, .35);
}

.history-dot.down {
    background: #ff5c5c;
    box-shadow: 0 0 8px rgba(255, 92, 92, .35);
}

.history-dot.empty,
.history-dot.pending {
    background: rgba(71, 85, 105, .35);
}

.service-current {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    font-size: 19px;
    font-weight: 650;
}

.service-current span,
.summary-dot {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    display: inline-block;
}

.service-current.up { color: #4ade80; }
.service-current.up span { background: #4ade80; box-shadow: 0 0 10px rgba(74,222,128,.55); }

.service-current.warning { color: #fbbf24; }
.service-current.warning span { background: #fbbf24; box-shadow: 0 0 10px rgba(251,191,36,.55); }

.service-current.down { color: #ff5c5c; }
.service-current.down span { background: #ff5c5c; box-shadow: 0 0 10px rgba(255,92,92,.55); }

.service-current.pending { color: #94a3b8; }
.service-current.pending span { background: #94a3b8; }

.status-footer-summary {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 24px;
    color: #cbd5e1;
    margin-top: 20px;
    font-size: 17px;
}

.summary-dot {
    background: #4ade80;
}

.status-footer-summary .green { color: #4ade80; }
.status-footer-summary .red { color: #ff5c5c; }
.status-footer-summary .yellow { color: #fbbf24; }

.empty-status {
    padding: 50px;
    text-align: center;
    color: #94a3b8;
}

@media (max-width: 1100px) {
    .status-service-row {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 18px 0;
    }

    .service-current {
        justify-content: flex-start;
    }

    .dot-history {
        flex-wrap: wrap;
    }

    .hero-status {
        grid-template-columns: 1fr;
        padding: 30px;
    }

    .hero-status p {
        white-space: normal;
    }
}

@media (max-width: 700px) {
    .status-dark-wrap {
        width: min(100% - 24px, 1500px);
    }

    .status-dark-header {
        grid-template-columns: 1fr;
        align-items: flex-start;
    }

    .status-head-right {
        text-align: left;
    }

    .bell-box {
        display: none;
    }

    .uptime-title-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .status-footer-summary {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 14px;
    }

    .hero-status h2 {
        font-size: 34px;
    }
}


/* Main website landing page */
.site-home-wrap {
    width: min(1320px, calc(100% - 40px));
    margin: 0 auto;
    padding: 28px 0 32px;
}

.site-home-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 55px;
}

.site-home-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
    font-size: 26px;
}

.site-home-brand span {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    color: #4ade80;
    background: rgba(15, 23, 42, .82);
    border: 1px solid rgba(74, 222, 128, .45);
    box-shadow: 0 0 30px rgba(34, 197, 94, .15);
}

.site-home-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-home-nav a {
    color: #cbd5e1;
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, .18);
    background: rgba(15, 23, 42, .55);
}

.site-home-nav a.login-btn {
    color: #08111d;
    background: #4ade80;
    border-color: #4ade80;
    font-weight: 800;
}

.site-home-hero {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 32px;
    align-items: center;
    margin-bottom: 42px;
}

.status-mini-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #cbd5e1;
    background: rgba(15,23,42,.65);
    border: 1px solid rgba(148,163,184,.18);
    padding: 9px 13px;
    border-radius: 999px;
    margin-bottom: 20px;
}

.status-mini-badge span {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #4ade80;
    box-shadow: 0 0 10px #4ade80;
}

.status-mini-badge.warning span { background: #fbbf24; box-shadow: 0 0 10px #fbbf24; }
.status-mini-badge.down span { background: #ff5c5c; box-shadow: 0 0 10px #ff5c5c; }

.site-home-hero h1 {
    color: #fff;
    font-size: clamp(40px, 6vw, 72px);
    line-height: 1;
    letter-spacing: -.06em;
    font-weight: 950;
    margin: 0 0 22px;
}

.site-home-hero p {
    color: #94a3b8;
    font-size: 19px;
    line-height: 1.7;
    max-width: 720px;
    margin-bottom: 28px;
}

.home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.primary-action,
.secondary-action {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    text-decoration: none;
    border-radius: 16px;
    padding: 15px 20px;
    font-weight: 850;
}

.primary-action {
    color: #08111d;
    background: #4ade80;
    box-shadow: 0 16px 35px rgba(34,197,94,.22);
}

.secondary-action {
    color: #e5e7eb;
    background: rgba(15, 23, 42, .75);
    border: 1px solid rgba(148, 163, 184, .22);
}

.home-status-card {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    padding: 38px;
    min-height: 400px;
    background:
        radial-gradient(circle at 20% 20%, rgba(74,222,128,.18), transparent 28%),
        linear-gradient(145deg, rgba(15,23,42,.92), rgba(8,17,31,.82));
    border: 1px solid rgba(148, 163, 184, .18);
    box-shadow: 0 25px 80px rgba(0,0,0,.35);
}

.home-status-card.warning {
    background:
        radial-gradient(circle at 20% 20%, rgba(251,191,36,.18), transparent 28%),
        linear-gradient(145deg, rgba(15,23,42,.92), rgba(8,17,31,.82));
}

.home-status-card.down {
    background:
        radial-gradient(circle at 20% 20%, rgba(255,92,92,.18), transparent 28%),
        linear-gradient(145deg, rgba(15,23,42,.92), rgba(8,17,31,.82));
}

.home-status-glow {
    width: 78px;
    height: 78px;
    border-radius: 999px;
    background: #4ade80;
    box-shadow: 0 0 0 18px rgba(74,222,128,.1), 0 0 65px rgba(74,222,128,.75);
    margin-bottom: 44px;
}

.home-status-card.warning .home-status-glow {
    background: #fbbf24;
    box-shadow: 0 0 0 18px rgba(251,191,36,.1), 0 0 65px rgba(251,191,36,.65);
}

.home-status-card.down .home-status-glow {
    background: #ff5c5c;
    box-shadow: 0 0 0 18px rgba(255,92,92,.1), 0 0 65px rgba(255,92,92,.65);
}

.home-status-card h2 {
    color: #fff;
    margin: 0 0 12px;
    font-size: 34px;
    letter-spacing: -.04em;
}

.home-status-card p {
    margin: 0 0 34px;
    color: #94a3b8;
}

.home-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.home-metric-grid div {
    background: rgba(2, 6, 23, .32);
    border: 1px solid rgba(148, 163, 184, .13);
    border-radius: 18px;
    padding: 16px;
}

.home-metric-grid span {
    display: block;
    color: #94a3b8;
    font-size: 13px;
    margin-bottom: 8px;
}

.home-metric-grid strong {
    color: #fff;
    font-size: 23px;
}

.home-metric-grid strong.green { color: #4ade80; }
.home-metric-grid strong.red { color: #ff5c5c; }

.home-service-preview {
    background: rgba(15, 23, 42, .72);
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 24px;
    padding: 26px;
    box-shadow: 0 22px 70px rgba(0,0,0,.28);
}

.home-section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 12px;
}

.home-section-title h2 {
    color: #fff;
    margin: 0 0 4px;
}

.home-section-title p {
    color: #94a3b8;
    margin: 0;
}

.home-section-title a {
    color: #4ade80;
    text-decoration: none;
    font-weight: 800;
}

.home-service-row {
    display: grid;
    grid-template-columns: 260px 1fr 120px;
    gap: 18px;
    align-items: center;
    min-height: 62px;
    border-bottom: 1px solid rgba(148, 163, 184, .12);
}

.home-service-row:last-child {
    border-bottom: 0;
}

.home-service-row strong {
    display: block;
    color: #f8fafc;
}

.home-service-row small {
    display: block;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-dot-history {
    display: flex;
    gap: 5px;
    overflow: hidden;
}

.site-home-footer {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    color: #64748b;
    margin-top: 22px;
}

@media (max-width: 980px) {
    .site-home-header,
    .site-home-hero,
    .home-section-title,
    .site-home-footer {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: flex-start;
    }

    .home-service-row {
        grid-template-columns: 1fr;
        padding: 16px 0;
    }

    .home-metric-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
