/**
 * Buscador de Canales - Servidores Astras
 * Hoja de estilos principal (Professional UI)
 * Versión: 1.0.0 - EXTERNAL SOURCES READY
 */

/* =========================================
   1. VARIABLES Y TEMAS (Dark/Light)
   ========================================= */
:root {
    /* Colores Base (Dark Mode - Defecto) */
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #0f172a;
    --bg-hover: #334155;
    --border-color: #334155;
    
    --text-main: #f8fafc;
    --text-secondary: #e2e8f0;
    --text-muted: #cbd5e1;
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #475569;
    
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0ea5e9;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    
    --transition: all 0.2s ease-in-out;
}

/* Light Mode Overrides */
[data-theme="light"] {
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --bg-hover: #f1f5f9;
    --border-color: #e2e8f0;
    
    --text-main: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* =========================================
   2. GLOBAL & RESET
   ========================================= */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s, color 0.3s;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main {
    flex: 1;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

/* =========================================
   3. HEADER / NAVBAR
   ========================================= */
.app-header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    z-index: 1020;
    padding: 0.75rem 0;
}

.app-logo {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-logo i {
    color: var(--primary);
    font-size: 1.5rem;
}

/* Dropdowns en Dark/Light */
.dropdown-menu {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.dropdown-item {
    color: var(--text-secondary);
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: var(--bg-hover);
    color: var(--text-main);
}

/* =========================================
   4. CARDS & CONTAINERS
   ========================================= */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: var(--transition);
}

.card-body {
    padding: 1.5rem;
}

/* =========================================
   5. FORMULARIOS Y INPUTS
   ========================================= */
.form-control, .form-select {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: var(--radius-md);
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-input);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
    color: var(--text-main);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.input-group-text {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* =========================================
   6. TABLAS
   ========================================= */
.table {
    color: var(--text-main);
    margin-bottom: 0;
    border-color: var(--border-color);
}

.table thead th {
    background-color: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

.table-hover tbody tr:hover {
    background-color: var(--bg-hover);
}

/* Filas animadas al cargar */
@keyframes fadeInRow {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}
.table tbody tr {
    animation: fadeInRow 0.3s ease-out forwards;
}

/* =========================================
   7. BOTONES
   ========================================= */
.btn {
    font-weight: 500;
    border-radius: var(--radius-md);
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background-color: var(--bg-hover);
    color: var(--text-main);
    border-color: var(--text-secondary);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

/* =========================================
   8. BADGES Y ETIQUETAS
   ========================================= */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.badge-status::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
}

.badge-online {
    background-color: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.badge-offline {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.badge-country {
    background-color: rgba(99, 102, 241, 0.15);
    color: var(--primary);
}

/* Mejor contraste visual para categorías */
.badge-country,
.badge-fuente,
.badge.bg-secondary,
.badge.bg-info,
.badge.bg-primary,
.badge.bg-success,
.badge.bg-warning,
.badge.bg-danger {
    border: 1px solid rgba(255,255,255,0.14);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

/* 🔹 BADGES DE FUENTE EXTERNA (NUEVO) */
.badge-fuente {
    font-size: 0.7rem;
    vertical-align: middle;
    margin-left: 0.25rem;
    font-weight: 500;
}

.badge.bg-purple {
    background-color: #8b5cf6 !important;
    color: white !important;
}

/* Colores específicos por fuente */
.badge-fuente.local {
    background-color: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.badge-fuente.searchtv {
    background-color: rgba(59, 130, 246, 0.2);
    color: var(--info);
}

.badge-fuente.fofa {
    background-color: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

/* =========================================
   9. FOOTER
   ========================================= */
.app-footer {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

/* =========================================
   10. TOASTS (Notificaciones)
   ========================================= */
.toast {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: var(--radius-md);
}

.toast-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

/* =========================================
   11. UTILIDADES RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    .app-header .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .search-section .row > div {
        margin-bottom: 0.5rem;
    }
    
    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table-responsive {
        border-radius: var(--radius-md);
    }
    
    .table td, .table th {
        white-space: nowrap;
        padding: 0.5rem;
    }
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.brand-logo {
    display: inline-block;
    object-fit: contain;
    border-radius: 0.75rem;
    background: rgba(255,255,255,.04);
}
.brand-logo-sm { height: 36px; max-width: 120px; }
.brand-logo-lg { height: 56px; max-width: 220px; }
.auth-brand-title {
    color: #f8fafc;
    letter-spacing: .02em;
    text-shadow: 0 1px 0 rgba(0,0,0,.25);
}
.auth-brand-subtitle { color: #cbd5e1 !important; }
.auth-brand-stack { display:flex; flex-direction:column; align-items:center; gap:.75rem; }
.auth-brand-logos { display:flex; align-items:center; justify-content:center; gap:.75rem; flex-wrap:wrap; }


.player-stage{position:relative;width:100%;aspect-ratio:16/9;background:#000;border-radius:.75rem;overflow:hidden}.player-stage>video,.player-stage .video-js,.player-stage .vjs-tech{width:100%!important;height:100%!important;background:#000}.player-stage>video,.player-stage .vjs-tech{object-fit:contain}.channel-player-el{display:block;width:100%;height:100%;background:#000;object-fit:contain}.player-shell .video-js{width:100%;height:100%;background:#000}.player-shell .vjs-control-bar{font-size:14px}.player-shell .vjs-big-play-button{border:none;border-radius:999px;width:3em;height:3em;line-height:3em;top:50%;left:50%;transform:translate(-50%,-50%)}

.badge-compat{font-size:.72rem;padding:.3rem .55rem;border-radius:999px;display:inline-flex;align-items:center;gap:.3rem}.badge-compat.web_ok{background:rgba(34,197,94,.18);color:#86efac}.badge-compat.limited,.badge-compat.mixed{background:rgba(245,158,11,.18);color:#fcd34d}.badge-compat.vlc{background:rgba(239,68,68,.18);color:#fca5a5}.player-compat{display:inline-flex;align-items:center;gap:.35rem}

.search-empty-highlight{display:inline-block;max-width:760px;padding:1.2rem 1.45rem;border-radius:1.1rem;background:linear-gradient(135deg, rgba(15,23,42,.98), rgba(30,41,59,.92));border:1px solid rgba(96,165,250,.24);box-shadow:0 20px 45px rgba(2,6,23,.28), inset 0 1px 0 rgba(255,255,255,.04);color:#e2e8f0;backdrop-filter:blur(4px)}.search-empty-highlight .search-empty-title,.search-empty-highlight p{color:#f8fafc;font-size:1.08rem;letter-spacing:.2px;text-shadow:0 1px 0 rgba(0,0,0,.28)}.search-empty-highlight small{display:block;color:#cbd5e1;font-size:.95rem;line-height:1.55}


/* =========================================
   Visual polish based on review video
   ========================================= */
body {
    background-attachment: fixed;
}

.app-header {
    backdrop-filter: blur(10px);
    background: linear-gradient(180deg, rgba(10,17,32,.96), rgba(10,17,32,.88));
    border-bottom: 1px solid rgba(148,163,184,.12);
    box-shadow: 0 10px 30px rgba(2,8,23,.18);
}

.auth-card {
    box-shadow: 0 30px 80px rgba(2,8,23,.42), inset 0 1px 0 rgba(255,255,255,.04);
}

.auth-brand-title {
    text-shadow: 0 8px 28px rgba(15,23,42,.35);
    letter-spacing: -.02em;
}

.auth-brand-subtitle {
    color: #dbeafe;
    opacity: .95;
}

#authTab {
    gap: .35rem;
    border-bottom-color: rgba(148,163,184,.22) !important;
}

#authTab .nav-link {
    border-radius: .85rem .85rem 0 0;
    padding: .8rem 1.05rem;
    font-weight: 600;
    color: #cbd5e1;
    background: rgba(15,23,42,.16);
}

#authTab .nav-link.active {
    background: linear-gradient(180deg, rgba(37,99,235,.15), rgba(15,23,42,.88));
    color: #f8fafc;
    border-color: rgba(96,165,250,.25) rgba(96,165,250,.25) rgba(15,23,42,.82);
}

.auth-access-card {
    gap: 1rem;
}

.auth-access-copy-box {
    margin-top: .35rem;
}

.auth-access-title {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    text-align: center;
}

.search-section.card,
.card.player-shell,
.admin-stat,
.card {
    border: 1px solid rgba(148,163,184,.14);
    box-shadow: 0 18px 44px rgba(2,8,23,.12);
}

.search-section.card {
    background: linear-gradient(180deg, rgba(255,255,255,.015), rgba(255,255,255,.01));
}

.search-section .card-body {
    padding: 1.15rem 1.2rem;
}

.search-section .input-group,
.search-section .form-select,
.search-section .btn,
.form-control,
.form-select {
    border-radius: .85rem;
}

.search-section .input-group .form-control {
    box-shadow: none;
}

.quick-filters .btn {
    border-radius: 999px;
    padding-inline: .9rem;
}

.search-empty-highlight {
    background: linear-gradient(180deg, rgba(15,23,42,.92), rgba(30,41,59,.88));
    border: 1px solid rgba(96,165,250,.2);
    border-radius: 1rem;
    padding: .9rem 1.1rem;
    max-width: 520px;
    box-shadow: 0 16px 32px rgba(2,8,23,.18);
}

.search-empty-title {
    color: #f8fafc;
    letter-spacing: .01em;
}

.table > :not(caption) > * > * {
    vertical-align: middle;
}

.table thead th {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #94a3b8;
}

.table tbody tr {
    transition: transform .15s ease, background-color .15s ease;
}

.table tbody tr:hover {
    transform: translateY(-1px);
}

.player-shell .card-header {
    background: linear-gradient(180deg, rgba(15,23,42,.95), rgba(15,23,42,.88));
    border-bottom: 1px solid rgba(148,163,184,.12);
}

.player-stage {
    min-height: 430px;
    background: radial-gradient(circle at top, rgba(37,99,235,.12), rgba(2,8,23,.94));
    border: 1px solid rgba(96,165,250,.16);
    border-radius: 1rem;
    padding: .35rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

.channel-player-el,
.player-stage video,
.player-stage .video-js {
    width: 100% !important;
    height: 100% !important;
    min-height: 405px;
    border-radius: .85rem;
    background: #000;
}

.player-meta {
    background: linear-gradient(180deg, rgba(15,23,42,.9), rgba(30,41,59,.86));
    border: 1px solid rgba(96,165,250,.14);
    border-radius: 1rem;
    padding: 1rem 1rem .7rem;
    box-shadow: 0 14px 28px rgba(2,8,23,.16);
}

.player-meta dt {
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: .73rem;
}

#playerHint {
    border-radius: 1rem;
    border: 1px solid rgba(148,163,184,.14);
    background: linear-gradient(180deg, rgba(15,23,42,.78), rgba(30,41,59,.82));
}

.admin-sidebar {
    background: linear-gradient(180deg, rgba(10,17,32,.98), rgba(15,23,42,.96));
    border-right: 1px solid rgba(148,163,184,.12);
}

.admin-nav .nav-link {
    padding: .8rem .95rem;
    border: 1px solid transparent;
}

.admin-nav .nav-link:hover,
.admin-nav .nav-link.active {
    background: linear-gradient(180deg, rgba(37,99,235,.14), rgba(15,23,42,.8));
    border-color: rgba(96,165,250,.18);
    box-shadow: 0 10px 24px rgba(2,8,23,.16);
}

.admin-stat {
    border-radius: 1rem;
    overflow: hidden;
}

.card-header {
    background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.01));
    border-bottom: 1px solid rgba(148,163,184,.12);
}

.btn-primary,
.btn-success,
.btn-info,
.btn-warning {
    box-shadow: 0 12px 24px rgba(2,8,23,.12);
}

@media (max-width: 991.98px) {
    .player-stage {
        min-height: 300px;
    }
    .channel-player-el,
    .player-stage video,
    .player-stage .video-js {
        min-height: 280px;
    }
}


/* Admin admin theme with cosmic background */
body.admin-white {
    background:
        linear-gradient(rgba(3, 10, 25, 0.82), rgba(3, 10, 25, 0.88)),
        url('../img/admin-bg-cosmic.png') center center / cover no-repeat fixed !important;
    color: #f8fbff !important;
}
body.admin-white .app-header {
    background: rgba(5, 12, 30, 0.76) !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18) !important;
    box-shadow: 0 10px 28px rgba(2, 8, 23, 0.28);
    backdrop-filter: blur(10px);
}
body.admin-white .app-logo,
body.admin-white .app-logo span,
body.admin-white .app-header .btn,
body.admin-white .app-header .dropdown-toggle,
body.admin-white .app-header .dropdown-item,
body.admin-white .app-header .text-primary,
body.admin-white .app-header .text-muted {
    color: #f8fbff !important;
}
body.admin-white .btn.btn-outline,
body.admin-white .theme-toggle,
body.admin-white .app-header .btn.btn-outline {
    border-color: rgba(148, 163, 184, 0.28) !important;
    color: #e2ecff !important;
    background: rgba(15, 23, 42, 0.58) !important;
    box-shadow: 0 10px 22px rgba(2, 8, 23, 0.18);
}
body.admin-white .container-fluid > .row > main,
body.admin-white .container-fluid > .row > nav {
    min-height: calc(100vh - 56px);
}
body.admin-white main {
    background: transparent !important;
}
body.admin-white .admin-sidebar {
    background: linear-gradient(180deg, rgba(11, 19, 38, 0.86), rgba(15, 23, 42, 0.92)) !important;
    border-right: 1px solid rgba(148, 163, 184, 0.18) !important;
    box-shadow: inset -1px 0 0 rgba(255,255,255,0.03);
    backdrop-filter: blur(10px);
}
body.admin-white .admin-nav .nav-link {
    color: #dbeafe !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 0.9rem;
}
body.admin-white .admin-nav .nav-link i {
    color: #93c5fd !important;
}
body.admin-white .admin-nav .nav-link:hover,
body.admin-white .admin-nav .nav-link.active {
    background: linear-gradient(180deg, rgba(59,130,246,0.18), rgba(15,23,42,0.85)) !important;
    border-color: rgba(96,165,250,0.26) !important;
    color: #ffffff !important;
    box-shadow: 0 12px 26px rgba(2,8,23,0.18) !important;
}
body.admin-white .admin-nav .nav-link:hover i,
body.admin-white .admin-nav .nav-link.active i {
    color: #bfdbfe !important;
}
body.admin-white h1,
body.admin-white h2,
body.admin-white h3,
body.admin-white h4,
body.admin-white h5,
body.admin-white h6,
body.admin-white p,
body.admin-white label,
body.admin-white .form-label,
body.admin-white .small,
body.admin-white .table,
body.admin-white .table th,
body.admin-white .table td,
body.admin-white .card,
body.admin-white .card-header,
body.admin-white .card-body,
body.admin-white .card-footer,
body.admin-white .list-group-item,
body.admin-white .fw-semibold,
body.admin-white .font-monospace,
body.admin-white .lead,
body.admin-white .form-text,
body.admin-white .text-dark {
    color: #f8fbff !important;
}
body.admin-white .text-muted,
body.admin-white .small.text-muted,
body.admin-white .form-text {
    color: #cbd5e1 !important;
}
body.admin-white .card,
body.admin-white .admin-stat,
body.admin-white .player-shell,
body.admin-white .search-section.card,
body.admin-white .admin-section,
body.admin-white .table-responsive,
body.admin-white .list-group-item {
    background: linear-gradient(180deg, rgba(10, 17, 32, 0.78), rgba(15, 23, 42, 0.86)) !important;
    border: 1px solid rgba(148, 163, 184, 0.18) !important;
    box-shadow: 0 18px 36px rgba(2, 8, 23, 0.26) !important;
    backdrop-filter: blur(8px);
}
body.admin-white .card-header,
body.admin-white .player-shell .card-header {
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)) !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16) !important;
}
body.admin-white .player-stage,
body.admin-white .player-meta,
body.admin-white #playerHint,
body.admin-white .search-empty-highlight {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.82), rgba(30, 41, 59, 0.86)) !important;
    border: 1px solid rgba(148, 163, 184, 0.18) !important;
    box-shadow: 0 14px 28px rgba(2, 8, 23, 0.22) !important;
}
body.admin-white .form-control,
body.admin-white .form-select,
body.admin-white textarea {
    background: rgba(2, 8, 23, 0.72) !important;
    color: #f8fbff !important;
    border: 1px solid rgba(96, 165, 250, 0.22) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}
body.admin-white .form-control::placeholder,
body.admin-white textarea::placeholder {
    color: #94a3b8 !important;
}
body.admin-white .form-control:focus,
body.admin-white .form-select:focus,
body.admin-white textarea:focus {
    background: rgba(2, 8, 23, 0.82) !important;
    color: #ffffff !important;
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 0.2rem rgba(59,130,246,0.14) !important;
}
body.admin-white .alert-info {
    background: rgba(186, 230, 253, 0.18) !important;
    border-color: rgba(125, 211, 252, 0.34) !important;
    color: #e0f2fe !important;
}
body.admin-white .alert-success {
    background: rgba(34, 197, 94, 0.14) !important;
    border-color: rgba(74, 222, 128, 0.28) !important;
    color: #dcfce7 !important;
}
body.admin-white .alert-danger {
    background: rgba(239, 68, 68, 0.14) !important;
    border-color: rgba(248, 113, 113, 0.32) !important;
    color: #fee2e2 !important;
}
body.admin-white .table thead th {
    color: #dbeafe !important;
    background: rgba(255,255,255,0.04) !important;
    border-bottom-color: rgba(148,163,184,0.16) !important;
}
body.admin-white .table tbody tr {
    background: rgba(255,255,255,0.02) !important;
}
body.admin-white .table tbody tr:hover {
    background: rgba(59,130,246,0.08) !important;
}
body.admin-white .table td,
body.admin-white .table th {
    border-color: rgba(148,163,184,0.14) !important;
}
body.admin-white .badge.bg-secondary { color: #fff !important; }
body.admin-white .btn-primary { box-shadow: 0 10px 22px rgba(37,99,235,0.24) !important; }
body.admin-white .btn-success { box-shadow: 0 10px 22px rgba(22,163,74,0.24) !important; }
body.admin-white .btn-warning { box-shadow: 0 10px 22px rgba(245,158,11,0.24) !important; }
body.admin-white .btn-info { box-shadow: 0 10px 22px rgba(6,182,212,0.24) !important; }
body.admin-white .btn {
    border-radius: 0.8rem;
}
body.admin-white .admin-stat .card-body,
body.admin-white .card-body {
    position: relative;
}
body.admin-white .admin-stat .card-body::after,
body.admin-white .card-body::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
body.admin-white hr,
body.admin-white .border-top,
body.admin-white .border-bottom {
    border-color: rgba(148,163,184,0.16) !important;
}



/* Admin readability and compact layout refinements */
body.admin-white .table {
    --bs-table-bg: transparent !important;
    --bs-table-color: #f8fbff !important;
    --bs-table-hover-bg: rgba(59,130,246,0.10) !important;
    --bs-table-hover-color: #ffffff !important;
    --bs-table-striped-bg: rgba(255,255,255,0.03) !important;
    --bs-table-striped-color: #f8fbff !important;
    --bs-table-active-bg: rgba(59,130,246,0.14) !important;
    --bs-table-active-color: #ffffff !important;
    margin-bottom: 0;
}
body.admin-white .table td,
body.admin-white .table th {
    background: transparent !important;
    vertical-align: middle;
}
body.admin-white .table a,
body.admin-white .table .fw-bold,
body.admin-white .table .fw-semibold {
    color: #eaf2ff !important;
}
body.admin-white .table a:hover {
    color: #ffffff !important;
}
body.admin-white .table .text-muted,
body.admin-white .table small,
body.admin-white small.text-muted,
body.admin-white .table small.text-muted {
    color: #c7d5ea !important;
}
body.admin-white .table code {
    color: #f8fbff !important;
    background: rgba(15,23,42,0.55);
    border: 1px solid rgba(148,163,184,0.16);
    border-radius: .45rem;
    padding: .18rem .38rem;
}
body.admin-white .table-responsive {
    background: linear-gradient(180deg, rgba(10,17,32,0.72), rgba(15,23,42,0.82));
    border-radius: 1rem;
}
body.admin-white .form-label,
body.admin-white .card-title {
    color: #f8fbff !important;
}
body.admin-white .card-body .btn-sm {
    padding: .3rem .68rem;
    border-radius: .7rem;
}
body.admin-white .admin-users-main .card-body,
body.admin-white .admin-users-main .card-header {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}
body.admin-white .admin-users-main .card-body {
    padding-top: .9rem !important;
    padding-bottom: .9rem !important;
}
body.admin-white .admin-users-main .form-control {
    padding: .52rem .72rem;
    font-size: .95rem;
}
body.admin-white .admin-users-main .form-label.small {
    font-size: .92rem;
}
body.admin-white .admin-users-main .table th,
body.admin-white .admin-users-main .table td {
    font-size: .93rem;
    padding-top: .7rem;
    padding-bottom: .7rem;
}
body.admin-white .admin-users-main .table .btn-sm {
    font-size: .82rem;
}
body.admin-white .admin-users-main .table .badge {
    font-size: .73rem;
}
body.admin-white .admin-users-main .table code {
    font-size: .84rem;
}


/* Role badge colors */
.badge-role-admin{background:#2563eb!important;color:#fff!important}
.badge-role-revendedor{background:#ef4444!important;color:#fff!important}
.badge-role-usuario{background:#facc15!important;color:#111827!important}


/* =========================================
   15. CONTRASTE EXTRA EN TEMA OSCURO
   ========================================= */
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .text-secondary,
html[data-theme="dark"] small,
html[data-theme="dark"] .small,
html[data-theme="dark"] label,
html[data-theme="dark"] .form-label,
html[data-theme="dark"] .input-group-text,
html[data-theme="dark"] .dropdown-item,
html[data-theme="dark"] .nav-link,
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .table thead th {
    color: #f8fafc !important;
}

html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] textarea::placeholder,
html[data-theme="dark"] input::placeholder {
    color: #e2e8f0 !important;
    opacity: 1;
}

html[data-theme="dark"] .text-black,
html[data-theme="dark"] .text-dark {
    color: #f8fafc !important;
}


/* Categorías más visibles en resultados */
body.theme-dark .table .badge,
html[data-theme="dark"] .table .badge {
    border-color: rgba(255,255,255,0.18) !important;
}


/* =========================================
   CONTRASTE GLOBAL EXTRA PARA TEXTOS Y TABLAS
   ========================================= */

/* Admin / paneles oscuros: filas más oscuras para que el texto no se pierda */
body.admin-white .table-responsive,
body.theme-dark .table-responsive,
html[data-theme="dark"] .table-responsive {
    background: rgba(8, 15, 30, 0.72) !important;
    border-radius: var(--radius-lg);
}

body.admin-white .table tbody tr,
body.theme-dark .table tbody tr,
html[data-theme="dark"] .table tbody tr {
    background: rgba(12, 20, 36, 0.86) !important;
}

body.admin-white .table tbody tr:nth-child(even),
body.theme-dark .table tbody tr:nth-child(even),
html[data-theme="dark"] .table tbody tr:nth-child(even) {
    background: rgba(16, 26, 46, 0.92) !important;
}

body.admin-white .table tbody tr:hover,
body.theme-dark .table-hover tbody tr:hover,
html[data-theme="dark"] .table-hover tbody tr:hover {
    background: rgba(30, 41, 59, 0.98) !important;
}

/* Texto más visible en tablas y listados */
body.admin-white .table,
body.admin-white .table th,
body.admin-white .table td,
body.admin-white .table a,
body.admin-white .table .fw-semibold,
body.admin-white .table .small,
body.admin-white .table .text-muted,
body.admin-white .table code,
body.admin-white .table .font-monospace,
body.theme-dark .table,
body.theme-dark .table th,
body.theme-dark .table td,
body.theme-dark .table a,
body.theme-dark .table .fw-semibold,
body.theme-dark .table .small,
body.theme-dark .table .text-muted,
body.theme-dark .table code,
body.theme-dark .table .font-monospace,
html[data-theme="dark"] .table,
html[data-theme="dark"] .table th,
html[data-theme="dark"] .table td,
html[data-theme="dark"] .table a,
html[data-theme="dark"] .table .fw-semibold,
html[data-theme="dark"] .table .small,
html[data-theme="dark"] .table .text-muted,
html[data-theme="dark"] .table code,
html[data-theme="dark"] .table .font-monospace {
    color: #f8fbff !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
}

/* Etiquetas y badges más legibles */
body.admin-white .badge,
body.theme-dark .badge,
html[data-theme="dark"] .badge {
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 4px 10px rgba(2,8,23,0.18);
}

/* Formularios y tablas en modo claro: texto oscuro visible */
[data-theme="light"] .table,
[data-theme="light"] .table th,
[data-theme="light"] .table td,
[data-theme="light"] .table a,
[data-theme="light"] .table .fw-semibold,
[data-theme="light"] .table .small,
[data-theme="light"] .table .text-muted,
[data-theme="light"] .table code,
[data-theme="light"] .table .font-monospace,
body.theme-light .table,
body.theme-light .table th,
body.theme-light .table td,
body.theme-light .table a,
body.theme-light .table .fw-semibold,
body.theme-light .table .small,
body.theme-light .table .text-muted,
body.theme-light .table code,
body.theme-light .table .font-monospace {
    color: #0f172a !important;
}

[data-theme="light"] .table tbody tr,
body.theme-light .table tbody tr {
    background: #ffffff !important;
}

[data-theme="light"] .table tbody tr:nth-child(even),
body.theme-light .table tbody tr:nth-child(even) {
    background: #f8fafc !important;
}

[data-theme="light"] .table-hover tbody tr:hover,
body.theme-light .table-hover tbody tr:hover {
    background: #eef2ff !important;
}

/* Encabezados con más contraste */
.table thead th,
body.admin-white .table thead th,
body.theme-dark .table thead th,
html[data-theme="dark"] .table thead th {
    color: #eaf2ff !important;
    font-weight: 700 !important;
}

/* Botones dentro de tablas: mejor contraste visual */
.table td .btn {
    font-weight: 600;
    backdrop-filter: blur(4px);
}

/* Ajuste extra móvil para que el texto no se corte ni se pierda */
@media (max-width: 768px) {
    .table td, .table th {
        font-size: 0.92rem !important;
    }
    .table td .btn {
        font-size: 0.78rem !important;
    }
}
