/**
 * Main Styles - AdminG ERP
 * Clean Architecture: Separation of layout, components, and utilities
 */

/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --success: #28a745;
    --success-dark: #218838;
    --danger: #dc3545;
    --danger-dark: #c82333;
    --warning: #ffc107;
    --info: #17a2b8;
    
    /* Neutrals */
    --gray-50: #f8f9fa;
    --gray-100: #f5f7fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    
    /* Sidebar */
    --sidebar-bg: #2c3e50;
    --sidebar-hover: #34495e;
    --sidebar-active: var(--primary);
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);

    /* Surfaces */
    --surface-page: #f5f7fa;
    --surface-card: #ffffff;
    --surface-muted: #f8fafc;
    --surface-elevated: #ffffff;
    --border-soft: rgba(148, 163, 184, 0.25);
}

:root[data-theme="night"] {
    --primary: #5aa9ff;
    --primary-dark: #3b82f6;
    --secondary: #0f766e;
    --success: #22c55e;
    --success-dark: #16a34a;
    --danger: #f87171;
    --danger-dark: #ef4444;
    --warning: #fbbf24;
    --info: #38bdf8;
    --gray-50: #020617;
    --gray-100: #0f172a;
    --gray-200: #172033;
    --gray-300: #253247;
    --gray-400: #334155;
    --gray-500: #64748b;
    --gray-600: #94a3b8;
    --gray-700: #cbd5e1;
    --gray-800: #e2e8f0;
    --gray-900: #f8fafc;
    --sidebar-bg: #08111f;
    --sidebar-hover: #132033;
    --surface-page: #09111f;
    --surface-card: #111827;
    --surface-muted: #0f172a;
    --surface-elevated: #162133;
    --border-soft: rgba(148, 163, 184, 0.2);
    --shadow-sm: 0 1px 2px rgba(2,6,23,0.35);
    --shadow-md: 0 12px 28px rgba(2,6,23,0.28);
    --shadow-lg: 0 18px 50px rgba(2,6,23,0.45);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: var(--surface-page);
    color: var(--gray-900);
    line-height: 1.5;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* ========== AUTH PAGES ========== */
.auth-container {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
}

.auth-box {
    background: var(--surface-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 450px;
    padding: var(--spacing-xl);
}

.auth-title {
    text-align: center;
    font-size: 28px;
    margin-bottom: var(--spacing-sm);
    color: var(--gray-900);
}

.auth-subtitle {
    text-align: center;
    color: var(--gray-600);
    margin-bottom: var(--spacing-lg);
    font-size: 14px;
}

/* ========== DASHBOARD LAYOUT ========== */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    color: white;
    padding: var(--spacing-lg) 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    left: 0;
    top: 0;
    transition: transform 0.3s ease-in-out;
}

.sidebar-header {
    padding: 0 var(--spacing-lg) var(--spacing-lg);
    border-bottom: 1px solid var(--sidebar-hover);
}

.sidebar-header h2 {
    font-size: 24px;
    margin-bottom: var(--spacing-xs);
}

.sidebar-user {
    font-size: 12px;
    color: var(--gray-400);
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-menu {
    margin-top: var(--spacing-lg);
}

.sidebar-section {
    margin-bottom: 12px;
    border-radius: 1rem;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
}

.sidebar-section-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 12px var(--spacing-lg);
    border: none;
    background: transparent;
    color: #e5e7eb;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

.sidebar-section-header:hover {
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-section-items {
    display: grid;
    gap: 0;
}

.sidebar-section.collapsed .sidebar-section-items {
    display: none;
}

.section-icon {
    width: 20px;
    text-align: center;
    font-size: 18px;
}

.section-title {
    flex: 1;
    text-align: left;
}

.section-chevron {
    font-size: 14px;
}

.menu-item {
    padding: 12px var(--spacing-lg);
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ecf0f1;
    font-size: 14px;
}

.menu-item.submenu-item {
    padding-left: calc(var(--spacing-lg) + 22px);
    font-size: 13px;
    opacity: 0.92;
}

.menu-item:hover {
    background: var(--sidebar-hover);
}

.menu-item.active {
    background: var(--sidebar-active);
    border-left: 4px solid white;
}

.menu-item.blocked {
    opacity: 0.6;
    position: relative;
}

.menu-item.blocked:hover {
    background: rgba(255, 255, 255, 0.05);
    opacity: 0.8;
}

.menu-lock {
    font-size: 14px;
    margin-left: auto;
}

.menu-icon {
    width: 20px;
    text-align: center;
    font-size: 18px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-light {
    background: var(--gray-200);
    color: var(--gray-800);
    border: 1px solid var(--gray-300);
}

.btn-light:hover {
    background: var(--gray-300);
}

/* Hamburger Menu Toggle */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--gray-800);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    transition: transform 0.2s ease-in-out;
    z-index: 102;
    position: relative;
}

.sidebar-toggle:hover {
    transform: scale(1.1);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
}

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

.main-content {
    margin-left: 250px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sidebar-collapsed .sidebar {
    width: 70px;
}

.sidebar-collapsed .sidebar-header {
    padding: 0 var(--spacing-sm) var(--spacing-lg);
    text-align: center;
}

.sidebar-collapsed .sidebar-header h2 {
    display: none;
}

.sidebar-collapsed .main-content {
    margin-left: 70px;
}

.sidebar-collapsed .menu-label,
.sidebar-collapsed .sidebar-user,
.sidebar-collapsed .sidebar-plan {
    display: none;
}

.sidebar-collapsed .menu-item {
    justify-content: center;
    padding: 12px var(--spacing-sm);
}

.sidebar-collapsed .menu-item.submenu-item {
    padding-left: var(--spacing-sm);
}

.sidebar-collapsed .menu-lock {
    display: none;
}

.sidebar,
.main-content {
    transition: all 0.2s ease-in-out;
}

/* ========== MAIN CONTENT ========== */
.main-content {
    margin-left: 250px;
    flex: 1;
}

/* ========== TOPBAR ========== */
.topbar {
    background: var(--surface-card);
    padding: 15px 30px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 24px;
    color: var(--gray-900);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-action-group {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.header-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    background: linear-gradient(180deg, var(--surface-elevated) 0%, var(--surface-muted) 100%);
    color: var(--gray-900);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.header-icon-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(102, 126, 234, 0.45);
    box-shadow: var(--shadow-md);
}

.header-icon-btn[aria-expanded="true"] {
    border-color: rgba(102, 126, 234, 0.5);
    background: linear-gradient(180deg, rgba(102, 126, 234, 0.14) 0%, var(--surface-elevated) 100%);
}

.quick-settings-trigger {
    font-size: 17px;
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.header-dropdown {
    position: absolute;
    right: 0;
    top: 48px;
    background: var(--surface-elevated);
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    overflow: hidden;
}

.header-dropdown-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.header-dropdown-action {
    font-size: 12px;
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-weight: 600;
}

.notification-dropdown {
    width: 340px;
    max-height: 420px;
    overflow-y: auto;
}

.notif-list {
    padding: 4px 0;
}

.quick-settings-dropdown {
    width: min(340px, calc(100vw - 24px));
}

.quick-settings-subtitle {
    margin-top: 3px;
    font-size: 12px;
    color: var(--gray-600);
}

.quick-settings-list {
    display: grid;
    gap: 4px;
    padding: 8px;
}

.quick-settings-item {
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    display: grid;
    grid-template-columns: 24px 1fr auto;
    align-items: center;
    gap: 12px;
    text-align: left;
    padding: 11px 12px;
    border-radius: 14px;
    cursor: pointer;
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.quick-settings-item:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.quick-settings-item.danger:hover {
    background: rgba(239, 68, 68, 0.12);
}

.quick-settings-icon {
    font-size: 16px;
    text-align: center;
}

.quick-settings-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.quick-settings-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-900);
}

.quick-settings-hint {
    font-size: 12px;
    color: var(--gray-600);
}

.quick-settings-status {
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(102, 126, 234, 0.14);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
}

.quick-settings-section {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.quick-settings-section-header {
    width: 100%;
    border: 0;
    background: rgba(15, 23, 42, 0.04);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--gray-800);
    font-weight: 700;
    cursor: pointer;
    text-align: left;
}

.quick-settings-section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    font-size: 16px;
}

.quick-settings-section-items {
    display: grid;
    gap: 4px;
    padding: 8px 0 10px;
}

.quick-settings-section.collapsed .quick-settings-section-items {
    display: none;
}

.quick-settings-section.collapsed .quick-settings-section-header {
    background: rgba(15, 23, 42, 0.08);
}

.user-email {
    font-size: 14px;
    color: var(--gray-700);
}

.user-badge {
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.user-trial-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* ========== CONTENT AREA ========== */
.content-area {
    padding: 30px;
}

/* ========== CARDS ========== */
.card {
    background: var(--surface-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 25px;
    margin-bottom: var(--spacing-lg);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.card-title {
    font-size: 20px;
    color: var(--gray-900);
    font-weight: 600;
}

/* ========== STATS GRID ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: 30px;
}

.stat-card {
    background: var(--surface-card);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.stat-card h3 {
    color: var(--gray-600);
    font-size: 14px;
    margin-bottom: 10px;
    font-weight: 500;
}

.stat-card .value {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
}

/* ========== FORMS ========== */
.form-group {
    margin-bottom: var(--spacing-lg);
}

label {
    display: block;
    margin-bottom: var(--spacing-sm);
    color: var(--gray-900);
    font-weight: 500;
    font-size: 14px;
}

input, 
select, 
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: var(--surface-card);
    color: var(--gray-900);
    transition: border-color 0.3s, box-shadow 0.3s;
}

input:focus, 
select:focus, 
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
    padding: 8px 0;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray-700);
}

.checkbox-item input {
    width: auto;
}

/* ========== BUTTONS ========== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #5568d3 100%);
}

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

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.btn-secondary:hover:not(:disabled) {
    background: #d1d5db;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 12px;
}

.btn-xs {
    padding: 6px 12px;
    font-size: 11px;
}

.btn-full {
    width: 100%;
}

/* ========== TABLES ========== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.table-shell {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.table-search {
    width: min(100%, 360px);
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: #fff;
}

.table-count {
    font-size: 12px;
    color: var(--gray-600);
    font-weight: 600;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
}

.data-table thead {
    background: var(--gray-50);
}

.data-table th, 
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.data-table th {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 13px;
    text-transform: uppercase;
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

@media (max-width: 768px) {
    .table-toolbar {
        align-items: stretch;
    }

    .table-search {
        width: 100%;
    }

    .data-table th,
    .data-table td {
        padding: 10px 8px;
        font-size: 12px;
    }
}

.info-table {
    width: 100%;
}

.info-table th {
    text-align: left;
    padding: 12px;
    font-weight: 600;
    color: var(--gray-700);
    width: 200px;
}

.info-table td {
    padding: 12px;
}

/* ========== BADGES ========== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-primary {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary);
}

/* ========== ALERTS ========== */
.error, 
.success {
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-lg);
    font-size: 14px;
}

.error {
    background: #fee;
    color: #c33;
    border-left: 4px solid #c33;
}

.success {
    background: #efe;
    color: #3c3;
    border-left: 4px solid #3c3;
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

/* ========== UTILITIES ========== */
.hidden {
    display: none !important;
}

.link {
    text-align: center;
    margin-top: var(--spacing-lg);
    font-size: 14px;
    color: var(--gray-600);
}

.link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.link a:hover {
    text-decoration: underline;
}

code {
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 13px;
}
/* ========== ADMIN PANEL STYLES ========== */
.admin-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--gray-200);
}

.admin-header h2 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 8px;
}

.admin-subtitle {
    color: #7f8c8d;
    font-size: 14px;
}

.plan-badge {
    display: inline-block;
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 8px;
    text-transform: uppercase;
}

.sidebar-plan {
    margin-top: 12px;
}

/* Feature Grid */
.feature-item {
    padding: 12px;
    background: #f0f8ff;
    border-left: 3px solid #28a745;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 8px;
}

/* Button Sizes */
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-info {
    background: var(--info);
    color: white;
    border: none;
}

.btn-info:hover {
    background: #0e6492;
}

.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #a81f1f;
}

/* ========== RESPONSIVE DESIGN ========== */

/* Desktop y Tablets (no hacemos nada, mantiene estilo normal) */
/* El sidebar normal se ve con iconos + labels en 250px */

/* Móviles pequeños (max-width: 576px) */
@media (max-width: 576px) {
    /* Sidebar compacto por defecto: solo iconos */
    .sidebar {
        width: 80px;
        padding: var(--spacing-md) 0;
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 100;
        overflow-y: auto;
    }

    /* Drawer completo al expandir */
    .sidebar.active {
        width: 250px;
        z-index: 101;
        box-shadow: var(--shadow-lg);
    }

    .sidebar-header {
        text-align: center;
        padding: 0 var(--spacing-sm) var(--spacing-lg);
        border-bottom: 1px solid var(--sidebar-hover);
    }

    .sidebar-header h2 {
        display: none;
    }

    .sidebar.active .sidebar-header h2 {
        display: block;
        font-size: 20px;
        margin-bottom: var(--spacing-xs);
    }

    .sidebar-user,
    .sidebar-plan {
        display: none;
    }

    .sidebar.active .sidebar-user,
    .sidebar.active .sidebar-plan {
        display: block;
    }

    .menu-item {
        justify-content: center;
        padding: 12px var(--spacing-sm);
        flex-direction: column;
        gap: 4px;
    }

    .sidebar.active .menu-item {
        justify-content: flex-start;
        padding: 12px var(--spacing-lg);
        flex-direction: row;
        gap: 10px;
    }

    .sidebar.active .menu-item.submenu-item {
        padding-left: calc(var(--spacing-lg) + 26px);
    }

    .menu-label {
        display: none;
    }

    .sidebar.active .menu-label {
        display: inline;
    }

    .menu-icon {
        width: 24px;
        font-size: 20px;
    }

    .sidebar-toggle {
        display: block;
    }

    .sidebar-overlay {
        display: none;
    }

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

    .topbar {
        z-index: 50;
    }

    .main-content {
        margin-left: 80px;
        width: calc(100% - 80px);
    }

    .dashboard-layout.sidebar-expanded .main-content {
        margin-left: 0;
        width: 100%;
    }

    .dashboard-layout {
        flex-direction: row;
    }

    .stats-grid {
        grid-template-columns: repeat(1, 1fr) !important;
    }
}

/* Tablets pequeñas (max-width: 768px) */
@media (max-width: 768px) {
    .auth-box {
        padding: var(--spacing-lg);
        max-width: 100%;
    }

    .auth-title {
        font-size: 24px;
    }

    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    .card {
        padding: 16px;
    }

    .card-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .btn-full {
        width: 100%;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
    }

    .topbar {
        padding: 12px;
    }

    .user-info {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .notification-dropdown,
    .quick-settings-dropdown {
        right: -8px;
    }

    .topbar-title {
        font-size: 18px;
    }

    .sidebar-header h2 {
        font-size: 20px;
    }

    .sidebar-toggle {
        display: block;
        margin-right: 12px;
    }
}

/* Móviles (max-width: 576px) */
@media (max-width: 576px) {
    .auth-container {
        padding: var(--spacing-md);
    }

    .auth-box {
        padding: var(--spacing-md);
    }

    .auth-title {
        font-size: 20px;
    }

    .btn {
        padding: 10px 14px;
        font-size: 13px;
    }

    .card-title {
        font-size: 18px;
    }

    .sidebar-header h2 {
        font-size: 18px;
    }

    .menu-item {
        padding: 10px var(--spacing-md);
        font-size: 13px;
    }

    .form-group label {
        font-size: 13px;
    }

    input, select, textarea {
        font-size: 14px;
    }

    .modal-content {
        padding: 16px;
        width: 95%;
    }

    .modal-title {
        font-size: 18px;
    }

    .topbar {
        gap: 4px;
    }

    .user-email,
    .user-badge {
        display: none;
    }

    .notification-dropdown,
    .quick-settings-dropdown {
        position: fixed;
        top: 72px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
    }
}

:root[data-theme="night"] .modal-content,
:root[data-theme="night"] .topbar,
:root[data-theme="night"] .card,
:root[data-theme="night"] .stat-card,
:root[data-theme="night"] .auth-box,
:root[data-theme="night"] .admin-header,
:root[data-theme="night"] .header-dropdown,
:root[data-theme="night"] .btn-light {
    background: var(--surface-card);
    color: var(--gray-900);
}

:root[data-theme="night"] .card,
:root[data-theme="night"] .topbar,
:root[data-theme="night"] .header-dropdown,
:root[data-theme="night"] input,
:root[data-theme="night"] select,
:root[data-theme="night"] textarea,
:root[data-theme="night"] .btn-light {
    border-color: var(--border-soft);
}

:root[data-theme="night"] .btn-light:hover {
    background: var(--gray-300);
}

/* Orientación landscape en móviles */
@media (max-width: 768px) and (orientation: landscape) {
    .sidebar {
        height: auto;
        max-height: 100vh;
    }
}

/* Ajustes para pantallas muy pequeñas */
@media (max-width: 375px) {
    .stats-grid {
        gap: 8px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-value {
        font-size: 20px;
    }

    .card {
        padding: 12px;
    }

    .btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .menu-item {
        padding: 8px;
        gap: 6px;
    }

    .menu-icon {
        width: 18px;
        font-size: 16px;
    }
}

/* CRM service picker */
.crm-svc-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 8px;
}

.crm-svc-empty {
    margin: 0;
    color: var(--gray-500);
    font-size: 13px;
}

.crm-svc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
}

.crm-svc-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.crm-svc-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
}

.crm-svc-price {
    font-size: 12px;
    color: var(--gray-500);
}

.crm-svc-counter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.crm-svc-inc,
.crm-svc-dec {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid var(--gray-300);
    background: #fff;
    cursor: pointer;
    line-height: 1;
}

.crm-svc-inc:disabled,
.crm-svc-dec:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.crm-svc-qty {
    min-width: 20px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    border-radius: 999px;
    padding: 2px 6px;
    color: var(--gray-600);
}

.crm-svc-qty.active {
    color: #fff;
    background: var(--primary);
}

/* Floating AI chat */
.ai-float-btn {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 58px;
    height: 58px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    color: #fff;
    font-weight: 800;
    font-size: 16px;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.35);
    cursor: pointer;
    z-index: 1200;
}

.ai-chat-panel {
    position: fixed;
    right: 20px;
    bottom: 90px;
    width: min(380px, calc(100vw - 24px));
    max-height: min(70vh, 620px);
    /* ── Floating AI Chat Widget ─────────────────────────────────────────────── */

    /* Main float button */
    .ai-float-btn {
        position: fixed;
        right: 20px;
        bottom: 20px;
        width: 56px;
        height: 56px;
        border-radius: 999px;
        border: none;
        background: linear-gradient(135deg, #0ea5e9, #2563eb);
        color: #fff;
        font-weight: 800;
        font-size: 15px;
        box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
        cursor: pointer;
        z-index: 1200;
        transition: transform 0.15s ease, box-shadow 0.15s ease;
    }
    .ai-float-btn:hover { transform: scale(1.07); box-shadow: 0 12px 32px rgba(37,99,235,0.5); }

    /* Quick action buttons (vertical stack left of float btn) */
    .ai-quick-actions {
        position: fixed;
        right: 20px;
        bottom: 86px;
        display: flex;
        flex-direction: column;
        gap: 6px;
        z-index: 1200;
        align-items: center;
    }

    .ai-quick-btn {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        border: 1px solid var(--gray-200);
        background: #fff;
        color: #2563eb;
        font-size: 15px;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(15,23,42,0.12);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.15s, transform 0.1s;
        line-height: 1;
        padding: 0;
    }
    .ai-quick-btn:hover { background: #eff6ff; transform: scale(1.1); }

    /* Chat panel (compact popup) */
    .ai-chat-panel {
        position: fixed;
        right: 20px;
        bottom: 88px;
        width: min(380px, calc(100vw - 24px));
        max-height: min(72vh, 600px);
        display: flex;
        flex-direction: column;
        background: #fff;
        border: 1px solid var(--gray-200);
        border-radius: 16px;
        box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
        z-index: 1199;
        overflow: hidden;
    }

    /* Shared header */
    .ai-chat-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 14px;
        background: linear-gradient(90deg, #1e3a8a 0%, #2563eb 100%);
        color: #fff;
        flex-shrink: 0;
    }
    .ai-chat-header strong { font-size: 14px; }

    .ai-chat-header-actions { display: flex; gap: 4px; }

    .ai-chat-icon-btn {
        border: none;
        background: rgba(255,255,255,0.15);
        color: #fff;
        font-size: 14px;
        width: 28px;
        height: 28px;
        border-radius: 6px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        transition: background 0.15s;
    }
    .ai-chat-icon-btn:hover { background: rgba(255,255,255,0.3); }

    /* Message feed */
    .ai-chat-feed {
        flex: 1;
        padding: 12px;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        gap: 8px;
        scroll-behavior: smooth;
        max-height: calc(72vh - 120px);
    }

    .ai-chat-feed::-webkit-scrollbar {
        width: 10px;
    }

    .ai-chat-feed::-webkit-scrollbar-track {
        background: #e2e8f0;
        border-radius: 999px;
    }

    .ai-chat-feed::-webkit-scrollbar-thumb {
        background: #94a3b8;
        border-radius: 999px;
    }

    .ai-chat-feed::-webkit-scrollbar-thumb:hover {
        background: #64748b;
    }

    .ai-chat-msg {
        padding: 8px 12px;
        border-radius: 12px;
        font-size: 13px;
        max-width: 88%;
        line-height: 1.45;
    }
    .ai-chat-msg.user {
        align-self: flex-end;
        background: #dbeafe;
        color: #1e3a8a;
    }
    .ai-chat-msg.bot {
        align-self: flex-start;
        background: #f8fafc;
        border: 1px solid var(--gray-200);
    }
    .ai-thinking { color: #94a3b8; font-style: italic; font-size: 12px; }

    /* Input form — fixed layout so button never crowds the input */
    .ai-chat-form {
        border-top: 1px solid var(--gray-200);
        padding: 8px 10px;
        display: flex;
        gap: 6px;
        flex-shrink: 0;
        align-items: center;
        background: #fff;
    }
    .ai-chat-form input {
        flex: 1;
        min-width: 0;
        border: 1px solid var(--gray-300);
        border-radius: 20px;
        padding: 7px 12px;
        font-size: 13px;
        outline: none;
    }
    .ai-chat-form input:focus { border-color: #2563eb; }

    /* Send button — compact icon-only circle */
    .ai-send-btn {
        flex-shrink: 0;
        width: 34px;
        height: 34px;
        border-radius: 50%;
        border: none;
        background: #2563eb;
        color: #fff;
        font-size: 15px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        padding: 0;
        transition: background 0.15s, transform 0.1s;
    }
    .ai-send-btn:hover { background: #1d4ed8; transform: scale(1.08); }

    /* Data table inside messages */
    .ai-chat-table {
        margin-top: 8px;
        overflow-x: auto;
    }
    .ai-chat-table table {
        width: 100%;
        border-collapse: collapse;
        font-size: 12px;
    }
    .ai-chat-table th,
    .ai-chat-table td {
        border: 1px solid var(--gray-200);
        padding: 4px 6px;
        text-align: left;
    }

    /* ── Fullscreen overlay ──────────────────────────────────────────────────── */
    .ai-fullscreen-overlay {
        position: fixed;
        inset: 0;
        background: rgba(15,23,42,0.55);
        z-index: 2000;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 16px;
    }
    .ai-fullscreen-overlay.hidden { display: none; }

    .ai-fullscreen-panel {
        background: #fff;
        border-radius: 16px;
        width: 100%;
        max-width: 860px;
        height: min(90vh, 720px);
        display: flex;
        flex-direction: column;
        overflow: hidden;
        box-shadow: 0 30px 80px rgba(15,23,42,0.35);
    }
    .ai-fullscreen-panel .ai-chat-feed { font-size: 14px; }
    .ai-fullscreen-panel .ai-chat-form input { font-size: 14px; }

    /* ── Nested sidebar submenu (RRHH inside Mi Equipo) ─────────────────────── */
    .menu-item.submenu-item.sub2-item {
        padding-left: 40px;
        font-size: 12.5px;
    }

    @media (max-width: 768px) {
        .ai-float-btn { right: 14px; bottom: 14px; }
        .ai-quick-actions { right: 14px; bottom: 80px; }
        .ai-chat-panel { right: 12px; bottom: 80px; width: calc(100vw - 24px); }
    }

    /* ── AI Studio View ───────────────────────────────────────────────────────── */
    .ai-studio-layout {
        display: block;
        min-height: calc(100vh - 180px);
    }

    .ai-studio-sidebar {
        display: none;
    }

    .ai-studio-sidebar-title {
        margin: 0;
        font-size: 15px;
        font-weight: 700;
    }

    .ai-studio-quick-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .ai-studio-quick-list-inline {
        padding: 0 14px 10px;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .ai-studio-quick-prompt {
        border: 1px solid #dbeafe;
        background: #ffffff;
        color: #0f172a;
        border-radius: 999px;
        padding: 6px 10px;
        text-align: left;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 12px;
        transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    }

    .ai-studio-quick-prompt:hover {
        border-color: #93c5fd;
        box-shadow: 0 4px 10px rgba(37, 99, 235, 0.15);
        transform: translateY(-1px);
    }

    .ai-studio-badge {
        margin-top: auto;
        background: rgba(37, 99, 235, 0.2);
        border: 1px solid rgba(96, 165, 250, 0.45);
        padding: 8px 10px;
        border-radius: 10px;
        display: inline-flex;
        gap: 8px;
        align-items: center;
        font-size: 12px;
    }

    .ai-studio-main {
        background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
        border-radius: 18px;
        border: 1px solid #dbeafe;
        display: flex;
        flex-direction: column;
        min-height: 540px;
        overflow: hidden;
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    }

    .ai-studio-header {
        padding: 16px 18px 10px;
        border-bottom: 1px solid #e2e8f0;
        background: transparent;
    }

    .ai-studio-header h2 {
        margin: 0 0 4px;
        font-size: 22px;
        letter-spacing: 0.2px;
    }

    .ai-studio-subtitle {
        margin: 0;
        color: #475569;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.9px;
    }

    .ai-studio-feed {
        flex: 1;
        overflow-y: auto;
        padding: 12px 14px;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .ai-studio-msg.user {
        align-self: flex-end;
        max-width: 85%;
    }

    .ai-studio-msg.bot {
        align-self: flex-start;
        width: 100%;
    }

    .ai-studio-question {
        margin: 0;
        background: #dbeafe;
        color: #1e3a8a;
        border-radius: 10px;
        padding: 8px 10px;
    }

    .ai-studio-response {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 12px;
    }

    .ai-studio-form {
        border-top: 1px solid #e2e8f0;
        padding: 10px 12px 12px;
        display: flex;
        gap: 8px;
        background: #ffffff;
    }

    .ai-studio-form input {
        flex: 1;
        min-width: 0;
        border: 1px solid #cbd5e1;
        border-radius: 12px;
        padding: 10px 12px;
    }

    .ai-studio-send-btn {
        border: none;
        background: linear-gradient(135deg, #0ea5e9, #2563eb);
        color: #fff;
        border-radius: 12px;
        padding: 0 16px;
        min-width: 112px;
        cursor: pointer;
        font-weight: 700;
    }

    .ai-studio-welcome p {
        margin: 0;
        color: #334155;
        font-size: 14px;
    }

    .ai-studio-answer-text {
        margin: 0;
        color: #1e293b;
        line-height: 1.5;
    }

    .ai-thinking {
        margin: 0;
        color: #64748b;
        font-size: 13px;
    }

    .ai-studio-chart-title {
        font-size: 13px;
        color: #334155;
        margin: 0 0 8px;
    }

    .ai-studio-bar-row {
        display: grid;
        grid-template-columns: 160px 1fr 70px;
        gap: 8px;
        align-items: center;
        margin-bottom: 6px;
    }

    .ai-studio-bar-label {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 12px;
        color: #475569;
    }

    .ai-studio-bar-track {
        background: #e2e8f0;
        border-radius: 999px;
        height: 10px;
        overflow: hidden;
    }

    .ai-studio-bar-fill {
        height: 100%;
        border-radius: 999px;
        background: linear-gradient(90deg, #38bdf8, #2563eb);
    }

    .ai-studio-bar-val {
        font-size: 12px;
        color: #0f172a;
        text-align: right;
    }

    .ai-studio-kpi-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 10px;
    }

    .ai-studio-kpi-card {
        border: 1px solid var(--gray-200);
        border-radius: 10px;
        padding: 10px;
        background: #fff;
    }

    .ai-studio-kpi-label { display: block; font-size: 12px; color: #64748b; }
    .ai-studio-kpi-value { display: block; font-size: 20px; font-weight: 800; color: #0f172a; }
    .ai-studio-kpi-delta { display: block; font-size: 12px; color: #059669; }

    /* ── Team HR view ─────────────────────────────────────────────────────────── */
    .hr-lock-banner {
        display: flex;
        align-items: center;
        gap: 8px;
        border: 1px solid #fcd34d;
        background: #fffbeb;
        border-radius: 10px;
        padding: 10px 12px;
    }

    .hr-stats-row {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 10px;
        margin-bottom: 12px;
    }

    .hr-stat-card {
        border: 1px solid var(--gray-200);
        border-radius: 10px;
        padding: 10px;
        background: #f8fafc;
    }

    .hr-stat-label { display: block; font-size: 12px; color: #64748b; margin-bottom: 4px; }
    .hr-stat-value { display: block; font-size: 20px; font-weight: 700; color: #0f172a; }

    .hr-form-section {
        border: 1px solid var(--gray-200);
        border-radius: 10px;
        padding: 12px;
        margin-bottom: 12px;
        background: #fff;
    }

    .hr-form-section h4 {
        margin: 0 0 10px;
    }

    .hr-form {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .hr-filters { margin-bottom: 8px; }
    .hr-table-wrapper { overflow-x: auto; }

    .hr-tracking-grid {
        display: grid;
        gap: 12px;
    }

    .hr-tracking-section {
        border: 1px solid var(--gray-200);
        border-radius: 10px;
        padding: 10px;
        background: #fff;
    }

    .hr-tracking-section h4 {
        margin: 0 0 8px;
    }

    .hr-performance-placeholder {
        background: #f8fafc;
        border-radius: 8px;
        padding: 10px;
    }

    @media (max-width: 980px) {
        .ai-studio-main {
            min-height: 480px;
        }

        .ai-studio-quick-list-inline {
            padding: 0 10px 10px;
            gap: 6px;
        }

        .ai-studio-bar-row {
            grid-template-columns: 1fr;
            gap: 4px;
        }

        .ai-studio-bar-val {
            text-align: left;
        }
    }

}

/* ============================================================
   PAYMENT PENDING VIEW
   ============================================================ */

.payment-pending-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.payment-pending-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.10);
    max-width: 560px;
    width: 100%;
    padding: 40px 36px 32px;
}

.payment-pending-header {
    text-align: center;
    margin-bottom: 32px;
}

.payment-pending-icon {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 14px;
}

.payment-pending-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px;
}

.payment-pending-header p {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0;
}

/* Plan summary badge */
.payment-plan-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.payment-plan-name {
    font-weight: 700;
    color: #0f172a;
    font-size: 1rem;
}

.payment-plan-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: #16a34a;
}

/* Steps */
.payment-pending-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 28px;
}

.payment-step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.payment-step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #0ea5e9;
    color: #fff;
    font-weight: 700;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.payment-step-content {
    flex: 1;
}

.payment-step-content h3,
.payment-step-content strong {
    display: block;
    font-size: 0.9375rem;
    color: #0f172a;
    margin-bottom: 4px;
}

.payment-step-content p {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0 0 10px;
    line-height: 1.5;
}

/* Nequi CTA button */
.btn-payment-nequi {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #00C65E;
    color: #fff;
    font-weight: 700;
    font-size: 0.9375rem;
    padding: 11px 22px;
    border-radius: 10px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-payment-nequi:hover {
    background: #00a84e;
    transform: translateY(-1px);
    text-decoration: none;
    color: #fff;
}

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

.payment-methods-wrap {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-payment-qr {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 11px 18px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-payment-qr:hover {
    background: #1e293b;
    transform: translateY(-1px);
}

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

.qr-payment-box {
    margin-top: 12px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    text-align: center;
}

.qr-payment-box p {
    margin: 0 0 10px;
    color: #334155;
    font-size: 0.85rem;
}

.qr-payment-box img {
    width: min(240px, 100%);
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #fff;
    padding: 8px;
}

/* Reference form */
.reference-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.reference-form input[type="text"] {
    flex: 1;
    min-width: 160px;
    padding: 10px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #0f172a;
    transition: border-color 0.2s;
    outline: none;
}

.reference-form input[type="text"]:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.reference-form button {
    white-space: nowrap;
    padding: 10px 18px;
    background: #0f172a;
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.reference-form button:hover {
    background: #1e293b;
}

.reference-status {
    font-size: 0.85rem;
    margin-top: 6px;
    min-height: 20px;
    color: #64748b;
}

.reference-status.success {
    color: #16a34a;
    font-weight: 600;
}

.reference-status.error {
    color: #dc2626;
}

/* Polling indicator */
.polling-indicator {
    text-align: center;
    font-size: 0.85rem;
    color: #94a3b8;
    padding: 10px 0 2px;
    animation: pulse-text 2.5s ease-in-out infinite;
}

@keyframes pulse-text {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

/* Footer */
.payment-pending-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    border-top: 1px solid #f1f5f9;
    padding-top: 18px;
    margin-top: 4px;
}

.payment-pending-footer button {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px 8px;
    transition: color 0.2s;
}

.payment-pending-footer button:hover {
    color: #64748b;
}

/* Responsive */
@media (max-width: 600px) {
    .payment-pending-card {
        padding: 28px 20px 24px;
    }

    .btn-payment-nequi,
    .btn-payment-qr {
        width: 100%;
        justify-content: center;
    }
}