*{box-sizing:border-box;margin:0;padding:0;}body{font-family:'Vazirmatn','Tahoma',sans-serif;direction:rtl;background:#f1f5f9;color:#334155;line-height:1.6;}
.login-page{min-height:100vh;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#667eea 0%,#764ba2 100%);}
.login-container{width:100%;max-width:420px;padding:20px;}
.login-card{background:white;border-radius:20px;padding:40px;box-shadow:0 20px 60px rgba(0,0,0,0.3);}
.login-header{text-align:center;margin-bottom:30px;}
.login-header .logo{font-size:48px;margin-bottom:15px;}
.login-header h1{font-size:24px;color:#1e293b;margin-bottom:5px;}
.login-header p{color:#64748b;font-size:14px;}
.login-footer{text-align:center;margin-top:20px;padding-top:20px;border-top:1px solid #e2e8f0;}
.login-footer a{color:#667eea;text-decoration:none;}
.login-footer a:hover{text-decoration:underline;}
.layout{display:flex;min-height:100vh;}
.sidebar{width:260px;background:white;border-left:1px solid #e2e8f0;display:flex;flex-direction:column;position:fixed;right:0;top:0;bottom:0;z-index:100;}
.sidebar-header{padding:24px;border-bottom:1px solid #e2e8f0;}
.sidebar-header h2{font-size:18px;color:#1e293b;}
.sidebar-header p{font-size:12px;color:#64748b;margin-top:4px;}
.sidebar-nav{flex:1;padding:16px 0;}
.sidebar-nav a{display:block;padding:12px 20px;border-radius:0;color:#475569;text-decoration:none;margin-bottom:2px;transition:all 0.2s;font-size:14px;}
.sidebar-nav a:hover{background:#f1f5f9;color:#667eea;}
.sidebar-nav a.active{background:#eff6ff;color:#667eea;font-weight:600;border-right:3px solid #667eea;}
.sidebar-nav .submenu{padding-right:0;margin-bottom:4px;border-right:3px solid #e2e8f0;margin-right:20px;}
.sidebar-nav .submenu a{font-size:13px;padding:8px 16px 8px 20px;color:#64748b;border-right:none;border-radius:0 8px 8px 0;}
.sidebar-nav .submenu a:hover{background:#f1f5f9;color:#667eea;}
.sidebar-nav .submenu a.active{background:#eff6ff;color:#667eea;font-weight:600;border-right:3px solid #667eea;}
.sidebar-footer{padding:16px;border-top:1px solid #e2e8f0;}
.sidebar-footer p{font-size:14px;margin-bottom:10px;color:#334155;}
.main-content{flex:1;margin-right:260px;padding:24px;}
.page-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px;padding-bottom:16px;border-bottom:1px solid #e2e8f0;}
.page-header h1{font-size:24px;color:#1e293b;}
.date-display{display:flex;gap:16px;color:#64748b;font-size:14px;}
.card{background:white;border-radius:16px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.08);margin-bottom:24px;}
.card h3{font-size:18px;margin-bottom:16px;color:#1e293b;}
.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:20px;margin-bottom:24px;}
.stat-card{background:white;border-radius:16px;padding:24px;display:flex;align-items:center;gap:16px;box-shadow:0 1px 3px rgba(0,0,0,0.08);}
.stat-card.blue{border-right:4px solid #3b82f6;}
.stat-card.green{border-right:4px solid #10b981;}
.stat-card.red{border-right:4px solid #ef4444;}
.stat-card.yellow{border-right:4px solid #f59e0b;}
.stat-card.purple{border-right:4px solid #8b5cf6;}
.stat-icon{font-size:32px;}
.stat-info h3{font-size:28px;font-weight:700;color:#1e293b;}
.stat-info p{font-size:14px;color:#64748b;}
.dashboard-grid{display:grid;grid-template-columns:2fr 1fr;gap:24px;}
.table-responsive{overflow-x:auto;}
.table{width:100%;border-collapse:collapse;font-size:14px;}
.table th{background:#f8fafc;padding:12px 16px;text-align:right;font-weight:600;color:#475569;border-bottom:2px solid #e2e8f0;}
.table td{padding:12px 16px;border-bottom:1px solid #f1f5f9;}
.table tr:hover{background:#f8fafc;}
.badge{display:inline-block;padding:4px 12px;border-radius:20px;font-size:12px;font-weight:600;}
.badge-success{background:#d1fae5;color:#065f46;}
.badge-danger{background:#fee2e2;color:#991b1b;}
.badge-warning{background:#fef3c7;color:#92400e;}
.btn{display:inline-flex;align-items:center;gap:6px;padding:10px 20px;border-radius:10px;border:none;cursor:pointer;font-family:inherit;font-size:14px;font-weight:600;text-decoration:none;transition:all 0.2s;}
.btn-primary{background:#667eea;color:white;}
.btn-primary:hover{background:#5a67d8;}
.btn-success{background:#10b981;color:white;}
.btn-success:hover{background:#059669;}
.btn-danger{background:#ef4444;color:white;}
.btn-danger:hover{background:#dc2626;}
.btn-warning{background:#f59e0b;color:white;}
.btn-warning:hover{background:#d97706;}
.btn-secondary{background:#e2e8f0;color:#475569;}
.btn-secondary:hover{background:#cbd5e1;}
.btn-sm{padding:6px 12px;font-size:12px;}
.btn-block{width:100%;justify-content:center;}
.form-group{margin-bottom:16px;}
.form-group label{display:block;margin-bottom:6px;font-size:14px;font-weight:600;color:#475569;}
.form-group input,.form-group select,.form-group textarea{width:100%;padding:10px 14px;border:2px solid #e2e8f0;border-radius:10px;font-family:inherit;font-size:14px;transition:border-color 0.2s;}
.form-group input:focus,.form-group select:focus,.form-group textarea:focus{outline:none;border-color:#667eea;}
.form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:16px;}
.form-grid .full-width{grid-column:1 / -1;}
.alert{padding:12px 16px;border-radius:10px;margin-bottom:16px;font-size:14px;}
.alert-success{background:#d1fae5;color:#065f46;border-right:4px solid #10b981;}
.alert-error{background:#fee2e2;color:#991b1b;border-right:4px solid #ef4444;}
.tabs{display:flex;gap:8px;margin-bottom:20px;}
.tab{padding:10px 20px;border-radius:10px;text-decoration:none;color:#64748b;background:white;border:1px solid #e2e8f0;font-size:14px;}
.tab.active{background:#667eea;color:white;border-color:#667eea;}
.modal{position:fixed;inset:0;background:rgba(0,0,0,0.5);display:flex;align-items:center;justify-content:center;z-index:1000;padding:20px;}
.modal-content{background:white;border-radius:20px;padding:32px;width:100%;max-width:600px;max-height:90vh;overflow-y:auto;}
.modal-content h3{margin-bottom:20px;}
.form-actions{display:flex;gap:12px;justify-content:flex-end;margin-top:20px;padding-top:20px;border-top:1px solid #e2e8f0;}
.quick-links{display:grid;gap:12px;}
.quick-link{display:block;padding:16px;background:#f8fafc;border-radius:12px;text-decoration:none;color:#334155;font-weight:600;transition:all 0.2s;}
.quick-link:hover{background:#eff6ff;color:#667eea;}
.empty-state{text-align:center;padding:40px;color:#64748b;}
.text-muted{color:#94a3b8;}
.text-center{text-align:center;}

/* Live Clock */
.live-clock{font-family:'Vazirmatn',monospace;font-size:18px;font-weight:700;color:#667eea;background:#eff6ff;padding:8px 16px;border-radius:12px;}

/* ==================== PERSIAN CALENDAR ==================== */
.pcal-container{background:#fff;border-radius:16px;overflow:hidden;box-shadow:0 4px 20px rgba(0,0,0,0.08);}
.pcal-header{background:linear-gradient(135deg,#0d7377,#14919b);color:#fff;padding:20px 24px;text-align:center;position:relative;}
.pcal-header h2{font-size:22px;margin:0;font-weight:700;}
.pcal-header .pcal-nav{position:absolute;top:50%;transform:translateY(-50%);background:rgba(255,255,255,0.2);border:none;color:#fff;width:36px;height:36px;border-radius:50%;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;text-decoration:none;}
.pcal-header .pcal-nav:hover{background:rgba(255,255,255,0.35);}
.pcal-header .pcal-nav.prev{left:20px;}
.pcal-header .pcal-nav.next{right:20px;}
.pcal-header .pcal-add{position:absolute;top:50%;transform:translateY(-50%);right:60px;background:rgba(255,255,255,0.2);border:none;color:#fff;width:36px;height:36px;border-radius:50%;cursor:pointer;font-size:20px;display:flex;align-items:center;justify-content:center;text-decoration:none;}
.pcal-header .pcal-add:hover{background:rgba(255,255,255,0.35);}
.pcal-subheader{background:#e8f6f3;padding:8px;text-align:center;color:#0d7377;font-size:13px;font-weight:600;}
.pcal-weekdays{display:grid;grid-template-columns:repeat(7,1fr);background:#f0fdf9;border-bottom:2px solid #e2e8f0;}
.pcal-weekday{text-align:center;padding:12px 4px;font-weight:700;color:#0d7377;font-size:13px;}
.pcal-weekday.friday{color:#ef4444;}
.pcal-days{display:grid;grid-template-columns:repeat(7,1fr);gap:1px;background:#e2e8f0;}
.pcal-day{min-height:90px;background:#fff;padding:8px;position:relative;transition:all 0.2s;}
.pcal-day:hover{background:#f8fafc;}
.pcal-day.empty{background:#f8fafc;}
.pcal-day.friday{background:#fff7ed;}
.pcal-day.holiday{background:#fef2f2;}
.pcal-day.today{box-shadow:inset 0 0 0 2px #0d7377;}
.pcal-day-num{font-size:20px;font-weight:700;color:#1e293b;display:block;text-align:center;margin-bottom:2px;}
.pcal-day.friday .pcal-day-num{color:#ef4444;}
.pcal-day.holiday .pcal-day-num{color:#dc2626;}
.pcal-day-greg{font-size:11px;color:#94a3b8;text-align:center;display:block;margin-bottom:4px;}
.pcal-day-events{direction:rtl;font-size:11px;line-height:1.5;}
.pcal-event{display:flex;align-items:center;gap:4px;padding:1px 0;white-space:nowrap;overflow:hidden;}
.pcal-event-dot{width:6px;height:6px;border-radius:50%;flex-shrink:0;}
.pcal-event.in .pcal-event-dot{background:#10b981;}
.pcal-event.out .pcal-event-dot{background:#ef4444;}
.pcal-event.late .pcal-event-dot{background:#f59e0b;}
.pcal-event.leave .pcal-event-dot{background:#8b5cf6;}
.pcal-event-text{overflow:hidden;text-overflow:ellipsis;}
.pcal-legend{display:flex;gap:20px;justify-content:center;padding:16px;background:#f8fafc;border-top:1px solid #e2e8f0;flex-wrap:wrap;}
.pcal-legend-item{display:flex;align-items:center;gap:6px;font-size:12px;color:#475569;}
.pcal-legend-box{width:14px;height:14px;border-radius:4px;}

/* ==================== MONTHLY REPORT TABLE ==================== */
.report-table-container{background:#fff;border-radius:16px;padding:20px;box-shadow:0 1px 3px rgba(0,0,0,0.08);}
.report-table{width:100%;border-collapse:collapse;font-size:12px;}
.report-table th,.report-table td{border:1px solid #cbd5e1;padding:6px 4px;text-align:center;}
.report-table th{background:#f1f5f9;font-weight:700;font-size:11px;}
.report-table td{vertical-align:top;}
.report-table .row-num{width:30px;background:#f8fafc;font-weight:700;}
.report-table .date-col{width:80px;}
.report-table .day-col{width:50px;}
.report-table .time-col{width:55px;font-size:11px;}
.report-table .work-col{width:60px;font-size:11px;font-weight:700;}
.report-table .in-time{color:#059669;font-weight:600;}
.report-table .out-time{color:#dc2626;font-weight:600;}
.report-table .late-cell{background:#fef3c7;color:#92400e;font-weight:700;}
.report-table .leave-cell{background:#e0e7ff;color:#3730a3;font-weight:600;}
.report-table .absent-cell{background:#fee2e2;color:#991b1b;font-weight:600;}
.report-table .holiday-cell{background:#fef2f2;color:#dc2626;font-weight:600;}
.report-table .weekend-cell{background:#fff7ed;color:#92400e;}
.report-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px;margin-top:20px;padding:16px;background:#f8fafc;border-radius:12px;border:1px solid #e2e8f0;}
.report-summary-item{text-align:center;}
.report-summary-item h4{font-size:12px;color:#64748b;margin-bottom:4px;}
.report-summary-item p{font-size:18px;font-weight:700;color:#1e293b;}
.report-summary-item .unit{font-size:11px;color:#94a3b8;}
.print-signature-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-top:24px;}
.print-signature-box{border:1px solid #cbd5e1;border-radius:8px;padding:12px;text-align:center;}
.print-signature-box h4{font-size:12px;margin-bottom:40px;color:#475569;}
.print-signature-line{border-top:1px dashed #94a3b8;padding-top:8px;font-size:11px;color:#64748b;}
.print-footer{text-align:center;margin-top:16px;font-size:11px;color:#94a3b8;}

/* ==================== BACKUP SECTION ==================== */
.backup-card{border:2px dashed #cbd5e1;border-radius:16px;padding:24px;text-align:center;background:#f8fafc;}
.backup-card h4{margin-bottom:12px;color:#1e293b;}
.backup-card p{color:#64748b;font-size:13px;margin-bottom:16px;}

@media print{.sidebar,.no-print{display:none !important;}.main-content{margin:0;padding:0;}.report-table-container{padding:0;box-shadow:none;}}
@media (max-width:768px){.sidebar{width:100%;transform:translateX(100%);transition:transform 0.3s;}.sidebar.open{transform:translateX(0);}.main-content{margin-right:0;}.dashboard-grid{grid-template-columns:1fr;}.stats-grid{grid-template-columns:1fr;}.form-grid{grid-template-columns:1fr;}}
