/**
 * Hotel Management System - Custom Styles
 * Mobile-first responsive design with Bootstrap integration
 */

/* ===================================
   CSS Variables (Custom Properties)
   =================================== */
:root {
    /* Brand Colors */
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;

    /* Neutral Colors */
    --text-dark: #333333;
    --text-muted: #666666;
    --text-light: #999999;
    --border-color: #e0e0e0;
    --background-light: #f8f9fa;
    --background-white: #ffffff;

    /* Status Colors */
    --success-color: #4caf50;
    --success-light: #e8f5e9;
    --success-dark: #2e7d32;
    --warning-color: #ff9800;
    --warning-light: #fff3e0;
    --error-color: #f44336;
    --error-light: #ffebee;
    --error-dark: #c62828;
    --info-color: #2196f3;
    --info-light: #e3f2fd;

    /* Spacing Scale */
    --spacing-xs: 0.25rem;  /* 4px */
    --spacing-sm: 0.5rem;   /* 8px */
    --spacing-md: 1rem;     /* 16px */
    --spacing-lg: 1.5rem;   /* 24px */
    --spacing-xl: 2rem;     /* 32px */
    --spacing-xxl: 3rem;    /* 48px */

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Font Sizes */
    --font-xs: 0.75rem;   /* 12px */
    --font-sm: 0.875rem;  /* 14px */
    --font-md: 1rem;      /* 16px */
    --font-lg: 1.125rem;  /* 18px */
    --font-xl: 1.5rem;    /* 24px */
    --font-xxl: 2rem;     /* 32px */
    --font-xxxl: 2.5rem;  /* 40px */
}

/* ===================================
   Global Reset & Base Styles
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: var(--font-md);
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--background-light);
    min-height: 100vh;
}

/* ===================================
   Responsive Grid System Utilities
   =================================== */
.container-fluid-custom {
    width: 100%;
    padding-right: var(--spacing-md);
    padding-left: var(--spacing-md);
    margin-right: auto;
    margin-left: auto;
}

.container-custom {
    width: 100%;
    padding-right: var(--spacing-md);
    padding-left: var(--spacing-md);
    margin-right: auto;
    margin-left: auto;
}

/* Mobile First - Container Max Widths */
@media (min-width: 576px) {
    .container-custom {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .container-custom {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .container-custom {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container-custom {
        max-width: 1140px;
    }
}

@media (min-width: 1400px) {
    .container-custom {
        max-width: 1320px;
    }
}

/* Custom Grid System */
.row-custom {
    display: flex;
    flex-wrap: wrap;
    margin-right: calc(-1 * var(--spacing-md));
    margin-left: calc(-1 * var(--spacing-md));
}

.col-custom {
    flex: 1 0 0%;
    padding-right: var(--spacing-md);
    padding-left: var(--spacing-md);
}

/* Mobile First Column Classes */
.col-12-custom { flex: 0 0 100%; max-width: 100%; }
.col-11-custom { flex: 0 0 91.666667%; max-width: 91.666667%; }
.col-10-custom { flex: 0 0 83.333333%; max-width: 83.333333%; }
.col-9-custom { flex: 0 0 75%; max-width: 75%; }
.col-8-custom { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-6-custom { flex: 0 0 50%; max-width: 50%; }
.col-4-custom { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-3-custom { flex: 0 0 25%; max-width: 25%; }

/* Responsive Column Classes - Small devices (≥576px) */
@media (min-width: 576px) {
    .col-sm-12 { flex: 0 0 100%; max-width: 100%; }
    .col-sm-6 { flex: 0 0 50%; max-width: 50%; }
    .col-sm-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-sm-3 { flex: 0 0 25%; max-width: 25%; }
}

/* Responsive Column Classes - Medium devices (≥768px) */
@media (min-width: 768px) {
    .col-md-12 { flex: 0 0 100%; max-width: 100%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
}

/* Responsive Column Classes - Large devices (≥992px) */
@media (min-width: 992px) {
    .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
    .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
    .col-lg-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
}

/* ===================================
   Utility Classes
   =================================== */

/* Spacing Utilities */
.m-0 { margin: 0 !important; }
.mt-1 { margin-top: var(--spacing-xs) !important; }
.mt-2 { margin-top: var(--spacing-sm) !important; }
.mt-3 { margin-top: var(--spacing-md) !important; }
.mt-4 { margin-top: var(--spacing-lg) !important; }
.mt-5 { margin-top: var(--spacing-xl) !important; }

.mb-1 { margin-bottom: var(--spacing-xs) !important; }
.mb-2 { margin-bottom: var(--spacing-sm) !important; }
.mb-3 { margin-bottom: var(--spacing-md) !important; }
.mb-4 { margin-bottom: var(--spacing-lg) !important; }
.mb-5 { margin-bottom: var(--spacing-xl) !important; }

.p-0 { padding: 0 !important; }
.pt-3 { padding-top: var(--spacing-md) !important; }
.pb-3 { padding-bottom: var(--spacing-md) !important; }
.p-3 { padding: var(--spacing-md) !important; }
.p-4 { padding: var(--spacing-lg) !important; }
.p-5 { padding: var(--spacing-xl) !important; }

/* Text Utilities */
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }

.text-primary { color: var(--primary-color) !important; }
.text-secondary { color: var(--secondary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--error-color) !important; }
.text-muted { color: var(--text-muted) !important; }

.font-weight-bold { font-weight: 700 !important; }
.font-weight-normal { font-weight: 400 !important; }

/* Display Utilities */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }

/* Flexbox Utilities */
.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.align-items-center { align-items: center !important; }
.flex-wrap { flex-wrap: wrap !important; }

/* Responsive Display Utilities */
@media (max-width: 767px) {
    .d-md-none { display: none !important; }
}

@media (min-width: 768px) {
    .d-md-block { display: block !important; }
    .d-md-flex { display: flex !important; }
}

/* ===================================
   Card Components
   =================================== */
.card-custom {
    background: var(--background-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card-custom:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-header-custom {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    background: var(--background-light);
    font-weight: 600;
}

.card-body-custom {
    padding: var(--spacing-lg);
}

.card-footer-custom {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    background: var(--background-light);
}

/* ===================================
   Button Components
   =================================== */
.btn-custom {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: var(--font-md);
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    line-height: 1.5;
}

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

.btn-primary-custom:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-success-custom {
    background: var(--success-color);
    color: white;
}

.btn-success-custom:hover {
    background: var(--success-dark);
}

.btn-outline-custom {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-custom:hover {
    background: var(--primary-color);
    color: white;
}

/* ===================================
   Form Components
   =================================== */
.form-group-custom {
    margin-bottom: var(--spacing-lg);
}

.form-label-custom {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: var(--text-dark);
}

.form-control-custom {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-md);
    line-height: 1.5;
    color: var(--text-dark);
    background-color: var(--background-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control-custom:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ===================================
   Alert Components
   =================================== */
.alert-custom {
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    border-radius: var(--radius-md);
    border-left: 4px solid;
}

.alert-success-custom {
    background: var(--success-light);
    border-color: var(--success-color);
    color: var(--success-dark);
}

.alert-danger-custom {
    background: var(--error-light);
    border-color: var(--error-color);
    color: var(--error-dark);
}

.alert-info-custom {
    background: var(--info-light);
    border-color: var(--info-color);
    color: #0d47a1;
}

/* ===================================
   Table Components
   =================================== */
.table-custom {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--spacing-lg);
    background: var(--background-white);
}

.table-custom thead {
    background: var(--background-light);
    border-bottom: 2px solid var(--border-color);
}

.table-custom th,
.table-custom td {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table-custom th {
    font-weight: 600;
    color: var(--text-dark);
}

.table-custom tbody tr:hover {
    background: var(--background-light);
}

/* Responsive Table */
@media (max-width: 767px) {
    .table-responsive-custom {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ===================================
   Mobile-First Responsive Utilities
   =================================== */

/* Hide on mobile */
@media (max-width: 575px) {
    .hide-mobile { display: none !important; }
}

/* Show only on mobile */
@media (min-width: 576px) {
    .show-mobile { display: none !important; }
}

/* ===================================
   Page Layout Components
   =================================== */
.page-header-custom {
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 2px solid var(--border-color);
}

.page-title-custom {
    font-size: var(--font-xxl);
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
}

.page-subtitle-custom {
    font-size: var(--font-lg);
    color: var(--text-muted);
}

/* ===================================
   Animation & Transitions
   =================================== */
.fade-in {
    animation: fadeIn var(--transition-normal);
}

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

/* ===================================
   Accessibility
   =================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===================================
   Navigation Styles - Responsive Design
   =================================== */

/* Main Header */
.main-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) 0;
    min-height: 70px;
}

/* Logo Styles */
.logo {
    color: white;
    font-size: var(--font-xl);
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: opacity var(--transition-normal);
}

.logo:hover {
    opacity: 0.9;
    color: white;
}

.logo:focus {
    outline: 2px solid white;
    outline-offset: 4px;
    border-radius: var(--radius-sm);
}

/* Main Navigation */
.main-nav {
    background: rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 0;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    display: block;
    color: white;
    text-decoration: none;
    padding: var(--spacing-md) var(--spacing-lg);
    font-weight: 500;
    transition: all var(--transition-normal);
    border-radius: 0;
    position: relative;
}

.nav-menu a:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.nav-menu a:focus {
    outline: 2px solid white;
    outline-offset: -2px;
}

.nav-menu a.active {
    background: rgba(255, 255, 255, 0.25);
    border-bottom: 3px solid white;
}

.nav-menu a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: white;
    border-radius: 0 2px 2px 0;
}

/* User Section */
.user-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    color: white;
}

.user-info {
    font-size: var(--font-sm);
    text-align: right;
}

.user-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.user-role {
    font-size: var(--font-xs);
    opacity: 0.9;
    text-transform: capitalize;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: var(--font-sm);
    font-weight: 500;
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-logout:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Mobile Menu Toggle */
.mobile-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: var(--font-xl);
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.mobile-toggle:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

.mobile-toggle[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.3);
}

/* Hamburger Icon Animation */
.hamburger {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 24px;
}

.hamburger span {
    display: block;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all var(--transition-normal);
}

.mobile-toggle[aria-expanded="true"] .hamburger span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-toggle[aria-expanded="true"] .hamburger span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle[aria-expanded="true"] .hamburger span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Content Area */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-md);
}

/* ===================================
   Responsive Breakpoints
   =================================== */

/* Tablet and Below (≤992px) */
@media (max-width: 992px) {
    .header-top {
        padding: var(--spacing-sm) 0;
    }

    .logo {
        font-size: var(--font-lg);
    }

    .nav-menu a {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: var(--font-sm);
    }
}

/* Mobile Devices (≤768px) */
@media (max-width: 768px) {
    .mobile-toggle {
        display: flex;
    }

    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--transition-normal) ease-in-out;
    }

    .main-nav.active {
        max-height: 500px;
    }

    .nav-menu {
        flex-direction: column;
        gap: 0;
        padding: var(--spacing-sm) 0;
    }

    .nav-menu li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .nav-menu a {
        padding: var(--spacing-md) var(--spacing-lg);
        font-size: var(--font-md);
    }

    .nav-menu a.active::before {
        display: none;
    }

    .user-section {
        gap: var(--spacing-sm);
    }

    .user-info {
        display: none;
    }

    .main-content {
        padding: var(--spacing-lg) var(--spacing-md);
    }
}

/* Small Mobile Devices (≤480px) */
@media (max-width: 480px) {
    .logo {
        font-size: var(--font-md);
        gap: 6px;
    }

    .btn-logout {
        padding: var(--spacing-sm);
        font-size: var(--font-xs);
    }

    .main-content {
        padding: var(--spacing-md) var(--spacing-sm);
    }
}

/* Landscape Mobile (max-height: 500px) */
@media (max-height: 500px) and (orientation: landscape) {
    .main-nav.active {
        max-height: 300px;
        overflow-y: auto;
    }
}

/* ===================================
   Accessibility Enhancements
   =================================== */

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: var(--spacing-sm) var(--spacing-md);
    text-decoration: none;
    border-radius: 0 0 var(--radius-md) 0;
    z-index: 1001;
    transition: top var(--transition-fast);
}

.skip-to-main:focus {
    top: 0;
    outline: 2px solid white;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .main-nav a {
        border: 1px solid transparent;
    }

    .main-nav a:focus,
    .main-nav a:hover {
        border-color: white;
    }

    .nav-menu a.active {
        border: 2px solid white;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .main-nav {
        transition: none;
    }
}

/* ===================================
   Print Styles
   =================================== */
@media print {
    body {
        background: white;
    }

    .no-print,
    .main-header,
    .mobile-toggle,
    .btn-logout {
        display: none !important;
    }

    .main-content {
        padding: 0;
        max-width: 100%;
    }
}

/* ===================================
   STEP 52: ENHANCED MOBILE-RESPONSIVE ADJUSTMENTS
   Advanced mobile optimizations for all interfaces
   =================================== */

/* ===================================
   Touch-Friendly Controls
   =================================== */

/* Minimum touch target size: 44x44px (iOS/Android guidelines) */
.btn,
.btn-custom,
button,
a.btn,
input[type="submit"],
input[type="button"],
input[type="reset"],
.mobile-touch-target {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Touch-friendly form controls on mobile */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    input[type="datetime-local"],
    select,
    textarea,
    .form-control,
    .form-select {
        min-height: 44px;
        font-size: 16px; /* Prevent iOS zoom on input focus */
        padding: 12px 16px;
    }

    /* Larger checkboxes and radio buttons */
    input[type="checkbox"],
    input[type="radio"] {
        min-width: 20px;
        min-height: 20px;
        margin-right: 10px;
    }

    /* Better spacing for labels */
    label {
        margin-bottom: 8px;
        font-size: 14px;
        font-weight: 500;
    }
}

/* ===================================
   Responsive Tables - Mobile Optimization
   =================================== */

/* Responsive table wrapper with horizontal scroll */
.table-responsive-mobile {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .table-responsive-mobile {
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        margin-bottom: var(--spacing-lg);
    }

    /* Card-style tables for mobile */
    .table-mobile-cards {
        display: block;
    }

    .table-mobile-cards thead {
        display: none;
    }

    .table-mobile-cards tbody,
    .table-mobile-cards tr,
    .table-mobile-cards td {
        display: block;
        width: 100%;
    }

    .table-mobile-cards tr {
        margin-bottom: var(--spacing-lg);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: var(--spacing-md);
        background: var(--background-white);
        box-shadow: var(--shadow-sm);
    }

    .table-mobile-cards td {
        text-align: right;
        padding: var(--spacing-sm) 0;
        border-bottom: 1px solid var(--border-color);
        position: relative;
        padding-left: 50%;
    }

    .table-mobile-cards td:last-child {
        border-bottom: none;
    }

    .table-mobile-cards td:before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 45%;
        padding-right: 10px;
        font-weight: 600;
        text-align: left;
        color: var(--text-dark);
    }
}

/* ===================================
   Mobile-Optimized Cards and Panels
   =================================== */

@media (max-width: 768px) {
    .card,
    .card-custom {
        margin-bottom: var(--spacing-md);
    }

    .card-body,
    .card-body-custom {
        padding: var(--spacing-md);
    }

    .card-header,
    .card-header-custom {
        padding: var(--spacing-md);
        font-size: var(--font-md);
    }

    /* Stack card elements vertically on mobile */
    .card-body .row {
        margin-left: 0;
        margin-right: 0;
    }

    .card-body .row > [class*="col-"] {
        padding-left: 0;
        padding-right: 0;
        margin-bottom: var(--spacing-sm);
    }
}

/* ===================================
   Mobile Navigation Enhancements
   =================================== */

@media (max-width: 768px) {
    /* Improve tap targets in mobile menu */
    .nav-menu a {
        padding: var(--spacing-lg) var(--spacing-xl);
        font-size: var(--font-lg);
        position: relative;
    }

    /* Add visual feedback for touch */
    .nav-menu a:active {
        background: rgba(255, 255, 255, 0.3);
    }

    /* Better visual separation */
    .nav-menu li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    }
}

/* ===================================
   Mobile Form Layout Optimizations
   =================================== */

@media (max-width: 768px) {
    /* Stack form rows vertically */
    .row.form-row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: var(--spacing-md);
    }

    /* Full-width buttons on mobile */
    .btn-block-mobile {
        display: block;
        width: 100%;
        margin-bottom: var(--spacing-sm);
    }

    /* Button groups stack vertically */
    .btn-group {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .btn-group .btn {
        width: 100%;
        border-radius: var(--radius-md) !important;
    }

    /* Form actions at bottom */
    .form-actions {
        position: sticky;
        bottom: 0;
        background: var(--background-white);
        padding: var(--spacing-md);
        border-top: 2px solid var(--border-color);
        box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.1);
        margin-left: calc(-1 * var(--spacing-md));
        margin-right: calc(-1 * var(--spacing-md));
        z-index: 10;
    }
}

/* ===================================
   Mobile Modal and Dialog Optimizations
   =================================== */

@media (max-width: 768px) {
    .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100vh;
    }

    .modal-content {
        height: 100vh;
        border-radius: 0;
        border: none;
    }

    .modal-body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-footer {
        position: sticky;
        bottom: 0;
        background: var(--background-white);
        border-top: 2px solid var(--border-color);
        box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.05);
    }
}

/* ===================================
   Mobile Dashboard Widget Optimizations
   =================================== */

@media (max-width: 768px) {
    /* Stack dashboard widgets */
    .dashboard-widget,
    .widget,
    .stat-card {
        margin-bottom: var(--spacing-md);
    }

    /* Smaller stat cards on mobile */
    .stat-card {
        padding: var(--spacing-md);
    }

    .stat-card .stat-value {
        font-size: var(--font-xl);
    }

    .stat-card .stat-label {
        font-size: var(--font-sm);
    }

    /* Compact charts on mobile */
    .chart-container {
        height: 250px !important;
        margin-bottom: var(--spacing-md);
    }
}

/* ===================================
   Mobile Data Display Utilities
   =================================== */

@media (max-width: 768px) {
    /* Hide less critical columns on mobile */
    .hide-mobile,
    .d-none-mobile {
        display: none !important;
    }

    /* Show mobile-specific content */
    .show-mobile,
    .d-block-mobile {
        display: block !important;
    }

    /* Truncate long text on mobile */
    .truncate-mobile {
        max-width: 200px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Reduce font sizes for dense content */
    .table-sm td,
    .table-sm th {
        font-size: var(--font-xs);
        padding: var(--spacing-xs);
    }
}

/* ===================================
   Mobile Page Layout Adjustments
   =================================== */

@media (max-width: 768px) {
    /* Reduce page header size */
    .page-title-custom {
        font-size: var(--font-xl);
        margin-bottom: var(--spacing-sm);
    }

    .page-subtitle-custom {
        font-size: var(--font-md);
    }

    .page-header-custom {
        margin-bottom: var(--spacing-lg);
        padding-bottom: var(--spacing-md);
    }

    /* Adjust container padding */
    .container,
    .container-fluid {
        padding-left: var(--spacing-sm);
        padding-right: var(--spacing-sm);
    }

    .main-content {
        padding: var(--spacing-md) var(--spacing-sm);
    }
}

/* ===================================
   Mobile Alert and Notification Styles
   =================================== */

@media (max-width: 768px) {
    .alert,
    .alert-custom {
        padding: var(--spacing-md);
        font-size: var(--font-sm);
        margin-bottom: var(--spacing-md);
    }

    .alert-dismissible .btn-close {
        padding: var(--spacing-md);
        width: 44px;
        height: 44px;
    }

    /* Toast notifications on mobile */
    .toast {
        max-width: calc(100vw - 32px);
        margin: var(--spacing-md);
    }
}

/* ===================================
   Mobile Badges and Status Indicators
   =================================== */

@media (max-width: 768px) {
    .badge {
        font-size: var(--font-xs);
        padding: 4px 8px;
    }

    .badge-lg {
        font-size: var(--font-sm);
        padding: 6px 12px;
    }
}

/* ===================================
   Mobile Breadcrumb Navigation
   =================================== */

@media (max-width: 768px) {
    .breadcrumb {
        font-size: var(--font-sm);
        padding: var(--spacing-sm);
        margin-bottom: var(--spacing-md);
    }

    .breadcrumb-item {
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* ===================================
   Mobile Loading States
   =================================== */

@media (max-width: 768px) {
    .spinner-border,
    .spinner-grow {
        width: 2rem;
        height: 2rem;
    }

    .spinner-border-sm,
    .spinner-grow-sm {
        width: 1rem;
        height: 1rem;
    }
}

/* ===================================
   Mobile Pagination
   =================================== */

@media (max-width: 768px) {
    .pagination {
        font-size: var(--font-sm);
    }

    .page-link {
        padding: var(--spacing-sm) var(--spacing-md);
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Show only essential pagination items on small screens */
    .pagination-sm .page-item:not(.active):not(.disabled):not(:first-child):not(:last-child) {
        display: none;
    }
}

/* ===================================
   Mobile Search and Filter Bars
   =================================== */

@media (max-width: 768px) {
    .search-bar,
    .filter-bar {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .search-bar input,
    .filter-bar select {
        width: 100%;
        margin-bottom: var(--spacing-sm);
    }

    .search-bar .btn,
    .filter-bar .btn {
        width: 100%;
    }
}

/* ===================================
   Horizontal Scroll Hint for Tables
   =================================== */

@media (max-width: 768px) {
    .table-scroll-hint {
        position: relative;
    }

    .table-scroll-hint::after {
        content: '← Scroll →';
        position: absolute;
        bottom: -25px;
        left: 50%;
        transform: translateX(-50%);
        font-size: var(--font-xs);
        color: var(--text-muted);
        background: var(--background-light);
        padding: 4px 12px;
        border-radius: var(--radius-md);
        opacity: 0.8;
    }
}

/* ===================================
   Mobile Action Sheets / Bottom Sheets
   =================================== */

@media (max-width: 768px) {
    .action-sheet {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--background-white);
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.2);
        padding: var(--spacing-lg);
        transform: translateY(100%);
        transition: transform var(--transition-normal);
        z-index: 1050;
    }

    .action-sheet.active {
        transform: translateY(0);
    }

    .action-sheet-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: var(--spacing-md);
        padding-bottom: var(--spacing-md);
        border-bottom: 1px solid var(--border-color);
    }

    .action-sheet-title {
        font-size: var(--font-lg);
        font-weight: 600;
    }

    .action-sheet-close {
        background: none;
        border: none;
        font-size: var(--font-xl);
        color: var(--text-muted);
        cursor: pointer;
        padding: 0;
        min-width: 44px;
        min-height: 44px;
    }
}

/* ===================================
   Mobile Dropdown Improvements
   =================================== */

@media (max-width: 768px) {
    .dropdown-menu {
        max-height: 70vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .dropdown-item {
        padding: var(--spacing-md);
        font-size: var(--font-md);
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* ===================================
   Safe Area Insets for Notched Devices
   =================================== */

@supports (padding-top: env(safe-area-inset-top)) {
    .main-header {
        padding-top: env(safe-area-inset-top);
    }

    .main-content {
        padding-left: max(var(--spacing-md), env(safe-area-inset-left));
        padding-right: max(var(--spacing-md), env(safe-area-inset-right));
        padding-bottom: max(var(--spacing-xl), env(safe-area-inset-bottom));
    }
}

/* ===================================
   Prevent Text Selection on Touch Targets
   =================================== */

@media (max-width: 768px) {
    .btn,
    button,
    .mobile-toggle,
    .nav-menu a {
        -webkit-tap-highlight-color: rgba(102, 126, 234, 0.2);
        -webkit-touch-callout: none;
        user-select: none;
    }
}

/* ===================================
   Mobile Landscape Optimizations
   =================================== */

@media (max-width: 768px) and (orientation: landscape) {
    .main-header {
        position: fixed;
        width: 100%;
    }

    .main-content {
        padding-top: calc(70px + var(--spacing-md));
    }

    .modal-content {
        max-height: 100vh;
        overflow-y: auto;
    }
}

/* ===================================
   Dark Mode Support for Mobile Devices
   =================================== */

@media (prefers-color-scheme: dark) and (max-width: 768px) {
    /* Optional: Add dark mode styles if needed */
    /* This section can be expanded based on requirements */
}
