:root {
    --bq-acc-primary: #033759;
    --bq-acc-primary-hover: #02233a;
    --bq-acc-focus: #0d6efd;
    --bq-acc-secondary: #f8fafc;
    --bq-acc-text-main: #1f2937;
    --bq-acc-text-light: #6b7280;
    --bq-acc-border: #e5e7eb;
    --bq-acc-danger: #dc2626;
    --bq-acc-danger-hover: #b91c1c;
    --bq-acc-success: #2E7D32;
    --bq-acc-radius: 3px;
    --bq-acc-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

body.bq-headless-page {
    background-color: var(--bq-acc-secondary);
}

.bq-acc-container {
    max-width: 1600px;
    width: 100%;
    margin: 50px auto;
    padding: 50px 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    font-family: 'Lato', sans-serif;
    box-sizing: border-box;
    min-height: 65vh;
}

@media (min-width: 768px) {
    .bq-acc-container {
        flex-direction: row;
        align-items: flex-start;
    }
}

/* Sidebar Navigation */
.bq-acc-sidebar {
    width: 100%;
    background: #fff;
    border: 1px solid var(--bq-acc-border);
    border-radius: var(--bq-acc-radius);
    padding: 20px 0;
    box-shadow: var(--bq-acc-shadow);
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .bq-acc-sidebar {
        width: 280px;
        flex-shrink: 0;
    }
}

.bq-acc-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bq-acc-sidebar li a {
    display: block;
    padding: 12px 24px;
    color: var(--bq-acc-text-main);
    text-decoration: none;
    font-weight: 700;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}

.bq-acc-sidebar li a:hover,
.bq-acc-sidebar li.active a {
    background: #f1f5f9;
    color: var(--bq-acc-primary);
    border-left-color: var(--bq-acc-primary);
}

/* Main Content Area */
.bq-acc-content {
    flex-grow: 1;
    min-width: 0;
    background: #fff;
    border: 1px solid var(--bq-acc-border);
    border-radius: var(--bq-acc-radius);
    padding: 30px;
    box-shadow: var(--bq-acc-shadow);
    box-sizing: border-box;
}

.bq-acc-header {
    border-bottom: 1px solid var(--bq-acc-border);
    margin-bottom: 25px;
    padding-bottom: 15px;
}

.bq-acc-header h1 {
    margin: 0;
    font-size: 24px;
    color: var(--bq-acc-text-main);
    font-weight: 900;
}

.bq-acc-header p {
    margin: 5px 0 0 0;
    color: var(--bq-acc-text-light);
    font-size: 14px;
}

/* Form Elements */
.bq-form-group {
    margin-bottom: 20px;
    max-width: 600px;
}

.bq-form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--bq-acc-text-main);
    font-size: 14px;
}

.bq-form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--bq-acc-border);
    border-radius: var(--bq-acc-radius);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

textarea.bq-form-control {
    resize: vertical;
    min-height: 120px;
}

.bq-modal textarea.bq-form-control {
    min-height: 160px;
}

.bq-form-control:focus {
    outline: none;
    border-color: var(--bq-acc-focus); 
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15); 
}

/* Buttons */
.bq-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--bq-acc-radius);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

.bq-btn-primary {
    background: #0076c4;
    color: #fff;
}

.bq-btn-primary:hover {
    background: #005c99;
}

.bq-btn-danger {
    background: transparent;
    border: 1px solid var(--bq-acc-danger);
    color: var(--bq-acc-danger);
}

.bq-btn-danger:hover {
    background: var(--bq-acc-danger);
    color: #fff;
}

/* Data Tables */
.bq-table-wrapper {
    overflow-x: auto;
}

.bq-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 5px;
}

.bq-table th, .bq-table td {
    padding: 6px 10px; 
    text-align: left;
    border-bottom: 1px solid var(--bq-acc-border);
    font-size: 13px;
    height: 36px;
}

.bq-table th {
    background: #f9fafb;
    font-weight: 700;
    color: var(--bq-acc-text-light);
    text-transform: uppercase;
    font-size: 12px;
    padding-top: 10px;
    padding-bottom: 10px;
}

/* Cards (Subscription specific) */
.bq-sub-card {
    border: 1px solid var(--bq-acc-border);
    border-radius: var(--bq-acc-radius);
    padding: 20px;
    background: #f8fafc;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.bq-sub-info h3 {
    margin: 0 0 5px 0;
    font-size: 20px;
    color: var(--bq-acc-primary);
}

.bq-sub-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: var(--bq-acc-radius);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.bq-sub-status.active {
    background: #dcfce7;
    color: var(--bq-acc-success);
}

.bq-sub-status.expired {
    background: #fee2e2;
    color: var(--bq-acc-danger);
}

/* API Usage Chart & Overlay styles */
.bq-chart-wrapper {
    position: relative;
    width: 100%;
    height: 350px;
    margin-bottom: 30px;
    border: 1px solid var(--bq-acc-border);
    border-radius: var(--bq-acc-radius);
    background: #fff;
    overflow: hidden;
}

.bq-chart-svg {
    width: 100%;
    height: 100%;
    opacity: 0.3;
}

.bq-coming-soon-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    background: rgba(255, 255, 255, 0.4); 
    backdrop-filter: blur(6px); 
    -webkit-backdrop-filter: blur(6px);
}

.bq-coming-soon-badge {
    background: #0076c4;
    color: #fff;
    padding: 10px 24px;
    border-radius: var(--bq-acc-radius);
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 4px 6px -1px rgba(3, 55, 89, 0.3);
}

/* Cancellation / Regen Modal */
.bq-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.bq-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.bq-modal {
    background: #fff;
    width: 92%; 
    max-width: 650px; 
    border-radius: var(--bq-acc-radius);
    padding: 35px; 
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(15px);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.bq-modal-overlay.active .bq-modal {
    transform: translateY(0);
}

.bq-modal h3 {
    margin: 0 0 10px 0;
    color: var(--bq-acc-text-main);
    font-size: 22px; 
}

.bq-modal p {
    color: var(--bq-acc-text-light);
    font-size: 15px; 
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Inline Error Message */
.bq-modal-error {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #f87171;
    border-radius: var(--bq-acc-radius);
    padding: 12px 15px;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.4;
}

.bq-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

@media (max-width: 480px) {
    .bq-modal-actions {
        flex-direction: column-reverse;
    }
    
    .bq-modal-actions .bq-btn {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* =========================================================
   API KEY SPECIFIC STYLES
   ========================================================= */
.bq-api-key-box {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 500px;
    background: #fff;
    border: 1px solid var(--bq-acc-border);
    border-radius: var(--bq-acc-radius);
    overflow: hidden;
}

.bq-api-key-box input {
    flex-grow: 1;
    border: none;
    padding: 12px 15px;
    font-family: monospace;
    font-size: 16px;
    color: var(--bq-acc-text-main);
    background: transparent;
    outline: none;
    min-width: 0;
}

.bq-api-key-actions {
    display: flex;
    border-left: 1px solid var(--bq-acc-border);
}

.bq-api-key-actions button {
    background: #f8fafc;
    border: none;
    padding: 12px 15px;
    cursor: pointer;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.bq-api-key-actions button:hover {
    background: #e2e8f0;
    color: var(--bq-acc-primary);
}

.bq-api-key-actions button:first-child {
    border-right: 1px solid var(--bq-acc-border);
}


/* =========================================================
   VISIBLE SLICK RECEIPT (Stripe-Style Interstitial)
   ========================================================= */

.bq-acc-content.bq-receipt-mode {
    background: transparent !important; 
    border: none !important;
    box-shadow: none !important;
    padding: 20px 10px 60px 10px;
}

.bq-slick-receipt-wrapper {
    max-width: 450px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.bq-slick-receipt-brand {
    text-align: center;
    margin-bottom: 25px;
    color: #475569;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bq-slick-receipt-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    padding: 40px 40px 30px 40px;
    text-align: center;
    border: 1px solid rgba(0,0,0,0.05);
}

.bq-slick-receipt-icon {
    position: relative;
    display: inline-block;
    margin-bottom: 15px;
}

.bq-slick-receipt-check {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: #10b981; 
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #fff;
}

.bq-slick-receipt-card h2 {
    font-size: 16px;
    color: #64748b;
    margin: 0 0 10px 0;
    font-weight: 500;
}

.bq-slick-receipt-amount {
    font-size: 38px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 30px 0;
    letter-spacing: -1px;
}

.bq-slick-receipt-details {
    text-align: left;
    margin-bottom: 30px;
}

.bq-slick-receipt-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 14px;
}

.bq-slick-receipt-row span:first-child { color: #64748b; }
.bq-slick-receipt-row span:last-child { color: #0f172a; font-weight: 500; }

.bq-slick-receipt-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bq-slick-receipt-actions .bq-btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    border-radius: 6px;
}

.bq-btn-dark {
    background: #0f172a;
    color: #fff;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bq-btn-dark:hover:not(:disabled) { background: #1e293b; }
.bq-btn-dark:disabled { opacity: 0.7; cursor: not-allowed; }

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

/* =========================================================
   HIDDEN DETAILED RECEIPT (Source for PDF Generation)
   ========================================================= */

.bq-pdf-receipt-document {
    padding: 40px;
    background: #ffffff;
    color: #0f172a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.bq-pdf-header {
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.bq-pdf-header h1 {
    font-size: 32px;
    color: #0f172a;
    margin: 0 0 20px 0;
    font-weight: 800;
}

.bq-pdf-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.bq-pdf-meta-item { display: flex; flex-direction: column; }
.bq-pdf-meta-label { font-size: 12px; color: #64748b; text-transform: uppercase; font-weight: 700; margin-bottom: 4px; }
.bq-pdf-meta-value { font-size: 15px; color: #0f172a; font-weight: 500; }

.bq-pdf-parties {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
}

.bq-pdf-party { width: 48%; }

.bq-pdf-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.bq-pdf-table th {
    border-bottom: 2px solid #e2e8f0;
    padding: 12px 0;
    color: #64748b;
    font-size: 13px;
    text-transform: uppercase;
}

.bq-pdf-table td {
    padding: 15px 0;
    border-bottom: 1px solid #e2e8f0;
    color: #0f172a;
    font-size: 15px;
}

.bq-pdf-summary {
    width: 300px;
    margin-left: auto;
}

.bq-pdf-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 15px;
    color: #475569;
}

.bq-pdf-summary-total {
    border-top: 2px solid #0f172a;
    margin-top: 5px;
    padding-top: 15px;
    font-weight: 800;
    color: #0f172a;
    font-size: 18px;
}

/* =========================================================
   USAGE CHART TOGGLES
   ========================================================= */
.bq-time-toggles {
    display: flex;
    background: #f1f5f9;
    border-radius: 6px;
    padding: 4px;
    gap: 4px;
    border: 1px solid var(--bq-acc-border);
}

.bq-time-toggles button {
    background: transparent;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bq-time-toggles button:hover {
    color: var(--bq-acc-primary);
}

.bq-time-toggles button.active {
    background: #fff;
    color: var(--bq-acc-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}