@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

:root {
    --sys-900: #042C53;
    --sys-700: #0C447C;
    --sys-500: #185FA5;
    --sys-400: #378ADD;
    --sys-200: #B5D4F4;
    --sys-50:  #E6F1FB;
    --success: #3B6D11;
    --success-bg: #EAF3DE;
    --warning: #854F0B;
    --warning-bg: #FAEEDA;
    --danger: #A32D2D;
    --danger-bg: #FCEBEB;
    --sidebar-w: 220px;
    --topbar-h: 54px;
    --font: 'Outfit', sans-serif;
    --font-mono: 'DM Mono', monospace;
    --radius: 10px;
    --radius-sm: 6px;
    --transition: 0.18s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    font-size: 14px;
    background: #f0f4f8;
    color: #1a2332;
    line-height: 1.5;
}

a { text-decoration: none; color: inherit; }

/* ── LOGIN ── */
.login-page {
    min-height: 100vh;
    background: var(--sys-900);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 380px;
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo img { height: 52px; object-fit: contain; }

.login-logo h1 {
    font-size: 15px;
    font-weight: 500;
    color: var(--sys-900);
    margin-top: 10px;
    line-height: 1.3;
}

.login-logo p {
    font-size: 12px;
    color: #8a9bb0;
    margin-top: 3px;
}

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

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
    color: #1a2332;
    transition: border-color var(--transition);
    background: #f8fafc;
}

.form-group input:focus {
    outline: none;
    border-color: var(--sys-400);
    background: #fff;
}

.btn-primary {
    width: 100%;
    padding: 11px;
    background: var(--sys-900);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition);
    margin-top: 4px;
}

.btn-primary:hover { background: var(--sys-700); }

.alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
}

.alert-danger { background: var(--danger-bg); color: var(--danger); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }
.alert-success { background: var(--success-bg); color: var(--success); }

/* ── LAYOUT ── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: var(--sys-900);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-header {
    padding: 18px 16px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-header img { height: 36px; object-fit: contain; }

.sidebar-server {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.server-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #4ade80;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.nav-section-label {
    padding: 14px 16px 5px;
    font-size: 10px;
    color: rgba(255,255,255,0.3);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 500;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    transition: all var(--transition);
    border-left: 2.5px solid transparent;
    position: relative;
}

.nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.9);
}

.nav-item.active {
    background: rgba(55,138,221,0.2);
    color: #fff;
    border-left-color: var(--sys-400);
}

.nav-item .nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 500;
}

.nav-icon { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
    margin-top: auto;
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

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

.user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--sys-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}

.user-name { font-size: 12px; color: rgba(255,255,255,0.8); font-weight: 500; }
.user-rol { font-size: 10px; color: rgba(255,255,255,0.4); }

.btn-logout {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: color var(--transition);
}

.btn-logout:hover { color: rgba(255,255,255,0.8); }

/* ── MAIN ── */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid #e8edf3;
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 12px;
}

.topbar-title { font-size: 15px; font-weight: 500; color: #1a2332; flex: 1; }

.topbar-badges { display: flex; align-items: center; gap: 8px; }

.badge {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
    white-space: nowrap;
}

.badge-ok { background: var(--success-bg); color: var(--success); }
.badge-warn { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--sys-50); color: var(--sys-500); }

.content-area {
    padding: 24px;
    flex: 1;
}

/* ── CARDS ── */
.section-title {
    font-size: 11px;
    font-weight: 600;
    color: #8a9bb0;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

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

.metric-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid #e8edf3;
}

.metric-label { font-size: 11px; color: #8a9bb0; font-weight: 500; margin-bottom: 6px; }
.metric-value { font-size: 28px; font-weight: 600; color: #1a2332; line-height: 1; }
.metric-sub { font-size: 11px; color: #8a9bb0; margin-top: 4px; }

.progress-bar {
    height: 4px;
    background: #e8edf3;
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-fill { height: 100%; border-radius: 2px; transition: width 0.5s ease; }
.progress-blue { background: var(--sys-400); }
.progress-green { background: #639922; }
.progress-amber { background: #BA7517; }
.progress-red { background: #E24B4A; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }

.card {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid #e8edf3;
    overflow: hidden;
}

.card-header {
    padding: 14px 18px 12px;
    border-bottom: 1px solid #f0f4f8;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title { font-size: 13px; font-weight: 500; color: #1a2332; }
.card-body { padding: 0 18px; }

/* ── TABLE ROWS ── */
.table-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f4f8;
    font-size: 13px;
}

.table-row:last-child { border-bottom: none; }

.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-green { background: #639922; }
.dot-amber { background: #BA7517; }
.dot-red { background: #E24B4A; }
.dot-gray { background: #888780; }

.row-main { flex: 1; color: #1a2332; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { font-size: 11px; color: #8a9bb0; }
.row-tag { font-size: 10px; background: #f0f4f8; color: #4a5568; padding: 2px 8px; border-radius: 4px; font-family: var(--font-mono); }

/* ── AVATAR ── */
.avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--sys-50);
    color: var(--sys-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

/* ── DISK BAR ── */
.disk-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid #f0f4f8; font-size: 12px; }
.disk-row:last-child { border-bottom: none; }
.disk-name { width: 120px; color: #4a5568; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.disk-bar-wrap { flex: 1; height: 6px; background: #f0f4f8; border-radius: 3px; overflow: hidden; }
.disk-bar-fill { height: 6px; border-radius: 3px; background: var(--sys-400); }
.disk-size { width: 60px; text-align: right; color: #8a9bb0; font-family: var(--font-mono); font-size: 11px; }

/* ── SERVICES ── */
.service-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f0f4f8; font-size: 13px; }
.service-row:last-child { border-bottom: none; }
.service-name { flex: 1; color: #1a2332; }
.service-status { font-size: 11px; font-weight: 500; }
.status-active { color: var(--success); }
.status-inactive { color: var(--danger); }
.service-uptime { font-size: 11px; color: #8a9bb0; font-family: var(--font-mono); }

/* ── SECURITY ── */
.sec-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f0f4f8; font-size: 13px; }
.sec-item:last-child { border-bottom: none; }
.sec-label { flex: 1; color: #4a5568; }
.sec-value { font-weight: 500; color: #1a2332; font-family: var(--font-mono); }

/* ── SSL ── */
.ssl-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f0f4f8; font-size: 12px; }
.ssl-item:last-child { border-bottom: none; }
.ssl-domain { flex: 1; color: #1a2332; font-family: var(--font-mono); font-size: 11px; }

/* ── LOG ── */
.log-item { padding: 8px 0; border-bottom: 1px solid #f0f4f8; font-size: 12px; display: flex; gap: 10px; }
.log-item:last-child { border-bottom: none; }
.log-time { color: #8a9bb0; font-family: var(--font-mono); font-size: 11px; width: 130px; flex-shrink: 0; }
.log-user { color: var(--sys-500); font-weight: 500; width: 80px; flex-shrink: 0; }
.log-msg { flex: 1; color: #4a5568; }

/* ── FORMS ── */
.form-inline { display: flex; gap: 8px; align-items: center; }

input[type=text], input[type=email], input[type=password], select, textarea {
    padding: 8px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    color: #1a2332;
    background: #f8fafc;
    transition: border-color var(--transition);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--sys-400);
    background: #fff;
}

.btn {
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    cursor: pointer;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #4a5568;
    transition: all var(--transition);
    font-weight: 500;
}

.btn:hover { background: #f0f4f8; border-color: #c8d4e0; }

.btn-sys {
    background: var(--sys-900);
    border-color: var(--sys-900);
    color: #fff;
}

.btn-sys:hover { background: var(--sys-700); border-color: var(--sys-700); }

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

/* ── TABS ── */
.tabs { display: flex; gap: 2px; margin-bottom: 16px; border-bottom: 1px solid #e8edf3; }
.tab { padding: 8px 16px; font-size: 13px; cursor: pointer; color: #8a9bb0; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all var(--transition); }
.tab:hover { color: #1a2332; }
.tab.active { color: var(--sys-500); border-bottom-color: var(--sys-400); font-weight: 500; }

/* ── MODAL ── */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(4,44,83,0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal-backdrop.show { display: flex; }

.modal {
    background: #fff;
    border-radius: var(--radius);
    width: 100%;
    max-width: 460px;
    padding: 24px;
    margin: 20px;
}

.modal-title { font-size: 15px; font-weight: 500; margin-bottom: 16px; color: #1a2332; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c8d4e0; border-radius: 3px; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .two-col { grid-template-columns: 1fr; }
}
