:root {
    /* Colores del logo de NicaStream */
    --brand: #1565D8;
    --brand-dark: #0D4FB0;
    --brand-indigo: #3010B0;
    --brand-sky: #50A0F0;
    --sidebar-bg: #0b1238;
    --sidebar-w: 240px;
    --bs-primary: var(--brand);
    --bs-primary-rgb: 21, 101, 216;
    --bs-link-color: var(--brand-dark);
    --bs-link-color-rgb: 13, 79, 176;
}

body { background: #f3f5f8; }

.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark);
    --bs-btn-active-border-color: var(--brand-dark);
    --bs-btn-disabled-bg: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
}

/* ---------- Sidebar ---------- */
.sidebar {
    background-color: var(--sidebar-bg) !important; /* Bootstrap pone transparent en offcanvas-lg ≥992px */
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
}
@media (min-width: 992px) {
    .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 1030; }
    .content { margin-left: var(--sidebar-w); }
}
.sidebar.offcanvas-lg { --bs-offcanvas-width: var(--sidebar-w); --bs-offcanvas-bg: var(--sidebar-bg); }
.sidebar-brand {
    display: flex; align-items: center; gap: .5rem;
    color: #fff; font-weight: 700; font-size: 1.15rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand img { flex: none; }
.sidebar-brand small { color: rgba(255,255,255,.5); font-weight: 400; font-size: .75rem; }
.sidebar .nav { padding: .75rem .6rem; flex: 1; }
.sidebar .nav-link {
    color: rgba(255,255,255,.72);
    border-radius: .5rem;
    padding: .55rem .8rem;
    display: flex; gap: .7rem; align-items: center;
}
.sidebar .nav-link:hover { color: #fff; background: rgba(255,255,255,.06); }
.sidebar .nav-link.active { color: #fff; background: var(--brand); }
.sidebar-user { padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,.08); }

.topbar {
    background: var(--sidebar-bg); color: #fff;
    display: flex; align-items: center; gap: .8rem;
    padding: .5rem 1rem; position: sticky; top: 0; z-index: 1020;
}

/* ---------- Contenido ---------- */
.content { padding: 1.5rem; max-width: 100%; }
@media (max-width: 575.98px) { .content { padding: 1rem; } }

.page-header {
    display: flex; flex-wrap: wrap; gap: .75rem;
    align-items: center; justify-content: space-between;
    margin-bottom: 1.25rem;
}
.page-header h1 { font-size: 1.5rem; margin: 0; font-weight: 600; }

.card { border: 0; box-shadow: 0 1px 3px rgba(15,23,36,.08); border-radius: .75rem; }
.card-header { background: #fff; border-bottom: 1px solid #eef0f3; font-weight: 600; border-radius: .75rem .75rem 0 0 !important; }

.stat { padding: 1rem 1.15rem; }
.stat .label { color: #6b7280; font-size: .85rem; }
.stat .value { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
.stat .bi { font-size: 1.6rem; opacity: .85; }

.table > :not(caption) > * > * { padding: .65rem .75rem; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: #6b7280; font-weight: 600; }
.table-card { margin: 0; }
.table-card tr:last-child td { border-bottom: 0; }

.platform-dot {
    display: inline-block; width: .7rem; height: .7rem;
    border-radius: 50%; margin-right: .35rem; vertical-align: baseline;
}

.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.profile-card { border-radius: .75rem; background: #fff; box-shadow: 0 1px 3px rgba(15,23,36,.08); padding: 1rem; border-top: 4px solid #d1d5db; }
.profile-card.libre { border-top-color: #22c55e; }
.profile-card.ocupado { border-top-color: var(--brand); }
.btn-outline-primary {
    --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark);
}
.nav-pills { --bs-nav-pills-link-active-bg: var(--brand); }
.profile-card.vencido { border-top-color: #ef4444; }

.secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---------- Login ---------- */
.guest-content { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem;
    background: radial-gradient(circle at 20% 15%, #1b3f8f 0, var(--sidebar-bg) 65%); }
.login-card { width: 100%; max-width: 400px; }
.login-card .brand { color: #fff; text-align: center; margin-bottom: 1.25rem; }
.login-card .brand img { max-width: 100%; height: auto; filter: drop-shadow(0 6px 18px rgba(0,0,0,.35)); }
.login-card .brand-sub { color: rgba(255,255,255,.6); letter-spacing: .3em; font-size: .8rem; text-transform: uppercase; margin-top: .25rem; }

/* ---------- Importar ---------- */
.import-row-error td { background: #fff1f2 !important; }
.import-row-warning td { background: #fffbeb !important; }
.guest-content .alert { position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 10; }
