/* اضافه کردن به انتهای فایل style.css */
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: #8b5cf6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

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

.status-badge.online {
    background: #10b981;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    margin-right: 5px;
}

.status-badge.offline {
    background: #ef4444;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    margin-right: 5px;
}

/* استایل تب‌های ماهانه */
.month-tab-btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.month-tab-btn:hover {
    background: rgba(139, 92, 246, 0.3) !important;
    transform: translateY(-2px);
}

.month-tab-btn.active {
    background: #8b5cf6 !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

/* استایل سلول‌های جدول دستگاه‌ها */
#daily-device-report td, 
#daily-device-report th {
    padding: 12px 8px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    min-width: 100px;
    transition: all 0.2s;
}

#daily-device-report tr:hover td {
    background: rgba(139, 92, 246, 0.1) !important;
}

.device-sales-cell {
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.device-sales-cell:hover {
    background: #8b5cf6 !important;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.5);
    z-index: 5;
}

.device-sales-cell.has-sale {
    background: rgba(16, 185, 129, 0.15);
    font-weight: bold;
    border-left: 2px solid var(--success);
}

.device-sales-cell.has-sale:hover {
    background: #10b981 !important;
}

.device-sales-cell.admin-mode {
    border: 2px dashed var(--accent);
}

.device-sales-cell.admin-mode:hover::after {
    content: 'ویرایش';
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    white-space: nowrap;
}

/* استایل روزهای خارج از ماه */
.out-of-month {
    opacity: 0.5;
    background: rgba(0,0,0,0.2) !important;
}

.out-of-month td {
    color: #64748b !important;
}

/* استایل مودال ویرایش */
#edit-sessions-list {
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg-card);
}

#edit-sessions-list::-webkit-scrollbar {
    width: 6px;
}

#edit-sessions-list::-webkit-scrollbar-track {
    background: var(--bg-card);
}

#edit-sessions-list::-webkit-scrollbar-thumb {
    background-color: var(--accent);
    border-radius: 20px;
}

.session-item {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.session-item:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--accent);
}

.session-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.session-customer {
    font-weight: bold;
    color: var(--text-main);
}

.session-amount {
    color: var(--success);
    font-weight: bold;
}

.session-details {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.btn-edit-session {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-edit-session:hover {
    background: var(--accent);
    color: white;
}

/* ===== VARIABLES ===== */
:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --secondary: #06b6d4;
    --accent: #ec4899;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --success-dark: #059669;
    --danger: #ef4444;
    --danger-dark: #b91c1c;
    --warning: #f59e0b;
    --warning-dark: #d97706;
    --neutral: #475569;
    --ps4-color: #10b981;
    --ps5-color: #8b5cf6;
    --drive-color: #f97316;
    --border-color: rgba(255,255,255,0.1);
    --card-bg: #1e293b;
}

/* ===== RESET & BASE ===== */
* { 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent; 
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    padding-bottom: 100px;
    font-size: 1rem;
    line-height: 1.5;
    overflow-x: hidden;
    width: 100%;
}

input, select, button, textarea {
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1rem;
}

/* ===== LAYOUT ===== */
.container { 
    max-width: 1400px; 
    margin: 20px auto; 
    padding: 0 15px; 
    width: 100%;
}

/* ===== NAVIGATION ===== */
.navbar {
    background: rgba(30, 41, 59, 0.95); 
    backdrop-filter: blur(10px);
    padding: 10px 20px; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center;
    position: sticky; 
    top: 0; 
    z-index: 100; 
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    width: 100%;
}

.nav-content {
    width: 100%; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    flex-wrap: wrap;
    gap: 10px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.club-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.logo-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo {
    font-weight: 900; 
    font-size: 1.2rem;
    background: linear-gradient(135deg, var(--secondary), var(--primary), var(--accent));
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent;
}

.club-name {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.date-display {
    text-align: center; 
    margin-bottom: 5px;
}

.date-main { 
    font-size: 1.1rem; 
    font-weight: bold; 
    color: var(--secondary); 
}

.time-display { 
    font-size: 1.4rem; 
    font-weight: 900; 
    color: var(--text-main); 
    font-family: monospace; 
    letter-spacing: 2px; 
}

.date-sub { 
    font-size: 0.75rem; 
    color: var(--text-muted); 
    display: flex; 
    gap: 15px; 
    justify-content: center; 
}

/* ===== TOP BUTTONS - ALL VISIBLE NO SCROLL ===== */
#top-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
}

#top-buttons button {
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 6px;
    background-color: var(--success);
    color: #fff;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.3s ease;
    flex: 0 1 auto;
    min-width: 110px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

#top-buttons button:hover {
    background-color: var(--success-dark);
}

/* ===== NAVIGATION BUTTONS ===== */
.nav-btn {
    width: auto !important;
    padding: 8px 16px !important;
    margin: 0 !important;
    font-size: 0.85rem !important;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
}

/* ===== LOGIN PAGE ===== */
#login-page {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: var(--bg-dark); 
    z-index: 2000;
    display: flex; 
    justify-content: center; 
    align-items: center;
    background-image: radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.15), transparent 50%);
}

.login-box {
    background: var(--bg-card); 
    padding: 40px; 
    border-radius: 20px;
    width: 100%; 
    max-width: 400px; 
    text-align: center;
    border: 1px solid rgba(139, 92, 246, 0.3); 
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

/* ===== BUTTONS ===== */
button {
    padding: 12px; 
    border: none; 
    border-radius: 10px;
    font-weight: bold; 
    cursor: pointer; 
    font-family: inherit; 
    transition: all 0.3s ease;
    color: white; 
    background: linear-gradient(90deg, var(--primary), var(--accent)); 
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

button:hover { 
    opacity: 0.9; 
    transform: translateY(-1px);
}

button.btn-secondary { background: #334155; }
button.btn-danger { background: linear-gradient(90deg, var(--danger), var(--danger-dark)); }
button.btn-success { background: linear-gradient(90deg, var(--success), var(--success-dark)); }
button.btn-warning { background: linear-gradient(90deg, var(--warning), var(--warning-dark)); }
button.btn-orange { background: linear-gradient(90deg, #f97316, #ea580c); }
button.btn-info-blue { background: linear-gradient(135deg, #06b6d4, #3b82f6); }

.btn-sm {
    padding: 5px 10px !important;
    font-size: 0.8rem !important;
    border-radius: 4px !important;
    margin: 2px !important;
    width: auto !important;
}

.btn-logout {
    background: var(--danger) !important;
    color: white !important;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.btn-logout:hover {
    background: var(--danger-dark) !important;
    transform: translateY(-2px);
}

.btn-reserve-main {
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.btn-reserve-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.3);
}

.btn-end-session {
    background: linear-gradient(90deg, var(--danger), var(--danger-dark));
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9rem;
    flex: 1;
}

.btn-extend-session {
    background: linear-gradient(90deg, var(--warning), var(--warning-dark));
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9rem;
    flex: 1;
}

.btn-reserve-device {
    background: white;
    color: var(--bg-dark);
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    cursor: pointer;
    margin-top: 5px;
    width: 100%;
}

.btn-add-payment {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    background: var(--success);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    flex-shrink: 0;
}

.btn-add-payment:hover { transform: scale(1.1); }

.manual-add-btn {
    background: var(--success);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

/* ===== FORMS ===== */
input, select, textarea {
    width: 100%; 
    padding: 10px; 
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color); 
    border-radius: 8px;
    color: white; 
    font-family: inherit; 
    margin-bottom: 10px;
}

input:focus, select:focus, textarea:focus { 
    outline: none; 
    border-color: var(--primary); 
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.form-section {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.form-group {
    flex: 1 1 200px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===== DEVICE CARDS ===== */
.device-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px; 
    margin-bottom: 40px;
}

.device-card {
    background: var(--bg-card); 
    border-radius: 16px; 
    padding: 15px;
    border: 2px solid transparent; 
    cursor: pointer; 
    transition: all 0.3s;
    min-height: 280px; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between;
    position: relative;
}

.device-card.free { border-color: var(--neutral); opacity: 0.8; }
.device-card.busy[data-type="PS4"] { border-color: var(--ps4-color); background: linear-gradient(145deg, #1e293b, #064e3b); }
.device-card.busy[data-type="PS5"] { border-color: var(--ps5-color); background: linear-gradient(145deg, #1e293b, #4c1d95); }
.device-card.busy[data-type="Drive"] { border-color: var(--drive-color); background: linear-gradient(145deg, #1e293b, #7c2d12); }

.device-card.time-up {
    animation: blink-yellow 1.5s infinite;
    background: linear-gradient(145deg, #451a03, #78350f) !important;
}

.device-card:hover { transform: translateY(-3px); }

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

.device-name { 
    font-size: 1.2rem; 
    font-weight: bold; 
}

.device-info { 
    font-size: 0.85rem; 
    color: var(--text-muted); 
    margin-bottom: 4px; 
}

.timer-large { 
    font-size: 1.8rem; 
    font-weight: 800; 
    text-align: center; 
    margin: 10px 0; 
    font-family: monospace; 
}

.cost-display { 
    background: rgba(0,0,0,0.3); 
    padding: 8px; 
    border-radius: 8px; 
    text-align: center; 
    font-weight: bold; 
    color: var(--secondary); 
    border: 1px solid rgba(6, 182, 212, 0.3); 
}

.buffet-summary { 
    font-size: 0.75rem; 
    color: var(--accent); 
    margin-top: 5px; 
    text-align: center; 
}

.card-actions {
    display: flex;
    gap: 5px;
    margin-top: auto;
    width: 100%;
}

/* ===== DEVICE GRID SMALL ===== */
.device-grid-small {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.device-card-small {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    border: 2px solid transparent;
    transition: all 0.3s;
    cursor: pointer;
    text-align: center;
}

.device-card-small:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    transform: translateY(-5px);
}

.device-card-small.selected {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.device-name-small {
    font-weight: bold;
    margin-bottom: 5px;
    color: #fff;
}

.device-type-small {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* ===== STATUS BADGES ===== */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-active {
    background-color: rgba(34, 197, 94, 0.2);
    color: rgb(34, 197, 94);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-pending {
    background-color: rgba(245, 158, 11, 0.2);
    color: rgb(245, 158, 11);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-completed {
    background-color: rgba(59, 130, 246, 0.2);
    color: rgb(59, 130, 246);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-cancelled {
    background-color: rgba(239, 68, 68, 0.2);
    color: rgb(239, 68, 68);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-dot { 
    width: 10px; 
    height: 10px; 
    border-radius: 50%; 
    display: inline-block; 
    margin-left: 5px; 
}

.status-online { 
    background-color: var(--success); 
    box-shadow: 0 0 10px var(--success); 
}

.status-offline { 
    background-color: var(--neutral); 
}

/* ===== DEVICE SESSION BOXES ===== */
.device-session-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    max-height: 300px;
    overflow-y: auto;
    padding: 2px;
}

.device-session-box {
    cursor: pointer;
    border-radius: 6px;
    padding: 8px 10px;
    min-width: 90px;
    max-width: 120px;
    box-sizing: border-box;
    color: white;
    font-weight: bold;
    font-size: 0.85rem;
    user-select: none;
    transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    text-align: center;
}

.device-session-box:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

.device-session-box.red    { background-color: #ef4444; }
.device-session-box.orange { background-color: #f97316; }
.device-session-box.yellow { background-color: #eab308; }
.device-session-box.lime   { background-color: #84cc16; }
.device-session-box.green  { background-color: #22c55e; }

/* ===== FINANCE DASHBOARD ===== */
.finance-dashboard {
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px; 
    margin-bottom: 30px;
}

.finance-card {
    background: var(--bg-card); 
    padding: 20px; 
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.05); 
    text-align: center;
}

.finance-val { 
    font-size: 1.5rem; 
    font-weight: bold; 
    margin-top: 5px; 
}

.cash-color { color: var(--success); }
.card-color { color: var(--secondary); }
.card2card-color { color: var(--warning); }
.total-color { color: var(--accent); }

/* ===== ADMIN SUPERVISION ===== */
.admin-supervision-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px; 
    margin-bottom: 30px;
}

.supervision-card {
    background: rgba(30, 41, 59, 0.6); 
    padding: 20px; 
    border-radius: 16px;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.supervision-header {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    margin-bottom: 15px; 
    padding-bottom: 10px; 
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.supervision-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    flex-wrap: wrap;
}

.performance-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.summary-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

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

.summary-info {
    flex: 1;
}

.summary-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.summary-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 6px 6px 0 0;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
    background: var(--primary);
    color: #fff;
    border-bottom: 2px solid var(--primary);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes blink-yellow {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); border-color: var(--warning); }
    70% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); border-color: var(--warning); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); border-color: var(--warning); }
}

/* ===== TABLES ===== */
.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
    margin-bottom: 1rem;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #121212;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

th, td {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border: 1px solid #ddd;
}

th {
    color: var(--secondary);
    font-weight: 600;
    background: rgba(139, 92, 246, 0.2);
    position: sticky;
    top: 0;
    z-index: 10;
}

tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

#daily-device-report {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

#daily-device-report th, 
#daily-device-report td {
    border: 1px solid #ddd;
    padding: 6px;
    vertical-align: top;
    text-align: center;
    min-width: 150px;
}

#daily-sales-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

#daily-sales-table th {
    background: rgba(139, 92, 246, 0.2);
    padding: 12px;
    color: var(--secondary);
    font-weight: 600;
    border-bottom: 2px solid var(--primary);
}

#daily-sales-table td {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

#daily-sales-table tfoot td {
    background: rgba(139, 92, 246, 0.1);
    font-size: 1rem;
    padding: 12px;
    border-top: 2px solid var(--primary);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

.table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

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

.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ===== MODAL ===== */
.modal {
    display: none;
    justify-content: center;
    align-items: center;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.95);
    z-index: 9999;
    overflow-y: auto;
    padding: 20px;
}

.modal-content {
    max-width: 95vw !important;
    max-height: 90vh !important;
    overflow-y: auto;
    padding: 15px !important;
    font-family: 'Vazirmatn', sans-serif !important;
    font-size: 1rem !important;
    box-sizing: border-box;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    position: relative;
    width: auto !important;
}

.modal-content button.close-btn {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    width: auto;
    margin: 0;
    padding: 0 8px;
}

/* ===== CHARTS ===== */
.charts-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.chart-box {
    background: rgba(15, 23, 42, 0.5);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    height: 350px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.chart-box h4 {
    text-align: center;
    color: var(--text-muted);
    margin-top: 0;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.chart-canvas-wrapper {
    flex: 1;
    position: relative;
    width: 100%;
    height: 100%;
}

.chart-container {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    height: 300px;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-title {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: bold;
}

/* ===== REPORTS ===== */
.reports-section {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.reports-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.reports-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.custom-report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.custom-stat-card {
    background: rgba(255,255,255,0.05);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.custom-stat-value {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--secondary);
    margin-top: 5px;
}

.custom-stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== BUFFET ===== */
.buffet-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 10px; 
    margin-bottom: 10px; 
}

.buffet-item { 
    background: rgba(255,255,255,0.05); 
    padding: 10px; 
    border-radius: 8px; 
    cursor: pointer; 
    border: 1px solid transparent; 
    text-align: center; 
}

.buffet-item.selected { 
    border-color: var(--success); 
    background: rgba(16, 185, 129, 0.1); 
}

.active-buffet-list { 
    margin-top: 10px; 
    border-top: 1px solid rgba(255,255,255,0.1); 
    padding-top: 10px; 
}

.active-buffet-item { 
    display: flex; 
    justify-content: space-between; 
    font-size: 0.85rem; 
    margin-bottom: 5px; 
    background: rgba(0,0,0,0.2); 
    padding: 5px; 
    border-radius: 4px; 
}

/* ===== OPERATOR PANEL ===== */
.operator-panel {
    background: rgba(255,255,255,0.03); 
    padding: 15px; 
    border-radius: 12px;
    margin-bottom: 20px; 
    border: 1px solid rgba(255,255,255,0.05);
}

.stat-row { 
    display: flex; 
    justify-content: space-between; 
    margin-bottom: 8px; 
    font-size: 0.9rem; 
}

/* ===== ACCOUNT ===== */
.account-select-container {
    margin-bottom: 15px;
}

.account-select-label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-color);
    font-size: 0.9rem;
}

.account-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--card-bg);
    color: var(--text-color);
    font-size: 1rem;
}

.account-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-right: 5px;
}

.account-badge.admin {
    background-color: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
}

.account-badge.operator {
    background-color: rgba(6, 182, 212, 0.2);
    color: #06b6d4;
}

.account-badge.cashbox {
    background-color: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

/* ===== MULTI SELECT ===== */
.multi-select-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: rgba(0,0,0,0.2);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 10px;
}

.multi-select-checkbox {
    display: none;
}

.multi-select-label {
    padding: 6px 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: 0.2s;
    border: 1px solid transparent;
}

.multi-select-checkbox:checked + .multi-select-label {
    background: var(--primary);
    color: white;
    border-color: var(--accent);
}

/* ===== PAYMENT ===== */
.payment-split-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.payment-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.05);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.payment-label {
    width: 100px;
    font-weight: bold;
    font-size: 0.9rem;
}

.payment-input {
    flex: 1;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    padding: 8px;
    border-radius: 4px;
    margin: 0;
    text-align: left;
    direction: ltr;
    min-width: 150px;
}

.payment-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 5px;
}

.payment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.2);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.btn-remove-payment {
    color: var(--danger);
    cursor: pointer;
    margin-right: 10px;
    font-size: 1rem;
}

/* ===== WITHDRAWALS ===== */
.withdrawals-list {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 15px;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
}

.withdraw-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.85rem;
}

.withdraw-actions { 
    display: flex; 
    gap: 8px; 
}

.withdraw-actions i { 
    cursor: pointer; 
    transition: 0.2s; 
}

.withdraw-actions i:hover { transform: scale(1.2); }

/* ===== RESERVATION ===== */
.reservation-badge {
    position: absolute; 
    top: 10px; 
    right: 10px;
    background: rgba(255,255,255,0.2); 
    padding: 5px 10px;
    border-radius: 20px; 
    font-size: 0.8rem; 
    display: flex; 
    align-items: center; 
    gap: 5px;
    backdrop-filter: blur(5px);
}

.reservation-list-item {
    background: rgba(255,255,255,0.05); 
    padding: 10px; 
    margin-bottom: 5px; 
    border-radius: 8px;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.reservation-avatars {
    display: flex; 
    gap: 5px; 
    margin-top: 10px; 
    flex-wrap: wrap;
}

.avatar-icon {
    width: 30px; 
    height: 30px; 
    background-color: #ffffff; 
    border: 2px solid var(--primary);
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    font-size: 12px; 
    color: var(--primary); 
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.reservation-select-list {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    background: rgba(0,0,0,0.2);
}

.reservation-select-item {
    padding: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.reservation-select-item:hover {
    background: rgba(255,255,255,0.05);
}

.reservation-select-item.active {
    background: rgba(139, 92, 246, 0.2);
    border-right: 3px solid var(--primary);
}

/* ===== MIGRATION ===== */
.migration-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.migration-device-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: 0.2s;
}

.migration-device-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--primary);
}

.migration-device-btn.busy {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: var(--danger);
}

.migration-cost-row {
    background-color: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.5);
    color: #fbbf24;
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 5px;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
}

/* ===== DATE PICKER ===== */
.custom-date-picker {
    position: relative;
    display: flex;
    align-items: center;
}

.date-picker-input {
    padding: 10px 40px 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    width: 150px;
    cursor: pointer;
    direction: rtl;
}

.date-picker-icon {
    position: absolute;
    right: 15px;
    color: var(--text-muted);
    cursor: pointer;
}

.date-picker-container {
    text-align: center;
}

.date-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.date-nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.date-nav-btn:hover {
    background: var(--primary);
}

.date-picker-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 20px;
}

.date-picker-day {
    padding: 10px;
    text-align: center;
    font-weight: bold;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.date-picker-cell {
    padding: 12px;
    text-align: center;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s;
    color: var(--text-color);
}

.date-picker-cell:hover {
    background: rgba(255, 255, 255, 0.1);
}

.date-picker-cell.selected {
    background: var(--primary);
    color: #fff;
    font-weight: bold;
}

.date-picker-cell.today {
    border: 2px solid var(--success);
}

.date-picker-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== HOLIDAY RIBBON ===== */
.holiday-ribbon {
    position: fixed;
    top: 0;
    left: 0;
    width: 150px;
    height: 150px;
    overflow: hidden;
    z-index: 9999;
    cursor: pointer;
    transition: transform 0.3s;
}

.holiday-ribbon:hover {
    transform: scale(1.05);
}

.holiday-ribbon span {
    position: absolute;
    display: block;
    width: 220px;
    padding: 10px 0;
    background: linear-gradient(45deg, #ef4444, #b91c1c);
    color: white;
    font-weight: 900;
    text-align: center;
    left: -35px;
    top: 35px;
    transform: rotate(-45deg);
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.5);
    font-size: 1rem;
    border: 2px solid rgba(255,255,255,0.3);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* ===== FAB ===== */
.fab {
    position: fixed; 
    bottom: 25px; 
    left: 25px; 
    width: 60px; 
    height: 60px;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    border-radius: 50%; 
    display: flex; 
    justify-content: center; 
    align-items: center;
    color: white; 
    font-size: 24px; 
    box-shadow: 0 10px 20px rgba(236, 72, 153, 0.4);
    z-index: 90; 
    cursor: pointer;
}

.fab:hover { transform: scale(1.1); }

/* ===== UTILITY CLASSES ===== */
.edit-badge {
    background: var(--warning);
    color: #000;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 5px;
    font-weight: bold;
}

.controller-icons {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 5px;
    text-align: center;
    letter-spacing: 2px;
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
}

.qty-btn {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: none;
    color: white;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 1rem;
}

.qty-btn.plus { background: var(--success); }
.qty-btn.minus { background: var(--danger); }

.qty-display {
    font-size: 0.9rem;
    min-width: 20px;
    text-align: center;
}

.manual-add-box {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
    flex-wrap: wrap;
}

.manual-add-input {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    color: white;
    padding: 8px;
    border-radius: 6px;
    width: 100%;
    flex: 1;
    min-width: 200px;
}

.manual-time-input {
    display: none;
    background: rgba(245, 158, 11, 0.1);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--warning);
    margin-bottom: 10px;
}

.manual-time-input.active {
    display: block;
}

.list-item-row {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 8px; 
    border-bottom: 1px solid rgba(255,255,255,0.05);
    flex-wrap: wrap;
    gap: 10px;
}

.list-actions i { 
    margin-right: 8px; 
    cursor: pointer; 
    transition: 0.2s; 
}

.list-actions i:hover { transform: scale(1.2); }

.checkbox-wrapper {
    display: flex; 
    align-items: center; 
    gap: 10px; 
    margin-bottom: 10px; 
    background: rgba(255,255,255,0.05); 
    padding: 10px; 
    border-radius: 8px;
    flex-wrap: wrap;
}

.checkbox-wrapper input[type="checkbox"] { 
    width: auto; 
    margin: 0; 
}

.id-card-preview {
    width: 100%; 
    height: 150px; 
    background: #000; 
    margin-top: 10px;
    border-radius: 8px; 
    object-fit: cover; 
    display: none;
}

.id-card-preview.show { display: block; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .charts-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .nav-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .logo-area {
        justify-content: center;
    }
    
    #top-buttons {
        margin-top: 10px;
    }
    
    #top-buttons button {
        min-width: calc(50% - 4px);
        flex: 1 1 calc(50% - 4px);
    }
}

@media (max-width: 768px) {
    body, input, select, button, textarea {
        font-size: 0.9rem;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .modal-content {
        max-width: 98vw !important;
        max-height: 95vh !important;
        padding: 10px !important;
    }
    
    .device-grid {
        grid-template-columns: 1fr;
    }
    
    .finance-dashboard {
        grid-template-columns: 1fr 1fr;
    }
    
    .charts-container {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-group {
        flex: 1 1 100%;
    }
    
    .payment-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .payment-label {
        width: 100%;
    }
    
    .payment-input {
        width: 100%;
    }
    
    .table-container {
        margin: 10px 0;
    }
    
    th, td {
        padding: 8px 4px;
        font-size: 0.8rem;
    }
    
    #top-buttons button {
        min-width: calc(50% - 4px);
        font-size: 0.85rem;
        padding: 8px 10px;
    }
    
    .btn-reserve-main {
        width: 100%;
    }
    
    .reports-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .reports-controls {
        justify-content: space-between;
    }
}

@media (max-width: 576px) {
    .finance-dashboard {
        grid-template-columns: 1fr;
    }
    
    #top-buttons button {
        min-width: 100%;
        flex: 1 1 100%;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
        border-radius: 6px;
    }
    
    .device-session-box {
        min-width: 80px;
        max-width: 100px;
        padding: 6px 8px;
    }
    
    .supervision-controls {
        flex-direction: column;
    }
    
    .performance-summary {
        grid-template-columns: 1fr;
    }
    
    .custom-report-grid {
        grid-template-columns: 1fr;
    }
    
    .device-grid-small {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .date-display {
        font-size: 0.9rem;
    }
    
    .time-display {
        font-size: 1.2rem;
    }
    
    .date-sub {
        flex-direction: column;
        gap: 5px;
    }
    
    .device-grid-small {
        grid-template-columns: 1fr;
    }
    
    .migration-options {
        grid-template-columns: 1fr;
    }
    
    .buffet-grid {
        grid-template-columns: 1fr;
    }
    
    .login-box {
        padding: 30px 20px;
        margin: 0 15px;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .navbar, 
    .fab, 
    .btn-logout, 
    .modal,
    .holiday-ribbon {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
        padding: 20px;
    }
    
    table {
        border-collapse: collapse;
    }
    
    th, td {
        border: 1px solid #ddd;
        color: black;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
}