/* ============================================
   MOBILE ADAPTIVE STYLES FOR BRONBEK
   Version: 1.0
   Description: Адаптация для мобильных устройств
                с элементами Material Design
   ============================================ */

/* ==========================================
   VARIABLES & ROOT SETTINGS
   ========================================== */
:root {
    /* Material Design Elevation Shadows */
    --elevation-1: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --elevation-2: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
    --elevation-3: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
    --elevation-4: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);

    /* Material Design Timing */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Touch Target Sizes */
    --touch-target-min: 44px;
    --touch-target-comfortable: 48px;

    /* Breakpoints */
    --breakpoint-xs: 0;
    --breakpoint-sm: 576px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 992px;
    --breakpoint-xl: 1200px;
}

/* ==========================================
   GLOBAL MOBILE IMPROVEMENTS
   ========================================== */

/* Touch-friendly scrolling */
* {
    -webkit-overflow-scrolling: touch;
}

/* Prevent text size adjustment on orientation change */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* Tap highlight color */
a, button, input, select, textarea {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

/* ==========================================
   MATERIAL DESIGN BUTTON ENHANCEMENTS
   ========================================== */

.btn {
    min-height: var(--touch-target-min);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.98);
}

/* Material Ripple Effect (simple version) */
.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

.btn-primary::after {
    background: rgba(255, 255, 255, 0.3);
}

.btn-secondary::after {
    background: rgba(0, 0, 0, 0.1);
}

/* ==========================================
   MATERIAL DESIGN CARD ENHANCEMENTS
   ========================================== */

.card {
    box-shadow: var(--elevation-1);
    transition: box-shadow var(--transition-normal);
    border: none;
}

.card:hover {
    box-shadow: var(--elevation-2);
}

.card.card-elevated {
    box-shadow: var(--elevation-2);
}

.card.card-elevated:hover {
    box-shadow: var(--elevation-3);
}

/* ==========================================
   HAMBURGER MENU BUTTON
   ========================================== */

.mobile-menu-toggle {
    display: none;
    width: var(--touch-target-comfortable);
    height: var(--touch-target-comfortable);
    padding: 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    z-index: 1050;
}

.mobile-menu-toggle .hamburger {
    position: relative;
    width: 24px;
    height: 2px;
    background-color: #333;
    transition: all var(--transition-normal);
}

.mobile-menu-toggle .hamburger::before,
.mobile-menu-toggle .hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 24px;
    height: 2px;
    background-color: #333;
    transition: all var(--transition-normal);
}

.mobile-menu-toggle .hamburger::before {
    top: -8px;
}

.mobile-menu-toggle .hamburger::after {
    top: 8px;
}

/* Animated hamburger when offcanvas is shown */
.offcanvas.show ~ * .mobile-menu-toggle .hamburger {
    background-color: transparent;
}

.offcanvas.show ~ * .mobile-menu-toggle .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.offcanvas.show ~ * .mobile-menu-toggle .hamburger::after {
    top: 0;
    transform: rotate(-45deg);
}

/* ==========================================
   SIDEBAR ADAPTATIONS
   ========================================== */

/* Desktop sidebar */
.app-sidebar {
    width: 280px;
    min-height: 100vh;
    transition: transform var(--transition-normal);
}

/* Logo adaptations */
.app-sidebar .app-logo {
    height: 100px;
    width: 200px;
    object-fit: contain;
}

/* Simplified sidebar for managers */
.app-sidebar.manager-mode {
    width: 240px;
}

.app-sidebar.manager-mode .nav-item {
    font-size: 1.1rem;
}

.app-sidebar.manager-mode .nav-link {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.app-sidebar.manager-mode .nav-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: var(--elevation-2);
}

.app-sidebar.manager-mode .nav-link:not(.active):hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* ==========================================
   OFFCANVAS CUSTOMIZATION
   ========================================== */

.offcanvas {
    box-shadow: var(--elevation-4);
}

.offcanvas-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.offcanvas-body {
    padding: 1rem;
}

/* Manager mode offcanvas styling */
.offcanvas.manager-mode .nav-link {
    font-size: 1.1rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    transition: all var(--transition-fast);
}

.offcanvas.manager-mode .nav-link i {
    font-size: 1.5rem;
    margin-right: 1rem;
    min-width: 28px;
}

.offcanvas.manager-mode .nav-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: var(--elevation-2);
}

.offcanvas.manager-mode .nav-link:not(.active) {
    background-color: rgba(0, 0, 0, 0.03);
}

.offcanvas.manager-mode .nav-link:not(.active):hover {
    background-color: rgba(0, 0, 0, 0.08);
    transform: translateX(4px);
}

/* ==========================================
   TOP NAVIGATION BAR
   ========================================== */

.app-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.app-topbar-start {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-topbar-end {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ==========================================
   RESPONSIVE BREAKPOINTS
   ========================================== */

/* Large tablets and below (< 992px) */
@media (max-width: 991.98px) {
    /* Hide desktop sidebar */
    .app-sidebar {
        display: none !important;
    }

    /* Show mobile menu toggle (in mobile-header) */
    .mobile-header .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Full width main content */
    .d-flex > .w-100 {
        padding: 1rem !important;
    }

    /* Adjust main content */
    #main-content {
        padding: 1rem !important;
    }
}

/* Tablets (768px - 991.98px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Tablet-specific adjustments */
    .card {
        margin-bottom: 1rem;
    }

    .btn-lg {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }
}

/* Mobile devices (< 768px) */
@media (max-width: 767.98px) {
    /* Compact header */
    .app-topbar {
        padding: 0.5rem 0;
        margin-bottom: 1rem;
    }

    /* Stack organization/language/user dropdown */
    .app-topbar-end {
        width: 100%;
        justify-content: flex-end;
    }

    /* Compact dropdowns */
    .app-topbar-end .dropdown {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* Compact buttons */
    .app-topbar-end .btn-sm {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    /* Icon-only mode for compact display */
    .dropdown-toggle strong {
        display: none;
    }

    /* Cards */
    .card {
        margin-bottom: 1rem;
        border-radius: 12px;
    }

    .card-header {
        padding: 0.75rem 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    /* Buttons */
    .btn-lg {
        font-size: 0.95rem;
        padding: 0.65rem 1.25rem;
        min-height: var(--touch-target-comfortable);
    }

    /* Forms */
    .form-control, .form-select {
        min-height: var(--touch-target-min);
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Input groups */
    .input-group {
        flex-wrap: nowrap;
    }

    .input-group .btn {
        padding: 0.5rem 0.75rem;
    }
}

/* Small mobile devices (< 576px) */
@media (max-width: 575.98px) {
    /* Very compact layout */
    #main-content {
        padding: 0.75rem !important;
    }

    /* Full width cards */
    .card {
        border-radius: 8px;
    }

    /* Stack form elements */
    .input-group {
        flex-direction: column;
    }

    .input-group .btn {
        width: 100%;
        margin-top: 0.5rem;
        border-radius: 0.375rem !important;
    }

    /* Alerts */
    .alert {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .alert .btn {
        font-size: 0.85rem;
        padding: 0.375rem 0.75rem;
        margin-top: 0.5rem;
    }

    /* Compact logo in offcanvas */
    .offcanvas .app-logo {
        height: 70px;
        width: 140px;
    }

    /* List groups */
    .list-group-item {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}

/* ==========================================
   LANDSCAPE ORIENTATION
   ========================================== */

/* Mobile landscape mode */
@media (max-height: 500px) and (orientation: landscape) {
    /* Reduce vertical padding */
    #main-content {
        padding: 0.5rem !important;
    }

    .card {
        margin-bottom: 0.5rem;
    }

    .app-topbar {
        margin-bottom: 0.5rem;
    }

    /* Compact alerts */
    .alert {
        padding: 0.5rem;
        font-size: 0.85rem;
    }

    /* Smaller buttons */
    .btn-lg {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }

    /* Offcanvas should be narrower */
    .offcanvas {
        max-width: 260px !important;
    }
}

/* ==========================================
   DASHBOARD-SPECIFIC MOBILE STYLES
   ========================================== */

/* KPI Cards */
@media (max-width: 767.98px) {
    /* 2 columns on small screens */
    .dashboard-kpis .col-md-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* Stack vertically on very small screens */
    @media (max-width: 400px) {
        .dashboard-kpis .col-md-4 {
            flex: 0 0 100%;
            max-width: 100%;
        }
    }

    .dashboard-kpis .card-title {
        font-size: 0.9rem;
    }

    .dashboard-kpis .card-text {
        font-size: 1.5rem !important;
    }
}

/* Booking URL Card */
@media (max-width: 575.98px) {
    .booking-url-card .input-group {
        flex-direction: row !important;
    }

    .booking-url-card .input-group .form-control {
        font-size: 0.75rem;
    }

    .booking-url-card .input-group .btn {
        width: auto;
        margin-top: 0;
        padding: 0.5rem;
    }

    .booking-url-card .input-group .btn i {
        font-size: 1rem;
    }
}

/* Today's Appointments List */
@media (max-width: 767.98px) {
    .appointments-list {
        max-height: 400px;
        overflow-y: auto;
    }

    .appointments-list .list-group-item {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }

    .appointments-list .list-group-item strong {
        font-size: 1.1rem;
    }
}

/* Quick Action Buttons */
@media (max-width: 767.98px) {
    .quick-actions .d-grid {
        gap: 0.75rem !important;
    }
}

/* ==========================================
   SCHEDULE (FULLCALENDAR) MOBILE STYLES
   ========================================== */

/* Mobile calendar adjustments */
@media (max-width: 767.98px) {
    /* Hide week numbers */
    .fc-daygrid-week-number {
        display: none;
    }

    /* Larger touch targets for calendar buttons */
    .fc .fc-button {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    .fc .fc-toolbar-title {
        font-size: 1.1rem;
    }

    /* Stack toolbar elements */
    .fc .fc-toolbar {
        flex-direction: column;
        gap: 0.5rem;
    }

    .fc .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
    }

    /* Event styling */
    .fc-event {
        font-size: 0.85rem;
        padding: 2px 4px;
    }

    .fc-event-title {
        font-weight: 500;
    }

    /* Time grid slots */
    .fc .fc-timegrid-slot {
        height: 2.5rem;
    }

    /* Scrollable calendar */
    .fc {
        max-height: calc(100vh - 200px);
    }
}

/* Very small screens - minimal calendar */
@media (max-width: 575.98px) {
    .fc .fc-button {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }

    .fc .fc-toolbar-title {
        font-size: 1rem;
    }

    .fc-event {
        font-size: 0.75rem;
    }

    /* Hide some toolbar buttons on very small screens */
    .fc .fc-dayGridMonth-button {
        display: none;
    }
}

/* Master filter on mobile */
@media (max-width: 767.98px) {
    #master-filter {
        max-width: 100% !important;
        margin-bottom: 1rem;
        font-size: 16px; /* Prevents iOS zoom */
    }
}

/* ==========================================
   MODAL IMPROVEMENTS FOR MOBILE
   ========================================== */

@media (max-width: 767.98px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .modal-content {
        border-radius: 12px;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
        max-height: calc(100vh - 200px);
        overflow-y: auto;
    }

    .modal-footer {
        padding: 0.75rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .modal-footer .btn {
        flex: 1 1 auto;
        min-width: calc(50% - 0.25rem);
    }
}

/* ==========================================
   TOAST NOTIFICATIONS
   ========================================== */

@media (max-width: 767.98px) {
    .toast-container {
        padding: 1rem !important;
    }

    .toast {
        min-width: 280px;
        max-width: calc(100vw - 2rem);
    }

    .toast-body {
        font-size: 0.9rem;
    }
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

/* Mobile-only visibility */
.mobile-only {
    display: none !important;
}

@media (max-width: 991.98px) {
    .mobile-only {
        display: block !important;
    }

    .mobile-only.d-flex {
        display: flex !important;
    }

    .mobile-only.d-inline-block {
        display: inline-block !important;
    }
}

/* Desktop-only visibility */
@media (max-width: 991.98px) {
    .desktop-only {
        display: none !important;
    }
}

/* Touch-friendly class */
.touch-target {
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
}

.touch-target-comfortable {
    min-width: var(--touch-target-comfortable);
    min-height: var(--touch-target-comfortable);
}

/* Material elevation classes */
.elevation-1 { box-shadow: var(--elevation-1); }
.elevation-2 { box-shadow: var(--elevation-2); }
.elevation-3 { box-shadow: var(--elevation-3); }
.elevation-4 { box-shadow: var(--elevation-4); }

/* Smooth transitions */
.transition-fast { transition: all var(--transition-fast); }
.transition-normal { transition: all var(--transition-normal); }
.transition-slow { transition: all var(--transition-slow); }

/* ==========================================
   PRINT MEDIA
   ========================================== */

@media print {
    .mobile-menu-toggle,
    .app-sidebar,
    .offcanvas,
    .app-topbar,
    .modal,
    .toast-container,
    .btn,
    .alert .btn-close {
        display: none !important;
    }

    #main-content {
        padding: 0 !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}

/* ==========================================
   ACCESSIBILITY IMPROVEMENTS
   ========================================== */

/* Focus visible for keyboard navigation */
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .btn::after {
        display: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid currentColor;
    }

    .btn {
        border: 2px solid currentColor;
    }
}

/* ==========================================
   MOBILE HEADER (New compact header for mobile)
   ========================================== */

.mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px;
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    margin: -1rem -1rem 1rem -1rem;
    border-radius: 0;
    position: sticky;
    top: 0;
    z-index: 1040;
}

@media (max-width: 575.98px) {
    .mobile-header {
        margin: -0.75rem -0.75rem 0.75rem -0.75rem;
    }
}

.mobile-page-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: -0.01em;
}

.mobile-avatar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f0f0ff 0%, #e8e8f8 100%);
    color: #667eea;
    font-size: 1.3rem;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.mobile-avatar-btn:hover,
.mobile-avatar-btn:active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

/* ==========================================
   MOBILE OFFCANVAS REDESIGN
   ========================================== */

.mobile-offcanvas-header {
    padding: 1.25rem 1.5rem;
    border-bottom: none;
    background: linear-gradient(135deg, #f8f9ff 0%, #fff 100%);
}

.mobile-offcanvas-body {
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* Organization card in mobile menu */
.mobile-org-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    margin: 0 12px 8px;
    background: linear-gradient(135deg, #f0f4ff 0%, #f8f0ff 100%);
    border-radius: 14px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    position: relative;
}

.mobile-org-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.mobile-org-info {
    flex-grow: 1;
    min-width: 0;
}

.mobile-org-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile navigation links */
.mobile-nav {
    padding: 4px 12px;
    flex-grow: 1;
}

.mobile-nav .nav-link {
    padding: 10px 14px;
    border-radius: 12px;
    margin-bottom: 2px;
    font-weight: 500;
    font-size: 0.95rem;
    color: #374151;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-nav .nav-link i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.mobile-nav .nav-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
    font-weight: 600;
}

.mobile-nav .nav-link:not(.active):hover {
    background: rgba(102, 126, 234, 0.06);
    color: #667eea;
    transform: translateX(4px);
}

.mobile-nav .nav-link.link-dark {
    color: #374151;
}

/* Section headers in mobile nav */
.mobile-nav-section {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #9CA3AF;
    padding: 16px 14px 6px;
    text-transform: uppercase;
    list-style: none;
}

/* Mobile menu footer */
.mobile-menu-footer {
    margin-top: auto;
    padding: 16px 20px;
    background: #f9fafb;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.mobile-menu-footer-link {
    display: block;
    padding: 8px 0;
    color: #6B7280;
    text-decoration: none;
    font-size: 0.9rem;
}

.mobile-menu-footer-link:hover {
    color: #667eea;
}

/* ==========================================
   KPI CARDS (Modern design with icons)
   ========================================== */

.kpi-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(0,0,0,0.04);
    height: 100%;
}

.kpi-card:active {
    transform: scale(0.98);
}

.kpi-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.kpi-card--primary .kpi-card__icon { background: rgba(59,130,246,0.1); color: #3B82F6; }
.kpi-card--danger .kpi-card__icon { background: rgba(239,68,68,0.1); color: #EF4444; }
.kpi-card--warning .kpi-card__icon { background: rgba(245,158,11,0.1); color: #F59E0B; }
.kpi-card--success .kpi-card__icon { background: rgba(34,197,94,0.1); color: #22C55E; }
.kpi-card--info .kpi-card__icon { background: rgba(14,165,233,0.1); color: #0EA5E9; }
.kpi-card--secondary .kpi-card__icon { background: rgba(107,114,128,0.1); color: #6B7280; }
.kpi-card--purple .kpi-card__icon { background: rgba(139,92,246,0.1); color: #8B5CF6; }
.kpi-card--teal .kpi-card__icon { background: rgba(20,184,166,0.1); color: #14B8A6; }

.kpi-card__content {
    min-width: 0;
    flex-grow: 1;
}

.kpi-card__value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    color: #1a1a2e;
}

.kpi-card--primary .kpi-card__value { color: #3B82F6; }
.kpi-card--danger .kpi-card__value { color: #EF4444; }
.kpi-card--warning .kpi-card__value { color: #F59E0B; }
.kpi-card--success .kpi-card__value { color: #22C55E; }
.kpi-card--info .kpi-card__value { color: #0EA5E9; }
.kpi-card--secondary .kpi-card__value { color: #6B7280; }
.kpi-card--purple .kpi-card__value { color: #8B5CF6; }
.kpi-card--teal .kpi-card__value { color: #14B8A6; }

.kpi-card__label {
    font-size: 0.78rem;
    color: #6B7280;
    margin-top: 3px;
    font-weight: 500;
}

/* ==========================================
   FLOATING ACTION BUTTON (FAB)
   ========================================== */

.mobile-fab {
    display: none;
}

@media (max-width: 767.98px) {
    .mobile-fab {
        display: flex;
        position: fixed;
        bottom: 24px;
        right: 24px;
        width: 56px;
        height: 56px;
        border-radius: 16px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: #fff;
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.45);
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        z-index: 1030;
        border: none;
        cursor: pointer;
        transition: all 0.2s ease;
        text-decoration: none;
    }

    .mobile-fab:hover,
    .mobile-fab:active {
        transform: scale(1.05);
        box-shadow: 0 8px 28px rgba(102, 126, 234, 0.55);
        color: #fff;
    }

    .mobile-fab:active {
        transform: scale(0.95);
    }
}

/* ==========================================
   GRADIENT BUTTONS
   ========================================== */

.btn-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.35);
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-gradient-primary:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    color: #fff;
    transform: translateY(-1px);
}

.btn-gradient-primary:active {
    transform: scale(0.98);
    color: #fff;
}

/* ==========================================
   MOBILE-SPECIFIC CARD IMPROVEMENTS
   ========================================== */

@media (max-width: 767.98px) {
    /* Enhanced cards on mobile */
    .card {
        border: none;
        border-radius: 16px;
        box-shadow: 0 2px 12px rgba(0,0,0,0.05);
        overflow: hidden;
    }

    .card-header {
        background: linear-gradient(135deg, #fafbff 0%, #fff 100%);
        border-bottom: 1px solid rgba(0,0,0,0.04);
        font-weight: 600;
    }

    /* Enhanced page headers */
    .border-bottom h1,
    .border-bottom .h2 {
        font-size: 1.35rem;
        font-weight: 700;
        color: #1a1a2e;
    }

    /* Hide the desktop topbar on mobile */
    .app-topbar.desktop-only {
        display: none !important;
    }

    /* Pill-style view toggles */
    .btn-group .btn-outline-primary,
    .btn-group .btn-outline-secondary {
        border-radius: 10px !important;
        font-weight: 500;
        border-color: rgba(0,0,0,0.1);
    }

    .btn-group .btn-outline-primary.active,
    .btn-group .btn-outline-secondary.active {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border-color: transparent;
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    }

    /* Better filter sections */
    .card-header[data-bs-toggle="collapse"] {
        cursor: pointer;
        padding: 14px 16px;
    }
}

/* ==========================================
   SCHEDULE PAGE MOBILE IMPROVEMENTS
   ========================================== */

@media (max-width: 767.98px) {
    /* Pill-style view toggle for schedule */
    #btn-view-calendar,
    #btn-view-grid {
        border-radius: 10px !important;
        padding: 8px 16px;
        font-weight: 600;
        font-size: 0.9rem;
    }

    /* Better empty state */
    .fc-daygrid-body-unbalanced .fc-daygrid-day-frame {
        min-height: 60px;
    }

    /* Specialist filter chip style */
    #master-filter {
        border-radius: 12px;
        border: 1px solid rgba(0,0,0,0.1);
        padding: 8px 16px;
        font-weight: 500;
        background-color: #fff;
        box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    }
}

/* ==========================================
   CLIENTS PAGE MOBILE IMPROVEMENTS
   ========================================== */

@media (max-width: 767.98px) {
    /* Client list as cards on mobile */
    .client-mobile-card {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        transition: background-color 0.15s ease;
    }

    .client-mobile-card:active {
        background-color: #f8f9ff;
    }

    .client-mobile-avatar {
        width: 44px;
        height: 44px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 1rem;
        flex-shrink: 0;
    }

    .client-mobile-info {
        flex-grow: 1;
        min-width: 0;
    }

    .client-mobile-name {
        font-weight: 600;
        font-size: 0.95rem;
        color: #1a1a2e;
    }

    .client-mobile-phone {
        font-size: 0.82rem;
        color: #6B7280;
    }

    /* Better action buttons layout */
    .page-actions-mobile {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }

    .page-actions-mobile .btn {
        border-radius: 10px;
        font-weight: 500;
        font-size: 0.85rem;
    }
}

/* ==========================================
   CHAT PAGE MOBILE IMPROVEMENTS
   ========================================== */

@media (max-width: 767.98px) {
    .stats-card {
        border-radius: 16px;
        border: none;
        box-shadow: 0 2px 12px rgba(0,0,0,0.05);
        background: #fff;
    }

    .stats-card .number {
        font-size: 2rem;
        font-weight: 700;
    }

    .filter-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }

    .filter-tabs .nav-link {
        white-space: nowrap;
        border-radius: 20px;
        padding: 6px 14px;
        font-size: 0.85rem;
    }
}

/* ==========================================
   DARK MODE SUPPORT (Future-ready)
   ========================================== */

@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here when needed */
    /* Currently disabled, but structure is ready */
}
