/* =============================================
   SIRE Automático — Estilos Premium Redesign
   ============================================= */

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

:root {
    /* --- World-Class "Clean & Crisp" Light Mode --- */
    --bg-base: #f9fafb;
    --surface: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --bg-glass: rgba(255, 255, 255, 0.4);

    /* Branding (Teal/Cyan from Logo) */
    --accent: #00a294;
    --accent-light: #071513;
    --accent-glow: rgba(0, 162, 148, 0.08);
    --accent-soft: rgba(0, 162, 148, 0.04);

    /* Neutral / Borders */
    --border: rgba(0, 0, 0, 0.05);
    --border-light: rgba(0, 0, 0, 0.02);
    --glass-edge: rgba(255, 255, 255, 0.8);

    /* Typography */
    --text-primary: #0f172a;
    /* Slate 900 */
    --text-secondary: #475569;
    /* Slate 600 */
    --text-muted: #94a3b8;
    /* Slate 400 */

    /* Functional */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    /* Geometry */
    --radius: 12px;
    --radius-lg: 18px;
    --radius-xl: 28px;

    /* World-Class Layered Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --shadow-xl:
        0 20px 25px -5px rgba(0, 0, 0, 0.05),
        0 10px 10px -5px rgba(0, 0, 0, 0.02),
        0 0 0 1px rgba(0, 0, 0, 0.02);
    /* Thin hairline stroke */

    --transition: cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
    --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-base) url('/app/dashboard_bg.png') no-repeat center center fixed;
    background-size: cover;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* =============================================
   NAVBAR
   ============================================= */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 72px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.navbar-brand {
    display: flex;
    align-items: center;
}

.nav-logo-img {
    height: 38px;
    width: auto;
}

.brand-accent {
    background: linear-gradient(to right, var(--accent), var(--accent-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 99px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.status-badge.online {
    color: #065f46;
    border-color: #d1fae5;
    background: #ecfdf5;
}

.status-badge.offline {
    color: #991b1b;
    border-color: #fee2e2;
    background: #fef2f2;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.3);
        opacity: 0.5;
    }
}

/* =============================================
   BOTONES
   ============================================= */
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 162, 148, 0.25);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 162, 148, 0.35);
    filter: brightness(1.1);
}

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

.btn-secondary {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

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

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-glass);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: grid;
    place-items: center;
}

.btn-icon:hover {
    background: #f1f5f9;
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #f1f5f9;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    line-height: 1;
}

.btn-close:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #991b1b;
    transform: rotate(90deg);
}

/* =============================================
   MAIN CONTAINER
   ============================================= */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem 4rem;
    flex: 1;
}

.main-footer {
    margin-top: auto;
    padding: 1.5rem 2rem;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    border-top: 1px solid var(--border-light);
    background: var(--surface);
}

/* --- Page header --- */
.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 3rem;
    gap: 2rem;
    flex-wrap: wrap;
}

.page-title {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    color: var(--text-primary);
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 4px;
    font-weight: 500;
}

.stats-bar {
    display: flex;
    gap: 16px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 32px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    min-width: 160px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-md);
}

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

.stat-num {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

/* =============================================
   TABLA CARD
   ============================================= */
.table-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: visible; /* NO usar hidden: recorta los dropdowns de acciones */
    margin-top: 1.5rem;
}

/* Preservar las esquinas redondeadas del toolbar superior */
.table-toolbar {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
}

.table-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-base);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-light);
    background: var(--surface);
}

.search-input {
    width: 100%;
    padding: 12px 20px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    outline: none;
}

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

.table-wrapper {
    overflow-x: visible;
}

@media (max-width: 1024px) {
    .table-wrapper {
        overflow-x: auto;
    }
}

.empresas-table {
    width: 100%;
    border-collapse: collapse;
}

.empresas-table thead th {
    padding: 18px 32px;
    /* Increased padding */
    text-align: left;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--border);
}

.empresas-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

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

/* Zebra striping suave para todas las tablas */
.empresas-table tbody tr:nth-child(even) {
    background-color: var(--accent-soft);
}
.empresas-table tbody tr:nth-child(odd) {
    background-color: transparent;
}

.empresas-table td {
    padding: 22px 32px;
    /* Increased padding */
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.empresas-table td.ruc-cell {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-weight: 600;
    color: var(--accent-light);
}

.badge-activo,
.badge-inactivo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.status-dot-mini {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge-activo {
    background: #ecfdf5;
    color: #065f46;
    border-color: #d1fae5;
}

.badge-activo .status-dot-mini {
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
}

.badge-inactivo {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

.badge-inactivo .status-dot-mini {
    background: #94a3b8;
}

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(2, 6, 23, 0.7);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.modal,
.modal-card {
    width: 100%;
    max-width: 640px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(20px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.visible .modal,
.modal-overlay.visible .modal-card {
    transform: scale(1) translateY(0);
}

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

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.modal-icon {
    width: 48px;
    height: 48px;
    background: #f1f5f9;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 20px;
    border: 1px solid var(--border-light);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.modal-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.modal-body {
    padding: 32px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Form Elements */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.form-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    outline: none;
}

.form-input:focus {
    background: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.form-input.mono {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.85rem;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.form-separator {
    grid-column: span 2;
    position: relative;
    padding: 10px 0;
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.form-separator span {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    white-space: nowrap;
}

.form-separator::after {
    content: "";
    height: 1.5px;
    flex: 1;
    background: var(--border-light);
}

.input-password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.btn-eye {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text-muted);
    padding: 4px;
    transition: color 0.2s ease;
}

.btn-eye:hover {
    color: var(--text-secondary);
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.toggle-switch {
    width: 44px;
    height: 24px;
    background: #e2e8f0;
    border-radius: 99px;
    position: relative;
    transition: all 0.3s ease;
}

.toggle-switch::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 4px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

input[type="checkbox"]:checked + .toggle-switch {
    background: var(--accent);
}

input[type="checkbox"]:checked + .toggle-switch::after {
    left: 24px;
}

input[type="checkbox"] {
    display: none;
}

.modal-footer {
    grid-column: span 2;
    padding: 24px 32px;
    background: #f8fafc;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin: 0 -32px -32px;
}

.form-alert {
    grid-column: span 2;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    display: none;
}

.form-alert.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fee2e2;
}

.form-alert.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #d1fae5;
}

/* =============================================
   LOADERS
   ============================================= */
.btn-loader,
.loader-inline {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(0, 162, 148, 0.1);
    border-top-color: var(--accent);
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

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

/* =============================================
   TOAST
   ============================================= */
.toast {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 1000;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    background: #ffffff;
    box-shadow: var(--shadow-xl);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    color: #065f46;
    border-left-color: var(--success);
}

.toast.error {
    color: #991b1b;
    border-left-color: var(--danger);
}

/* --- Animación de entrada para filas --- */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.empresas-table tbody tr {
    animation: slideUp 0.4s ease forwards;
}


/* =============================================
   ELEMENTOS DECORATIVOS (ELIMINADOS)
   ============================================= */
/* Blobs eliminados por feedback del usuario */

/* =============================================
   LOGIN SCREEN (MINIMAL PREMIUM)
   ============================================= */
.view-login {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    pointer-events: none;
    background: #ffffff;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.view-login.active {
    display: flex;
    pointer-events: all;
    opacity: 1;
}

.login-split-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Lado Visual (Izquierda) */
.login-visual {
    flex: 1.2;
    position: relative;
    background: url('/app/login_bg.png') no-repeat center center;
    background-size: cover;
    display: flex;
    align-items: flex-end;
    padding: 5rem;
    overflow: hidden;
}

.visual-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.4) 60%, rgba(15, 23, 42, 0.2) 100%);
}

.visual-content {
    position: relative;
    z-index: 2;
    color: white;
    max-width: 540px;
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.visual-logo {
    height: 48px;
    margin-bottom: 2rem;
    filter: brightness(0) invert(1);
}

.visual-title {
    font-size: 3.5rem;
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -0.05em;
    margin-bottom: 1.5rem;
}

.visual-title span {
    color: var(--accent-light);
}

.visual-text {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    font-weight: 500;
}

/* Lado del Formulario (Derecha) */
.login-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 4rem;
    box-shadow: -20px 0 50px rgba(0, 0, 0, 0.05);
    z-index: 5;
}

.login-card-clean {
    width: 100%;
    max-width: 420px;
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s backwards;
}

.login-header-mini {
    margin-bottom: 3rem;
}

.login-logo-mini {
    height: 40px;
    margin-bottom: 2.5rem;
    display: none;
}

@media (max-width: 1100px) {
    .login-visual {
        display: none;
    }

    .login-form-side {
        flex: 1;
        background: var(--bg-base);
    }

    .login-card-clean {
        background: white;
        padding: 3rem;
        border-radius: var(--radius-xl);
        box-shadow: var(--shadow-xl);
    }

    .login-logo-mini {
        display: block;
    }
}

.login-title-clean {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.05em;
    margin-bottom: 0.75rem;
}

.login-subtitle-clean {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 500;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.login-input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-left: 4px;
}

.input-wrapper {
    position: relative;
}

.login-input-banking {
    width: 100%;
    padding: 16px 16px 16px 48px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 1.05rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-input-banking:focus {
    background: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
    outline: none;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.login-input-banking:focus+.input-icon {
    color: var(--accent);
}

.btn-banking {
    margin-top: 1.5rem;
    padding: 18px;
    border-radius: 14px;
    background: var(--text-primary);
    border: none;
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn-banking:hover {
    background: #1e293b;
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

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

.login-footer-clean {
    margin-top: 4rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.login-footer-clean a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
}

.login-header-mini {
    margin-bottom: 2.5rem;
}

.login-logo-mini {
    height: 32px;
    margin-bottom: 2rem;
    display: none;
    /* Opcional: El logo ya está a la izquierda, pero lo dejamos si el usuario prefiere */
}

@media (max-width: 1024px) {
    .login-logo-mini {
        display: block;
    }
}

.login-title-clean {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.04em;
    margin-bottom: 0.5rem;
}

.login-subtitle-clean {
    color: var(--text-secondary);
    font-size: 1rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-input-group {
    position: relative;
}

.login-input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: white;
    font-family: var(--font);
    font-size: 1rem;
    transition: var(--transition);
}

.login-input:focus {
    border-color: var(--accent);
    background: var(--bg-glass-heavy);
    box-shadow: 0 0 0 4px var(--accent-glow);
    outline: none;
}

.login-input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.btn-login {
    margin-top: 10px;
    padding: 14px;
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    border: none;
    border-radius: 14px;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 8px 20px -4px var(--accent-glow);
}

.btn-login:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 12px 28px -6px var(--accent-glow);
}

.login-footer {
    text-align: center;
    margin-top: 32px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* =============================================
   LOGIN SCREEN
   ============================================= */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

/* Elementos decorativos de fondo para Login */
.login-bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
}

.login-card {
    background: rgba(15, 22, 40, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 420px;
    z-index: 10;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

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

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-icon-wrap {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.2rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 28px;
    box-shadow: 0 8px 32px var(--accent-glow);
    animation: pulseIcon 3s infinite ease-in-out;
}

@keyframes pulseIcon {

    0%,
    100% {
        box-shadow: 0 8px 32px var(--accent-glow);
    }

    50% {
        box-shadow: 0 12px 48px rgba(59, 130, 246, 0.4);
    }
}

.login-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    letter-spacing: -0.04em;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.login-input-group {
    position: relative;
}

.login-input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.login-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.login-input-banking:focus+.input-icon {
    color: var(--accent);
}

.btn-banking {
    margin-top: 1rem;
    padding: 16px;
    border-radius: 12px;
    background: var(--text-primary);
    /* Dark professional button */
    border: none;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn-banking:hover {
    background: #1e293b;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-banking span {
    letter-spacing: 0.02em;
}

.login-footer-clean {
    margin-top: 3rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.login-footer-clean a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.login-input:focus+.login-input-icon {
    color: var(--accent);
}

.btn-login {
    margin-top: 1rem;
    padding: 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border: none;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 16px -4px var(--accent-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -6px var(--accent-glow);
    filter: brightness(1.1);
}

.btn-login:active {
    transform: translateY(1px);
}

/* Control de vistas (App vs Login) */
.view-app {
    display: none;
}

.view-app.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* =============================================
   DROPDOWN MENUS (ACCIONES)
   ============================================= */
.dropdown {
    position: relative;
    display: inline-block;
}

/* El menú ahora es un portal global fuera de la tabla */
.dropdown-content-portal {
    display: none;
    position: fixed;
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
    border-radius: 12px;
    z-index: 2000; /* Prioridad máxima por encima de TODO */
    padding: 8px 0;
    animation: fadeIn 0.15s ease;
}

.dropdown-content-portal.active {
    display: block;
}
.dropdown-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: 6px;
    transition: var(--transition);
}

.dropdown-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-content-portal .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.dropdown-content-portal .dropdown-item:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.dropdown-content-portal .dropdown-item.accent {
    color: var(--accent);
}

/* --- SPINNER DE CARGA --- */
.spinner-loader {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin-loader 0.8s linear infinite;
    display: inline-block;
}

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

.modal-content-processing {
    text-align: center;
    padding: 2.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.modal-content-processing h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.modal-content-processing p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.pulse-animation {
    animation: pulse-op 2s ease-in-out infinite;
}

@keyframes pulse-op {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}


.dropdown-content-portal .dropdown-item.accent:hover {
    background: #f0fdfa;
}