/* ============================================
   Rate Transparency Dashboard - Design System
   ============================================ */

:root {
    --navy: #0D1D51;
    --navy-light: #1a2d6b;
    --purple: #5E2A84;
    --teal: #00696E;
    --red-benchmark: #C0392B;
    --bg-light: #F7F9FC;
    --bg-white: #FFFFFF;
    --alt-row: #E8EEF6;
    --border: #A0B0C8;
    --border-light: #D0D9E8;
    --text-dark: #1E2124;
    --text-muted: #5A6A7A;
    --text-white: #FFFFFF;
    --shadow: 0 2px 8px rgba(13, 29, 81, 0.08);
    --shadow-lg: 0 4px 16px rgba(13, 29, 81, 0.12);
    --radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Inter, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.5;
    min-height: 100vh;
}

/* ---- Top Navigation ---- */
.top-nav {
    background: var(--navy);
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 1100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

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

.nav-logo-img {
    height: 28px;
    filter: invert(1) brightness(2);
}

.nav-title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-user {
    font-size: 14px;
    opacity: 0.9;
}

.nav-link {
    color: var(--text-white);
    text-decoration: none;
    font-size: 14px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.nav-link:hover {
    opacity: 1;
}

.nav-logout-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

/* ---- Page Layout ---- */
.page-layout {
    display: flex;
    max-width: 1440px;
    margin: 0 auto;
    min-height: calc(100vh - 56px - 130px - 40px);
}

/* ---- Ad Sidebar ---- */
.ad-sidebar {
    width: 192px;
    padding: 20px 16px;
    flex-shrink: 0;
}

.ad-slot {
    display: flex;
    justify-content: center;
}

.ad-placeholder {
    background: #f0f0f0;
    border: 2px dashed #ccc;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #999;
}

.ad-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.ad-size {
    font-size: 12px;
}

/* ---- Main Content ---- */
.main-content {
    flex: 1;
    padding: 24px 24px 24px 0;
    min-width: 0;
}

/* ---- Filter Bar ---- */
.filter-bar {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.filter-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.filter-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.filter-group {
    flex: 1;
}

.filter-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.filter-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-light);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-dark);
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235A6A7A' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--navy);
}

.filter-group select:disabled {
    background-color: #f5f5f5;
    color: #aaa;
    cursor: not-allowed;
}

.filter-group-wide {
    flex: 1 1 100%;
}

.filter-arrow {
    font-size: 20px;
    color: var(--border);
    padding-bottom: 10px;
    flex-shrink: 0;
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-muted);
}

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

.empty-state h3 {
    font-size: 18px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    max-width: 400px;
    margin: 0 auto;
}

/* ---- Loading ---- */
.loading-container {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-light);
    border-top-color: var(--navy);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- Summary Bar ---- */
.summary-bar {
    background: var(--navy);
    color: var(--text-white);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.summary-item {
    text-align: center;
    flex: 1 1 auto;
    min-width: 0;
}

.summary-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.7;
    margin-bottom: 2px;
}

.summary-value {
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.summary-value.highlight {
    color: #4FC3F7;
}

/* ---- Chart Card ---- */
.chart-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 32px;
}

/* ---- In-Content Ad (full width) ---- */
.ad-inline-full {
    width: 100%;
    margin-bottom: 24px;
}

.ad-placeholder-wide {
    width: 100%;
    height: 100px;
    background: #f0f0f0;
    border: 2px dashed #ccc;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #999;
}

/* ---- Table Cards ---- */
.table-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 24px;
    margin-bottom: 24px;
    overflow-x: auto;
}

.table-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 8px;
}

.decile-totals {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.decile-totals strong {
    color: var(--text-dark);
}

/* ---- Decile Table ---- */
.decile-table,
.peer-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.decile-table th,
.peer-table th {
    background: var(--navy);
    color: var(--text-white);
    padding: 10px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}

.decile-table th:first-child,
.peer-table th:first-child {
    border-radius: 6px 0 0 0;
}

.decile-table th:last-child,
.peer-table th:last-child {
    border-radius: 0 6px 0 0;
}

.decile-table td,
.peer-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-light);
}

.decile-table tr:nth-child(even),
.peer-table tr:nth-child(even) {
    background: var(--alt-row);
}

.decile-table tr:hover,
.peer-table tr:hover {
    background: #dce5f2;
}

.peer-table tr.selected-row {
    background: #ede0f5;
    font-weight: 600;
}

.peer-table tr.selected-row:hover {
    background: #e0d0ed;
}

.position-marker {
    display: inline-block;
    background: var(--purple);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.position-empty {
    color: var(--border);
}

.proximity-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.proximity-badge.zip {
    background: #E0F2F1;
    color: var(--teal);
}

.proximity-badge.nearby {
    background: #E8EEF6;
    color: var(--navy);
}

/* ---- Bottom Banner Ad ---- */
.ad-banner-container {
    display: flex;
    justify-content: center;
    padding: 20px 0;
    background: var(--bg-light);
}

/* ---- Footer ---- */
.site-footer {
    background: var(--navy);
    color: var(--text-white);
    text-align: center;
    padding: 12px 24px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.site-footer a {
    color: var(--text-white);
    text-decoration: none;
    opacity: 0.8;
}

.site-footer a:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer-logo-img {
    height: 20px;
    filter: invert(1) brightness(2);
}

/* ---- Pricing Cards ---- */
.pricing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.pricing-card {
    background: white;
    border-radius: 12px;
    padding: 32px 28px;
    position: relative;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}

.pricing-card-featured {
    border: 3px solid #4FC3F7;
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #4FC3F7;
    color: var(--navy);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 16px;
    border-radius: 20px;
    white-space: nowrap;
}

.pricing-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.pricing-amount {
    font-size: 48px;
    font-weight: 800;
    color: var(--navy);
    line-height: 1;
}

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

.pricing-monthly {
    font-size: 13px;
    color: var(--teal);
    font-weight: 600;
    margin-top: 4px;
    margin-bottom: 24px;
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 28px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pricing-features li {
    font-size: 14px;
    color: var(--text-dark);
    padding-left: 20px;
    position: relative;
}

.pricing-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--teal);
    font-weight: 700;
}

.btn-plan {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-plan-outline {
    background: white;
    color: var(--navy);
    border: 2px solid var(--navy);
}

.btn-plan-outline:hover {
    background: var(--navy);
    color: white;
}

.btn-plan-primary {
    background: var(--navy);
    color: white;
    border: 2px solid var(--navy);
}

.btn-plan-primary:hover {
    background: var(--navy-light);
    border-color: var(--navy-light);
}

@media (max-width: 600px) {
    .pricing-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- Subscribe Page ---- */
.subscribe-section {
    background: white;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}

.subscribe-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* Specialty grid */
.specialty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.specialty-card {
    display: block;
    cursor: pointer;
    border-radius: 8px;
    border: 2px solid var(--border-light);
    background: var(--bg-light);
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    user-select: none;
}

.specialty-card:hover {
    border-color: #4FC3F7;
    background: #EEF8FD;
    box-shadow: 0 2px 8px rgba(79,195,247,0.2);
}

.specialty-card input[type=checkbox] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.specialty-card:has(input:checked) {
    border-color: #0288D1;
    background: #E1F4FD;
    box-shadow: 0 2px 10px rgba(2,136,209,0.2);
}

.specialty-card-inner {
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    position: relative;
}

.specialty-check-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: transparent;
    transition: all 0.15s;
    flex-shrink: 0;
    background: white;
}

.specialty-card:has(input:checked) .specialty-check-icon {
    background: #0288D1;
    border-color: #0288D1;
    color: white;
    font-weight: 700;
}

.specialty-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.3;
}

.specialty-card-disabled {
    border-radius: 8px;
    border: 2px solid var(--border-light);
    background: #F4F6FA;
    cursor: default;
}

.specialty-card-disabled .specialty-name {
    color: var(--text-muted);
}

.coming-soon-badge {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: var(--border-light);
    border-radius: 4px;
    padding: 2px 7px;
}

/* Plan toggle */
.plan-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.plan-toggle-btn {
    position: relative;
    padding: 16px 20px;
    border-radius: 8px;
    border: 2px solid var(--border-light);
    background: var(--bg-light);
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.15s;
    font-family: inherit;
}

.plan-toggle-btn:hover {
    border-color: #4FC3F7;
    background: #EEF8FD;
    color: var(--navy);
}

.plan-toggle-btn-active {
    border-color: #0288D1 !important;
    background: #E1F4FD !important;
    color: var(--navy) !important;
    box-shadow: 0 2px 10px rgba(2,136,209,0.15);
}

.plan-toggle-sub {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
}

.plan-toggle-btn-active .plan-toggle-sub {
    color: var(--teal);
}

.plan-toggle-badge {
    position: absolute;
    top: -10px;
    right: 14px;
    background: var(--teal);
    color: white;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 10px;
    border-radius: 10px;
}

/* Price summary */
.price-summary {
    margin-top: 20px;
    background: var(--navy);
    border-radius: 10px;
    padding: 18px 22px;
    box-shadow: 0 4px 16px rgba(13,29,81,0.25);
}

.price-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: rgba(255,255,255,0.85);
    font-size: 15px;
}

.price-summary-amount {
    font-size: 24px;
    font-weight: 800;
    color: #4FC3F7;
    white-space: nowrap;
}

/* Subscribe button */
.btn-subscribe {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 15px;
    background: #0288D1;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    font-family: inherit;
    box-shadow: 0 4px 14px rgba(2,136,209,0.4);
}

.btn-subscribe:hover {
    background: #0277BD;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(2,136,209,0.5);
}

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

@media (max-width: 600px) {
    .specialty-grid {
        grid-template-columns: 1fr 1fr;
    }
    .plan-toggle {
        grid-template-columns: 1fr;
    }
}

/* ---- Auth Forms (Login & Register) ---- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
    text-align: left;
}

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

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-hint {
    font-weight: 400;
    color: var(--text-muted);
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-light);
    border-radius: 6px;
    font-size: 15px;
    color: var(--text-dark);
    background: white;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--navy);
}

.form-input::placeholder {
    color: #bbb;
}

.form-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border-top: 1px solid var(--border-light);
    padding-top: 16px;
    margin-top: 4px;
}

.form-error-banner {
    background: #fdecea;
    border: 1px solid #f5c6cb;
    color: #7c1f1f;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    text-align: left;
    margin-top: 12px;
}

.form-success-banner {
    background: #e8f5e9;
    border: 1px solid #81c784;
    color: #1b5e20;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    text-align: left;
    margin-top: 12px;
    margin-bottom: 4px;
}

.form-field-error {
    font-size: 12px;
    color: #c0392b;
    margin-top: 2px;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--navy);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

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

.btn-secondary {
    padding: 10px 16px;
    background: white;
    color: var(--navy);
    border: 2px solid var(--navy);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: inherit;
    flex-shrink: 0;
}

.btn-secondary:hover {
    background: var(--navy);
    color: white;
}

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

.npi-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.npi-row .form-input {
    flex: 1;
}

.npi-result {
    background: #e8f5e9;
    border: 1px solid #81c784;
    color: #2e7d32;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.5;
    margin-top: 4px;
}

.npi-check {
    font-size: 15px;
    margin-right: 4px;
}

.npi-specialty {
    opacity: 0.8;
    font-size: 12px;
}

.disclaimer-box {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 14px 16px;
    font-size: 12px;
    color: var(--text-muted);
    max-height: 180px;
    overflow-y: auto;
    line-height: 1.6;
    text-align: left;
}

.disclaimer-box p {
    margin-bottom: 10px;
}

.disclaimer-box p:last-child {
    margin-bottom: 0;
}

.disclaimer-standalone {
    font-size: 14px;
    color: var(--text-dark);
    line-height: 1.8;
}

.disclaimer-standalone p {
    margin-bottom: 16px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--text-dark);
    cursor: pointer;
    text-align: left;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--navy);
}

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

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

/* ---- Login Page ---- */
.login-body {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 50%, var(--teal) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 24px;
}

.login-card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 48px 40px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    background: var(--navy);
    color: white;
    font-weight: 700;
    font-size: 28px;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.login-logo-img {
    height: 40px;
    margin-bottom: 24px;
}

.login-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-white);
    border: 2px solid var(--border-light);
    color: var(--text-dark);
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.login-btn:hover {
    border-color: var(--navy);
    box-shadow: var(--shadow);
}

.login-note {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 24px;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .ad-sidebar {
        display: none;
    }
    .main-content {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
    }
    .filter-arrow {
        display: none;
    }
    .summary-bar {
        flex-direction: column;
        text-align: center;
    }
}

/* ---- Tom Select Overrides ---- */
.ts-wrapper.single .ts-control {
    border: 2px solid var(--border-light);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    background: white;
    min-height: 42px;
}

.ts-wrapper.single .ts-control:focus,
.ts-wrapper.single.focus .ts-control {
    border-color: var(--navy);
    box-shadow: none;
}

.ts-dropdown {
    border: 2px solid var(--border-light);
    border-radius: 6px;
    margin-top: 2px;
    font-size: 14px;
}

.ts-dropdown .active {
    background: var(--alt-row);
    color: var(--text-dark);
}

.ts-wrapper.disabled .ts-control {
    background-color: #f5f5f5;
    opacity: 0.7;
}

.filter-group .ts-wrapper {
    width: 100%;
}

/* Tom Select — custom loading / no-results messages */
.ts-search-status {
    padding: 10px 14px;
    color: #888;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ts-search-status::before {
    content: '';
    display: inline-block;
    width: 13px;
    height: 13px;
    border: 2px solid #ddd;
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: ts-spin 0.65s linear infinite;
    flex-shrink: 0;
}
/* No-results rows don't get the spinner */
.ts-dropdown .no-results .ts-search-status::before,
.ts-dropdown [data-selectable] .ts-search-status::before {
    display: none;
}
@keyframes ts-spin { to { transform: rotate(360deg); } }

/* Hide Tom Select's own loading bar — we use our custom render instead */
.ts-wrapper.loading .ts-control::after { display: none !important; }

/* ── Zip Code Input ── */
.filter-group-zip {
    flex: 0 0 160px;
    min-width: 130px;
}

.zip-text-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-light);
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text-dark);
    background: white;
    letter-spacing: 0.12em;
    transition: border-color 0.2s;
}

.zip-text-input:focus {
    outline: none;
    border-color: var(--navy);
}

.zip-text-input:disabled {
    background: #f5f5f5;
    color: #aaa;
    cursor: not-allowed;
}

.zip-locality-label {
    font-size: 11px;
    margin-top: 5px;
    min-height: 16px;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zip-locality-label.found {
    color: var(--teal);
}

.zip-locality-label.error {
    color: var(--red-benchmark);
}

.filter-optional {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 11px;
}

/* ── Tab Bar ── */
.tab-bar {
    display: flex;
    gap: 2px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border-light);
}

.tab-btn {
    padding: 10px 22px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    border-radius: 4px 4px 0 0;
    transition: color 0.15s, border-color 0.15s;
    font-family: inherit;
}

.tab-btn:hover {
    color: var(--navy);
    background: var(--alt-row);
}

.tab-btn.tab-active {
    color: var(--navy);
    border-bottom-color: var(--purple);
}

/* ── Market Map Table ── */
.market-map-card {
    padding: 20px 0 20px 20px;  /* no right pad — scroll handles it */
}

.market-map-scroll {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 62vh;
    padding-right: 20px;
}

.market-map-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    min-width: 1050px;
}

.market-map-table thead th {
    background: var(--navy);
    color: white;
    padding: 9px 10px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 3;
}

.market-map-table thead th.mm-code { text-align: left; min-width: 70px; }
.market-map-table thead th.mm-desc { text-align: left; min-width: 200px; }
.market-map-table thead th.mm-num  { text-align: right; min-width: 56px; }
.market-map-table thead th.mm-rate { text-align: right; min-width: 64px; }
.market-map-table thead th.mm-p50  { background: #1a2d6b; }
.market-map-table thead th.mm-ref  { text-align: right; min-width: 80px; background: #3a1264; }
.market-map-table thead th.mm-pctl { text-align: center; min-width: 60px; background: #3a1264; }

.market-map-table tbody td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

.mm-code-cell  { text-align: left; font-weight: 600; }
.mm-desc-cell  { text-align: left; color: var(--text-muted); font-size: 11px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.mm-num-cell   { text-align: right; color: var(--text-muted); }
.mm-rate-cell  { text-align: right; color: var(--text-dark); }
.mm-p50-cell   { font-weight: 700; background: #f0f4ff; }
.mm-ref-cell   { text-align: right; background: #f5eeff; }
.mm-pctl-cell  { text-align: center; background: #f5eeff; }
.mm-na         { color: var(--border); }

.market-map-table tr.mm-even { background: var(--alt-row); }
.market-map-table tr.mm-even .mm-p50-cell { background: #e8edf8; }
.market-map-table tr.mm-even .mm-ref-cell,
.market-map-table tr.mm-even .mm-pctl-cell { background: #ede0f5; }

.market-map-table tr.mm-has-data .mm-ref-cell,
.market-map-table tr.mm-has-data .mm-pctl-cell { border-left: 3px solid var(--purple); }

.market-map-table tr:hover td { background: #dce5f2 !important; }

/* Code link button inside market map */
.mm-code-link {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-weight: 700;
    color: var(--navy);
    font-family: inherit;
    font-size: 12px;
    text-decoration: underline dotted;
    text-underline-offset: 2px;
}
.mm-code-link:hover { color: var(--purple); }

/* Percentile badges in market map */
.mm-pctl-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.mm-pctl-high { background: #d4edda; color: #1a5c2e; }
.mm-pctl-mid  { background: #fff3cd; color: #7a5a00; }
.mm-pctl-low  { background: #f8d7da; color: #7a1a1a; }

/* ── Specialty Bar ────────────────────────────────────────────────────────── */
.specialty-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    background: var(--navy);
    border-bottom: 2px solid rgba(255,255,255,0.08);
    flex-wrap: wrap;
}

.specialty-bar-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.5);
    flex-shrink: 0;
    margin-right: 4px;
}

.specialty-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.specialty-tab {
    padding: 5px 16px;
    border-radius: 20px;
    border: 1.5px solid rgba(255,255,255,0.25);
    background: transparent;
    color: rgba(255,255,255,0.70);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.specialty-tab:hover {
    background: rgba(255,255,255,0.10);
    color: white;
    border-color: rgba(255,255,255,0.5);
}

.specialty-tab-active {
    background: #654EA3;       /* GH Ultra Violet */
    border-color: #654EA3;
    color: white;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(101,78,163,0.45);
}

.specialty-none {
    font-size: 13px;
    color: rgba(255,255,255,0.50);
}

.specialty-none a {
    color: #FFC845;
    text-decoration: none;
    font-weight: 600;
}

/* ── Login page catalog strip ────────────────────────────────────────────── */
.catalog-strip {
    padding: 14px 20px;
    background: var(--bg-white);
    border-top: 1px solid #e0e6f0;
    flex-shrink: 0;
}

.catalog-strip-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.catalog-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.catalog-card {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 9px 14px;
    min-width: 180px;
}

.catalog-card-specialty {
    font-size: 12px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 3px;
}

.catalog-card-payers {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.catalog-card-updated {
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.75;
}
.mm-pctl-na   { background: #e9ecef; color: #888; }
