@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;900&display=swap');
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:'Cairo',sans-serif; direction:rtl; background:#f0f4f8; }
:root {
  --navy:#0D1B4B; --blue:#2176C7; --gold:#C9A227; --sky:#4FC3F7;
  --sidebar-w:260px; --header-h:60px;
}
/* ===== LOGIN ===== */
.login-page { min-height:100vh; background:linear-gradient(135deg,#0D1B4B 0%,#1a3a7a 50%,#0D1B4B 100%); display:flex; align-items:center; justify-content:center; }
.login-box { background:white; border-radius:16px; padding:40px; width:380px; box-shadow:0 20px 60px rgba(0,0,0,0.3); text-align:center; }
.login-logo { width:100px; height:100px; background:linear-gradient(135deg,#0D1B4B,#2176C7); border-radius:50%; display:flex; align-items:center; justify-content:center; margin:0 auto 20px; font-size:36px; color:#C9A227; font-weight:900; }
.login-title { color:#0D1B4B; font-size:22px; font-weight:700; margin-bottom:6px; }
.login-sub { color:#666; font-size:13px; margin-bottom:24px; }
.login-input { width:100%; padding:12px 16px; border:2px solid #e0e0e0; border-radius:8px; font-family:'Cairo',sans-serif; font-size:14px; direction:rtl; transition:border-color .2s; margin-bottom:14px; }
.login-input:focus { outline:none; border-color:#2176C7; }
.login-btn { width:100%; padding:13px; background:linear-gradient(135deg,#0D1B4B,#2176C7); color:white; border:none; border-radius:8px; font-family:'Cairo',sans-serif; font-size:16px; font-weight:700; cursor:pointer; transition:opacity .2s; }
.login-btn:hover { opacity:.9; }
/* ===== LAYOUT ===== */
.app { display:flex; height:100vh; overflow:hidden; }
.sidebar { width:var(--sidebar-w); background:linear-gradient(180deg,#0D1B4B 0%,#122060 100%); display:flex; flex-direction:column; flex-shrink:0; overflow-y:auto; }
.sidebar-logo { padding:16px; text-align:center; border-bottom:1px solid rgba(255,255,255,.1); }
.logo-circle { width:70px; height:70px; background:linear-gradient(135deg,#1a3a7a,#2176C7); border-radius:50%; display:flex; align-items:center; justify-content:center; margin:0 auto 8px; font-size:24px; color:#C9A227; font-weight:900; border:2px solid #C9A227; }
.sidebar-company { color:white; font-size:12px; font-weight:600; line-height:1.4; }
.sidebar-nav { flex:1; padding:10px 0; }
.nav-section { padding:6px 16px 2px; color:rgba(255,255,255,.4); font-size:10px; text-transform:uppercase; }
.nav-item { display:flex; align-items:center; gap:10px; padding:10px 18px; color:rgba(255,255,255,.8); cursor:pointer; transition:all .2s; border-right:3px solid transparent; font-size:13px; }
.nav-item:hover { background:rgba(255,255,255,.1); color:white; }
.nav-item.active { background:rgba(33,118,199,.3); color:white; border-right-color:#C9A227; }
.nav-item i { width:18px; text-align:center; font-size:14px; }
.nav-badge { margin-right:auto; background:#e53935; color:white; border-radius:10px; padding:1px 7px; font-size:11px; }
.sidebar-user { padding:12px; border-top:1px solid rgba(255,255,255,.1); display:flex; align-items:center; gap:10px; }
.user-avatar { width:36px; height:36px; background:linear-gradient(135deg,#2176C7,#C9A227); border-radius:50%; display:flex; align-items:center; justify-content:center; color:white; font-weight:700; font-size:14px; flex-shrink:0; }
.user-info { flex:1; min-width:0; }
.user-name { color:white; font-size:12px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.user-role { color:rgba(255,255,255,.5); font-size:10px; }
/* ===== MAIN ===== */
.main { flex:1; display:flex; flex-direction:column; overflow:hidden; }
.topbar { height:var(--header-h); background:white; border-bottom:1px solid #e0e0e0; display:flex; align-items:center; padding:0 20px; gap:14px; flex-shrink:0; }
.page-title { font-size:18px; font-weight:700; color:#0D1B4B; flex:1; }
.topbar-btn { width:36px; height:36px; border-radius:8px; border:1px solid #e0e0e0; background:white; display:flex; align-items:center; justify-content:center; cursor:pointer; position:relative; color:#555; transition:all .2s; }
.topbar-btn:hover { background:#f5f5f5; }
.notif-dot { position:absolute; top:4px; right:4px; width:8px; height:8px; background:#e53935; border-radius:50%; }
.content { flex:1; overflow-y:auto; padding:20px; }
/* ===== CARDS ===== */
.stat-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:14px; margin-bottom:20px; }
.stat-card { background:white; border-radius:12px; padding:16px; display:flex; flex-direction:column; gap:8px; box-shadow:0 2px 8px rgba(0,0,0,.06); border-right:4px solid #2176C7; transition:transform .2s; cursor:pointer; }
.stat-card:hover { transform:translateY(-2px); }
.stat-card.gold { border-right-color:#C9A227; }
.stat-card.green { border-right-color:#43a047; }
.stat-card.red { border-right-color:#e53935; }
.stat-card.purple { border-right-color:#7b1fa2; }
.stat-card.teal { border-right-color:#00897b; }
.stat-label { color:#888; font-size:12px; }
.stat-value { font-size:26px; font-weight:700; color:#0D1B4B; }
.stat-icon { font-size:22px; color:#2176C7; }
/* ===== TABLES ===== */
.card { background:white; border-radius:12px; box-shadow:0 2px 8px rgba(0,0,0,.06); margin-bottom:16px; overflow:hidden; }
.card-header { padding:14px 18px; border-bottom:1px solid #f0f0f0; display:flex; align-items:center; justify-content:space-between; }
.card-title { font-size:15px; font-weight:700; color:#0D1B4B; }
.card-body { padding:16px; }
.data-table { width:100%; border-collapse:collapse; font-size:13px; }
.data-table th { background:#f8f9fa; color:#555; padding:10px 12px; text-align:right; font-weight:600; border-bottom:2px solid #e0e0e0; white-space:nowrap; }
.data-table td { padding:10px 12px; border-bottom:1px solid #f5f5f5; vertical-align:middle; }
.data-table tr:hover td { background:#fafbfc; }
/* ===== BADGES ===== */
.badge { display:inline-block; padding:3px 10px; border-radius:20px; font-size:11px; font-weight:600; }
.badge-blue { background:#e3f2fd; color:#1565c0; }
.badge-green { background:#e8f5e9; color:#2e7d32; }
.badge-orange { background:#fff3e0; color:#e65100; }
.badge-red { background:#ffebee; color:#c62828; }
.badge-purple { background:#f3e5f5; color:#6a1b9a; }
.badge-gray { background:#f5f5f5; color:#555; }
.badge-gold { background:#fff8e1; color:#f57f17; }
.badge-teal { background:#e0f2f1; color:#00695c; }
/* ===== BUTTONS ===== */
.btn { display:inline-flex; align-items:center; gap:6px; padding:8px 16px; border-radius:8px; border:none; cursor:pointer; font-family:'Cairo',sans-serif; font-size:13px; font-weight:600; transition:all .2s; }
.btn-primary { background:linear-gradient(135deg,#0D1B4B,#2176C7); color:white; }
.btn-primary:hover { opacity:.9; }
.btn-gold { background:linear-gradient(135deg,#C9A227,#f0c040); color:#0D1B4B; }
.btn-danger { background:#e53935; color:white; }
.btn-success { background:#43a047; color:white; }
.btn-outline { background:white; border:1px solid #ddd; color:#555; }
.btn-outline:hover { background:#f5f5f5; }
.btn-sm { padding:5px 12px; font-size:12px; }
.btn-xs { padding:3px 8px; font-size:11px; border-radius:5px; }
/* ===== FORMS ===== */
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-bottom:14px; }
.form-row.cols-3 { grid-template-columns:1fr 1fr 1fr; }
.form-row.cols-1 { grid-template-columns:1fr; }
.form-group { display:flex; flex-direction:column; gap:5px; }
.form-label { font-size:12px; font-weight:600; color:#444; }
.form-control { padding:9px 12px; border:1.5px solid #e0e0e0; border-radius:8px; font-family:'Cairo',sans-serif; font-size:13px; direction:rtl; transition:border-color .2s; }
.form-control:focus { outline:none; border-color:#2176C7; }
.form-control.error { border-color:#e53935; }
/* ===== MODAL ===== */
.modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:1000; display:flex; align-items:center; justify-content:center; padding:20px; }
.modal { background:white; border-radius:16px; width:100%; max-width:860px; max-height:90vh; display:flex; flex-direction:column; }
.modal-lg { max-width:1060px; }
.modal-sm { max-width:460px; }
.modal-header { padding:16px 20px; border-bottom:1px solid #f0f0f0; display:flex; align-items:center; justify-content:space-between; flex-shrink:0; }
.modal-title { font-size:17px; font-weight:700; color:#0D1B4B; }
.modal-close { width:32px; height:32px; border-radius:8px; border:none; background:#f5f5f5; cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:16px; color:#555; }
.modal-body { padding:20px; overflow-y:auto; flex:1; }
.modal-footer { padding:14px 20px; border-top:1px solid #f0f0f0; display:flex; gap:10px; justify-content:flex-end; flex-shrink:0; }
/* ===== SEARCH BAR ===== */
.search-bar { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:14px; }
.search-input-wrap { flex:1; min-width:200px; position:relative; }
.search-input-wrap i { position:absolute; right:12px; top:50%; transform:translateY(-50%); color:#aaa; }
.search-input { width:100%; padding:9px 38px 9px 12px; border:1.5px solid #e0e0e0; border-radius:8px; font-family:'Cairo',sans-serif; font-size:13px; direction:rtl; }
.search-input:focus { outline:none; border-color:#2176C7; }
.filter-select { padding:9px 12px; border:1.5px solid #e0e0e0; border-radius:8px; font-family:'Cairo',sans-serif; font-size:13px; direction:rtl; background:white; }
/* ===== TABS ===== */
.tabs { display:flex; gap:4px; border-bottom:2px solid #e0e0e0; margin-bottom:18px; }
.tab { padding:8px 18px; border-radius:8px 8px 0 0; cursor:pointer; font-size:13px; font-weight:600; color:#777; border:2px solid transparent; border-bottom:none; margin-bottom:-2px; }
.tab.active { color:#0D1B4B; background:white; border-color:#e0e0e0; border-bottom-color:white; }
/* ===== NOTIF PANEL ===== */
.notif-panel { position:fixed; top:60px; left:20px; width:340px; background:white; border-radius:12px; box-shadow:0 8px 30px rgba(0,0,0,.15); z-index:900; max-height:500px; display:flex; flex-direction:column; }
.notif-header { padding:12px 16px; border-bottom:1px solid #f0f0f0; display:flex; align-items:center; justify-content:space-between; }
.notif-list { flex:1; overflow-y:auto; }
.notif-item { padding:12px 16px; border-bottom:1px solid #f5f5f5; display:flex; gap:12px; align-items:flex-start; cursor:pointer; }
.notif-item:hover { background:#fafbfc; }
.notif-item.unread { background:#eff6ff; }
.notif-icon { width:36px; height:36px; border-radius:50%; display:flex; align-items:center; justify-content:center; flex-shrink:0; font-size:15px; }
.notif-icon.warn { background:#fff3e0; color:#e65100; }
.notif-icon.info { background:#e3f2fd; color:#1565c0; }
.notif-icon.success { background:#e8f5e9; color:#2e7d32; }
.notif-icon.danger { background:#ffebee; color:#c62828; }
.notif-text { font-size:12px; color:#555; line-height:1.5; }
.notif-time { font-size:10px; color:#aaa; margin-top:2px; }
/* ===== TOAST ===== */
.toast-container { position:fixed; bottom:20px; left:20px; z-index:2000; display:flex; flex-direction:column; gap:8px; }
.toast { padding:12px 18px; border-radius:10px; color:white; font-size:13px; font-weight:600; display:flex; align-items:center; gap:10px; box-shadow:0 4px 14px rgba(0,0,0,.2); animation:slideIn .3s ease; min-width:280px; }
.toast-success { background:#43a047; }
.toast-error { background:#e53935; }
.toast-info { background:#1565c0; }
.toast-warn { background:#e65100; }
@keyframes slideIn { from { transform:translateX(-100%); opacity:0; } to { transform:translateX(0); opacity:1; } }
/* ===== UPLOAD AREA ===== */
.upload-area { border:2px dashed #c0c0c0; border-radius:10px; padding:24px; text-align:center; cursor:pointer; transition:all .2s; }
.upload-area:hover, .upload-area.drag-over { border-color:#2176C7; background:#eff6ff; }
.upload-area i { font-size:36px; color:#aaa; margin-bottom:8px; }
/* ===== FILE GRID ===== */
.file-item { display:flex; align-items:center; gap:10px; padding:10px; border:1px solid #e0e0e0; border-radius:8px; margin-bottom:8px; }
.file-icon { width:38px; height:38px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:18px; flex-shrink:0; }
.file-icon.pdf { background:#ffebee; color:#e53935; }
.file-icon.word { background:#e3f2fd; color:#1565c0; }
.file-icon.img { background:#e8f5e9; color:#2e7d32; }
.file-icon.other { background:#f3e5f5; color:#7b1fa2; }
.file-info { flex:1; min-width:0; }
.file-name { font-size:13px; font-weight:600; color:#333; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.file-meta { font-size:11px; color:#aaa; }
/* ===== CHART CONTAINER ===== */
.chart-container { position:relative; height:280px; }
/* ===== LOG TABLE ===== */
.log-row td { font-size:12px; }
/* ===== STATUS TIMELINE ===== */
.timeline { padding:8px 0; }
.tl-item { display:flex; gap:12px; align-items:flex-start; padding:8px 0; }
.tl-dot { width:12px; height:12px; border-radius:50%; flex-shrink:0; margin-top:4px; }
.tl-line { width:2px; background:#e0e0e0; height:100%; margin:0 5px; }
/* ===== FOLLOW-UP BADGE ===== */
.followup-due { background:#fff3e0; color:#e65100; border:1px solid #ffcc80; animation:pulse 1.5s infinite; }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:.6; } }
/* ===== RESPONSIVE ===== */
@media(max-width:768px) { .sidebar { width:200px; } .form-row { grid-template-columns:1fr; } }
