/* Main CSS for dashboard - Modern Sidebar Layout */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #6366f1;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;
    --header-height: 70px;
    --bg-color: #ffffff;
    --card-bg: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Vazir', 'Tahoma', 'Arial', sans-serif !important;
    direction: rtl;
    background-color: var(--light-color);
    color: var(--text-primary);
    font-weight: 400;
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-color);
    border-left: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none !important;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.25rem;
    white-space: nowrap;
}

.sidebar-logo:hover {
    text-decoration: none !important;
}

.sidebar-logo:focus {
    text-decoration: none !important;
}

.sidebar-logo span {
    font-size: 1.25rem;
    line-height: 1.2;
}

.sidebar-logo i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-section-title {
    padding: 0.5rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-right: 3px solid transparent;
    font-weight: 500;
}

.nav-item:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
    border-right-color: var(--primary-color);
}

.nav-item.active {
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
    border-right-color: var(--primary-color);
    font-weight: 600;
}

.nav-item i {
    font-size: 1.125rem;
    width: 20px;
    text-align: center;
}

/* Main Wrapper */
.main-wrapper {
    margin-right: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-right 0.3s ease;
}

/* Top Header */
.top-header {
    height: var(--header-height);
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.sidebar-toggle-mobile {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    display: none;
}

.modal-header.modal-close-start {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-header.modal-close-start .btn-close {
    order: -1;
    margin: 0;
}

.modal-header.modal-close-start .modal-title {
    margin: 0;
    flex: 1;
    text-align: right;
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.breadcrumb-item {
    color: var(--text-secondary);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
}

.breadcrumb-separator {
    color: var(--text-secondary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-search {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: 1.5rem;
}

.header-search i {
    position: absolute;
    right: 1rem;
    color: var(--text-secondary);
    font-size: 1rem;
}

.search-input {
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--light-color);
    font-size: 0.875rem;
    width: 250px;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background: var(--bg-color);
}

.header-icons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-icon-btn {
    position: relative;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-icon-btn:hover {
    background: var(--light-color);
    color: var(--text-primary);
}

.badge-notification {
    position: absolute;
    top: 6px;
    left: 6px;
    background: var(--danger-color);
    color: white;
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.header-user-dropdown {
    position: relative;
}

.header-user-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-user-btn:hover {
    background: var(--light-color);
}

.user-avatar {
    width: auto;
    height: auto;
    border-radius: 0;
    background: none;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-left: 0.5rem;
}

.user-info-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.4;
}

.user-role-small {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.header-user-btn i.bi-chevron-down {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-right: 0.25rem;
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-menu .dropdown-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.user-name-large {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.dropdown-item:hover {
    background: var(--light-color);
}

.dropdown-item i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    padding: 2rem;
    min-height: calc(100vh - var(--header-height));
}

/* Cards */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    background: var(--card-bg);
    transition: all 0.3s ease;
    overflow: hidden;
    width: 100%;
}

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

/* Grid System Improvements */
.row {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}

.row > * {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* Responsive Grid */
@media (max-width: 575.98px) {
    .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
    
    .row > * {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .g-4 {
        --bs-gutter-y: 1rem;
        --bs-gutter-x: 1rem;
    }
}

.card-header {
    background: var(--light-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 1.5rem;
}

/* Tables */
.table {
    background: var(--card-bg);
    margin-bottom: 0;
    width: 100%;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table thead th {
    background: var(--light-color);
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    padding: 1rem;
    text-align: right;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.table tbody tr {
    transition: all 0.2s ease;
}

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

/* Responsive Table Wrapper */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0.75rem;
}

/* Buttons */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, var(--danger-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

/* Badges */
.badge {
    padding: 0.375rem 0.75rem;
    font-weight: 500;
    border-radius: 0.375rem;
    font-size: 0.75rem;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.5rem;
    border-right: 4px solid;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0; /* برای جلوگیری از overflow */
}

.alert-message {
    flex: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.alert i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.alert-success {
    background-color: #d1fae5;
    border-right-color: var(--success-color);
    color: #065f46;
}

.alert-danger {
    background-color: #fee2e2;
    border-right-color: var(--danger-color);
    color: #991b1b;
}

.alert-info {
    background-color: #dbeafe;
    border-right-color: var(--info-color);
    color: #1e40af;
}

.alert-warning {
    background-color: #fef3c7;
    border-right-color: var(--warning-color);
    color: #92400e;
}

/* Price Tiles */
.price-tiles-container {
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
    padding-right: 0.25rem;
}

.price-tiles-container::-webkit-scrollbar {
    width: 6px;
}

.price-tiles-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.price-tiles-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.price-tiles-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.price-tiles-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    padding: 0.5rem;
}

@media (max-width: 1199.98px) {
    .price-tiles-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .price-tiles-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .price-tiles-grid {
        grid-template-columns: 1fr;
    }
}

.price-tile {
    border: 2px solid var(--border-color);
    border-radius: 16px;
    background-color: #ffffff;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-height: 120px;
}

.price-tile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.price-tile-unit {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-right: 0.3rem;
}

.price-tile-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.85rem;
    flex: 1;
    justify-content: space-between;
}

.price-tile-price {
    margin-bottom: 0.25rem;
}

.price-tile-change-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
}

.price-tile-value {
    font-size: 1rem;
    font-weight: 700;
}

.price-tile-yesterday {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    font-weight: 400;
}

.price-tile-change {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid transparent;
}

.price-tile-change i {
    font-size: 0.9rem;
}

.price-tile-change-up {
    color: #b91c1c;
    background-color: rgba(248, 113, 113, 0.2);
    border-color: #f87171;
}

.price-tile-change-down {
    color: #065f46;
    background-color: rgba(74, 222, 128, 0.2);
    border-color: #34d399;
}

.price-tile-change-missing {
    color: #92400e;
    background-color: rgba(250, 204, 21, 0.25);
    border-color: #fbbf24;
}

.price-tile-change-neutral {
    color: #475569;
    background-color: rgba(148, 163, 184, 0.2);
    border-color: #cbd5f5;
}

.price-tile-up {
    background-color: #fee2e2;
    border-color: #f87171;
}

.price-tile-down {
    background-color: #dcfce7;
    border-color: #4ade80;
}

.price-tile-missing {
    background-color: #fef9c3;
    border-color: #facc15;
}

.price-tile-no_previous {
    background-color: #f3f4f6;
    border-color: #cbd5f5;
}

.price-tile .price-tile-status span {
    font-weight: 600;
}

.price-tile-badge {
    background-color: rgba(59, 130, 246, 0.15);
    color: #1d4ed8;
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Forms */
.form-control,
.form-select {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.625rem 1rem;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    background: var(--bg-color);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    outline: none;
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* Modals */
.modal-content {
    border: none;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.modal-title {
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

/* Stats Cards */
.stat-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    color: white;
}

.stat-card p {
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
    font-size: 0.875rem;
}

/* Page Headers */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
}

h1 {
    font-size: 1.875rem;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.5rem;
}

/* Responsive Design */
@media (max-width: 1199.98px) {
    .search-input {
        width: 200px;
    }
    
    .main-content {
        padding: 1.5rem;
    }
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(100%);
        box-shadow: var(--shadow-lg);
        z-index: 1001;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-wrapper {
        margin-right: 0;
    }
    
    .sidebar-toggle-mobile {
        display: block !important;
    }
    
    .search-input {
        width: 180px;
    }
    
    .main-content {
        padding: 1.25rem;
    }
    
    .top-header {
        padding: 0 1.25rem;
    }
}

@media (max-width: 767.98px) {
    .top-header {
        padding: 0 1rem;
        height: 60px;
    }
    
    .header-left {
        gap: 1rem;
    }
    
    .header-right {
        gap: 0.5rem;
    }
    
    .header-search {
        display: none;
    }
    
    .user-name {
        display: none;
    }
    
    .header-user-btn {
        padding: 0.375rem;
    }
    
    .breadcrumb-nav {
        font-size: 0.8125rem;
    }
    
    .breadcrumb-item {
        display: none;
    }
    
    .breadcrumb-item.active {
        display: block;
    }
    
    .breadcrumb-separator {
        display: none;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table {
        font-size: 0.8125rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.75rem 0.5rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    .stat-card {
        padding: 1.25rem;
    }
    
    .stat-card h3 {
        font-size: 1.75rem;
    }
    
    .user-dropdown-menu {
        min-width: 240px;
        left: auto;
        right: 0;
    }
}

@media (max-width: 575.98px) {
    .top-header {
        padding: 0 0.75rem;
        height: 56px;
    }
    
    .header-icon-btn {
        width: 36px;
        height: 36px;
        font-size: 1.125rem;
    }
    
    .user-avatar {
        width: auto;
        height: auto;
        font-size: 1.25rem;
        margin-left: 0.5rem;
    }
    
    .main-content {
        padding: 0.75rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .table {
        font-size: 0.75rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
    }
    
    /* Hide less important columns on mobile */
    .table .d-none-mobile,
    .table th.d-none-mobile,
    .table td.d-none-mobile {
        display: none !important;
    }
    
    /* Stack table on very small screens */
    @media (max-width: 400px) {
        .table,
        .table thead,
        .table tbody,
        .table th,
        .table td,
        .table tr {
            display: block;
        }
        
        .table thead tr {
            position: absolute;
            top: -9999px;
            left: -9999px;
        }
        
        .table tr {
            border: 1px solid var(--border-color);
            margin-bottom: 0.5rem;
            border-radius: 0.5rem;
            padding: 0.5rem;
        }
        
        .table td {
            border: none;
            position: relative;
            padding-right: 50% !important;
            padding-top: 0.5rem !important;
            padding-bottom: 0.5rem !important;
            text-align: right !important;
        }
        
        .table td:before {
            content: attr(data-label);
            position: absolute;
            right: 6px;
            font-weight: 600;
            color: var(--text-secondary);
            font-size: 0.75rem;
        }
    }
    
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.6875rem;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-content {
        border-radius: 0.5rem;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card h3 {
        font-size: 1.5rem;
    }
    
    .sidebar {
        width: 100%;
        max-width: 280px;
    }
    
    .sidebar-header {
        padding: 1rem;
    }
    
    .nav-item {
        padding: 0.625rem 1rem;
    }
    
    .user-dropdown-menu {
        min-width: 200px;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .top-header,
    .header-icons,
    .btn,
    .alert {
        display: none !important;
    }
    
    .main-wrapper {
        margin-right: 0 !important;
    }
    
    .main-content {
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* Landscape Mobile */
@media (max-width: 991.98px) and (orientation: landscape) {
    .top-header {
        height: 56px;
    }
    
    .main-content {
        padding: 1rem;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .sidebar-logo i,
    .nav-item i,
    .header-icon-btn {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Touch Device Improvements */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .nav-item,
    .header-icon-btn,
    .header-user-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .card:hover {
        transform: none;
    }
    
    .table tbody tr:hover {
        background-color: transparent;
    }
}

/* Flexbox Utilities for Responsive */
.d-flex-responsive {
    display: flex;
}

@media (max-width: 767.98px) {
    .d-flex-responsive {
        flex-direction: column;
    }
    
    .justify-content-between-responsive {
        justify-content: flex-start !important;
        gap: 1rem;
    }
}

/* Spacing Utilities */
@media (max-width: 575.98px) {
    .mb-4 {
        margin-bottom: 1.5rem !important;
    }
    
    .mb-3 {
        margin-bottom: 1rem !important;
    }
    
    .p-4 {
        padding: 1rem !important;
    }
    
    .p-3 {
        padding: 0.75rem !important;
    }
}

/* Modal Responsive */
@media (max-width: 575.98px) {
    .modal-dialog {
        margin: 0.25rem;
        max-width: calc(100% - 0.5rem);
    }
    
    .modal-content {
        border-radius: 0.5rem;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 0.75rem;
    }
    
    .modal-title {
        font-size: 1.125rem;
    }
}

/* Form Groups Responsive */
@media (max-width: 575.98px) {
    .form-group,
    .mb-3 {
        margin-bottom: 1rem;
    }
    
    .form-control,
    .form-select {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Button Groups Responsive */
@media (max-width: 575.98px) {
    .btn-group {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn-group .btn:last-child {
        margin-bottom: 0;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Empty States */
.text-center.py-5 {
    padding: 3rem 1rem;
}

.text-center.py-5 i {
    opacity: 0.3;
    font-size: 3rem;
}

.text-center.py-5 p {
    color: var(--text-secondary);
    margin-top: 1rem;
}

/* Code Tags */
code {
    background-color: var(--light-color);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8125rem;
    color: var(--primary-color);
    font-weight: 500;
}
