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

:root {
    --app-bg: #f4f7fb;
    --app-bg-strong: #e9eef9;
    --surface: rgba(255, 255, 255, 0.92);
    --surface-strong: #ffffff;
    --surface-soft: #f8fbff;
    --border: rgba(148, 163, 184, 0.18);
    --border-strong: rgba(37, 99, 235, 0.18);
    --text: #0f172a;
    --muted: #64748b;
    --primary: #1d4ed8;
    --primary-strong: #0f3fbb;
    --primary-soft: #eff6ff;
    --secondary: #0f172a;
    --success: #0f9d71;
    --warning: #d97706;
    --danger: #dc2626;
    --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.12);
    --shadow-md: 0 16px 32px rgba(15, 23, 42, 0.08);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 35%),
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.09), transparent 28%),
        linear-gradient(180deg, #f8fbff 0%, var(--app-bg) 55%, #edf2fb 100%);
    position: relative;
    overflow-x: hidden;
}

body::before,
body::after {
    content: "";
    position: fixed;
    pointer-events: none;
    z-index: -1;
    border-radius: 999px;
    filter: blur(10px);
    opacity: 0.75;
}

body::before {
    width: 320px;
    height: 320px;
    top: -120px;
    right: -90px;
    background: rgba(59, 130, 246, 0.12);
}

body::after {
    width: 220px;
    height: 220px;
    left: -70px;
    bottom: 10%;
    background: rgba(16, 185, 129, 0.08);
}

body.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: hidden;
}

body.dashboard-page,
body.admin-page {
    min-height: 100vh;
    padding-bottom: 0;
}

.auth-page .login-card,
.auth-page .change-card {
    position: relative;
    width: min(100%, 860px);
    max-width: 860px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.92));
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.auth-page .login-card::before,
.auth-page .change-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 8px;
    background: linear-gradient(90deg, var(--primary), #10b981, #f59e0b);
}

.auth-page .login-card {
    padding: 36px;
    display: grid;
    gap: 18px;
    width: min(100%, 560px);
    max-width: 560px;
}

.auth-page .change-card {
    width: min(100%, 520px);
    padding: 36px;
}

.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary-strong);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-title {
    font-size: clamp(1.7rem, 2.4vw, 2.25rem);
    font-weight: 800;
    line-height: 1.1;
    color: #0f172a;
    margin: 0;
}

.auth-subtitle {
    color: var(--muted);
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.65;
}

.auth-logos {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 6px;
}

.auth-logos .logo-hover {
    max-height: 64px;
    object-fit: contain;
    transition: transform 0.35s ease, filter 0.35s ease;
}

.auth-logos .logo-hover:hover {
    transform: translateY(-3px) scale(1.05);
    filter: drop-shadow(0 16px 20px rgba(15, 23, 42, 0.15));
}

.auth-card-grid {
    display: grid;
    gap: 16px;
}

.auth-card-note {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(14, 165, 233, 0.08));
    border: 1px solid rgba(37, 99, 235, 0.14);
    color: #1e3a8a;
    font-size: 0.92rem;
    line-height: 1.5;
}

.auth-page .form-label {
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    color: #475569;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.auth-page .input-group {
    background: #f8fafc;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid #e2e8f0;
    transition: all 0.25s ease;
}

.auth-page .input-group:focus-within {
    border-color: rgba(37, 99, 235, 0.35);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.auth-page .input-group-text {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding-left: 16px;
}

.auth-page .form-control,
.auth-page .form-select {
    background: transparent;
    border: none;
    padding: 13px 16px;
    font-size: 0.96rem;
    color: var(--text);
}

.auth-page .form-control:focus,
.auth-page .form-select:focus {
    background: transparent;
    box-shadow: none;
    outline: none;
}

.btn-login,
.btn-update,
.btn-main,
.btn-pro,
.nav-btn,
.btn-header {
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

.btn-login,
.btn-update {
    border: none;
    border-radius: 14px;
    padding: 14px 18px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.btn-login {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
    box-shadow: 0 18px 32px rgba(29, 78, 216, 0.18);
}

.btn-update {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 18px 32px rgba(245, 158, 11, 0.16);
}

.btn-login:hover,
.btn-update:hover,
.btn-main:hover,
.btn-pro:hover,
.btn-header:hover,
.nav-btn:hover {
    transform: translateY(-3px);
}

.btn-login:hover {
    box-shadow: 0 22px 34px rgba(29, 78, 216, 0.22);
}

.btn-update:hover {
    box-shadow: 0 22px 34px rgba(245, 158, 11, 0.24);
}

.alert-custom,
.auth-page .alert,
.admin-page .alert,
.dashboard-page .alert {
    border: 1px solid rgba(220, 38, 38, 0.12);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.05);
}

.footer-login,
.auth-page .security-hint {
    color: var(--muted);
}

.footer-login {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.header-bg {
    color: #fff;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(29, 78, 216, 0.96)),
        linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    padding: 1.25rem 0;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.18);
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(12px);
}

.header-bg .container {
    gap: 16px;
}

.header-bg h2 {
    font-weight: 800;
    letter-spacing: -0.03em;
}

.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    font-size: 0.88rem;
}

.btn-header,
.nav-btn {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

.btn-admin {
    background: rgba(245, 158, 11, 0.92);
    color: #0f172a;
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-exit {
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
}

.btn-admin:hover,
.nav-btn:hover {
    color: #0f172a;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
}

.btn-exit:hover {
    color: #fff;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
}

.dashboard-page .container,
.admin-page .container {
    position: relative;
    z-index: 1;
}

.dashboard-hero,
.admin-hero {
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.95fr);
    align-items: stretch;
    padding: 28px;
    margin-top: 24px;
    margin-bottom: 24px;
    border-radius: var(--radius-xl);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(247, 250, 255, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.76);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
    overflow: hidden;
    position: relative;
}

.dashboard-hero::after,
.admin-hero::after {
    content: "";
    position: absolute;
    inset: auto -80px -80px auto;
    width: 220px;
    height: 220px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.16), transparent 65%);
    pointer-events: none;
}

.hero-copy {
    display: grid;
    gap: 12px;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary-strong);
    font-weight: 800;
    font-size: 0.76rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero-copy h1 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 3rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.05em;
    color: #0f172a;
}

.hero-copy p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
    max-width: 62ch;
}

.hero-stats {
    display: grid;
    gap: 12px;
    align-content: start;
}

.stat-card,
.repo-pill {
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 14px 24px rgba(15, 23, 42, 0.06);
}

.stat-card {
    padding: 16px 18px;
}

.stat-label {
    display: block;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    word-break: break-word;
}

.repo-pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.repo-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #1e3a8a;
}

.repo-pill i {
    color: var(--primary);
}

.info-panel,
.status-panel {
    border-radius: var(--radius-lg);
    border: 1px solid rgba(37, 99, 235, 0.12);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(14, 165, 233, 0.05));
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
}

.info-panel {
    padding: 14px 18px;
    color: #1e3a8a;
    font-weight: 600;
}

.card-import {
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease, background 0.35s ease;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.94));
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.card-import::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), #10b981);
    opacity: 0.8;
}

.card-import:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(37, 99, 235, 0.26);
}

.card-import.selected {
    border: 1px solid rgba(37, 99, 235, 0.45);
    background: linear-gradient(180deg, rgba(239, 246, 255, 1), rgba(255, 255, 255, 0.96));
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.08), var(--shadow-lg);
}

.icon-box {
    width: 84px;
    height: 84px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2.4rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 16px 24px rgba(15, 23, 42, 0.08);
}

.card-import:hover .icon-box {
    transform: scale(1.07) rotate(-2deg);
}

.box-atencion {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(59, 130, 246, 0.08));
    color: var(--primary);
}

.box-consumo {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(5, 150, 105, 0.08));
    color: var(--success);
}

.btn-main {
    padding: 14px 34px;
    font-weight: 800;
    border-radius: 14px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border: none;
    box-shadow: 0 18px 28px rgba(15, 23, 42, 0.1);
}

.btn-import {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: #fff;
}

.btn-consolidate {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff !important;
}

.btn-audit {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
}

.btn-main:hover {
    box-shadow: 0 22px 36px rgba(15, 23, 42, 0.14);
}

.progress {
    background: rgba(226, 232, 240, 0.88);
    overflow: hidden;
}

.progress-bar {
    border-radius: inherit;
}

.status-panel {
    padding: 18px;
}

.status-panel #statusMsg {
    margin-bottom: 0;
    color: #1e3a8a;
}

.card {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.section-title {
    position: relative;
    padding-left: 16px;
    color: #0f172a;
}

.section-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 24px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--primary), #10b981);
}

.btn-pro {
    border-radius: 14px;
    padding: 10px 18px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
}

.btn-primary-pro {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: #fff;
}

.btn-dark-pro {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
}

.btn-action {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border: none;
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
}

.btn-action:hover {
    transform: translateY(-2px) scale(1.06);
}

.btn-edit {
    background: #eff6ff;
    color: #2563eb;
}

.btn-edit:hover {
    background: #2563eb;
    color: #fff;
}

.btn-delete {
    background: #fef2f2;
    color: #dc2626;
}

.btn-delete:hover {
    background: #dc2626;
    color: #fff;
}

.table-responsive {
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.table thead {
    background: linear-gradient(90deg, #0f172a, #1d4ed8);
    color: #fff;
}

.table thead th {
    border: none;
    padding: 14px 16px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.74rem;
    letter-spacing: 0.08em;
}

.table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    vertical-align: middle;
    font-size: 0.93rem;
}

.table-hover tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

.badge {
    border-radius: 999px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.form-label {
    font-weight: 700;
    font-size: 0.82rem;
    color: #475569;
    margin-bottom: 6px;
}

.form-control,
.form-select {
    border-radius: 12px;
    border: 1px solid #dbe4f0;
    padding: 10px 12px;
    font-size: 0.95rem;
    background: #fff;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(37, 99, 235, 0.4);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.modal-content {
    border: none;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-footer {
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.footer-custom {
    width: 100%;
    position: static;
    margin-top: 40px;
    padding: 18px 0;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
    box-shadow: 0 -12px 32px rgba(15, 23, 42, 0.12);
}

.creditos {
    margin: 0;
    font-size: 0.9rem;
}

.copy {
    margin: 0;
    display: inline-block;
}

.btn-footer {
    text-decoration: none;
    color: #966900;
    font-weight: 800;
    display: inline-block;
    transition: transform 0.22s ease, color 0.22s ease, text-shadow 0.22s ease;
    transform-origin: center;
}

.btn-footer:hover {
    color: #966900;
    transform: scale(1.08);
    text-shadow: 0 6px 16px rgba(150, 105, 0, 0.22);
}

#editor-sql,
.ace_editor {
    width: 100% !important;
    min-height: 520px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.form-text {
    color: #64748b;
}

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

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

.bg-white {
    background-color: rgba(255, 255, 255, 0.92) !important;
}

.bg-dark {
    background-color: #0f172a !important;
}

@media (max-width: 991.98px) {
    .dashboard-hero,
    .admin-hero {
        grid-template-columns: 1fr;
    }

    .header-bg .container {
        flex-direction: column;
        align-items: flex-start !important;
    }
}

@media (max-width: 767.98px) {
    body.auth-page {
        padding: 16px;
    }

    .auth-page .login-card,
    .auth-page .change-card {
        padding: 24px;
        border-radius: 22px;
    }

    .auth-logos {
        gap: 12px;
    }

    .auth-logos .logo-hover {
        max-height: 48px;
    }

    .dashboard-hero,
    .admin-hero {
        padding: 20px;
    }

    .btn-main {
        width: 100%;
    }

    .header-bg .d-flex.gap-2 {
        width: 100%;
        flex-wrap: wrap;
    }

    .btn-header,
    .nav-btn {
        flex: 1 1 auto;
        justify-content: center;
    }
}
