/* =============================================================================
   EDICON · Control de Pagos — tema y layout
   Para cambiar el color corporativo, edita --brand y --brand-rgb.
   ============================================================================= */
:root {
    --brand:        #3f6d9e;   /* acento azul acero (cámbialo aquí) */
    --brand-rgb:    63, 109, 158;
    --brand-dark:   #335880;
    --brand-accent: #7ba7d4;
    --sidebar-bg:   #1b2635;   /* menú lateral: gris azulado oscuro */
    --topbar-bg:    #243244;   /* barra superior: gris azulado */
    --login-bg-1:   #1b2635;
    --login-bg-2:   #2f4257;
    --sidebar-fg:   #c3cdd9;
    --sidebar-width: 250px;
    --topbar-h:     56px;
}

/* ----- Marca sobre componentes Bootstrap ---------------------------------- */
.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);
}
.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); --bs-btn-active-border-color: var(--brand);
}
.text-primary { color: var(--brand) !important; }
.bg-primary   { background-color: var(--brand) !important; }
.text-bg-primary { background-color: var(--brand) !important; color: #fff !important; }
.link-primary, a.link-primary { color: var(--brand) !important; }
.progress-bar.bg-primary { background-color: var(--brand) !important; }
.form-control:focus, .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 .25rem rgba(var(--brand-rgb), .2);
}
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.spinner-border.text-primary { color: var(--brand) !important; }

body { background: #f1f3f6; }

/* ----- Estructura general ------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }
.app-main  { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

/* ----- Sidebar ------------------------------------------------------------ */
.sidebar {
    width: var(--sidebar-width); flex-shrink: 0;
    background: var(--sidebar-bg); color: var(--sidebar-fg);
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
    transition: margin-left .25s ease;
}
.sidebar-brand {
    display: flex; align-items: center; gap: .6rem;
    padding: 1rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,.08);
    color: #fff; text-decoration: none;
}
.logo-box {
    background: var(--brand); color: #fff; font-weight: 700;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sidebar-brand .logo-box {
    width: 38px; height: 38px; border-radius: 9px; font-size: 1.15rem;
}
.sidebar-brand .brand-text { line-height: 1.1; }
.sidebar-brand .brand-text strong { font-size: 1rem; letter-spacing: .3px; }
.sidebar-brand .brand-text small { color: var(--sidebar-fg); font-size: .72rem; }

.sidebar-nav { padding: .5rem 0; overflow-y: auto; flex: 1 1 auto; }
.sidebar-nav .nav-label {
    padding: .75rem 1.1rem .35rem; font-size: .68rem; text-transform: uppercase;
    letter-spacing: .8px; color: #64748b;
}
.sidebar-nav a {
    display: flex; align-items: center; gap: .7rem;
    padding: .6rem 1.1rem; color: var(--sidebar-fg); text-decoration: none;
    border-left: 3px solid transparent; font-size: .93rem;
}
.sidebar-nav a i { width: 18px; text-align: center; opacity: .85; }
.sidebar-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav a.active {
    background: rgba(var(--brand-rgb), .22); color: #fff;
    border-left-color: var(--brand-accent);
}
.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,.08); padding: .85rem 1.1rem;
    font-size: .85rem;
}
.sidebar-footer .user-name { color: #fff; }

/* ----- Topbar (oscuro) ---------------------------------------------------- */
.topbar {
    height: var(--topbar-h); background: var(--topbar-bg);
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex; align-items: center; gap: .75rem; padding: 0 1rem;
    position: sticky; top: 0; z-index: 100;
}
.topbar .btn-toggle {
    border: 0; background: transparent; font-size: 1.2rem; color: #cbd5e1;
    line-height: 1; padding: .35rem .5rem; border-radius: 8px;
}
.topbar .btn-toggle:hover { background: rgba(255,255,255,.1); color: #fff; }
.topbar .topbar-title { font-weight: 600; color: #e2e8f0; }
.topbar .btn-outline-secondary {
    --bs-btn-color: #cbd5e1; --bs-btn-border-color: rgba(255,255,255,.25);
    --bs-btn-hover-bg: rgba(255,255,255,.12); --bs-btn-hover-border-color: rgba(255,255,255,.4);
    --bs-btn-hover-color: #fff;
}

.content { padding: 1.25rem 1.5rem; flex: 1 0 auto; }

/* Pie de página siempre visible */
.app-footer {
    position: sticky; bottom: 0; z-index: 50;
    background: #fff; border-top: 1px solid #e5e7eb;
    padding: .45rem 1.5rem; font-size: .78rem; color: #6b7280;
    display: flex; justify-content: space-between; align-items: center; gap: .5rem;
}
.app-footer strong { color: var(--brand); }

/* ----- Plegado (escritorio) ---------------------------------------------- */
body.sidebar-collapsed .sidebar { margin-left: calc(var(--sidebar-width) * -1); }

/* ----- Móvil: off-canvas -------------------------------------------------- */
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed; left: 0; top: 0; z-index: 1045;
        margin-left: calc(var(--sidebar-width) * -1);
        box-shadow: 0 0 30px rgba(0,0,0,.3);
    }
    body.sidebar-open .sidebar { margin-left: 0; }
    body.sidebar-open .sidebar-backdrop {
        display: block; position: fixed; inset: 0; z-index: 1040;
        background: rgba(0,0,0,.45);
    }
    /* En móvil el estado "collapsed" de escritorio no aplica */
    body.sidebar-collapsed .sidebar { margin-left: calc(var(--sidebar-width) * -1); }
}

/* ----- Notificaciones (campana) ------------------------------------------ */
.notif-dropdown .notif-badge {
    position: absolute; top: -6px; right: -6px;
    font-size: .62rem; padding: .2em .4em; min-width: 1.4em;
}
.notif-menu {
    width: 360px; max-width: 92vw; border: 0;
    box-shadow: 0 8px 30px rgba(0,0,0,.18); border-radius: .6rem; overflow: hidden;
}
.notif-head { border-bottom: 1px solid #e9edf2; background: #f8fafc; }
.notif-head strong { font-size: .92rem; }
.notif-list { max-height: 60vh; overflow-y: auto; }
.notif-empty { font-size: .88rem; }
.notif-item {
    display: flex; gap: .65rem; align-items: flex-start;
    padding: .7rem .9rem; border-bottom: 1px solid #f0f2f5;
    color: #243244; text-decoration: none; transition: background .12s ease;
}
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: #f5f8fb; }
.notif-item.notif-nueva { background: rgba(var(--brand-rgb), .07); }
.notif-item.notif-nueva:hover { background: rgba(var(--brand-rgb), .12); }
.notif-ic { margin-top: .15rem; font-size: .95rem; color: #64748b; }
.notif-critico .notif-ic { color: #dc3545; }
.notif-aviso   .notif-ic { color: #b8860b; }
.notif-info    .notif-ic { color: var(--brand); }
.notif-cuerpo { display: flex; flex-direction: column; min-width: 0; }
.notif-titulo { font-weight: 600; font-size: .86rem; line-height: 1.2; }
.notif-msg {
    font-size: .8rem; color: #4b5563; margin-top: .1rem;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.notif-fecha { font-size: .72rem; color: #94a3b8; margin-top: .2rem; }
.notif-foot { background: #f8fafc; border-top: 1px solid #e9edf2; font-size: .84rem; color: var(--brand); font-weight: 600; }
.notif-foot:hover { background: #eef2f7; }
