/**
 * UrgentCare Admin – Premium Dark/Gold Theme
 * Mirrors the ClientFirst AI design system for a consistent look.
 */

/* ===== BASE ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--surface-base);
    color: var(--text-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-container {
    min-height: 100vh;
    background: var(--surface-base);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--surface-base);
}

::-webkit-scrollbar-thumb {
    background: var(--gold-dark);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold-primary);
}

/* ===== LAYOUT WRAPPER ===== */
#wrapper {
    display: flex;
    min-height: 100vh;
    background: var(--surface-base);
}

/* ===== SIDEBAR ===== */
#sidebar-wrapper {
    width: 260px;
    min-height: 100vh;
    background: var(--surface-card);
    border-right: 1px solid var(--border-card) !important;
    transition: margin 0.3s ease-out;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-heading {
    padding: 22px 24px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--gold-primary) !important;
    background: var(--surface-card) !important;
    border-bottom: 1px solid var(--border-card) !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-heading i {
    color: var(--gold-primary) !important;
    font-size: 16px;
}

/* Sidebar nav items */
.list-group {
    flex: 1;
    padding: 12px 0;
}

.list-group-item,
.list-group-item-action {
    background: transparent !important;
    border: none !important;
    color: var(--text-muted) !important;
    padding: 12px 24px !important;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    position: relative;
    border-radius: 0 !important;
}

.list-group-item i {
    font-size: 15px;
    width: 18px;
    text-align: center;
}

.list-group-item-action:hover {
    background: var(--gold-bg-subtle) !important;
    color: var(--gold-primary) !important;
}

.list-group-item.active-link,
.list-group-item-action.active-link {
    background: var(--gold-bg-subtle) !important;
    color: var(--gold-primary) !important;
    font-weight: 600;
    border-right: 3px solid var(--gold-primary) !important;
}

.list-group-item.text-danger,
.list-group-item-action.text-danger {
    color: #ef4444 !important;
    border-top: 1px solid var(--border-card) !important;
    margin-top: auto;
}

.list-group-item.text-danger:hover,
.list-group-item-action.text-danger:hover {
    background: rgba(239, 68, 68, 0.08) !important;
    color: #ef4444 !important;
}

/* ===== TOP NAVBAR ===== */
#page-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.navbar {
    /* background: var(--surface-card) !important; */
    border-bottom: 1px solid var(--border-card) !important;
    padding: 12px 24px !important;
    box-shadow: none !important;
}

.navbar .btn-light,
#sidebarToggle {
    background: var(--surface-hover) !important;
    border: 1px solid var(--border-card) !important;
    color: var(--text-secondary) !important;
    border-radius: 8px;
    padding: 6px 12px;
}

#sidebarToggle:hover {
    background: var(--gold-bg-subtle) !important;
    border-color: var(--gold-border) !important;
    color: var(--gold-primary) !important;
}

.navbar .dropdown-toggle {
    color: var(--text-secondary) !important;
    font-size: 14px;
    font-weight: 500;
}

.navbar .dropdown-toggle:hover {
    color: var(--gold-primary) !important;
}

.dropdown-menu {
    background: var(--surface-elevated) !important;
    border: 1px solid var(--border-card) !important;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.dropdown-item {
    color: var(--text-secondary) !important;
    font-size: 14px;
    padding: 10px 16px;
}

.dropdown-item:hover {
    background: var(--gold-bg-subtle) !important;
    color: var(--gold-primary) !important;
}

/* Theme toggle button in navbar */
.theme-toggle-btn {
    background: var(--surface-hover);
    border: 1px solid var(--border-card);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 12px;
}

.theme-toggle-btn:hover {
    background: var(--gold-bg-subtle);
    border-color: var(--gold-border);
    color: var(--gold-primary);
}

/* ===== MAIN CONTENT AREA ===== */
.container-fluid {
    background: var(--surface-base);
    padding: 28px 32px !important;
}
.lp-lead-detail { padding: 20px; }
.lp-lead-detail-header { margin-bottom: 20px; }
.lp-lead-detail-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--lp-border-light, rgba(255,255,255,0.12));
    padding-bottom: 0;
}
.lp-lead-tab {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--lp-text-muted, #9ca3af);
    background: transparent;
    border: 0;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}
.lp-lead-tab:hover { color: var(--lp-text, #fff); }
.lp-lead-tab.active {
    color: var(--lp-accent);
    border-bottom-color: var(--lp-accent);
}
.lp-lead-tab-panel { min-height: 200px; }
.lp-lead-case-docs { padding-top: 8px; }
.lp-lead-chat-panel { padding-top: 8px; }
.lp-lead-chat-panel .lawyer-chat-card.lp-embed {
    border: 1px solid var(--lp-border-panel, rgba(255,255,255,0.1));
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 80vh;
}
.lp-lead-chat-panel .lawyer-chat-status {
    padding: 10px 16px;
    font-size: 13px;
    color: var(--lp-text-muted);
    border-bottom: 1px solid var(--lp-border-light);
}
.lp-lead-chat-panel .lawyer-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}
.lp-lead-chat-panel .lawyer-chat-composer {
    padding: 12px 16px;
    border-top: 1px solid var(--lp-border-light);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.lp-lead-chat-panel .lawyer-chat-composer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.lp-lead-chat-panel .lawyer-chat-input {
    width: 100%;
    min-height: 60px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--lp-border-light);
    background: var(--lp-bg-input);
    color: #fff;
    font-size: 14px;
    resize: vertical;
}
.lp-lead-chat-panel .lawyer-chat-error-banner { padding: 12px 16px; color: #f87171; font-size: 13px; }
.lp-lead-chat-panel .lawyer-chat-empty { padding: 24px; text-align: center; color: var(--lp-text-muted); }
.lp-lead-chat-panel .lawyer-chat-msg-wrapper { margin-bottom: 12px; }
.lp-lead-chat-panel .lawyer-chat-msg-label { font-size: 11px; font-weight: 600; margin-bottom: 2px; }
.lp-lead-chat-panel .lawyer-chat-msg-body { margin: 0 0 4px; font-size: 14px; }
.lp-lead-chat-panel .lawyer-chat-msg-time { font-size: 11px; color: var(--lp-text-muted); }

.lp-btn-back { color: var(--lp-accent); text-decoration: none; font-size: 14px; display: inline-block; margin-bottom: 8px; }
.lp-btn-back:hover { text-decoration: underline; }
.lp-lead-detail-title { font-size: 1.5rem; font-weight: 700; color: var(--lp-text); margin: 0 0 16px 0; }
.lp-lead-detail-body { display: flex; flex-direction: column; gap: 20px; }
.lp-lead-detail-card { background: var(--lp-card-bg); border: 1px solid var(--lp-border-light); border-radius: 12px; padding: 20px; }
.lp-lead-detail-card-title { font-size: 1rem; font-weight: 600; color: var(--lp-text); margin: 0 0 12px 0; }
.lp-lead-detail-text { color: var(--lp-text-muted); margin: 0; white-space: pre-wrap; }
.lp-dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; }
.lp-dl dt { color: var(--lp-text-muted); font-weight: 500; }
.lp-dl dd { margin: 0; color: var(--lp-text); }
.lp-json-block { background: rgba(0,0,0,0.25); border-radius: 8px; padding: 12px; font-size: 12px; overflow-x: auto; margin: 12px 0 0 0; white-space: pre-wrap; word-break: break-all; color: var(--lp-text-muted); }
.lp-lead-detail-actions { margin-top: 8px; }
.lp-link { color: var(--lp-accent); text-decoration: none; }
.lp-link:hover { text-decoration: underline; }

/* ===== PAGE HEADINGS ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary) !important;
    font-family: 'Inter', sans-serif;
}

.fw-bold,
.fw-semibold {
    color: var(--text-primary) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-dark {
    color: var(--text-primary) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

/* ===== CARDS (scoped to admin #wrapper to avoid breaking patient dashboard cards) ===== */
#wrapper .card {
    background: var(--surface-card) !important;
    border: 1px solid var(--border-card) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-md) !important;
    transform: none !important;
    transition: box-shadow 0.2s ease, border-color 0.2s ease !important;
}

#wrapper .card:hover {
    transform: none !important;
    box-shadow: var(--shadow-lg) !important;
    border-color: var(--gold-border) !important;
    background: var(--surface-card) !important;
}

#wrapper .card::before {
    display: none;
}

#wrapper .card-header {
    background: var(--surface-card) !important;
    border-bottom: 1px solid var(--border-card) !important;
    color: var(--text-primary) !important;
}

#wrapper .card-footer {
    background: var(--surface-card) !important;
    border-top: 1px solid var(--border-card) !important;
    color: var(--text-muted) !important;
}

#wrapper .card-body {
    background: var(--surface-card) !important;
}

/* ===== TABLES ===== */
.table {
    color: var(--text-secondary) !important;
    border-color: var(--border-card) !important;
    margin-bottom: 0;
}

.table thead th,
.table .bg-light {
    background: var(--surface-elevated) !important;
    color: var(--text-muted) !important;
    border-bottom: 1px solid var(--border-card) !important;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px !important;
}

.table tbody tr {
    border-bottom: 1px solid var(--border-subtle) !important;
    transition: background 0.15s ease;
}

.table-hover tbody tr:hover {
    background: var(--surface-hover) !important;
    color: var(--text-primary) !important;
}

.table td {
    color: var(--text-secondary) !important;
    padding: 14px 16px !important;
    vertical-align: middle;
    border-color: var(--border-subtle) !important;
}

.table .fw-bold,
.table .fw-medium {
    color: var(--text-primary) !important;
}

.align-middle td {
    vertical-align: middle !important;
}

/* Nested branch sub-table */
.table-responsive.radius-12 {
    border-radius: var(--radius-md) !important;
    overflow: hidden;
}

/* Scoped to admin wrapper to avoid breaking patient views */
#wrapper .bg-white {
    background: var(--surface-card) !important;
}

#wrapper .bg-light {
    background: var(--surface-elevated) !important;
}

#wrapper .border {
    border-color: var(--border-card) !important;
}

#wrapper .border-bottom {
    border-bottom-color: var(--border-card) !important;
}

#qrPreviewModal .bg-white {
    background: var(--surface-card) !important;
}

#qrPreviewModal .bg-light {
    background: var(--surface-elevated) !important;
}

/* ===== BADGES ===== */
.badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.badge.bg-success {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #10b981 !important;
}

.badge.bg-warning {
    background: rgba(245, 200, 106, 0.15) !important;
    color: var(--gold-primary) !important;
}

.badge.bg-secondary {
    background: var(--surface-elevated) !important;
    color: var(--text-muted) !important;
}

.badge.bg-danger {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #ef4444 !important;
}

.badge.bg-primary {
    background: var(--gold-bg-subtle) !important;
    color: var(--gold-primary) !important;
}

.bg-primary.bg-opacity-10 {
    background: var(--gold-bg-subtle) !important;
}

/* ===== BUTTONS ===== */
.btn-primary {
    background: var(--primary-gradient) !important;
    border: none !important;
    color: var(--text-on-accent) !important;
    font-weight: 600;
    font-size: 14px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-gold);
    transition: all 0.2s ease;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-gradient-hover) !important;
    box-shadow: var(--shadow-gold-hover) !important;
    transform: translateY(-1px);
    color: var(--text-on-accent) !important;
}

.btn-primary:disabled {
    background: var(--surface-hover) !important;
    color: var(--text-disabled) !important;
    box-shadow: none !important;
    cursor: not-allowed;
}

.btn-outline-primary {
    border: 1.5px solid var(--gold-border) !important;
    color: var(--gold-primary) !important;
    background: transparent !important;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.btn-outline-primary:hover {
    background: var(--gold-bg-subtle) !important;
    border-color: var(--gold-primary) !important;
    color: var(--gold-primary) !important;
}

.btn-light {
    background: var(--surface-hover) !important;
    border: 1px solid var(--border-card) !important;
    color: var(--text-secondary) !important;
    border-radius: var(--radius-sm);
}

.btn-light:hover {
    background: var(--surface-elevated) !important;
    color: var(--text-primary) !important;
}

.btn-outline-secondary {
    border: 1px solid var(--border-card) !important;
    color: var(--text-muted) !important;
    background: transparent !important;
}

.btn-outline-secondary:hover {
    border-color: var(--gold-border) !important;
    color: var(--gold-primary) !important;
    background: var(--gold-bg-subtle) !important;
}

/* Icon action buttons */
.btn-sm.btn-light.text-primary {
    color: var(--gold-primary) !important;
}

.btn-sm.btn-light.text-success {
    color: #10b981 !important;
}

.btn-sm.btn-light.text-warning {
    color: #f59e0b !important;
}

.btn-sm.btn-light.text-danger {
    color: #ef4444 !important;
}

.btn-sm.btn-light.text-info {
    color: #3b82f6 !important;
}

.btn-outline-danger {
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #ef4444 !important;
    background: transparent !important;
}

.btn-outline-danger:hover {
    background: rgba(239, 68, 68, 0.1) !important;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    border: none !important;
    color: #fff !important;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.btn-success:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-close {
    filter: invert(1);
}

/* ===== FORMS ===== */
.form-control,
.form-select {
    background: var(--input-bg) !important;
    border: 1px solid var(--border-card) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-sm);
    font-size: 14px;
    padding: 13px 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    background: var(--input-bg-focus) !important;
    border-color: var(--gold-primary) !important;
    box-shadow: 0 0 0 3px var(--gold-glow) !important;
    color: var(--text-primary) !important;
    outline: none;
}

.form-control::placeholder {
    color: var(--input-placeholder) !important;
}

.form-control:disabled {
    background: var(--surface-elevated) !important;
    color: var(--text-disabled) !important;
}

.form-label {
    color: var(--text-secondary) !important;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
}

.form-check-input {
    background-color: var(--surface-hover) !important;
    border: 1px solid var(--border-card) !important;
}

.form-check-input:checked {
    background-color: var(--gold-primary) !important;
    border-color: var(--gold-primary) !important;
}

.form-check-label {
    color: var(--text-secondary) !important;
}

.input-group-text {
    background: var(--surface-hover) !important;
    border: 1px solid var(--border-card) !important;
    color: var(--text-muted) !important;
}

.input-group:focus-within .input-group-text {
    border-color: var(--gold-primary) !important;
    color: var(--gold-primary) !important;
}

/* Validation */
.is-invalid {
    border-color: #ef4444 !important;
}

.invalid-feedback {
    color: #ef4444;
    font-size: 12px;
}

.text-danger {
    color: #ef4444 !important;
}

/* ===== ALERTS ===== */
.alert {
    border-radius: var(--radius-sm);
    font-size: 14px;
    border-width: 1px;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    color: #93c5fd !important;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    color: #6ee7b7 !important;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #fca5a5 !important;
}

.alert-warning {
    background: rgba(245, 200, 106, 0.1) !important;
    border-color: rgba(245, 200, 106, 0.3) !important;
    color: var(--gold-light) !important;
}

/* ===== PAGINATION ===== */
.pagination .page-link {
    background: var(--surface-elevated) !important;
    border-color: var(--border-card) !important;
    color: var(--text-secondary) !important;
    font-size: 13px;
}

.pagination .page-link:hover {
    background: var(--gold-bg-subtle) !important;
    border-color: var(--gold-border) !important;
    color: var(--gold-primary) !important;
}

.pagination .page-item.active .page-link {
    background: var(--gold-primary) !important;
    border-color: var(--gold-primary) !important;
    color: var(--text-on-accent) !important;
}

.pagination .page-item.disabled .page-link {
    background: var(--surface-card) !important;
    color: var(--text-disabled) !important;
}

/* ===== SPINNER ===== */
.spinner-border.text-primary {
    color: var(--gold-primary) !important;
}

/* ===== SECTION HEADERS IN FORMS ===== */
h6.text-primary {
    color: var(--gold-primary) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.border-bottom {
    border-bottom-color: var(--border-card) !important;
}

/* ===== MODAL ===== */
.modal-content {
    background: var(--surface-card) !important;
    border: 1px solid var(--border-card) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-xl) !important;
}

.modal-header {
    border-bottom: 1px solid var(--border-card) !important;
    color: var(--text-primary) !important;
}

.modal-footer {
    border-top: 1px solid var(--border-card) !important;
}

.modal-backdrop {
    background: rgba(0, 0, 0, 0.7) !important;
}

/* ===== QR MODAL (scoped) ===== */
#qrPreviewModal .modal-content {
    background: var(--surface-card) !important;
    border-color: var(--border-card) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-xl) !important;
}

#qrPreviewModal .row>div:first-child {
    background: var(--gold-bg-subtle) !important;
    border-right: 1px solid var(--border-card) !important;
}

#qrPreviewModal .col-md-7 {
    background: var(--gold-bg-subtle) !important;
}

#qrPreviewModal .modal-header {
    border-bottom-color: var(--border-card) !important;
}

#qrPreviewModal h4,
#qrPreviewModal h5,
#qrPreviewModal h6 {
    color: var(--text-primary) !important;
}

#qrPreviewModal p {
    color: var(--text-muted) !important;
}

#qrPreviewModal .qr-preview-wrapper {
    background: var(--surface-elevated) !important;
    border: 1px solid var(--border-card) !important;
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow-md) !important;
}

#qrPreviewModal .qr-container {
    background: var(--surface-hover) !important;
    border-radius: 10px;
}

#qrPreviewModal .border-top {
    border-top-color: var(--border-card) !important;
}

#qrPreviewModal .rounded-circle {
    background: var(--gold-bg-subtle) !important;
    border: 1px solid var(--gold-border) !important;
    padding: 10px !important;
}

#qrPreviewModal .rounded-circle i {
    color: var(--gold-primary) !important;
    font-size: 20px;
}

/* ===== SIDEBAR TOGGLE ===== */
#wrapper.toggled #sidebar-wrapper {
    margin-left: -260px;
}

/* ===== ICON CIRCLE AVATARS ===== */
.rounded-circle.me-3 {
    background: var(--gold-bg-subtle) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.rounded-circle.me-3 i {
    color: var(--gold-primary) !important;
}

/* ===== STATS CARDS (leads page - admin scoped) ===== */
#wrapper .col-md-6 .card {
    border-left: 3px solid var(--gold-primary) !important;
}

#wrapper .col-md-6 .card .fw-bold.fs-4 {
    color: var(--gold-primary) !important;
    font-size: 28px !important;
}

#wrapper .col-md-6 .card .text-muted.small.text-uppercase {
    font-size: 11px !important;
    letter-spacing: 1px;
}

/* ===== ASSESSMENT CHAT ICON ALIAS (dashboard.html) ===== */
.assessment-chat-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.assessment-chat-icon svg {
    width: 28px;
    height: 28px;
}

/* ===== BTN-LINK IN TABLES ===== */
.btn-link {
    color: var(--text-muted) !important;
}

.btn-link:hover {
    color: var(--gold-primary) !important;
}

/* ===== EMPTY STATE ===== */
td .fa.display-4 {
    color: var(--surface-elevated) !important;
    font-size: 48px !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    #sidebar-wrapper {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        z-index: 1000;
        transform: translateX(-260px);
    }

    #wrapper.toggled #sidebar-wrapper {
        transform: translateX(0);
        margin-left: 0;
    }

    .container-fluid {
        padding: 20px 16px !important;
    }
}

/* ===== RADIUS UTILITY ===== */
.radius-12 {
    border-radius: 12px !important;
}

/* ===== BRANCH TABLE BG ===== */
.bg-light.border-bottom td,
tr.bg-light td {
    background: var(--surface-elevated) !important;
}

/* ===== TABLE INSIDE NESTED ===== */
.table-sm td,
.table-sm th {
    padding: 10px 12px !important;
    font-size: 13px;
}

/* branches header text */
h6.text-uppercase.text-success {
    color: #10b981 !important;
}

/* ===== OVERFLOW HELPER ===== */
.overflow-hidden {
    overflow: hidden;
}

/* ===== LINK COLORS ===== */
a,
a:visited {
    
    text-decoration: none;
}

a:hover {
    color: var(--gold-light);
}

a.text-primary {
    color: var(--gold-primary) !important;
}

/* ===== LIGHT THEME ADMIN OVERRIDES ===== */
[data-theme="light"] #sidebar-wrapper {
    background: #FBF6EF !important;
    border-right-color: rgba(140, 100, 50, 0.12) !important;
}

[data-theme="light"] .sidebar-heading {
    color: #C8A96E !important;
    background: #FBF6EF !important;
    border-bottom-color: rgba(140, 100, 50, 0.12) !important;
}

[data-theme="light"] .list-group-item,
[data-theme="light"] .list-group-item-action {
    color: #5A4535 !important;
}

[data-theme="light"] .list-group-item-action:hover {
    background: rgba(200, 169, 110, 0.12) !important;
    color: #A07840 !important;
}

[data-theme="light"] .list-group-item.active-link,
[data-theme="light"] .list-group-item-action.active-link {
    background: rgba(200, 169, 110, 0.15) !important;
    border-right-color: #C8A96E !important;
    color: #A07840 !important;
}

[data-theme="light"] .navbar {
    background: #FBF6EF !important;
    border-bottom-color: rgba(140, 100, 50, 0.12) !important;
}

[data-theme="light"] .navbar .dropdown-toggle {
    color: #5A4535 !important;
}

[data-theme="light"] .container-fluid {
    background: transparent !important;
}

[data-theme="light"] #wrapper {
    background: #F2E9DA !important;
}

[data-theme="light"] #wrapper .card {
    background: #FBF6EF !important;
    border-color: rgba(140, 100, 50, 0.12) !important;
}

[data-theme="light"] #wrapper .card:hover {
    border-color: rgba(200, 169, 110, 0.4) !important;
}

[data-theme="light"] #wrapper .card-header {
    background: #FBF6EF !important;
    border-bottom-color: rgba(140, 100, 50, 0.12) !important;
}

[data-theme="light"] #wrapper .card-footer {
    background: #FBF6EF !important;
    border-top-color: rgba(140, 100, 50, 0.12) !important;
}

[data-theme="light"] #wrapper .card-body {
    background: #FBF6EF !important;
}

[data-theme="light"] .table {
    color: #5A4535 !important;
}

[data-theme="light"] .table thead th,
[data-theme="light"] #wrapper .bg-light {
    background: #F2E9DA !important;
    border-bottom-color: rgba(140, 100, 50, 0.12) !important;
    color: #8C7B68 !important;
}

[data-theme="light"] .table tbody tr:hover {
    background: rgba(200, 169, 110, 0.08) !important;
}

[data-theme="light"] .table td {
    color: #5A4535 !important;
    border-color: rgba(140, 100, 50, 0.08) !important;
}

[data-theme="light"] #wrapper .bg-white {
    background: #FBF6EF !important;
}

[data-theme="light"] .dropdown-menu {
    background: #FBF6EF !important;
    border-color: rgba(140, 100, 50, 0.15) !important;
}

[data-theme="light"] .dropdown-item {
    color: #5A4535 !important;
}

[data-theme="light"] .dropdown-item:hover {
    background: rgba(200, 169, 110, 0.12) !important;
    color: #A07840 !important;
}

[data-theme="light"] .form-control,
[data-theme="light"] .form-select {
    background: rgba(140, 100, 50, 0.06) !important;
    border-color: rgba(140, 100, 50, 0.15) !important;
    color: #2C1F0E !important;
}

[data-theme="light"] .form-control:focus,
[data-theme="light"] .form-select:focus {
    background: rgba(200, 169, 110, 0.1) !important;
    border-color: #C8A96E !important;
    box-shadow: 0 0 0 3px rgba(200, 169, 110, 0.2) !important;
}

[data-theme="light"] .form-control::placeholder {
    color: rgba(90, 69, 53, 0.5) !important;
}

[data-theme="light"] .input-group-text {
    background: rgba(140, 100, 50, 0.08) !important;
    border-color: rgba(140, 100, 50, 0.15) !important;
    color: #8C7B68 !important;
}

[data-theme="light"] .form-label {
    color: #5A4535 !important;
}

[data-theme="light"] .form-check-label {
    color: #5A4535 !important;
}

[data-theme="light"] .btn-light {
    background: rgba(140, 100, 50, 0.08) !important;
    border-color: rgba(140, 100, 50, 0.15) !important;
    color: #5A4535 !important;
}

[data-theme="light"] #sidebarToggle {
    background: rgba(140, 100, 50, 0.08) !important;
    border-color: rgba(140, 100, 50, 0.15) !important;
    color: #5A4535 !important;
}

[data-theme="light"] .theme-toggle-btn {
    background: rgba(140, 100, 50, 0.08);
    border-color: rgba(140, 100, 50, 0.15);
    color: #5A4535;
}

[data-theme="light"] .modal-content {
    background: #FBF6EF !important;
    border-color: rgba(140, 100, 50, 0.15) !important;
}

[data-theme="light"] .modal-header {
    border-bottom-color: rgba(140, 100, 50, 0.15) !important;
}

[data-theme="light"] .modal-footer {
    border-top-color: rgba(140, 100, 50, 0.15) !important;
}

[data-theme="light"] .btn-close {
    filter: none !important;
}

[data-theme="light"] .pagination .page-link {
    background: #FBF6EF !important;
    border-color: rgba(140, 100, 50, 0.15) !important;
    color: #5A4535 !important;
}

[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] h5,
[data-theme="light"] h6 {
    color: #2C1F0E !important;
}

[data-theme="light"] .text-muted {
    color: #8C7B68 !important;
}

[data-theme="light"] .fw-bold,
[data-theme="light"] .fw-semibold {
    color: #2C1F0E !important;
}

[data-theme="light"] #qrPreviewModal .modal-content {
    background: #FBF6EF !important;
}

[data-theme="light"] #qrPreviewModal .col-md-7 {
    background: rgba(200, 169, 110, 0.12) !important;
}

[data-theme="light"] .alert-info {
    color: #1e40af !important;
}

[data-theme="light"] .alert-success {
    color: #065f46 !important;
}

[data-theme="light"] .alert-info {
    color: #1e40af !important;
}

[data-theme="light"] .alert-success {
    color: #065f46 !important;
}

[data-theme="light"] .alert-danger {
    color: #991b1b !important;
}

/* ===== SELECT OPTION NATIVE DROPDOWN THEMING ===== */
/* Style the select element options (works in most browsers) */
#wrapper select,
#wrapper select option,
.form-control option,
.form-select option,
select.form-control option {
    background: var(--surface-elevated) !important;
    color: var(--text-primary) !important;
}

/* ===== TABLE-LIGHT BOOTSTRAP THEAD ===== */
/* Bootstrap .table-light applies bg to thead/tr/th — override for admin */
#wrapper .table-light,
#wrapper .table-light>th,
#wrapper .table-light>td,
#wrapper thead.table-light tr,
#wrapper thead.table-light th {
    background: var(--surface-elevated) !important;
    color: var(--text-muted) !important;
    border-color: var(--border-card) !important;
    --bs-table-bg: var(--surface-elevated) !important;
    --bs-table-color: var(--text-muted) !important;
}

/* ===== ASSIGNED USERS TABLE ROWS ===== */
/* tbody tr rows in the form table were rendering white */
#wrapper tbody tr,
#wrapper tbody td {
    background: var(--surface-card) !important;
    --bs-table-bg: transparent !important;
    --bs-table-accent-bg: transparent !important;
}

/* Form controls inside table cells */
#wrapper table .form-control,
#wrapper table .form-control-sm {
    background: var(--input-bg) !important;
    border-color: var(--border-card) !important;
    color: var(--text-primary) !important;
}

#wrapper table .form-control:focus,
#wrapper table .form-control-sm:focus {
    background: var(--input-bg-focus) !important;
    border-color: var(--gold-primary) !important;
    box-shadow: 0 0 0 2px var(--gold-glow) !important;
}

/* "No users assigned" empty-state bg-light block */
#wrapper .bg-light.rounded-3,
#wrapper .rounded-3.bg-light {
    background: var(--surface-elevated) !important;
    color: var(--text-muted) !important;
}

/* ===== QR MODAL — RIGHT PANEL bg-light ICON WRAPPERS ===== */
#qrPreviewModal .bg-light.p-2.rounded-3,
#qrPreviewModal .bg-light.rounded-3 {
    background: var(--gold-bg-subtle) !important;
}

#qrPreviewModal .bg-light.p-2.rounded-3 i,
#qrPreviewModal .bg-light.rounded-3 i {
    color: var(--gold-primary) !important;
}

/* ===== GOOGLE MAPS PLACES AUTOCOMPLETE DROPDOWN ===== */
/* .pac-container is rendered by Google Maps outside the DOM/shadow */
.pac-container {
    background: var(--surface-elevated) !important;
    border: 1px solid var(--border-card) !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: var(--shadow-lg) !important;
    font-family: 'Inter', sans-serif !important;
}

.pac-item {
    background: var(--surface-elevated) !important;
    color: var(--text-secondary) !important;
    border-top: 1px solid var(--border-subtle) !important;
    padding: 10px 14px !important;
    font-size: 13px;
    transition: background 0.15s ease;
}

.pac-item:hover,
.pac-item-selected {
    background: var(--gold-bg-subtle) !important;
    color: var(--text-primary) !important;
}

.pac-item-query {
    color: var(--text-primary) !important;
    font-weight: 600;
}

.pac-matched {
    color: var(--gold-primary) !important;
    font-weight: 700;
}

.pac-icon,
.pac-icon-search {
    filter: invert(0.7) sepia(1) saturate(2) hue-rotate(10deg) brightness(1.2);
}

/* ===== SWAL (SweetAlert) MODAL DARK THEME ===== */
.sweet-alert {
    background: var(--surface-card) !important;
    border: 1px solid var(--border-card) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-xl) !important;
}

.sweet-alert h2 {
    color: var(--text-primary) !important;
}

.sweet-alert p {
    color: var(--text-muted) !important;
}

.sweet-alert .confirm {
    background: var(--primary-gradient) !important;
    box-shadow: var(--shadow-gold) !important;
    color: var(--text-on-accent) !important;
    border-radius: var(--radius-sm) !important;
    font-weight: 600 !important;
}

.sweet-alert .cancel {
    background: var(--surface-hover) !important;
    color: var(--text-secondary) !important;
    border-radius: var(--radius-sm) !important;
}

/* ===== OBG REGISTER — bs-table-bg override ===== */
/* Ensure Bootstrap table stripe/hover vars don't override our theme */
#wrapper .table,
#wrapper .table-hover {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-secondary);
    --bs-table-border-color: var(--border-card);
    --bs-table-striped-bg: var(--surface-elevated);
    --bs-table-hover-bg: var(--surface-hover);
    --bs-table-hover-color: var(--text-primary);
    --bs-table-accent-bg: transparent;
}

/* ===== LIGHT THEME — additional table/select fixes ===== */
[data-theme="light"] #wrapper tbody tr,
[data-theme="light"] #wrapper tbody td {
    background: #FBF6EF !important;
    color: #5A4535 !important;
}

[data-theme="light"] #wrapper table .form-control,
[data-theme="light"] #wrapper table .form-control-sm {
    background: rgba(140, 100, 50, 0.06) !important;
    border-color: rgba(140, 100, 50, 0.15) !important;
    color: #2C1F0E !important;
}

[data-theme="light"] #wrapper .table-light,
[data-theme="light"] #wrapper thead.table-light tr,
[data-theme="light"] #wrapper thead.table-light th {
    background: #F2E9DA !important;
    color: #8C7B68 !important;
    border-color: rgba(140, 100, 50, 0.12) !important;
}

[data-theme="light"] .pac-container {
    background: #FBF6EF !important;
    border-color: rgba(140, 100, 50, 0.15) !important;
}

[data-theme="light"] .pac-item {
    background: #FBF6EF !important;
    color: #5A4535 !important;
    border-top-color: rgba(140, 100, 50, 0.08) !important;
}

[data-theme="light"] .pac-item:hover,
[data-theme="light"] .pac-item-selected {
    background: rgba(200, 169, 110, 0.12) !important;
}

[data-theme="light"] .pac-item-query {
    color: #2C1F0E !important;
}

[data-theme="light"] .pac-icon,
[data-theme="light"] .pac-icon-search {
    filter: none;
}

[data-theme="light"] .sweet-alert {
    background: #FBF6EF !important;
    border-color: rgba(140, 100, 50, 0.15) !important;
}

[data-theme="light"] #wrapper .bg-light.rounded-3 {
    background: #F2E9DA !important;
}

[data-theme="light"] #wrapper select option,
[data-theme="light"] .form-control option {
    background: #FBF6EF !important;
    color: #2C1F0E !important;
}