/* ================================================
   PHARMACY MANAGEMENT SYSTEM - MAIN STYLESHEET
   Modern, responsive, pharmacy-themed design
   ================================================ */

/* ===== CSS VARIABLES ===== */
:root {
    --primary-color: #2563eb;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --success-color: #10b981;
    --info-color: #3b82f6;
    
    --dark-bg: #1f2937;
    --light-bg: #f9fafb;
    --white: #ffffff;
    --border-color: #e5e7eb;
    
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    --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: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--light-bg);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: #1d4ed8;
}

/* ===== AUTHENTICATION PAGES ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.auth-container {
    max-width: 1200px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.auth-box {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-xl);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.auth-header h1 {
    font-size: 28px;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.role-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.role-tab {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--white);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
}

.role-tab:hover {
    border-color: var(--primary-color);
    background: #eff6ff;
}

.role-tab.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: var(--white);
}

.role-tab i {
    margin-right: 5px;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.auth-form label i {
    margin-right: 5px;
    color: var(--text-secondary);
}

.auth-form input,
.auth-form textarea,
.auth-form select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: var(--transition);
}

.auth-form input:focus,
.auth-form textarea:focus,
.auth-form select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.password-input {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 5px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 14px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    width: auto;
}

.forgot-link {
    color: var(--primary-color);
    font-size: 14px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-info {
    color: var(--white);
}

.auth-info h2 {
    font-size: 32px;
    margin-bottom: 15px;
}

.auth-info > p {
    font-size: 18px;
    margin-bottom: 40px;
    opacity: 0.9;
}

.features {
    display: grid;
    gap: 25px;
}

.feature {
    display: flex;
    gap: 15px;
    align-items: start;
}

.feature i {
    font-size: 32px;
    opacity: 0.9;
}

.feature h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

.feature p {
    font-size: 14px;
    opacity: 0.8;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-secondary:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger-color);
    color: var(--white);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: var(--warning-color);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--white);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* ===== ALERTS ===== */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert i {
    font-size: 18px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* ===== DASHBOARD LAYOUT ===== */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: var(--transition);
    z-index: 100;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    padding: 0;
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255,255,255,0.05);
}

.sidebar-header h2 {
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Logo Section Styles */
.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.logo-icon i {
    font-size: 24px;
    color: #667eea;
}

.logo-text h2 {
    color: white;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.logo-text p {
    color: rgba(255,255,255,0.8);
    font-size: 11px;
    margin: 2px 0 0 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

/* Sidebar Profile Section */
.sidebar-profile {
    padding: 20px;
    margin: 20px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: white;
    color: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    flex-shrink: 0;
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info h4 {
    color: white;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.profile-info p {
    color: rgba(255,255,255,0.7);
    font-size: 11px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.sidebar-nav {
    padding: 10px 0 20px 0;
}

.nav-item {
    display: flex;
    padding: 14px 20px;
    margin: 5px 15px;
    color: rgba(255, 255, 255, 0.9);
    transition: var(--transition);
    align-items: center;
    gap: 12px;
    border-radius: 10px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: white;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    transform: translateX(5px);
}

.nav-item:hover::before {
    transform: scaleY(1);
}

.nav-item.active {
    background: white;
    color: #667eea;
    font-weight: 600;
}

.nav-item.active::before {
    transform: scaleY(1);
    background: #667eea;
}

.nav-item i {
    width: 20px;
    font-size: 18px;
}

.main-content {
    flex: 1;
    margin-left: 280px;
    transition: var(--transition);
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.topbar {
    background: var(--white);
    padding: 15px 30px;
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.topbar-left h1 {
    font-size: 24px;
    color: var(--text-primary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.user-menu:hover {
    background: var(--light-bg);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.content-area {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.content-wrapper {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Page Header Styling */
.page-header {
    background: white;
    border-radius: 12px;
    padding: 25px 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid #667eea;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header h1 i {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header p {
    color: #6b7280;
    margin: 0;
    font-size: 14px;
}

/* ===== CARDS ===== */
.card {
    background: var(--white);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 25px;
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f3f4f6;
}

.card-header h3 {
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 600;
}

.card-body {
    padding: 0;
}

/* Filter Cards */
.filter-card {linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    color: white;
    border: none;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.35);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
}

.stat-details h4 {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 5px;
    font-weight: 500;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: white;
}

/* Alternative stat card styles */
.stats-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.stats-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-3px);
}

.stats-card p {
    margin: 0 0 10px 0;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
}

.stats-card h3 {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f3f4f6;
}

/* ===== 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(--radius-lg);
    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-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.stat-icon.blue {
    background: #dbeafe;
    color: #2563eb;
}

.stat-icon.green {
    background: #d1fae5;
    color: #10b981;
}

.stat-icon.orange {
    background: #fed7aa;
    color: #f59e0b;
}

.stat-icon.red {
    background: #fee2e2;
    color: #ef4444;
}

.stat-details h4 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.stat-details .stat-value {
    font-size: 28px;
    font-weight: bold;
    color: var(--text-primary);
}

/* ===== TABLES ===== */
.table-container {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

table th {
    padding: 16px 15px;
    text-align: left;
    font-weight: 600;
    color: white;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}

table tbody tr:hover {
    background-color: #f9fafb;
    transform: scale(1.01);
}

table tbody tr:last-child {
    border-bottom: none;
}

table td {
    padding: 15px;
    font-size: 14px;
    color: #374151;
}

table td img {
    border-radius: 6px;
    object-fit: cover;
}

/* Table Actions */
.table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.table-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
}
}

table tbody tr:hover {
    background: var(--light-bg);
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-secondary {
    background: #e5e7eb;
    color: #374151;
}

/* ===== RESPONSIVE ===== */

/* Floating Burger Button */
.floating-burger-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 9999;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.floating-burger-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.floating-burger-btn.active {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.burger-line {
    width: 24px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.floating-burger-btn.active .burger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.floating-burger-btn.active .burger-line:nth-child(2) {
    opacity: 0;
}

.floating-burger-btn.active .burger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Burger Navigation Overlay */
.burger-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9997;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.burger-nav-overlay.active {
    display: block;
    opacity: 1;
}

/* Burger Navigation Menu */
.burger-nav-menu {
    position: fixed;
    top: 0;
    left: -320px;
    width: 280px;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 9998;
    overflow-y: auto;
    transition: left 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 4px 0 15px rgba(0,0,0,0.3);
}

.burger-nav-menu.active {
    left: 0;
}

.burger-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.burger-nav-header h3 {
    margin: 0;
    color: white;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.burger-close-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.burger-close-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

.burger-nav-items {
    padding: 10px 0;
}

.burger-nav-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.burger-nav-link:hover {
    background: rgba(255,255,255,0.15);
    border-left-color: white;
    padding-left: 25px;
}

.burger-nav-link i {
    font-size: 20px;
    width: 25px;
    text-align: center;
}

.burger-nav-link span {
    font-size: 15px;
    font-weight: 500;
}

.burger-nav-logout {
    margin-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 20px !important;
}

.burger-nav-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    border-left-color: #ef4444;
}

/* Responsive Tables - Mobile & Tablet Friendly */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

.table-responsive table {
    min-width: 100%;
    margin-bottom: 0;
}

/* Table Container Wrapper */
.table-wrapper {
    position: relative;
    overflow: hidden;
}

/* Tablet Responsive Styles */
@media (max-width: 1024px) {
    /* Make all tables scrollable on tablet */
    .table-responsive,
    .table-container,
    .card-body .table-responsive,
    div:has(> table) {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        position: relative;
        display: block;
        width: 100%;
    }
    
    .table-responsive table,
    table {
        min-width: 900px !important;
        display: table !important;
        font-size: 13px;
        width: 100%;
        margin-bottom: 0;
    }
    
    table th,
    table td {
        padding: 10px 8px;
        white-space: nowrap;
    }
    
    /* Adjust card padding */
    .card-body {
        padding: 15px;
    }
}

@media (max-width: 768px) {
    /* Show Burger Button on Mobile */
    .floating-burger-btn {
        display: flex !important;
    }
    
    /* Sidebar Mobile */
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        width: 280px;
        z-index: 9999;
        transition: left 0.3s ease;
    }
    
    .sidebar.active {
        left: 0;
        box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    }
    
    /* Mobile Table Styles */
    .table-responsive,
    .table-container,
    .card-body .table-responsive,
    .card .table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        display: block !important;
        width: 100%;
        position: relative;
        scrollbar-width: thin;
        scrollbar-color: #667eea #f1f1f1;
    }
    
    /* Force scrollbar to be visible */
    .table-responsive::-webkit-scrollbar,
    .table-container::-webkit-scrollbar {
        height: 8px;
        -webkit-appearance: none;
    }
    
    .table-responsive::-webkit-scrollbar-track,
    .table-container::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 10px;
    }
    
    .table-responsive::-webkit-scrollbar-thumb,
    .table-container::-webkit-scrollbar-thumb {
        background: #667eea;
        border-radius: 10px;
        border: 2px solid #f1f1f1;
    }
    
    .table-responsive::-webkit-scrollbar-thumb:hover,
    .table-container::-webkit-scrollbar-thumb:hover {
        background: #5568d3;
    }
    
    /* Scroll indicator hint */
    .table-responsive::before,
    .card .table-responsive::before {
        content: '← Swipe to scroll →';
        display: block;
        text-align: center;
        font-size: 10px;
        color: white;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        padding: 5px;
        margin: 0;
        font-weight: 600;
        letter-spacing: 0.5px;
        position: sticky;
        left: 0;
        z-index: 5;
        border-bottom: 2px solid rgba(255,255,255,0.3);
    }
    
    /* Fade effect on table edges */
    .table-responsive::after {
        content: '';
        position: absolute;
        top: 30px;
        right: 0;
        bottom: 8px;
        width: 30px;
        background: linear-gradient(to left, rgba(255,255,255,0.9), transparent);
        pointer-events: none;
        z-index: 2;
    }
    
    .table-responsive table,
    table {
        min-width: 800px !important;
        display: table !important;
        font-size: 11px;
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 0;
    }
    
    table th,
    table td {
        padding: 8px 5px !important;
        white-space: nowrap;
        vertical-align: middle;
        font-size: 11px;
    }
    
    table th {
        background-color: #f8f9fa;
        position: sticky;
        top: 0;
        z-index: 10;
        font-weight: 600;
    }
    
    /* Smaller buttons in tables */
    table .btn {
        font-size: 10px !important;
        padding: 3px 6px !important;
        margin: 1px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    table .btn i {
        font-size: 10px;
    }
    
    table .btn-group {
        display: flex;
        flex-wrap: nowrap;
        gap: 2px;
    }
    
    /* Badge sizing */
    table .badge {
        font-size: 10px;
        padding: 3px 6px;
        white-space: nowrap;
    }
    
    /* Responsive card adjustments */
    .card {
        margin-bottom: 15px;
    }
    
    .card-header {
        padding: 12px;
        font-size: 14px;
    }
    
    .card-body {
        padding: 10px;
    }
    
    .card-body.p-0 {
        padding: 0 !important;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .table-responsive,
    .table-container {
        overflow-x: auto !important;
    }
    
    .table-responsive table,
    table {
        min-width: 700px !important;
        font-size: 10px;
    }
    
    table th,
    table td {
        padding: 6px 3px !important;
        font-size: 10px;
    }
    
    table .btn {
        font-size: 9px !important;
        padding: 2px 5px !important;
    }
    
    table .badge {
        font-size: 9px;
        padding: 2px 5px;
    }
    
    .card-body {
        padding: 8px;
    }
    
    /* Stack form controls vertically */
    .form-inline {
        flex-direction: column;
    }
    
    .form-inline .form-control,
    .form-inline .btn {
        width: 100%;
        margin-bottom: 5px;
    }
    
    /* Auth Container */
    .auth-container {
        grid-template-columns: 1fr;
    }
    
    .auth-info {
        display: none;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    /* Main Content */
    .main-content {
        margin-left: 0;
        padding: 10px;
    }
    
    .content-wrapper,
    .content-area {
        padding: 15px;
    }
    
    /* Stats Grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stats-card,
    .stat-card {
        padding: 15px;
    }
    
    /* Page Header */
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .page-header p {
        font-size: 0.875rem;
    }
    
    /* Cards */
    .card {
        margin-bottom: 15px;
    }
    
    .card-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .card-header .btn {
        width: 100%;
    }
    
    /* Tables - Horizontal Scroll */
    .table-container,
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: -1rem;
        padding: 1rem;
    }
    
    table {
        font-size: 0.75rem;
        min-width: 600px;
    }
    
    table thead th,
    table tbody td {
        padding: 0.5rem 0.25rem;
        white-space: nowrap;
    }
    
    /* Buttons */
    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .btn-group {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    /* Filters */
    .filters-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-box,
    .filter-group select,
    .filter-group input {
        width: 100%;
    }
    
    /* Modals */
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .modal-content {
        padding: 15px;
    }
    
    .custom-modal-content {
        width: 95%;
        margin: 10px;
    }
    
    /* Forms */
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    /* Alerts */
    .alert {
        padding: 12px;
        font-size: 14px;
    }
    
    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        gap: 5px;
        justify-content: center;
    }
    
    .pagination a,
    .pagination span {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    /* Topbar */
    .topbar {
        padding: 10px 15px;
        flex-wrap: nowrap;
    }
    
    .topbar-left h1 {
        font-size: 16px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }
    
    .topbar-right {
        gap: 0.5rem;
        flex-shrink: 0;
    }
    
    /* Hide user info text, keep menu functional */
    .user-menu .user-info {
        display: none !important;
    }
    
    .user-menu .user-avatar {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .user-menu .fa-chevron-down {
        display: none;
    }
    
    .user-menu:hover {
        background: transparent;
    }
    
    /* Notification button */
    .notification-bell {
        padding: 8px;
        font-size: 18px;
    }
    
    /* Notifications */
    .notification-dropdown {
        width: calc(100vw - 20px);
        right: -120px;
        max-width: 380px;
    }
    
    .user-menu-dropdown {
        right: -10px;
        width: 260px;
    }
}

@media (max-width: 480px) {
    /* Single Column Stats */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    /* Smaller Headers */
    .page-header h1 {
        font-size: 1.25rem;
    }
    
    .page-header p {
        font-size: 0.8rem;
    }
    
    /* Smaller Cards */
    .card-header h3 {
        font-size: 1.1rem;
    }
    
    /* Full Width Buttons */
    .btn {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    /* Smaller Tables */
    table {
        font-size: 0.7rem;
    }
    
    /* Stack Alerts */
    .alert {
        flex-direction: column;
        text-align: center;
    }
    
    /* Topbar */
    .topbar-left h1 {
        font-size: 14px;
        max-width: 120px;
    }
    
    .user-menu .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
    
    .notification-bell {
        padding: 6px;
        font-size: 16px;
    }
}

/* Landscape Mode Fixes */
@media (max-height: 500px) and (orientation: landscape) {
    .quick-nav-menu {
        max-height: 90vh;
    }
    
    .quick-nav-body {
        max-height: calc(90vh - 80px);
    }
    
    .mobile-menu-toggle {
        bottom: 10px;
        right: 10px;
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
}


/* ===== CUSTOM MODAL (Not for Bootstrap modals) ===== */
.custom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.custom-modal.active {
    display: flex;
}

.custom-modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.custom-modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.custom-modal-header h3 {
    font-size: 20px;
}

.custom-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

.custom-modal-body {
    padding: 20px;
}

.custom-modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ===== FORM STYLES ===== */
.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control small {
    display: block;
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 12px;
}

/* ===== CONTENT ORGANIZATION UTILITIES ===== */
.section-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, #e5e7eb, transparent);
    margin: 35px 0;
}

.content-section {
    margin-bottom: 35px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #667eea;
    display: inline-block;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.empty-state i {
    font-size: 64px;
    color: #d1d5db;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 20px;
    color: #6b7280;
    margin-bottom: 10px;
}

.empty-state p {
    color: #9ca3af;
    font-size: 14px;
}

/* Better Badge Styling */
.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Better Button Styling */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #65408b 100%);
}

/* Loading State */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f3f4f6;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5568d3 0%, #65408b 100%);
}

/* ===== LOADING SPINNER ===== */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== QR CODE STYLES ===== */
.qr-container {
    text-align: center;
    padding: 20px;
}

.qr-code {
    max-width: 250px;
    margin: 0 auto;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 15px;
    background: var(--white);
}

.qr-code img {
    width: 100%;
    height: auto;
}
/* ================================================
   ENHANCED MOBILE RESPONSIVE IMPROVEMENTS
   Customer Portal Mobile Optimization
   ================================================ */

/* Mobile Navigation Improvements */
@media (max-width: 992px) {
    /* Make content more readable on tablets */
    .main-content {
        padding: 15px;
    }
    
    .content-wrapper {
        padding: 20px;
    }
    
    /* Better card spacing */
    .card {
        margin-bottom: 20px;
    }
    
    /* Improve stats grid on tablets */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* Enhanced Mobile Styles for Tablets and Small Screens */
@media (max-width: 768px) {
    /* Typography improvements */
    body {
        font-size: 14px;
    }
    
    h1 {
        font-size: 22px !important;
    }
    
    h2 {
        font-size: 20px !important;
    }
    
    h3 {
        font-size: 18px !important;
    }
    
    h4 {
        font-size: 16px !important;
    }
    
    h5 {
        font-size: 14px !important;
    }
    
    /* Main layout improvements */
    .main-content {
        margin-left: 0 !important;
        padding: 10px !important;
        width: 100% !important;
    }
    
    .content-wrapper,
    .content-area {
        padding: 15px !important;
    }
    
    /* Page header mobile optimization */
    .page-header {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .page-header h1 {
        font-size: 20px !important;
        margin-bottom: 5px;
    }
    
    .page-header p {
        font-size: 13px;
    }
    
    .page-header .btn {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    /* Stats cards mobile */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .stats-card,
    .stat-card {
        padding: 15px !important;
    }
    
    .stats-card h3,
    .stat-card h3 {
        font-size: 22px !important;
        margin-bottom: 5px;
    }
    
    .stats-card p,
    .stat-card p {
        font-size: 12px;
    }
    
    .stats-card i,
    .stat-card i {
        font-size: 24px;
    }
    
    /* Form improvements */
    .form-group,
    .mb-3 {
        margin-bottom: 15px !important;
    }
    
    .form-label {
        font-size: 13px;
        margin-bottom: 5px;
    }
    
    .form-control,
    .form-select {
        font-size: 14px;
        padding: 10px;
    }
    
    /* Button improvements */
    .btn {
        font-size: 13px !important;
        padding: 10px 15px !important;
        white-space: nowrap;
    }
    
    .btn-sm {
        font-size: 12px !important;
        padding: 6px 10px !important;
    }
    
    .btn-lg {
        font-size: 15px !important;
        padding: 12px 20px !important;
    }
    
    .btn i {
        font-size: 12px;
    }
    
    /* Card improvements */
    .card {
        margin-bottom: 15px;
        border-radius: 12px;
    }
    
    .card-header {
        padding: 12px 15px;
        font-size: 15px;
        flex-wrap: wrap;
    }
    
    .card-header h3,
    .card-header h4,
    .card-header h5 {
        font-size: 16px !important;
        margin: 0;
    }
    
    .card-header .btn {
        margin-top: 5px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    /* Modal improvements */
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .modal-content {
        border-radius: 15px;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-title {
        font-size: 16px !important;
    }
    
    .modal-body {
        padding: 15px;
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .modal-footer {
        padding: 15px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .modal-footer .btn {
        flex: 1 1 auto;
        min-width: 100px;
    }
    
    /* Medicine/Product cards mobile */
    .medicine-card,
    .product-card {
        padding: 12px;
        margin-bottom: 10px;
    }
    
    .medicine-card-img,
    .product-card-img {
        height: 120px;
    }
    
    .medicine-card h5,
    .product-card h5 {
        font-size: 14px !important;
    }
    
    .medicine-card p,
    .product-card p {
        font-size: 12px;
    }
    
    .medicine-price,
    .product-price {
        font-size: 16px !important;
    }
    
    /* Order/Bill details mobile */
    .order-details,
    .bill-details {
        font-size: 13px;
    }
    
    .order-item,
    .bill-item {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    /* Filter section mobile */
    .filter-section,
    .search-filters {
        padding: 15px;
    }
    
    .filter-row,
    .search-row {
        gap: 10px;
        flex-direction: column;
    }
    
    .filter-item,
    .search-item {
        width: 100% !important;
        margin-bottom: 10px;
    }
    
    /* Pagination mobile */
    .pagination {
        font-size: 12px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pagination .page-link {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    /* Badge improvements */
    .badge {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    /* Alert improvements */
    .alert {
        padding: 12px;
        font-size: 13px;
        margin-bottom: 15px;
    }
    
    /* Topbar mobile */
    .topbar {
        padding: 10px 15px;
        flex-wrap: wrap;
    }
    
    .topbar-left h1 {
        font-size: 18px !important;
    }
    
    .topbar-right {
        gap: 10px;
    }
    
    /* Notification dropdown mobile */
    .notifications {
        margin-right: 5px;
    }
    
    .notification-dropdown {
        width: calc(100vw - 20px);
        right: 10px;
        left: 10px;
        max-height: 60vh;
    }
    
    .notification-item {
        padding: 10px;
        font-size: 12px;
    }
    
    /* User menu mobile */
    .user-menu {
        font-size: 12px;
    }
    
    .user-dropdown {
        right: 0;
        left: auto;
        min-width: 200px;
    }
    
    /* Grid layouts mobile */
    .row {
        margin: 0 -5px;
    }
    
    .row > [class*='col-'] {
        padding: 0 5px;
        margin-bottom: 10px;
    }
    
    /* Dashboard specific */
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .quick-action-card {
        padding: 15px;
    }
    
    /* Browse medicines grid */
    .medicines-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    /* Cart improvements */
    .cart-item {
        padding: 10px;
        font-size: 13px;
    }
    
    .cart-summary {
        padding: 15px;
        font-size: 13px;
    }
}

/* Extra Small Mobile Devices */
@media (max-width: 480px) {
    body {
        font-size: 13px;
    }
    
    h1 {
        font-size: 20px !important;
    }
    
    h2 {
        font-size: 18px !important;
    }
    
    h3 {
        font-size: 16px !important;
    }
    
    /* Single column layouts */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .medicines-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-section .row,
    .search-section .row {
        flex-direction: column;
    }
    
    .filter-section .col-md-3,
    .filter-section .col-md-4,
    .search-section .col-md-3,
    .search-section .col-md-4 {
        width: 100%;
        margin-bottom: 10px;
    }
    
    /* Page header compact */
    .page-header {
        padding: 10px;
    }
    
    .page-header h1 {
        font-size: 18px !important;
    }
    
    /* Card header actions */
    .card-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }
    
    .card-header .btn-group,
    .card-header .btn {
        width: 100%;
        margin: 0;
    }
    
    /* Modal full screen on small devices */
    .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100vh;
    }
    
    .modal-content {
        height: 100%;
        border-radius: 0;
    }
    
    .modal-body {
        max-height: calc(100vh - 140px);
    }
    
    /* Form compact */
    .form-control,
    .form-select {
        font-size: 13px;
        padding: 8px;
    }
    
    .btn {
        font-size: 12px !important;
        padding: 8px 12px !important;
    }
    
    /* Medicine cards stack */
    .medicine-card,
    .product-card {
        padding: 10px;
    }
    
    .medicine-card-img,
    .product-card-img {
        height: 100px;
    }
    
    /* Table scrolling hint more visible */
    .table-responsive::before {
        font-size: 11px;
        padding: 8px;
        text-transform: uppercase;
    }
}

/* Landscape phone optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-dialog {
        max-height: 95vh;
    }
    
    .modal-body {
        max-height: calc(95vh - 140px);
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Print styles */
@media print {
    .sidebar,
    .topbar,
    .floating-burger-btn,
    .mobile-menu-toggle,
    .btn,
    .pagination,
    .filter-section {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        break-inside: avoid;
        border: 1px solid #ddd;
    }
    
    table {
        font-size: 10px;
    }
}