/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Tahoma, Arial, sans-serif; direction: rtl; background: #f0f2f7; color: #1a1a2e; min-height: 100vh; }

/* ===== Auth Page ===== */
.auth-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1a1a2e 0%, #4B2D8A 100%); }
.auth-container { width: 100%; max-width: 420px; padding: 1rem; }
.auth-card { background: #fff; border-radius: 20px; padding: 2.5rem 2rem; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo-icon { width: 64px; height: 64px; background: linear-gradient(135deg, #4B2D8A, #7B4FB0); border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; color: #fff; margin-bottom: 12px; }
.auth-title { font-size: 20px; font-weight: 700; color: #1a1a2e; margin-bottom: 4px; }
.auth-sub { font-size: 13px; color: #888; }
.forgot-hint { font-size: 13px; color: #666; margin-bottom: 1rem; line-height: 1.6; }
.auth-links { display: flex; justify-content: space-between; margin-top: 1rem; }
.auth-msg { margin-top: 1rem; font-size: 13px; min-height: 20px; text-align: center; }
.auth-footer { color: rgba(255,255,255,0.5); font-size: 12px; margin-top: 1.5rem; text-align: center; }

/* ===== Forms ===== */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: #444; margin-bottom: 6px; }
.form-input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid #dde1ea; border-radius: 10px; font-size: 14px; font-family: inherit; outline: none; transition: border-color 0.2s; background: #fafbfd; }
.form-input:focus { border-color: #4B2D8A; background: #fff; }
.input-icon-wrap { position: relative; }
.input-icon-wrap .form-input { padding-left: 40px; }
.input-eye { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); cursor: pointer; font-size: 16px; }
.link { font-size: 13px; color: #4B2D8A; cursor: pointer; text-decoration: underline; }

/* ===== Buttons ===== */
.btn-primary { background: #1a1a2e; color: #fff; border: none; border-radius: 10px; padding: 11px 24px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; transition: background 0.2s; }
.btn-primary:hover { background: #4B2D8A; }
.btn-primary:disabled { background: #c0c4cc; cursor: not-allowed; }
.btn-full { width: 100%; padding: 13px; }
.btn-outline { background: #fff; color: #1a1a2e; border: 1px solid #dde1ea; border-radius: 10px; padding: 10px 20px; font-size: 14px; cursor: pointer; font-family: inherit; transition: all 0.2s; }
.btn-outline:hover { background: #f4f6f9; border-color: #4B2D8A; }
.btn-danger { background: #fce4ec; color: #c62828; border: 1px solid #ef9a9a; border-radius: 8px; padding: 7px 14px; font-size: 13px; cursor: pointer; font-family: inherit; }
.btn-danger:hover { background: #f44336; color: #fff; }
.btn-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; border-radius: 8px; padding: 7px 14px; font-size: 13px; cursor: pointer; font-family: inherit; }
.btn-success:hover { background: #4caf50; color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 12px; }

/* ===== Dashboard Layout ===== */
.dashboard { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar { width: 240px; background: #1a1a2e; color: #fff; display: flex; flex-direction: column; flex-shrink: 0; position: fixed; height: 100vh; right: 0; z-index: 50; }
.sidebar-logo { padding: 1.5rem 1.2rem; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-logo-icon { width: 40px; height: 40px; background: #4B2D8A; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; margin-left: 10px; }
.sidebar-logo-text { font-size: 14px; font-weight: 600; }
.sidebar-logo-sub { font-size: 11px; color: #aaa; margin-top: 2px; }
.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 11px 1.2rem; color: rgba(255,255,255,0.7); cursor: pointer; transition: all 0.2s; font-size: 14px; text-decoration: none; }
.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active { background: #4B2D8A; color: #fff; border-radius: 0; }
.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; }
.nav-section { font-size: 11px; color: rgba(255,255,255,0.3); padding: 1rem 1.2rem 0.3rem; text-transform: uppercase; letter-spacing: 1px; }
.sidebar-footer { padding: 1rem 1.2rem; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar-user { font-size: 13px; color: #ccc; margin-bottom: 8px; }
.sidebar-user strong { color: #fff; display: block; }

/* Main Content */
.main-content { margin-right: 240px; flex: 1; padding: 2rem; min-height: 100vh; }
.page-header { margin-bottom: 2rem; }
.page-title { font-size: 22px; font-weight: 700; color: #1a1a2e; }
.page-sub { font-size: 14px; color: #888; margin-top: 4px; }

/* ===== Cards ===== */
.card { background: #fff; border-radius: 14px; padding: 1.5rem; border: 1px solid #e8eaf0; box-shadow: 0 1px 4px rgba(0,0,0,0.05); margin-bottom: 1.5rem; }
.card-title { font-size: 15px; font-weight: 600; color: #1a1a2e; margin-bottom: 1.2rem; display: flex; align-items: center; gap: 8px; }
.card-icon { font-size: 16px; }

/* ===== Stats Grid ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: #fff; border-radius: 14px; padding: 1.2rem 1.5rem; border: 1px solid #e8eaf0; }
.stat-label { font-size: 13px; color: #888; margin-bottom: 6px; }
.stat-value { font-size: 28px; font-weight: 700; color: #1a1a2e; }
.stat-sub { font-size: 12px; color: #aaa; margin-top: 4px; }
.stat-card.purple .stat-value { color: #4B2D8A; }
.stat-card.green .stat-value  { color: #2e7d32; }
.stat-card.blue .stat-value   { color: #1565c0; }
.stat-card.orange .stat-value { color: #e65100; }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: #f4f6f9; padding: 10px 12px; font-size: 12px; font-weight: 600; color: #555; text-align: right; border-bottom: 1px solid #e8eaf0; }
td { padding: 11px 12px; font-size: 13px; color: #333; border-bottom: 1px solid #f0f2f7; vertical-align: middle; }
tr:hover td { background: #fafbfd; }
tr:last-child td { border-bottom: none; }

/* ===== Badges ===== */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-pending  { background: #fff8e1; color: #f57f17; }
.badge-approved { background: #e8f5e9; color: #2e7d32; }
.badge-rejected { background: #fce4ec; color: #c62828; }
.badge-info     { background: #e3f2fd; color: #1565c0; }
.badge-purple   { background: #ede7f6; color: #4B2D8A; }

/* ===== Coins Display ===== */
.coins-display { display: inline-flex; align-items: center; gap: 6px; background: linear-gradient(135deg, #fff8e1, #fff3cd); border: 1px solid #ffe082; border-radius: 20px; padding: 6px 16px; font-size: 15px; font-weight: 700; color: #f57f17; }

/* ===== Notifications Bell ===== */
.notif-bell { position: relative; cursor: pointer; font-size: 20px; }
.notif-badge { position: absolute; top: -4px; left: -4px; background: #f44336; color: #fff; border-radius: 50%; width: 16px; height: 16px; font-size: 10px; display: flex; align-items: center; justify-content: center; font-weight: 700; }

/* ===== Top Bar ===== */
.top-bar { display: flex; align-items: center; justify-content: space-between; background: #fff; border-radius: 14px; padding: 1rem 1.5rem; margin-bottom: 1.5rem; border: 1px solid #e8eaf0; }
.top-bar-right { display: flex; align-items: center; gap: 16px; }

/* ===== Drop Zone ===== */
.drop-zone { border: 2px dashed #c8cfe0; border-radius: 12px; padding: 2.5rem 1rem; text-align: center; cursor: pointer; transition: all 0.2s; }
.drop-zone:hover, .drop-zone.drag { border-color: #4B2D8A; background: #f5f0ff; }
.drop-icon { font-size: 36px; margin-bottom: 10px; }
.drop-text { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.drop-sub  { font-size: 13px; color: #888; }

/* ===== File Items ===== */
.file-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #eef0f6; border-radius: 10px; margin-bottom: 8px; background: #fafbfd; }
.file-icon { width: 34px; height: 34px; background: #fde8e8; color: #c62828; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { font-size: 11px; color: #999; }

/* ===== Result Cards ===== */
.result-card { background: #fff; border: 1px solid #e8eaf0; border-radius: 14px; margin-bottom: 1rem; overflow: hidden; }
.result-header { padding: 12px 16px; border-bottom: 1px solid #eef0f6; display: flex; align-items: center; gap: 10px; background: #fafbfd; }
.result-body { padding: 0 16px; }
.ind-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid #f0f2f7; }
.ind-row:last-child { border-bottom: none; }
.ind-id { font-size: 11px; font-family: 'Courier New', monospace; background: #f0f2f7; color: #4B2D8A; font-weight: 700; padding: 3px 8px; border-radius: 5px; flex-shrink: 0; direction: ltr; }
.ind-name { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.ind-reason { font-size: 12px; color: #777; }

/* ===== Progress ===== */
.progress-wrap { background: #fff; border: 1px solid #e8eaf0; border-radius: 14px; padding: 1rem 1.5rem; margin-bottom: 1.5rem; }
.progress-info { display: flex; justify-content: space-between; font-size: 13px; color: #555; margin-bottom: 8px; }
.progress-bar { height: 6px; background: #eef0f6; border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #4B2D8A, #7B4FB0); border-radius: 3px; transition: width 0.35s; }

/* ===== Modal ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal { background: #fff; border-radius: 16px; padding: 2rem; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; }
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 1.5rem; color: #1a1a2e; }
.modal-actions { display: flex; gap: 10px; margin-top: 1.5rem; justify-content: flex-end; }

/* ===== Indicators List ===== */
.ind-manage-row { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid #f0f2f7; }
.ind-manage-row:last-child { border-bottom: none; }
.ind-manage-id { font-size: 11px; font-family: 'Courier New'; background: #f0f2f7; color: #4B2D8A; font-weight: 700; padding: 2px 7px; border-radius: 5px; flex-shrink: 0; direction: ltr; }
.ind-manage-name { font-size: 12px; color: #333; flex: 1; }
.ind-manage-domain { font-size: 11px; color: #888; flex-shrink: 0; max-width: 100px; text-align: left; }

/* ===== History ===== */
.history-item { border: 1px solid #e8eaf0; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer; transition: border-color 0.2s; }
.history-item:hover { border-color: #4B2D8A; }
.history-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.history-filename { font-size: 13px; font-weight: 600; color: #1a1a2e; }
.history-date { font-size: 12px; color: #999; }
.history-meta { display: flex; gap: 12px; font-size: 12px; color: #666; }

/* ===== Charge Request ===== */
.charge-info-box { background: #f4f6f9; border-radius: 10px; padding: 1.2rem; margin-bottom: 1rem; }
.charge-info-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #e8eaf0; font-size: 15px; }
.charge-info-row:last-child { border-bottom: none; }
.charge-info-label { color: #666; font-size: 14px; }
.charge-info-value { font-weight: 700; color: #1a1a2e; font-size: 16px; }

/* ===== Logo Upload ===== */
.logo-upload-wrap { display: flex; align-items: center; gap: 16px; margin-bottom: 1rem; }
.logo-preview { width: 72px; height: 72px; border-radius: 14px; object-fit: contain; border: 2px dashed #dde1ea; display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.logo-preview-placeholder { font-size: 28px; }

/* ===== Footer ===== */
.dashboard-footer { text-align: center; padding: 1.5rem; font-size: 12px; color: #aaa; border-top: 1px solid #eee; margin-top: 2rem; }

/* ===== Filter Buttons ===== */
.active-filter { background: #4B2D8A !important; color: #fff !important; border-color: #4B2D8A !important; }

/* ===== Notifications Panel ===== */
/* قائمة منسدلة صغيرة تحت الجرس — موضعها يُحسب في JS من موقع الجرس */
.notif-panel { position: fixed; top: 60px; left: 12px; width: 320px; max-width: calc(100vw - 24px);
  max-height: min(58vh, 400px); background: #fff; border: 1px solid #e8eaf2; border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.16); z-index: 300; padding: 0.85rem 1rem; overflow-y: auto;
  opacity: 0; transform: translateY(-8px) scale(.98); pointer-events: none;
  transition: opacity .18s ease, transform .18s ease; }
.notif-panel.open { opacity: 1; transform: none; pointer-events: auto; }
/* شفافة: تلتقط النقر خارج القائمة دون تعتيم الصفحة */
.notif-overlay { position: fixed; inset: 0; background: transparent; z-index: 299; display: none; }
.notif-overlay.open { display: block; }
.notif-item { padding: 12px; border-bottom: 1px solid #f0f2f7; }
.notif-item.unread { background: #f5f0ff; }
.notif-title { font-size: 13px; font-weight: 600; color: #1a1a2e; }
.notif-msg { font-size: 12px; color: #666; margin-top: 3px; }
.notif-time { font-size: 11px; color: #aaa; margin-top: 4px; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .sidebar { width: 100%; height: auto; position: relative; }
  .main-content { margin-right: 0; padding: 1rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .charts-grid-2 { grid-template-columns: 1fr !important; }
}
