:root {
    --primary: #1B3A57;
    --secondary: #D97D54;
    --bg-light: #F8FAFC;
    --white: #FFFFFF;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-600: #475569;
    --success: #059669;
    --warning: #D97706;
    --danger: #DC2626;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    margin: 0;
    color: #1E293B;
}

/* Header */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 20px 48px;
    /* Increased padding */
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1600px;
    margin: 0 auto;
}

.header h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Console Trigger - Aesthetic Fix */
.btn-console-trigger {
    background: linear-gradient(135deg, #1B3A57 0%, #0F172A 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 13px;
    border: none;
    box-shadow: 0 4px 6px rgba(27, 58, 87, 0.2);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-console-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(27, 58, 87, 0.3);
}

/* Status Dot */
.status-online {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--success);
    background: #ECFDF5;
    padding: 4px 12px;
    border-radius: 100px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: #c66d44;
}

.btn-secondary {
    background: white;
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
}

.btn-secondary:hover {
    background: var(--gray-100);
    color: var(--primary);
}

/* Main Layout */
.main {
    max-width: 1600px;
    margin: 40px auto;
    padding: 0 48px;
    /* Increased horizontal padding */
}

/* Controls & Tabs */
.controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.tabs {
    display: flex;
    gap: 8px;
    background: var(--gray-100);
    padding: 4px;
    border-radius: 10px;
}

.tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--gray-600);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border-radius: 8px;
}

.tab.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 8px;
    padding: 8px 12px;
    /* width/height controlled by inline style for layout */
}

.search-box input {
    border: none;
    outline: none;
    width: 100%;
    margin-left: 8px;
    font-size: 14px;
    background: transparent;
    color: #F8FAFC;
}

.search-box input::placeholder {
    color: #94A3B8;
}

.search-box input:focus {
    outline: none;
}

.search-clear-btn {
    display: none;
    background: none;
    border: none;
    color: #94A3B8;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 16px;
    line-height: 1;
    border-radius: 4px;
}

.search-clear-btn:hover {
    color: #E2E8F0;
}

.search-shortcut-badge {
    display: none;
    margin: 0 6px;
    padding: 2px 5px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    color: #CBD5E1;
    font-size: 9px;
    font-weight: 700;
    pointer-events: none;
}

/* Result highlight */
.search-highlight {
    background: rgba(251, 191, 36, 0.3);
    border-radius: 2px;
    padding: 0 1px;
}

.search-results-header {
    margin-bottom: 12px;
    padding: 0 4px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
}

.search-results-section {
    margin-bottom: 16px;
}

.search-results-section-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94A3B8;
    padding: 4px 4px 8px;
    border-bottom: 1px solid #E2E8F0;
    margin-bottom: 8px;
}

/* Screen reader only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    padding: 28px;
    /* Increased internal padding */
    border-radius: 16px;
    /* Softer radius */
    border: 1px solid var(--gray-200);
}

.stat-card.hot {
    border-left: 4px solid var(--danger);
}

.stat-card.new {
    border-left: 4px solid var(--primary);
}

.stat-card .label {
    color: var(--gray-600);
    font-size: 14px;
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
}

/* Lead Cards */
.leads-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
}

.lead-card {
    background: white;
    border-radius: 16px;
    /* Softer radius */
    border: 1px solid var(--gray-200);
    padding: 28px;
    /* Increased padding */
    transition: transform 0.2s, box-shadow 0.2s;
}

.lead-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.lead-card.hot {
    border-top: 4px solid var(--secondary);
}

.lead-card.warm {
    border-top: 4px solid var(--primary);
}

.lead-card.cool {
    border-top: 4px solid var(--gray-200);
}

.lead-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.lead-title h3 {
    margin: 0;
    font-size: 18px;
    color: var(--primary);
}

.lead-title .meta {
    font-size: 12px;
    color: var(--gray-600);
    margin-top: 4px;
}

.lead-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
    text-transform: uppercase;
}

.badge.hot {
    background: #FEF2F2;
    color: var(--danger);
}

.badge.cool {
    background: #F1F5F9;
    color: var(--gray-600);
}

.badge.new {
    background: #ECFDF5;
    color: var(--success);
}

.badge.type-wl {
    background: #EEF2FF;
    color: #4F46E5;
}

.badge.type-dys {
    background: #FFF7ED;
    color: #C2410C;
}

.lead-info {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    gap: 8px;
    font-size: 13px;
}

.info-item .label {
    color: var(--gray-600);
    font-size: 11px;
}

.info-item .value {
    font-weight: 500;
}

.action-area {
    background: var(--gray-100);
    margin: 0 -24px -24px;
    padding: 16px 24px;
    border-radius: 0 0 12px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.action-label {
    font-size: 11px;
    color: var(--gray-600);
    text-transform: uppercase;
}

.action-status {
    font-size: 13px;
    font-weight: 600;
}

.btn-action {
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    padding: 6px 12px;
}

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

.btn-action.secondary {
    background: white;
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1000;
    backdrop-filter: blur(4px);
    padding: 20px;
}

.modal-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    margin-top: 6px;
    margin-bottom: 20px;
    transition: border 0.2s;
}

.modal-input:focus {
    border-color: var(--secondary);
    outline: none;
}

.modal-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
}

.modal-btn-primary {
    width: 100%;
    background: var(--secondary);
    color: white;
    padding: 14px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(217, 125, 84, 0.3);
    transition: all 0.2s;
}

.modal-btn-primary:hover {
    transform: translateY(-2px);
    background: #c26a45;
}

.modal-overlay.active {
    display: flex;
}

/* Z-Index Overrides for Modals to ensure popups overlay parent modals */
#systemModal {
    z-index: 99999 !important;
}
#dailyCloseModal {
    z-index: 99999 !important;
}
#quickAddDocModal {
    z-index: 30000 !important;
}
#outcomePromptModal {
    z-index: 25000 !important;
}

.modal {
    background: white;
    width: 600px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    max-height: 90vh;
}

/* CRITICAL: Lead Action Modal Sizing */
#actionModal .modal {
    width: 98%;
    max-width: 1800px;
    height: 95vh;
}

.modal.full-screen {
    width: 98%;
    height: 95vh;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: #F1F5F9;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--gray-600);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

.modal-close:hover {
    background: #E2E8F0;
    color: var(--primary);
    transform: rotate(90deg);
}

/* Split Body (Action Modal) */
.split-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    box-sizing: border-box;
}

.left-pane {
    flex: 0 0 55%;
    width: 55%;
    padding: 24px;
    overflow-y: auto;
    border-right: 1px solid var(--gray-200);
    background: #FFFFFF;
    box-sizing: border-box;
}

.right-pane {
    flex: 0 0 45%;
    width: 45%;
    padding: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    background: #F8FAFC;
}

/* Tab bar and buttons styles */
.modal-tab-bar {
    display: flex;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 20px;
    background: #F1F5F9;
    border-radius: 12px;
    padding: 4px;
    box-sizing: border-box;
}

.modal-tab-btn {
    flex: 1;
    padding: 10px 14px;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    color: #64748B;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-tab-btn:hover {
    background: #E2E8F0;
    color: #475569;
}

.modal-tab-btn.active {
    background: #FFFFFF;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    color: #0D9488 !important;
}

/* Two-column layout grid for profile fields */
.profile-grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 1024px) {
    .profile-grid-layout {
        grid-template-columns: 1fr;
    }
}

/* Details Section */
.details-section {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02), 0 2px 4px -1px rgba(0,0,0,0.02);
}

.details-section h3 {
    margin-top: 0;
    font-size: 16px;
    color: var(--primary);
    border-bottom: 1px solid var(--gray-100);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
}

.detail-label {
    color: var(--gray-600);
}

.detail-value {
    font-weight: 500;
    text-align: right;
}

/* Edit Mode */
.editable .edit-input {
    display: none;
}

.editable.editing .detail-value-text {
    display: none;
}

.editable.editing .edit-input {
    display: block;
    width: 100%;
    padding: 4px;
    font-size: 13px;
}

/* AI Pilot */
.pilot-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.pilot-history {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: #F8FAFC;
}

.chat-bubble {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    max-width: 80%;
}

.chat-bubble.ai {
    background: white;
    border: 1px solid var(--gray-200);
    align-self: flex-start;
}

.chat-bubble.user {
    background: #E0F2FE;
    color: #0369A1;
    align-self: flex-end;
    margin-left: auto;
}

.chat-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 4px;
    color: var(--gray-600);
}

.suggested-script-box {
    background: #FFF7ED;
    border-top: 1px solid #FED7AA;
    border-bottom: 1px solid #FED7AA;
    padding: 20px;
    position: relative;
}

.script-text {
    font-family: monospace;
    font-size: 14px;
    color: #9A3412;
    white-space: pre-wrap;
}

.script-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
}

.script-btn-mini {
    font-size: 11px;
    padding: 4px 8px;
    border: 1px solid #FDBA74;
    background: white;
    cursor: pointer;
    border-radius: 4px;
}

.reaction-board {
    padding: 20px;
    background: white;
}

.reaction-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-600);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.quick-responses {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.reaction-btn {
    padding: 8px 12px;
    border: 1px solid var(--gray-200);
    background: white;
    border-radius: 100px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.reaction-btn:hover {
    background: var(--gray-100);
    border-color: var(--primary);
}

.custom-input-wrapper {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.custom-input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
}

.outcome-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.outcome-btn {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    background: white;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.outcome-btn:hover {
    background: var(--gray-100);
}

.outcome-btn.success {
    border-color: var(--success);
    color: var(--success);
}

.outcome-btn.warning {
    border-color: var(--warning);
    color: var(--warning);
}

.outcome-btn.danger {
    border-color: var(--danger);
    color: var(--danger);
}

/* --- FINANCE MODULE SPECIFIC STYLES --- */
.finance-dashboard-wrapper {
    padding: 24px;
}

/* Modified Grid for 3 Columns: PC, MSO, Controls */
.owner-split-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

.clinical-card,
.business-card,
.control-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
}

.card-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gray-200);
}

.pc-header {
    background: #ECFDF5;
    color: #065F46;
}

.mso-header {
    background: #F8FAFC;
    color: #1E293B;
}

.control-header {
    background: #FFF7ED;
    color: #9A3412;
}

.card-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.cash-badge {
    background: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.card-body {
    padding: 24px;
    flex: 1;
}

.line-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
}

.line-item .value {
    font-weight: 600;
}

.line-item .value.income {
    color: var(--success);
}

.line-item .value.expense {
    color: var(--danger);
}

.line-item .value.final {
    font-size: 18px;
    color: var(--primary);
    font-weight: 800;
}

/* Danger & Warning Text Utilities */
.text-danger {
    color: #DC2626;
    font-weight: 700;
}

.text-warning {
    color: #D97706;
    font-weight: 600;
}

.text-subtle {
    color: #64748B;
    font-size: 12px;
}

/* Tax Wallet Box */
.tax-wallet-box {
    background: #1E293B;
    color: #F8FAFC;
    padding: 16px;
    border-radius: 8px;
    margin-top: 16px;
    border: 1px solid #334155;
}

.tax-wallet-box h4 {
    margin: 0 0 8px 0;
    font-size: 12px;
    text-transform: uppercase;
    color: #94A3B8;
}

.tax-wallet-value {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.tax-deadline {
    font-size: 11px;
    color: #CBD5E1;
}

/* AR / Danger Zone Box */
.ar-box {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

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

.ar-label {
    font-size: 11px;
    color: #7F1D1D;
    font-weight: 700;
    text-transform: uppercase;
}

.ar-value {
    font-size: 16px;
    font-weight: 700;
    color: #991B1B;
}

.divider {
    height: 1px;
    background: var(--gray-200);
    margin: 16px 0;
}

.sweep-alert {
    margin-top: 24px;
    padding: 12px;
    background: #FFF7ED;
    border: 1px solid #FED7AA;
    border-radius: 8px;
}

.btn-sweep {
    background: var(--warning);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    margin-top: 8px;
}

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

/* Transaction Log */
.tx-log-container {
    margin-top: 40px;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    padding: 24px;
}

.finance-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.finance-table th {
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid var(--gray-200);
    color: var(--gray-600);
    font-size: 13px;
}

.finance-table td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
}

/* Transaction Chips */
.chip {
    padding: 4px 8px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.chip.md {
    background: #E0F2FE;
    color: #0369A1;
}

.chip.pt {
    background: #DCFCE7;
    color: #166534;
}

.chip.prod {
    background: #FEF3C7;
    color: #92400E;
}

.chip.admin {
    background: #F1F5F9;
    color: #475569;
}

.chip.diagnostics {
    background: #F5F3FF;
    color: #5B21B6;
}

.chip.procedure {
    background: #FFF1F2;
    color: #9F1239;
}

/* Transaction Card */
.transaction-card {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 12px;
    background: white;
}

.tx-header {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    margin-bottom: 4px;
}

.tx-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.tx-status-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
}

.tx-status-badge.paid {
    background: #DCFCE7;
    color: #166534;
}

.tx-status-badge.unpaid {
    background: #FEE2E2;
    color: #991B1B;
}

.tx-progress-container {
    height: 6px;
    background: var(--gray-100);
    border-radius: 100px;
    overflow: hidden;
    margin-top: 8px;
}

.tx-progress-fill {
    height: 100%;
    background: var(--primary);
}

.tx-progress-fill.warning {
    background: var(--warning);
}

.tx-progress-fill.complete {
    background: var(--success);
}

/* Note Bubble Modern Stylings */
.note-bubble {
    position: relative;
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 10px;
    font-size: 13px;
    line-height: 1.5;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-left: 4px solid #94A3B8;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.note-bubble:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
}

.note-meta {
    font-size: 10px;
    font-weight: 700;
    color: #64748B;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Categorized Types */
.note-bubble.system {
    background: #FFF5F5;
    border-color: #FEE2E2;
    border-left-color: #EF4444;
}
.note-bubble.system .note-meta { color: #B91C1C; }

.note-bubble.patient {
    background: #F0FDF4;
    border-color: #DCFCE7;
    border-left-color: #10B981;
}
.note-bubble.patient .note-meta { color: #047857; }

.note-bubble.finance {
    background: #FFFDF0;
    border-color: #FEF9C3;
    border-left-color: #D97706;
}
.note-bubble.finance .note-meta { color: #B45309; }

.note-bubble.call {
    background: #F0F9FF;
    border-color: #E0F2FE;
    border-left-color: #0EA5E9;
}
.note-bubble.call .note-meta { color: #0369A1; }

.note-bubble.manual {
    background: #F8FAFC;
    border-color: #E2E8F0;
    border-left-color: #4F46E5;
}
.note-bubble.manual .note-meta { color: #4338CA; }

/* Pinned State */
.note-bubble.pinned {
    background: #FFFBEB;
    border-color: #FDE68A;
    border-left-color: #F59E0B;
    border-width: 1.5px;
    box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.08);
}
.note-bubble.pinned::after {
    content: "📌 PINNED";
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 8px;
    font-weight: 900;
    color: #D97706;
    background: #FEF3C7;
    padding: 2px 6px;
    border-radius: 100px;
    letter-spacing: 0.5px;
}

/* Pinned Alert Container */
.pinned-notes-container {
    background: #FFFDF5;
    border: 1px dashed #FCD34D;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
    display: none; /* Injected dynamically */
}
.pinned-notes-title {
    font-size: 11px;
    font-weight: 800;
    color: #B45309;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Floating Actions inside note */
.note-bubble .note-actions {
    position: absolute;
    bottom: 8px;
    right: 12px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.note-bubble:hover .note-actions {
    opacity: 1;
}

.note-action-btn {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    color: #64748B;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.note-action-btn:hover {
    color: #1E293B;
    border-color: #CBD5E1;
    background: #F8FAFC;
    transform: scale(1.05);
}

.note-action-btn.delete:hover {
    color: #EF4444;
    border-color: #FCA5A5;
    background: #FEF2F2;
}

.note-action-btn.pin:hover {
    color: #F59E0B;
    border-color: #FDE68A;
    background: #FFFBEB;
}

/* Notes Textarea & Input */
.add-note-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 10px;
}

.note-input-container {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    width: 100%;
}

.add-note-box textarea {
    flex: 1;
    min-height: 48px;
    max-height: 180px;
    padding: 10px 12px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    font-family: inherit;
    resize: none;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.add-note-box textarea:focus {
    border-color: #6366F1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

/* Voice Mic Button styling */
.mic-btn {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.mic-btn:hover {
    background: #F8FAFC;
    border-color: #CBD5E1;
}

.mic-btn.active {
    background: #FEF2F2;
    border-color: #FCA5A5;
    color: #EF4444;
    animation: pulse-mic 1.5s infinite alternate;
}

@keyframes pulse-mic {
    0% {
        box-shadow: 0 0 0 0px rgba(239, 68, 68, 0.4);
    }
    100% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
        transform: scale(1.03);
    }
}

/* Presets & Chips */
.preset-chips-container {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 2px 4px;
}

.preset-chip {
    font-size: 10px;
    font-weight: 700;
    color: #475569;
    background: white;
    border: 1px solid #E2E8F0;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-chip:hover {
    background: #F1F5F9;
    color: #1E293B;
    border-color: #CBD5E1;
}

/* Note Search & Filters bar */
.notes-filter-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 10px;
}

.notes-search-wrapper {
    position: relative;
    width: 100%;
}

.notes-search-input {
    width: 100%;
    padding: 6px 10px 6px 28px;
    font-size: 11px;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    outline: none;
    background: white;
    box-sizing: border-box;
}

.notes-search-input:focus {
    border-color: #6366F1;
}

.notes-search-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #94A3B8;
}

.notes-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.notes-tabs::-webkit-scrollbar { display: none; }

.notes-tab {
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #E2E8F0;
    background: white;
    cursor: pointer;
    font-weight: 600;
    color: #64748B;
    white-space: nowrap;
    transition: all 0.2s;
}

.notes-tab:hover {
    background: #F1F5F9;
    color: #475569;
}

.notes-tab.active {
    background: #EEF2FF;
    border-color: #C7D2FE;
    color: #4F46E5;
    font-weight: 700;
}

/* Slack-style Reactions */
.note-reactions-container {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #E2E8F0;
    flex-wrap: wrap;
    align-items: center;
}

.reaction-pill {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 100px;
    padding: 3px 8px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #475569;
    font-weight: 700;
}

.reaction-pill:hover {
    background: #EEF2FF;
    border-color: #C7D2FE;
    color: #4F46E5;
    transform: scale(1.05);
}

.reaction-pill.active {
    background: #EEF2FF;
    border-color: #C7D2FE;
    color: #4F46E5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.quick-reaction-triggers {
    display: flex;
    gap: 6px;
    margin-left: auto;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 20px;
    padding: 2px 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.quick-react-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    padding: 2px;
    transition: transform 0.2s;
}

.quick-react-btn:hover {
    transform: scale(1.2) rotate(5deg);
}

/* Asana-style Mentions */
.mention-tag {
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    letter-spacing: 0.2px;
    display: inline-block;
}

.mention-tag.pt {
    background: #ECFDF5;
    color: #059669;
    border: 1px solid #A7F3D0;
}

.mention-tag.md {
    background: #EFF6FF;
    color: #2563EB;
    border: 1px solid #BFDBFE;
}

.mention-tag.admin {
    background: #FFF7ED;
    color: #EA580C;
    border: 1px solid #FFEDD5;
}


/* Loading Spinner */
.loading {
    display: flex;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top: 4px solid var(--secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Directory Module Styles */
.dir-split-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.dir-sidebar {
    width: 300px;
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    background: #FAFAFA;
}

.dir-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.tab-dir {
    background: none;
    border: 1px solid var(--gray-200);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--gray-600);
}

.tab-dir.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.dir-edit-btn { float: right; opacity: 0.5; cursor: pointer; padding: 0 4px; }
.dir-edit-btn:hover { opacity: 1; color: #D97D54; }

.dir-toast { position: fixed; bottom: 24px; right: 24px; background: #1E293B; color: white; padding: 12px 24px; border-radius: 8px; font-size: 13px; z-index: 9999; animation: dirToastIn .3s ease; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.dir-toast.out { animation: dirToastOut .3s ease forwards; }
@keyframes dirToastIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dirToastOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(20px); } }

.dir-loading, .dir-empty, .dir-error { padding: 40px; text-align: center; color: #94a3b8; font-size: 14px; }
.dir-loading::before { content: ''; display: inline-block; width: 20px; height: 20px; margin-right: 8px; border: 2px solid #e2e8f0; border-top-color: #D97D54; border-radius: 50%; animation: dirSpin .6s linear infinite; vertical-align: middle; }
@keyframes dirSpin { to { transform: rotate(360deg); } }
.dir-empty { color: #94a3b8; }
.dir-error { color: #ef4444; }

.dir-list-card {
    padding: 16px;
    border-bottom: 1px solid var(--gray-200);
    cursor: pointer;
}

.dir-list-card:hover {
    background: #F1F5F9;
}

.dir-list-card.active {
    background: #E0F2FE;
    border-left: 4px solid #0369A1;
}

.dir-dash-header {
    padding: 24px;
    border-bottom: 1px solid var(--gray-200);
    background: white;
}

.dir-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 16px;
}

.metric-card {
    background: #F8FAFC;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

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

.workload-table th {
    text-align: left;
    padding: 12px 24px;
    background: #F8FAFC;
    border-bottom: 1px solid var(--gray-200);
    font-size: 12px;
    color: var(--gray-600);
    text-transform: uppercase;
}

.workload-table td {
    padding: 12px 24px;
    border-bottom: 1px solid #F1F5F9;
    font-size: 14px;
}

/* Patient Roster Specifics */
.pm-modal {
    max-width: 1400px;
    height: 95vh;
    display: flex;
    flex-direction: column;
}

.pm-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    height: 100%;
    overflow: hidden;
}

.pm-sidebar {
    background: #F8FAFC;
    border-right: 1px solid var(--gray-200);
    padding: 20px;
    overflow-y: auto;
}

.pm-content {
    padding: 20px;
    overflow-y: auto;
    background: white;
}

.priority-item {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.priority-item.urgent {
    border-left: 4px solid var(--danger);
    background: #FEF2F2;
}

.priority-action {
    background: var(--primary);
    color: white;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
}

.roster-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 0.5fr 1fr;
    padding: 12px;
    border-bottom: 1px solid var(--gray-100);
    align-items: center;
}

.roster-row.status-red {
    border-left: 4px solid var(--danger);
    background: #FEF2F2;
}

.roster-row.status-yellow {
    border-left: 4px solid var(--warning);
    background: #FFFBEB;
}

.roster-row.status-green {
    border-left: 4px solid var(--success);
}

.star {
    color: #CBD5E1;
    cursor: pointer;
    font-size: 18px;
}

.star.filled {
    color: #F59E0B;
}

/* Morning Briefing Widget */
.morning-briefing-wrapper {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    padding: 20px;
    margin-bottom: 24px;
}

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

.briefing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.briefing-card {
    padding: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.briefing-card.danger {
    background: #FEF2F2;
    border: 1px solid #FECACA;
}

.briefing-card.warning {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
}

.briefing-card.success {
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
}

.b-icon {
    font-size: 24px;
}

.b-value {
    font-size: 20px;
    font-weight: 800;
}

.b-label {
    font-size: 12px;
    color: var(--gray-600);
}

/* Session Table */
.session-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.session-table th {
    text-align: left;
    padding: 8px;
    background: #F8FAFC;
    color: #64748B;
    font-weight: 600;
}

.session-table td {
    border-bottom: 1px solid #F1F5F9;
    padding: 8px;
    vertical-align: middle;
}

/* Filter Buttons */
.filter-group {
    display: flex;
    gap: 4px;
    background: var(--gray-100);
    padding: 4px;
    border-radius: 8px;
}

.filter-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    border-radius: 6px;
}

.filter-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.filter-btn.hot.active {
    color: var(--danger);
}

/* FIX: Modal Input Styling */
.modal-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    margin-top: 6px;
    margin-bottom: 0px;
    transition: all 0.2s;
    background: #F8FAFC;
    color: #334155;
    font-family: inherit;
    box-sizing: border-box;
    /* Crucial for width: 100% */
}

.modal-input:focus {
    border-color: var(--secondary);
    background: white;
    box-shadow: 0 0 0 3px rgba(217, 125, 84, 0.1);
    outline: none;
}

/* Custom Select Styling */
select.modal-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748B'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.modal-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 4px;
    display: block;
}

/* Premium Glowing social actions */
.pancake-btn-glow {
    background: linear-gradient(135deg, #0084FF, #00C6FF) !important;
    color: white !important;
    border: none !important;
    font-weight: 700 !important;
    box-shadow: 0 0 12px rgba(0, 132, 255, 0.4) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    overflow: hidden;
}

.pancake-btn-glow:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 0 20px rgba(0, 132, 255, 0.7) !important;
    filter: brightness(1.1) !important;
}

.pancake-btn-glow:active {
    transform: translateY(1px) !important;
    box-shadow: 0 0 8px rgba(0, 132, 255, 0.5) !important;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0, 132, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 22px rgba(0, 132, 255, 0.8);
    }
}

.pancake-btn-glow {
    animation: pulse-glow 2.5s infinite ease-in-out !important;
}
.dir-fullpage{display:flex;flex-direction:column;height:100%;background:#F1F5F9}.dir-fp-header{display:flex;justify-content:space-between;align-items:center;padding:16px 24px;background:white;border-bottom:1px solid #E2E8F0}.dir-charts-container{padding:0 24px 24px}.dir-chart-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.dir-chart-card{background:white;border-radius:12px;padding:20px;box-shadow:0 1px 3px rgba(0,0,0,0.1)}@media(max-width:800px){.dir-chart-grid{grid-template-columns:1fr}}.dir-loading::after{content:"";display:inline-block;width:16px;height:16px;border:2px solid #E2E8F0;border-top-color:#D97D54;border-radius:50%;animation:dirSpin .6s linear infinite;margin-left:8px;vertical-align:middle}@keyframes dirSpin{to{transform:rotate(360deg)}}