:root {
    --sidebar-width: 240px;
    --topbar-height: 56px;
    --primary: #2563eb;
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-active: #2563eb;
    --sidebar-hover: rgba(255,255,255,0.06);
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    background: #f1f5f9;
    color: #1e293b;
    margin: 0;
}

/* ── Sidebar ─────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 1000;
    transition: transform .25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    padding: 18px 20px 10px;
    color: #fff;
    font-size: 16px;
}

.sidebar-nav .nav-link {
    color: var(--sidebar-text);
    padding: 8px 20px;
    border-radius: 6px;
    margin: 1px 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    transition: background .15s, color .15s;
}
.sidebar-nav .nav-link:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-nav .nav-link.active { background: var(--sidebar-active); color: #fff; }

.sidebar-section {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    color: #475569;
    padding: 14px 20px 4px;
    text-transform: uppercase;
}

.sidebar-footer {
    margin-top: auto;
    padding: 14px 16px;
    border-top: 1px solid #1e293b;
}

.avatar-sm {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

/* ── Main content ────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left .25s ease;
}

.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 900;
}

.page-content { padding-top: 20px; }

/* ── Cards ───────────────────────────────── */
.card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: none;
}
.card-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    padding: 14px 20px;
}

/* ── Stat cards ──────────────────────────── */
.stat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
}
.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}
.stat-card .stat-label {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-top: 4px;
}
.stat-card .stat-icon {
    width: 42px; height: 42px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}

/* ── Badge de estado cliente ─────────────── */
.badge-activo    { background: #dcfce7; color: #166534; }
.badge-suspendido{ background: #fef9c3; color: #854d0e; }
.badge-moroso    { background: #fee2e2; color: #991b1b; }
.badge-retirado  { background: #f1f5f9; color: #475569; }

/* ── Alerta corte prominente ─────────────── */
.alerta-corte {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #fff;
    border-radius: 10px;
    padding: 16px 20px;
}
.alerta-corte h5 { font-weight: 700; margin-bottom: 4px; }

/* ── Tablas ──────────────────────────────── */
.table { font-size: 13.5px; }
.table th { font-weight: 600; color: #475569; font-size: 12px;
            text-transform: uppercase; letter-spacing: .04em;
            border-bottom: 2px solid #e2e8f0; }
.table-hover tbody tr:hover { background: #f8fafc; }

/* ── Formularios ─────────────────────────── */
.form-label { font-weight: 500; font-size: 13px; }
.form-control, .form-select {
    font-size: 13.5px;
    border-color: #e2e8f0;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* ── Botones ─────────────────────────────── */
.btn { font-size: 13.5px; font-weight: 500; }
.btn-primary { background: var(--primary); border-color: var(--primary); }

/* ── Login ───────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    background: var(--sidebar-bg);
    display: flex; align-items: center; justify-content: center;
}
.login-card {
    background: #fff;
    border-radius: 14px;
    padding: 40px 36px;
    width: 100%;
    max-width: 380px;
}

/* ── MikroTik estado ─────────────────────── */
.mk-ok   { color: #16a34a; }
.mk-fail { color: #dc2626; }

/* ── Sidebar collapsed (mobile) ─────────── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
}
