/* ============================================================
   Afarinesh Panel — Custom Styles (RTL + Bootstrap 5)
   ============================================================ */

:root {
  --sidebar-width: 260px;
  --navbar-height: 56px;
  --primary: #0d6efd;
  --sidebar-bg: #1e2a3a;
  --sidebar-text: #c8d6e5;
  --sidebar-hover: rgba(255,255,255,0.08);
  --sidebar-active: rgba(13,110,253,0.25);
  --section-color: #5f7d9b;
}

body {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  background: #f4f6f9;
  direction: rtl;
}

/* ── Navbar ─────────────────────────────────────────── */
.navbar { height: var(--navbar-height); }

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: var(--navbar-height);
  right: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--navbar-height));
  background: var(--sidebar-bg);
  overflow-y: auto;
  z-index: 999;
  transition: transform 0.25s ease;
  box-shadow: -2px 0 8px rgba(0,0,0,0.15);
}

.sidebar-header { border-bottom: 1px solid rgba(255,255,255,0.08); }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }

.sidebar .nav-link {
  color: var(--sidebar-text);
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: background 0.15s;
  text-decoration: none;
  display: flex;
  align-items: center;
}
.sidebar .nav-link:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar .nav-link.active { background: var(--sidebar-active); color: #5ba4ff; font-weight: 600; }

.nav-section {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--section-color);
  padding: 12px 14px 4px;
  margin-top: 4px;
}

/* ── Main Content ─────────────────────────────────────── */
.main-content {
  margin-right: var(--sidebar-width);
  margin-top: var(--navbar-height);
  min-height: calc(100vh - var(--navbar-height));
}

.content-header {
  background: #fff;
  border-bottom: 1px solid #e3e6ea;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.content-header h4 { margin: 0; font-size: 1.1rem; font-weight: 600; }

/* ── Cards ────────────────────────────────────────────── */
.card { border: none; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.07); }
.card-header { background: #fff; border-bottom: 1px solid #eee; font-weight: 600; }

/* ── Stat Cards ───────────────────────────────────────── */
.stat-card {
  border-radius: 12px;
  padding: 20px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.stat-card .stat-icon { font-size: 2.4rem; opacity: 0.8; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; }
.stat-card .stat-label { font-size: 0.85rem; opacity: 0.85; }

/* ── Forms ────────────────────────────────────────────── */
.form-label { font-weight: 500; font-size: 0.9rem; }
.form-control, .form-select { font-size: 0.9rem; }
.required-mark { color: #dc3545; margin-right: 3px; }

/* ── Tables ───────────────────────────────────────────── */
.table th { font-weight: 600; font-size: 0.85rem; background: #f8f9fa; }
.table td { font-size: 0.88rem; vertical-align: middle; }

/* ── Badges ───────────────────────────────────────────── */
.badge { font-size: 0.78rem; padding: 5px 10px; border-radius: 6px; }

/* ── Mobile ───────────────────────────────────────────── */
@media (max-width: 991px) {
  .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-right: 0; }
}

/* ── Login Page ───────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0d6efd 0%, #1e2a3a 100%);
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.login-logo { font-size: 2.5rem; color: var(--primary); }

/* ── DataTables RTL ────────────────────────────────────── */
.dataTables_wrapper .dataTables_filter { float: right !important; }
.dataTables_wrapper .dataTables_length { float: left !important; }
.dataTables_wrapper .dataTables_info  { float: right !important; }
.dataTables_wrapper .dataTables_paginate { float: left !important; }

/* ── Misc ─────────────────────────────────────────────── */
.section-divider {
  border-top: 2px solid #e3e6ea;
  margin: 24px 0;
  position: relative;
}
.section-divider span {
  position: absolute;
  top: -12px;
  right: 16px;
  background: #fff;
  padding: 0 10px;
  font-size: 0.82rem;
  color: #666;
  font-weight: 600;
}

.document-row { background: #f8f9fa; border-radius: 8px; padding: 12px; margin-bottom: 8px; }
