* {
    box-sizing: border-box;
}

:root {
    --background: #0b0f14;
    --sidebar: #10151c;
    --card: #141a22;
    --border: #252d38;
    --text: #f1f5f9;
    --muted: #8b96a5;
    --accent: #4f8cff;
    --success: #35d07f;
}

body {
    margin: 0;
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: var(--background);
    color: var(--text);
}


/* LOGIN */

.login-page {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        radial-gradient(
            circle at top,
            #182334,
            var(--background) 55%
        );
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--card);

    border: 1px solid var(--border);

    border-radius: 18px;

    padding: 40px;

    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.4);
}

.login-logo {
    width: 60px;
    height: 60px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0 auto 20px;

    border-radius: 15px;

    background: var(--accent);

    font-size: 28px;
}

.login-card h1 {
    text-align: center;

    margin: 0;

    font-size: 25px;
}

.login-subtitle {
    text-align: center;

    color: var(--muted);

    margin: 8px 0 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;

    margin-bottom: 8px;

    font-size: 14px;

    color: var(--muted);
}

.form-group input {
    width: 100%;

    padding: 13px 14px;

    border-radius: 10px;

    border: 1px solid var(--border);

    background: #0d1218;

    color: white;

    outline: none;

    font-size: 15px;
}

.form-group input:focus {
    border-color: var(--accent);
}

.login-button {
    width: 100%;

    padding: 13px;

    border: none;

    border-radius: 10px;

    background: var(--accent);

    color: white;

    font-size: 15px;

    font-weight: 600;

    cursor: pointer;
}

.login-button:hover {
    opacity: 0.9;
}

.login-error {
    padding: 12px;

    margin-bottom: 20px;

    border-radius: 10px;

    background: #351b20;

    border: 1px solid #71323b;

    color: #ff9fa8;

    font-size: 14px;
}


/* DASHBOARD */

.dashboard {
    display: flex;

    min-height: 100vh;
}


/* SIDEBAR */

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar {
    width: 250px;

    position: fixed;

    top: 0;
    bottom: 0;
    left: 0;

    background: var(--sidebar);

    border-right: 1px solid var(--border);

    padding: 24px 16px;

    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.sidebar-logo {
    display: flex;

    align-items: center;

    gap: 12px;

    padding: 8px 12px 28px;
    position: relative;
}

.sidebar-logo .logo-text {
    flex: 1;
}

.sidebar-logo strong {
    display: block;

    font-size: 16px;
}

.sidebar-logo span {
    display: block;

    color: var(--muted);

    font-size: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background: var(--accent);
}

.sidebar-close-btn {
    display: none;
    background: #1f242c;
    border: 1px solid var(--border);
    color: #f0f6fc;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
}

.nav-item {
    display: flex;

    align-items: center;

    gap: 12px;

    padding: 12px 14px;

    margin-bottom: 5px;

    border-radius: 9px;

    color: var(--muted);

    text-decoration: none;

    font-size: 14px;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
    background: #171e27;

    color: white;
}

.nav-item.active {
    background: #1a3158;

    color: white;
}

.sidebar-bottom {
    margin-top: auto;
}

.logout {
    display: flex;

    gap: 12px;

    align-items: center;

    padding: 12px 14px;

    color: var(--muted);

    text-decoration: none;

    border-radius: 9px;
}

.logout:hover {
    background: #171e27;

    color: white;
}


/* MAIN */

.main {
    margin-left: 250px;

    width: calc(100% - 250px);
    min-width: 0;
}

.topbar {
    min-height: 80px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 14px 35px;

    border-bottom: 1px solid var(--border);

    background: rgba(11, 15, 20, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.mobile-menu-btn {
    display: none;
    background: #161b22;
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    padding: 9px;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    position: relative;
    z-index: 101;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: #f0f6fc;
    border-radius: 2px;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.mobile-menu-btn:active {
    background: #1f242c;
    border-color: #58a6ff;
}

.topbar h1 {
    margin: 0 0 2px;

    font-size: 22px;
}

.topbar p {
    margin: 0;

    color: var(--muted);

    font-size: 13px;
}

.status {
    display: flex;

    align-items: center;

    gap: 8px;

    color: var(--muted);

    font-size: 13px;
}

.status-dot {
    width: 8px;
    height: 8px;

    display: inline-block;

    border-radius: 50%;

    background: var(--success);

    box-shadow: 0 0 10px rgba(53, 208, 127, 0.5);
}

.content {
    padding: 30px 35px;
}


/* CARDS */

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 18px;
}

.stat-card {
    background: var(--card);

    border: 1px solid var(--border);

    border-radius: 15px;

    padding: 22px;
}

.stat-header {
    display: flex;

    align-items: center;

    justify-content: space-between;

    color: var(--muted);

    font-size: 13px;
}

.stat-icon {
    font-size: 18px;
}

.stat-value {
    margin-top: 12px;

    font-size: 30px;

    font-weight: 700;
}

.stat-value.uptime {
    font-size: 20px;
}

.progress {
    height: 6px;

    margin-top: 18px;

    overflow: hidden;

    border-radius: 10px;

    background: #252d38;
}

.progress-bar {
    height: 100%;

    width: 0;

    border-radius: 10px;

    background: var(--accent);

    transition: width 0.4s ease;
}

.stat-footer {
    margin-top: 10px;

    color: var(--muted);

    font-size: 12px;
}


/* PANELS */

.section-grid {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 18px;

    margin-top: 18px;
}

.panel {
    background: var(--card);

    border: 1px solid var(--border);

    border-radius: 15px;

    padding: 24px;
}

.panel-header h2 {
    margin: 0;

    font-size: 17px;
}

.panel-header p {
    margin: 5px 0 20px;

    color: var(--muted);

    font-size: 12px;
}

.info-row,
.status-row {
    display: flex;

    justify-content: space-between;

    align-items: center;

    padding: 14px 0;

    border-bottom: 1px solid var(--border);

    font-size: 13px;
}

.info-row:last-child,
.status-row:last-child {
    border-bottom: none;
}

.info-row span,
.status-row span {
    color: var(--muted);
}

.status-row {
    justify-content: flex-start;

    gap: 10px;
}

.status-row strong {
    margin-left: auto;

    color: var(--success);

    font-size: 12px;
}

/* =========================================================
   SERVER HISTORY
   ========================================================= */

.history-card {
    margin-top: 24px;
    padding: 24px;

    background: #0d1117;

    border: 1px solid #222a35;
    border-radius: 16px;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.25);

    overflow: hidden;
}


/* Header */

.history-top {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 22px;
}


.history-top h2 {
    margin: 0;

    font-size: 22px;
    font-weight: 700;

    color: #f3f4f6;
}


.history-top p {
    margin: 6px 0 0;

    font-size: 14px;

    color: #8b949e;
}


/* Dropdown */

#history-range {
    appearance: none;

    min-width: 130px;

    padding: 9px 34px 9px 12px;

    border: 1px solid #30363d;
    border-radius: 8px;

    background:
        #161b22
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%238b949e' d='m7 10 5 5 5-5z'/%3E%3C/svg%3E")
        no-repeat right 10px center;

    color: #e6edf3;

    font-size: 13px;

    cursor: pointer;

    outline: none;

    transition:
        border-color .2s,
        background .2s;
}


#history-range:hover {
    border-color: #4b5563;
}


#history-range:focus {
    border-color: #58a6ff;
}


/* Stats */

.history-stats {
    display: grid;

    grid-template-columns:
        repeat(6, minmax(0, 1fr));

    gap: 12px;

    margin-bottom: 24px;
}


.history-stat {
    padding: 14px 16px;

    background: #11161d;

    border: 1px solid #202832;

    border-radius: 12px;
}


.history-stat-label {
    display: flex;

    align-items: center;

    gap: 8px;

    margin-bottom: 7px;

    color: #8b949e;

    font-size: 12px;
}


.history-stat strong {
    display: block;

    color: #f0f6fc;

    font-size: 21px;

    font-weight: 650;
}

.power-dot {
    background: #fbbf24;
}

.history-power-status {
    margin: -12px 0 18px;
    color: #8b949e;
    font-size: 12px;
}

.history-power-status.history-power-unavailable {
    color: #ffd580;
}


/* Dots */

.history-dot {
    width: 8px;
    height: 8px;

    border-radius: 50%;

    display: inline-block;
}


.cpu-dot {
    background: #4ade80;

    box-shadow:
        0 0 8px rgba(74, 222, 128, .45);
}


.ram-dot {
    background: #60a5fa;

    box-shadow:
        0 0 8px rgba(96, 165, 250, .45);
}


/* Chart */

.chart-wrapper {
    position: relative;

    width: 100%;

    height: 360px;

    border-radius: 12px;

    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,.015),
            rgba(255,255,255,0)
        );

    overflow: hidden;
}


#history-chart {
    display: block;

    width: 100%;
    height: 100%;
}


/* Tooltip */

.chart-tooltip {
    position: absolute;

    display: none;

    pointer-events: none;

    padding: 10px 12px;

    background: rgba(13, 17, 23, .96);

    border: 1px solid #30363d;

    border-radius: 8px;

    box-shadow:
        0 8px 25px rgba(0,0,0,.35);

    color: #e6edf3;

    font-size: 12px;

    line-height: 1.6;

    white-space: nowrap;

    z-index: 10;
}


/* Mobile */

@media (max-width: 800px) {

    .history-stats {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


@media (max-width: 550px) {

    .history-card {
        padding: 16px;
    }


    .history-top {
        align-items: flex-start;

        flex-direction: column;
    }


    #history-range {
        width: 100%;
    }


    .chart-wrapper {
        height: 280px;
    }

}
/* =========================================================
   WEBSITE STATISTICS
   ========================================================= */

.websites-card {
    margin-top: 24px;
    padding: 24px;

    background: #0d1117;

    border: 1px solid #222a35;
    border-radius: 16px;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.25);
}

.websites-top {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 20px;
}

.websites-top h2 {
    margin: 0;

    font-size: 22px;
    font-weight: 700;

    color: #f3f4f6;
}

.websites-top p {
    margin: 6px 0 0;

    font-size: 14px;

    color: #8b949e;
}

.website-count {
    padding: 7px 11px;

    border-radius: 8px;

    background: #11161d;

    border: 1px solid #202832;

    color: #8b949e;

    font-size: 12px;
}


/* WEBSITE LIST */

.websites-list {
    display: flex;

    flex-direction: column;

    gap: 10px;
}


/* WEBSITE ROW */

.website-row {
    display: grid;

    grid-template-columns:
        minmax(220px, 1.5fr)
        repeat(4, minmax(90px, 1fr))
        auto;

    align-items: center;

    gap: 15px;

    padding: 16px;

    background: #11161d;

    border: 1px solid #202832;

    border-radius: 12px;

    transition:
        border-color .2s,
        background .2s;
}

.website-row:hover {
    background: #141a22;

    border-color: #303a47;
}


/* DOMAIN */

.website-domain {
    display: flex;

    align-items: center;

    gap: 12px;

    min-width: 0;
}

.website-status {
    width: 9px;
    height: 9px;

    flex-shrink: 0;

    border-radius: 50%;

    background: var(--success);

    box-shadow:
        0 0 9px rgba(53, 208, 127, .5);
}

.website-status.offline {
    background: #ef4444;

    box-shadow:
        0 0 9px rgba(239, 68, 68, .4);
}

.website-domain-text {
    min-width: 0;
}

.uptime-bar {
    background: #38bdf8;
}

.website-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    color: inherit;
    transition: color 0.15s ease;
}

.website-link:hover strong {
    color: #58a6ff;
    text-decoration: underline;
}

.website-link-icon {
    font-size: 11px;
    color: #8b949e;
    transition: transform 0.15s ease, color 0.15s ease;
}

.website-link:hover .website-link-icon {
    color: #58a6ff;
    transform: translate(1px, -1px);
}

.website-domain-text strong {
    display: inline-block;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    color: #f0f6fc;

    font-size: 14px;
}

.website-domain-text span {
    display: block;

    margin-top: 3px;

    color: #6e7781;

    font-size: 11px;
}


/* WEBSITE NUMBERS */

.website-metric {
    min-width: 0;
}

.website-metric-label {
    margin-bottom: 4px;

    color: #6e7781;

    font-size: 10px;

    text-transform: uppercase;

    letter-spacing: .04em;
}

.website-metric-value {
    color: #e6edf3;

    font-size: 14px;

    font-weight: 600;
}


/* HTTP STATUS */

.website-statuses {
    display: flex;

    align-items: center;

    gap: 5px;
}

.http-badge {
    padding: 4px 6px;

    border-radius: 5px;

    font-size: 10px;

    font-weight: 600;
}

.http-2xx {
    background: rgba(53, 208, 127, .12);

    color: #35d07f;
}

.http-3xx {
    background: rgba(96, 165, 250, .12);

    color: #60a5fa;
}

.http-4xx {
    background: rgba(251, 191, 36, .12);

    color: #fbbf24;
}

.http-5xx {
    background: rgba(239, 68, 68, .12);

    color: #ef4444;
}


/* LAST UPDATE */

.website-updated {
    color: #6e7781;

    font-size: 11px;

    white-space: nowrap;
}


/* LOADING / EMPTY / ERROR */

.website-loading,
.website-empty,
.website-error {
    padding: 30px;

    text-align: center;

    color: #8b949e;

    font-size: 13px;

    background: #11161d;

    border: 1px solid #202832;

    border-radius: 12px;
}

.website-error {
    color: #ff9fa8;

    border-color: #71323b;

    background: #351b20;
}

/* =========================================================
   GENERIC SECTIONS & CARD PANELS
   ========================================================= */

.card-section {
    margin-top: 24px;
    padding: 24px;

    background: #0d1117;

    border: 1px solid #222a35;
    border-radius: 16px;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.25);
}

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

.section-top-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #f3f4f6;
}

.section-top-header p {
    margin: 6px 0 0;
    font-size: 14px;
    color: #8b949e;
}

.badge {
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success {
    background: rgba(53, 208, 127, 0.15);
    border: 1px solid rgba(53, 208, 127, 0.3);
    color: #35d07f;
}

.badge-warning {
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #fbbf24;
}

.text-success {
    color: #35d07f !important;
}

.text-warning {
    color: #fbbf24 !important;
}

.text-danger {
    color: #ef4444 !important;
}

.text-muted {
    color: #8b949e !important;
}

.text-small {
    font-size: 12px !important;
}

.mono-text {
    font-family: monospace;
    word-break: break-all;
}

/* =========================================================
   BACKUPS
   ========================================================= */

.backup-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.summary-mini-card {
    padding: 14px 16px;
    background: #11161d;
    border: 1px solid #202832;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
}

.summary-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #8b949e;
    margin-bottom: 6px;
}

.summary-mini-card strong {
    font-size: 18px;
    color: #f0f6fc;
    font-weight: 700;
}

.summary-subtext {
    font-size: 11px;
    color: #6e7781;
    margin-top: 4px;
}

.backups-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.backup-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.5fr) 1fr 1fr 1.5fr auto;
    align-items: center;
    gap: 15px;
    padding: 16px;
    background: #11161d;
    border: 1px solid #202832;
    border-radius: 12px;
    transition: border-color .2s, background .2s;
}

.backup-row:hover {
    background: #141a22;
    border-color: #303a47;
}

.backup-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.backup-name-group strong {
    display: block;
    color: #f0f6fc;
    font-size: 14px;
}

.backup-name-group span {
    display: block;
    margin-top: 2px;
    color: #6e7781;
    font-size: 11px;
}

.backup-filename {
    font-family: monospace;
    font-size: 12px;
    color: #58a6ff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.backup-age-cell {
    margin-left: auto;
}

/* =========================================================
   SECURITY & LOGINS
   ========================================================= */

.security-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.security-panel {
    background: #11161d;
    border: 1px solid #202832;
    border-radius: 12px;
    padding: 18px 20px;
    margin-top: 18px;
}

.panel-inner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid #202832;
    margin-bottom: 15px;
}

.panel-inner-header h3 {
    margin: 0;
    font-size: 15px;
    color: #f0f6fc;
}

.session-info-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
}

.session-item {
    display: flex;
    flex-direction: column;
}

.session-item span {
    font-size: 11px;
    color: #8b949e;
    margin-bottom: 4px;
}

.session-item strong {
    font-size: 14px;
    color: #f0f6fc;
}

.session-item-full {
    grid-column: 1 / -1;
    margin-top: 5px;
}

.security-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.audit-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
}

.audit-row {
    display: grid;
    grid-template-columns: minmax(140px, 1.2fr) minmax(120px, 1.5fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #0d1117;
    border: 1px solid #202832;
    border-radius: 8px;
    font-size: 12px;
}

.audit-row.failed-row {
    border-color: rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.04);
}

.audit-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.audit-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
}

.success-icon {
    background: rgba(53, 208, 127, 0.15);
    color: #35d07f;
}

.failed-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.audit-user strong {
    display: block;
    color: #f0f6fc;
}

.audit-user span {
    display: block;
    color: #6e7781;
    font-size: 10px;
}

.audit-ua {
    color: #8b949e;
    font-family: monospace;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audit-time {
    color: #6e7781;
    font-size: 11px;
    white-space: nowrap;
    margin-left: auto;
}

.security-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.security-setting-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: #0d1117;
    border: 1px solid #202832;
    border-radius: 10px;
}

.setting-icon-box {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
    background: #161b22;
}

.setting-details {
    flex: 1;
    min-width: 0;
}

.setting-header-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.setting-header-line strong {
    font-size: 13px;
    color: #f0f6fc;
}

.setting-badge {
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.badge-on {
    background: rgba(53, 208, 127, 0.15);
    color: #35d07f;
}

.setting-details p {
    margin: 0;
    font-size: 11px;
    color: #8b949e;
    line-height: 1.4;
}

/* =========================================================
   ALERTS SECTION & NOTIFICATIONS
   ========================================================= */

.nav-badge {
    margin-left: auto;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.nav-badge-critical {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.nav-badge-warning {
    background: #fbbf24;
    color: #111827;
}

.nav-badge-muted {
    background: #21262d;
    color: #8b949e;
}

.status-critical {
    background: rgba(239, 68, 68, 0.15) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    color: #f87171 !important;
}

.status-warning {
    background: rgba(251, 191, 36, 0.15) !important;
    border: 1px solid rgba(251, 191, 36, 0.3) !important;
    color: #fbbf24 !important;
}

.status-dot-critical {
    background: #ef4444 !important;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.7) !important;
}

.status-dot-warning {
    background: #fbbf24 !important;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.7) !important;
}

.badge-critical {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.active-alerts-container {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alert-empty-state {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 20px;
    background: rgba(53, 208, 127, 0.05);
    border: 1px solid rgba(53, 208, 127, 0.2);
    border-radius: 12px;
}

.alert-empty-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(53, 208, 127, 0.15);
    color: #35d07f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    flex-shrink: 0;
}

.alert-empty-text strong {
    display: block;
    font-size: 14px;
    color: #35d07f;
}

.alert-empty-text p {
    margin: 4px 0 0;
    font-size: 12px;
    color: #8b949e;
}

.alert-item-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    border-radius: 12px;
    background: #11161d;
    border: 1px solid #202832;
    transition: transform 0.15s ease;
}

.alert-card-critical {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.05);
}

.alert-card-warning {
    border-color: rgba(251, 191, 36, 0.4);
    background: rgba(251, 191, 36, 0.05);
}

.alert-card-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-card-content {
    flex: 1;
    min-width: 0;
}

.alert-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.alert-card-header strong {
    font-size: 14px;
    color: #f0f6fc;
}

.alert-card-content p {
    margin: 0 0 6px;
    font-size: 12px;
    color: #c9d1d9;
    line-height: 1.4;
}

.alert-time {
    font-size: 11px;
    color: #6e7781;
}

.thresholds-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.threshold-card {
    padding: 14px;
    background: #11161d;
    border: 1px solid #202832;
    border-radius: 12px;
}

.threshold-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.threshold-icon {
    font-size: 18px;
}

.threshold-header strong {
    display: block;
    font-size: 13px;
    color: #f0f6fc;
}

.threshold-tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    background: #1f242c;
    color: #8b949e;
    margin-top: 2px;
}

.threshold-card p {
    margin: 0;
    font-size: 11px;
    color: #8b949e;
    line-height: 1.4;
}

.alert-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
}

.alert-history-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #0d1117;
    border: 1px solid #202832;
    border-radius: 8px;
    font-size: 12px;
}

.alert-history-row.history-active {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.04);
}

.history-main {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 65%;
}

.history-main strong {
    display: block;
    color: #f0f6fc;
    font-size: 13px;
}

.history-main p {
    margin: 2px 0 0;
    color: #8b949e;
    font-size: 11px;
}

.history-meta {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.history-badges {
    display: flex;
    align-items: center;
    gap: 6px;
}

.history-timestamps {
    font-size: 10px;
    color: #6e7781;
}

/* =========================================================
   TOPBAR CONTROLS
   ========================================================= */

.topbar-right-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.refresh-control-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #11161d;
    padding: 6px 10px;
    border: 1px solid #202832;
    border-radius: 8px;
}

.refresh-label {
    font-size: 12px;
    color: #8b949e;
}

.refresh-select {
    background: #161b22;
    border: 1px solid #30363d;
    color: #f0f6fc;
    border-radius: 6px;
    padding: 3px 6px;
    font-size: 12px;
    cursor: pointer;
    outline: none;
}

.btn-icon {
    background: #1f242c;
    border: 1px solid #30363d;
    color: #f0f6fc;
    border-radius: 6px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: transform 0.2s ease, background 0.2s;
}

.btn-icon:hover {
    background: #28303b;
    border-color: #58a6ff;
}

/* =========================================================
   SERVICES & PROCESSES
   ========================================================= */

.services-list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.service-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #0d1117;
    border: 1px solid #202832;
    border-radius: 8px;
}

.service-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.service-info strong {
    display: block;
    font-size: 13px;
    color: #f0f6fc;
}

.service-info span {
    display: block;
    font-size: 11px;
    color: #8b949e;
}

.process-table-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 360px;
    overflow-y: auto;
}

.proc-table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 80px 80px;
    padding: 8px 12px;
    font-size: 11px;
    text-transform: uppercase;
    color: #8b949e;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #202832;
}

.proc-row {
    display: grid;
    grid-template-columns: 2fr 1fr 80px 80px;
    align-items: center;
    padding: 8px 12px;
    background: #11161d;
    border: 1px solid #202832;
    border-radius: 6px;
    font-size: 12px;
}

.proc-name strong {
    display: block;
    color: #f0f6fc;
    font-size: 13px;
}

.proc-name span {
    display: block;
    color: #6e7781;
    font-size: 11px;
    font-family: monospace;
}

.proc-meta span {
    display: block;
    color: #8b949e;
}

.proc-meta small {
    color: #6e7781;
    font-family: monospace;
}

.proc-stat strong {
    color: #f0f6fc;
    font-weight: 600;
}

/* =========================================================
   STORAGE & DATABASES
   ========================================================= */

.db-list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.db-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #0d1117;
    border: 1px solid #202832;
    border-radius: 8px;
}

.db-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.db-icon {
    font-size: 16px;
}

.db-main strong {
    display: block;
    font-size: 13px;
    color: #f0f6fc;
}

.db-main span {
    display: block;
    font-size: 11px;
    color: #8b949e;
}

.db-size strong {
    font-size: 14px;
    color: #58a6ff;
}

.partitions-list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.partition-item {
    background: #0d1117;
    border: 1px solid #202832;
    border-radius: 8px;
    padding: 12px;
}

.partition-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.partition-header strong {
    display: block;
    font-size: 13px;
    color: #f0f6fc;
}

.partition-header span {
    font-size: 11px;
    color: #8b949e;
}

.partition-metrics {
    text-align: right;
}

.bg-danger {
    background: #ef4444 !important;
}

.bg-warning {
    background: #fbbf24 !important;
}

/* =========================================================
   ANALYTICS & ERROR TRACKING
   ========================================================= */

.analytics-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
}

.analytics-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #0d1117;
    border: 1px solid #202832;
    border-radius: 6px;
    font-size: 12px;
}

.path-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70%;
    color: #f0f6fc;
}

.error-path-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 70%;
}

.traffic-feed-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 250px;
    overflow-y: auto;
}

.traffic-event-row {
    display: grid;
    grid-template-columns: 50px 60px 1.5fr 1fr 120px;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #0d1117;
    border: 1px solid #202832;
    border-radius: 6px;
    font-size: 12px;
}

.event-method {
    font-weight: 700;
    color: #8b949e;
    font-size: 11px;
}

.event-path {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #f0f6fc;
}

.event-site {
    color: #8b949e;
    font-size: 11px;
}

.event-ip {
    color: #6e7781;
    font-size: 11px;
    text-align: right;
}

.traffic-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.traffic-data-warning {
    margin: 0 0 14px;
    padding: 10px 12px;
    color: #ffd580;
    background: rgba(210, 153, 34, .1);
    border: 1px solid rgba(210, 153, 34, .45);
    border-radius: 6px;
    overflow-wrap: anywhere;
}

.traffic-chart-wrap {
    position: relative;
    height: 270px;
    min-height: 220px;
}

.traffic-sites-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 10px;
}

.traffic-site-row {
    min-width: 0;
    padding: 12px;
    background: #0d1117;
    border: 1px solid #202832;
    border-radius: 6px;
}

.traffic-site-heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    margin-bottom: 10px;
}

.traffic-site-heading strong,
.traffic-site-heading span {
    overflow-wrap: anywhere;
}

.traffic-site-heading span {
    color: #8b949e;
    font-size: 12px;
}

.traffic-site-bar {
    display: flex;
    overflow: hidden;
    width: 100%;
    height: 8px;
    background: #202832;
    border-radius: 4px;
}

.traffic-site-bar span {
    min-width: 0;
}

.traffic-bar-2xx { background: #3fb950; }
.traffic-bar-3xx { background: #58a6ff; }
.traffic-bar-4xx { background: #d29922; }
.traffic-bar-5xx { background: #f85149; }

.traffic-site-statuses {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.two-factor-panel {
    margin-bottom: 16px;
}

.two-factor-state {
    flex: 0 0 auto;
    padding: 5px 9px;
    border: 1px solid currentColor;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
}

.two-factor-state.enabled { color: #3fb950; }
.two-factor-state.disabled { color: #d29922; }

.two-factor-controls,
.two-factor-form {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.two-factor-form[hidden] {
    display: none;
}

.two-factor-form {
    width: 100%;
    padding-top: 12px;
    border-top: 1px solid #202832;
}

.two-factor-form p {
    margin: 0;
    color: #c9d1d9;
}

.two-factor-secret {
    display: block;
    max-width: 100%;
    padding: 10px 12px;
    overflow-wrap: anywhere;
    color: #f0f6fc;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 4px;
    font-size: 14px;
    letter-spacing: 1px;
}

.two-factor-input-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.two-factor-input-row input {
    min-width: 0;
    min-height: 40px;
    padding: 8px 10px;
    color: #f0f6fc;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 4px;
}

.two-factor-input-row input[type="text"] {
    width: 150px;
}

.two-factor-disable-row input[type="password"] {
    width: min(260px, 100%);
}

.two-factor-feedback:empty {
    display: none;
}

.two-factor-feedback {
    min-height: 18px;
}

/* =========================================================
   SSL CERTIFICATES & SSH SESSIONS
   ========================================================= */

.ssl-certs-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.ssl-cert-card {
    background: #0d1117;
    border: 1px solid #202832;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ssl-cert-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ssl-icon {
    font-size: 18px;
}

.ssl-cert-title strong {
    display: block;
    color: #f0f6fc;
    font-size: 13px;
}

.ssl-cert-title span {
    display: block;
    color: #8b949e;
    font-size: 11px;
}

.ssl-cert-body {
    text-align: right;
}

.ssl-days-count strong {
    font-size: 16px;
}

.ssl-days-count span {
    font-size: 11px;
    color: #8b949e;
    margin-left: 4px;
}

.ssl-dates small {
    display: block;
    color: #6e7781;
    font-size: 10px;
    margin-top: 2px;
}

.ssh-sessions-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ssh-session-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #0d1117;
    border: 1px solid #202832;
    border-radius: 8px;
    font-size: 12px;
}

.ssh-user-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ssh-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.ssh-remote {
    background: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

.ssh-local {
    background: #35d07f;
}

.ssh-user-group strong {
    display: block;
    color: #f0f6fc;
}

.ssh-user-group span {
    display: block;
    font-size: 10px;
    color: #8b949e;
}

.ssh-command {
    color: #8b949e;
    max-width: 35%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =========================================================
   WEBHOOKS & SETTINGS
   ========================================================= */

.webhook-config-box {
    background: #11161d;
    border: 1px solid #202832;
    border-radius: 12px;
    padding: 20px;
}

.form-grid-webhooks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.form-item {
    display: flex;
    flex-direction: column;
}

.form-item label {
    font-size: 12px;
    font-weight: 600;
    color: #f0f6fc;
    margin-bottom: 6px;
}

.styled-input {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 9px 12px;
    color: #f0f6fc;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.styled-input:focus {
    border-color: #58a6ff;
}

.form-item small {
    margin-top: 4px;
    font-size: 11px;
}

.webhook-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #202832;
    flex-wrap: wrap;
}

.btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.2s, opacity 0.2s;
}

.btn-primary {
    background: #238636;
    color: #ffffff;
}

.btn-primary:hover {
    background: #2ea043;
}

.btn-secondary {
    background: #21262d;
    border: 1px solid #30363d;
    color: #f0f6fc;
}

.btn-secondary:hover {
    background: #30363d;
}

.btn-danger {
    background: #da3633;
    color: #ffffff;
}

.btn-danger:hover {
    background: #b62324;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.webhook-msg {
    margin-left: 10px;
    font-size: 13px;
    font-weight: 600;
}

/* =========================================================
   RESPONSIVE DESIGN (TABLETS & MOBILE DEVICES)
   ========================================================= */

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .topbar {
        padding: 14px 24px;
    }

    .content {
        padding: 24px 20px;
    }

    .security-two-col {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .backup-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .session-info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .thresholds-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .history-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 850px) {
    /* Modern Off-Canvas Sidebar */
    .sidebar-backdrop {
        display: block;
        pointer-events: none;
        visibility: hidden;
    }

    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
        visibility: visible;
    }

    .sidebar {
        width: 280px;
        max-width: 82vw;
        transform: translateX(-100%);
        box-shadow: none;
        z-index: 1000;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: 10px 0 40px rgba(0, 0, 0, 0.85);
    }

    .sidebar-close-btn {
        display: flex;
        touch-action: manipulation;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .main {
        margin-left: 0;
        width: 100%;
    }

    .topbar {
        min-height: 64px;
        padding: 10px 16px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .topbar h1 {
        font-size: 20px;
    }

    .topbar p {
        font-size: 12px;
    }

    .content {
        padding: 16px 14px;
    }

    .section-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .card-section,
    .websites-card,
    .history-card {
        padding: 18px 16px;
        border-radius: 14px;
        margin-top: 16px;
    }

    .section-top-header,
    .history-top,
    .websites-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .thresholds-grid {
        grid-template-columns: 1fr;
    }

    .form-grid-webhooks {
        grid-template-columns: 1fr;
    }

    .proc-table-header {
        grid-template-columns: 1.5fr 1fr 60px 60px;
    }

    .proc-row {
        grid-template-columns: 1.5fr 1fr 60px 60px;
    }

    .traffic-event-row {
        grid-template-columns: 45px 50px 1fr 1fr 100px;
        font-size: 11px;
    }

    .website-row {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .website-statuses,
    .website-updated {
        grid-column: span 1;
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 14px 12px;
        border-radius: 12px;
    }

    .stat-header {
        font-size: 12px;
    }

    .stat-value {
        font-size: 22px;
        margin-top: 8px;
    }

    .stat-value.uptime {
        font-size: 15px;
        line-height: 1.25;
    }

    .progress {
        margin-top: 12px;
        height: 5px;
    }

    .stat-footer {
        font-size: 11px;
        margin-top: 6px;
    }

    .topbar-right-controls {
        width: 100%;
        display: flex;
        justify-content: space-between;
        gap: 8px;
    }

    .refresh-control-group {
        padding: 4px 8px;
        flex: 1;
        justify-content: space-between;
    }

    .refresh-label {
        display: none;
    }

    .refresh-select {
        font-size: 11px;
    }

    .backup-summary-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .summary-mini-card {
        padding: 10px 12px;
    }

    .summary-mini-card strong {
        font-size: 15px;
    }

    .session-info-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .backup-row {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px;
    }

    .backup-age-cell {
        margin-left: 0;
    }

    .website-row {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px;
    }

    .website-statuses {
        flex-wrap: wrap;
    }

    .proc-table-header {
        display: none;
    }

    .proc-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 10px;
    }

    .proc-stat {
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .proc-stat::before {
        content: "Load: ";
        font-size: 10px;
        color: #6e7781;
    }

    .traffic-event-row {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 10px;
    }

    .event-ip {
        text-align: left;
    }

    .ssh-session-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .ssh-command {
        max-width: 100%;
    }

    .audit-row {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 10px;
    }

    .audit-time {
        margin-left: 0;
    }

    .security-setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .chart-wrapper {
        height: 250px;
    }

    .history-stats {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .history-stat {
        padding: 10px 12px;
    }

    .history-stat strong {
        font-size: 18px;
    }

    #history-range {
        width: 100%;
    }

    .webhook-actions {
        flex-direction: column;
        width: 100%;
    }

    .webhook-actions .btn {
        width: 100%;
    }

    .login-container {
        padding: 16px;
    }

    .login-card {
        padding: 24px 20px;
    }
}

@media (max-width: 380px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .backup-summary-grid {
        grid-template-columns: 1fr;
    }

    .history-stats {
        grid-template-columns: 1fr;
    }
}

