/* التنسيقات الأساسية */

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1f2937;
    --light: #f8fafc;
    --gray: #6b7280;
    --gray-light: #e5e7eb;
    --shadow: 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);
}

/* الوضع الليلي */
.dark-mode {
    --primary: #60a5fa;
    --primary-dark: #3b82f6;
    --secondary: #a78bfa;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --dark: #f8fafc;
    --light: #1e293b;
    --gray: #94a3b8;
    --gray-light: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    transition: all 0.3s ease;
}

.dark-mode body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.container {
    display: flex;
    min-height: calc(100vh - 70px);
}

/* نموذج تسجيل الدخول */
.btn-block {
    width: 100%;
    justify-content: center;
}

.user-badge {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    margin-right: 1rem;
}

/* زر إنهاء اليوم */
#endDayBtn {
    background: var(--warning);
    color: white;
}

/* حالة المزامنة */
.sync-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--gray);
}

.sync-status.syncing {
    color: var(--warning);
}

.sync-status.synced {
    color: var(--success);
}

.sync-status.error {
    color: var(--danger);
}

/* تحسينات للشريط العلوي */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* شريط التنقل */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    box-shadow: var(--shadow);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.dark-mode .navbar {
    background: rgba(30, 41, 59, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.nav-brand i {
    font-size: 1.75rem;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.time-display {
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: 600;
    box-shadow: var(--shadow);
}

.total-display {
    background: var(--success);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: 600;
    box-shadow: var(--shadow);
}

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

.dark-mode .btn-outline {
    border-color: var(--primary);
    color: var(--primary);
}

/* الشريط الجانبي */
.sidebar {
    width: 280px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem 1rem;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.dark-mode .sidebar {
    background: rgba(30, 41, 59, 0.95);
    border-left-color: rgba(255, 255, 255, 0.1);
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: var(--gray);
    border-radius: 12px;
    transition: all 0.3s ease;
    font-weight: 600;
}

.menu-item:hover {
    background: var(--primary);
    color: white;
    transform: translateX(-5px);
}

.menu-item.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: var(--shadow);
}

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

.quick-stats {
    background: var(--light);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.dark-mode .quick-stats {
    background: rgba(15, 23, 42, 0.8);
}

.quick-stats h4 {
    margin-bottom: 1rem;
    color: var(--dark);
    font-size: 1.1rem;
}

.dark-mode .quick-stats h4 {
    color: var(--light);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-light);
}

.stat-item:last-child {
    border-bottom: none;
}

/* المحتوى الرئيسي */
.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.section-header h2 {
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.75rem;
}

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

/* مربع البحث */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    right: 1rem;
    color: var(--gray);
}

.search-box input {
    padding: 0.75rem 3rem 0.75rem 1rem;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.9);
    width: 300px;
    font-family: 'Cairo', sans-serif;
}

.dark-mode .search-box input {
    background: rgba(30, 41, 59, 0.9);
    color: white;
}

/* الأزرار */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-secondary {
    background: var(--gray-light);
    color: var(--dark);
}

.dark-mode .btn-secondary {
    background: var(--gray-light);
    color: var(--dark);
}

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

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

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

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

.btn:active {
    transform: translateY(0);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* الفلاتر */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.dark-mode .filters {
    background: rgba(255, 255, 255, 0.05);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.filter-group select,
.filter-group input {
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    background: white;
    font-family: 'Cairo', sans-serif;
    min-width: 150px;
}

.dark-mode .filter-group select,
.dark-mode .filter-group input {
    background: var(--light);
    color: var(--dark);
}

/* إحصائيات الأجهزة السريعة */
.quick-device-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.device-stat {
    background: rgba(255, 255, 255, 0.95);
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: var(--shadow);
}

.dark-mode .device-stat {
    background: rgba(30, 41, 59, 0.95);
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}

/* شبكة الأجهزة */
.devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.device-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    position: relative;
}

.dark-mode .device-card {
    background: rgba(30, 41, 59, 0.95);
}

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

.device-card.active {
    border-left: 5px solid var(--success);
}

.device-card.inactive {
    border-left: 5px solid var(--gray);
}

.device-card.reserved {
    border-left: 5px solid var(--warning);
    position: relative;
    overflow: hidden;
}

.device-card.reserved::before {
    content: "محجوز";
    position: absolute;
    top: 10px;
    left: -30px;
    background: var(--warning);
    color: white;
    padding: 5px 40px;
    transform: rotate(-45deg);
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 1;
}

.device-card.active {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.device-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.device-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark);
}

.dark-mode .device-name {
    color: var(--light);
}

.device-type {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

.device-type.ps4 {
    background: var(--primary);
}

.device-type.ps5 {
    background: var(--secondary);
}

.device-type.xbox {
    background: var(--success);
}

.device-status {
    padding: 0.5rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    margin: 1rem 0;
}

.status-active {
    background: #d1fae5;
    color: #065f46;
}

.dark-mode .status-active {
    background: #064e3b;
    color: #a7f3d0;
}

.status-inactive {
    background: #f3f4f6;
    color: var(--gray);
}

.dark-mode .status-inactive {
    background: #374151;
    color: #d1d5db;
}

.status-reserved {
    background: #fef3c7;
    color: #92400e;
}

.dark-mode .status-reserved {
    background: #78350f;
    color: #fcd34d;
}

.timer-display {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    color: var(--primary);
    font-family: 'Courier New', monospace;
    margin: 1rem 0;
    background: var(--light);
    padding: 1rem;
    border-radius: 10px;
}

.dark-mode .timer-display {
    background: rgba(15, 23, 42, 0.8);
}

.cost-display {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    color: var(--success);
    margin: 1rem 0;
}

.device-info {
    display: flex;
    justify-content: space-between;
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.device-info span {
    background: var(--light);
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
}

.dark-mode .device-info span {
    background: rgba(15, 23, 42, 0.8);
}

.device-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 1rem;
}

.reservation-toggle {
    grid-column: 1 / -1;
}

/* إحصائيات الكافيتيريا */
.cafe-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.cafe-stat {
    background: rgba(255, 255, 255, 0.95);
    padding: 1rem;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

.dark-mode .cafe-stat {
    background: rgba(30, 41, 59, 0.95);
}

/* الكافيتيريا */
.cafe-categories {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.category-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
}

.category-btn:hover,
.category-btn.active {
    background: white;
    color: var(--primary);
}

.dark-mode .category-btn:hover,
.dark-mode .category-btn.active {
    background: var(--primary);
    color: white;
}

.cafe-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.cafe-item-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    text-align: center;
    border: 2px solid transparent;
    position: relative;
}

.dark-mode .cafe-item-card {
    background: rgba(30, 41, 59, 0.95);
}

.cafe-item-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.cafe-item-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--gray-light);
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--gray);
}

.cafe-item-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.dark-mode .cafe-item-name {
    color: var(--light);
}

.cafe-item-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 1rem;
}

.cafe-item-stock {
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 1rem;
}

.cafe-item-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

/* شبكة الكافيتيريا في النموذج المنبثق */
.cafe-items-grid-modal {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--light);
    border-radius: 10px;
}

.dark-mode .cafe-items-grid-modal {
    background: rgba(15, 23, 42, 0.8);
}

.cafe-item-selector {
    background: var(--light);
    padding: 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    border: 2px solid transparent;
}

.dark-mode .cafe-item-selector {
    background: rgba(30, 41, 59, 0.8);
}

.cafe-item-selector:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

.cafe-item-selector.selected {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.selected-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1rem 0;
    max-height: 200px;
    overflow-y: auto;
}

.selected-item {
    background: var(--light);
    padding: 1rem;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--success);
}

.dark-mode .selected-item {
    background: rgba(15, 23, 42, 0.8);
}

.order-summary {
    background: var(--light);
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1rem;
}

.dark-mode .order-summary {
    background: rgba(15, 23, 42, 0.8);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-light);
}

.summary-item.total {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--success);
    border-bottom: none;
}

.discount-section {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.discount-section input {
    width: 120px;
}

/* إدارة الكاش */
.cash-balance {
    background: var(--success);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.2rem;
}

.cash-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.cash-action-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.dark-mode .cash-action-card {
    background: rgba(30, 41, 59, 0.95);
}

.cash-action-card h3 {
    margin-bottom: 1.5rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dark-mode .cash-action-card h3 {
    color: var(--light);
}

.action-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cash-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: var(--shadow);
}

.dark-mode .summary-card {
    background: rgba(30, 41, 59, 0.95);
}

.summary-card h4 {
    margin-bottom: 1rem;
    color: var(--gray);
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.cash-history {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.dark-mode .cash-history {
    background: rgba(30, 41, 59, 0.95);
}

.table-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

/* الإحصائيات */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dark-mode .stat-card {
    background: rgba(30, 41, 59, 0.95);
}

.stat-card.primary {
    border-left: 5px solid var(--primary);
}

.stat-card.success {
    border-left: 5px solid var(--success);
}

.stat-card.warning {
    border-left: 5px solid var(--warning);
}

.stat-card.danger {
    border-left: 5px solid var(--danger);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-card.primary .stat-icon {
    background: var(--primary);
}

.stat-card.success .stat-icon {
    background: var(--success);
}

.stat-card.warning .stat-icon {
    background: var(--warning);
}

.stat-card.danger .stat-icon {
    background: var(--danger);
}

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
}

.dark-mode .stat-value {
    color: var(--light);
}

.stat-change {
    font-size: 0.8rem;
    color: var(--success);
    font-weight: 600;
}

.stat-change.negative {
    color: var(--danger);
}

.stat-subtitle {
    font-size: 0.8rem;
    color: var(--gray);
}

.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.dark-mode .chart-container {
    background: rgba(30, 41, 59, 0.95);
}

.chart-container h3 {
    margin-bottom: 1rem;
    color: var(--dark);
    text-align: center;
}

.dark-mode .chart-container h3 {
    color: var(--light);
}

.detailed-report,
.daily-reports {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.dark-mode .detailed-report,
.dark-mode .daily-reports {
    background: rgba(30, 41, 59, 0.95);
}

.detailed-report h3,
.daily-reports h3 {
    margin-bottom: 1rem;
    color: var(--dark);
}

.dark-mode .detailed-report h3,
.dark-mode .daily-reports h3 {
    color: var(--light);
}

.table-container {
    overflow-x: auto;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
}

.report-table th,
.report-table td {
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid var(--gray-light);
}

.report-table th {
    background: var(--light);
    font-weight: 700;
    color: var(--dark);
}

.dark-mode .report-table th {
    background: rgba(15, 23, 42, 0.8);
    color: var(--light);
}

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

.dark-mode .report-table tr:hover {
    background: rgba(15, 23, 42, 0.6);
}

/* النماذج المنبثقة */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 2% auto;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

.dark-mode .modal-content {
    background: #1e293b;
    color: white;
}

.modal-content.large {
    max-width: 800px;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-light);
}

.dark-mode .modal-header {
    border-bottom-color: #374151;
}

.modal-header h3 {
    color: var(--dark);
    margin: 0;
}

.dark-mode .modal-header h3 {
    color: white;
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--gray-light);
}

.dark-mode .modal-footer {
    border-top-color: #374151;
}

.modal-footer p {
    text-align: center;
    width: 100%;
}

.modal-footer a {
    color: var(--primary);
    text-decoration: none;
}

.modal-footer a:hover {
    text-decoration: underline;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark);
}

.dark-mode .form-group label {
    color: white;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.dark-mode .form-input {
    background: #374151;
    border-color: #4b5563;
    color: white;
}

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

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

/* إعدادات الجهاز */
.device-stats {
    background: var(--light);
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1rem;
}

.dark-mode .device-stats {
    background: rgba(15, 23, 42, 0.8);
}

.device-stats h4 {
    margin-bottom: 1rem;
    color: var(--dark);
}

.dark-mode .device-stats h4 {
    color: var(--light);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-light);
}

.stat-row:last-child {
    border-bottom: none;
}

/* طرق الدفع */
.payment-methods {
    margin-top: 1rem;
}

.payment-methods h5 {
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.dark-mode .payment-methods h5 {
    color: var(--light);
}

.payment-options {
    display: flex;
    gap: 1rem;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--light);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dark-mode .payment-option {
    background: rgba(15, 23, 42, 0.8);
}

.payment-option:hover {
    background: var(--primary);
    color: white;
}

.payment-option input[type="radio"] {
    margin: 0;
}

/* معلومات العميل */
.customer-info {
    background: var(--light);
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.dark-mode .customer-info {
    background: rgba(15, 23, 42, 0.8);
}

/* الإعدادات */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.setting-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.dark-mode .setting-card {
    background: rgba(30, 41, 59, 0.95);
}

.setting-card h3 {
    margin-bottom: 1.5rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dark-mode .setting-card h3 {
    color: var(--light);
}

.backup-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.backup-info {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--light);
    border-radius: 8px;
}

.dark-mode .backup-info {
    background: rgba(15, 23, 42, 0.8);
}

.about-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.about-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* معاينة الجلسة */
.session-preview {
    background: var(--light);
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1rem;
}

.dark-mode .session-preview {
    background: rgba(15, 23, 42, 0.8);
}

.preview-item {
    display: flex;
    justify-content: space-between;
    margin: 0.5rem 0;
}

.session-type-content {
    transition: all 0.3s ease;
}

/* تفاصيل الجلسة */
.session-details {
    background: var(--light);
    padding: 1rem;
    border-radius: 10px;
}

.dark-mode .session-details {
    background: rgba(15, 23, 42, 0.8);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-light);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item.total {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--success);
}

/* الإشعارات */
.notifications-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.notification {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--success);
    animation: slideInLeft 0.3s ease;
}

.dark-mode .notification {
    background: #1e293b;
    color: white;
}

.notification.error {
    border-left-color: var(--danger);
}

.notification.warning {
    border-left-color: var(--warning);
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* التجاوب مع الشاشات الصغيرة */
@media (max-width: 1200px) {
    .nav-controls {
        flex-wrap: wrap;
    }
    .nav-brand {
        flex-direction: column;
        align-items: flex-start;
    }
    .user-badge {
        margin-right: 0;
        margin-top: 0.25rem;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        order: 2;
    }
    .main-content {
        order: 1;
    }
    .filters {
        flex-direction: column;
    }
    .devices-grid {
        grid-template-columns: 1fr;
    }
    .charts-row {
        grid-template-columns: 1fr;
    }
    .stats-cards {
        grid-template-columns: 1fr;
    }
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    .search-box input {
        width: 200px;
    }
    .cash-actions-grid {
        grid-template-columns: 1fr;
    }
    .nav-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    .cafe-items-grid {
        grid-template-columns: 1fr;
    }
    .payment-options {
        flex-direction: column;
    }
}

.text-success {
    color: var(--success) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-danger {
    color: var(--danger) !important;
}

/* تحسينات إضافية للواجهة */
.quick-device-stats,
.cafe-stats,
.cash-summary {
    animation: fadeInUp 0.6s ease;
}

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

/* تأثيرات hover محسنة */
.device-card,
.cafe-item-card,
.stat-card,
.setting-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* شريط التمرير المخصص */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-light);
    border-radius: 4px;
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}
/* تحسينات الوضع الليلي */
.dark-mode {
    --primary: #60a5fa;
    --primary-dark: #3b82f6;
    --secondary: #a78bfa;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --dark: #f8fafc;
    --light: #1e293b;
    --gray: #94a3b8;
    --gray-light: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

.dark-mode .modal-content {
    background: #1e293b;
    color: white;
    border: 1px solid #374151;
}

.dark-mode .form-input {
    background: #374151;
    border-color: #4b5563;
    color: white;
}

.dark-mode .form-input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

.dark-mode .btn-secondary {
    background: #4b5563;
    color: white;
    border: 1px solid #6b7280;
}

.dark-mode .device-card, 
.dark-mode .cafe-item-card,
.dark-mode .stat-card,
.dark-mode .setting-card {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid #374151;
}

.dark-mode .search-box input {
    background: #374151;
    color: white;
    border: 1px solid #4b5563;
}

/* تحسينات الأزرار */
.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.btn-info {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
}

/* تحسينات الكافيتيريا */
.cafe-item-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cafe-item-actions .btn {
    flex: 1;
    min-width: 80px;
    font-size: 0.8rem;
}

/* تحسينات الأجهزة */
.device-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.device-actions .btn {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
}

/* تحسينات المؤقتات */
.timer-display {
    background: linear-gradient(135deg, #1e293b, #374151);
    color: #60a5fa;
    font-weight: bold;
    border: 2px solid #3b82f6;
    border-radius: 10px;
}

.dark-mode .timer-display {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #93c5fd;
    border-color: #60a5fa;
}

/* تحسينات النماذج المنبثقة */
.modal-content {
    border-radius: 15px;
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-bottom: none;
}

.dark-mode .modal-header {
    background: linear-gradient(135deg, #1e40af, #7c3aed);
}

/* تحسينات الجلسات */
.session-preview {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.dark-mode .session-preview {
    background: linear-gradient(135deg, #1e293b, #334155);
    border-color: #475569;
}

/* تحسينات شريط العمليات النقدية */
.cash-operations {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.dark-mode .cash-operations {
    background: rgba(30, 41, 59, 0.95);
}

.operation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 10px;
    background: var(--light);
    border-left: 4px solid var(--success);
}

.dark-mode .operation-item {
    background: rgba(15, 23, 42, 0.8);
}

.operation-item.withdrawal {
    border-left-color: var(--warning);
}

.operation-amount {
    font-weight: bold;
    font-size: 1.1rem;
}

.operation-amount.positive {
    color: var(--success);
}

.operation-amount.negative {
    color: var(--warning);
}

.operation-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.operation-time {
    font-size: 0.8rem;
    color: var(--gray);
}

.operation-note {
    font-size: 0.9rem;
}

/* تحسينات الاستجابة */
@media (max-width: 768px) {
    .device-actions {
        grid-template-columns: 1fr;
    }
    
    .cafe-item-actions {
        flex-direction: column;
    }
    
    .modal-content {
        margin: 5% auto;
        width: 95%;
    }
}

/* تأثيرات hover محسنة */
.device-card:hover, 
.cafe-item-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* أحجام أزرار متسقة */
.btn {
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* تحسينات النص */
.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.cost-display {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--success);
}

/* تحسينات شريط التمرير */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.dark-mode ::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.dark-mode ::-webkit-scrollbar-thumb {
    background: #475569;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* تحسينات إضافية للكافيتيريا */
.cafe-item-card {
    position: relative;
    transition: all 0.3s ease;
}

.cafe-item-card .btn {
    margin: 2px;
}

.delete-cafe-item {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.edit-cafe-item {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

/* تحسينات الأجهزة */
.delete-device-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

/* تحسينات العمليات النقدية */
.cash-operations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-light);
}

.daily-cash-total {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--success);
}

.dark-mode .daily-cash-total {
    color: #34d399;
}
/* تحسينات الكافيتيريا */
.cafe-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.cafe-stat {
    background: rgba(255, 255, 255, 0.95);
    padding: 1rem;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

.dark-mode .cafe-stat {
    background: rgba(30, 41, 59, 0.95);
}

.cafe-item-card {
    position: relative;
    transition: all 0.3s ease;
}

.cafe-item-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.cafe-item-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.5rem;
    text-align: center;
}

.dark-mode .cafe-item-name {
    color: var(--light);
}

.cafe-item-description {
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 0.5rem;
    text-align: center;
}

.cafe-item-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 0.5rem;
    text-align: center;
}

.cafe-item-profit,
.cafe-item-sales {
    font-size: 0.8rem;
    color: var(--gray);
    text-align: center;
    margin-bottom: 0.25rem;
}

.cafe-item-stock {
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 1rem;
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    font-weight: 600;
}

.cafe-item-stock.low-stock {
    background: #fef3c7;
    color: #92400e;
}

.dark-mode .cafe-item-stock.low-stock {
    background: #78350f;
    color: #fcd34d;
}

.cafe-item-stock.out-of-stock {
    background: #fee2e2;
    color: #991b1b;
}

.dark-mode .cafe-item-stock.out-of-stock {
    background: #7f1d1d;
    color: #fca5a5;
}

.cafe-item-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cafe-item-actions .btn {
    flex: 1;
    min-width: 80px;
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
}

.no-items-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--gray);
}

.no-items-message i {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.out-of-stock {
    opacity: 0.7;
    filter: grayscale(0.3);
}

/* تحسينات البحث */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    right: 1rem;
    color: var(--gray);
}

.search-box input {
    padding: 0.75rem 3rem 0.75rem 1rem;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.9);
    width: 300px;
    font-family: 'Cairo', sans-serif;
}

.dark-mode .search-box input {
    background: rgba(30, 41, 59, 0.9);
    color: white;
}
/* تحسينات الإشعارات */
.notification {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--success);
    animation: slideInLeft 0.3s ease;
    min-width: 300px;
    max-width: 400px;
}

.dark-mode .notification {
    background: #1e293b;
    color: white;
}

.notification.error {
    border-left-color: var(--danger);
}

.notification.warning {
    border-left-color: var(--warning);
}

.notification.info {
    border-left-color: var(--primary);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.notification-close {
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    padding: 0.25rem;
    margin-right: auto;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.notification-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--dark);
}

.dark-mode .notification-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}
/* تحسينات نموذج إنهاء الجلسة */
.session-summary {
    background: var(--light);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.dark-mode .session-summary {
    background: rgba(15, 23, 42, 0.8);
}

.session-summary h4 {
    margin-bottom: 1rem;
    color: var(--primary);
    text-align: center;
    font-size: 1.3rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-light);
    font-size: 1rem;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item.total {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--success);
    border-top: 2px solid var(--success);
    margin-top: 0.5rem;
    padding-top: 1rem;
}