/*
 * St. Ann's Unified Billing System
 * Main Stylesheet
 * Professional and Modern UI Design
 */

/* ==================== ROOT VARIABLES ==================== */
:root {
    /* Primary Colors */
    --primary-color: #4A90E2;
    --secondary-color: #50C878;
    --accent-color: #FF6B6B;
    
    /* Business Unit Colors */
    --bakery-color: #FF6B6B;
    --restaurant-color: #4ECDC4;
    --bormey-color: #95E1D3;
    
    /* Neutral Colors */
    --dark: #2C3E50;
    --light: #ECF0F1;
    --gray: #95A5A6;
    --white: #FFFFFF;
    
    /* Status Colors */
    --success: #27AE60;
    --warning: #F39C12;
    --danger: #E74C3C;
    --info: #3498DB;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    
    /* Borders */
    --border-radius: 8px;
    --border-color: #dee2e6;
    
    /* Transitions */
    --transition: all 0.3s ease;
}

/* ==================== GLOBAL STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--dark);
    background-color: #f5f6fa;
}

img,
svg,
video,
canvas {
    max-width: 100%;
    height: auto;
}

input,
select,
textarea {
    max-width: 100%;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--accent-color);
}

/* ==================== ACCESSIBILITY ==================== */
/* Screen reader only - visually hidden but accessible to assistive technologies */
.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;
}

/* ==================== LOGIN PAGE ==================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 450px;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo img {
    max-width: 120px;
    margin-bottom: 20px;
}

.login-logo h2 {
    color: var(--dark);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
}

.login-logo p {
    color: var(--gray);
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.input-group {
    position: relative;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
}

.input-group .form-control {
    padding-left: 45px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
    width: 100%;
}

.btn-primary:hover {
    background: #3a7bc8;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-warning {
    background: var(--warning);
    color: var(--white);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-secondary {
    background: var(--gray);
    color: var(--white);
}

/* ==================== ALERT MESSAGES ==================== */
.alert {
    padding: 12px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
}

.btn-close:hover {
    opacity: 1;
}

/* ==================== DASHBOARD LAYOUT ==================== */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #2C3E50 0%, #34495E 100%);
    color: var(--white);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.sidebar-logo h3 {
    font-size: 18px;
    font-weight: 600;
}

.sidebar-menu {
    padding: 20px 0;
}

.menu-section {
    margin-bottom: 25px;
}

.menu-section-title {
    padding: 10px 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
    cursor: pointer;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    padding-left: 25px;
}

.menu-item.active {
    background: rgba(74, 144, 226, 0.2);
    border-left: 3px solid var(--primary-color);
    color: var(--white);
}

.menu-item i {
    width: 20px;
    margin-right: 12px;
    font-size: 16px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    transition: var(--transition);
}

/* Topbar */
.topbar {
    background: var(--white);
    padding: 15px 30px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 999;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.page-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--dark);
}

.breadcrumb {
    display: flex;
    gap: 8px;
    font-size: 13px;
    color: var(--gray);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.user-profile:hover {
    background: var(--light);
}

.user-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

.user-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
}

.user-info p {
    font-size: 12px;
    color: var(--gray);
}

/* User Profile Dropdown */
.user-profile {
    position: relative;
}

.user-profile .fa-chevron-down {
    transition: transform 0.3s ease, color 0.2s ease;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
}

.user-profile .fa-chevron-down:hover {
    color: var(--primary-color) !important;
    background: var(--light);
}

.user-profile.active .fa-chevron-down {
    transform: rotate(180deg);
    color: var(--primary-color) !important;
}

.user-profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    z-index: 10001;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
}

.user-profile-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--light);
    border-bottom: 1px solid var(--border-color);
}

.dropdown-header .user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.dropdown-user-info {
    flex: 1;
}

.dropdown-user-info h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    margin: 0 0 5px 0;
}

.dropdown-user-info p {
    font-size: 12px;
    color: var(--gray);
    margin: 0 0 8px 0;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--dark);
    text-decoration: none;
    transition: var(--transition);
    font-size: 14px;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background: var(--light);
    color: var(--primary-color);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--gray);
}

.dropdown-item:hover i {
    color: var(--primary-color);
}

.dropdown-item.logout-item {
    color: var(--danger);
}

.dropdown-item.logout-item:hover {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger);
}

.dropdown-item.logout-item i {
    color: var(--danger);
}

/* Content Area */
.content {
    padding: 30px;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 25px;
    margin-bottom: 25px;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
}

.card-body {
    padding: 0;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--white);
}

.stat-icon.bakery {
    background: linear-gradient(135deg, var(--bakery-color), #ff8787);
}

.stat-icon.restaurant {
    background: linear-gradient(135deg, var(--restaurant-color), #6fd4ce);
}

.stat-icon.bormey {
    background: linear-gradient(135deg, var(--bormey-color), #a8e6db);
}

.stat-icon.primary {
    background: linear-gradient(135deg, var(--primary-color), #6ba3e9);
}

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 5px;
}

.stat-info p {
    font-size: 14px;
    color: var(--gray);
}

/* Table */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.table thead {
    background: var(--light);
}

.table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--dark);
    border-bottom: 2px solid var(--border-color);
}

.table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--dark);
}

.table tbody tr:hover {
    background: rgba(74, 144, 226, 0.05);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.bg-success {
    background: var(--success);
    color: var(--white);
}

.bg-warning {
    background: var(--warning);
    color: var(--white);
}

.bg-danger {
    background: var(--danger);
    color: var(--white);
}

.bg-info {
    background: var(--info);
    color: var(--white);
}

.bg-primary {
    background: var(--primary-color);
    color: var(--white);
}

.bg-secondary {
    background: var(--gray);
    color: var(--white);
}

/* Buttons Group */
.btn-group {
    display: flex;
    gap: 10px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-icon {
    width: 35px;
    height: 35px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 30px;
    max-width: 600px;
    width: 90%;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
}

/* ==================== MOBILE RESPONSIVE STYLES ==================== */

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none !important;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    background: linear-gradient(135deg, var(--primary-color) 0%, #357ABD 100%);
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    cursor: pointer;
    font-size: 22px;
    transition: all 0.3s ease;
    outline: none;
}

.mobile-menu-toggle:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
    transform: translateY(-2px);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

.mobile-menu-toggle i {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tablet Screens (768px - 1024px) */
@media (max-width: 1024px) {
    .dashboard-wrapper {
        display: flex;
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        left: 0;
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    /* Tables responsive */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
}

/* Mobile Screens (max-width: 768px) */
@media (max-width: 768px) {
    /* Hide sidebar by default on mobile */
    .sidebar {
        position: fixed;
        transform: translateX(-100%);
        left: 0;
        top: 0;
        width: 280px;
        height: 100vh;
        z-index: 9998;
        transition: transform 0.3s ease;
        overflow-y: auto;
        background: #2C3E50;
    }
    
    .sidebar.active {
        transform: translateX(0);
        box-shadow: 2px 0 20px rgba(0,0,0,0.5);
    }
    
    /* Mobile menu toggle */
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    
    /* Overlay for sidebar */
    body.sidebar-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.6);
        z-index: 9997;
        animation: fadeIn 0.3s ease;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    /* Topbar mobile */
    .topbar {
        padding: 10px 15px;
        flex-wrap: wrap;
        position: sticky;
        top: 0;
        z-index: 100;
        background: var(--white);
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .topbar-left h2 {
        font-size: 18px;
    }
    
    .topbar-left .breadcrumb {
        font-size: 11px;
    }
    
    .topbar-right {
        gap: 10px;
    }
    
    .topbar-right .user-profile {
        padding: 5px 10px;
    }
    
    .topbar-right .user-avatar {
        width: 35px;
        height: 35px;
        min-width: 35px;
        min-height: 35px;
    }
    
    /* User Profile Dropdown - Mobile */
    .user-profile-dropdown {
        right: 10px;
        left: auto;
        min-width: 260px;
        max-width: calc(100vw - 20px);
        top: calc(100% + 5px);
    }
    
    .user-profile .user-info {
        display: none;
    }
    
    /* Content padding */
    .content {
        padding: 15px 10px;
    }
    
    /* Stats grid - single column on mobile */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-info h3 {
        font-size: 24px;
    }
    
    /* Cards */
    .card {
        margin-bottom: 15px;
        border-radius: 8px;
    }
    
    .card-header {
        padding: 12px 15px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .card-title {
        font-size: 16px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    /* Forms - full width on mobile */
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-control, 
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
        width: 100%;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-row .form-group {
        width: 100% !important;
    }

    /* Flex layouts from inline styles */
    div[style*="display: flex"] {
        flex-wrap: wrap !important;
        gap: 10px;
    }

    /* Prevent fixed-width inputs breaking layout */
    input[style*="width"],
    select[style*="width"],
    textarea[style*="width"] {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Buttons - full width and touch-friendly */
    .btn {
        padding: 12px 20px;
        font-size: 14px;
        min-height: 44px; /* Touch target size */
        width: 100%;
        margin-bottom: 10px;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
        margin-right: 0;
        margin-bottom: 8px;
    }
    
    .btn-sm {
        padding: 8px 12px;
        min-height: 36px;
        width: auto;
    }
    
    /* Tables - scroll horizontally */
    .table-responsive,
    .card-body > table,
    div[style*="overflow"] {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        display: block;
        width: 100%;
    }

    .table,
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
    }
    
    table {
        min-width: 600px;
        font-size: 13px;
    }
    
    table th,
    table td {
        padding: 10px 8px;
        white-space: nowrap;
    }

    /* Common action rows */
    .action-bar,
    .filters,
    .form-inline {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    /* Grid layouts - single column */
    div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Finance stats grid */
    .finance-stats-grid {
        grid-template-columns: 1fr !important;
    }
    
    .finance-stat-card {
        padding: 15px;
    }
    
    /* Modal - full screen on mobile */
    .modal {
        padding: 0;
    }
    
    .modal-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
        overflow-y: auto;
    }
    
    .modal-header {
        padding: 12px 15px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-footer {
        padding: 12px 15px;
        flex-wrap: wrap;
    }
    
    /* POS Items Grid */
    .pos-items,
    div[style*="display: grid"][style*="300px"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }
    
    .pos-item,
    .menu-item {
        padding: 12px;
    }
    
    /* Cart sidebar on mobile - full width bottom sheet */
    .pos-cart,
    .cart-sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 50vh;
        overflow-y: auto;
        z-index: 100;
        border-radius: 20px 20px 0 0;
    }
    
    /* Login page */
    .login-container {
        padding: 15px;
    }
    
    .login-box {
        padding: 25px 20px;
    }
    
    /* Alert messages */
    .alert {
        padding: 12px;
        font-size: 13px;
        border-radius: 6px;
    }
    
    /* Badge sizing */
    .badge {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    /* Hide less important columns on mobile */
    .hide-mobile {
        display: none !important;
    }
    
    /* Improve touch targets */
    a, button, input[type="submit"], input[type="button"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Text sizing for mobile */
    h1 { font-size: 24px; }
    h2 { font-size: 20px; }
    h3 { font-size: 18px; }
    h4 { font-size: 16px; }
    h5 { font-size: 14px; }
    h6 { font-size: 13px; }
}

/* Small Mobile Screens (max-width: 480px) */
@media (max-width: 480px) {
    /* Ensure menu button is visible */
    .mobile-menu-toggle {
        display: flex !important;
        bottom: 15px;
        right: 15px;
        width: 56px;
        height: 56px;
        font-size: 20px;
    }
    
    body {
        font-size: 13px;
    }
    
    .content {
        padding: 10px 8px;
    }
    
    .topbar {
        padding: 8px 10px;
    }
    
    .topbar-left h2 {
        font-size: 16px;
    }
    
    /* Single column for all grids */
    .pos-items,
    div[style*="display: grid"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Stack financial cards */
    .finance-stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .finance-stat-icon {
        margin-bottom: 10px;
    }
    
    /* Full width buttons */
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        width: 100%;
        margin-bottom: 8px;
    }
    
    /* Smaller stat cards */
    .stat-card {
        padding: 12px;
    }
    
    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .stat-info h3 {
        font-size: 20px;
    }
    
    .stat-info p {
        font-size: 12px;
    }
    
    /* Table font size */
    table {
        font-size: 12px;
    }
    
    table th,
    table td {
        padding: 8px 5px;
    }
    
    /* Modal close button */
    .close {
        font-size: 28px;
        padding: 10px;
    }
}

/* Landscape mode for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .sidebar {
        width: 240px;
    }
    
    .topbar {
        padding: 8px 15px;
    }
    
    .content {
        padding: 10px;
    }
    
    .pos-items {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    button, a, input, select, textarea {
        min-height: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .btn:hover,
    .card:hover {
        transform: none;
    }
    
    /* Make scrollable areas more obvious */
    .table-responsive,
    .modal-body {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

.flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.items-center {
    align-items: center;
}

.gap-10 {
    gap: 10px;
}

