/* RestoPOS theme: أخضر غامق + أبيض
   ملف مستقل فوق AdminLTE/Bootstrap: ما كيحتاج بناء (npm). */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --g-950: #06281d;
  --g-900: #0b3d2e;
  --g-800: #0f5238;
  --g-700: #146c4a;
  --g-600: #1b8a5e;
  --g-200: #bfe0cf;
  --g-100: #e1f0e8;
  --g-50:  #f0f7f3;
  --page:  #f2f6f4;
  --ink:   #12261e;
  --muted: #6a7d74;
  --line:  #e2eae5;
  --danger:#d64545;
  --warn:  #d99a2b;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(11,61,46,.04), 0 8px 24px rgba(11,61,46,.06);
}

html, body {
  font-family: 'Plus Jakarta Sans', 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--page);
}
body { font-size: .92rem; }
a { color: var(--g-700); }
a:hover { color: var(--g-900); }
h1,h2,h3,h4,h5,h6 { color: var(--ink); font-weight: 700; letter-spacing: -.01em; }
.text-muted { color: var(--muted) !important; }

/* ---------- الهيكل ---------- */
.content-wrapper { background: var(--page); }
.content-header { padding: 8px .5rem 0; }

.main-header.navbar {
  background: #fff !important;
  border-bottom: 1px solid var(--line) !important;
  box-shadow: none;
  min-height: 62px;
}
.main-header .nav-link { color: var(--ink); }
.main-header .nav-link:hover { color: var(--g-700); }

/* ---------- القائمة الجانبية ---------- */
.main-sidebar, .main-sidebar.sidebar-dark-primary {
  background: linear-gradient(180deg, var(--g-900) 0%, var(--g-950) 100%) !important;
  box-shadow: none !important;
}
.main-sidebar .brand-link {
  border-bottom: 1px solid rgba(255,255,255,.08) !important;
  background: transparent !important;
  height: 62px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 1rem;
}
.rp-brand {
  display: inline-flex; align-items: center; gap: .6rem;
  color: #fff; font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em;
}
.rp-brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: #fff; color: var(--g-900);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem;
}
.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .rp-brand-text { display: none; }

.main-sidebar .sidebar { padding: 8px 10px; }
.nav-sidebar .nav-link,
.nav-sidebar .nav-link p { color: rgba(255,255,255,.78); }
.nav-sidebar > .nav-item { margin-bottom: 2px; }
.nav-sidebar .nav-link {
  border-radius: 12px !important;
  padding: .6rem .8rem;
  transition: background .15s, color .15s;
}
.nav-sidebar .nav-link:hover { background: rgba(255,255,255,.08) !important; color: #fff; }
.nav-sidebar .nav-link:hover p { color: #fff; }
/* أيقونات الألوان القديمة (blue/green/red...) تولي بيضاء */
.main-sidebar .nav-icon, .main-sidebar .nav-icon.blue, .main-sidebar .nav-icon.green,
.main-sidebar .nav-icon.red, .main-sidebar .nav-icon.orange, .main-sidebar .nav-icon.yellow,
.main-sidebar .nav-icon.teal, .main-sidebar .nav-icon.cyan, .main-sidebar .nav-icon.purple,
.main-sidebar .nav-icon.pink, .main-sidebar .nav-icon.indigo {
  color: rgba(255,255,255,.7) !important;
}
.main-sidebar.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active,
.main-sidebar.sidebar-dark-primary .nav-sidebar > .nav-item.menu-open > .nav-link {
  background: #fff !important;
  color: var(--g-900) !important;
  box-shadow: 0 6px 14px rgba(0,0,0,.18);
}
.main-sidebar.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active p,
.main-sidebar.sidebar-dark-primary .nav-sidebar > .nav-item.menu-open > .nav-link p,
.main-sidebar.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active .nav-icon,
.main-sidebar.sidebar-dark-primary .nav-sidebar > .nav-item.menu-open > .nav-link .nav-icon {
  color: var(--g-900) !important;
}
.nav-treeview { padding-left: .4rem; }
.nav-treeview > .nav-item > .nav-link { padding: .45rem .8rem; font-size: .88rem; }
.nav-treeview > .nav-item > .nav-link.active {
  background: rgba(255,255,255,.14) !important; color: #fff !important; box-shadow: none;
}
.nav-treeview > .nav-item > .nav-link.active p { color: #fff !important; }

/* ---------- البطاقات ---------- */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: #fff;
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--line);
  padding: 1rem 1.25rem;
}
.card-title { font-weight: 700; font-size: 1.02rem; color: var(--ink); }
.card-body { padding: 1.1rem 1.25rem; }
.card-footer { background: transparent; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- الأزرار ---------- */
.btn { border-radius: 10px; font-weight: 600; }
.btn-primary, .btn-primary:focus {
  background: var(--g-800); border-color: var(--g-800); color: #fff;
}
.btn-primary:hover, .btn-primary:active, .btn-primary:not(:disabled):not(.disabled):active {
  background: var(--g-900); border-color: var(--g-900);
}
.btn-outline-primary { color: var(--g-800); border-color: var(--g-800); }
.btn-outline-primary:hover { background: var(--g-800); border-color: var(--g-800); }
.btn-success { background: var(--g-600); border-color: var(--g-600); }
.btn-success:hover { background: var(--g-700); border-color: var(--g-700); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn:focus, .form-control:focus { box-shadow: 0 0 0 .2rem rgba(27,138,94,.18) !important; }

/* ---------- الجداول ---------- */
.table thead th {
  border-top: 0; border-bottom: 1px solid var(--line);
  color: var(--muted); font-weight: 600; font-size: .78rem;
  text-transform: uppercase; letter-spacing: .04em; background: var(--g-50);
}
.table td { border-top: 1px solid var(--line); vertical-align: middle; }
.table-hover tbody tr:hover { background: var(--g-50); }
.table-striped tbody tr:nth-of-type(odd) { background: #fafcfb; }

/* ---------- الحقول ---------- */
.form-control, .custom-select, .vs__dropdown-toggle {
  border-radius: 10px; border-color: #d5e0d9; background: #fff;
}
.form-control:focus { border-color: var(--g-600); }
label { font-weight: 600; color: var(--ink); }

/* ---------- شارات وصفحات ---------- */
.badge { border-radius: 999px; padding: .38em .7em; font-weight: 600; }
.badge-success { background: var(--g-100); color: var(--g-800); }
.badge-warning { background: #fbf0d8; color: #8a5e0c; }
.badge-danger  { background: #fbe3e3; color: #a52a2a; }
.badge-info    { background: #e3eef9; color: #1f5c99; }
.page-link { color: var(--g-800); border-color: var(--line); }
.page-item.active .page-link { background: var(--g-800); border-color: var(--g-800); color: #fff; }
.modal-content { border: 0; border-radius: var(--radius); box-shadow: 0 24px 60px rgba(6,40,29,.25); }
.modal-header { border-bottom: 1px solid var(--line); }
.modal-footer { border-top: 1px solid var(--line); }
.bg-primary { background-color: var(--g-800) !important; }
.text-primary { color: var(--g-700) !important; }
.info-box { border-radius: var(--radius); box-shadow: var(--shadow); }

/* =====================  الداشبورد  ===================== */
.rp-dash { padding: 4px .5rem 28px; }
.rp-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 6px 0 18px; }
.rp-head h1 { font-size: 1.6rem; font-weight: 800; margin: 0; }
.rp-head p { margin: 2px 0 0; color: var(--muted); }
.rp-refresh {
  border: 1px solid var(--line); background: #fff; color: var(--g-800);
  border-radius: 10px; padding: .45rem .9rem; font-weight: 600; cursor: pointer;
}
.rp-refresh:hover { background: var(--g-50); }

.rp-grid { display: grid; gap: 16px; }
.rp-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.rp-main  { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); margin-bottom: 16px; }

.rp-stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px; position: relative; min-height: 138px;
}
.rp-stat .ic {
  width: 40px; height: 40px; border-radius: 12px; background: var(--g-50); color: var(--g-800);
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.rp-stat .lbl { margin-top: 14px; color: var(--muted); font-weight: 600; font-size: .85rem; }
.rp-stat .val { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.rp-stat .chg {
  position: absolute; top: 18px; right: 18px; font-size: .74rem; font-weight: 700;
  padding: .2rem .55rem; border-radius: 999px;
}
.chg.up   { background: var(--g-100); color: var(--g-800); }
.chg.down { background: #fbe3e3; color: #a52a2a; }
.rp-stat.primary {
  background: linear-gradient(145deg, var(--g-700) 0%, var(--g-900) 100%);
  border-color: transparent; color: #fff;
  box-shadow: 0 14px 30px rgba(11,61,46,.28);
}
.rp-stat.primary .ic { background: rgba(255,255,255,.16); color: #fff; }
.rp-stat.primary .lbl { color: rgba(255,255,255,.78); }
.rp-stat.primary .chg.up { background: rgba(255,255,255,.2); color: #fff; }
.rp-stat.primary .chg.down { background: rgba(255,255,255,.9); color: #a52a2a; }

.rp-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; }
.rp-card h3 { font-size: 1.05rem; margin: 0; }
.rp-card .sub { color: var(--muted); font-size: .82rem; margin: 2px 0 14px; }

.rp-chart { width: 100%; height: 250px; display: block; }
.rp-chart .bar { fill: var(--g-800); transition: fill .15s; }
.rp-chart .bar.today { fill: var(--g-600); }
.rp-chart .bar:hover { fill: var(--g-900); }
.rp-chart .bar-bg { fill: var(--g-50); }
.rp-chart text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.rp-chart .val { fill: var(--ink); font-weight: 700; }
.rp-chart line { stroke: var(--line); }

.rp-ring { display: flex; align-items: center; justify-content: center; position: relative; margin: 4px 0 14px; }
.rp-ring .center { position: absolute; text-align: center; }
.rp-ring .center b { display: block; font-size: 1.55rem; font-weight: 800; line-height: 1.1; }
.rp-ring .center span { color: var(--muted); font-size: .78rem; }
.rp-legend { list-style: none; margin: 0; padding: 0; }
.rp-legend li { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); }
.rp-legend .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.rp-legend .nm { font-weight: 600; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-legend .qt { font-weight: 700; }

.rp-empty { color: var(--muted); text-align: center; padding: 28px 0; }

@media (max-width: 1100px) {
  .rp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rp-main  { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .rp-stats { grid-template-columns: 1fr; }
}

/* ---------- صفحة الدخول ---------- */
body > #app, body > div > .container { }
.navbar-laravel { background: #fff; }


/* ---------- إصلاحات ---------- */
/* زر OPEN POS فالشريط العلوي: كتابة بيضاء */
.main-header .btn-primary, .main-header a.btn-primary { color: #fff !important; }
/* الرسم البياني كيعمر البطاقة */
.rp-main > .rp-card:first-child { display: flex; flex-direction: column; }
.rp-main > .rp-card:first-child .rp-chart { flex: 1 1 auto; height: auto; min-height: 250px; }
