@import "https://fonts.googleapis.com/css?family=Inter:400,500,600,700,800";

:root {
    --brand: #1e3a8a;
    --brand-dark: #172554;
    --brand-top: #2563eb;
    --brand-light: #0284c7;
    --brand-light-dark: #0369a1;
    --text-dark: #0f172a;
    --on-brand: #ffffff;
    --on-brand-soft: rgba(255,255,255,.85);
}

html, body {
    height: 100%;
    margin: 0;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: #f8fafc;
    color: #334155;
}

a, a:hover, a:focus { text-decoration: none; }

.app-wrapper { display: flex; min-height: 100vh; align-items: stretch; }
.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.app-footer { margin-top: auto; padding: 16px; text-align: center; font-size: 12px; color: #64748b; }

#sidebar {
    width: 235px;
    min-width: 235px;
    background: linear-gradient(180deg, var(--brand-top) 0%, var(--brand) 42%, var(--brand-dark) 100%);
    color: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: width .25s, min-width .25s, margin-right .25s;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
}

#sidebar .sidebar-nav { flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.35) transparent; }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 20px 14px 14px 18px; }
.sidebar-toggle { flex-shrink: 0; width: 44px; height: 44px; margin: -6px -6px -6px 0; padding: 0; border: none; background: none; color: #fff; display: flex; align-items: center; justify-content: center; }
.sidebar-toggle-icono { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; transition: background .15s ease; }
.sidebar-toggle-icono svg { width: 16px; height: 16px; }
.sidebar-toggle:hover .sidebar-toggle-icono { background: rgba(255,255,255,.3); }
.sidebar-brand { flex: 1; min-width: 0; font-size: 14px; font-weight: 800; letter-spacing: .4px; color: #fff; text-transform: uppercase; white-space: nowrap; overflow: hidden; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 12px 18px 18px; border-bottom: 1px solid rgba(255,255,255,.18); }
.sidebar-user .avatar { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.2); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.35); display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--on-brand); flex-shrink: 0; }
.sidebar-user .name { font-size: 13.5px; font-weight: 700; color: var(--on-brand); white-space: nowrap; }
.sidebar-canal label { display: block; font-size: 11px; font-weight: 700; color: var(--on-brand-soft); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; }

.sidebar-nav { list-style: none; margin: 0; padding: 12px 0 20px; }
.sidebar-nav li { display: block; width: 100%; }
.sidebar-nav li a { display: flex; align-items: center; gap: 12px; min-height: 44px; box-sizing: border-box; margin: 0 10px; padding: 0 12px; border-radius: 12px; font-size: 14px; font-weight: 500; color: var(--on-brand-soft); }
.sidebar-nav li + li { margin-top: 4px; }
.sidebar-nav li a .nav-icono { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-nav li a:hover { background: rgba(255,255,255,.10); color: var(--on-brand); }
.sidebar-nav li.active a { background: rgba(255,255,255,.2); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); color: var(--on-brand); font-weight: 700; }

body[data-canal="promotores"] .solo-tecnicos, body[data-canal="tecnicos"] .solo-promotores { display: none !important; }

.sidebar-canal { padding: 12px 18px 18px; border-top: 1px solid rgba(255,255,255,.18); }
.sidebar-canal-switch { display: flex; gap: 2px; background: rgba(15,23,60,.32); border-radius: 12px; padding: 3px; }
.sidebar-canal-btn { flex: 1; min-width: 0; min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: none; background: transparent; color: var(--on-brand-soft); font-size: 12px; font-weight: 700; padding: 8px 4px; border-radius: 9px; cursor: pointer; transition: all .15s ease; }
.sidebar-canal-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-canal-btn:hover { background: rgba(255,255,255,.12); color: var(--on-brand); }
.sidebar-canal-btn.is-activo { background: var(--on-brand); color: var(--brand-dark); box-shadow: 0 1px 3px rgba(15,23,60,.3); }

@media (min-width: 901px) {
    #sidebar.active:not(:has(:focus-visible)) { width: 72px; min-width: 72px; }
    #sidebar.active:not(:has(:focus-visible)) .sidebar-brand,
    #sidebar.active:not(:has(:focus-visible)) .sidebar-user .name,
    #sidebar.active:not(:has(:focus-visible)) .sidebar-canal label,
    #sidebar.active:not(:has(:focus-visible)) .sidebar-canal-btn span,
    #sidebar.active:not(:has(:focus-visible)) .nav-texto { display: none; }
    #sidebar.active:not(:has(:focus-visible)) .sidebar-header { justify-content: center; padding: 20px 0 10px; }
    #sidebar.active:not(:has(:focus-visible)) .sidebar-user { justify-content: center; padding: 4px 0 14px; }
    #sidebar.active:not(:has(:focus-visible)) .sidebar-nav li a { width: 48px; margin: 0 auto; padding: 0; justify-content: center; }
    #sidebar.active:not(:has(:focus-visible)) .sidebar-canal-switch { flex-direction: column; gap: 6px; width: 48px; margin: 0 auto; background: transparent; }
    #sidebar.active:not(:has(:focus-visible)) .sidebar-canal-btn { min-height: 44px; padding: 0; }
}

.main-topbar { display: flex; align-items: center; gap: 14px; min-height: 70px; padding: 0 32px; background: #fff; border-bottom: 1px solid #e2e8f0; }
.main-topbar h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--text-dark); }
.topbar-canal { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 14px; background: #e0f2fe; color: #0369a1; font-size: 13px; font-weight: 700; white-space: nowrap; }
.topbar-canal svg { width: 15px; height: 15px; flex-shrink: 0; }
.topbar-canal [data-icono] { display: none; }
.topbar-canal[data-canal="promotores"] [data-icono="promotores"],
.topbar-canal[data-canal="tecnicos"] [data-icono="tecnicos"] { display: block; }

.topbar-logo-badge { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; background: #0f172a; color: #f8fafc; font-size: 13px; letter-spacing: .3px; }
.topbar-logo-badge span { color: #38bdf8; font-weight: 600; }
.topbar-logo-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; }

.filter-group { display: flex; flex-direction: column; gap: 5px; }
.filter-group label { font-size: 10.5px; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: .4px; }
.filter-group .form-control { min-width: 190px; }

.btn-actualizar { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; background: var(--brand-light); border-color: var(--brand-light); color: #fff; font-size: 12.5px; font-weight: 700; padding: 8px 16px; border-radius: 6px; }
.btn-actualizar:hover { background: var(--brand-light-dark); border-color: var(--brand-light-dark); color: #fff; }
.btn-excel { margin-left: 10px; display: inline-flex; align-items: center; gap: 6px; background: #15803d; border-color: #15803d; color: #fff; font-weight: 700; padding: 9px 18px; border-radius: 6px; }

.section-pane { display: none; }
.section-pane.active { display: block; }
.content-panel { padding: 24px 28px 40px; flex: 1; }

.mod-filtros { background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(15,23,42,.06); padding: 16px 20px; margin-bottom: 18px; display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.mod-filtros .filter-group .form-control { min-width: 160px; }
.mod-filtros-extra { margin-left: auto; display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; padding-bottom: 2px; }

.btn-mod-actualizar { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid #cbd5e1; color: #334155; font-size: 12.5px; font-weight: 600; padding: 8px 14px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.btn-mod-actualizar:hover { background: #f1f5f9; border-color: #94a3b8; }

.visor-foto { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; background: rgba(15, 23, 42, .88); cursor: zoom-out; }
.visor-foto[hidden] { display: none; }
.visor-foto img { max-width: 92vw; max-height: 90vh; border-radius: 8px; cursor: default; }
.visor-foto-cerrar { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .15); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }

.confirmar { width: min(420px, calc(100vw - 32px)); padding: 28px 24px 22px; border: 0; border-radius: 14px; background: #fff; color: var(--text-dark); text-align: center; box-shadow: 0 20px 50px rgba(15, 23, 42, .35); }
.confirmar::backdrop { background: rgba(15, 23, 42, .55); }
.confirmar-icono { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%; background: #e0f2fe; color: var(--brand-light); }
.confirmar-peligro .confirmar-icono, .confirmar-error .confirmar-icono { background: #fee2e2; color: #dc2626; }
.confirmar-titulo { margin: 0 0 8px; font-size: 18px; font-weight: 800; }
.confirmar-texto { margin: 0 0 22px; font-size: 14px; line-height: 1.5; color: #475569; }
.confirmar-acciones { display: flex; justify-content: center; gap: 10px; }
.confirmar-btn { flex: 1; min-height: 44px; padding: 0 18px; border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer; }
.confirmar-btn[hidden] { display: none; }
.confirmar-btn-cancelar { border: 1px solid #cbd5e1; background: #fff; color: var(--text-dark); }
.confirmar-btn-ok { border: 1px solid var(--brand-light); background: var(--brand-light); color: #fff; }
.confirmar-peligro .confirmar-btn-ok, .confirmar-error .confirmar-btn-ok { border-color: #dc2626; background: #dc2626; }

