/* ==========================================================================
   1GLOBAL eSIM Telemetry Dashboard Design System (Premium Glassmorphism)
   ========================================================================== */

/* Root Variables - Sleek Dark Palette */
:root {
    --bg-primary: #3a3a3a;
    --bg-secondary: rgba(20, 20, 20, 0.55);
    --border-color: rgba(237, 237, 237, 0.08);
    --border-hover: rgba(158, 45, 42, 0.35);
    /* Elegant rust-red glow on hover */
    --card-hover-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45), 0 0 15px 0 rgba(158, 45, 42, 0.15);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Branding & Accent Colors */
    --accent-blue: #9e2d2a;
    --accent-blue-dark: #6b1515;
    --accent-blue-glow: rgba(158, 45, 42, 0.3);
    --accent-blue-bg: rgba(158, 45, 42, 0.12);
    --accent-blue-border: rgba(158, 45, 42, 0.25);
    --accent-cyan: #c6c6c6;
    --accent-purple: #fca5a5;
    --accent-purple-bg: rgba(158, 45, 42, 0.15);

    --mini-tag-bg: rgba(198, 198, 198, 0.1);
    --mini-tag-text: #ededed;
    --mini-tag-border: rgba(198, 198, 198, 0.2);

    --notification-unread-bg: rgba(158, 45, 42, 0.05);
    --notification-unread-hover-bg: rgba(158, 45, 42, 0.1);

    --accent-green: #10b981;
    --accent-green-bg: rgba(16, 185, 129, 0.15);
    --accent-orange: #f59e0b;
    --accent-orange-bg: rgba(245, 158, 11, 0.15);
    --accent-red: #ef4444;
    --accent-red-bg: rgba(239, 68, 68, 0.15);
    --accent-pink: #ec4899;
    --accent-pink-bg: rgba(236, 72, 153, 0.15);
    --accent-gray: #6b7280;
    --accent-gray-bg: rgba(107, 114, 128, 0.15);

    /* Text Colors */
    --text-main: #ededed;
    --text-muted: #c6c6c6;
    --text-dark: #1e1e1e;

    /* Transitions */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Glowing Accents */
.background-decor {
    position: fixed;
    top: -200px;
    right: -100px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(237, 237, 237, 0.08) 0%, rgba(198, 198, 198, 0.02) 50%, rgba(0, 0, 0, 0) 100%);
    filter: blur(100px);
    z-index: -1;
    pointer-events: none;
}

.background-decor-2 {
    position: fixed;
    bottom: -150px;
    left: -150px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(158, 45, 42, 0.08) 0%, rgba(58, 58, 58, 0.01) 60%, rgba(0, 0, 0, 0) 100%);
    filter: blur(100px);
    z-index: -1;
    pointer-events: none;
}

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

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* App Container */
.app-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Header Component */
.app-header {
    position: relative;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--bg-secondary);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-isotype {
    height: 42px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(59, 130, 246, 0.2));
}

.header-logotipo {
    height: 26px;
    width: auto;
    object-fit: contain;
    display: block;
    margin-bottom: 0.15rem;
}

.header-logo i {
    font-size: 2.2rem;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pulse-icon {
    animation: icon-pulse 3s infinite ease-in-out;
}

.logo-text h1 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff, #c7d2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text span {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-dark));
    color: white;
    box-shadow: 0 4px 15px var(--accent-blue-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-blue-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-green), #059669);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}
.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}
.btn-success:active {
    transform: translateY(0);
}
.btn-success:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent-red), #dc2626);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
}
.btn-danger:active {
    transform: translateY(0);
}
.btn-danger:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-warning {
    background: linear-gradient(135deg, var(--accent-orange), #d97706);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}
.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
}
.btn-warning:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--accent-gray), #4b5563);
    color: white;
    box-shadow: 0 4px 15px rgba(107, 114, 128, 0.3);
}
.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 114, 128, 0.45);
}
.btn-secondary:active {
    transform: translateY(0);
}

.detail-actions-section {
    animation: fadeIn 0.4s ease;
}


/* Badges */
.badge {
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.badge-mock {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-orange);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-api {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

/* KPI Cards Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
    gap: 1.1rem;
    width: 100%;
}

.kpi-card {
    background: var(--bg-secondary);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem 1.15rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--glass-shadow);
    transition: var(--transition-smooth);
    min-width: 0;
}

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

.kpi-info {
    min-width: 0;
    flex: 1;
}

.kpi-info h3 {
    font-size: 0.785rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-value {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 0.2rem;
    white-space: nowrap;
}

.kpi-subtext {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
    margin-left: 0.4rem;
}

.icon-blue {
    background: var(--accent-blue-bg);
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue-border);
}

.icon-green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.icon-purple {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-purple);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.icon-cyan {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent-cyan);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.icon-orange {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-orange);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.icon-slate,
.icon-gray {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

/* Workspaces Layout */
.dashboard-workspace {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
}

.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

@media (max-width: 1100px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
}

/* Card Panel Base */
.card {
    background: var(--bg-secondary);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.card-header {
    padding: 1.5rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.card-header.border-bottom {
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.card-header h2 i {
    color: var(--accent-cyan);
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Left Panel - Charting */
.panel-left {
    min-height: 480px;
    min-width: 0;
}

.chart-container {
    padding: 1rem 1.75rem;
    position: relative;
    height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.legend-list-container {
    padding: 1rem 1.75rem 1.75rem;
    border-top: 1px solid var(--border-color);
    overflow-y: auto;
    max-height: 200px;
}

.legend-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.legend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.legend-label-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 30%;
    display: inline-block;
}

.legend-value {
    font-weight: 700;
    color: var(--text-main);
}

/* Forecast Panel styles */
.panel-depletion {
    min-height: 480px;
    min-width: 0;
}

.depletion-summary-container {
    padding: 1.5rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex: 1;
}

.depletion-summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 1rem;
}

.depletion-stat-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: var(--transition-smooth);
}

.depletion-stat-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.depletion-stat-count {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.depletion-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Stat color themes */
.depletion-stat-item.critical .depletion-stat-count {
    color: var(--accent-red);
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.depletion-stat-item.warning .depletion-stat-count {
    color: var(--accent-orange);
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.depletion-stat-item.stable .depletion-stat-count {
    color: var(--accent-green);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.depletion-critical-list-wrapper h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.depletion-critical-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.depletion-list-item {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.depletion-list-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-hover);
    transform: translateX(4px);
}

.depletion-item-left {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.depletion-item-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

.depletion-item-iccid {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: monospace;
}

.depletion-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
}

/* Badges on main table and detail modal */
.depletion-badge {
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.depletion-badge.critical {
    background: var(--accent-red-bg);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.depletion-badge.warning {
    background: var(--accent-orange-bg);
    color: var(--accent-orange);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.depletion-badge.stable {
    background: var(--accent-green-bg);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.spinner-sm {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top: 2px solid var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Right Panel - Data Table */
.panel-right {
    min-height: 560px;
}

/* Table Controls */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.5rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    color: white;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition-smooth);
}

.search-box input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px var(--accent-blue-glow);
}

.filter-group {
    display: flex;
    gap: 0.75rem;
}

.form-select {
    padding: 0.65rem 2.25rem 0.65rem 1rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    color: white;
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px 10px;
    appearance: none;
}

.form-select:focus {
    border-color: var(--accent-blue);
}

.form-select option {
    background-color: var(--bg-primary);
    color: white;
}

.select-sm {
    padding: 0.25rem 1.5rem 0.25rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 6px;
    background-position: right 0.5rem center;
    background-size: 10px 8px;
}

/* The Table */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.sim-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.82rem;
}

.sim-table th {
    padding: 0.6rem 0.4rem;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.12);
}

.sim-table td {
    padding: 0.6rem 0.4rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    font-weight: 500;
    transition: var(--transition-smooth);
}

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

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

.sim-table td.iccid {
    font-family: monospace;
    font-size: 0.76rem;
    color: var(--accent-cyan);
}

.sim-table td.msisdn {
    font-family: monospace;
    font-size: 0.76rem;
}

.sim-table td.ip {
    font-family: monospace;
    font-size: 0.76rem;
    color: var(--text-muted);
}

/* Status Badges */
.status-pill {
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
    letter-spacing: 0.3px;
}

.status-pill.active {
    background: var(--accent-green-bg);
    color: var(--accent-green);
}

.status-pill.suspended {
    background: var(--accent-orange-bg);
    color: var(--accent-orange);
}

.status-pill.blocked {
    background: var(--accent-red-bg);
    color: var(--accent-red);
}

.status-pill.attached {
    background: var(--accent-purple-bg);
    color: var(--accent-purple);
}

.status-pill.detached {
    background: var(--accent-gray-bg);
    color: var(--accent-gray);
}

/* Tag mini-badges inside table */
.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.mini-tag {
    background: var(--mini-tag-bg);
    color: var(--mini-tag-text);
    border: 1px solid var(--mini-tag-border);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Loading Spinner Row */
.loading-spinner-row {
    padding: 4rem 0 !important;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--accent-cyan);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 0.8s linear infinite;
}

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

.text-center {
    text-align: center;
}

/* Table Footer Summary */
.table-footer {
    padding: 1.25rem 1.75rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Animations */
@keyframes icon-pulse {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 2px rgba(6, 182, 212, 0));
    }

    50% {
        transform: scale(1.08);
        filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.6));
    }
}

/* ==========================================================================
   New Styles: Expiring SIMs KPI Card and Glassmorphic Modal
   ========================================================================== */
.icon-red {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.text-red {
    color: var(--accent-red) !important;
}

.icon-pink {
    background: rgba(236, 72, 153, 0.1);
    color: var(--accent-pink);
    border: 1px solid rgba(236, 72, 153, 0.2);
}

.text-pink {
    color: var(--accent-pink) !important;
}

.text-cyan {
    color: var(--accent-cyan) !important;
}

.text-orange {
    color: var(--accent-orange) !important;
}

.interactive-card {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.interactive-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    transition: var(--transition-smooth);
    opacity: 0;
}

.interactive-card:hover::after {
    opacity: 1;
}

/* Custom glow transitions for each balance threshold */
#kpi-exhausted::after {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0) 60%, rgba(236, 72, 153, 0.08));
}

#kpi-exhausted:hover {
    border-color: rgba(236, 72, 153, 0.35);
    box-shadow: 0 8px 30px rgba(236, 72, 153, 0.18);
}

#kpi-critical::after {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0) 60%, rgba(239, 68, 68, 0.08));
}

#kpi-critical:hover {
    border-color: rgba(239, 68, 68, 0.35);
    box-shadow: 0 8px 30px rgba(239, 68, 68, 0.18);
}

#kpi-low::after {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0) 60%, rgba(245, 158, 11, 0.08));
}

#kpi-low:hover {
    border-color: rgba(245, 158, 11, 0.35);
    box-shadow: 0 8px 30px rgba(245, 158, 11, 0.18);
}

/* Modal Overlay & Glassmorphic Container */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 6, 12, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal-content {
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    border: 1px solid var(--border-color);
    background: rgba(26, 26, 26, 0.98);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    border-radius: 16px;
    transform: scale(0.92);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.modal-header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.15);
}

.modal-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition-smooth);
    padding: 0 0.5rem;
}

.close-btn:hover {
    color: white;
    transform: scale(1.15);
}

.modal-search-container {
    padding: 1rem 1.5rem 0.75rem 1.5rem;
    background: rgba(0, 0, 0, 0.12);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.modal-body {
    padding: 1rem 1.5rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* Progress bar inside Modal */
.progress-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 160px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 600;
}

.progress-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-red), var(--accent-orange));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-fill.medium-warning {
    background: linear-gradient(90deg, var(--accent-orange), var(--accent-blue));
}

.progress-fill.exhausted-fill {
    background: var(--accent-pink);
}

/* ==========================================================================
   Notification System Styles
   ========================================================================== */

.notification-container {
    position: relative;
    display: inline-block;
}

.notification-bell-btn {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.15rem;
    transition: var(--transition-smooth);
}

.notification-bell-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--border-hover);
    color: white;
    box-shadow: 0 0 15px var(--accent-blue-glow);
}

.notification-bell-btn i {
    transition: transform 0.3s ease;
}

.notification-bell-btn:hover i {
    animation: ring 0.5s ease;
}

@keyframes ring {
    0% {
        transform: rotate(0);
    }

    15% {
        transform: rotate(15deg);
    }

    30% {
        transform: rotate(-15deg);
    }

    45% {
        transform: rotate(10deg);
    }

    60% {
        transform: rotate(-10deg);
    }

    75% {
        transform: rotate(4deg);
    }

    85% {
        transform: rotate(-4deg);
    }

    100% {
        transform: rotate(0);
    }
}

.notification-container .badge-count {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--accent-red);
    color: white;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
    animation: pulse-badge 2s infinite;
}

.notification-container .badge-count.hidden {
    display: none !important;
}

@keyframes pulse-badge {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 12px;
    width: 380px;
    max-height: 480px;
    background: rgba(26, 26, 26, 0.98);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--glass-shadow);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: dropdown-fade-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdown-fade-in {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.notification-dropdown.hidden {
    display: none !important;
}

.dropdown-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.dropdown-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.btn-link {
    background: transparent;
    border: none;
    color: var(--accent-blue);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-link:hover {
    color: var(--accent-cyan);
    text-decoration: underline;
}

.notifications-list {
    overflow-y: auto;
    flex: 1;
    max-height: 400px;
}

.notification-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.notification-empty i {
    font-size: 2rem;
    opacity: 0.4;
}

.notification-empty p {
    font-size: 0.85rem;
}

/* Notification Item */
.notification-item {
    position: relative;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 0.85rem;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.notification-item.unread {
    background: var(--notification-unread-bg);
}

.notification-item.unread:hover {
    background: var(--notification-unread-hover-bg);
}

.notification-icon-container {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
}

/* Color codes based on notification type */
.notification-item.exhausted .notification-icon-container {
    background: var(--accent-pink-bg);
    color: var(--accent-pink);
}

.notification-item.critical .notification-icon-container {
    background: var(--accent-red-bg);
    color: var(--accent-red);
}

.notification-item.low .notification-icon-container {
    background: var(--accent-orange-bg);
    color: var(--accent-orange);
}

.notification-item.status_change .notification-icon-container {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

.notification-item.refill .notification-icon-container {
    background: var(--accent-green-bg);
    color: var(--accent-green);
}

.notification-item.new_sim .notification-icon-container {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
}

.notification-item.system .notification-icon-container {
    background: var(--accent-gray-bg);
    color: var(--text-main);
}

.notification-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.notification-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
}

.notification-message {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.notification-item.unread .notification-message {
    color: var(--text-main);
}

.notification-close-btn {
    opacity: 0;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
    padding: 0.2rem;
    align-self: flex-start;
}

.notification-item:hover .notification-close-btn {
    opacity: 1;
}

.notification-close-btn:hover {
    color: white;
}

/* SIM Chip & Quick View Button in Notifications */
.notif-sim-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(59, 130, 246, 0.18);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 4px;
    padding: 1px 6px;
    font-weight: 600;
    font-size: 0.76rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.notif-sim-chip:hover {
    background: rgba(59, 130, 246, 0.3);
    color: #ffffff;
    border-color: rgba(59, 130, 246, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.25);
}

.btn-notification-view-sim {
    font-size: 0.75rem;
    font-weight: 600;
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    align-self: flex-start;
    transition: all 0.2s ease;
}

.btn-notification-view-sim:hover {
    background: rgba(59, 130, 246, 0.28);
    color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

body.light-theme .btn-notification-view-sim {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.3);
}

body.light-theme .btn-notification-view-sim:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #1d4ed8;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.toast-sim-link-btn {
    margin-top: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.toast-sim-link-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

/* ==========================================================================
   Toast Notification System
   ========================================================================== */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
    max-width: 400px;
    pointer-events: none;
}

.toast-alert {
    pointer-events: auto;
    background: #18181b;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(158, 45, 42, 0.4);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    padding: 1rem 1.25rem;
    display: flex;
    gap: 1rem;
    position: relative;
    overflow: hidden;
    width: 360px;
    animation: toast-slide-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transition: var(--transition-smooth);
}

.toast-alert.dismissing {
    animation: toast-slide-out 0.3s cubic-bezier(0.36, 0.07, 0.19, 0.97) forwards;
}

@keyframes toast-slide-in {
    from {
        opacity: 0;
        transform: translateX(100%) translateY(0);
    }

    to {
        opacity: 1;
        transform: translateX(0) translateY(0);
    }
}

@keyframes toast-slide-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.toast-icon-container {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.toast-alert.exhausted .toast-icon-container {
    background: var(--accent-pink-bg);
    color: var(--accent-pink);
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.3);
}

.toast-alert.critical .toast-icon-container {
    background: var(--accent-red-bg);
    color: var(--accent-red);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.toast-alert.low .toast-icon-container {
    background: var(--accent-orange-bg);
    color: var(--accent-orange);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.toast-alert.status_change .toast-icon-container {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.toast-alert.refill .toast-icon-container {
    background: var(--accent-green-bg);
    color: var(--accent-green);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.toast-alert.new_sim .toast-icon-container {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

.toast-alert.system .toast-icon-container {
    background: var(--accent-gray-bg);
    color: var(--text-main);
}

.toast-alert.success .toast-icon-container {
    background: var(--accent-green-bg);
    color: var(--accent-green);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.toast-alert.error .toast-icon-container {
    background: var(--accent-red-bg);
    color: var(--accent-red);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.toast-alert.warning .toast-icon-container {
    background: var(--accent-orange-bg);
    color: var(--accent-orange);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.toast-alert.info .toast-icon-container {
    background: rgba(158, 45, 42, 0.2);
    color: #fca5a5;
    box-shadow: 0 0 10px rgba(158, 45, 42, 0.3);
}

.toast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.toast-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #ffffff !important;
}

.toast-message {
    font-size: 0.82rem;
    color: #e2e8f0 !important;
    line-height: 1.4;
}

body.light-theme .toast-alert {
    background: #ffffff !important;
    border-color: #fca5a5 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

body.light-theme .toast-title {
    color: #0f172a !important;
}

body.light-theme .toast-message {
    color: #334155 !important;
}

/* Interactive Tag Picker Chips in Edit SIM Modal */
.edit-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}
.edit-tag-chip:hover {
    border-color: var(--accent-blue);
    color: var(--text-main);
    background: rgba(59, 130, 246, 0.15);
}
.edit-tag-chip.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.35), rgba(37, 99, 235, 0.45));
    border-color: var(--accent-blue);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}
.edit-tag-chip.active .remove-tag-icon {
    font-size: 0.7rem;
    margin-left: 0.2rem;
    opacity: 0.8;
}
.edit-tag-chip.active .remove-tag-icon:hover {
    opacity: 1;
    color: #fca5a5;
}


.toast-message {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition-smooth);
    align-self: flex-start;
}

.toast-close:hover {
    color: white;
}

/* Toast Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--accent-blue);
    width: 100%;
}

.toast-alert.exhausted .toast-progress {
    background: var(--accent-pink);
}

.toast-alert.critical .toast-progress {
    background: var(--accent-red);
}

.toast-alert.low .toast-progress {
    background: var(--accent-orange);
}

.toast-alert.status_change .toast-progress {
    background: var(--accent-purple);
}

.toast-alert.refill .toast-progress {
    background: var(--accent-green);
}

.toast-alert.new_sim .toast-progress {
    background: var(--accent-cyan);
}

.toast-alert.system .toast-progress {
    background: var(--accent-gray);
}

.toast-alert.success .toast-progress {
    background: var(--accent-green);
}

.toast-alert.error .toast-progress {
    background: var(--accent-red);
}

.toast-alert.warning .toast-progress {
    background: var(--accent-orange);
}

.toast-alert.info .toast-progress {
    background: #9e2d2a;
}

/* ==========================================================================
   Pagination and Footer Styles
   ========================================================================== */

.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.page-size-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.select-sm {
    padding: 0.25rem 1.75rem 0.25rem 0.75rem !important;
    font-size: 0.8rem !important;
    border-radius: 6px !important;
    background-color: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
    height: auto !important;
    width: auto !important;
}

.select-sm:focus {
    border-color: var(--accent-blue) !important;
    outline: none;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-pagination {
    width: 32px;
    height: 32px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-size: 0.8rem;
}

.btn-pagination:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--border-hover);
    color: white;
    box-shadow: 0 0 10px var(--accent-blue-glow);
}

.btn-pagination:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.page-indicator {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    padding: 0 0.5rem;
    display: inline-flex;
    align-items: center;
}

.page-num-input {
    width: 48px;
    padding: 0.2rem 0.3rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    margin: 0 0.35rem;
    display: inline-block;
    height: auto;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    transition: var(--transition-smooth);
}

.page-num-input::-webkit-outer-spin-button,
.page-num-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.page-num-input:focus {
    border-color: var(--accent-blue);
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 8px var(--accent-blue-glow);
}

/* eSIM Detail Modal styles */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

@media (max-width: 600px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

.detail-field {
    font-size: 0.9rem;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.detail-field strong {
    color: var(--text-muted);
}

.detail-chart-section {
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
}

.detail-chart-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.chart-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.chart-loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Clickable table row cursor hover styles */
#sims-table-body tr {
    cursor: pointer;
    transition: var(--transition-smooth);
}

#sims-table-body tr:hover {
    background: rgba(255, 255, 255, 0.035) !important;
}

/* General helper classes */
.hidden {
    display: none !important;
}

/* Secondary Button style */
.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* Table Header Sort and Filter styles */
.sim-table th {
    padding: 0.6rem 0.4rem !important;
    /* Adjusted padding to accommodate buttons */
}

.th-content {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    position: relative;
    cursor: pointer;
    user-select: none;
}

.th-title {
    flex-grow: 1;
    white-space: nowrap;
    transition: var(--transition-smooth);
}

.th-content:hover .th-title {
    color: var(--text-main);
}

.sort-indicator {
    font-size: 0.75rem;
    opacity: 0.25;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    color: var(--text-muted);
}

.th-content:hover .sort-indicator {
    opacity: 0.55;
}

.sort-indicator.active {
    opacity: 1;
    color: var(--accent-blue);
}

.th-filter-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.75rem;
    opacity: 0.25;
    transition: var(--transition-smooth);
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.th-filter-btn:hover {
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.th-filter-btn.active {
    opacity: 1;
    color: var(--accent-cyan);
}

/* Header Filter Dropdown (Popover) */
.header-filter-dropdown {
    position: fixed;
    z-index: 1000;
    background: rgba(15, 22, 42, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.6);
    padding: 0.75rem;
    width: 230px;
    transition: opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1), transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top left;
    pointer-events: auto;
}

.header-filter-dropdown.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

/* Subcomponents inside Header Filter Popover */
.filter-dropdown-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-input-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-input-container input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-main);
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    transition: var(--transition-smooth);
}

.filter-input-container input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.15);
}

/* Checkbox lists */
.filter-checkbox-list {
    max-height: 160px;
    overflow-y: auto;
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
    padding-right: 2px;
}

.filter-checkbox-list::-webkit-scrollbar {
    width: 4px;
}

.filter-checkbox-list::-webkit-scrollbar-track {
    background: transparent;
}

.filter-checkbox-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

.filter-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.4rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition-smooth);
    user-select: none;
}

.filter-checkbox-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.filter-checkbox-item input[type="checkbox"] {
    accent-color: var(--accent-cyan);
    cursor: pointer;
    width: 14px;
    height: 14px;
}

.filter-checkbox-label {
    flex-grow: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
}

.filter-checkbox-count {
    color: var(--text-muted);
    font-size: 0.72rem;
    background: rgba(255, 255, 255, 0.06);
    padding: 0.05rem 0.35rem;
    border-radius: 10px;
}

/* Numerical Range filter */
.filter-range-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-range-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.filter-range-row input {
    flex: 1;
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-main);
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
    min-width: 0;
}

.filter-range-row input:focus {
    outline: none;
    border-color: var(--accent-cyan);
}

.filter-range-row span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Action Buttons inside Dropdown */
.filter-dropdown-actions {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    gap: 0.5rem;
}

.filter-btn-action {
    flex: 1;
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-smooth);
    text-align: center;
    border: none;
}

.filter-btn-apply {
    background: var(--accent-cyan);
    color: var(--bg-primary);
}

.filter-btn-apply:hover {
    background: #0891b2;
}

.filter-btn-clear {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.filter-btn-clear:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-hover);
}


/* ==========================================================================
   Light Theme Style Overrides
   ========================================================================== */
body.light-theme {
    --bg-primary: #e2e8f0;
    /* Darker slate gray background to reduce eye strain */
    --bg-secondary: rgba(255, 255, 255, 0.75);
    /* High-end semi-translucent white */
    --border-color: rgba(15, 23, 42, 0.08);
    /* Clean dark borders */
    --border-hover: rgba(29, 78, 216, 0.25);
    /* Elegant translucent blue glow on hover */
    --card-hover-shadow: 0 12px 30px 0 rgba(148, 163, 184, 0.15), 0 0 15px 0 rgba(29, 78, 216, 0.12);
    --glass-shadow: 0 8px 30px 0 rgba(148, 163, 184, 0.24), 0 2px 8px 0 rgba(15, 23, 42, 0.04);

    /* Text Colors */
    --text-main: #0f172a;
    /* Slate 900 */
    --text-muted: #475569;
    /* Slate 600 */
    --text-dark: #f8fafc;

    /* Adjusted Branding/Accent Colors for Better Contrast */
    --accent-blue: #1d4ed8;
    /* Deeper blue */
    --accent-blue-dark: #1e3a8a;
    --accent-blue-glow: rgba(29, 78, 216, 0.12);
    --accent-blue-bg: rgba(29, 78, 216, 0.08);
    --accent-blue-border: rgba(29, 78, 216, 0.16);
    --accent-cyan: #0891b2;
    /* Deeper cyan */
    --accent-purple: #6d28d9;
    --accent-purple-bg: rgba(109, 40, 217, 0.08);
    --accent-green: #047857;
    --accent-green-bg: rgba(4, 120, 87, 0.08);
    --accent-orange: #b54708;
    --accent-orange-bg: rgba(181, 71, 8, 0.08);
    --accent-red: #be123c;
    --accent-red-bg: rgba(190, 18, 60, 0.08);
    --accent-pink: #c01048;
    --accent-pink-bg: rgba(192, 16, 72, 0.08);

    --mini-tag-bg: rgba(29, 78, 216, 0.08);
    --mini-tag-text: #1d4ed8;
    --mini-tag-border: rgba(29, 78, 216, 0.16);

    --notification-unread-bg: rgba(29, 78, 216, 0.05);
    --notification-unread-hover-bg: rgba(29, 78, 216, 0.09);
}

/* Light Theme Overrides for Specific Components */
body.light-theme .background-decor {
    background: radial-gradient(circle, rgba(59, 130, 246, 0.06) 0%, rgba(139, 92, 246, 0.02) 50%, rgba(0, 0, 0, 0) 100%);
}

body.light-theme .background-decor-2 {
    background: radial-gradient(circle, rgba(6, 182, 212, 0.04) 0%, rgba(16, 185, 129, 0.01) 60%, rgba(0, 0, 0, 0) 100%);
}

/* Inputs and Forms */
body.light-theme .search-box input {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

body.light-theme .search-box input:focus {
    background: #ffffff;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px var(--accent-blue-glow);
}

body.light-theme .search-box i {
    color: var(--text-muted);
}

body.light-theme .form-select {
    background-color: rgba(255, 255, 255, 0.95);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23475569' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

body.light-theme .form-selectOption,
body.light-theme .form-select option {
    background-color: #ffffff;
    color: var(--text-main);
}

/* Buttons and Badges */
body.light-theme .theme-toggle-btn {
    background: rgba(15, 23, 42, 0.04);
}

body.light-theme .theme-toggle-btn:hover {
    background: rgba(15, 23, 42, 0.08);
    color: var(--accent-blue);
    box-shadow: 0 0 12px rgba(29, 78, 216, 0.15);
}

body.light-theme .notification-bell-btn {
    background: rgba(15, 23, 42, 0.04);
}

body.light-theme .notification-bell-btn:hover {
    background: rgba(15, 23, 42, 0.08);
    color: var(--text-main);
    box-shadow: 0 0 12px rgba(15, 23, 42, 0.1);
}

body.light-theme .btn-secondary {
    background: rgba(15, 23, 42, 0.04);
    color: var(--text-main);
}

body.light-theme .btn-secondary:hover {
    background: rgba(15, 23, 42, 0.08);
}

/* Table overrides */
body.light-theme .sim-table th {
    background: rgba(15, 23, 42, 0.02);
    color: var(--text-muted);
}

body.light-theme .sim-table tbody tr:hover {
    background: rgba(15, 23, 42, 0.015);
}

body.light-theme .sim-table td.ip {
    color: var(--text-muted);
}

/* Scrollbar overrides */
body.light-theme ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
}

body.light-theme ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
}

body.light-theme ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Notifications panel overrides */
body.light-theme .notification-dropdown {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1);
}

body.light-theme .dropdown-header {
    border-bottom: 1px solid var(--border-color);
}

body.light-theme .notification-item {
    border-bottom: 1px solid var(--border-color);
}

body.light-theme .notification-item.unread {
    background: rgba(29, 78, 216, 0.03);
}

body.light-theme .notification-item.unread::before {
    background: var(--accent-blue);
}

body.light-theme .notification-item:hover {
    background: rgba(15, 23, 42, 0.02);
}

/* Modals glassmorphic light effect */
body.light-theme .modal-overlay {
    background: rgba(15, 23, 42, 0.4);
}

body.light-theme .modal-content {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
    border: 1px solid var(--border-color);
}

body.light-theme .modal-header {
    background: rgba(15, 23, 42, 0.02);
    border-bottom: 1px solid var(--border-color);
}

body.light-theme .modal-header h2 {
    color: var(--text-main);
}

body.light-theme .modal-search-container {
    background: rgba(15, 23, 42, 0.01);
}

body.light-theme .modal-search-container input {
    background: #ffffff;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

body.light-theme .close-btn {
    color: var(--text-muted);
}

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

body.light-theme .progress-bg {
    background: rgba(0, 0, 0, 0.06);
}

/* Dropdown Filters in headers */
body.light-theme .header-filter-dropdown {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
}

body.light-theme .filter-dropdown-title {
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
}

body.light-theme .filter-input-container input,
body.light-theme .filter-range-row input {
    background: #ffffff;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

body.light-theme .filter-checkbox-item:hover {
    background: rgba(15, 23, 42, 0.02);
}

body.light-theme .filter-checkbox-count {
    background: rgba(15, 23, 42, 0.05);
    color: var(--text-muted);
}

body.light-theme .filter-dropdown-actions {
    border-top: 1px solid var(--border-color);
}

body.light-theme .filter-btn-clear {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

body.light-theme .filter-btn-clear:hover {
    background: rgba(15, 23, 42, 0.04);
}

body.light-theme .filter-btn-apply {
    color: #ffffff;
}

/* KPI Cards header adjustment */
body.light-theme .logo-text h1 {
    background: linear-gradient(135deg, #0f172a, #334155);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.light-theme .logo-text span {
    color: var(--text-muted);
}

body.light-theme .depletion-stat-item {
    background: rgba(255, 255, 255, 0.6);
}

body.light-theme .depletion-stat-item:hover {
    background: rgba(255, 255, 255, 0.9);
}

body.light-theme .depletion-list-item {
    background: rgba(255, 255, 255, 0.4);
}

body.light-theme .depletion-list-item:hover {
    background: rgba(255, 255, 255, 0.85);
}

body.light-theme .toast {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
    color: var(--text-main);
}

body.light-theme .toast-header {
    border-bottom: 1px solid var(--border-color);
}


.export-group {
    display: flex;
    gap: 0.75rem;
}

/* ==========================================================================
   Print Styles for Executive PDF Report
   ========================================================================== */
@media print {

    /* Hide interactive elements, tools and animations */
    .background-decor,
    .background-decor-2,
    .header-actions,
    .table-controls,
    .export-group,
    .table-footer,
    .pagination-controls,
    .toast-container,
    .modal-overlay,
    .th-filter-btn,
    .sort-indicator,
    #clear-all-filters-btn,
    .panel-right,
    .non-top-client {
        display: none !important;
    }

    /* Standard PDF layout overrides */
    html,
    body {
        position: static !important;
        background: #ffffff !important;
        color: #0f172a !important;
        font-family: 'Inter', -apple-system, sans-serif !important;
        font-size: 9pt !important;
        overflow: visible !important;
        height: auto !important;
        min-height: auto !important;
    }

    .app-container {
        display: block !important;
        position: static !important;
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
        height: auto !important;
    }

    /* Print header layout */
    .app-header {
        background: transparent !important;
        border: none !important;
        border-bottom: 2px solid #0f172a !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        padding: 0 0 1rem 0 !important;
        margin-bottom: 1.5rem !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    .header-logo {
        display: flex !important;
        align-items: center !important;
        gap: 0.75rem !important;
    }

    .header-isotype {
        height: 35px !important;
        filter: none !important;
        display: block !important;
    }

    .header-logotipo {
        height: 22px !important;
        filter: none !important;
        display: block !important;
    }

    .logo-text h1 {
        background: none !important;
        -webkit-background-clip: initial !important;
        -webkit-text-fill-color: #0f172a !important;
        color: #0f172a !important;
        font-size: 1.4rem !important;
    }

    .logo-text span {
        color: #475569 !important;
    }

    /* KPI Grid layout for paper sheet width */
    .kpi-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.75rem !important;
        margin-bottom: 1.5rem !important;
        page-break-inside: avoid !important;
    }

    .kpi-card {
        background: #f8fafc !important;
        border: 1px solid #cbd5e1 !important;
        border-radius: 8px !important;
        box-shadow: none !important;
        padding: 0.75rem !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        page-break-inside: avoid !important;
    }

    .kpi-value {
        font-size: 1.5rem !important;
        font-weight: 800 !important;
        color: #0f172a !important;
        letter-spacing: -0.5px !important;
    }

    .kpi-subtext {
        font-size: 0.7rem !important;
        color: #475569 !important;
    }

    .kpi-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 1rem !important;
        border-radius: 6px !important;
        background: rgba(0, 0, 0, 0.03) !important;
        color: #0f172a !important;
        border: 1px solid #cbd5e1 !important;
    }

    .text-pink {
        color: #be185d !important;
    }

    .text-red {
        color: #b91c1c !important;
    }

    .text-orange {
        color: #c2410c !important;
    }

    .text-cyan {
        color: #0369a1 !important;
    }

    .text-purple {
        color: #6d28d9 !important;
    }

    /* Workspace grid adapt */
    .dashboard-workspace {
        display: block !important;
        width: 100% !important;
    }

    .charts-row {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 1.5rem !important;
        margin-bottom: 1.5rem !important;
    }

    .panel-left,
    .panel-depletion {
        min-height: auto !important;
        height: auto !important;
    }

    #panel-clients {
        grid-column: span 2 !important;
    }

    .card {
        background: transparent !important;
        border: 1px solid #cbd5e1 !important;
        box-shadow: none !important;
        border-radius: 8px !important;
        page-break-inside: avoid !important;
    }

    .card-header {
        padding: 0.75rem 1rem !important;
        border-bottom: 1px solid #cbd5e1 !important;
    }

    .card-header h2 {
        font-size: 1rem !important;
        color: #0f172a !important;
    }

    .chart-container {
        padding: 0.5rem !important;
        height: 250px !important;
        min-height: 250px !important;
    }

    .legend-list-container {
        max-height: none !important;
        overflow: visible !important;
        padding: 0.5rem 1rem !important;
        border-top: 1px solid #cbd5e1 !important;
    }

    /* Forecast items list format */
    .depletion-summary-stats {
        gap: 0.5rem !important;
    }

    .depletion-stat-item {
        background: #f8fafc !important;
        border: 1px solid #cbd5e1 !important;
        border-radius: 6px !important;
        padding: 0.5rem !important;
    }

    .depletion-stat-count {
        font-size: 1.2rem !important;
    }

    .depletion-list-item {
        background: #f8fafc !important;
        border: 1px solid #e2e8f0 !important;
        padding: 0.5rem !important;
    }

    /* SIM Table formatting */
    .panel-right {
        page-break-before: always !important;
        margin-top: 2rem !important;
    }

    .table-responsive {
        overflow: visible !important;
        max-height: none !important;
        height: auto !important;
        border: none !important;
        background: transparent !important;
    }

    .sim-table {
        font-size: 7.5pt !important;
    }

    .sim-table th {
        background: #f1f5f9 !important;
        color: #0f172a !important;
        border-bottom: 1.5px solid #94a3b8 !important;
        padding: 0.4rem !important;
    }

    .sim-table td {
        border-bottom: 1px solid #e2e8f0 !important;
        padding: 0.4rem !important;
        color: #334155 !important;
    }

    .sim-table tbody tr {
        background: transparent !important;
    }

    .sim-table td.iccid,
    .sim-table td.msisdn,
    .sim-table td.ip {
        color: #0f172a !important;
    }

    .status-pill {
        padding: 0.15rem 0.4rem !important;
        font-size: 6.5pt !important;
        border-radius: 3px !important;
        border: 1px solid rgba(0, 0, 0, 0.1) !important;
    }

    .status-pill.active {
        background: #dcfce7 !important;
        color: #15803d !important;
    }

    .status-pill.suspended {
        background: #fef3c7 !important;
        color: #b45309 !important;
    }

    .status-pill.blocked {
        background: #fee2e2 !important;
        color: #b91c1c !important;
    }

    .status-pill.attached {
        background: #f3e8ff !important;
        color: #6b21a8 !important;
    }

    .mini-tag {
        background: #f1f5f9 !important;
        color: #334155 !important;
        border: 1px solid #cbd5e1 !important;
        padding: 0.1rem 0.3rem !important;
        font-size: 6.5pt !important;
    }

    tr,
    td,
    th {
        page-break-inside: avoid !important;
    }
}

/* User Profile Header Component & Logout Button */
.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}

.user-profile i {
    font-size: 1.1rem;
    color: var(--accent-blue);
}

.user-details {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-name {
    font-weight: 600;
    color: var(--text-main);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(158, 45, 42, 0.1);
    color: #f87171;
    border: 1px solid rgba(158, 45, 42, 0.25);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.btn-logout:hover {
    background: var(--accent-blue);
    color: #ffffff;
    border-color: var(--accent-blue-dark);
    box-shadow: 0 4px 12px rgba(158, 45, 42, 0.2);
}

/* Light theme overrides for user profile */
body.light-theme .user-profile {
    background: rgba(0, 0, 0, 0.03);
}

body.light-theme .user-name {
    color: var(--text-dark);
}

body.light-theme .btn-logout {
    background: rgba(158, 45, 42, 0.05);
}

body.light-theme .btn-logout:hover {
    background: var(--accent-blue);
    color: #ffffff;
}

.btn-audit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.btn-audit:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

body.light-theme .btn-audit {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-dark);
}

body.light-theme .btn-audit:hover {
    background: rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   SIDEBAR & MULTI-VIEW NAVIGATION STYLES
   ========================================================================== */

/* Layout Shell */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
    background-color: var(--bg-primary);
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--bg-secondary);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
}

.sidebar-header {
    padding: 1.25rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-isotype {
    height: 34px;
    width: auto;
    flex-shrink: 0;
}

.sidebar-logotipo {
    height: 18px;
    width: auto;
    display: block;
}

.sidebar-logo-text {
    display: flex;
    flex-direction: column;
}

.sidebar-subtext {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.3px;
}

.sidebar-toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

/* Sidebar Nav */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.75rem 0.75rem 0.35rem 0.75rem;
    white-space: nowrap;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-align: left;
    width: 100%;
    position: relative;
    white-space: nowrap;
}

.nav-item i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.05);
}

.nav-item:hover i {
    color: var(--accent-blue);
}

.nav-item.active {
    background: var(--accent-blue-bg);
    color: #ffffff;
    border-color: var(--accent-blue-border);
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(158, 45, 42, 0.15);
}

.nav-item.active i {
    color: #fca5a5;
}

.nav-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    background: rgba(158, 45, 42, 0.2);
    color: #fca5a5;
    font-weight: 600;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.btn-logout-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(158, 45, 42, 0.1);
    color: #f87171;
    border: 1px solid rgba(158, 45, 42, 0.25);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.btn-logout-icon:hover {
    background: var(--accent-blue);
    color: #ffffff;
    border-color: var(--accent-blue-dark);
}

/* Collapsed Sidebar State */
.sidebar-collapsed .sidebar {
    width: 72px;
    min-width: 72px;
}

.sidebar-collapsed .sidebar-logo-text,
.sidebar-collapsed .nav-section-title,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .nav-badge,
.sidebar-collapsed .user-details {
    display: none !important;
}

.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: 1.25rem 0.5rem;
}

.sidebar-collapsed .sidebar-brand {
    display: none;
}

.sidebar-collapsed .sidebar-toggle-btn i {
    transform: rotate(180deg);
}

.sidebar-collapsed .nav-item {
    justify-content: center;
    padding: 0.75rem 0;
}

.sidebar-collapsed .user-profile {
    justify-content: center;
    padding: 0.6rem;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
    overflow-x: hidden;
}

/* Top Bar Styles */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 900;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(20, 20, 20, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-hamburger-btn {
    display: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1rem;
}

.view-header-title h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
}

.view-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Workspace Container */
.workspace-body {
    padding: 1.75rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Dynamic View Display Modes */
/* Mode: All (Vista Completa / Dashboard Principal - Default) */
.view-mode-all .kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)) !important;
    gap: 1.1rem !important;
    width: 100% !important;
}

.view-mode-all .section-title-wrapper {
    display: flex !important;
}

.view-mode-all #threshold-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
    gap: 1.25rem !important;
    width: 100% !important;
}

.view-mode-all .charts-row {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)) !important;
    gap: 1.5rem !important;
    width: 100% !important;
}

.view-mode-all .panel-right {
    display: flex !important;
    width: 100% !important;
}

/* Mode: Overview (Resumen General) */
.view-mode-overview .kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)) !important;
    gap: 1.1rem !important;
    width: 100% !important;
}

.view-mode-overview .section-title-wrapper {
    display: flex !important;
}

.view-mode-overview #threshold-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
    gap: 1.25rem !important;
    width: 100% !important;
}

.view-mode-overview .charts-row,
.view-mode-overview .panel-right {
    display: none !important;
}

/* Mode: Sims (Monitoreo & SIMs) */
.view-mode-sims .kpi-grid,
.view-mode-sims .section-title-wrapper,
.view-mode-sims #threshold-grid,
.view-mode-sims .charts-row {
    display: none !important;
}

.view-mode-sims .panel-right {
    display: flex !important;
    width: 100% !important;
}

/* Mode: Analytics (Analítica & Reportes) */
.view-mode-analytics .kpi-grid,
.view-mode-analytics .section-title-wrapper,
.view-mode-analytics #threshold-grid,
.view-mode-analytics .panel-right {
    display: none !important;
}

.view-mode-analytics .charts-row {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr)) !important;
    gap: 1.5rem !important;
    width: 100% !important;
}

/* Mode: Depletion (Pronóstico & Alertas) */
.view-mode-depletion .kpi-grid,
.view-mode-depletion .section-title-wrapper,
.view-mode-depletion #threshold-grid,
.view-mode-depletion .panel-right {
    display: none !important;
}

.view-mode-depletion .charts-row {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)) !important;
    gap: 1.5rem !important;
}

.view-mode-depletion .panel-left,
.view-mode-depletion #panel-clients,
.view-mode-depletion #panel-peak-hours,
.view-mode-depletion #panel-devices,
.view-mode-depletion #panel-countries {
    display: none !important;
}

.view-mode-depletion .panel-depletion {
    display: flex !important;
    width: 100% !important;
}

/* Mode: Audit (Auditoría & Accesos) */
.view-mode-audit .kpi-grid,
.view-mode-audit .section-title-wrapper,
.view-mode-audit #threshold-grid,
.view-mode-audit .charts-row,
.view-mode-audit .panel-right {
    display: none !important;
}

.view-mode-audit #panel-audit {
    display: flex !important;
    width: 100% !important;
}

/* Audit Sub-Tabs Navigation */
.audit-subtabs-nav {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem 0 1.75rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.15);
    overflow-x: auto;
}

.audit-subtab-btn {
    padding: 0.75rem 1.25rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.audit-subtab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.audit-subtab-btn.active {
    color: #ffffff;
    border-bottom-color: var(--accent-blue);
    background: var(--accent-blue-bg);
}

.audit-subtab-btn.active i {
    color: #fca5a5;
}

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

.audit-tab-content.hidden {
    display: none !important;
}

.audit-tab-content.active:not(.hidden) {
    display: block !important;
    padding: 1.25rem 1.75rem;
    animation: fadeIn 0.25s ease;
}

/* Mobile & Responsiveness */
@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: -270px;
        top: 0;
        bottom: 0;
        z-index: 1050;
        transition: left 0.3s ease;
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .sidebar-mobile-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        z-index: 1040;
        display: none;
    }

    .sidebar-mobile-overlay.active {
        display: block;
    }

    .mobile-hamburger-btn {
        display: flex;
    }

    .view-mode-all .charts-row {
        grid-template-columns: 1fr;
    }

    .view-mode-analytics .charts-row {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================================================
   Light Mode Design System (WCAG High Contrast Compliant)
   ========================================================================== */
body.light-theme {
    --bg-primary: #f1f5f9;
    --bg-secondary: #ffffff;
    --border-color: #e2e8f0;
    --border-hover: #9e2d2a;
    --card-hover-shadow: 0 12px 30px 0 rgba(0, 0, 0, 0.08), 0 0 15px 0 rgba(158, 45, 42, 0.12);
    --glass-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.05);

    --accent-blue: #9e2d2a;
    --accent-blue-dark: #7f201d;
    --accent-blue-glow: rgba(158, 45, 42, 0.2);
    --accent-blue-bg: rgba(158, 45, 42, 0.08);
    --accent-blue-border: rgba(158, 45, 42, 0.2);

    --accent-cyan: #0284c7;
    --accent-purple: #7c3aed;
    --accent-purple-bg: rgba(124, 58, 237, 0.1);

    --mini-tag-bg: #f1f5f9;
    --mini-tag-text: #0f172a;
    --mini-tag-border: #cbd5e1;

    --notification-unread-bg: rgba(158, 45, 42, 0.04);
    --notification-unread-hover-bg: rgba(158, 45, 42, 0.08);

    --accent-green: #059669;
    --accent-green-bg: rgba(5, 150, 105, 0.1);
    --accent-orange: #d97706;
    --accent-orange-bg: rgba(217, 119, 6, 0.1);
    --accent-red: #dc2626;
    --accent-red-bg: rgba(220, 38, 38, 0.1);
    --accent-pink: #be185d;
    --accent-pink-bg: rgba(190, 24, 93, 0.1);
    --accent-gray: #475569;
    --accent-gray-bg: rgba(71, 85, 105, 0.1);

    --text-main: #0f172a;
    --text-muted: #475569;
    --text-dark: #0f172a;
}

/* Light Theme Component Overrides */
body.light-theme .background-decor,
body.light-theme .background-decor-2 {
    opacity: 0.25;
}

body.light-theme .sidebar {
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.04);
}

body.light-theme .sidebar-header {
    border-bottom: 1px solid #e2e8f0;
}

body.light-theme .sidebar-subtext {
    color: #64748b;
}

body.light-theme .nav-section-title {
    color: #64748b;
}

body.light-theme .nav-item {
    color: #334155;
}

body.light-theme .nav-item i {
    color: #64748b;
}

body.light-theme .nav-item:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}

body.light-theme .nav-item:hover i {
    color: #9e2d2a;
}

body.light-theme .nav-item.active {
    background: #9e2d2a;
    color: #ffffff !important;
    border-color: #7f201d;
    box-shadow: 0 4px 14px rgba(158, 45, 42, 0.25);
}

body.light-theme .nav-item.active i {
    color: #ffffff !important;
}

body.light-theme .nav-item.active .nav-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

body.light-theme .sidebar-toggle-btn {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

body.light-theme .sidebar-toggle-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

body.light-theme .user-profile {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

body.light-theme .user-name {
    color: #0f172a;
}

body.light-theme .user-role {
    color: #64748b;
}

body.light-theme .theme-toggle-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

body.light-theme .theme-toggle-btn:hover {
    background: #e2e8f0;
    color: #9e2d2a;
}

body.light-theme .btn-logout-icon {
    background: rgba(220, 38, 38, 0.08);
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.2);
}

body.light-theme .btn-logout-icon:hover {
    background: #dc2626;
    color: #ffffff;
}

body.light-theme .top-bar {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

body.light-theme .view-header-title h1 {
    color: #0f172a;
}

body.light-theme .view-subtitle {
    color: #64748b;
}

body.light-theme .mobile-hamburger-btn {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

body.light-theme .kpi-card,
body.light-theme .card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

body.light-theme .card-header.border-bottom {
    border-bottom: 1px solid #e2e8f0;
}

body.light-theme .card-header h2 {
    color: #0f172a;
}

body.light-theme .card-subtitle {
    color: #64748b;
}

body.light-theme .kpi-info h3 {
    color: #475569;
}

body.light-theme .kpi-value {
    color: #0f172a;
}

body.light-theme .kpi-subtext {
    color: #64748b;
}

body.light-theme .audit-subtabs-nav {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

body.light-theme .audit-subtab-btn {
    color: #64748b;
}

body.light-theme .audit-subtab-btn:hover {
    color: #0f172a;
    background: #f1f5f9;
}

body.light-theme .audit-subtab-btn.active {
    color: #9e2d2a;
    border-bottom-color: #9e2d2a;
    background: #ffffff;
}

body.light-theme .audit-subtab-btn.active i {
    color: #9e2d2a;
}

body.light-theme .search-box input {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

body.light-theme .search-box input::placeholder {
    color: #94a3b8;
}

body.light-theme .search-box i {
    color: #64748b;
}

body.light-theme .form-select {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

body.light-theme .form-select option {
    background-color: #ffffff;
    color: #0f172a;
}

body.light-theme .form-control {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

body.light-theme .form-control::placeholder {
    color: #94a3b8;
}

body.light-theme .btn-secondary {
    background: #e2e8f0;
    color: #1e293b;
    border: 1px solid #cbd5e1;
}

body.light-theme .btn-secondary:hover {
    background: #cbd5e1;
    color: #0f172a;
}

body.light-theme .sim-table th {
    background: #f8fafc;
    color: #334155;
    border-bottom: 2px solid #e2e8f0;
}

body.light-theme .sim-table td {
    color: #1e293b;
    border-bottom: 1px solid #e2e8f0;
}

body.light-theme .sim-table tbody tr:hover {
    background: #f1f5f9;
}

body.light-theme .iccid-code {
    color: #0f172a;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
}

body.light-theme .depletion-stat-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

body.light-theme .depletion-stat-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

body.light-theme .depletion-list-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

body.light-theme .depletion-list-item:hover {
    background: #f8fafc;
    border-color: #9e2d2a;
}

body.light-theme .depletion-item-name {
    color: #0f172a;
}

body.light-theme .depletion-item-iccid {
    color: #64748b;
}

body.light-theme .text-purple {
    color: #7c3aed !important;
}

body.light-theme .text-cyan {
    color: #0284c7 !important;
}

body.light-theme .text-pink {
    color: #be185d !important;
}

body.light-theme .text-red {
    color: #dc2626 !important;
}

body.light-theme .text-orange {
    color: #d97706 !important;
}

body.light-theme .text-green {
    color: #059669 !important;
}

body.light-theme .modal-content {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

body.light-theme .modal-header {
    border-bottom: 1px solid #e2e8f0;
}

body.light-theme .modal-header h2 {
    color: #0f172a;
}

body.light-theme .modal-close {
    color: #64748b;
}

body.light-theme .modal-close:hover {
    color: #0f172a;
}

body.light-theme .modal-footer {
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

body.light-theme .detail-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

body.light-theme .detail-label {
    color: #64748b;
}

body.light-theme .detail-value {
    color: #0f172a;
}

body.light-theme .notification-dropdown {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    color: #0f172a;
}

body.light-theme .dropdown-header {
    border-bottom: 1px solid #e2e8f0;
}

body.light-theme .dropdown-header h3 {
    color: #0f172a;
}

body.light-theme .notification-empty {
    color: #64748b;
}

body.light-theme .header-filter-dropdown {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    color: #0f172a;
}

body.light-theme .header-filter-item {
    color: #334155;
}

body.light-theme .header-filter-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}

body.light-theme .btn-pagination {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
}

body.light-theme .btn-pagination:hover:not(:disabled) {
    background: #f1f5f9;
    color: #0f172a;
}

body.light-theme .btn-pagination:disabled {
    background: #f8fafc;
    color: #94a3b8;
    border-color: #e2e8f0;
}

body.light-theme .page-input {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

body.light-theme .pagination-info {
    color: #64748b;
}

/* Modal Tags Filter Bar & Chips */
.modal-tags-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.6rem;
    padding: 0.6rem 0.8rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    max-height: 115px;
    overflow-y: auto;
    scrollbar-width: thin;
    flex-shrink: 0;
}

.modal-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.2;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted, #9ca3af);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.modal-tag-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main, #ffffff);
    border-color: rgba(255, 255, 255, 0.25);
}

.modal-tag-chip.active {
    background: rgba(249, 115, 22, 0.2) !important;
    border-color: var(--accent-orange, #f97316) !important;
    color: #fdba74 !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.25);
}

body.light-theme .modal-tags-bar {
    background: rgba(0, 0, 0, 0.03);
}

body.light-theme .modal-tag-chip {
    border-color: rgba(0, 0, 0, 0.15);
    background: rgba(0, 0, 0, 0.04);
    color: #475569;
}

body.light-theme .modal-tag-chip:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #0f172a;
}

body.light-theme .modal-tag-chip.active {
    background: #fff7ed !important;
    border-color: #ea580c !important;
    color: #c2410c !important;
}

/* ==========================================================================
   Audit Center High Contrast & Theme Styling
   ========================================================================== */

.audit-date-filter-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-main);
    background: var(--bg-secondary);
    padding: 0.3rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.audit-date-label {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.78rem;
}

.audit-date-input {
    height: 32px;
    padding: 0 0.5rem;
    font-size: 0.78rem;
    width: 130px;
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    color-scheme: dark;
    transition: var(--transition-smooth);
}

.audit-date-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px var(--accent-blue-glow);
}

.audit-export-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.4rem;
    background: var(--bg-secondary);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    z-index: 100;
    min-width: 235px;
    padding: 0.5rem 0;
    overflow: hidden;
}

.audit-export-item {
    width: 100%;
    text-align: left;
    padding: 0.65rem 1.1rem;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: var(--transition-smooth);
}

.audit-export-item:hover {
    background: rgba(255, 255, 255, 0.09);
    color: var(--text-main);
}

.audit-export-divider {
    border-top: 1px solid var(--border-color);
    margin: 0.35rem 0;
}

.audit-kpi-card {
    background: var(--bg-secondary);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 0.95rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--glass-shadow);
    transition: var(--transition-smooth);
}

.audit-kpi-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    box-shadow: var(--card-hover-shadow);
}

/* Light Theme Overrides for Audit */
body.light-theme .audit-date-filter-group {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

body.light-theme .audit-date-label {
    color: #334155;
}

body.light-theme .audit-date-input {
    background: #f8fafc;
    color: #0f172a;
    border-color: #cbd5e1;
    color-scheme: light;
}

body.light-theme .audit-export-menu {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

body.light-theme .audit-export-item {
    color: #0f172a;
}

body.light-theme .audit-export-item:hover {
    background: #f1f5f9;
}

body.light-theme .audit-export-divider {
    border-top-color: #e2e8f0;
}

body.light-theme .audit-kpi-card {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.audit-kpi-card h3 {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
}

.audit-kpi-card .kpi-subtext {
    color: var(--text-muted);
    font-size: 0.75rem;
}

body.light-theme .audit-kpi-card h3 {
    color: #1e293b !important;
}

body.light-theme .audit-kpi-card .kpi-subtext {
    color: #475569 !important;
}

body.light-theme .audit-kpi-card .kpi-value.text-muted {
    color: #475569 !important;
}

/* High Contrast KPI Icon Badges in Light Theme */
body.light-theme .icon-blue {
    background: #dbeafe !important;
    color: #1d4ed8 !important;
    border-color: #93c5fd !important;
}

body.light-theme .icon-green {
    background: #d1fae5 !important;
    color: #047857 !important;
    border-color: #6ee7b7 !important;
}

body.light-theme .icon-orange {
    background: #fef3c7 !important;
    color: #b45309 !important;
    border-color: #fde68a !important;
}

body.light-theme .icon-purple {
    background: #f3e8ff !important;
    color: #6d28d9 !important;
    border-color: #d8b4fe !important;
}

body.light-theme .icon-cyan {
    background: #cffaff !important;
    color: #0e7490 !important;
    border-color: #67e8f9 !important;
}

body.light-theme .icon-slate,
body.light-theme .icon-gray {
    background: #f1f5f9 !important;
    color: #334155 !important;
    border-color: #cbd5e1 !important;
}

/* ==========================================================================
   Section: Permisos & Gestión de Usuarios (view-mode-users)
   ========================================================================== */
.view-mode-users .kpi-grid,
.view-mode-users .section-title-wrapper,
.view-mode-users #threshold-grid,
.view-mode-users .charts-row,
.view-mode-users .panel-right,
.view-mode-users #panel-audit {
    display: none !important;
}

.view-mode-users #panel-users {
    display: flex !important;
    flex-direction: column;
    width: 100% !important;
}

/* User Role Badges High Contrast */
.user-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.role-badge-admin {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.role-badge-gerente {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.role-badge-supervisor {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.role-badge-operador {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

/* User Status Badges */
.user-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.user-status-active {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.user-status-inactive {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.user-role-select {
    height: 36px;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    background-color: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.user-role-select option {
    background-color: #1a1a1a !important;
    color: #ededed !important;
    padding: 0.5rem 0.75rem;
}

.user-role-select option:hover,
.user-role-select option:focus,
.user-role-select option:checked {
    background-color: #9e2d2a !important;
    color: #ffffff !important;
}

.user-role-select:focus {
    border-color: #9e2d2a !important;
    outline: none;
    box-shadow: 0 0 0 2px rgba(158, 45, 42, 0.35) !important;
}

/* Custom Role Dropdown Component */
.custom-role-dropdown {
    position: relative;
    display: inline-block;
    min-width: 150px;
    text-align: left;
}

.role-dropdown-trigger {
    width: 100%;
    height: 36px;
    padding: 0 0.85rem;
    background: var(--bg-card, rgba(20, 20, 20, 0.6));
    color: var(--text-main, #ededed);
    border: 1px solid var(--border-color, rgba(237, 237, 237, 0.1));
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.role-dropdown-trigger:hover:not(:disabled) {
    border-color: #9e2d2a;
    background: rgba(158, 45, 42, 0.12);
}

.role-dropdown-trigger:focus,
.custom-role-dropdown.open .role-dropdown-trigger {
    outline: none;
    border-color: #9e2d2a;
    box-shadow: 0 0 0 2px rgba(158, 45, 42, 0.3);
}

.role-dropdown-trigger:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.dropdown-arrow {
    font-size: 0.72rem;
    color: var(--text-muted, #c6c6c6);
    transition: transform 0.2s ease;
}

.custom-role-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.role-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    min-width: 165px;
    background: #18181b;
    border: 1px solid rgba(158, 45, 42, 0.4);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    padding: 0.35rem 0;
    z-index: 1050;
    display: none;
    flex-direction: column;
    animation: fadeInDropdown 0.15s ease-out;
}

@keyframes fadeInDropdown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-role-dropdown.open .role-dropdown-menu {
    display: flex;
}

.role-dropdown-item {
    padding: 0.55rem 0.85rem;
    font-size: 0.83rem;
    font-weight: 500;
    color: #ededed;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

.role-dropdown-item i {
    font-size: 0.8rem;
    width: 16px;
    text-align: center;
    color: var(--text-muted, #94a3b8);
}

/* Hover effect with Brand Burgundy Palette */
.role-dropdown-item:hover {
    background: rgba(158, 45, 42, 0.25);
    color: #ffffff;
    border-left-color: #9e2d2a;
}

.role-dropdown-item:hover i {
    color: #fca5a5;
}

/* Active / Selected item */
.role-dropdown-item.active {
    background: #9e2d2a;
    color: #ffffff;
    font-weight: 600;
    border-left-color: #ffffff;
}

.role-dropdown-item.active i {
    color: #ffffff;
}

/* Action buttons in User Management */
.btn-action-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.btn-action-icon:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.btn-action-icon:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.btn-action-toggle.active {
    color: #ef4444;
}

.btn-action-toggle.active:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.35);
}

.btn-action-toggle.inactive {
    color: #10b981;
}

.btn-action-toggle.inactive:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.35);
}

.btn-action-delete {
    color: #ef4444;
}

.btn-action-delete:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

/* Light Theme High Contrast Overrides */
body.light-theme .role-badge-admin {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

body.light-theme .role-badge-gerente {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

body.light-theme .role-badge-supervisor {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

body.light-theme .role-badge-operador {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

body.light-theme .user-status-active {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

body.light-theme .user-status-inactive {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

body.light-theme .user-role-select {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-theme .user-role-select option {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

body.light-theme .user-role-select option:hover,
body.light-theme .user-role-select option:focus,
body.light-theme .user-role-select option:checked {
    background-color: #9e2d2a !important;
    color: #ffffff !important;
}

body.light-theme .user-role-select:focus {
    border-color: #9e2d2a !important;
    box-shadow: 0 0 0 2px rgba(158, 45, 42, 0.25) !important;
}

body.light-theme .role-dropdown-trigger {
    background: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
}

body.light-theme .role-dropdown-trigger:hover:not(:disabled) {
    border-color: #9e2d2a;
    background: #fff5f5;
}

body.light-theme .role-dropdown-menu {
    background: #ffffff;
    border-color: #fca5a5;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

body.light-theme .role-dropdown-item {
    color: #1e293b;
}

body.light-theme .role-dropdown-item:hover {
    background: #fee2e2;
    color: #991b1b;
    border-left-color: #9e2d2a;
}

body.light-theme .role-dropdown-item:hover i {
    color: #991b1b;
}

body.light-theme .role-dropdown-item.active {
    background: #9e2d2a;
    color: #ffffff;
    border-left-color: #ffffff;
}

body.light-theme .role-dropdown-item.active i {
    color: #ffffff;
}

body.light-theme .btn-action-icon {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
}

body.light-theme .btn-action-icon:hover {
    background: #e2e8f0;
}

body.light-theme .btn-action-delete {
    color: #dc2626;
}

body.light-theme .btn-action-delete:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

/* ==========================================================================
   Edit eSIM Modal & Tag Picker - Theme & Contrast Fixes
   ========================================================================== */
.edit-sim-input-disabled {
    width: 100%;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: var(--text-muted, #c6c6c6) !important;
    cursor: not-allowed;
    border-radius: 6px;
    font-size: 0.9rem;
    padding: 0 0.75rem;
}

.edit-sim-input {
    width: 100%;
    background: #27272a !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: var(--text-main, #ffffff) !important;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.edit-sim-input:focus {
    border-color: var(--accent-blue, #9e2d2a) !important;
    outline: none;
}

.edit-sim-tags-box {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.6rem;
    border-radius: 8px;
    align-items: center;
    transition: background-color 0.2s, border-color 0.2s;
}

.edit-sim-tags-box.selected-tags-box {
    min-height: 44px;
    background: #1f2937;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.edit-sim-tags-box.available-tags-box {
    max-height: 120px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Tag Chips in Edit SIM Modal */
.edit-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease-in-out;
    background: #27272a;
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.edit-tag-chip:hover {
    background: #3f3f46;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
}

.edit-tag-chip.active {
    background: rgba(158, 45, 42, 0.25);
    color: #fca5a5;
    border: 1px solid rgba(158, 45, 42, 0.6);
    font-weight: 600;
}

.edit-tag-chip.active:hover {
    background: rgba(158, 45, 42, 0.4);
    color: #ffffff;
}

.edit-tag-chip .remove-tag-icon {
    font-size: 0.7rem;
    margin-left: 0.2rem;
    opacity: 0.8;
    transition: opacity 0.15s, color 0.15s;
}

.edit-tag-chip .remove-tag-icon:hover {
    opacity: 1;
    color: #f87171;
}

.edit-sim-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.25rem;
}

/* Light Theme Overrides for Edit eSIM Modal */
body.light-theme #edit-sim-modal .modal-content {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
}

body.light-theme .edit-sim-input-disabled {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #64748b !important;
}

body.light-theme .edit-sim-input {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

body.light-theme .edit-sim-input::placeholder {
    color: #94a3b8 !important;
}

body.light-theme .edit-sim-input:focus {
    border-color: #9e2d2a !important;
    box-shadow: 0 0 0 3px rgba(158, 45, 42, 0.15) !important;
}

body.light-theme .edit-sim-tags-box.selected-tags-box {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-theme .edit-sim-tags-box.available-tags-box {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme .edit-tag-chip {
    background: #ffffff !important;
    color: #334155 !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

body.light-theme .edit-tag-chip:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

body.light-theme .edit-tag-chip.active {
    background: #fee2e2 !important;
    color: #991b1b !important;
    border: 1px solid #fca5a5 !important;
}

body.light-theme .edit-tag-chip.active:hover {
    background: #fca5a5 !important;
    color: #7f1d1d !important;
}

body.light-theme .edit-sim-footer {
    border-top: 1px solid #e2e8f0 !important;
}