@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --app-bg: #f8fafc; /* Slate 50 */
    --app-surface: #ffffff;
    --app-surface-soft: #f1f5f9; /* Slate 100 */
    --app-border: #e2e8f0; /* Slate 200 */
    --app-text: #0f172a; /* Slate 900 */
    --app-muted: #64748b; /* Slate 500 */
    --app-primary: #1e3a8a; /* Navy/Blue */
    --app-primary-dark: #1e293b; /* Slate 800 */
    --app-accent: #0d9488; /* Teal 600 */
    --app-accent-dark: #0f766e; /* Teal 700 */
    --app-danger: #ef4444; /* Red 500 */
    --app-warning: #f59e0b; /* Amber 500 */
    --app-radius: 12px;
    --app-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --app-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Base Body Styles */
body.app-body,
body.bg-light {
    background: var(--app-bg) !important;
    color: var(--app-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* App Navbar */
.app-navbar {
    background: linear-gradient(135deg, var(--app-primary-dark) 0%, var(--app-primary) 50%, var(--app-accent-dark) 100%);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.15);
    min-height: 64px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.app-brand img {
    display: block;
    object-fit: contain;
    transition: transform 0.2s ease;
}


.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.app-nav-list {
    gap: 0.5rem;
    justify-content: flex-end;
    margin-left: 1.5rem;
    width: 100%;
}

.app-nav-item {
    flex: none;
}

.app-nav-link {
    align-items: center;
    border-radius: var(--app-radius);
    color: rgba(255, 255, 255, 0.8) !important;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    min-height: 40px;
    padding: 0.5rem 1rem !important;
    text-align: center;
    white-space: nowrap;
    font-weight: 500;
    transition: all 0.2s ease;
}

.app-nav-link:hover,
.app-nav-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff !important;
}

.app-nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Container Spacing */
.container,
.container-fluid {
    --bs-gutter-x: 1.5rem;
}

/* Card Improvements */
.card {
    background: var(--app-surface) !important;
    border: 1px solid var(--app-border) !important;
    border-radius: var(--app-radius) !important;
    box-shadow: var(--app-shadow) !important;
    transition: box-shadow 0.15s ease;
    overflow: hidden;
}

.card.overflow-visible {
    overflow: visible !important;
    position: relative;
    z-index: 10;
}

.card-header {
    background-color: var(--app-surface) !important;
    border-bottom: 1px solid var(--app-border) !important;
    color: var(--app-text) !important;
    font-weight: 600;
    font-size: 1rem;
    padding: 1.1rem 1.25rem !important;
}

/* Modernized Tables */
.table-responsive {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: var(--app-surface);
    box-shadow: var(--app-shadow);
    overflow-x: auto;
    margin-bottom: 1rem;
}

.table {
    background: var(--app-surface) !important;
    margin-bottom: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0;
    border: none !important;
}

.table thead th {
    background-color: var(--app-surface-soft) !important;
    color: var(--app-muted) !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    padding: 0.85rem 1rem !important;
    border-bottom: 1px solid var(--app-border) !important;
    border-top: none !important;
}

.table tbody td {
    padding: 0.85rem 1rem !important;
    vertical-align: middle;
    border-bottom: 1px solid var(--app-border) !important;
    color: var(--app-text);
    font-size: 0.88rem;
    background: var(--app-surface) !important;
}

.table tbody tr:last-child td {
    border-bottom: none !important;
}

.table-hover tbody tr:hover td {
    background-color: var(--app-surface-soft) !important;
}

/* Modals */
.modal-content {
    border: 1px solid var(--app-border) !important;
    border-radius: var(--app-radius) !important;
    box-shadow: var(--app-shadow-lg) !important;
    overflow: hidden;
}

.modal-header {
    background: var(--app-surface-soft);
    border-bottom: 1px solid var(--app-border);
    padding: 1.25rem;
}

.modal-footer {
    border-top: 1px solid var(--app-border);
    background: var(--app-surface-soft);
    padding: 1rem;
}

/* Form Styling */
.form-control,
.form-select {
    border: 1px solid #cbd5e1;
    border-radius: var(--app-radius);
    padding: 0.55rem 0.85rem;
    font-size: 0.9rem;
    color: var(--app-text);
    background-color: var(--app-surface);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--app-accent);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

/* Buttons */
.btn {
    border-radius: var(--app-radius) !important;
    padding: 0.55rem 1.1rem;
    font-weight: 550;
    font-size: 0.88rem;
    transition: all 0.2s ease;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
}

.btn-primary {
    background: var(--app-primary);
    border-color: var(--app-primary);
}

.btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.btn-success {
    background: var(--app-accent);
    border-color: var(--app-accent);
}

.btn-success:hover {
    background: var(--app-accent-dark);
    border-color: var(--app-accent-dark);
}

.btn-outline-primary {
    color: var(--app-primary);
    border-color: var(--app-primary);
    background: transparent;
}
.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-check:checked + .btn-outline-primary {
    background-color: var(--app-primary) !important;
    border-color: var(--app-primary) !important;
    color: #ffffff !important;
}

.btn-outline-success {
    color: var(--app-accent);
    border-color: var(--app-accent);
    background: transparent;
}
.btn-outline-success:hover,
.btn-outline-success:focus,
.btn-check:checked + .btn-outline-success {
    background-color: var(--app-accent) !important;
    border-color: var(--app-accent) !important;
    color: #ffffff !important;
}

/* Alerts / Badges */
.bg-success {
    background-color: var(--app-accent) !important;
}

.bg-danger {
    background-color: var(--app-danger) !important;
}

.bg-warning {
    background-color: var(--app-warning) !important;
}

.text-success {
    color: var(--app-accent) !important;
}

.border-success {
    border-color: var(--app-accent) !important;
}

.badge {
    border-radius: 6px;
    font-weight: 600;
    padding: 0.35em 0.6em;
}

.badge.bg-danger {
    background-color: var(--app-danger) !important;
}

/* Links */
a.link,
td a {
    color: var(--app-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

a.link:hover,
td a:hover {
    color: var(--app-accent);
    text-decoration: underline;
}

.page-shell {
    padding-bottom: 2rem;
}

.section-surface {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
}

/* Dashboard Specific Layout */
.welcome-banner {
    background: linear-gradient(135deg, var(--app-primary-dark) 0%, var(--app-primary) 50%, var(--app-accent-dark) 100%);
    color: #fff;
    border-radius: var(--app-radius);
    padding: 2.25rem 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(30, 58, 138, 0.15);
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.welcome-banner h1 {
    font-size: 1.85rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    letter-spacing: -0.025em;
}

.welcome-banner p {
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 0;
    font-weight: 400;
}

/* Alert Grid Cards */
.dashboard-alert-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    padding: 1.15rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--app-text);
    box-shadow: var(--app-shadow);
    transition: box-shadow 0.15s ease;
    min-height: 84px;
}

.dashboard-alert-card:hover {
    color: var(--app-text);
}

.dashboard-alert-card .alert-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.dashboard-alert-card .alert-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.dashboard-alert-card strong {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--app-text);
}

.dashboard-alert-card small {
    color: var(--app-muted);
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 0.15rem;
}

/* Card Custom Accents */
.alert-waiting {
    border-left: 4px solid var(--app-accent);
}
.alert-waiting .alert-icon {
    background: rgba(13, 148, 136, 0.1);
    color: var(--app-accent);
}

.alert-dues {
    border-left: 4px solid var(--app-danger);
}
.alert-dues .alert-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--app-danger);
}

.alert-followups {
    border-left: 4px solid var(--app-primary);
}
.alert-followups .alert-icon {
    background: rgba(30, 58, 138, 0.1);
    color: var(--app-primary);
}

.alert-missed {
    border-left: 4px solid var(--app-warning);
}
.alert-missed .alert-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--app-warning);
}

.alert-long-gap {
    border-left: 4px solid var(--app-muted);
}
.alert-long-gap .alert-icon {
    background: rgba(100, 116, 139, 0.1);
    color: var(--app-muted);
}

.alert-income {
    border-left: 4px solid #10b981;
}
.alert-income .alert-icon {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.alert-consultations {
    border-left: 4px solid #8b5cf6;
}
.alert-consultations .alert-icon {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.alert-new-patients {
    border-left: 4px solid #06b6d4;
}
.alert-new-patients .alert-icon {
    background: rgba(6, 182, 212, 0.1);
    color: #06b6d4;
}

.alert-out-of-stock {
    border-left: 4px solid #ef4444;
}
.alert-out-of-stock .alert-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.alert-reorder {
    border-left: 4px solid #f97316;
}
.alert-reorder .alert-icon {
    background: rgba(249, 115, 22, 0.1);
    color: #f97316;
}

.alert-birthday {
    border-left: 4px solid #ec4899;
    background: var(--app-surface) !important;
}
.alert-birthday .alert-icon {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

@media (min-width: 992px) {
    .col-lg-2-4 {
        flex: 0 0 20%;
        max-width: 20%;
    }
}

/* Stat Summary Cards */
.stat-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--app-shadow);
    transition: box-shadow 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}


.stat-card-info h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.15rem 0;
    color: var(--app-text);
}

.stat-card-info p {
    color: var(--app-muted);
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0;
}

.stat-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.stat-consultations {
    border-left: 4px solid var(--app-danger);
}
.stat-consultations .stat-card-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--app-danger);
}

.stat-income {
    border-left: 4px solid var(--app-primary);
}
.stat-income .stat-card-icon {
    background: rgba(30, 58, 138, 0.1);
    color: var(--app-primary);
}

.stat-patients {
    border-left: 4px solid var(--app-accent);
}
.stat-patients .stat-card-icon {
    background: rgba(13, 148, 136, 0.1);
    color: var(--app-accent);
}

/* Scrollable Container inside Patients Search */
.scrollable-results {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 10px;
    padding: 5px;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

@media (max-width: 991.98px) {
    .app-nav-list {
        gap: 0.25rem;
        margin-left: 0;
        padding-top: 0.75rem;
    }

    .app-nav-item {
        flex: none;
        width: 100%;
    }

    .app-nav-link {
        justify-content: flex-start;
        padding: 0.7rem 0.8rem !important;
    }
}

/* Restored Card Hover Shadows (Dashboard & Page Title Cards only) */
.dashboard-alert-card:hover,
.stat-card:hover,
.card.stat-consultations:hover,
.card.stat-income:hover,
.card.stat-patients:hover,
.card.p-3:hover,
.card.p-4:hover {
    box-shadow: var(--app-shadow-lg) !important;
}

/* WhatsApp Brand Button Style */
.btn-whatsapp {
    background-color: #25D366 !important;
    border-color: #25D366 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

.btn-whatsapp:hover,
.btn-whatsapp:focus {
    background-color: #20ba5a !important;
    border-color: #20ba5a !important;
    color: #ffffff !important;
}

/* OP Number Display Style (Replaces old grey box badge) */
.op-number-display {
    font-family: 'Inter', monospace;
    font-weight: 700;
    color: #0f766e; /* Deep teal for high legibility */
    font-size: 0.95rem;
    letter-spacing: 0.025em;
}

/* Login Page Premium Styles */
body.app-login-body {
    background-image: url('../../images/login.jpg') !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
}

.login-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.75); /* Dark slate overlay to match current UI colors */
    z-index: 1;
}

.login-shell-premium {
    z-index: 2;
    position: relative;
    max-width: 440px;
    width: 100%;
}

.login-card-premium {
    background: #1e293b !important; /* Slate 800 background to pop the white logo */
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-top: 5px solid var(--app-accent) !important; /* Top accent line in teal matching our active UI */
    border-radius: var(--app-radius) !important;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4) !important;
    padding: 1rem;
    color: #ffffff;
}

.login-logo {
    max-width: 260px;
    max-height: 170px;
    height: auto;
    object-fit: contain;
}

.brand-subtitle {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--app-accent);
    margin-top: 0.5rem;
    text-transform: uppercase;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-top: 1rem;
}

.login-card-premium .form-label {
    font-weight: 600;
    color: #cbd5e1; /* Light slate text for labels */
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

/* Input group styling for dark theme */
.login-card-premium .input-group-text {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-right: none !important;
    border-radius: var(--app-radius) 0 0 var(--app-radius) !important;
    color: #94a3b8;
}

.login-card-premium .form-control,
.login-card-premium .form-select {
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 0 var(--app-radius) var(--app-radius) 0 !important;
    font-size: 0.9rem;
    padding: 0.6rem 0.8rem;
    background-color: rgba(255, 255, 255, 0.02) !important;
    color: #ffffff !important;
}

.login-card-premium .form-control::placeholder {
    color: #64748b !important;
}

/* Ensure select dropdown options have dark backgrounds */
.login-card-premium .form-select option {
    background-color: #1e293b;
    color: #ffffff;
}

.login-card-premium .form-control:focus,
.login-card-premium .form-select:focus {
    border-color: var(--app-accent) !important;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.3) !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* Alert styling matching the dark application */
.login-card-premium .alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    border-radius: var(--app-radius);
    padding: 0.75rem;
}

.login-card-premium .btn-success {
    background: var(--app-accent) !important;
    border-color: var(--app-accent) !important;
    border-radius: var(--app-radius) !important;
    padding: 0.65rem !important;
    color: #ffffff !important;
    transition: all 0.2s ease;
}

.login-card-premium .btn-success:hover {
    background: var(--app-accent-dark) !important;
    border-color: var(--app-accent-dark) !important;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.2);
}

/* ==================== SIDEBAR NAVIGATION SYSTEM ==================== */

body.has-sidebar {
    transition: padding-left 0.3s ease-in-out;
}

@media (min-width: 992px) {
    body.has-sidebar {
        padding-left: 260px !important;
    }
}

/* Sidebar Styling (Colored gradient mixing Navy and Teal) */
.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, #1e3a8a 0%, #115e59 60%, #0f766e 100%) !important;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.15) !important;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    color: #ffffff !important;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-sidebar .sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: transparent !important;
    position: relative;
    padding: 1.5rem 1rem !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sidebar-logo {
    height: 52px;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.2s ease-in-out;
}

.sidebar-logo:hover {
    transform: scale(1.05);
}

.sidebar-brand-name {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #ffffff;
    margin-top: 0.5rem;
    max-width: 200px;
    text-align: center;
}

.app-sidebar .sidebar-header .btn-close {
    filter: invert(1) grayscale(1) brightness(2);
    opacity: 0.75;
    transition: opacity 0.15s ease;
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
}

.app-sidebar .sidebar-header .btn-close:hover {
    opacity: 1;
}

/* User Profile Section */
.sidebar-user-profile {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: transparent !important;
}

.sidebar-user-profile .profile-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    border: 1.5px solid rgba(255, 255, 255, 0.2) !important;
    font-size: 1.25rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-user-profile .profile-details h6 {
    font-size: 0.92rem;
    color: #ffffff !important;
    font-weight: 700;
}

.sidebar-user-profile .profile-details .badge {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
}

/* Heading section */
.sidebar-heading {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    font-weight: 700 !important;
    color: rgba(255, 255, 255, 0.45) !important;
    text-transform: uppercase;
}

/* Navigation Links */
.sidebar-nav {
    overflow-y: auto;
}

/* Custom Scrollbar for Sidebar Nav */
.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1rem !important;
    color: rgba(255, 255, 255, 0.75) !important;
    font-size: 0.86rem;
    font-weight: 500;
    border-radius: var(--app-radius) !important;
    text-decoration: none !important;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.sidebar-link:hover {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
}

.sidebar-link-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
    transition: transform 0.2s ease;
}

.sidebar-link:hover .sidebar-link-icon {
    color: #ffffff;
}

.sidebar-link.active {
    background-color: rgba(255, 255, 255, 0.16) !important;
    color: #ffffff !important;
    font-weight: 600;
    border-left: 4px solid #ffffff !important;
    border-radius: 0 var(--app-radius) var(--app-radius) 0 !important;
}

.sidebar-link.active .sidebar-link-icon {
    color: #ffffff !important;
}

/* Sidebar Footer */
.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: transparent !important;
}

.sidebar-link-danger {
    color: #fca5a5 !important;
    border-color: rgba(252, 165, 165, 0.2) !important;
}

.sidebar-link-danger:hover {
    background-color: rgba(239, 68, 68, 0.15) !important;
    color: #ffffff !important;
    border-color: rgba(239, 68, 68, 0.25) !important;
}

/* Mobile Header Bar */
.mobile-header {
    height: 56px;
    background-color: var(--app-surface) !important;
    border-bottom: 1px solid var(--app-border) !important;
    z-index: 1030;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.mobile-header .btn-link {
    color: var(--app-text) !important;
}

.mobile-header .no-caret::after {
    display: none !important;
}

/* Sidebar Backdrop (Mobile overlay) */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1035;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

/* Responsive Toggles */
@media (max-width: 991.98px) {
    .app-sidebar {
        left: -260px;
    }
    
    .app-sidebar.open {
        left: 0;
    }
    
    body.sidebar-open {
        overflow: hidden;
    }
    
    body.has-sidebar {
        padding-top: 56px !important;
    }
}

@media (min-width: 992px) {
    .sidebar-backdrop {
        display: none !important;
    }
}

/* ==================== UNIFIED PAGE TITLE BANNERS ==================== */

.page-title-banner {
    background: linear-gradient(135deg, var(--app-primary-dark) 0%, var(--app-primary) 50%, var(--app-accent-dark) 100%);
    color: #ffffff !important;
    border-radius: var(--app-radius) !important;
    padding: 1.5rem 1.75rem !important;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(30, 58, 138, 0.12) !important;
    border: none !important;
    transition: all 0.25s ease;
}

.page-title-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.page-title-banner h5 {
    color: #ffffff !important;
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.25rem !important;
    letter-spacing: -0.01em;
}

.page-title-banner h5 i {
    color: #ffffff !important;
    opacity: 0.9;
}

.page-title-banner p,
.page-title-banner .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 400;
}

/* Buttons inside title banners */
.page-title-banner .btn-outline-primary {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    background: transparent !important;
}

.page-title-banner .btn-outline-primary:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: #ffffff !important;
    color: #ffffff !important;
}

.page-title-banner .btn-primary {
    background: #ffffff !important;
    color: var(--app-primary-dark) !important;
    border-color: #ffffff !important;
}

.page-title-banner .btn-primary:hover {
    background: rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    color: var(--app-primary-dark) !important;
}

.page-title-banner .btn-outline-danger {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    background: transparent !important;
}

.page-title-banner .btn-outline-danger:hover {
    background: var(--app-danger) !important;
    border-color: var(--app-danger) !important;
    color: #ffffff !important;
}

.page-title-banner .btn-success {
    background: var(--app-accent) !important;
    color: #ffffff !important;
    border-color: var(--app-accent) !important;
}

.page-title-banner .btn-success:hover {
    background: var(--app-accent-dark) !important;
    border-color: var(--app-accent-dark) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Text fields/select inputs inside title banners */
.page-title-banner .form-control,
.page-title-banner .form-select {
    background-color: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
}

.page-title-banner .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
}

.page-title-banner .form-control:focus,
.page-title-banner .form-select:focus {
    background-color: rgba(255, 255, 255, 0.2) !important;
    border-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15) !important;
}
/* ==================== PATIENT RECORD INFO CARDS ==================== */
.patient-view-page .patient-info-card {
    background: linear-gradient(135deg, var(--app-primary-dark) 0%, var(--app-primary) 50%, var(--app-accent-dark) 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: var(--app-radius) !important;
    box-shadow: 0 10px 25px rgba(30, 58, 138, 0.12) !important;
    transition: all 0.25s ease;
}

.patient-view-page .patient-info-card .card-title {
    color: #ffffff !important;
    border-bottom: none !important;
}

.patient-view-page .patient-info-card .patient-info-card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.patient-view-page .patient-info-card .card-title i {
    color: #ffffff !important;
    opacity: 0.9;
}

.patient-view-page .patient-info-card strong {
    color: rgba(255, 255, 255, 0.75) !important;
    font-size: 0.8rem;
    font-weight: 550;
    text-transform: uppercase;
}

.patient-view-page .patient-info-card span {
    color: #ffffff !important;
    font-weight: 600;
}

.patient-view-page .patient-info-card span.text-danger {
    color: #fda4af !important; /* Standout soft red on dark background */
}

.patient-view-page .patient-info-card i {
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 0.85rem;
}

.patient-view-page .patient-info-card a {
    color: #7dd3fc !important;
    text-decoration: underline !important;
    font-weight: 600;
    transition: color 0.15s ease;
}

.patient-view-page .patient-info-card a:hover {
    color: #93c5fd !important;
}

.patient-view-page .patient-info-card .relatives-none {
    color: rgba(255, 255, 255, 0.5) !important;
}

.patient-view-page .patient-info-card .relatives-none i {
    color: rgba(255, 255, 255, 0.4) !important;
}

.patient-view-page .patient-info-card .patient-card-edit {
    color: rgba(255, 255, 255, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    padding: 0 !important;
    width: 20px !important;
    height: 20px !important;
    font-size: 0.7rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 4px !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}

.patient-view-page .patient-info-card .patient-card-edit:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
}

/* ==================== MOBILE RESPONSIVE FIXES ==================== */
@media (max-width: 575.98px) {
    .dashboard-alert-card {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        padding: 1rem 0.5rem !important;
        gap: 0.5rem !important;
        min-height: 120px !important;
    }
    
    .dashboard-alert-card .alert-icon {
        margin-bottom: 0.25rem !important;
    }
    
    .dashboard-alert-card .alert-copy {
        align-items: center !important;
        width: 100% !important;
    }
    
    .dashboard-alert-card strong {
        font-size: 1.15rem !important;
        word-break: break-word !important;
    }
    
    .dashboard-alert-card small {
        font-size: 0.75rem !important;
    }
    
    .welcome-banner {
        padding: 1.5rem 1.25rem !important;
    }
    
    .welcome-banner h1 {
        font-size: 1.4rem !important;
    }
    
    .welcome-banner p {
        font-size: 0.85rem !important;
    }
}
