:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #16a085;
    --light-bg: #f8f9fa;
    --dark-bg: #343a40;

    /* Atlas Theme Tokens */
    --atlas-bg-start: #e0eafc;
    --atlas-bg-end: #cfdef3;
    --atlas-card-bg: rgba(255,255,255,.85);
    --atlas-card-solid: #fff;
    --atlas-card-border: rgba(0,0,0,.08);
    --atlas-card-radius: 1rem;
    --atlas-card-radius-lg: 16px;
    --atlas-card-radius-xl: 20px;
    --atlas-card-shadow: 0 2px 12px rgba(0,0,0,.06);
    --atlas-card-shadow-lg: 0 25px 60px rgba(0,0,0,.3);
    --atlas-input-bg: #fff;
    --atlas-input-border: #d1d5db;
    --atlas-input-border-auth: #e2e8f0;
    --atlas-text-dark: #1e293b;
    --atlas-text-body: #334155;
    --atlas-text-secondary: #475569;
    --atlas-text-muted: #64748b;
    --atlas-text-subtle: #94a3b8;
    --atlas-accent: #2563eb;
    --atlas-accent-dark: #1d4ed8;
    --atlas-accent-purple: #7c3aed;
    --atlas-hero-start: #1e3a5f;
    --atlas-hero-end: #2563eb;
    --atlas-divider: #e5e7eb;
    --atlas-divider-light: #e9ecef;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f4f8;
}

/* ===== Atlas Theme Classes ===== */

/* Page backgrounds */
.atlas-page-bg {
    background: linear-gradient(135deg, var(--atlas-bg-start), var(--atlas-bg-end));
    min-height: 100vh;
    color: var(--atlas-text-dark);
}

.atlas-auth-bg {
    background: linear-gradient(135deg, var(--atlas-bg-start), var(--atlas-bg-end));
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* Glass card  */
.atlas-glass-card {
    background: var(--atlas-card-bg);
    border: 1px solid var(--atlas-card-border);
    border-radius: var(--atlas-card-radius);
    backdrop-filter: blur(12px);
}

/* Auth card (login/register) */
.atlas-auth-card {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    color: #222;
    border-radius: var(--atlas-card-radius-xl);
    box-shadow: var(--atlas-card-shadow-lg), 0 0 0 1px rgba(255,255,255,0.05);
    padding: 2.5rem 2rem 2rem;
    max-width: 420px;
    width: 100%;
}

.atlas-auth-card--wide { max-width: 460px; }

/* Solid white card */
.atlas-solid-card {
    background: var(--atlas-card-solid);
    border: 1px solid var(--atlas-divider);
    border-radius: var(--atlas-card-radius-lg);
    box-shadow: var(--atlas-card-shadow);
}

/* Hero banner (plans, etc.) */
.atlas-hero {
    background: linear-gradient(135deg, var(--atlas-hero-start), var(--atlas-hero-end));
    color: #fff;
    position: relative;
    overflow: hidden;
}

/* Form elements in glass/audit context */
.atlas-form-input {
    background: var(--atlas-input-bg) !important;
    border: 1px solid var(--atlas-input-border) !important;
    color: var(--atlas-text-dark) !important;
}

.atlas-form-input:focus {
    background: var(--atlas-input-bg) !important;
    border-color: var(--atlas-accent) !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12) !important;
    color: var(--atlas-text-dark) !important;
}

.atlas-form-floating .form-control {
    border-radius: 10px;
    border: 1.5px solid var(--atlas-input-border-auth);
    font-size: 0.95rem;
}

/* Text utility classes */
.atlas-text-dark    { color: var(--atlas-text-dark) !important; }
.atlas-text-body    { color: var(--atlas-text-body) !important; }
.atlas-text-secondary { color: var(--atlas-text-secondary) !important; }
.atlas-text-muted   { color: var(--atlas-text-muted) !important; }
.atlas-text-subtle  { color: var(--atlas-text-subtle) !important; }

/* Labels */
.atlas-label {
    color: var(--atlas-text-muted);
    font-size: 0.875rem;
}

/* Divider */
.atlas-divider {
    border-color: var(--atlas-divider);
}

.atlas-border-top {
    border-top: 1px solid var(--atlas-divider-light);
}

/* Primary gradient (buttons, icon boxes) */
.atlas-gradient-primary {
    background: linear-gradient(135deg, var(--atlas-accent), var(--atlas-accent-purple));
}

.atlas-gradient-blue {
    background: linear-gradient(135deg, var(--atlas-accent), var(--atlas-accent-dark));
}

/* Icon box (login/register logo) */
.atlas-icon-box {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--atlas-accent), var(--atlas-accent-purple));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    box-shadow: 0 8px 24px rgba(37,99,235,0.3);
}

.atlas-icon-box i { font-size: 1.8rem; color: #fff; }

/* Auth submit button */
.atlas-btn-auth {
    width: 100%;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--atlas-accent), var(--atlas-accent-purple));
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 0.8rem;
    font-size: 1rem;
    box-shadow: 0 4px 16px rgba(37,99,235,0.25);
    transition: box-shadow .2s, transform .2s;
}

.atlas-btn-auth:hover {
    box-shadow: 0 6px 20px rgba(37,99,235,0.35);
    color: #fff;
    transform: translateY(-1px);
}

/* Light table (audit, admin) */
.atlas-table { color: var(--atlas-text-body); }
.atlas-table thead th {
    background: #f8fafc;
    color: var(--atlas-text-muted);
    border-color: var(--atlas-divider);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.atlas-table tbody tr { border-color: var(--atlas-divider); }
.atlas-table tbody tr:hover { background: rgba(0,0,0,.02); }
.atlas-table td { border-color: var(--atlas-divider); }

/* Light pagination */
.atlas-pagination .page-link {
    background: var(--atlas-card-solid);
    border: 1px solid var(--atlas-input-border);
    color: var(--atlas-text-muted);
}
.atlas-pagination .page-link:hover {
    background: #f1f5f9;
    color: var(--atlas-text-dark);
    border-color: rgba(37,99,235,.3);
}
.atlas-pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--atlas-accent), var(--atlas-accent-dark));
    border-color: var(--atlas-accent);
    color: #fff;
}
.atlas-pagination .page-item.disabled .page-link {
    background: #f8fafc;
    color: var(--atlas-text-subtle);
    border-color: var(--atlas-divider);
}

/* Hero decorative circles */
.atlas-hero-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}
.atlas-hero-circle--tr { top: -60px; right: -60px; width: 200px; height: 200px; }
.atlas-hero-circle--bl { bottom: -40px; left: -40px; width: 150px; height: 150px; background: rgba(255,255,255,0.06); }

/* Hero pill badge */
.atlas-hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50px;
    padding: 0.35rem 1rem;
    font-size: 0.85rem;
    color: #fff;
}

/* Plans alert (rounded) */
.atlas-alert {
    border: 0;
    border-radius: 12px;
}

/* Plans quota card */
.atlas-quota-card {
    background: var(--atlas-card-solid);
    border-radius: 14px;
    box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}

/* Plans tab switcher */
.atlas-tab-switcher {
    background: var(--atlas-card-solid);
    border-radius: 12px;
    padding: 4px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    display: inline-flex;
    gap: 4px;
    border: 1px solid var(--atlas-divider);
}

.atlas-tab-switcher button {
    border: none;
    border-radius: 10px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    color: var(--atlas-text-muted);
}

/* Plans card base (legacy, kept for compat) */
.atlas-plan-card {
    background: var(--atlas-card-solid);
    border-radius: var(--atlas-card-radius-lg);
    border: 1px solid var(--atlas-divider);
    box-shadow: 0 1px 8px rgba(0,0,0,0.06);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.atlas-plan-card:hover { transform: translateY(-4px); }

.atlas-plan-card--best {
    border-width: 2px;
}

/* Plans CTA button base */
.atlas-btn-plan {
    border-radius: 10px;
    padding: 0.7rem;
    font-size: 0.95rem;
    font-weight: 700;
    transition: opacity 0.2s;
}

/* --- Plans table layout --- */
.atlas-plans-table-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.atlas-plans-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.atlas-plans-table-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.atlas-plans-table-badge {
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    white-space: nowrap;
}

.atlas-plans-table-badge--blue {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.atlas-plans-table-badge--teal {
    background: #f0fdfa;
    color: #0d9488;
    border: 1px solid #99f6e4;
}

.atlas-plans-table-accent {
    height: 3px;
}

.atlas-plans-table-accent--blue {
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
}

.atlas-plans-table-accent--teal {
    background: linear-gradient(90deg, #14b8a6, #06b6d4);
}

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

.atlas-plans-table thead th {
    padding: 0.65rem 1.25rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
    white-space: nowrap;
}

.atlas-plans-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}

.atlas-plans-table tbody tr:last-child {
    border-bottom: none;
}

.atlas-plans-table tbody tr:hover {
    background: #f8fafc;
}

.atlas-plans-table tbody td {
    padding: 0.85rem 1.25rem;
    vertical-align: middle;
}

.atlas-plans-table-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.9rem;
}

.atlas-plans-table-qty {
    font-weight: 700;
    color: #1e293b;
    font-size: 1.05rem;
    display: block;
}

.atlas-plans-table-unit {
    font-size: 0.75rem;
    color: #94a3b8;
    display: block;
}

.atlas-plans-table-price {
    font-weight: 700;
    color: #0d9488;
    font-size: 1.1rem;
}

.atlas-plans-table-iva {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-left: 0.25rem;
}

.atlas-plans-table-perunit {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.15rem;
}

.atlas-plans-table-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.45rem 1rem;
    border-radius: 8px;
    border: 1.5px solid #0d9488;
    background: #fff;
    color: #0d9488;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.atlas-plans-table-btn:hover {
    background: #0d9488;
    color: #fff;
}

.atlas-plans-table-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 991.98px) {
    .atlas-plans-table-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Trust bar */
.atlas-trust-bar {
    color: var(--atlas-text-muted);
    font-size: 0.85rem;
}

/* WhatsApp floating action button */
.atlas-whatsapp-fab {
    position: fixed;
    bottom: 5.5rem;
    right: 1.5rem;
    z-index: 9000;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #25d366;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.45);
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.atlas-whatsapp-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.55);
    color: #fff;
}

.atlas-whatsapp-fab:active {
    transform: scale(0.95);
}

@media print {
    .atlas-whatsapp-fab { display: none !important; }
}

/* Toast (fixed top-right) */
.atlas-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    animation: fadeIn 0.3s ease;
}
.atlas-toast--success { background: #ecfdf5; border: 1px solid #a7f3d0; }

/* Admin card wrapper */
.atlas-admin-card {
    border: 0;
    border-radius: var(--atlas-card-radius-lg);
    overflow: hidden;
    box-shadow: var(--atlas-card-shadow);
}

/* Upload drop zone (facial) */
.atlas-dropzone {
    border: 2px dashed #8f94fb;
    border-radius: 1rem;
    padding: 3rem;
    background: #f4f6fb;
    max-width: 500px;
}
.atlas-dropzone i { font-size: 3rem; color: #8f94fb; }

/* Loading overlay (light) */
.atlas-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(2px);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Footer */
.atlas-footer {
    font-size: 0.75rem;
    color: var(--atlas-text-muted);
    border-top: 1px solid var(--atlas-divider);
}
.atlas-footer a {
    color: var(--atlas-text-muted);
    text-decoration: none;
}
.atlas-footer a:hover { color: var(--atlas-accent); }

/* Navbar */
.navbar-brand {
    font-weight: 600;
    font-size: 1.3rem;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(203,213,225,.8);
    transition: color 0.3s ease;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
    color: #fff;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 4rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.hero-section h1 {
    font-weight: 700;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Stat Cards */
.stat-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.stat-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.card-title {
    color: var(--primary-color);
    font-weight: 600;
}

/* Forms */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 0.6rem 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: var(--light-bg);
    color: var(--primary-color);
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.table-hover tbody tr:hover {
    background-color: #f1f3f5;
    cursor: pointer;
}

/* Badges */
.badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
}

/* Loading States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Alert Styles */
.alert {
    border-radius: 8px;
    border: none;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-icon {
        font-size: 2rem;
    }
}

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

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* Input Group */
.input-group-lg > .form-control {
    border-radius: 8px 0 0 8px;
}

.input-group-lg > .btn {
    border-radius: 0 8px 8px 0;
}

/* Modal */
.modal-content {
    border-radius: 12px;
    border: none;
}

.modal-header {
    background-color: var(--light-bg);
    border-bottom: 2px solid #dee2e6;
    border-radius: 12px 12px 0 0;
}

/* Pagination */
.pagination .page-link {
    color: var(--secondary-color);
    border-radius: 8px;
    margin: 0 0.2rem;
    border: 1px solid #dee2e6;
}

.pagination .page-link:hover {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

/* Facial Recognition Panel */
.facial-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 500px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0,0,0,0.2);
    z-index: 1050;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.facial-panel.show {
    right: 0;
}

.facial-panel-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.facial-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.facial-panel-header h4 {
    margin: 0;
    font-weight: 600;
}

.facial-panel-header .btn-close {
    filter: invert(1);
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.facial-panel-header .btn-close:hover {
    opacity: 1;
}

.facial-panel-body {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Dropzone Customization */
.dropzone {
    border: 3px dashed #dee2e6;
    border-radius: 12px;
    background: #f8f9fa;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropzone:hover {
    border-color: var(--secondary-color);
    background: #e8f4f8;
}

.dropzone.dz-drag-hover {
    border-color: var(--success-color);
    background: #e8f8f0;
    transform: scale(1.02);
}

.dropzone .dz-message {
    margin: 0;
}

.dropzone .dz-preview {
    margin: 1rem;
}

.dropzone .dz-preview .dz-image {
    border-radius: 12px;
    overflow: hidden;
    width: 200px;
    height: 200px;
    display: block;
    margin: 0 auto;
}

.dropzone .dz-preview .dz-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dropzone .dz-preview .dz-details {
    padding: 1rem;
}

.dropzone .dz-preview .dz-remove {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--danger-color);
    color: white;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dropzone .dz-preview .dz-remove:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.dropzone .dz-preview.dz-processing .dz-progress {
    display: block;
}

.dropzone .dz-progress {
    height: 4px;
    background: #dee2e6;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.dropzone .dz-progress .dz-upload {
    height: 100%;
    background: var(--success-color);
    transition: width 0.3s ease;
}

/* Facial Results */
.facial-match-item {
    transition: all 0.3s ease;
}

.facial-match-item:hover {
    background: #f8f9fa;
    transform: translateX(5px);
}

/* Hover Card Effect */
.hover-card {
    transition: all 0.3s ease;
}

.hover-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* Responsive Facial Panel */
@media (max-width: 768px) {
    .facial-panel {
        width: 100%;
        right: -100%;
    }
}

