/* NEXOLINK ISP SYSTEM STYLESHEET - PREMIUM GLASSMORPHIC DESIGN */

/* Reset y Variables Globales */
:root {
    --bg-app: #f0f7ff;
    --bg-sidebar: #072448;
    --bg-header: linear-gradient(90deg, #0088eb 0%, #0070f3 50%, #0265d6 100%);
    --bg-card: #ffffff;
    --border-glass: #e2e8f0;
    --border-glass-hover: #d1d5db;
    
    --text-main: #333333;
    --text-muted: #6b7280;
    --text-sidebar: #cbd5e1;
    --text-sidebar-hover: #ffffff;
    
    --primary: #0070f3;
    --primary-glow: rgba(0, 112, 243, 0.25);
    --primary-hover: #005bb5;
    
    --success: #28a745;
    --success-glow: rgba(40, 167, 69, 0.2);
    
    --warning: #ff9800;
    --warning-glow: rgba(255, 152, 0, 0.2);
    
    --danger: #dc3545;
    --danger-glow: rgba(220, 53, 69, 0.2);
    
    --info: #0284c7;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    
    --sidebar-width: 250px;
    --header-height: 60px;
    
    --shadow-premium: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --transition-smooth: all 0.2s ease;
}

.dark-theme {
    --bg-app: #222d32;
    --bg-sidebar: #1a2226;
    --bg-header: #1a2226;
    --bg-card: #2c3b41;
    --border-glass: #3c8dbc;
    --text-main: #f3f4f6;
    --text-muted: #8a97a0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-app);
    color: var(--text-main);
    font-family: var(--font-body);
    overflow-x: hidden;
    transition: var(--transition-smooth);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Scrollbar Personalizado */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* LAYOUT PRINCIPAL */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    background: #072448;
    background: linear-gradient(180deg, #072448 0%, #051d3b 100%);
    box-shadow: 2px 0 16px rgba(7, 36, 72, 0.15);
    border-right: none;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition-smooth);
    color: #fff;
}

.sidebar-brand {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #051a36;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: none;
    height: var(--header-height);
}

.brand-logo i {
    font-size: 24px;
    color: #38bdf8;
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.5));
}

.brand-text h2 {
    font-size: 20px;
    font-weight: 700;
}

.brand-text span {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-menu {
    flex: 1;
    padding: 24px 16px;
    overflow-y: auto;
}

.sidebar-menu ul {
    list-style: none;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 15px;
    color: var(--text-sidebar);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 0;
    border-left: 3px solid transparent;
    transition: var(--transition-smooth);
}

.menu-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.menu-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.09);
}

.menu-item.active {
    color: #ffffff !important;
    background: linear-gradient(90deg, #0088eb 0%, #0070f3 100%) !important;
    border-left: none !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 14px rgba(0, 112, 243, 0.45) !important;
}

.menu-separator {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #7ea5d3;
    background: transparent;
    margin: 14px 0 6px 0;
    padding: 6px 14px;
    letter-spacing: 0.06em;
}

.sidebar-badge {
    margin-left: auto;
    font-size: 10px;
    padding: 2px 6px;
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-glass);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-glass);
}

.user-info h4 {
    font-size: 14px;
    color: var(--text-main);
}

.user-info span {
    font-size: 12px;
    color: var(--text-muted);
}

/* MAIN CONTENT */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* HEADER */
.main-header {
    height: var(--header-height);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, #0088eb 0%, #0070f3 50%, #0265d6 100%) !important;
    color: #ffffff !important;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: 0 3px 14px rgba(0, 112, 243, 0.25) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.header-left h1 {
    font-size: 24px;
    font-weight: 700;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.global-search {
    position: relative;
    width: 300px;
}

.global-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.global-search input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: 30px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 13px;
    transition: var(--transition-smooth);
}

.global-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 10px var(--primary-glow);
}

.search-results-dropdown {
    position: absolute;
    top: 48px;
    left: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    box-shadow: var(--shadow-premium);
    backdrop-filter: blur(15px);
    max-height: 250px;
    overflow-y: auto;
    z-index: 120;
    display: none;
}

.search-results-dropdown.active {
    display: block;
}

.search-item {
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-smooth);
}

.search-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.search-item span.ip-tag {
    font-size: 11px;
    color: var(--text-muted);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 30px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success-glow);
}

.status-indicator.online {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success-glow);
}

.status-indicator.offline {
    background-color: var(--danger);
    box-shadow: 0 0 8px var(--danger-glow);
}

/* APP SECTIONS */
.section-container {
    padding: 20px 24px;
    flex: 1;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}
@media (max-width: 768px) {
    .section-container {
        padding: 12px 14px;
    }
}

.app-section {
    display: none;
}

.app-section.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* CARDS & GLASSMORPHISM */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    box-shadow: var(--shadow-premium);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: var(--transition-smooth);
    overflow: hidden;
}

.card:hover {
    border-color: var(--border-glass-hover);
}

.card-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.card-body {
    padding: 24px;
}

/* KPI GRID */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.kpi-card {
    padding: 24px;
    border-radius: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-premium);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition-smooth);
}

.kpi-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-glass-hover);
}

.kpi-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.bg-emerald-trans { background: rgba(16, 185, 129, 0.12); }
.bg-blue-trans { background: rgba(59, 130, 246, 0.12); }
.bg-warning-trans { background: rgba(245, 158, 11, 0.12); }
.bg-coral-trans { background: rgba(244, 63, 94, 0.12); }

.text-emerald { color: var(--success); }
.text-blue { color: var(--primary); }
.text-warning { color: var(--warning); }
.text-coral { color: #f43f5e; }

.kpi-content h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.kpi-content p {
    font-size: 13px;
    color: var(--text-muted);
}

.trend {
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
}

.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }
.trend-stable { color: var(--primary); }

/* DASHBOARD LAYOUT & CHARTS */
.dashboard-layout {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 18px;
    margin-bottom: 20px;
    width: 100%;
}

.dashboard-left {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.dashboard-right {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

@media (max-width: 1100px) {
    .dashboard-layout {
        grid-template-columns: 1fr !important;
    }
}

.chart-card {
    height: 330px;
    display: flex;
    flex-direction: column;
}

.chart-card .card-body {
    flex: 1;
    position: relative;
    padding: 16px;
}

.chart-container {
    width: 100%;
    height: 220px;
}

.traffic-stats-mini {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 13px;
}

.finances-split {
    display: flex;
    justify-content: space-between;
}

.fin-stat span {
    font-size: 12px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 6px;
}

.fin-stat h4 {
    font-size: 20px;
    font-weight: 700;
}

/* SYSTEM LOGS & HARDWARE */
.router-card {
    margin-bottom: 24px;
}

.hw-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-glass);
}

.hw-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.hw-info span {
    font-size: 13px;
    font-weight: 600;
    display: block;
}

.hw-info small {
    font-size: 11px;
    color: var(--text-muted);
}

.hw-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.hw-status-dot.online { background-color: var(--success); box-shadow: 0 0 8px var(--success-glow); }

.syslog-card {
    height: 380px;
    display: flex;
    flex-direction: column;
}

.syslog-card .card-body {
    flex: 1;
    overflow-y: auto;
}

.syslog-timeline {
    position: relative;
    padding-left: 20px;
}

.syslog-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background: var(--border-glass);
}

.syslog-item {
    position: relative;
    margin-bottom: 20px;
    font-size: 12px;
}

.syslog-item:last-child {
    margin-bottom: 0;
}

.syslog-dot {
    position: absolute;
    left: -24px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
    border: 2px solid var(--bg-app);
}

.syslog-dot.network { background: var(--primary); }
.syslog-dot.olt { background: var(--warning); }
.syslog-dot.billing { background: var(--success); }

.syslog-time {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
}

.syslog-title {
    font-weight: 600;
    color: var(--text-main);
    margin-top: 2px;
}

.syslog-desc {
    color: var(--text-muted);
    margin-top: 2px;
}

/* TABLES */
.table-container {
    overflow-x: auto;
    width: 100%;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    padding: 16px 20px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-glass);
}

.data-table td {
    padding: 16px 20px;
    font-size: 13px;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-glass);
}

.data-table tbody tr {
    transition: var(--transition-smooth);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* BADGES AND LABELS */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 30px;
    text-align: center;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.badge-neutral { background: rgba(255, 255, 255, 0.06); color: var(--text-muted); }

.client-status-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
}

.client-status-badge.activo { background: rgba(16, 185, 129, 0.12); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.25); }
.client-status-badge.suspendido { background: rgba(239, 68, 68, 0.12); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.25); }
.client-status-badge.retirado { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); border: 1px solid var(--border-glass); }

.client-signal-badge {
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}
.client-signal-badge.sig-good { color: var(--success); }
.client-signal-badge.sig-warning { color: var(--warning); }
.client-signal-badge.sig-critical { color: var(--danger); }

/* MAP LAYOUT */
.map-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    height: calc(100vh - 180px);
}

.map-sidebar {
    height: 100%;
}

.map-main {
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-premium);
    height: 100%;
    position: relative;
}

#map-container {
    width: 100%;
    height: 100%;
}

/* Custom styles for Leaflet Markers */
.custom-olt-icon, .custom-nap-icon, .custom-client-icon {
    background: none !important;
    border: none !important;
}

.olt-marker-pulse {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px var(--primary);
    animation: markerPulse 2s infinite;
}

.nap-marker {
    width: 36px;
    height: 36px;
    background: #1e293b;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    color: #3b82f6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    position: relative;
}

.nap-marker.nap-full { border-color: var(--danger); color: var(--danger); }
.nap-marker.nap-warning { border-color: var(--warning); color: var(--warning); }
.nap-marker.nap-available { border-color: var(--success); color: var(--success); }

.nap-badge {
    position: absolute;
    bottom: -6px;
    background: var(--bg-app);
    font-size: 8px;
    font-weight: 700;
    padding: 0px 4px;
    border-radius: 10px;
    border: 1px solid var(--border-glass);
    color: var(--text-main);
}

.client-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #ffffff;
}

@keyframes markerPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 15px rgba(59, 130, 246, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

.map-popup {
    font-family: var(--font-body);
    color: #1f2937; /* Leaflet popup default text color */
}

.map-popup h4 {
    margin-bottom: 6px;
    font-size: 14px;
    color: #111827;
}

.map-popup p {
    font-size: 12px;
    margin-bottom: 4px;
    color: #4b5563;
}

.map-legend {
    border-top: 1px solid var(--border-glass);
    padding-top: 20px;
}

.map-legend h4 {
    font-size: 13px;
    margin-bottom: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 12px;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-dot.olt-pulse { background: var(--primary); box-shadow: 0 0 8px var(--primary-glow); }
.legend-dot.nap-blue { background: #1e293b; border: 2px solid var(--primary); }
.legend-dot.client-green { background: var(--success); }
.legend-dot.client-red { background: var(--danger); }

.coords-box {
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--border-glass);
    border-radius: 8px;
    padding: 10px;
    font-family: monospace;
    font-size: 12px;
    text-align: center;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-primary { background: var(--primary); color: #ffffff; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 4px 15px var(--primary-glow); }

.btn-success { background: var(--success); color: #ffffff; }
.btn-success:hover { background: #059669; box-shadow: 0 4px 15px var(--success-glow); }

.btn-outline { background: transparent; border-color: var(--border-glass); color: var(--text-main); }
.btn-outline:hover { background: rgba(255, 255, 255, 0.05); border-color: var(--border-glass-hover); }

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
}
.btn-icon:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 11px;
    border-radius: 8px;
}

.section-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-group {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    padding: 4px;
    border-radius: 10px;
}

.btn-filter {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-filter.active, .btn-filter:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

/* OLT TABS */
.olt-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 16px;
}

.btn-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-tab.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.02);
}

.olt-tab-content {
    display: none;
}

.olt-tab-content.active {
    display: block;
}

/* FORMS */
.form-group {
    margin-bottom: 16px;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 13px;
    transition: var(--transition-smooth);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* MODALS */
.modal-backdrop,
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 7, 15, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.modal-backdrop.active,
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Modal dialog — contenedor flexible para modales grandes */
.modal-dialog {
    background: rgba(13, 20, 38, 0.97);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
    overflow: hidden;
    transform: scale(0.94) translateY(12px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    opacity: 0;
}

/* Activación cuando el modal-backdrop O modal-overlay tienen la clase active */
.modal-backdrop.active .modal-dialog,
.modal-overlay.active .modal-dialog {
    transform: scale(1) translateY(0);
    opacity: 1;
}


.modal-content {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    width: 550px;
    max-width: 90%;
    box-shadow: var(--shadow-premium);
    overflow: hidden;
    transform: scale(0.9);
    transition: var(--transition-smooth);
}

.modal-content.large {
    width: 800px;
}

.modal-backdrop.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-close:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-glass);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.alert {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* CLIENT PROFILE DETAILS & DIAGNOSTICS VIEW */
.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.profile-title h3 {
    font-size: 22px;
    margin-bottom: 4px;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.profile-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 20px;
}

.profile-card h4 {
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 8px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 13px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-row span {
    color: var(--text-muted);
}

.info-row b {
    color: var(--text-main);
}

/* SPEEDTEST & PING WIDGETS */
.diagnostics-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 24px;
}

.diag-widget {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.speedtest-gauge {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 6px dashed var(--border-glass);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 15px 0;
    transition: var(--transition-smooth);
}

.speedtest-gauge.running {
    border-color: var(--primary);
    animation: spinGauge 3s linear infinite;
}

@keyframes spinGauge {
    100% { transform: rotate(360deg); }
}

.speedtest-number {
    font-size: 24px;
    font-weight: 700;
}

.ping-panel {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 10px;
    margin-top: 15px;
    height: 100px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 11px;
    text-align: left;
    border: 1px solid var(--border-glass);
}

.progress-bar-container {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    height: 8px;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.progress-bar-container.large {
    height: 16px;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease-in-out;
}

.progress-bar-fill.bg-emerald {
    background: var(--success);
}
.progress-bar-fill.bg-blue {
    background: var(--primary);
}

.mt-4 { margin-top: 16px; }
.mt-2 { margin-top: 8px; }
.w-full { width: 100%; }
.text-xs { font-size: 11px; }
.text-center { text-align: center; }

/* UTILS ANIMATIONS */
.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* GPON MAP FULLSCREEN MODE STYLES */
.map-layout.fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2000 !important;
    background: var(--bg-app) !important;
    padding: 20px !important;
    margin: 0 !important;
    grid-template-columns: 320px 1fr !important;
}

.btn-map-fullscreen {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1010;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    cursor: pointer;
}

.btn-map-fullscreen:hover {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
    transform: scale(1.05);
}

.btn-map-fullscreen i {
    font-size: 16px;
    transition: var(--transition-smooth);
}

/* NEXOOLT CLOUD PREMIUM STYLES */
.olt-chassis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.olt-connect-grid, .olt-diagnostics-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.promotional-copy {
    padding: 10px;
}

.text-gradient {
    background: linear-gradient(135deg, #3b82f6, #10b981);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.feature-bullets {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.bullet {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13px;
    line-height: 1.5;
}

.bullet i {
    color: var(--success);
    margin-top: 3px;
}

.quote {
    margin-top: 24px;
    padding: 12px 16px;
    border-left: 4px solid var(--primary);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0 12px 12px 0;
    font-style: italic;
    font-size: 13px;
    color: var(--text-muted);
}

.quote cite {
    display: block;
    text-align: right;
    margin-top: 6px;
    font-weight: 600;
    color: var(--text-main);
}

/* Acceso Remoto LAN Ports */
.onu-lan-ports-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.lan-port-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 6px;
    height: 70px;
    font-size: 12px;
    border-radius: 12px;
    border: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.02);
    transition: var(--transition-smooth);
}

.lan-port-btn.active-port {
    border-color: var(--success);
    color: var(--success);
    box-shadow: 0 0 12px var(--success-glow);
}

.lan-port-btn:not(.active-port) {
    border-color: var(--border-glass);
    color: var(--text-muted);
}

/* ── Toast Notifications Stack ── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10000;
    max-width: 420px;
    width: 100%;
    pointer-events: none; /* container transparent — children override below */
}

.toast-container > * {
    pointer-events: auto; /* cada toast es clickeable */
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(120%); }
    to   { opacity: 1; transform: translateX(0); }
}

.toast-alert {
    background: rgba(17, 24, 39, 0.95);
    border-left: 4px solid var(--danger);
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--text-main);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}

.toast-alert.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-alert-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toast-alert-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--danger);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toast-alert-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.toast-alert-close:hover {
    color: var(--text-main);
}

.toast-alert-body {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted);
}

.toast-alert-body b {
    color: var(--text-main);
}

.toast-alert-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}

.toast-alert-btn {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.toast-alert-btn:hover {
    background: var(--danger);
    color: #fff;
}

/* ── TR-069 ACS SERVER STYLES ── */
.acs-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 16px;
}

.acs-tab-content {
    display: none;
}

.acs-tab-content.active {
    display: block;
}

/* parameter tree visual layout */
.acs-param-tree {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 16px;
    height: 280px;
    overflow-y: auto;
}

.acs-param-node {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    font-family: monospace;
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition-smooth);
    user-select: none;
}

.acs-param-node:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}

.acs-param-node.selected {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.08);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.2);
}

/* soap XML terminal box */
.acs-xml-terminal {
    background: #060913;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 16px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 10px;
    color: #38bdf8;
    height: 400px;
    overflow-y: auto;
    line-height: 1.5;
}

.acs-xml-envelope {
    margin-bottom: 16px;
    border-left: 3px solid #3b82f6;
    padding-left: 10px;
}

.acs-xml-req {
    border-left-color: #3b82f6;
    color: #93c5fd;
}

.acs-xml-res {
    border-left-color: #10b981;
    color: #34d399;
}

/* cpe tab sections inside modal */
.cpe-tab-content {
    display: none;
}

.cpe-tab-content.active {
    display: block;
}

/* DROPDOWN MENU CUSTOM FOR ROUTER TOOLS */
.dropdown-container {
    position: relative;
    display: inline-block;
}
.dropdown-menu-custom {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 1000;
    min-width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 8px 0;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: scaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.dropdown-menu-custom.show {
    display: block;
}
.dropdown-item-custom {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 13px;
    transition: var(--transition-smooth);
}
.dropdown-item-custom:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary);
}
.dropdown-item-custom i {
    font-size: 14px;
    width: 16px;
    text-align: center;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-5px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* FINANCE TABS AND SUB-SECTIONS */
.finances-tabs {
    margin-bottom: 20px;
}
.btn-tab-finances {
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
}
.btn-tab-finances.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px var(--primary-glow);
}
.btn-tab-finances:hover:not(.active) {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-glass-hover);
}

/* BILLING DASHBOARD KPI INTERACTIVE STYLES */
.billing-interactive-section:hover {
    background: rgba(255, 255, 255, 0.05);
}
.kpi-card-billing {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.kpi-card-billing:hover {
    box-shadow: 0 8px 32px 0 rgba(16, 185, 129, 0.08);
}

/* THERMAL RECEIPT TICKET STYLES */
#receipt-paper.receipt-80mm {
    width: 300px !important;
    font-size: 12px !important;
    padding: 20px !important;
}
#receipt-paper.receipt-56mm {
    width: 220px !important;
    font-size: 10px !important;
    padding: 12px !important;
}

/* Column Specific Searching */
.search-row th {
    padding: 6px !important;
    background: rgba(0, 0, 0, 0.2);
}
.column-search {
    width: 100%;
    height: 28px;
    padding: 2px 6px;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--text-main);
    box-sizing: border-box;
    font-family: inherit;
    transition: all 0.2s ease;
}
.column-search::placeholder {
    color: rgba(255, 255, 255, 0.35);
}
.column-search:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

@media print {
    /* Hide everything on the body level except the print modals */
    body > :not(#modal-thermal-receipt):not(#modal-service-contract):not(#modal-digital-invoice) {
        display: none !important;
    }

    #modal-service-contract {
        position: absolute;
        left: 0;
        top: 0;
        width: 100% !important;
        height: auto !important;
        background: #ffffff !important;
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        z-index: 99999 !important;
    }

    #modal-service-contract > div {
        background: #ffffff !important;
        box-shadow: none !important;
        border: none !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    #modal-service-contract button,
    #modal-service-contract > div > div:first-child,
    #modal-service-contract > div > div:last-child {
        display: none !important;
    }

    #service-contract-print-area {
        max-height: none !important;
        overflow: visible !important;
        padding: 0 !important;
        color: #000000 !important;
        background: #ffffff !important;
    }
    
    #modal-thermal-receipt:not(.active) {
        display: none !important;
    }

    #modal-thermal-receipt.active,
    #modal-thermal-receipt {
        position: absolute;
        left: 0;
        top: 0;
        width: 100% !important;
        height: auto !important;
        background: #ffffff !important;
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        z-index: 99999 !important;
    }

    #modal-thermal-receipt .modal-content {
        background: #ffffff !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        display: block !important;
    }

    #modal-thermal-receipt .modal-header,
    #modal-thermal-receipt .modal-footer,
    #modal-thermal-receipt .js-ticket-size-btn,
    #modal-thermal-receipt .modal-body > :not(#receipt-paper) {
        display: none !important;
    }

    #receipt-paper {
        display: block !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 auto !important;
        background: #ffffff !important;
        color: #000000 !important;
    }
    
    #receipt-paper.receipt-80mm {
        width: 80mm !important;
        font-size: 12px !important;
    }
    
    #receipt-paper.receipt-56mm {
        width: 56mm !important;
        font-size: 10px !important;
    }
}

/* NEXOCLOW-style Dashboard Layout */
.nexoclow-row,
.nexoclow-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 8px;
    margin-bottom: 16px;
    width: 100%;
}

.nexoclow-col,
.nexoclow-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.w-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.w-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-top: 3px solid #d2d6de; /* Fallback top border */
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.w-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    background: rgba(255, 255, 255, 0.04);
}

.w-card-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.w-card-content h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.w-card-content span {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 2px;
    letter-spacing: 0.4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.w-card-icon {
    font-size: 20px;
    opacity: 0.75;
    flex-shrink: 0;
    margin-left: 8px;
}

/* NEXOCLOW Column Borders */
.border-top-success { border-top: 3px solid var(--success) !important; }
.border-top-warning { border-top: 3px solid var(--warning) !important; }
.border-top-primary { border-top: 3px solid var(--primary) !important; }
.border-top-danger { border-top: 3px solid var(--danger) !important; }
.border-top-info { border-top: 3px solid #00c0ef !important; }
.border-top-dark { border-top: 3px solid #d2d6de !important; }

/* PAYMENTS QUICKVIEW (Recibidos Hoy, Laser Out, Staff, Averías) */
.payments-quickview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 6px;
    margin-bottom: 20px;
    width: 100%;
}

.payments-quickview .card.glass {
    min-width: 0;
}

/* Responsive grid for NEXOCLOW columns and quickview */
@media (max-width: 1250px) {
    .nexoclow-row,
.nexoclow-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    .payments-quickview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}

@media (max-width: 650px) {
    .nexoclow-row,
.nexoclow-row {
        grid-template-columns: 1fr;
    }
    .payments-quickview {
        grid-template-columns: 1fr;
    }
}
/* ================================================================
   SECCIÓN DESPACHO DE TÉCNICOS - ALTA LEGIBILIDAD Y CONTRASTE NÍTIDO
   ================================================================ */
#section-technicians {
    color: #0f172a !important;
}

#section-technicians .section-title,
#section-technicians h2 {
    font-size: 24px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    letter-spacing: -0.01em !important;
}

#section-technicians p.section-sub,
#section-technicians p.text-muted {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #334155 !important;
}

/* KPIs de Técnicos */
#section-technicians .kpi-card {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06) !important;
}

#section-technicians .kpi-card label,
#section-technicians .kpi-card > span:first-child {
    font-size: 12.5px !important;
    font-weight: 800 !important;
    color: #1e293b !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

#section-technicians #tech-kpi-assigned-count,
#section-technicians #tech-kpi-optimal-count,
#section-technicians #tech-kpi-critical-count {
    font-size: 28px !important;
    font-weight: 900 !important;
    line-height: 1.1 !important;
}

#section-technicians .kpi-card .text-muted {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #475569 !important;
}

#section-technicians #select-active-tech {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    background: #f8fafc !important;
    border: 2px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 8px 10px !important;
}

/* Encabezados de Columna */
#section-technicians .column-title {
    font-size: 16px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
}

/* Tarjeta de Cliente Asignado */
.tech-client-card {
    background: #ffffff !important;
    border: 2px solid #cbd5e1 !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.07) !important;
    margin-bottom: 12px !important;
    padding: 14px 16px !important;
    color: #0f172a !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease !important;
}

.tech-client-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12) !important;
    border-color: #94a3b8 !important;
}

.tech-client-card .client-title {
    font-size: 17px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    line-height: 1.3 !important;
}

.tech-client-card .client-code-badge {
    font-size: 12.5px !important;
    font-weight: 800 !important;
    color: #1e293b !important;
    background: #e2e8f0 !important;
    border: 1px solid #cbd5e1 !important;
    padding: 2px 7px !important;
    border-radius: 5px !important;
}

.tech-client-card .client-address {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    margin-top: 4px !important;
    line-height: 1.4 !important;
}

.tech-client-card .client-meta-row {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #334155 !important;
    padding: 8px 0 !important;
    border-top: 1px solid #e2e8f0 !important;
    margin-top: 8px !important;
}

.tech-client-card .client-signal-badge {
    font-size: 13.5px !important;
    font-weight: 800 !important;
    padding: 4px 10px !important;
    border-radius: 16px !important;
}

.tech-client-card .client-signal-label {
    font-size: 11.5px !important;
    font-weight: 800 !important;
    margin-top: 2px !important;
}

.tech-client-card .btn-action {
    font-size: 12.5px !important;
    font-weight: 800 !important;
    padding: 7px 12px !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    cursor: pointer !important;
}

/* Popups del Mapa Leaflet en la sección de técnicos */
.leaflet-popup-content {
    font-size: 13.5px !important;
    line-height: 1.4 !important;
}

.leaflet-popup-content strong {
    font-weight: 800 !important;
}

/* ================================================================
   MODAL DE STAFF Y CAJAS DE PERMISOS - FONDO BLANCO Y ALTO CONTRASTE
   ================================================================ */
#modal-staff .modal-content,
#modal-staff > div {
    background: #ffffff !important;
    color: #0f172a !important;
}

#modal-staff label {
    color: #1e293b !important;
    font-size: 13px !important;
    font-weight: 700 !important;
}

#modal-staff .form-control {
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    color: #0f172a !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
}

#modal-staff .form-control:focus {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

.perm-box {
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 12px !important;
    padding: 16px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important;
    color: #0f172a !important;
}

.perm-title {
    font-size: 14.5px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin-bottom: 12px !important;
    padding-bottom: 8px !important;
    border-bottom: 1.5px solid #f1f5f9 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.perm-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)) !important;
    gap: 8px !important;
}

.perm-item {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    cursor: pointer !important;
    padding: 6px 8px !important;
    border-radius: 6px !important;
    transition: background 0.15s !important;
}

.perm-item:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

.perm-item input[type=checkbox] {
    accent-color: #059669 !important;
    width: 17px !important;
    height: 17px !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
}

/* ================================================================
   NEXOCLOW UI: AGREGAR CLIENTE (TABS, SWITCHES, IP PICKER & DESIGN)
   ================================================================ */
#modal-add-client .modal-content {
    background: #ffffff !important;
    color: #1e293b !important;
    width: 960px !important;
    max-width: 95vw !important;
    max-height: 94vh !important;
    border-radius: 8px !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.3) !important;
    border: 1px solid #e2e8f0 !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    overflow: hidden !important;
}

#modal-add-client form {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

#modal-add-client .modal-header {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 14px 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-shrink: 0 !important;
}

#modal-add-client .modal-header h2 {
    color: #16a34a !important;
    font-size: 19px !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 !important;
}

#modal-add-client .wh-nav-tabs {
    flex-shrink: 0 !important;
}

#modal-add-client .modal-body {
    padding: 0 !important;
    overflow-y: auto !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    background: #ffffff !important;
}

#modal-add-client .modal-footer {
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
    padding: 12px 20px !important;
    display: flex !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    flex-shrink: 0 !important;
}

.wh-nav-tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    background: #ffffff;
    padding: 0 16px;
    gap: 2px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.wh-nav-tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    margin-bottom: -2px;
}

.wh-nav-tab:hover {
    color: #16a34a;
}

.wh-nav-tab.active {
    color: #16a34a;
    border-bottom-color: #16a34a;
}

.wh-tab-content {
    padding: 20px 24px;
}

.wh-section-title {
    color: #16a34a;
    font-size: 14.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f1f5f9;
}

.wh-form-row {
    margin-bottom: 14px;
}

.wh-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.wh-grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

#modal-add-client label {
    color: #334155 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    margin-bottom: 5px !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

#modal-add-client .form-control {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
    color: #0f172a !important;
    font-size: 13px !important;
    padding: 6px 12px !important;
    height: 35px !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.03) !important;
    transition: border-color 0.15s, box-shadow 0.15s !important;
}

#modal-add-client textarea.form-control {
    height: auto !important;
}

#modal-add-client .form-control:focus {
    border-color: #16a34a !important;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.15) !important;
    outline: none !important;
}

.wh-icon-btn {
    background: #16a34a;
    color: #ffffff;
    border: none;
    border-radius: 3px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    transition: background 0.15s;
    flex-shrink: 0;
}

.wh-icon-btn:hover {
    background: #15803d;
}

.wh-ip-picker-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    width: 320px;
    max-height: 260px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.18);
    padding: 8px;
    margin-top: 4px;
}

.wh-ip-picker-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.wh-ip-picker-item {
    padding: 5px 8px;
    font-size: 12px;
    font-family: monospace;
    color: #1e293b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
}

.wh-ip-picker-item:hover {
    background: #16a34a;
    color: #ffffff;
    border-color: #16a34a;
}

.wh-switch-group {
    display: inline-flex;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    overflow: hidden;
    height: 30px;
}

.wh-switch-btn {
    border: none;
    padding: 0 16px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    background: #f1f5f9;
    color: #64748b;
    transition: all 0.15s;
}

.wh-switch-btn.active-si {
    background: #0284c7;
    color: #ffffff;
}

.wh-switch-btn.active-no {
    background: #94a3b8;
    color: #ffffff;
}

.wh-alert-banner {
    background: #fefce8;
    border: 1px solid #fef08a;
    color: #854d0e;
    padding: 10px 14px;
    border-radius: 5px;
    font-size: 12px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-wh-save {
    background: #0284c7 !important;
    border: 1px solid #0284c7 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    padding: 7px 20px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.btn-wh-save:hover {
    background: #0369a1 !important;
}

.btn-wh-cancel {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    padding: 7px 18px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
}

.btn-wh-cancel:hover {
    background: #f1f5f9 !important;
}

@media (max-width: 768px) {
    .wh-grid-3 {
        grid-template-columns: 1fr !important;
    }
}

/* ── TABLA DE PAGOS PENDIENTES (ANTI-DISTORSIÓN Y ALTA LEGIBILIDAD) ── */
.pending-payments-table {
    width: 100% !important;
    min-width: 1120px !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: #ffffff !important;
    font-family: var(--font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif) !important;
}

.pending-payments-table thead th {
    background: #f8fafc !important;
    color: #475569 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    padding: 10px 12px !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: 1px solid #e2e8f0 !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
}

.pending-payments-table thead tr.search-row th {
    background: #f1f5f9 !important;
    padding: 6px 8px !important;
    border-bottom: 2px solid #cbd5e1 !important;
}

.pending-payments-table tbody td {
    padding: 10px 12px !important;
    font-size: 12.5px !important;
    color: #1e293b !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: 1px solid #f1f5f9 !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
    line-height: 1.4 !important;
    box-sizing: border-box !important;
}

.pending-payments-table tbody tr {
    transition: background-color 0.15s ease !important;
    background: #ffffff !important;
}

.pending-payments-table tbody tr:hover {
    background: #f8fafc !important;
}

.table-search-input {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    height: 28px !important;
    padding: 3px 8px !important;
    font-size: 11.5px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 5px !important;
    background: #ffffff !important;
    color: #1e293b !important;
    outline: none !important;
    font-family: inherit !important;
    transition: all 0.2s ease !important;
    line-height: 20px !important;
    display: block !important;
}

.table-search-input:focus {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2) !important;
    background: #ffffff !important;
}

.table-search-input::placeholder {
    color: #94a3b8 !important;
    font-size: 11px !important;
    opacity: 1 !important;
}

/* ================================================================
   NEXOCLOW UI: MODAL AGREGAR / EDITAR PLAN (BLANCO CON AZUL VIBRANTE)
   ================================================================ */
#modal-plan .modal-content {
    background: #ffffff !important;
    color: #0f172a !important;
    border-radius: 18px !important;
    box-shadow: 0 25px 65px -12px rgba(0, 112, 243, 0.3), 0 0 0 1.5px rgba(2, 132, 199, 0.25) !important;
    border: 1.5px solid #bfdbfe !important;
    max-width: 680px !important;
    overflow: hidden !important;
    padding: 0 !important;
}

#modal-plan .modal-header {
    background: linear-gradient(135deg, #f0f7ff 0%, #e0f2fe 100%) !important;
    border-bottom: 1.5px solid #bfdbfe !important;
    padding: 18px 24px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

#modal-plan #modal-plan-title {
    color: #02385e !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    letter-spacing: -0.2px !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

#modal-plan #modal-plan-title i {
    color: #0070f3 !important;
}

#modal-plan .btn-close {
    background: #e0f2fe !important;
    color: #0070f3 !important;
    border: none !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    line-height: 1 !important;
}

#modal-plan .btn-close:hover {
    background: #0070f3 !important;
    color: #ffffff !important;
}

#modal-plan .modal-body {
    background: #ffffff !important;
    padding: 22px 24px !important;
    max-height: calc(85vh - 130px) !important;
    overflow-y: auto !important;
}

#modal-plan label {
    color: #02385e !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.2px !important;
    margin-bottom: 6px !important;
    display: block !important;
}

#modal-plan .form-control {
    background: #f0f7ff !important;
    border: 1.5px solid #cbd5e1 !important;
    color: #0f172a !important;
    border-radius: 10px !important;
    padding: 8px 13px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    height: 42px !important;
    transition: all 0.15s ease !important;
}

#modal-plan .form-control:focus {
    border-color: #0070f3 !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(0, 112, 243, 0.16) !important;
    outline: none !important;
}

#modal-plan .form-control::placeholder {
    color: #94a3b8 !important;
    font-weight: 500 !important;
}

#modal-plan #plan-type-helper {
    background: linear-gradient(135deg, #f0f7ff 0%, #e0f2fe 100%) !important;
    border: 1.5px solid #bfdbfe !important;
    color: #034574 !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
    font-size: 12px !important;
    line-height: 1.5 !important;
}

#modal-plan #plan-type-helper i {
    color: #0070f3 !important;
}

#modal-plan #plan-type-helper code {
    background: #ffffff !important;
    color: #005bb5 !important;
    padding: 2px 7px !important;
    border-radius: 5px !important;
    border: 1px solid #cbd5e1 !important;
    font-weight: 700 !important;
}

#modal-plan #plan-sync-mikrotik-group {
    background: linear-gradient(135deg, #f0f7ff 0%, #e0f2fe 100%) !important;
    border: 1.5px solid #bfdbfe !important;
    border-radius: 12px !important;
    padding: 14px 16px !important;
}

#modal-plan #plan-sync-mikrotik-group label {
    color: #02385e !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    cursor: pointer !important;
}

#modal-plan #plan-sync-mikrotik-group input[type="checkbox"] {
    accent-color: #0070f3 !important;
    width: 18px !important;
    height: 18px !important;
    cursor: pointer !important;
}

#modal-plan #plan-sync-mikrotik-group div {
    color: #6b7280 !important;
    font-size: 11.5px !important;
}

#modal-plan #plan-olt-fields {
    background: linear-gradient(135deg, #f0f7ff 0%, #e0f2fe 100%) !important;
    border: 1.5px solid #bfdbfe !important;
    border-radius: 12px !important;
    padding: 14px 16px !important;
}

#modal-plan #plan-olt-fields div:first-child {
    color: #034574 !important;
    font-size: 13px !important;
    font-weight: 800 !important;
}

#modal-plan #plan-olt-fields input[type="checkbox"] {
    accent-color: #0070f3 !important;
    width: 17px !important;
    height: 17px !important;
}

#modal-plan .modal-footer {
    background: #f0f7ff !important;
    border-top: 1.5px solid #e0f2fe !important;
    padding: 16px 24px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
}

#modal-plan .modal-footer .btn-outline {
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    color: #02385e !important;
    font-weight: 700 !important;
    border-radius: 9px !important;
    padding: 9px 16px !important;
    font-size: 12.5px !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
}

#modal-plan .modal-footer .btn-outline:hover {
    background: #e0f2fe !important;
    border-color: #bfdbfe !important;
    color: #02385e !important;
}

#modal-plan #btn-save-plan {
    background: linear-gradient(135deg, #0070f3 0%, #0070f3 100%) !important;
    border: none !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    border-radius: 9px !important;
    padding: 10px 22px !important;
    font-size: 13.5px !important;
    box-shadow: 0 4px 14px rgba(0, 112, 243, 0.35) !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    transition: all 0.15s ease !important;
}

#modal-plan #btn-save-plan:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 20px rgba(0, 112, 243, 0.45) !important;
}

/* ==========================================================================
   DROPDOWN DE HERRAMIENTAS DE TABLA DE CLIENTES (ALTA LEGIBILIDAD Y CONTRASTE)
   ========================================================================== */
#clients-tools-dropdown {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 5px;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.2), 0 4px 10px rgba(15, 23, 42, 0.08) !important;
    min-width: 310px;
    z-index: 1050;
    padding: 6px 0;
    text-align: left;
    overflow: hidden;
}

.clients-tool-item {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 10px 18px !important;
    color: #1e293b !important;
    background-color: transparent !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    border-bottom: 1px solid #f1f5f9 !important;
    transition: background-color 0.15s ease, color 0.15s ease !important;
    cursor: pointer !important;
    user-select: none;
}

.clients-tool-item:last-child {
    border-bottom: none !important;
}

.clients-tool-item:hover {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

.clients-tool-item i {
    width: 20px !important;
    text-align: center !important;
    font-size: 15px !important;
    flex-shrink: 0 !important;
}

.clients-tool-item .tool-item-label {
    color: #1e293b !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em !important;
    white-space: nowrap !important;
}

.clients-tool-item:hover .tool-item-label {
    color: #0f172a !important;
    font-weight: 700 !important;
}

.clients-tool-item.danger-item .tool-item-label {
    color: #dc2626 !important;
    font-weight: 700 !important;
}

.clients-tool-item.danger-item:hover {
    background-color: #fef2f2 !important;
}





/* Action dropdown & client table controls contrast fix */
#bulk-client-action,
#filter-client-zone,
#expenses-bulk-action,
#invoices-bulk-action,
#other-incomes-bulk-action,
#timbradas-bulk-action,
#pending-pay-action-select,
#pending-pay-method-select,
#section-clients .form-control,
#section-clients select.form-control,
#section-finances .form-control,
#section-finances select.form-control,
#section-finances select {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border: 1.5px solid #94a3b8 !important;
    font-weight: 600 !important;
}

#bulk-client-action option,
#filter-client-zone option,
#expenses-bulk-action option,
#invoices-bulk-action option,
#other-incomes-bulk-action option,
#timbradas-bulk-action option,
#pending-pay-action-select option,
#pending-pay-method-select option,
#section-clients select.form-control option,
#section-finances select.form-control option,
#section-finances select option {
    background-color: #ffffff !important;
    color: #0f172a !important;
    font-weight: 500 !important;
}

#bulk-client-action:focus,
#filter-client-zone:focus,
#expenses-bulk-action:focus,
#invoices-bulk-action:focus,
#other-incomes-bulk-action:focus,
#timbradas-bulk-action:focus,
#pending-pay-action-select:focus,
#pending-pay-method-select:focus,
#section-clients .form-control:focus,
#section-finances select:focus,
#section-finances .form-control:focus {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2) !important;
    outline: none !important;
}

#section-clients .form-control::placeholder {
    color: #64748b !important;
}


/* Action dropdown enhanced sizing */
#bulk-client-action {
    height: 42px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    padding: 0 12px !important;
    border: 1.5px solid #94a3b8 !important;
}

#bulk-client-action option {
    font-size: 14.5px !important;
    padding: 8px 12px !important;
}


/* Action row buttons in client table - enhanced size */
#clients-tbody .btn-sm {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    padding: 0 !important;
    border-radius: 6px !important;
}

#clients-tbody .btn-sm i {
    font-size: 14px !important;
    line-height: 1 !important;
}

/* Zone selector centered text and clarity */
#filter-client-zone {
    width: 240px !important;
    height: 40px !important;
    padding: 0 14px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    background-color: #ffffff !important;
    border: 1.5px solid #94a3b8 !important;
    border-radius: 8px !important;
    line-height: 38px !important;
    box-sizing: border-box !important;
}

#filter-client-zone option {
    font-size: 14px !important;
    padding: 8px 12px !important;
    color: #0f172a !important;
    background-color: #ffffff !important;
}


/* ============================================================
   NEXOCLOW: ACCIONES MASIVAS (DISEÑO MODERNO)
   ============================================================ */
.masivas-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    background: rgba(30, 41, 59, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    text-decoration: none;
    outline: none;
}

.masivas-tab-btn:hover {
    background: rgba(51, 65, 85, 0.85);
    color: #f8fafc;
    border-color: rgba(0, 112, 243, 0.45);
    transform: translateY(-1px);
}

.masivas-tab-btn.active {
    background: linear-gradient(135deg, rgba(0, 112, 243, 0.28) 0%, rgba(2, 132, 199, 0.28) 100%);
    border: 1px solid #0070f3;
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(0, 112, 243, 0.3);
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #334155;
    transition: .3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
}

input:checked + .slider {
    background-color: #0070f3;
}

input:focus + .slider {
    box-shadow: 0 0 1px #0070f3;
}

input:checked + .slider:before {
    transform: translateX(20px);
}


/* ================================================================
   NEXOCLOW UI: MODAL REGISTRAR PAGO (BLANCO CON AZUL VIBRANTE)
   ================================================================ */
#modal-payment .modal-content {
    background: #ffffff !important;
    color: #0f172a !important;
    border-radius: 20px !important;
    box-shadow: 0 25px 65px -12px rgba(0, 112, 243, 0.35), 0 0 0 1.5px rgba(2, 132, 199, 0.25) !important;
    border: 1.5px solid #bfdbfe !important;
    overflow: hidden !important;
    padding: 0 !important;
}

#modal-payment .modal-header {
    background: linear-gradient(135deg, #f0f7ff 0%, #e0f2fe 100%) !important;
    border-bottom: 1.5px solid #bfdbfe !important;
    padding: 18px 24px !important;
}

#modal-payment .btn-close {
    background: #e0f2fe !important;
    color: #0070f3 !important;
    border: none !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 50% !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
}

#modal-payment .btn-close:hover {
    background: #0070f3 !important;
    color: #ffffff !important;
    transform: rotate(90deg);
}

#modal-payment .modal-body {
    background: #ffffff !important;
    padding: 22px 24px !important;
}

#modal-payment .form-control:focus,
#modal-payment select:focus,
#modal-payment textarea:focus {
    border-color: #0070f3 !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(0, 112, 243, 0.18) !important;
    outline: none !important;
}

#modal-payment textarea::placeholder {
    color: #94a3b8 !important;
    font-weight: 500 !important;
}

#modal-payment .modal-footer {
    background: #f0f7ff !important;
    border-top: 1.5px solid #e0f2fe !important;
    padding: 16px 24px !important;
}

#modal-payment .modal-footer .btn-outline:hover {
    background: #e0f2fe !important;
    border-color: #bfdbfe !important;
    color: #02385e !important;
}

#modal-payment #btn-confirm-payment:hover {
    background: linear-gradient(135deg, #005bb5 0%, #034574 100%) !important;
    box-shadow: 0 6px 22px rgba(0, 112, 243, 0.55) !important;
    transform: translateY(-1px);
}

/* Purple Switches */
.pay-switch-blue {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.pay-switch-blue input {
    opacity: 0;
    width: 0;
    height: 0;
}

.pay-switch-blue .slider {
    background-color: #cbd5e1 !important;
    border-radius: 24px !important;
    transition: 0.3s;
}

.pay-switch-blue input:checked + .slider {
    background: linear-gradient(135deg, #0070f3, #0088eb) !important;
    box-shadow: 0 2px 8px rgba(0, 112, 243, 0.4) !important;
}

.pay-switch-blue .slider:before {
    background-color: #ffffff !important;
    border-radius: 50% !important;
    height: 18px !important;
    width: 18px !important;
    left: 3px !important;
    bottom: 3px !important;
    transition: 0.3s;
}

.pay-switch-blue input:checked + .slider:before {
    transform: translateX(20px) !important;
}

/* ================================================================
   NEXOCLOW UI: MODAL TICKET TÉRMICO (BLANCO CON AZUL VIBRANTE)
   ================================================================ */
#modal-thermal-receipt .modal-content {
    background: #ffffff !important;
    color: #0f172a !important;
    border-radius: 20px !important;
    box-shadow: 0 25px 65px -12px rgba(0, 112, 243, 0.35), 0 0 0 1.5px rgba(2, 132, 199, 0.25) !important;
    border: 1.5px solid #bfdbfe !important;
    overflow: hidden !important;
    padding: 0 !important;
}

#modal-thermal-receipt .modal-header {
    background: linear-gradient(135deg, #f0f7ff 0%, #e0f2fe 100%) !important;
    border-bottom: 1.5px solid #bfdbfe !important;
    padding: 16px 22px !important;
}

#modal-thermal-receipt .modal-header h2 {
    color: #02385e !important;
    font-size: 17px !important;
    font-weight: 800 !important;
    margin: 0 !important;
}

#modal-thermal-receipt .btn-close {
    background: #e0f2fe !important;
    color: #0070f3 !important;
    border: none !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#modal-thermal-receipt .btn-close:hover {
    background: #0070f3 !important;
    color: #ffffff !important;
}

#modal-thermal-receipt .modal-footer {
    background: #f0f7ff !important;
    border-top: 1.5px solid #e0f2fe !important;
    padding: 14px 22px !important;
}

#modal-thermal-receipt #btn-print-receipt {
    background: linear-gradient(135deg, #0070f3 0%, #005bb5 100%) !important;
    border: none !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    border-radius: 10px !important;
    padding: 10px 20px !important;
    box-shadow: 0 4px 14px rgba(0, 112, 243, 0.4) !important;
}

#modal-thermal-receipt #btn-print-receipt:hover {
    background: linear-gradient(135deg, #005bb5 0%, #034574 100%) !important;
}

#modal-thermal-receipt .js-ticket-size-btn.active {
    background: #0070f3 !important;
    color: #ffffff !important;
    border-color: #0070f3 !important;
}



/* ================================================================
   NEXOCLOW GLOBAL UI: ALL POPUP WINDOWS THEME (BLANCO CON AZUL VIBRANTE)
   Inspirado exactamente en la estética de Imagen 4 (Registrar Pago)
   ================================================================ */

.modal-backdrop {
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

/* Contenedor principal de todas las mini ventanas */
.modal-content,
.modal-dialog,
.modal-backdrop > div:not(.modal-dialog),
#modal-client-invoices .modal-content,
#modal-whatsapp-hub .modal-content,
#modal-digitali-bulk .modal-content,
#modal-quick-pay .modal-content,
#modal-receipt-view .modal-content,
#modal-payment .modal-content,
#modal-thermal-receipt .modal-content,
#modal-payment-promise > div,
#modal-generate-invoice .modal-content,
#modal-billing-details .modal-content,
#modal-tickets-list .modal-content,
#modal-zone .modal-content,
#modal-add-client .modal-content,
#modal-plan .modal-content,
#modal-add-expense > div,
#modal-add-other-income > div {
    background: #ffffff !important;
    color: #0f172a !important;
    border-radius: 20px !important;
    box-shadow: 0 25px 65px -12px rgba(0, 112, 243, 0.35), 0 0 0 1.5px rgba(2, 132, 199, 0.25) !important;
    border: 1.5px solid #bfdbfe !important;
    overflow: hidden !important;
}

/* Cabeceras de todas las mini ventanas */
.modal-header,
#modal-payment-promise > div > div:first-child,
#modal-add-expense > div > div:first-child,
#modal-add-other-income > div > div:first-child {
    background: linear-gradient(135deg, #f0f7ff 0%, #e0f2fe 100%) !important;
    border-bottom: 1.5px solid #bfdbfe !important;
    padding: 16px 22px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.modal-header h2,
.modal-header h3,
.modal-header .modal-title,
#modal-payment-promise h3,
#modal-add-expense h3,
#modal-add-other-income h3 {
    color: #02385e !important;
    font-size: 17.5px !important;
    font-weight: 800 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

/* Botón cerrar 'X' circular morado en todas las ventanas */
.modal-header .btn-close,
.modal-content .btn-close,
.modal-header button.btn-close,
.btn-close {
    background: #e0f2fe !important;
    color: #0070f3 !important;
    border: none !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 50% !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    line-height: 1 !important;
}

.modal-header .btn-close:hover,
.modal-content .btn-close:hover,
.btn-close:hover {
    background: #0070f3 !important;
    color: #ffffff !important;
    transform: rotate(90deg) !important;
}

/* Cuerpo de las ventanas */
.modal-body {
    background: #ffffff !important;
    color: #0f172a !important;
}

/* Etiquetas y títulos de campos */
.modal-body label,
.modal-content label {
    color: #02385e !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
}

/* Controles de formulario (inputs, selects, textarea) */
.modal-body .form-control,
.modal-content .form-control,
.modal-body select.form-control,
.modal-body textarea.form-control {
    background: #f0f7ff !important;
    border: 1.5px solid #cbd5e1 !important;
    color: #0f172a !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    border-radius: 10px !important;
}

.modal-body .form-control:focus,
.modal-content .form-control:focus,
.modal-body select:focus,
.modal-body textarea:focus {
    border-color: #0070f3 !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(0, 112, 243, 0.18) !important;
    outline: none !important;
}

.modal-body .form-control::placeholder,
.modal-content .form-control::placeholder {
    color: #94a3b8 !important;
    font-weight: 500 !important;
}

/* Pie de las mini ventanas */
.modal-footer,
#modal-client-invoices .modal-footer,
#modal-quick-pay .modal-footer,
#modal-generate-invoice .modal-footer {
    background: #f0f7ff !important;
    border-top: 1.5px solid #e0f2fe !important;
    padding: 14px 22px !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 8px !important;
}

.modal-footer .btn-outline,
.modal-footer button.btn-outline,
.modal-content .btn-outline {
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    color: #034574 !important;
    font-weight: 700 !important;
    border-radius: 10px !important;
    padding: 9px 18px !important;
    font-size: 13px !important;
    transition: all 0.15s ease !important;
}

.modal-footer .btn-outline:hover,
.modal-content .btn-outline:hover {
    background: #e0f2fe !important;
    border-color: #bfdbfe !important;
    color: #02385e !important;
}

.modal-footer .btn-primary,
.modal-footer .btn-success,
.modal-content .btn-primary:not(#btn-modal-inv-generate) {
    background: linear-gradient(135deg, #0070f3 0%, #005bb5 100%) !important;
    border: none !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    border-radius: 10px !important;
    padding: 10px 22px !important;
    font-size: 13.5px !important;
    box-shadow: 0 4px 16px rgba(0, 112, 243, 0.4) !important;
    transition: all 0.15s ease !important;
}

.modal-footer .btn-primary:hover,
.modal-footer .btn-success:hover {
    background: linear-gradient(135deg, #005bb5 0%, #034574 100%) !important;
    box-shadow: 0 6px 22px rgba(0, 112, 243, 0.55) !important;
    transform: translateY(-1px) !important;
}



/* ================================================================
   NEXOCLOW UI: EXPANDED MODAL BILLING DETAILS (SCALE 100 - 5000+ CLIENTS)
   ================================================================ */
#modal-billing-details .modal-content {
    width: 96% !important;
    max-width: 1580px !important;
    height: 92vh !important;
    max-height: 94vh !important;
    min-height: 720px !important;
    display: flex !important;
    flex-direction: column !important;
    background: #ffffff !important;
    border-radius: 20px !important;
    box-shadow: 0 25px 70px -10px rgba(0, 112, 243, 0.4), 0 0 0 1.5px rgba(2, 132, 199, 0.3) !important;
    border: 1.5px solid #bfdbfe !important;
}

#modal-billing-details .modal-body {
    flex: 1 !important;
    max-height: none !important;
    overflow-y: auto !important;
    padding: 22px 28px !important;
    background: #ffffff !important;
}

#modal-billing-details .billing-tab-content.active,
#modal-billing-details .billing-tab-content[style*="display: block"] {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    height: 100% !important;
}

#modal-billing-details .table-container {
    flex: 1 !important;
    min-height: 440px !important;
    max-height: calc(92vh - 310px) !important;
    overflow-y: auto !important;
    overflow-x: auto !important;
    border: 1.5px solid #bfdbfe !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    box-shadow: 0 2px 10px rgba(0, 112, 243, 0.05) !important;
}

#modal-billing-details .billing-details-tabs .btn-tab.active {
    background: linear-gradient(135deg, #0070f3 0%, #005bb5 100%) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(0, 112, 243, 0.35) !important;
    font-weight: 800 !important;
}

#modal-billing-details .billing-details-tabs .btn-tab:not(.active) {
    background: #f0f7ff !important;
    border: 1.5px solid #cbd5e1 !important;
    color: #034574 !important;
    font-weight: 700 !important;
}

#modal-billing-details .data-table thead th {
    background: linear-gradient(135deg, #f0f7ff 0%, #e0f2fe 100%) !important;
    color: #02385e !important;
    font-weight: 800 !important;
    font-size: 12px !important;
    border-bottom: 1.5px solid #bfdbfe !important;
    padding: 12px 14px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
}

#modal-billing-details .data-table tbody tr {
    border-bottom: 1px solid #e0f2fe !important;
    transition: background 0.15s ease !important;
}

#modal-billing-details .data-table tbody tr:hover {
    background: #f0f7ff !important;
}


/* ================================================================ */
/* CENTRO DE PLANTILLAS & MARCA CORPORATIVA */
/* ================================================================ */
.tpl-filter-btn {
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    font-size: 11.5px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tpl-filter-btn:hover {
    border-color: #0070f3;
    color: #0070f3;
    background: #f0f7ff;
}

.tpl-filter-btn.active {
    border-color: #0070f3;
    background: linear-gradient(135deg, #0070f3 0%, #005bb5 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 112, 243, 0.3);
}

.tpl-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tpl-card:hover {
    border-color: #bfdbfe;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 112, 243, 0.1);
}

.tpl-card-badge {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 3px 8px;
    border-radius: 6px;
}

.var-tag-pill {
    background: #ffffff;
    border: 1.5px solid #bfdbfe;
    color: #005bb5;
    font-family: monospace;
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.var-tag-pill:hover {
    background: #0070f3;
    color: #ffffff;
    border-color: #0070f3;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 112, 243, 0.25);
}

.phone-mockup ::-webkit-scrollbar {
    width: 4px;
}

.phone-mockup ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

/* Dashboard: filas de 3 tarjetas (se quitaron "Tráfico & Red" y "Lista de Averías & Soporte") */
.nexoclow-row.dash-3col,
.payments-quickview.dash-3col {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 1250px) {
    .nexoclow-row.dash-3col,
    .payments-quickview.dash-3col {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 650px) {
    .nexoclow-row.dash-3col,
    .payments-quickview.dash-3col {
        grid-template-columns: 1fr;
    }
}

/* ── Materiales & Stock en Móviles ── */
.tstock-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1100px) { .tstock-grid { grid-template-columns: 1fr; } }
.tstock-head { padding: 14px 18px; background: #f8fafc; border-bottom: 1.5px solid #e2e8f0; font-weight: 800; color: #0f172a; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tstock-head > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.tstock-summary { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.tstock-chip { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: #e0f2fe; color: #0369a1; white-space: nowrap; }
.tstock-chip.warn { background: #fee2e2; color: #b91c1c; }
.tstock-chip.muted { background: #f1f5f9; color: #64748b; }
.tstock-table { width: 100%; border-collapse: collapse; margin: 0; }
.tstock-table thead th { font-size: 11px; font-weight: 800; color: #64748b; text-transform: uppercase; letter-spacing: .4px; padding: 10px 14px; background: #ffffff; border-bottom: 1px solid #e2e8f0; text-align: left; }
.tstock-table tbody td { padding: 11px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.tstock-table tbody tr:hover td { background: #f8fafc; }
.tstock-mat { display: flex; align-items: center; gap: 11px; min-width: 0; }
.tstock-ico { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 14px; background: #eff6ff; color: #2563eb; }
.tstock-name { font-weight: 700; color: #0f172a; font-size: 13.5px; line-height: 1.25; }
.tstock-cat { font-size: 11px; color: #94a3b8; text-transform: capitalize; margin-top: 1px; }
.tstock-qty { display: inline-flex; flex-direction: column; align-items: center; min-width: 74px; padding: 5px 10px; border-radius: 10px; background: #eff6ff; border: 1px solid #bfdbfe; }
.tstock-qty b { font-size: 18px; font-weight: 900; color: #1d4ed8; line-height: 1.1; }
.tstock-qty small { font-size: 10.5px; color: #3b82f6; font-weight: 700; }
.tstock-qty.zero { background: #f8fafc; border-color: #e2e8f0; }
.tstock-qty.zero b, .tstock-qty.zero small { color: #94a3b8; }
.tstock-wh { min-width: 130px; }
.tstock-wh-num { font-size: 12.5px; color: #334155; font-weight: 700; }
.tstock-wh-num.low { color: #b91c1c; }
.tstock-bar { height: 5px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin-top: 5px; }
.tstock-bar span { display: block; height: 100%; background: linear-gradient(90deg, #22c55e, #16a34a); border-radius: 999px; }
.tstock-bar.low span { background: linear-gradient(90deg, #f87171, #dc2626); }
.tstock-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.tstock-btn { border: none; border-radius: 8px; padding: 6px 11px; font-size: 12px; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.tstock-btn.send { background: #0284c7; color: #fff; }
.tstock-btn.send:hover { background: #0369a1; }
.tstock-btn.back { background: #ffffff; color: #334155; border: 1px solid #cbd5e1; }
.tstock-btn.back:hover { background: #f1f5f9; }
.tstock-btn:disabled { opacity: .45; cursor: not-allowed; }
.tstock-empty-group td { padding: 0 !important; }
.tstock-empty-group summary { cursor: pointer; padding: 10px 14px; font-size: 12px; font-weight: 700; color: #64748b; background: #f8fafc; list-style: none; }
.tstock-empty-group summary::-webkit-details-marker { display: none; }
.tstock-empty-group .tstock-empty-list { padding: 4px 14px 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.dark-theme .tstock-head, .dark-theme .tstock-table thead th { background: #1e293b; color: #cbd5e1; border-color: #334155; }
.dark-theme .tstock-name { color: #e2e8f0; }
.dark-theme .tstock-table tbody td { border-color: #334155; }
.dark-theme .tstock-table tbody tr:hover td { background: #0f172a; }

/* ══ NexoOLT (rediseño 30-oct) ══════════════════════════════ */
#section-olt { min-width: 0; max-width: 100%; }
.nolt-head { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:14px; background:#fff; border:1px solid #e2e8f0; border-radius:14px; padding:16px 20px; margin-bottom:14px; box-shadow:0 2px 10px rgba(15,23,42,.04); }
.nolt-head-title { display:flex; align-items:center; gap:14px; }
.nolt-head-icon { width:46px; height:46px; border-radius:12px; background:linear-gradient(135deg,#0ea5e9,#0369a1); color:#fff; display:flex; align-items:center; justify-content:center; font-size:20px; box-shadow:0 4px 14px rgba(14,165,233,.3); }
.nolt-head h2 { margin:0; font-size:21px; font-weight:800; color:#0f172a; }
.nolt-head p { margin:2px 0 0; font-size:12.5px; color:#64748b; }
.nolt-head-actions { display:flex; gap:8px; flex-wrap:wrap; }
.nolt-btn { display:inline-flex; align-items:center; gap:7px; padding:7px 13px; border-radius:8px; border:1px solid #cbd5e1; background:#fff; color:#334155; font-size:12.5px; font-weight:700; cursor:pointer; text-decoration:none; white-space:nowrap; transition:background .15s, border-color .15s; }
.nolt-btn:hover { background:#f1f5f9; border-color:#94a3b8; }
.nolt-btn-primary { background:#0284c7; border-color:#0284c7; color:#fff; }
.nolt-btn-primary:hover { background:#0369a1; border-color:#0369a1; color:#fff; }
.nolt-btn-danger { background:#fef2f2; border-color:#fecaca; color:#b91c1c; }
.nolt-btn-ghost { background:transparent; border-color:transparent; color:#64748b; }
.nolt-btn-xs { padding:4px 9px; font-size:11.5px; }
.nolt-sep { width:1px; height:22px; background:#e2e8f0; margin:0 4px; }
.nolt-olt-strip { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px; }
.nolt-olt-pill { display:flex; align-items:center; gap:8px; background:#fff; border:1px solid #e2e8f0; border-radius:999px; padding:6px 14px; font-size:12px; color:#475569; }
.nolt-olt-pill b { color:#0f172a; }
.nolt-olt-n { background:#f1f5f9; border-radius:999px; padding:1px 8px; font-weight:700; }
.nolt-dot { width:9px; height:9px; border-radius:50%; background:#94a3b8; }
.nolt-dot.on { background:#10b981; box-shadow:0 0 0 3px rgba(16,185,129,.18); }
.nolt-dot.off { background:#ef4444; }
.nolt-empty-olt { background:#fffbeb; border:1px solid #fde68a; color:#92400e; border-radius:10px; padding:10px 14px; font-size:12.5px; width:100%; }
.nolt-empty-olt a { color:#b45309; font-weight:700; }
.nolt-kpis { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:14px; margin-bottom:6px; }
.nolt-kgroup h4 { margin:0 0 6px; font-size:11px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; color:#64748b; }
.nolt-kgroup h4 i { margin-right:4px; }
.nolt-kcards { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:8px; }
.nolt-kcard { background:#fff; border:1px solid #e2e8f0; border-radius:10px; padding:10px 12px; display:flex; flex-direction:column; gap:2px; min-width:0; }
.nolt-kcard b { font-size:22px; font-weight:800; color:#0f172a; line-height:1.1; }
.nolt-kcard span { font-size:11px; font-weight:700; color:#64748b; text-transform:uppercase; letter-spacing:.03em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.nolt-kcard-link { cursor:pointer; transition:border-color .15s, transform .15s; }
.nolt-kcard-link:hover { border-color:#0ea5e9; transform:translateY(-1px); }
.nolt-kcard .c-green { color:#059669; } .nolt-kcard .c-blue { color:#0284c7; } .nolt-kcard .c-purple { color:#7c3aed; } .nolt-kcard .c-amber { color:#d97706; } .nolt-kcard .c-red { color:#dc2626; }
.nolt-updated { font-size:11.5px; color:#64748b; margin:8px 0 14px; }
.nolt-updated a { color:#0284c7; font-weight:700; }
.nolt-tabs { display:flex; gap:4px; flex-wrap:wrap; border-bottom:2px solid #e2e8f0; margin-bottom:0; background:transparent; padding:0; }
.nolt-tab { background:transparent !important; border:none !important; border-bottom:3px solid transparent !important; border-radius:0 !important; color:#64748b !important; font-weight:700; font-size:13px; padding:9px 14px; margin-bottom:-2px; cursor:pointer; display:inline-flex; align-items:center; gap:7px; }
.nolt-tab:hover { color:#0f172a !important; }
.nolt-tab.active { color:#0284c7 !important; border-bottom-color:#0284c7 !important; }
.nolt-tab-badge { background:#f59e0b; color:#fff; border-radius:999px; font-size:10.5px; padding:1px 7px; }
.nolt-panel { background:#fff; border:1px solid #e2e8f0; border-top:none; border-radius:0 0 12px 12px; padding:16px; min-width:0; }
.nolt-toolbar { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:12px; }
.nolt-chips { display:flex; gap:6px; flex-wrap:wrap; }
.nolt-chip { display:inline-flex; align-items:center; gap:6px; border:1px solid #e2e8f0; background:#f8fafc; color:#475569; border-radius:999px; padding:6px 13px; font-size:12.5px; font-weight:700; cursor:pointer; }
.nolt-chip b { background:#e2e8f0; color:#0f172a; border-radius:999px; padding:0 8px; font-size:11.5px; }
.nolt-chip.active { background:#e0f2fe; border-color:#7dd3fc; color:#0369a1; }
.nolt-chip.active b { background:#0284c7; color:#fff; }
.nolt-search { display:flex; align-items:center; gap:8px; border:1px solid #cbd5e1; border-radius:8px; padding:0 10px; background:#fff; min-width:260px; }
.nolt-search i { color:#94a3b8; font-size:12px; }
.nolt-search input { border:none; outline:none; height:34px; font-size:13px; width:100%; background:transparent; color:#0f172a; }
.nolt-actions { display:flex; gap:6px; flex-wrap:wrap; align-items:center; margin-bottom:12px; }
.nolt-batch { align-items:center; gap:8px; flex-wrap:wrap; background:#0f172a; border-radius:10px; padding:8px 12px; margin-bottom:12px; }
.nolt-batch-count { background:#0ea5e9; color:#fff; border-radius:999px; padding:3px 10px; font-size:12px; font-weight:800; margin-right:6px; }
.nolt-table-wrap { width:100%; max-width:100%; overflow-x:auto; overflow-y:auto; border:1px solid #e2e8f0; border-radius:10px; }
.nolt-table { width:100%; border-collapse:collapse; font-size:12.5px; }
.nolt-table thead th { position:sticky; top:0; background:#f8fafc; color:#475569; font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.03em; text-align:left; padding:9px 10px; border-bottom:1px solid #e2e8f0; white-space:nowrap; z-index:1; }
.nolt-table .nolt-filter-row th { top:34px; background:#fff; padding:5px 8px; text-transform:none; }
.nolt-colf { width:100%; min-width:70px; height:28px; border:1px solid #e2e8f0; border-radius:6px; padding:0 8px; font-size:11.5px; background:#f8fafc; color:#0f172a; }
.nolt-colf:focus { outline:none; border-color:#0ea5e9; background:#fff; }
.nolt-table tbody td { padding:9px 10px; border-bottom:1px solid #f1f5f9; vertical-align:middle; color:#334155; }
.nolt-table tbody tr:hover td { background:#f8fafc; }
.nolt-chk { width:34px; text-align:center; }
.nolt-client b { display:block; color:#0f172a; font-weight:700; }
.nolt-client span, .nolt-small { display:block; font-size:11px; color:#64748b; }
.nolt-sn { font-family:ui-monospace,Consolas,monospace; font-weight:700; color:#0369a1; background:#f0f9ff; border:1px solid #bae6fd; border-radius:5px; padding:1px 7px; text-decoration:none; font-size:12px; }
.nolt-mono { font-family:ui-monospace,Consolas,monospace; }
.nolt-muted { color:#94a3b8; }
.nolt-badge { display:inline-flex; align-items:center; gap:5px; border-radius:999px; padding:2px 9px; font-size:11.5px; font-weight:700; border:1px solid transparent; white-space:nowrap; }
.nolt-badge.ok { background:#ecfdf5; color:#047857; border-color:#a7f3d0; }
.nolt-badge.warn { background:#fffbeb; color:#b45309; border-color:#fde68a; }
.nolt-badge.bad { background:#fef2f2; color:#b91c1c; border-color:#fecaca; }
.nolt-badge.mute { background:#f1f5f9; color:#64748b; border-color:#e2e8f0; }
.nolt-acts-h { text-align:right; }
.nolt-acts { text-align:right; white-space:nowrap; }
.nolt-acts > button:not(.nolt-btn) { width:28px; height:28px; border-radius:7px; border:1px solid #e2e8f0; background:#fff; color:#0369a1; cursor:pointer; font-size:12px; }
.nolt-acts > button:not(.nolt-btn):hover { background:#e0f2fe; border-color:#7dd3fc; }
.nolt-acts > button.danger { color:#dc2626; }
.nolt-acts > button.danger:hover { background:#fef2f2; border-color:#fecaca; }
.nolt-emptyrow { text-align:center; padding:28px 12px !important; color:#64748b; }
.nolt-foot { font-size:12px; color:#64748b; margin-top:10px; }
.nolt-foot a { color:#0284c7; font-weight:700; }
.nolt-h3 { margin:0; font-size:15px; font-weight:800; color:#0f172a; }
.nolt-sub { margin:3px 0 0; font-size:12px; color:#64748b; }
.nolt-sub a { color:#0284c7; font-weight:700; }
.nolt-warnline { background:#fffbeb; border-bottom:1px solid #fde68a; color:#92400e; padding:8px 12px; font-size:12px; }
.nolt-occ { width:120px; height:7px; background:#e2e8f0; border-radius:999px; overflow:hidden; display:inline-block; vertical-align:middle; margin-right:6px; }
.nolt-occ > div { height:100%; background:#0ea5e9; }
.nolt-tools { display:grid; grid-template-columns:repeat(auto-fill, minmax(230px,1fr)); gap:10px; }
.nolt-tool { display:flex; flex-direction:column; align-items:flex-start; gap:4px; text-align:left; border:1px solid #e2e8f0; background:#fff; border-radius:12px; padding:14px; cursor:pointer; text-decoration:none; color:#334155; transition:border-color .15s, box-shadow .15s; }
.nolt-tool:hover { border-color:#7dd3fc; box-shadow:0 4px 14px rgba(14,165,233,.12); }
.nolt-tool i { font-size:18px; color:#0284c7; margin-bottom:4px; }
.nolt-tool b { color:#0f172a; font-size:13.5px; }
.nolt-tool span { font-size:12px; color:#64748b; }
.nolt-diag-sum { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-bottom:12px; }
.nolt-diag-sum > div { border:1px solid #e2e8f0; border-radius:10px; padding:10px; text-align:center; }
.nolt-diag-sum b { display:block; font-size:20px; color:#0f172a; }
.nolt-diag-sum span { font-size:11px; color:#64748b; }
.nolt-diag-sum .bad b { color:#dc2626; } .nolt-diag-sum .warn b { color:#d97706; } .nolt-diag-sum .mute b { color:#64748b; }
@media (max-width: 1200px) { .nolt-kpis { grid-template-columns:1fr; } }
@media (max-width: 700px) { .nolt-search { min-width:0; width:100%; } .nolt-diag-sum { grid-template-columns:repeat(2,1fr); } }
@media print { .nolt-head, .nolt-kpis, .nolt-tabs, .nolt-actions, .nolt-toolbar, .nolt-batch, .nolt-olt-strip { display:none !important; } }
.dark-theme .nolt-head, .dark-theme .nolt-kcard, .dark-theme .nolt-panel, .dark-theme .nolt-olt-pill, .dark-theme .nolt-tool, .dark-theme .nolt-search, .dark-theme .nolt-btn:not(.nolt-btn-primary):not(.nolt-btn-ghost) { background:#0f172a; border-color:#334155; color:#cbd5e1; }
.dark-theme .nolt-head h2, .dark-theme .nolt-kcard b, .dark-theme .nolt-client b, .dark-theme .nolt-tool b, .dark-theme .nolt-h3, .dark-theme .nolt-olt-pill b { color:#f1f5f9; }
.dark-theme .nolt-table thead th, .dark-theme .nolt-table .nolt-filter-row th { background:#1e293b; color:#cbd5e1; border-color:#334155; }
.dark-theme .nolt-table tbody td { border-color:#1e293b; color:#cbd5e1; }
.dark-theme .nolt-table tbody tr:hover td { background:#1e293b; }
.dark-theme .nolt-colf, .dark-theme .nolt-search input { background:#1e293b; border-color:#334155; color:#e2e8f0; }
.dark-theme .nolt-chip { background:#1e293b; border-color:#334155; color:#cbd5e1; }
.dark-theme .nolt-acts > button:not(.nolt-btn) { background:#1e293b; border-color:#334155; }
.nolt-client { min-width:190px; }
.nolt-table td .nolt-sn + .nolt-small { white-space:nowrap; }

/* Ventanas abiertas con element.style.display='flex' (sin la clase .active) quedaban invisibles (opacidad 0):
   pasaba con "Asignar ONU a cliente", "Script CLI", "Equipos conectados" y otras. */
.modal-backdrop[style*="display: flex"], .modal-backdrop[style*="display:flex"],
.modal-backdrop[style*="display: block"], .modal-backdrop[style*="display:block"] { opacity: 1; pointer-events: auto; }
.modal-backdrop[style*="display: flex"] .modal-content, .modal-backdrop[style*="display:flex"] .modal-content { transform: scale(1); }
.modal-backdrop[style*="display: flex"] .modal-dialog, .modal-backdrop[style*="display:flex"] .modal-dialog { transform: none; opacity: 1; }
/* El área principal no se encogía: tablas anchas empujaban toda la página hacia la derecha */
.main-content { min-width: 0; }
.section-container { min-width: 0; max-width: 100%; }

/* NexoOLT: alertas, reportes */
.nolt-alert-bar { border:1px solid #fecaca; background:#fff7f7; border-radius:12px; padding:10px 14px; margin-bottom:12px; }
.nolt-alerts-head { display:flex; justify-content:space-between; align-items:center; font-size:13px; color:#991b1b; margin-bottom:6px; }
.nolt-alerts-head a { font-size:12px; color:#b91c1c; font-weight:700; }
.nolt-alert { display:flex; gap:10px; align-items:flex-start; padding:6px 0; border-top:1px solid #fee2e2; font-size:12.5px; }
.nolt-alert i { margin-top:2px; color:#d97706; } .nolt-alert.critical i { color:#dc2626; }
.nolt-alert b { display:block; color:#0f172a; } .nolt-alert span { color:#64748b; } .nolt-alert small { margin-left:auto; color:#94a3b8; white-space:nowrap; }
.nolt-reports { display:grid; grid-template-columns:repeat(auto-fit, minmax(420px, 1fr)); gap:12px; }
.nolt-report { border:1px solid #e2e8f0; border-radius:12px; padding:12px; background:#fff; min-width:0; }
.nolt-report-head { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.nolt-report-head > div { flex:1; } .nolt-report-head b { display:block; color:#0f172a; font-size:13.5px; } .nolt-report-head span { font-size:12px; color:#64748b; }
.dark-theme .nolt-report, .dark-theme .nolt-alert-bar { background:#0f172a; border-color:#334155; }
@media (max-width: 700px) { .nolt-reports { grid-template-columns:1fr; } }

/* ================================================================
   EXPERIENCIA MÓVIL NEXOCLOW (Android / iPhone)
   Mantiene el escritorio intacto y convierte el panel en una app táctil.
   ================================================================ */
#mobile-menu-toggle {
    display: none;
}
#mobile-menu-backdrop {
    display: none;
}

@media (max-width: 900px) {
    html, body { max-width: 100%; overflow-x: hidden; }
    body { -webkit-text-size-adjust: 100%; }
    .app-layout { display: block; min-height: 100vh; }

    #mobile-menu-toggle {
        display: inline-flex;
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 10020;
        width: 42px;
        height: 42px;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(255,255,255,.35);
        border-radius: 12px;
        background: rgba(7,36,72,.94);
        color: #fff;
        box-shadow: 0 4px 14px rgba(0,0,0,.22);
        font-size: 18px;
        cursor: pointer;
        touch-action: manipulation;
    }
    #mobile-menu-backdrop {
        position: fixed;
        inset: 0;
        z-index: 10000;
        background: rgba(2, 12, 27, .52);
    }
    #mobile-menu-backdrop.open { display: block; }

    .sidebar {
        width: min(86vw, 310px) !important;
        left: 0;
        transform: translateX(-105%);
        z-index: 10010;
        box-shadow: 12px 0 30px rgba(0,0,0,.28);
    }
    .sidebar.mobile-open { transform: translateX(0); }
    .sidebar-brand { padding-left: 18px; }
    .sidebar-menu { padding: 14px 10px 24px; }
    .sidebar-footer { padding: 14px 16px; }

    .main-content { margin-left: 0 !important; width: 100%; min-width: 0; }
    .main-header {
        display: flex !important;
        width: 100% !important;
        background: linear-gradient(90deg, #0088eb 0%, #0070f3 50%, #0265d6 100%) !important;
        min-height: 64px;
        height: auto;
        padding: 10px 12px 10px 62px;
        gap: 8px;
        flex-wrap: wrap;
    }
    .header-left { flex: 1 1 100%; min-width: 0; }
    .header-left h1 { font-size: 20px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .header-right { width: 100%; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
    .global-search { order: 10; width: 100%; flex: 1 1 100%; }
    .global-search input { min-height: 42px; font-size: 14px; }
    .connection-status { max-width: 48%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 11px; }
    .header-right .theme-toggle { width: 38px; height: 38px; }

    .section-container { padding: 12px !important; width: 100%; min-width: 0; }
    /* Evita una pantalla vacía cuando una vista se activa durante un cambio de menú.
       La sección activa siempre ocupa el ancho disponible y las vistas no activas
       no pueden empujar el lienzo fuera del viewport. */
    .app-section { min-width: 0 !important; max-width: 100% !important; width: 100% !important; overflow-x: hidden !important; }
    .app-section.active { display: flex !important; visibility: visible !important; opacity: 1 !important; }
    #section-dashboard.active { display: block !important; animation: none !important; }
    #section-dashboard .nexoclow-row,
    #section-dashboard .payments-quickview {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        gap: 12px !important;
        margin-bottom: 12px !important;
    }
    #section-dashboard .nexoclow-col,
    #section-dashboard .w-card,
    #section-dashboard .card { min-height: 0 !important; height: auto !important; }
    #section-dashboard .chart-card { height: auto !important; min-height: 0 !important; }
    #section-dashboard .chart-container { height: 220px !important; min-height: 0 !important; }
    #section-dashboard canvas { max-width: 100% !important; max-height: 220px !important; }
    .section-container > * { max-width: 100%; min-width: 0; }
    .dashboard-grid, .stats-grid, .cards-grid, .card-grid, .widgets-grid,
    .nexoclow-row, .payments-quickview { grid-template-columns: 1fr !important; }
    .card, .glass, .panel, .section-card, .kpi-card { max-width: 100%; min-width: 0; }
    .toolbar, .section-toolbar, .action-bar, .filter-bar { flex-wrap: wrap !important; gap: 8px !important; }
    .toolbar > *, .section-toolbar > *, .action-bar > *, .filter-bar > * { max-width: 100%; }
    .form-control, select, input, textarea { max-width: 100%; }
    .table-container { max-width: 100%; overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
    .data-table { min-width: 680px; }
    .data-table th, .data-table td { white-space: nowrap; }
    .modal-content, .modal-card, .modal-dialog { width: calc(100vw - 24px) !important; max-width: calc(100vw - 24px) !important; margin: 12px auto; }
    .modal-overlay, .modal-backdrop { padding: 12px !important; align-items: flex-start !important; overflow-y: auto; }

    /* Digitali CRM: navegación por columnas con toque, sin comprimir el chat. */
    #section-digitali { min-height: calc(100vh - 76px) !important; padding: 0 !important; }
    #section-digitali > div:first-child { height: auto !important; min-height: 48px !important; padding: 8px 10px !important; flex-wrap: wrap; gap: 6px; }
    #section-digitali > div:first-child > div:first-child { min-width: 0; flex: 1 1 100%; }
    #section-digitali > div:first-child > div:last-child { width: 100%; justify-content: flex-end; }
    #section-digitali > div:first-child span.badge { font-size: 9px !important; }
    #digitali-settings-drawer { top: 12px !important; right: 12px !important; width: calc(100vw - 24px) !important; max-height: calc(100vh - 24px) !important; padding: 12px !important; }
    #digitali-settings-drawer form > div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
    #section-digitali > div[style*="grid-template-columns: 310px"] {
        display: flex !important;
        flex-direction: column !important;
        min-height: calc(100vh - 145px) !important;
        height: calc(100vh - 145px) !important;
        overflow: hidden !important;
    }
    #section-digitali > div[style*="grid-template-columns: 310px"] > div { min-height: 0 !important; }
    #digitali-conversations-list { max-height: 30vh; flex: 0 0 30vh !important; }
    #digitali-chat-messages { min-height: 170px !important; }
    #digitali-chat-input { min-width: 0 !important; }
    #section-digitali button span { white-space: nowrap; }
    #modal-digitali-averia { padding: 10px !important; }

    /* Evita que acciones anchas rompan la pantalla. */
    button, .btn { min-height: 36px; touch-action: manipulation; }
    .hide-mobile { display: none !important; }
}

/* En escritorio el desplazamiento pertenece a la tabla o tarjeta ancha, no a
   toda la aplicación. Esto elimina el efecto de interfaz "entrecortada" al
   mover el contenido horizontalmente. */
@media (min-width: 901px) {
    .main-content, .section-container { min-width: 0; max-width: 100%; overflow-x: hidden; }
    .app-section { min-width: 0; max-width: 100%; }
    .table-container, .table-responsive, .data-table-wrapper, .nolt-table-wrap { max-width: 100%; overflow-x: auto; }
}

@media (max-width: 480px) {
    .section-container { padding: 8px !important; }
    .main-header { padding-right: 8px; }
    .header-right .connection-status { display: none; }
    .kpi-card { padding: 12px !important; }
    .data-table { min-width: 620px; }
    #digitali-conversations-list { max-height: 25vh; flex-basis: 25vh !important; }
    #digitali-chat-messages { padding: 8px !important; }
}
