body {
    font-family: 'Outfit', sans-serif;
    -webkit-font-smoothing: antialiased;
    background-color: #0d1117 !important;
}

/* Glassmorphic Cards */
.card.glass {
    background: rgba(22, 27, 34, 0.7) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(240, 246, 252, 0.1) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37) !important;
}

.card {
    border-radius: 12px !important;
    overflow: hidden;
}

/* Custom Table overrides for dark style */
.table-dark {
    --bs-table-bg: #161b22 !important;
    --bs-table-border-color: rgba(240, 246, 252, 0.1) !important;
}

/* Input Fields overrides */
.form-control, .form-select {
    border-radius: 8px !important;
}

.form-control:focus, .form-select:focus {
    background-color: #0d1117 !important;
    color: #fff !important;
    border-color: #58a6ff !important;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.3) !important;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #0d1117;
}
::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #8b949e;
}

/* Fade In animations */
#wrapper, #login-container, #unauthorized-container, .view-section {
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Nav Tab links */
.nav-pills .nav-link {
    color: #8b949e;
    font-weight: 500;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}
.nav-pills .nav-link:hover {
    color: #c9d1d9;
    background: rgba(255, 255, 255, 0.05);
}
.nav-pills .nav-link.active {
    color: #58a6ff !important;
    background: rgba(88, 166, 255, 0.15) !important;
    border: 1px solid rgba(88, 166, 255, 0.3);
}

/* Searchable Combobox */
.combobox-container {
    position: relative;
}
.combobox-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #161b22;
    border: 1px solid rgba(240, 246, 252, 0.15);
    border-radius: 10px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
    max-height: 320px;
    overflow-y: auto;
    z-index: 1060;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.combobox-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.15s ease;
}
.combobox-item:last-child {
    border-bottom: none;
}
.combobox-item:hover, .combobox-item.active {
    background-color: rgba(88, 166, 255, 0.15);
}
.combobox-item .item-title {
    font-weight: 600;
    color: #f0f6fc;
}
.combobox-item .item-sub {
    font-size: 0.75rem;
    color: #8b949e;
}
.combobox-item mark {
    background-color: rgba(255, 215, 0, 0.3);
    color: #fff;
    padding: 0 2px;
    border-radius: 2px;
}

/* Clinic Directory Table */
.clinic-row {
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
}
.clinic-row:hover {
    background-color: rgba(88, 166, 255, 0.08) !important;
}

/* Soft Badges */
.badge-soft-success {
    background: rgba(46, 160, 67, 0.2);
    color: #3fb950;
    border: 1px solid rgba(46, 160, 67, 0.3);
}
.badge-soft-warning {
    background: rgba(210, 153, 34, 0.2);
    color: #d29922;
    border: 1px solid rgba(210, 153, 34, 0.3);
}
.badge-soft-info {
    background: rgba(56, 139, 253, 0.2);
    color: #58a6ff;
    border: 1px solid rgba(56, 139, 253, 0.3);
}
.badge-soft-secondary {
    background: rgba(139, 148, 158, 0.2);
    color: #8b949e;
    border: 1px solid rgba(139, 148, 158, 0.3);
}

/* ==========================================================================
   FOLDABLE LEFT SIDEBAR & SYSTEM HEALTH STYLES
   ========================================================================== */

#app-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#top-header {
    height: 56px;
    background: #161b22;
    border-bottom: 1px solid rgba(240, 246, 252, 0.1);
    z-index: 1020;
}

#sidebar {
    width: 250px;
    min-width: 250px;
    height: calc(100vh - 56px);
    background: #0d1117;
    border-right: 1px solid rgba(240, 246, 252, 0.1);
    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 1010;
}

#sidebar.sidebar-collapsed {
    width: 68px;
    min-width: 68px;
}

#main-content {
    flex-grow: 1;
    height: calc(100vh - 56px);
    overflow-y: auto;
    overflow-x: hidden;
    background-color: #0d1117;
}

.sidebar-nav-section {
    padding: 10px 0 4px 0;
}

.nav-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 8px 18px 4px 18px;
    white-space: nowrap;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    margin: 3px 10px;
    color: #8b949e;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    border: 1px solid transparent;
}

.sidebar-nav-item i {
    font-size: 1.15rem;
    min-width: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-nav-item:hover {
    color: #f0f6fc;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav-item.active {
    color: #58a6ff !important;
    background: rgba(88, 166, 255, 0.14) !important;
    border-color: rgba(88, 166, 255, 0.28) !important;
    font-weight: 600;
}

/* Collapsed Sidebar adjustments */
#sidebar.sidebar-collapsed .nav-section-title,
#sidebar.sidebar-collapsed .nav-label,
#sidebar.sidebar-collapsed .nav-badge,
#sidebar.sidebar-collapsed .sidebar-footer-text {
    display: none !important;
}

#sidebar.sidebar-collapsed .sidebar-nav-item {
    margin: 4px 8px;
    padding: 12px 0;
    justify-content: center;
}

#sidebar.sidebar-collapsed .sidebar-nav-item i {
    min-width: unset;
    font-size: 1.3rem;
}

.sidebar-footer {
    border-top: 1px solid rgba(240, 246, 252, 0.08);
    padding: 12px 14px;
    background: rgba(22, 27, 34, 0.5);
}

#sidebar.sidebar-collapsed .sidebar-footer {
    justify-content: center !important;
    padding: 12px 0;
}

/* Pulse Animation for Live Health Status */
.pulse-green {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3fb950;
    box-shadow: 0 0 0 rgba(63, 185, 80, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(63, 185, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0); }
}

.status-badge-2xx {
    background-color: rgba(46, 160, 67, 0.15);
    color: #3fb950;
    border: 1px solid rgba(46, 160, 67, 0.3);
}

.status-badge-3xx {
    background-color: rgba(56, 139, 253, 0.15);
    color: #58a6ff;
    border: 1px solid rgba(56, 139, 253, 0.3);
}

.status-badge-4xx {
    background-color: rgba(210, 153, 34, 0.15);
    color: #d29922;
    border: 1px solid rgba(210, 153, 34, 0.3);
}

.status-badge-5xx {
    background-color: rgba(248, 81, 73, 0.15);
    color: #f85149;
    border: 1px solid rgba(248, 81, 73, 0.3);
}

/* Extra-small button utilities for config editor & action toolbars */
.btn-xs,
.btn-group-xs > .btn {
    --bs-btn-padding-y: 0.15rem;
    --bs-btn-padding-x: 0.45rem;
    --bs-btn-font-size: 0.75rem;
    --bs-btn-border-radius: 0.25rem;
    padding: 0.15rem 0.45rem;
    font-size: 0.75rem;
    line-height: 1.3;
    border-radius: 0.25rem;
}

/* Dark theme Business Config Modal refinements */
#devBusinessConfigModal .modal-content {
    background-color: #161b22;
    border: 1px solid rgba(240, 246, 252, 0.14);
}

#devBusinessConfigModal .modal-body {
    background-color: #0d1117;
}

#devBusinessConfigModal .card {
    background-color: #161b22;
    border: 1px solid rgba(240, 246, 252, 0.1);
}

#devBusinessConfigModal .card-header {
    background-color: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(240, 246, 252, 0.1);
}

#devBusinessConfigModal .list-group-item {
    background-color: #161b22;
    color: #f0f6fc;
    border-color: rgba(240, 246, 252, 0.1);
}

#devBusinessConfigModal .form-control,
#devBusinessConfigModal .form-select,
#devBusinessConfigModal .input-group-text {
    background-color: #0d1117;
    color: #f0f6fc;
    border-color: rgba(240, 246, 252, 0.18);
}

#devBusinessConfigModal .form-control:disabled,
#devBusinessConfigModal .form-control[readonly] {
    background-color: #161b22;
    color: #8b949e;
}

#devConfClinicFormCard {
    overflow: visible !important;
}

#devConfPlacesResults {
    z-index: 1070;
    max-height: 240px;
    overflow-y: auto;
    border-radius: 8px;
}

#devConfPlacesResults .list-group-item-action:hover {
    background-color: rgba(88, 166, 255, 0.15);
    color: #fff;
}

.dev-config-subpanel {
    background-color: #0d1117;
    border: 1px solid rgba(240, 246, 252, 0.12);
    border-radius: 8px;
}

.draggable-item {
    cursor: grab;
    transition: all 0.2s ease;
    user-select: none;
}

.draggable-item:active {
    cursor: grabbing;
}

.draggable-item.dragging {
    opacity: 0.4;
    background-color: rgba(88, 166, 255, 0.12);
    border: 1px dashed rgba(88, 166, 255, 0.5);
}

