/* ==========================================================================
   BLUEMEDICAL SYSTEM STYLE SHEET
   ========================================================================== */

/* Variables & Design Tokens */
:root {
    --primary-color: #0070C0;     /* BlueMedical Blue */
    --primary-dark: #005694;
    --primary-light: #e6f0fa;
    --dark-blue: #0f2c59;          /* Clinical Navy Blue */
    --background: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #cbd5e1;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--dark-blue);
    font-weight: 600;
}

/* Loading Screen */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-color: var(--background);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border-color);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Main Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--dark-blue);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    flex-shrink: 0;
    box-shadow: 4px 0 10px rgba(15, 44, 89, 0.05);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-icon {
    font-size: 32px;
    color: #38bdf8;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.logo-sub {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.7;
    text-transform: uppercase;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.nav-item:hover, .nav-item.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
    background-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 112, 192, 0.2);
}

.nav-item i {
    font-size: 20px;
}

.sidebar-footer {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    padding: 40px;
    overflow-y: auto;
    max-width: 1400px;
    margin: 0 auto;
    width: calc(100% - 260px);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Cards & Containers */
.card {
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(226, 232, 240, 0.8);
    margin-bottom: 30px;
    transition: var(--transition);
}

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

.card-title {
    font-size: 18px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title i {
    color: var(--primary-color);
}

/* Forms & Inputs */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    font-size: 13px;
    font-weight: 600;
    color: var(--dark-blue);
}

input, select, textarea {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-main);
    background-color: white;
    outline: none;
    transition: var(--transition);
    width: 100%;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 112, 192, 0.15);
}

input:disabled, select:disabled {
    background-color: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(0, 112, 192, 0.2);
}

.btn-secondary {
    background-color: #f1f5f9;
    color: #475569;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

.btn-outline {
    background-color: transparent;
    border: 1.5px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-light);
}

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

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

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

/* Stepper Component */
.stepper-container {
    margin-bottom: 40px;
}

.stepper {
    display: flex;
    justify-content: space-between;
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.stepper::before {
    content: '';
    position: absolute;
    top: 22px;
    left: 40px;
    right: 40px;
    height: 3px;
    background-color: var(--border-color);
    z-index: 1;
}

.stepper-progress {
    position: absolute;
    top: 22px;
    left: 40px;
    height: 3px;
    background-color: var(--primary-color);
    z-index: 1;
    transition: width 0.3s ease;
}

.step-item {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
}

.step-circle {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background-color: white;
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-muted);
    font-family: var(--font-heading);
    transition: var(--transition);
}

.step-label {
    margin-top: 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.step-item.active .step-circle {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 0 0 6px rgba(0, 112, 192, 0.15);
}

.step-item.active .step-label {
    color: var(--primary-color);
    font-weight: 700;
}

.step-item.completed .step-circle {
    border-color: var(--primary-color);
    background-color: white;
    color: var(--primary-color);
}

.step-item.completed .step-label {
    color: var(--text-main);
}

/* Stepper Actions footer */
.stepper-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

/* Insurer Badges (Colors matching Excel) */
.insurer-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-la-general { background-color: #1F6B36; }
.badge-bam { background-color: #843C0C; }
.badge-mapfre { background-color: #7B1818; }
.badge-universales { background-color: #1F4E79; }
.badge-epss { background-color: #375623; }
.badge-blue-medical { background-color: #1A5276; }
.badge-addiuva { background-color: #6B3A7D; }
.badge-bmi { background-color: #7D4F1A; }
.badge-bupa { background-color: #154360; }
.badge-mdabroad { background-color: #1B4F72; }
.badge-redbridge { background-color: #641E16; }
.badge-palig { background-color: #2B5D95; }
.badge-rpn { background-color: #0D47A1; }

/* Interactive Cards Grid for Step 2 */
.pkg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.pkg-card {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 180px;
}

.pkg-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pkg-card.selected {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.pkg-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.pkg-num {
    background-color: var(--primary-color);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    font-family: var(--font-heading);
}

.pkg-code {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    background-color: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
}

.pkg-name {
    font-size: 14px;
    font-weight: 600;
    margin-top: 15px;
    color: var(--dark-blue);
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pkg-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    text-align: right;
    margin-top: 10px;
}

/* Package Desglose Details */
.desglose-panel {
    background-color: #f8fafc;
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border-color);
    margin-top: 20px;
}

.desglose-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark-blue);
    margin-bottom: 12px;
}

.desglose-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.desglose-item {
    background-color: white;
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.desglose-item i {
    font-size: 16px;
    color: var(--success);
}

.desglose-section-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    text-transform: uppercase;
}
.sec-honorarios { background-color: #dbeafe; color: #1e40af; }
.sec-insumos { background-color: #d1fae5; color: #065f46; }
.sec-medicamentos { background-color: #fef3c7; color: #92400e; }
.sec-equipos { background-color: #f3e8ff; color: #6b21a8; }

/* Dynamic List Inputs (Step 3) */
.list-builder {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.list-row {
    display: flex;
    gap: 15px;
    align-items: center;
    background-color: #f8fafc;
    padding: 15px;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border-color);
}

.list-row-fields {
    display: flex;
    gap: 15px;
    flex-grow: 1;
}

.list-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.list-table th, .list-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
}

.list-table th {
    font-weight: 600;
    color: var(--text-muted);
}

.list-table td button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--danger);
}

/* History Table Styling */
.history-table-container {
    overflow-x: auto;
}

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

.history-table th, .history-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.history-table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.history-table td {
    font-size: 14px;
}

.history-table tr:hover {
    background-color: #f8fafc;
}

/* Search and Filters */
.filters-bar {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    align-items: center;
}

.search-input-wrapper {
    position: relative;
    flex-grow: 1;
}

.search-input-wrapper i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input-wrapper input {
    padding-left: 38px;
}

/* Modal Layout */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 44, 89, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 30px;
    flex-grow: 1;
}

.modal-footer {
    padding: 15px 30px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.close-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    color: var(--text-muted);
}

/* ==========================================================================
   STATEMENT OF ACCOUNT / INVOICE LAYOUT (EXCEL SHEET STYLE)
   ========================================================================== */
.invoice-container {
    background-color: white;
    padding: 40px;
    border: 1px solid #94a3b8;
    box-shadow: 0 0 15px rgba(0,0,0,0.02);
    font-family: 'Inter', sans-serif;
    color: black;
    width: 100%;
    margin: 0 auto;
    font-size: 12px;
    line-height: 1.4;
}

.invoice-header {
    text-align: center;
    margin-bottom: 25px;
    border-bottom: 3px double #0f2c59;
    padding-bottom: 15px;
}

.invoice-title {
    font-size: 22px;
    font-weight: 800;
    color: #0f2c59;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.invoice-subtitle {
    font-size: 14px;
    font-weight: 700;
    color: #64748b;
}

/* Grid layout for Patient details */
.invoice-details-grid {
    display: grid;
    grid-template-columns: 100px 1fr 100px 1fr;
    gap: 10px 15px;
    margin-bottom: 25px;
    background-color: #f8fafc;
    padding: 15px;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
}

.detail-label {
    font-weight: 700;
    color: #475569;
}

.detail-value {
    border-bottom: 1px solid #cbd5e1;
    padding-bottom: 2px;
}

/* Invoice Section Headers */
.invoice-sec-header {
    background-color: #0f2c59;
    color: white;
    font-weight: 700;
    padding: 6px 12px;
    font-size: 12px;
    margin-top: 20px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Invoice Table Layout */
.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.invoice-table th {
    background-color: #f1f5f9;
    font-weight: 700;
    border: 1px solid #94a3b8;
    padding: 6px 10px;
    text-align: left;
    font-size: 11px;
}

.invoice-table td {
    border: 1px solid #cbd5e1;
    padding: 6px 10px;
    font-size: 11px;
}

.invoice-table .col-num {
    width: 40px;
    text-align: center;
}

.invoice-table .col-qty {
    width: 60px;
    text-align: center;
}

.invoice-table .col-price, .invoice-table .col-subtotal {
    width: 100px;
    text-align: right;
}

.invoice-subtotal-row {
    font-weight: 700;
    background-color: #f8fafc;
}

.invoice-subtotal-row td {
    border: 1px solid #94a3b8;
}

/* Total block calculations */
.invoice-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-top: 30px;
    align-items: start;
}

.invoice-footer-left {
    font-size: 10px;
    color: #475569;
    font-style: italic;
    border: 1px solid #cbd5e1;
    padding: 10px;
    border-radius: var(--radius-sm);
    line-height: 1.5;
}

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

.totals-table td {
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
}

.totals-table td:nth-child(2) {
    text-align: right;
    font-weight: 500;
}

.totals-table .total-final-row {
    font-weight: 700;
    font-size: 13px;
    background-color: #f1f5f9;
    border-top: 2px solid #0f2c59;
}

.totals-table .total-final-row td {
    border: 1px solid #0f2c59;
}

.totals-table .total-patient-row {
    font-weight: 700;
    background-color: #dbeafe;
    color: #1e40af;
    border: 2px solid #1e40af;
}

.totals-table .total-insurer-row {
    font-weight: 700;
    background-color: #d1fae5;
    color: #065f46;
    border: 2px solid #065f46;
}

/* EKG / Specialty custom table */
.inner-row-grid {
    display: grid;
    grid-template-columns: 1fr 100px 100px;
    gap: 10px;
}

/* Screen-only styling for print elements */
.print-only {
    display: none !important;
}

/* Print optimizations */
@media print {
    /* Hide layout wrapper UI elements and everything else */
    body * {
        visibility: hidden;
    }
    
    /* Show only the invoice container and its contents */
    .invoice-container, .invoice-container * {
        visibility: visible;
    }
    
    /* Positioning the invoice perfectly */
    .invoice-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100% !important;
        max-width: 100% !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
        background-color: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    /* Explicitly hide other large container elements during print */
    .sidebar, .stepper-container, .stepper-actions, .nav-menu, .page-header, .filters-bar, .btn, .modal-header, .modal-footer, .no-print {
        display: none !important;
    }
    
    /* Hide screen-only interactive inputs */
    .no-print, input.no-print, span.no-print, button.no-print {
        display: none !important;
        visibility: hidden !important;
    }
    
    /* Make print-only contents visible */
    .print-only {
        display: inline !important;
        visibility: visible !important;
    }
    
    /* Tables page break control */
    .invoice-table {
        page-break-inside: avoid;
    }
    
    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
    
    /* Layout cleanups for print margins */
    @page {
        size: letter;
        margin: 1.2cm;
    }
}

/* Entry Mode Choice Screen */
.mode-chooser-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 40px auto;
    max-width: 900px;
    width: 100%;
}

.mode-card {
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    border: 2px solid rgba(226, 232, 240, 0.8);
    padding: 40px 30px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow-sm);
}

.mode-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.mode-icon {
    font-size: 48px;
    color: var(--primary-color);
    background-color: var(--primary-light);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    transition: var(--transition);
}

.mode-card:hover .mode-icon {
    background-color: var(--primary-color);
    color: white;
}

.mode-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark-blue);
}

.mode-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    flex-grow: 1;
}

/* Auto form specific styling */
.auto-container {
    max-width: 800px;
    margin: 0 auto;
}

.mode-back-btn {
    margin-bottom: 20px;
}

/* Client Header Banner (Sticky info at the top) */
.client-header-banner {
    background: linear-gradient(135deg, var(--dark-blue), #1e3a8a);
    color: white;
    padding: 18px 24px;
    border-radius: var(--radius-md);
    margin-bottom: 25px;
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.client-banner-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.client-banner-avatar {
    width: 45px;
    height: 45px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.client-banner-avatar i {
    font-size: 24px;
    color: #38bdf8;
}

.client-banner-name {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

.client-banner-sub {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 2px;
}

.client-banner-meta {
    display: flex;
    gap: 20px;
    align-items: center;
}

.client-meta-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.client-meta-label {
    font-size: 10px;
    text-transform: uppercase;
    opacity: 0.7;
    font-weight: 600;
}

.client-meta-value {
    font-size: 14px;
    font-weight: 600;
}

/* Gemini IA Toggle Switch styling */
.ia-toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--primary-light);
    border: 1px solid rgba(0, 112, 192, 0.2);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.ia-toggle-label-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ia-toggle-label-group i {
    color: var(--primary-color);
    font-size: 24px;
}

.ia-toggle-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--dark-blue);
}

.ia-toggle-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* Pricing admin table styles */
.admin-tab-container {
    display: flex;
    gap: 15px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 25px;
}

.admin-tab {
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    transition: var(--transition);
}

.admin-tab:hover, .admin-tab.active {
    color: var(--primary-color);
}

.admin-tab.active {
    border-bottom-color: var(--primary-color);
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.admin-stat-card {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.admin-stat-icon i {
    font-size: 28px;
}

.admin-stat-number {
    font-size: 22px;
    font-weight: 700;
    color: var(--dark-blue);
}

.admin-stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* Price Catalog Action buttons */
.catalog-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: wrap;
}

.catalog-actions-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.catalog-actions-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Upload input override */
.custom-file-upload {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.custom-file-upload input[type=file] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
    height: 100%;
    width: 100%;
}

/* Pricing Pagination controls */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.pagination-buttons {
    display: flex;
    gap: 8px;
}

.pagination-btn {
    padding: 8px 12px;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition);
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

.pagination-info {
    font-size: 13px;
    color: var(--text-muted);
}

/* Inline / editable inputs for copago */
.editable-total-input {
    width: 100px;
    text-align: right;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-weight: 600;
    font-family: inherit;
    font-size: inherit;
}

.editable-total-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 4px rgba(0, 112, 192, 0.2);
}

.print-only {
    display: none;
}

@media print {
    .print-only {
        display: inline !important;
    }
}


