@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Variables de diseño ────────────────────────────────────── */
:root {
    --sidebar-bg:     #111827;
    --sidebar-border: #1f2937;
    --content-bg:     #0d1117;
    --card-bg:        #161b27;
    --card-border:    #1e2d3d;
    --card-hover:     #1c2538;

    --txt-primary:    #e2e8f0;
    --txt-secondary:  #64748b;
    --txt-muted:      #3d4f63;

    --accent:         #3b82f6;
    --accent-soft:    rgba(59,130,246,0.08);
    --accent-hover:   #2563eb;
    --success:        #10b981;
    --success-soft:   rgba(16,185,129,0.08);
    --warning:        #f59e0b;
    --warning-soft:   rgba(245,158,11,0.08);
    --danger:         #ef4444;
    --danger-soft:    rgba(239,68,68,0.08);

    --radius-sm:  8px;
    --radius-md:  12px;
    --radius-lg:  16px;
    --shadow:     0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
    --shadow-lg:  0 10px 25px rgba(0,0,0,0.5);
    --transition: all 0.2s ease;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--content-bg);
    color: var(--txt-primary);
    min-height: 100vh;
    font-size: 0.9375rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

h1,h2,h3,h4,h5 { font-weight: 600; line-height: 1.3; color: var(--txt-primary); }

/* ── Layout ─────────────────────────────────────────────────── */
.app-container { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

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

.sidebar-close {
    display: none;
    background: transparent;
    border: none;
    color: var(--txt-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
}

.sidebar-header h2 {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #fff;
}

.sidebar-logo {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: white;
    flex-shrink: 0;
}

.nav-links { list-style: none; padding: 1rem 0.75rem; flex-grow: 1; }
.nav-item { margin-bottom: 2px; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    color: var(--txt-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link i { font-size: 0.9rem; width: 16px; text-align: center; }

.nav-link:hover {
    background: rgba(255,255,255,0.04);
    color: var(--txt-primary);
}

.nav-link.active {
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid rgba(59,130,246,0.15);
}

.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid var(--sidebar-border);
}

/* ── Main content ────────────────────────────────────────────── */
.main-content {
    flex-grow: 1;
    margin-left: 240px;
    padding: 1.75rem 2rem;
    overflow-y: auto;
    min-height: 100vh;
    transition: padding 0.3s ease;
}

/* ── Topbar ──────────────────────────────────────────────────── */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--sidebar-border);
}

.topbar-left h3 { font-size: 1rem; font-weight: 600; margin-bottom: 2px; }
.topbar-left p  { font-size: 0.8rem; color: var(--txt-secondary); }

.topbar-right { display: flex; align-items: center; gap: 0.75rem; }

.avatar {
    width: 36px; height: 36px;
    background: var(--accent-soft);
    border: 1px solid rgba(59,130,246,0.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
}

.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--txt-primary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
}

/* ── Stat cards ──────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: #2a3f56;
    background: var(--card-hover);
}

.stat-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.stat-icon.blue   { background: var(--accent-soft);   color: var(--accent); }
.stat-icon.green  { background: var(--success-soft);  color: var(--success); }
.stat-icon.yellow { background: var(--warning-soft);  color: var(--warning); }
.stat-icon.red    { background: var(--danger-soft);   color: var(--danger); }

.stat-body { flex: 1; min-width: 0; }
.stat-label  { font-size: 0.75rem; color: var(--txt-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.25rem; }
.stat-value  { font-size: 1.35rem; font-weight: 700; color: var(--txt-primary); line-height: 1.2; }
.stat-sub    { font-size: 0.75rem; color: var(--txt-secondary); margin-top: 3px; }

/* Status badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}
.badge-green  { background: var(--success-soft); color: var(--success); }
.badge-yellow { background: var(--warning-soft); color: var(--warning); }
.badge-red    { background: var(--danger-soft);  color: var(--danger); }
.badge-blue   { background: var(--accent-soft);  color: var(--accent); }
.badge-dot::before {
    content: ''; width: 6px; height: 6px;
    border-radius: 50%; background: currentColor;
}

/* ── Panel glass ─────────────────────────────────────────────── */
.glass-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.speedtest-container {
    padding: 0;
    overflow: hidden;
    border-radius: 16px;
    height: 650px;
}
.speedtest-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

@media (max-width: 768px) {
    .speedtest-container { height: 500px; }
}

/* Legacy grid (facturas, dashboard) */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.grid-2-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 900px) {
    .grid-2-cols { grid-template-columns: 1fr; }
}

.status-card {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    transition: var(--transition);
    gap: 1rem;
}
.status-card:hover { background: var(--card-hover); border-color:#2a3f56; }

.status-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    background: var(--accent-soft);
    color: var(--accent);
}

.status-info h4 { font-size: 0.75rem; color: var(--txt-secondary); font-weight: 500; margin-bottom: 2px; }
.status-info p  { font-size: 1.15rem; font-weight: 700; color: var(--txt-primary); }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

.form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--txt-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    background: #1e293b; /* Fondo sólido oscuro para evitar transparencias problemáticas */
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    color: var(--txt-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: var(--transition);
}

/* Arreglo para selectores en modo oscuro (Firefox/Chrome) */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

select.form-control option {
    background-color: #1e293b;
    color: var(--txt-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
    background: #232d3f;
}
.form-control:read-only { opacity: 0.55; cursor: not-allowed; }

/* Search Forms (Facturas) */
.search-query-form {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}
.form-group-flex { flex: 1; min-width: 180px; }
.form-actions { flex-shrink: 0; }

@media (max-width: 600px) {
    .search-query-form { flex-direction: column; align-items: stretch; }
    .form-group-flex { min-width: 100%; }
    .form-actions { margin-top: 0.5rem; }
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    font-family: 'Inter', sans-serif;
    line-height: 1;
}

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

.btn-ghost {
    background: transparent;
    color: var(--txt-secondary);
    border-color: var(--card-border);
}
.btn-ghost:hover { background: rgba(255,255,255,0.04); color: var(--txt-primary); }

.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(239,68,68,0.2); }
.btn-danger:hover { background: var(--danger); color: white; }

.btn-block { width: 100%; }

/* ── Alert ───────────────────────────────────────────────────── */
.alert {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    display: flex; align-items: flex-start; gap: 0.5rem;
    margin-bottom: 1.25rem;
    background: var(--danger-soft);
    border: 1px solid rgba(239,68,68,0.2);
    color: #f87171;
}
.alert-success {
    background: var(--success-soft);
    border-color: rgba(16,185,129,0.2);
    color: #34d399;
}

/* ── Divider ──────────────────────────────────────────────────── */
.divider { height:1px; background: var(--sidebar-border); margin: 1.5rem 0; }

/* ── Data row (perfil) ───────────────────────────────────────── */
.data-row {
    display: flex; align-items: baseline; gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--sidebar-border);
}
.data-row:last-child { border-bottom: none; }
.data-key   { width: 140px; flex-shrink: 0; font-size:0.78rem; color: var(--txt-secondary); font-weight:500; text-transform: uppercase; letter-spacing:0.05em; }
.data-value { font-size: 0.9rem; font-weight: 500; color: var(--txt-primary); }

/* ── Table ───────────────────────────────────────────────────── */
table { width:100%; border-collapse:collapse; }
th,td { padding:0.875rem 1rem; text-align:left; border-bottom:1px solid var(--sidebar-border); font-size:0.875rem; }
th { color:var(--txt-secondary); font-weight:500; font-size:0.75rem; text-transform:uppercase; letter-spacing:0.05em; }
td { color: var(--txt-primary); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.015); }

/* ── Login ───────────────────────────────────────────────────── */
.login-container {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
    background: var(--content-bg);
}

.login-box {
    width: 100%; max-width: 420px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.logo-container { text-align:center; margin-bottom:1.75rem; }
.gradient-text {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .main-content { padding: 1.5rem 1.25rem; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); width: 280px; }
    .sidebar.active { transform: translateX(0); }
    .sidebar-close { display: block; }
    .main-content { margin-left:0; padding: 1rem 0.75rem; }
    .mobile-nav-toggle { display:block; }
    .topbar { position:sticky; top:0; z-index:90; background:var(--content-bg); padding:1rem 0; margin-bottom: 1.25rem; }
    .topbar-left h3 { font-size: 0.95rem; }
    .topbar-left p { font-size: 0.75rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
    .stat-card { padding: 1rem; }
    .stat-value { font-size: 1.2rem; }
}

@media (max-width: 500px) {
    .stats-grid { grid-template-columns: 1fr; }
    .topbar { padding: 0.75rem 0; }
    .stat-card { align-items: center; }
    .stat-icon { width: 36px; height: 36px; font-size: 0.9rem; }
}
/* ── Modal & Overlay ─────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center; justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    width: 90%; max-width: 500px;
    position: relative;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-close {
    position: absolute;
    top: 1rem; right: 1rem;
    width: 32px; height: 32px;
    background: rgba(0,0,0,0.3);
    border: none; border-radius: 50%;
    color: white; font-size: 1.2rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    z-index: 10;
    transition: var(--transition);
}
.modal-close:hover { background: var(--danger); transform: rotate(90deg); }

.modal-img { width: 100%; display: block; object-fit: cover; }

.modal-body { padding: 1.5rem; text-align: center; }
.modal-body h3 { margin-bottom: 0.5rem; font-size: 1.25rem; }
.modal-body p { color: var(--txt-secondary); font-size: 0.9rem; margin-bottom: 1.5rem; }

/* Variación Informativa */
.modal-content.info { border-color: var(--accent); }
.modal-content.info .btn-primary { background: var(--accent); }
.modal-content.info h3 { color: var(--accent); }

/* Variación Planes */
.modal-content.plans { max-width: 900px; }
.plans-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 1rem;
}

.plan-card-item {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-top: 5px solid var(--accent);
    color: #1f2937;
}

.plan-title { font-size: 0.65rem; color: #6b7280; font-weight: 700; text-transform: uppercase; margin-bottom: 0.5rem; letter-spacing: 0.05em; }
.plan-mb { font-size: 2rem; font-weight: 800; color: var(--accent); margin-bottom: 0.25rem; }
.plan-price { font-size: 1.25rem; font-weight: 700; color: #111827; margin-bottom: 0.5rem; }
.plan-desc { font-size: 0.75rem; color: #4b5563; margin-bottom: 1.25rem; min-height: 2em; }

.plan-features {
    list-style: none;
    text-align: left;
    width: 100%;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.plan-features li {
    font-size: 0.7rem;
    color: #4b5563;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.plan-features li i { color: var(--success); font-size: 0.8rem; }

.btn-contract {
    background: #fff;
    color: #1f2937;
    border: 2px solid #1f2937;
    font-weight: 700;
    width: 100%;
    padding: 0.5rem;
    border-radius: 999px;
    font-size: 0.8rem;
    transition: all 0.2s;
}
.btn-contract:hover { background: #1f2937; color: #fff; }

@media (max-width: 768px) {
    .modal-content.plans { width: 95%; max-height: 90vh; overflow-y: auto; }
    .plans-grid { grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
    .modal-content { width: 98%; border-radius: 0; }
}

/* ── Invoice PDF Styling (Hidden by default) ─────────────────── */
#invoice-capture-area {
    position: absolute;
    left: -9999px;
    top: 0;
    width: 800px; /* Ancho fijo para captura consistente */
}

.invoice-pdf-container {
    background: white;
    color: #1e293b;
    font-family: 'Inter', sans-serif;
    padding: 40px;
    line-height: 1.4;
}

.invoice-pdf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #1e293b;
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.corp-info { text-align: right; font-size: 13px; }
.corp-info h1 { font-size: 22px; font-weight: 800; margin-bottom: 5px; color: #1e293b; }

.invoice-pdf-title-section { margin-bottom: 25px; }
.invoice-pdf-title-section h2 { font-size: 20px; font-weight: 900; margin-bottom: 5px; text-transform: uppercase; color: #0f172a; }
.invoice-pdf-title-section p { font-size: 14px; font-weight: 700; color: #1e293b; }

.pdf-section-title {
    background: #e2e8f0;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 15px;
    border-radius: 4px;
    color: #0f172a;
}

.pdf-info-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 8px;
    margin-bottom: 30px;
    padding: 0 12px;
}
.pdf-info-grid div:nth-child(odd) { font-weight: 700; font-size: 13px; text-transform: uppercase; color: #475569; }
.pdf-info-grid div:nth-child(even) { font-size: 14px; color: #1e293b; }

.pdf-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}
.pdf-table th {
    background: #e2e8f0;
    border: 1px solid #94a3b8;
    padding: 10px;
    font-size: 13px;
    font-weight: 900;
    text-align: center;
    color: #0f172a;
}
.pdf-table td {
    border: 1px solid #cbd5e1;
    padding: 12px 10px;
    font-size: 14px;
    color: #0f172a;
    font-weight: 500;
}

.pdf-totals {
    float: right;
    width: 250px;
    text-align: right;
}
.pdf-total-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 14px;
}
.pdf-total-row.grand-total {
    font-size: 18px;
    font-weight: 800;
    margin-top: 10px;
    border-top: 2px solid #1e293b;
    padding-top: 10px;
}

.pdf-footer {
    margin-top: 120px;
    font-size: 12px;
}
.pdf-notes { color: #475569; margin-bottom: 40px; }
.pdf-notes ol { padding-left: 20px; }
.pdf-notes li { margin-bottom: 4px; }

.pdf-bottom-text {
    text-align: center;
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
    font-style: italic;
    color: #64748b;
}

/* Modal de Visualización */
.pdf-viewer-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
    z-index: 4000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.pdf-viewer-modal.active { display: flex; }

.pdf-viewer-content {
    background: white;
    width: 100%;
    max-width: 900px;
    height: 90vh;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pdf-viewer-header {
    background: #1e293b;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}
.pdf-viewer-header h3 { font-size: 1rem; margin: 0; display: flex; align-items: center; gap: 0.75rem; }
.pdf-viewer-body { flex: 1; position: relative; background: #f1f5f9; padding: 20px; overflow-y: auto; text-align: center; }

.pdf-preview-loading {
    position: absolute;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    text-align: center;
    color: #475569;
}
.pdf-preview-loading i { font-size: 2rem; margin-bottom: 1rem; animation: spin 1s linear infinite; }

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

/* ── Invoice Detail Drawer ───────────────────────────────────── */
.invoice-drawer {
    position: fixed;
    top: 0; right: 0; width: 100%; height: 100%;
    background: var(--content-bg);
    z-index: 3000;
    display: none;
    flex-direction: column;
    overflow-y: auto;
}

.invoice-drawer.active { display: flex !important; animation: slideInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1); }

@keyframes slideInUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.drawer-header {
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--sidebar-border);
    color: var(--txt-primary);
    padding: 1.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.drawer-header h2 { font-size: 1.1rem; font-weight: 700; color: var(--txt-primary); margin: 0; flex: 1; text-align: center; }
.btn-back { background: transparent; border: none; color: var(--txt-primary); font-size: 1.25rem; cursor: pointer; padding: 0.5rem; }

.drawer-body { padding: 1rem; max-width: 600px; margin: 0 auto; width: 100%; }

.drawer-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--card-border);
}

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

.card-label { font-size: 0.8rem; color: var(--txt-secondary); margin-bottom: 0.25rem; }
.card-value { font-size: 0.95rem; font-weight: 600; color: var(--txt-primary); }

.monto-label { font-size: 0.9rem; color: var(--txt-secondary); margin-top: 1rem; }
.monto-value { font-size: 2.5rem; font-weight: 800; color: var(--accent); margin: 0.5rem 0; }

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--card-border);
}
.detail-item:last-child { border-bottom: none; }
.detail-item i { width: 20px; color: var(--txt-muted); font-size: 0.9rem; }
.detail-item span { font-size: 0.875rem; color: var(--txt-secondary); }

.btn-pay-now {
    background: var(--accent);
    color: white;
    font-weight: 700;
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.2);
}
.btn-pay-now:hover { background: var(--accent-hover); transform: translateY(-1px); }

.conoce-servicios { margin-top: 2rem; }
.conoce-servicios h4 { font-size: 1rem; font-weight: 700; color: var(--txt-primary); margin-bottom: 1rem; text-align: center; }

.action-link {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    text-decoration: none;
    color: var(--txt-primary);
    border: 1px solid var(--card-border);
    transition: all 0.2s;
}
.action-link:hover { border-color: var(--accent); transform: translateX(4px); }
.action-link i.icon-start { color: var(--accent); font-size: 1.1rem; }
.action-link span { flex: 1; font-weight: 600; font-size: 0.9rem; color: var(--txt-primary); }

/* ── Invasive Notice Modal ────────────────────────────────────── */
.notice-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center; justify-content: center;
    z-index: 99999; /* Por encima de todo */
    opacity: 0;
    transition: opacity 0.4s ease;
}

.notice-overlay.active {
    display: flex;
    opacity: 1;
}

.notice-modal {
    background: #fff;
    width: 90%;
    max-width: 500px;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.notice-img-container {
    width: 100%;
    height: 240px;
    background: #f8fafc;
    overflow: hidden;
}

.notice-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.notice-content {
    padding: 2rem;
    text-align: center;
}

.notice-content h3 {
    color: #1e293b;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

.notice-content p {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.notice-close-btn {
    background: #1e293b;
    color: #fff;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.notice-close-btn:hover {
    background: #000;
    transform: translateY(-2px);
}

/* Temporizador visual */
.timer-container {
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    position: absolute;
    bottom: 0;
}

.timer-bar {
    height: 100%;
    background: var(--accent);
    width: 100%;
    transform-origin: left;
}

@keyframes timerProgress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

.timer-bar.running {
    animation: timerProgress 10s linear forwards;
}

@media (max-width: 480px) {
    .notice-modal { width: 95%; border-radius: 16px; }
    .notice-content { padding: 1.5rem; }
    .notice-img-container { height: 180px; }
}

