@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-dark-outer: #040d1a;
    --bg-card-main: #0a192f;
    --bg-sidebar-dark: #002353;
    --bg-sidebar-accent: #003882;
    --yellow-primary: #ffcc00;
    --yellow-hover: #e6b800;
    --yellow-glow: rgba(255, 204, 0, 0.25);
    --border-card: #1e3a66;
    --border-accent: #ffcc00;
    --text-white: #ffffff;
    --text-sub: #8892b0;
    --text-dark: #0a192f;
    --danger-color: #ff5555;
    --success-color: #00e676;
}

body {
    background-color: var(--bg-dark-outer);
    color: var(--text-white);
    font-family: 'Inter', -apple-system, sans-serif;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 20px;
}

/* MARCO CONTENEDOR CON GLOW (Inspirado en la Imagen 1) */
.glow-wrapper {
    width: 100%;
    max-width: 1200px;
    height: 90vh;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(135deg, var(--yellow-primary) 0%, var(--bg-sidebar-accent) 50%, #00122e 100%);
    box-shadow: 0 0 30px var(--yellow-glow), 0 20px 50px rgba(0, 0, 0, 0.7);
}

.app-container {
    display: flex;
    width: 100%;
    height: 100%;
    background-color: var(--bg-card-main);
    border-radius: 18px;
    overflow: hidden;
    position: relative;
}

/* SIDEBAR CON DIBUJO DIAGONAL (Inspirado en la Imagen 1) */
.sidebar {
    width: 360px;
    background-color: var(--bg-sidebar-dark);
    position: relative;
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 2;
    overflow: hidden;
}

/* Fondo cortado diagonalmente */
.sidebar-diagonal-bg {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(160deg, var(--bg-sidebar-accent) 0%, var(--bg-sidebar-dark) 100%);
    clip-path: polygon(0 0, 100% 0, 80% 100%, 0% 100%);
    z-index: -1;
}

.btn-salir {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 16px;
    color: var(--text-white);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 1px;
    background: rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.btn-salir:hover {
    background: var(--yellow-primary);
    color: var(--text-dark);
    border-color: var(--yellow-primary);
}

.sidebar-welcome {
    margin: 20px 0;
}

.sidebar-welcome h1 {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.sidebar-welcome .highlight {
    color: var(--yellow-primary);
}

.sidebar-welcome p {
    font-size: 0.85rem;
    color: var(--text-sub);
    margin-top: 10px;
    line-height: 1.4;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar-action {
    display: none;
    width: 100%;
}

.sidebar-action.active {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* BOTONES ESTILO AMARILLO (Imagen 2) */
.box-button {
    background: var(--yellow-primary);
    border: none;
    border-radius: 12px;
    width: 100%;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 8px 20px rgba(255, 204, 0, 0.2);
}

.box-button:hover {
    background-color: var(--yellow-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(255, 204, 0, 0.35);
}

.icon-doc {
    color: var(--text-dark);
    margin-bottom: 8px;
}

.box-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: 0.5px;
}

.box-subtitle {
    font-size: 0.75rem;
    color: rgba(10, 25, 47, 0.8);
    font-weight: 600;
}

.drive-btn {
    background: #ffffff;
}

.drive-btn .box-title, .drive-btn span {
    color: var(--text-dark);
    font-weight: 800;
}

.drive-btn:hover {
    background: #f0f0f0;
}

.icon-drive {
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
}

.circle-loader {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--yellow-primary);
    animation: spin 0.8s infinite linear;
    margin-bottom: 12px;
}

.status-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--yellow-primary);
    letter-spacing: 1px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* SECCIÓN PRINCIPAL DERECHA */
.main-content {
    flex: 1;
    padding: 36px 40px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: radial-gradient(circle at top right, #0f2b54 0%, var(--bg-card-main) 60%);
}

.view-state {
    display: none;
    height: 100%;
    width: 100%;
}

.view-state.active {
    display: flex;
    flex-direction: column;
}

/* Tarjeta vacía inicial */
#view-initial {
    justify-content: center;
    align-items: center;
}

.empty-card {
    border: 1px solid var(--border-card);
    background: rgba(10, 25, 47, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 40px 32px;
    text-align: center;
    max-width: 440px;
}

.empty-icon {
    width: 64px;
    height: 64px;
    background: rgba(255, 204, 0, 0.1);
    color: var(--yellow-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
}

.empty-card h2 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--yellow-primary);
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.empty-card p {
    font-size: 0.875rem;
    color: var(--text-sub);
    line-height: 1.5;
}

/* Estado de Carga */
#view-loading {
    justify-content: center;
    align-items: center;
}

.loading-card {
    text-align: center;
}

.dots-loader {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.dots-loader span {
    width: 12px;
    height: 12px;
    background-color: var(--yellow-primary);
    border-radius: 50%;
    animation: bounce 1.2s infinite ease-in-out;
}

.dots-loader span:nth-child(2) { animation-delay: 0.2s; }
.dots-loader span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0.4); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}

.loading-card h2 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-white);
    letter-spacing: 1px;
}

.loading-card p {
    font-size: 0.85rem;
    color: var(--text-sub);
    margin-top: 4px;
}

/* Tabla de Resultados */
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.results-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-white);
    letter-spacing: 0.5px;
}

.badge-count {
    background-color: var(--yellow-primary);
    color: var(--text-dark);
    font-size: 0.75rem;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: 20px;
}

.table-container {
    background: rgba(4, 13, 26, 0.5);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    flex: 1;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    position: sticky;
    top: 0;
    background-color: var(--bg-sidebar-dark);
    color: var(--yellow-primary);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-card);
    z-index: 5;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(30, 58, 102, 0.5);
    font-size: 0.85rem;
    color: #e6f1ff;
}

tbody tr:hover {
    background-color: rgba(255, 204, 0, 0.03);
}

.text-right { text-align: right; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.fw-bold { font-weight: 700; }
.text-yellow { color: var(--yellow-primary); }
.text-danger { color: var(--danger-color); }
.text-success { color: var(--success-color); }
.text-muted { color: rgba(255, 255, 255, 0.3); }
.cell-concept { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bank-tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.bank-bbva { background: #004481; color: #ffffff; }
.bank-bajio { background: #d97706; color: #ffffff; }