/* =============================================
   Q.Tech ERP - التصميم
   ============================================= */
:root {
  --ink: #10232e;        /* كحلي غامق - السايدبار */
  --ink-2: #16303f;
  --teal: #0e7d8a;       /* اللون الأساسي */
  --teal-soft: #e3f2f4;
  --amber: #f2a51a;      /* لون التمييز */
  --bg: #f4f6f8;
  --card: #ffffff;
  --line: #e5eaee;
  --text: #22333d;
  --muted: #7a8a94;
  --green: #1e8e5a;
  --red: #c94040;
}

* { font-family: 'Tajawal', sans-serif; }
body { background: var(--bg); color: var(--text); margin: 0; }

.layout { display: flex; min-height: 100vh; }

/* ---------- القائمة الجانبية ---------- */
.sidebar {
  width: 250px; min-height: 100vh; background: var(--ink);
  color: #cfdde5; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-mark {
  width: 40px; height: 40px; border-radius: 10px; background: var(--teal);
  color: #fff; font-weight: 800; font-size: 22px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 3px rgba(14,125,138,.25);
}
.brand-name { font-weight: 800; color: #fff; font-size: 16px; }
.brand-sub { font-size: 11px; color: #8fa5b1; }

.nav-menu { padding: 12px 10px; flex: 1; overflow-y: auto; }
.nav-menu a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 3px;
  color: #b8cad4; text-decoration: none; border-radius: 8px; font-weight: 500; font-size: 14.5px;
  transition: background .15s, color .15s;
}
.nav-menu a:hover { background: var(--ink-2); color: #fff; }
.nav-menu a.active { background: var(--teal); color: #fff; font-weight: 700; }
.nav-menu a i { font-size: 17px; }

.sidebar-footer { padding: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip i { font-size: 28px; color: var(--amber); }
.u-name { font-weight: 700; color: #fff; font-size: 14px; }
.u-role { font-size: 12px; color: #8fa5b1; }

/* ---------- المحتوى ---------- */
.content { flex: 1; min-width: 0; }
.page-inner { padding: 24px; max-width: 1300px; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--ink); color: #fff; }

.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.page-head h1 { font-size: 22px; font-weight: 800; margin: 0; color: var(--ink); }
.page-head h1 i { color: var(--teal); margin-left: 6px; }

/* ---------- الكروت ---------- */
.card { border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 3px rgba(16,35,46,.05); }
.card-header { background: #fff; border-bottom: 1px solid var(--line); font-weight: 700; border-radius: 12px 12px 0 0 !important; }

.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: flex; align-items: center; gap: 14px; height: 100%; }
.stat-icon { width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.stat-icon.teal { background: var(--teal-soft); color: var(--teal); }
.stat-icon.amber { background: #fdf1da; color: #c07f08; }
.stat-icon.green { background: #e3f3ec; color: var(--green); }
.stat-icon.red { background: #f9e7e7; color: var(--red); }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat-value { font-size: 21px; font-weight: 800; color: var(--ink); }
.stat-value.small-val { font-size: 17px; }

/* ---------- الجداول ---------- */
.table { font-size: 14px; }
.table thead th { background: #f0f3f5; color: var(--ink); font-weight: 700; border-bottom: 2px solid var(--line); white-space: nowrap; }
.table td { vertical-align: middle; }
.table-hover tbody tr:hover { background: var(--teal-soft); }

.badge-lead { background: #fdf1da; color: #a06a05; }
.badge-active { background: #e3f3ec; color: var(--green); }
.badge-low { background: #f9e7e7; color: var(--red); }

/* ---------- الأزرار ---------- */
.btn-teal { background: var(--teal); color: #fff; font-weight: 600; }
.btn-teal:hover { background: #0a6b76; color: #fff; }
.btn-amber { background: var(--amber); color: #3d2a00; font-weight: 700; }
.btn-amber:hover { background: #dd950f; color: #3d2a00; }

.form-label { font-weight: 600; font-size: 13.5px; }
.form-control:focus, .form-select:focus { border-color: var(--teal); box-shadow: 0 0 0 .2rem rgba(14,125,138,.15); }

/* ---------- صفحة الدخول ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(145deg, var(--ink) 0%, #0d3742 100%); }
.login-box { background: #fff; border-radius: 16px; padding: 36px; width: 100%; max-width: 400px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.login-box .brand-mark { margin: 0 auto 12px; width: 54px; height: 54px; font-size: 28px; border-radius: 14px; }

/* ---------- موبايل ---------- */
@media (max-width: 991px) {
  .sidebar { position: fixed; right: -260px; z-index: 1050; transition: right .25s; height: 100vh; }
  .sidebar.open { right: 0; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .page-inner { padding: 16px; }
}

@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .page-inner { padding: 0; max-width: 100%; }
  .card { border: none; box-shadow: none; }
}
