﻿/* Member Portal Styles â€” extends main site styles.css */

[hidden] { display: none !important; }

/* Auth section (login/register) â€” sits below the navbar */
.member-auth-section {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 0 60px;
    background: var(--light, #f9fafb);
}

/* Dashboard section */
.member-dashboard-section {
    padding: 100px 0 60px;
    min-height: calc(100vh - 200px);
    background: var(--light, #f9fafb);
}

.dashboard-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.dashboard-toolbar h2 { font-size: 22px; color: var(--dark, #0a0e27); }
.dashboard-toolbar-right { display: flex; align-items: center; gap: 12px; }
.header-email-display { font-size: 14px; color: var(--gray, #6b7280); }

/* Buttons (supplement main site buttons) */
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-full { width: 100%; justify-content: center; }
.btn-outline { background: transparent; color: var(--gray, #6b7280); border: 1px solid var(--gray-light, #e5e7eb); }
.btn-outline:hover { background: var(--light, #f9fafb); color: var(--dark, #0a0e27); }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-terraform { color: #7c3aed; border-color: #7c3aed; }
.btn-terraform:hover { background: rgba(124,58,237,0.1); color: #6d28d9; border-color: #6d28d9; }
.btn-terraform:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* Login Card */
.login-card {
    background: var(--white, #fff); border-radius: 16px; padding: 40px;
    width: 100%; max-width: 420px; margin: 0 auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08); border: 2px solid var(--gray-light, #e5e7eb);
    transition: border-color 0.3s, box-shadow 0.3s;
}
.login-card:hover { border-color: var(--primary, #0066ff); box-shadow: 0 12px 40px rgba(0,102,255,0.1); }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo img { width: 56px; height: 56px; margin-bottom: 12px; }
.login-logo h1 { font-size: 22px; color: var(--dark); margin-bottom: 4px; }
.login-logo p { font-size: 14px; color: var(--gray); }
.login-error { font-size: 13px; color: var(--danger); font-weight: 500; margin-bottom: 8px; min-height: 0; }
.login-error:empty { display: none; }
.login-link { text-align: center; margin-top: 20px; font-size: 14px; color: var(--gray); }
.login-link a { color: var(--primary); text-decoration: none; font-weight: 600; }
.login-link a:hover { text-decoration: underline; }
.reg-step-info { font-size: 14px; color: #374151; margin-bottom: 16px; text-align: center; }

/* Form Elements */
.form-group { margin-bottom: 16px; flex: 1; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px 12px; border: 1.5px solid var(--gray-light);
    border-radius: 8px; font-size: 14px; outline: none;
    transition: border-color 0.2s; font-family: inherit; background: var(--white);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,102,255,0.1);
}
.form-group input:disabled { background: #f3f4f6; color: var(--gray); cursor: not-allowed; }
.form-error { font-size: 13px; color: var(--danger); font-weight: 500; margin-top: 4px; }
.form-error:empty { display: none; }
.field-hint { font-size: 12px; color: var(--gray); margin-top: 4px; }

/* Dashboard Content */
.dashboard-content { max-width: 100%; margin: 0; padding: 20px 24px 32px; }

/* Data Table */
.table-wrapper {
    overflow-x: auto; background: var(--white);
    border-radius: 12px; border: 1px solid var(--gray-light);
}
.data-table { width: 100%; min-width: 800px; border-collapse: collapse; font-size: 13px; }
.data-table thead th {
    background: #d0e4ff; color: #000; font-weight: 600; font-size: 12px;
    text-transform: uppercase; letter-spacing: 0.5px; padding: 12px 14px;
    text-align: left; white-space: nowrap;
}
.data-table thead th:first-child { border-radius: 12px 0 0 0; }
.data-table thead th:last-child { border-radius: 0 12px 0 0; }
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:nth-child(even) { background: var(--row-alt); }
.data-table tbody tr:hover { background: #e0e7ff; }
.data-table tbody td {
    padding: 10px 14px; border-bottom: 1px solid #f0f0f0;
    max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.data-table .actions-cell { white-space: nowrap; }

/* Action Buttons */
.btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 6px; border: none;
    cursor: pointer; font-size: 13px; transition: background 0.2s;
}
.btn-icon-edit { background: rgba(0,102,255,0.1); color: var(--primary); }
.btn-icon-edit:hover { background: rgba(0,102,255,0.2); }
.btn-icon-delete { background: rgba(239,68,68,0.1); color: var(--danger); }
.btn-icon-delete:hover { background: rgba(239,68,68,0.2); }
.btn-icon-download { background: rgba(16,185,129,0.1); color: var(--success); }
.btn-icon-download:hover { background: rgba(16,185,129,0.2); }
.btn-icon-test { background: rgba(245,158,11,0.1); color: var(--warning); }
.btn-icon-test:hover { background: rgba(245,158,11,0.2); }

/* Status Badges */
.status-badge {
    display: inline-block; padding: 3px 10px; border-radius: 12px;
    font-size: 11px; font-weight: 600; text-transform: capitalize;
}
.status-connected { background: #d1fae5; color: #065f46; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-failed { background: #fee2e2; color: #991b1b; }
.status-partial { background: #ffedd5; color: #9a3412; }

/* Empty State */
.empty-state { padding: 48px 24px; text-align: center; color: var(--gray); font-size: 14px; }

/* Modal */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(10,14,39,0.6);
    display: flex; align-items: center; justify-content: center;
    z-index: 200; padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
    background: var(--white); border-radius: 16px; width: 100%; max-width: 480px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25); animation: modalIn 0.2s ease-out;
}
.modal-card-sm { max-width: 400px; }
@keyframes modalIn {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0; }
.modal-header h2 { font-size: 18px; color: var(--dark); }
.modal-close { background: none; border: none; font-size: 24px; color: var(--gray); cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--dark); }
.modal-body { padding: 20px 24px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 0 24px 20px; }

/* Loading Overlay */
.loading-overlay {
    position: fixed; inset: 0; background: rgba(255,255,255,0.7);
    display: flex; align-items: center; justify-content: center; z-index: 300;
}
.loading-overlay[hidden] { display: none; }
.loading-spinner {
    width: 44px; height: 44px; border: 4px solid var(--gray-light);
    border-top-color: var(--primary); border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Notification Banner */
.notification {
    position: fixed; top: 20px; right: 20px; padding: 12px 20px;
    border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--white);
    z-index: 400; box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    animation: notifIn 0.25s ease-out; max-width: 380px;
}
.notification[hidden] { display: none; }
.notification-success { background: var(--success); }
.notification-error { background: var(--danger); }
.notification-warning { background: #b45309; }
@keyframes notifIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .login-card { padding: 28px 20px; }
    .dashboard-header { padding: 0 16px; }
    .dashboard-content { padding: 16px 16px 32px; }
    .tab-toolbar { flex-wrap: wrap; gap: 12px; }
    .modal-card { margin: 12px; }
    .data-table { font-size: 12px; }
    .data-table thead th { padding: 10px 10px; font-size: 11px; }
    .data-table tbody td { padding: 8px 10px; }
}

/* ============================================================
   Setup Wizard
   ============================================================ */
.modal-card-wizard { max-width: 640px; max-height: 85vh; display: flex; flex-direction: column; }
.modal-card-wizard .modal-body { overflow-y: auto; flex: 1; }

.wizard-progress {
    display: flex; gap: 8px; margin-bottom: 24px;
    border-bottom: 2px solid var(--gray-light); padding-bottom: 16px;
}
.wizard-step-indicator {
    flex: 1; text-align: center; font-size: 12px; font-weight: 600;
    color: var(--gray); padding: 8px 4px; border-radius: 8px;
    transition: all 0.2s;
}
.wizard-step-indicator span {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 50%; background: var(--gray-light);
    color: var(--gray); font-size: 12px; font-weight: 700; margin-right: 6px;
}
.wizard-step-indicator.active { color: var(--primary); }
.wizard-step-indicator.active span { background: var(--primary); color: var(--white); }
.wizard-step-indicator.done { color: var(--success); }
.wizard-step-indicator.done span { background: var(--success); color: var(--white); }

.wizard-step-content { animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.wizard-icon { font-size: 40px; text-align: center; margin-bottom: 12px; }
.wizard-step-content h3 { font-size: 18px; color: var(--dark); margin-bottom: 12px; text-align: center; }
.wizard-step-content p { font-size: 14px; color: #555; line-height: 1.6; margin-bottom: 16px; }

.wizard-info-box {
    background: #f0f7ff; border: 1px solid #cce0ff; border-radius: 10px;
    padding: 16px; margin-bottom: 16px; font-size: 13px;
}
.wizard-info-box p { margin-bottom: 6px; color: #333; }
.wizard-info-box code { background: #e0e7ff; padding: 2px 6px; border-radius: 4px; font-size: 12px; }

.wizard-instructions {
    margin: 0 0 16px 0; padding-left: 22px; font-size: 13px; line-height: 1.9; color: #444;
}
.wizard-instructions li { margin-bottom: 4px; }
.wizard-instructions strong { color: #0a0e27; }
.wizard-instructions a { color: var(--primary); text-decoration: none; }
.wizard-instructions a:hover { text-decoration: underline; }
.wizard-instructions code { background: #f0f0f0; padding: 1px 5px; border-radius: 3px; font-size: 12px; }

.wizard-note {
    text-align: center; font-size: 12px; color: var(--gray); margin-top: 12px; font-style: italic;
}

.wizard-test-result {
    padding: 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; font-weight: 500;
}
.wizard-test-result.test-success { background: #d1fae5; color: #065f46; border: 1px solid #10b981; }
.wizard-test-result.test-failed { background: #fee2e2; color: #991b1b; border: 1px solid #ef4444; }
.wizard-test-result.test-partial { background: #ffedd5; color: #9a3412; border: 1px solid #f97316; }

/* Extra variables for member portal */
:root {
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --row-alt: #f0f4ff;
}

/* Nav active highlight for member portal */
.nav-active {
    color: var(--primary) !important;
    position: relative;
}

/* ============================================================
   Member Tabs
   ============================================================ */
.member-tabs {
    display: flex; gap: 0; margin-bottom: 0;
    border-bottom: none; padding-bottom: 0;
}
.member-tab {
    padding: 14px 32px; font-size: 16px; font-weight: 600;
    color: var(--gray); background: #f0f4f8; border: 1px solid var(--gray-light);
    border-bottom: none; cursor: pointer;
    border-radius: 8px 8px 0 0; margin-right: -1px;
    transition: color 0.2s, background 0.2s;
}
.member-tab:hover { color: var(--primary); background: #e8eef6; }
.member-tab.active { color: var(--primary); background: var(--white); border-bottom: 2px solid var(--white); position: relative; z-index: 1; }

.member-tab-content {
    border: 1px solid var(--gray-light); border-radius: 0 8px 8px 8px;
    background: var(--white); min-height: 500px;
}
#ai-tab.member-tab-content {
    min-height: 0; height: calc(100vh - 160px); display: flex; flex-direction: column;
}
#ai-tab .lab-container {
    flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}

/* Tab toolbar inside tab content */
.tab-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; flex-wrap: wrap; gap: 12px; padding: 20px 20px 0;
}
.tab-toolbar h2 { font-size: 22px; color: var(--dark, #0a0e27); margin: 0; }

/* Table wrapper inside tab */
.member-tab-content .table-wrapper { margin: 0 20px 20px; }

/* ============================================================
   Lab Area
   ============================================================ */
.lab-container {
    display: flex; flex-direction: column; flex: 1; min-height: 0;
    background: var(--white); border-radius: 12px; border: 1px solid var(--gray-light);
    overflow: hidden;
}
.lab-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--gray-light); background: #f8fafc;
}
.lab-header h2 { font-size: 20px; color: var(--dark); margin: 0; }
.lab-account-selector { display: flex; align-items: center; gap: 8px; }
.lab-account-selector label { font-size: 15px; font-weight: 600; color: #374151; }
.lab-account-selector select {
    padding: 6px 12px; border: 1.5px solid var(--gray-light); border-radius: 6px;
    font-size: 15px; outline: none; min-width: 280px;
}
.lab-account-selector select:focus { border-color: var(--primary); }

.lab-chat {
    flex: 1; overflow-y: auto; padding: 20px; padding-bottom: 100px; background: #0d1117;
    font-family: 'Consolas', 'Courier New', monospace; font-size: 15px;
    min-height: 0;
}
.lab-welcome { text-align: left; padding: 20px; color: #8b949e; }
.lab-welcome-icon { font-size: 48px; margin-bottom: 12px; }
.lab-welcome h3 { color: #c9d1d9; font-size: 22px; margin-bottom: 8px; }
.lab-welcome p { font-size: 15px; line-height: 1.6; max-width: 100%; margin: 0 0 20px; }
.lab-examples { text-align: left; max-width: 100%; margin: 0; }
.lab-examples p { margin-bottom: 8px; color: #c9d1d9; }
.lab-examples code {
    display: block; background: #161b22; border: 1px solid #30363d; border-radius: 6px;
    padding: 10px 14px; margin-bottom: 6px; font-size: 14px; color: #58a6ff;
    cursor: pointer; transition: background 0.2s;
}
.lab-examples code:hover { background: #1c2128; }

.lab-message { margin-bottom: 16px; }
.lab-msg-command {
    color: #58a6ff; padding: 8px 0; font-weight: 600;
}
.lab-msg-command::before { content: '$ '; color: #7ee787; }
.lab-msg-output {
    background: #161b22; border: 1px solid #30363d; border-radius: 6px;
    padding: 12px; color: #c9d1d9; white-space: pre-wrap; word-wrap: break-word;
    max-height: 400px; overflow-y: auto; line-height: 1.6;
}
.lab-msg-error { color: #f85149; }
.lab-msg-info { color: #8b949e; font-style: italic; padding: 4px 0; }

/* ============================================================
   AI Feedback Widget
   ============================================================ */
.ai-feedback-widget { user-select: none; }
.ai-fb-btn { transition: background 0.2s, border-color 0.2s; }
.ai-fb-btn:hover:not(:disabled) { background: #30363d !important; }
.ai-fb-btn:disabled { opacity: 0.7; cursor: default; }
.ai-fb-correction-input:focus { border-color: #58a6ff !important; outline: none; }

.lab-input-area {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    padding: 12px 20px; border-top: 1px solid #30363d; background: #161b22;
}
.lab-input-row { display: flex; align-items: center; gap: 8px; }
.lab-prompt { color: #7ee787; font-family: 'Consolas', monospace; font-size: 14px; font-weight: 700; }
.lab-command-input {
    flex: 1; background: #0d1117; border: 1px solid #30363d; border-radius: 6px;
    padding: 10px 12px; color: #c9d1d9; font-family: 'Consolas', monospace; font-size: 15px;
    outline: none;
}
.lab-command-input:focus { border-color: #58a6ff; }
.lab-command-input::placeholder { color: #484f58; }
.lab-hint { font-size: 11px; color: #484f58; margin-top: 6px; text-align: center; }


/* Act Tab â€” Left Navigation */
.act-nav-btn{display:flex;align-items:center;gap:8px;width:100%;padding:10px 16px;border:none;background:none;color:#6b7280;font-size:0.9em;font-weight:500;cursor:pointer;text-align:left;border-left:3px solid transparent;transition:all .15s;}
.act-nav-btn:hover{background:#f3f4f6;color:#1f2937;}
.act-nav-btn.active{background:#eef2ff;color:#4f46e5;border-left-color:#6366f1;font-weight:600;}
#act-tab .member-tab-content, #act-tab [id^="act-section-"] { max-width: 100%; overflow-x: auto; box-sizing: border-box; }
@media(max-width:768px){
  #act-nav{width:60px !important;}
  .act-nav-btn span:last-child{display:none;}
}


/* FinOps Settings â€” Configure Tab */
.finops-checklist-item{transition:border-color .15s;}
.finops-checklist-item:hover{border-color:#484f58 !important;}
.finops-fix-btn{background:linear-gradient(135deg,#6366f1,#4f46e5);border:none;color:#fff;border-radius:6px;padding:6px 14px;cursor:pointer;font-weight:600;transition:opacity .15s;}
.finops-fix-btn:hover{opacity:0.85;}
.finops-fix-btn:disabled{opacity:0.5;cursor:not-allowed;}
#finops-score-bar .score-progress{transition:width 0.5s ease;}

/* ============================================================
   Commitment Savings Explorer Styles
   ============================================================ */

/* Explorer Container */
.cse-explorer {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}
.cse-explorer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.cse-explorer-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: #1f2937;
    font-size: 1em;
}
.cse-explorer-title .cse-icon { font-size: 1.3em; }

/* Dropdowns Row */
.cse-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    align-items: flex-end;
}
.cse-control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cse-control-group label {
    font-size: 0.75em;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.cse-control-group select {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.85em;
    background: #fff;
    color: #1f2937;
    min-width: 140px;
    cursor: pointer;
}
.cse-control-group select:focus {
    border-color: #6366f1;
    outline: none;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.1);
}
.cse-control-group select:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

/* Savings Card */
.cse-savings-card {
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border: 1px solid #86efac;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 16px;
}
.cse-savings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.cse-savings-metric {
    text-align: center;
}
.cse-savings-metric .cse-metric-label {
    font-size: 0.72em;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 2px;
}
.cse-savings-metric .cse-metric-value {
    font-size: 1.2em;
    font-weight: 700;
    color: #059669;
}
.cse-savings-metric .cse-metric-value.cse-neutral {
    color: #374151;
}
.cse-savings-metric .cse-metric-value.cse-warning {
    color: #d97706;
}

/* Badge */
.cse-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 0.7em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.cse-badge-best {
    background: #d1fae5;
    color: #065f46;
}
.cse-badge-tco {
    background: #dbeafe;
    color: #1e40af;
}

/* Not Available Message */
.cse-not-available {
    text-align: center;
    padding: 24px;
    color: #6b7280;
    font-size: 0.9em;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px dashed #d1d5db;
}

/* Compare All Toggle */
.cse-compare-toggle {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.8em;
    color: #6366f1;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.cse-compare-toggle:hover {
    background: #eef2ff;
    border-color: #6366f1;
}

/* Compare Table */
.cse-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8em;
    margin-top: 12px;
}
.cse-compare-table thead th {
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    background: #f8fafc;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
}
.cse-compare-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.1s;
}
.cse-compare-table tbody tr:hover {
    background: #f9fafb;
}
.cse-compare-table tbody td {
    padding: 8px 10px;
}
.cse-compare-table .cse-row-best-savings {
    background: #f0fdf4 !important;
    border-left: 3px solid #10b981;
}
.cse-compare-table .cse-row-lowest-cost {
    background: #eff6ff !important;
    border-left: 3px solid #3b82f6;
}

/* Standard vs Convertible Note */
.cse-note {
    font-size: 0.8em;
    color: #6b7280;
    font-style: italic;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 6px;
    margin-top: 8px;
}

/* Dashboard Coverage Widgets */
.cse-widget-progress {
    background: #e5e7eb;
    border-radius: 4px;
    height: 8px;
    margin-top: 4px;
    overflow: hidden;
}
.cse-widget-progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}
.cse-widget-metric-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.cse-widget-label {
    font-size: 0.8em;
    color: #6b7280;
}
.cse-widget-value {
    font-size: 1em;
    font-weight: 700;
}
.cse-widget-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.8em;
    color: #6366f1;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
}
.cse-widget-link:hover {
    text-decoration: underline;
}
.cse-widget-empty {
    text-align: center;
    padding: 16px;
    color: #6b7280;
    font-size: 0.85em;
}
.cse-underutilized-badge {
    display: inline-block;
    background: #fee2e2;
    color: #991b1b;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 0.72em;
    font-weight: 700;
    margin-left: 6px;
}



/* ============================================================
   Free Tier Tracker Styles
   ============================================================ */
.cse-ft-summary {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 0.82em;
    color: #374151;
    margin-bottom: 16px;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 6px;
}
.cse-ft-sep {
    color: #d1d5db;
}
.cse-ft-benefits {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}
.cse-ft-benefit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}
.cse-ft-benefit-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 180px;
}
.cse-ft-service {
    font-size: 0.75em;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.cse-ft-desc {
    font-size: 0.82em;
    color: #374151;
}
.cse-ft-benefit-usage {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}
.cse-ft-progress {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    min-width: 80px;
}
.cse-ft-progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}
.cse-ft-bar-green { background: #10b981; }
.cse-ft-bar-amber { background: #f59e0b; }
.cse-ft-bar-red { background: #ef4444; }
.cse-ft-usage-text {
    font-size: 0.75em;
    color: #6b7280;
    white-space: nowrap;
    min-width: 90px;
}
.cse-ft-badge {
    font-size: 0.7em;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
    white-space: nowrap;
}
.cse-ft-badge-warning {
    background: #fef3c7;
    color: #92400e;
}
.cse-ft-badge-danger {
    background: #fee2e2;
    color: #991b1b;
}
.cse-ft-opportunities {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 12px 16px;
}
.cse-ft-opportunities-header {
    font-weight: 600;
    color: #065f46;
    font-size: 0.88em;
    margin-bottom: 6px;
}
.cse-ft-opportunities-note {
    font-size: 0.8em;
    color: #047857;
    margin-bottom: 10px;
}
.cse-ft-opportunity-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 0.82em;
}
.cse-ft-limit {
    margin-left: auto;
    font-size: 0.85em;
    color: #059669;
    font-weight: 600;
}

@media (max-width: 600px) {
    .cse-ft-benefit-row {
        flex-direction: column;
        align-items: stretch;
    }
    .cse-ft-benefit-usage {
        flex-wrap: wrap;
    }
}

/* Free Tier Alternative Callout */
.cse-ft-callout {
    background: #eff6ff;
    border: 1px solid #93c5fd;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 10px;
}
.cse-ft-callout-header {
    font-weight: 600;
    color: #1e40af;
    font-size: 0.88em;
    margin-bottom: 6px;
}
.cse-ft-callout-body {
    font-size: 0.82em;
    color: #374151;
}
.cse-ft-callout-comparison {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}
.cse-ft-callout-detail {
    margin-bottom: 6px;
    color: #6b7280;
}
.cse-ft-callout-expiry {
    color: #d97706;
    font-size: 0.9em;
    margin-bottom: 6px;
}
.cse-ft-callout-caveat {
    color: #6b7280;
    font-style: italic;
    font-size: 0.9em;
    margin-bottom: 6px;
}
.cse-ft-callout-disclaimer {
    color: #6b7280;
    font-style: italic;
    font-size: 0.85em;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #bfdbfe;
}

/* ============================================================
   Invoice Explorer Tab Styles
   ============================================================ */

/* Summary Cards */
.inv-summary-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 20px;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.inv-summary-card:hover {
    border-color: #6366f1;
    box-shadow: 0 2px 8px rgba(99,102,241,0.08);
}
.inv-card-label {
    font-size: 0.75em;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
    font-weight: 600;
}
.inv-card-value {
    font-size: 1.4em;
    font-weight: 700;
    color: #1f2937;
}
.inv-card-value.inv-positive { color: #ef4444; }
.inv-card-value.inv-negative { color: #10b981; }

/* Filter Bar */
.inv-filter-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.inv-filter-group label {
    font-size: 0.72em;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.inv-filter-group input:focus,
.inv-filter-group select:focus {
    border-color: #6366f1;
    outline: none;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.1);
}

/* Sortable Table Headers */
.inv-sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}
.inv-sortable:hover {
    color: #6366f1;
}
.inv-sortable.inv-sort-active {
    color: #4f46e5;
    font-weight: 700;
}

/* Skeleton loader for invoice cards */
.inv-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: inv-shimmer 1.5s infinite;
    border-radius: 6px;
    height: 1.4em;
    width: 60%;
    margin: 0 auto;
}
@keyframes inv-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #inv-summary-cards {
        grid-template-columns: 1fr !important;
    }
    #inv-filter-bar {
        flex-direction: column;
        align-items: stretch !important;
    }
    .inv-filter-group {
        width: 100%;
    }
    .inv-filter-group input,
    .inv-filter-group select {
        width: 100%;
    }
}


/* ============================================================
   Invoice Drilldown â€” Hierarchical 3-Level Drill-Down
   ============================================================ */

/* Drilldown table base */
.dd-table { font-size: 13px; }
.dd-table thead th { cursor: default; }

/* Chevron column */
.dd-chevron {
    width: 30px;
    text-align: center;
    cursor: pointer;
    user-select: none;
    font-size: 12px;
    color: #6b7280;
    transition: color 0.15s;
}
.dd-invoice-row:hover .dd-chevron,
.dd-service-row:hover .dd-chevron {
    color: #4f46e5;
}

/* Invoice rows (Level 1) */
.dd-invoice-row {
    cursor: pointer;
    transition: background 0.15s;
}
.dd-invoice-row:hover {
    background: #eef2ff !important;
}
.dd-invoice-row.dd-expanded {
    background: #f0f4ff;
    font-weight: 600;
}

/* Service rows (Level 2 â€” indented 24px) */
.dd-services-area {
    padding: 8px 0 8px 24px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}
.dd-service-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.dd-service-table thead th {
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.dd-service-row {
    cursor: pointer;
    transition: background 0.15s;
}
.dd-service-row:hover {
    background: #e0e7ff !important;
}
.dd-service-row.dd-expanded {
    background: #eef2ff;
}
.dd-service-row td {
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
}

/* Resource rows (Level 3 â€” indented 48px) */
.dd-resources-area {
    padding: 8px 0 8px 48px;
    background: #fefefe;
    border-top: 1px solid #f0f0f0;
}
.dd-resource-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.dd-resource-table thead th {
    padding: 6px 10px;
    text-align: left;
    font-weight: 600;
    color: #6b7280;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.dd-resource-row td {
    padding: 8px 10px;
    border-bottom: 1px solid #f5f5f5;
}

/* Subtable shared */
.dd-subtable {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 4px;
}

/* Payment status badges */
.dd-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}
.dd-status-paid {
    background: #d1fae5;
    color: #065f46;
}
.dd-status-pending {
    background: #fef3c7;
    color: #92400e;
}
.dd-status-overdue {
    background: #fee2e2;
    color: #991b1b;
}

/* Resource type badge */
.dd-resource-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Consolas', 'Courier New', monospace;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

/* Savings tip in resource table */
.dd-savings-tip {
    display: inline;
    font-size: 12px;
    color: #059669;
    font-weight: 500;
    line-height: 1.4;
}
.dd-tip-cell {
    max-width: 260px;
    line-height: 1.5;
}
.dd-chat-link {
    display: inline-block;
    margin-top: 2px;
    font-size: 11px;
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}
.dd-chat-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}
.dd-no-tip {
    color: #9ca3af;
    font-size: 12px;
}

/* Resource ID in monospace */
.dd-resource-id {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 12px;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    color: #374151;
}

/* AI explanation info box */
.dd-ai-box {
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
    border-radius: 0 6px 6px 0;
    padding: 10px 14px;
    margin: 4px 10px 8px 10px;
    font-size: 12px;
    color: #1e40af;
    line-height: 1.5;
}
.dd-ai-row td {
    padding: 0 !important;
    border-bottom: none !important;
}

/* Percentage bar */
.dd-pct-bar {
    display: inline-block;
    width: 80px;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    vertical-align: middle;
    margin-right: 6px;
}
.dd-pct-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #818cf8);
    border-radius: 3px;
    transition: width 0.3s ease;
}
.dd-pct-label {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
}

/* Cost explanation text */
.dd-explanation {
    color: #6b7280;
    font-size: 12px;
    max-width: 280px;
    white-space: pre-line;
}

/* Inline loading spinner */
.dd-inline-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    color: #6b7280;
    font-size: 13px;
}
.dd-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* Inline error */
.dd-inline-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    margin: 4px 0;
    font-size: 12px;
    color: #991b1b;
}

/* Inline info */
.dd-inline-info {
    padding: 10px 16px;
    color: #6b7280;
    font-size: 12px;
    font-style: italic;
}

/* Inline warning */
.dd-inline-warning {
    padding: 8px 16px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    margin-top: 8px;
    font-size: 12px;
    color: #92400e;
}

/* Sortable headers */
.dd-sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}
.dd-sortable:hover {
    color: #6366f1;
}

/* Pagination styling */
#dd-pagination {
    border-top: 1px solid #e5e7eb;
    margin-top: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .dd-services-area {
        padding-left: 12px;
    }
    .dd-resources-area {
        padding-left: 24px;
    }
    .dd-pct-bar {
        width: 50px;
    }
    .dd-explanation {
        max-width: 160px;
    }
    .dd-ai-box {
        margin: 4px 4px 8px 4px;
    }
}


/* ============================================================
   Observe Tab â€” Left Navigation & Responsive Layout
   ============================================================ */

/* Observe Nav Panel */
#observe-nav {
    width: 180px;
    min-width: 180px;
    border-right: 1px solid #e5e7eb;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Observe Widget Grid â€” responsive auto-fit grid */
.observe-widget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 16px;
    padding: 16px;
    width: 100%;
    box-sizing: border-box;
}

/* Single-column fallback when content area is narrower than 380px */
@container (max-width: 380px) {
    .observe-widget-grid {
        grid-template-columns: 1fr;
    }
}

/* Fallback for browsers without container queries */
@supports not (container-type: inline-size) {
    .observe-widget-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr));
    }
}

/* Responsive: collapse observe nav on small viewports */
@media (max-width: 768px) {
    #observe-nav {
        width: 60px !important;
        min-width: 60px;
    }
    #observe-nav .act-nav-btn span:last-child {
        display: none;
    }
    .observe-widget-grid {
        grid-template-columns: 1fr;
        padding: 12px;
        gap: 12px;
    }
}



/* ============================================================
   SQL Platform Comparator
   ============================================================ */

.sql-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.sql-compare-table th {
    background: #f9fafb;
    color: #374151;
    font-weight: 600;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
}

.sql-compare-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.sql-compare-table tbody tr:hover {
    background: #f9fafb;
}

.sql-cheapest-badge {
    display: inline-block;
    background: #d1fae5;
    color: #065f46;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.95em;
    border: 1px solid #6ee7b7;
}

.sql-savings-positive {
    font-size: 0.8em;
    color: #059669;
    font-weight: 600;
}

.sql-savings-negative {
    font-size: 0.8em;
    color: #dc2626;
    font-weight: 600;
}

.sql-migrate-btn {
    margin-top: 4px;
    padding: 3px 10px;
    font-size: 0.8em;
    font-weight: 600;
    color: #fff;
    background: #6366f1;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.sql-migrate-btn:hover {
    background: #4f46e5;
}

.sql-plan-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.sql-plan-step {
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}

.sql-plan-step:last-child {
    border-bottom: none;
}

.sql-complexity-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 100px;
    font-size: 0.75em;
    font-weight: 700;
    letter-spacing: 0.03em;
}

/* ============================================================
   Cost By Service Widget
   ============================================================ */

/* Loading indicator */
.cost-by-service-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 280px;
    color: #6b7280;
    font-size: 0.9em;
    gap: 8px;
}
.cost-by-service-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 3px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* Empty state message */
.cost-by-service-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 280px;
    color: #6b7280;
    font-size: 0.9em;
    text-align: center;
    padding: 24px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px dashed #d1d5db;
}

/* Granularity toggle active state (supplement for btn-outline btn-sm) */
#dash-cost-by-service .btn-outline.active,
#dash-cost-by-service .btn-outline[aria-pressed="true"] {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
}
#dash-cost-by-service .btn-outline.active:hover,
#dash-cost-by-service .btn-outline[aria-pressed="true"]:hover {
    background: #4f46e5;
    border-color: #4f46e5;
}

/* Responsive: ensure widget respects 380px minimum */
#dash-cost-by-service {
    min-width: 380px;
}

@media (max-width: 480px) {
    #dash-cost-by-service {
        min-width: 100%;
    }
    .cost-by-service-loading,
    .cost-by-service-empty {
        height: 200px;
    }
}
