/* ====================================================
   نظام إدارة محلات الذهب - الأنماط الرئيسية
   Gold ERP System - Main Styles
   ==================================================== */

/* ---- الخطوط العربية المحلية ---- */
@font-face {
  font-family: 'GoldERP Arabic';
  src: url('../fonts/NotoNaskhArabic-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'GoldERP Arabic';
  src: url('../fonts/NotoNaskhArabic-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---- المتغيرات ---- */
:root {
  --gold-primary: #C8960C;
  --gold-dark: #A07808;
  --gold-light: #F5D060;
  --gold-pale: #FDF6DC;
  --gold-gradient: linear-gradient(135deg, #C8960C 0%, #F5D060 60%, #C8960C 100%);
  --dark-bg: #0D0D0D;
  --dark-card: #1A1A1A;
  --dark-border: #2E2E2E;
  --sidebar-bg: #111111;
  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --text-primary: #F0F0F0;
  --text-secondary: #9A9A9A;
  --text-muted: #666666;
  --success: #2ECC71;
  --danger: #E74C3C;
  --warning: #F39C12;
  --info: #3498DB;
  --purple: #9B59B6;
  --teal: #1ABC9C;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-gold: 0 4px 20px rgba(200,150,12,0.25);
  --transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* ---- الأساسيات ---- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  direction: rtl;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body,
button,
input,
select,
textarea,
table,
th,
td {
  font-family: 'GoldERP Arabic', 'Noto Naskh Arabic', 'Cairo', 'Tajawal', sans-serif;
  font-kerning: normal;
  font-feature-settings: 'liga' 1, 'calt' 1;
}

body {
  background: var(--dark-bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

input,
textarea,
select,
button {
  letter-spacing: normal !important;
}

/* ---- شريط التمرير ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--dark-card); }
::-webkit-scrollbar-thumb { background: var(--gold-primary); border-radius: 10px; }

/* ================================================
   صفحة تسجيل الدخول
   ================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #1a1200 0%, #0D0D0D 70%);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(200,150,12,0.15) 0%, transparent 70%);
  top: -200px; right: -200px;
  border-radius: 50%;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(200,150,12,0.1) 0%, transparent 70%);
  bottom: -150px; left: -100px;
  border-radius: 50%;
}

.login-container {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: 20px;
  padding: 50px 45px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 40px rgba(200,150,12,0.1);
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 35px;
}

.login-logo .logo-icon {
  width: 80px; height: 80px;
  background: var(--gold-gradient);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px;
  font-size: 2rem;
  box-shadow: var(--shadow-gold);
}

.login-logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold-primary);
  margin-bottom: 5px;
}

.login-logo p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.tab-switcher {
  display: flex;
  gap: 8px;
  margin-bottom: 30px;
  background: rgba(255,255,255,0.05);
  padding: 5px;
  border-radius: var(--radius);
}

.tab-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  transition: var(--transition);
}

.tab-btn.active {
  background: var(--gold-primary);
  color: #000;
  font-weight: 700;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 8px;
  font-weight: 500;
}

.form-group .input-wrap {
  position: relative;
}

.form-group .input-wrap i {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.form-control {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-sm);
  padding: 12px 42px 12px 16px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--gold-primary);
  background: rgba(200,150,12,0.08);
  box-shadow: 0 0 0 3px rgba(200,150,12,0.15);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control { cursor: pointer; }

.btn-login {
  width: 100%;
  padding: 14px;
  background: var(--gold-gradient);
  border: none;
  border-radius: var(--radius-sm);
  color: #000;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-gold);
  margin-top: 8px;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(200,150,12,0.4);
}

.fingerprint-btn {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1px dashed var(--gold-primary);
  border-radius: var(--radius-sm);
  color: var(--gold-primary);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.fingerprint-btn:hover {
  background: rgba(200,150,12,0.1);
}

/* ================================================
   التخطيط الرئيسي
   ================================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ================================================
   الشريط الجانبي
   ================================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-left: 1px solid var(--dark-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; right: 0;
  height: 100vh;
  z-index: 1000;
  transition: var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid var(--dark-border);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
}

.sidebar-logo {
  width: 40px; height: 40px;
  background: var(--gold-gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-gold);
}

.sidebar-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--gold-primary);
  white-space: nowrap;
  overflow: hidden;
  transition: var(--transition);
}

.sidebar.collapsed .sidebar-title { opacity: 0; width: 0; }

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.nav-section {
  padding: 8px 16px 4px;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  transition: var(--transition);
}

.sidebar.collapsed .nav-section { opacity: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  border-radius: 8px;
  margin: 2px 8px;
  position: relative;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
}

.nav-item:hover {
  background: rgba(200,150,12,0.1);
  color: var(--gold-primary);
}

.nav-item.active {
  background: rgba(200,150,12,0.15);
  color: var(--gold-primary);
  border-right: 3px solid var(--gold-primary);
}

.nav-item i {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-item .nav-label {
  transition: var(--transition);
  font-size: 0.9rem;
}

.sidebar.collapsed .nav-item .nav-label { opacity: 0; width: 0; }

.nav-item .badge {
  margin-right: auto;
  background: var(--gold-primary);
  color: #000;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar.collapsed .nav-item .badge { display: none; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--dark-border);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
}

.user-card:hover { background: rgba(255,255,255,0.08); }

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gold-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #000;
  flex-shrink: 0;
}

.user-info { overflow: hidden; }

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.sidebar.collapsed .user-info { display: none; }

/* ================================================
   المحتوى الرئيسي
   ================================================ */
.main-content {
  flex: 1;
  margin-right: var(--sidebar-width);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content.sidebar-collapsed {
  margin-right: var(--sidebar-collapsed);
}

/* ================================================
   شريط الرأس
   ================================================ */
.topbar {
  height: 72px;
  background: var(--dark-card);
  border-bottom: 1px solid var(--dark-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 900;
}

.toggle-sidebar {
  width: 36px; height: 36px;
  background: transparent;
  border: 1px solid var(--dark-border);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.toggle-sidebar:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.page-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-btn {
  width: 36px; height: 36px;
  background: transparent;
  border: 1px solid var(--dark-border);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  position: relative;
}

.topbar-btn:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.notif-dot {
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  position: absolute;
  top: 6px;
  left: 6px;
}

.gold-price-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(200,150,12,0.1);
  border: 1px solid rgba(200,150,12,0.3);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 0.85rem;
}

.gold-price-tag .label { color: var(--text-secondary); }
.gold-price-tag .value { color: var(--gold-primary); font-weight: 700; }

/* ================================================
   منطقة الصفحة
   ================================================ */
.page-content {
  padding: 24px;
  flex: 1;
}

/* ================================================
   بطاقات الإحصائيات
   ================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: var(--transition);
  cursor: default;
}

.stat-card:hover {
  border-color: rgba(200,150,12,0.3);
  transform: translateY(-3px);
  box-shadow: var(--shadow-gold);
}

.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-icon.gold { background: rgba(200,150,12,0.15); color: var(--gold-primary); }
.stat-icon.green { background: rgba(46,204,113,0.15); color: var(--success); }
.stat-icon.red { background: rgba(231,76,60,0.15); color: var(--danger); }
.stat-icon.blue { background: rgba(52,152,219,0.15); color: var(--info); }
.stat-icon.purple { background: rgba(155,89,182,0.15); color: var(--purple); }
.stat-icon.teal { background: rgba(26,188,156,0.15); color: var(--teal); }

.stat-info { flex: 1; }

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.stat-change {
  font-size: 0.8rem;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ================================================
   البطاقات العامة
   ================================================ */
.card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--dark-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title i { color: var(--gold-primary); }

.card-body { padding: 22px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* ================================================
   الجداول
   ================================================ */
.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table thead th {
  background: rgba(200,150,12,0.08);
  color: var(--gold-primary);
  padding: 13px 16px;
  text-align: right;
  font-weight: 600;
  font-size: 0.82rem;
  border-bottom: 2px solid rgba(200,150,12,0.2);
  white-space: nowrap;
}

.data-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: var(--transition);
}

.data-table tbody tr:hover {
  background: rgba(255,255,255,0.03);
}

.data-table tbody td {
  padding: 12px 16px;
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table .actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

/* ================================================
   الشارات والعلامات
   ================================================ */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-status.active { background: rgba(46,204,113,0.15); color: var(--success); }
.badge-status.inactive { background: rgba(231,76,60,0.15); color: var(--danger); }
.badge-status.cash { background: rgba(52,152,219,0.15); color: var(--info); }
.badge-status.debt { background: rgba(231,76,60,0.15); color: var(--danger); }
.badge-status.sale { background: rgba(46,204,113,0.15); color: var(--success); }
.badge-status.purchase { background: rgba(52,152,219,0.15); color: var(--info); }
.badge-status.supply { background: rgba(200,150,12,0.15); color: var(--gold-primary); }
.badge-status.free { background: rgba(155,89,182,0.15); color: var(--purple); }
.badge-status.monthly { background: rgba(52,152,219,0.15); color: var(--info); }
.badge-status.yearly { background: rgba(46,204,113,0.15); color: var(--success); }

/* ================================================
   الأزرار
   ================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-icon { padding: 8px; width: 34px; height: 34px; justify-content: center; }

.btn-gold {
  background: var(--gold-gradient);
  color: #000;
  box-shadow: var(--shadow-gold);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(200,150,12,0.4); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--dark-border);
  color: var(--text-secondary);
}
.btn-outline:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
  background: rgba(200,150,12,0.05);
}

.btn-danger {
  background: rgba(231,76,60,0.15);
  border: 1px solid rgba(231,76,60,0.3);
  color: var(--danger);
}
.btn-danger:hover { background: rgba(231,76,60,0.25); }

.btn-success {
  background: rgba(46,204,113,0.15);
  border: 1px solid rgba(46,204,113,0.3);
  color: var(--success);
}
.btn-success:hover { background: rgba(46,204,113,0.25); }

.btn-info {
  background: rgba(52,152,219,0.15);
  border: 1px solid rgba(52,152,219,0.3);
  color: var(--info);
}
.btn-info:hover { background: rgba(52,152,219,0.25); }

/* ================================================
   النماذج
   ================================================ */
.form-row { display: grid; gap: 16px; margin-bottom: 16px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

.form-field label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 7px;
  font-weight: 500;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--gold-primary);
  background: rgba(200,150,12,0.06);
  box-shadow: 0 0 0 3px rgba(200,150,12,0.12);
}

.form-field select { cursor: pointer; }
.form-field textarea { resize: vertical; min-height: 90px; }

.calc-preview {
  background: rgba(200,150,12,0.08);
  border: 1px solid rgba(200,150,12,0.2);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 16px;
}

.calc-preview .calc-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.calc-preview .calc-row:last-child { border-bottom: none; }
.calc-preview .calc-row.total {
  color: var(--gold-primary);
  font-weight: 700;
  font-size: 1rem;
  margin-top: 4px;
}

/* ================================================
   المودال / النوافذ المنبثقة
   ================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: 16px;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s ease;
}

.modal-overlay.show .modal { transform: scale(1) translateY(0); }

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--dark-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title i { color: var(--gold-primary); }

.modal-close {
  width: 32px; height: 32px;
  background: transparent;
  border: 1px solid var(--dark-border);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover { border-color: var(--danger); color: var(--danger); }

.modal-body { padding: 24px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--dark-border);
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

/* ================================================
   الرسوم البيانية - ECharts placeholders
   ================================================ */
.chart-container {
  width: 100%;
  height: 300px;
}

.chart-container.tall { height: 400px; }

/* ================================================
   صفحة لوحة التحكم
   ================================================ */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.welcome-text h2 { font-size: 1.3rem; font-weight: 800; }
.welcome-text p { color: var(--text-secondary); font-size: 0.9rem; margin-top: 3px; }

/* ================================================
   بطاقة الفرع
   ================================================ */
.branch-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
  cursor: pointer;
}

.branch-card:hover {
  border-color: rgba(200,150,12,0.4);
  transform: translateY(-3px);
  box-shadow: var(--shadow-gold);
}

.branch-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.branch-icon {
  width: 44px; height: 44px;
  background: rgba(200,150,12,0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--gold-primary);
  flex-shrink: 0;
}

.branch-card-name { font-weight: 700; font-size: 0.95rem; }
.branch-card-location { color: var(--text-secondary); font-size: 0.8rem; margin-top: 2px; }

.branch-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.branch-stat {
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  padding: 10px;
}

.branch-stat .bs-label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }
.branch-stat .bs-value { font-size: 0.95rem; font-weight: 700; }
.branch-stat .bs-value.red { color: var(--danger); }
.branch-stat .bs-value.green { color: var(--success); }
.branch-stat .bs-value.gold { color: var(--gold-primary); }

/* ================================================
   سجل النشاط
   ================================================ */
.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  position: relative;
}

.timeline-item:last-child { border-bottom: none; }

.timeline-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.timeline-dot.sale { background: var(--success); }
.timeline-dot.purchase { background: var(--info); }
.timeline-dot.supply { background: var(--gold-primary); }
.timeline-dot.withdraw { background: var(--warning); }
.timeline-dot.system { background: var(--purple); }

.timeline-content { flex: 1; }

.timeline-title { font-size: 0.9rem; font-weight: 600; }
.timeline-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 3px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ================================================
   إعدادات الاتصال
   ================================================ */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.pricing-card {
  background: var(--dark-card);
  border: 2px solid var(--dark-border);
  border-radius: 16px;
  padding: 30px 24px;
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.pricing-card.featured {
  border-color: var(--gold-primary);
  box-shadow: var(--shadow-gold);
}

.pricing-card.featured::before {
  content: '⭐ الأكثر شيوعًا';
  position: absolute;
  top: 16px;
  right: -30px;
  background: var(--gold-primary);
  color: #000;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 40px;
  transform: rotate(40deg);
  transform-origin: center;
}

.pricing-icon {
  width: 64px; height: 64px;
  border-radius: 16px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

.pricing-price {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--gold-primary);
  margin-bottom: 4px;
}

.pricing-period {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 20px;
}

.pricing-features {
  list-style: none;
  text-align: right;
  margin-bottom: 24px;
}

.pricing-features li {
  padding: 8px 0;
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pricing-features li:last-child { border-bottom: none; }

.pricing-features li i { color: var(--success); font-size: 0.8rem; }
.pricing-features li i.no { color: var(--danger); }

/* ================================================
   التقارير
   ================================================ */
.report-filter {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.karat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(200,150,12,0.15);
  color: var(--gold-primary);
  border: 1px solid rgba(200,150,12,0.2);
}

/* ================================================
   Breadcrumb
   ================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
}

.breadcrumb a:hover { color: var(--gold-primary); }

.breadcrumb .sep { color: var(--dark-border); }

.breadcrumb .current { color: var(--gold-primary); }

/* ================================================
   التنبيهات
   ================================================ */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.alert i { margin-top: 2px; flex-shrink: 0; }

.alert-warning {
  background: rgba(243,156,18,0.1);
  border: 1px solid rgba(243,156,18,0.25);
  color: var(--warning);
}

.alert-info {
  background: rgba(52,152,219,0.1);
  border: 1px solid rgba(52,152,219,0.25);
  color: var(--info);
}

.alert-success {
  background: rgba(46,204,113,0.1);
  border: 1px solid rgba(46,204,113,0.25);
  color: var(--success);
}

/* ================================================
   إشعار Toast
   ================================================ */
.toast-container {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  box-shadow: var(--shadow);
  min-width: 280px;
  max-width: 360px;
  animation: toastIn 0.3s ease;
  pointer-events: all;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.success { border-color: rgba(46,204,113,0.4); }
.toast.success i { color: var(--success); }
.toast.error { border-color: rgba(231,76,60,0.4); }
.toast.error i { color: var(--danger); }
.toast.info { border-color: rgba(52,152,219,0.4); }
.toast.info i { color: var(--info); }
.toast.gold { border-color: rgba(200,150,12,0.4); }
.toast.gold i { color: var(--gold-primary); }

/* ================================================
   شاشة التحميل
   ================================================ */
.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--dark-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  flex-direction: column;
  gap: 24px;
}

.loading-logo {
  width: 80px; height: 80px;
  background: var(--gold-gradient);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: var(--shadow-gold);
  animation: none;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.loading-bar {
  width: 200px;
  height: 4px;
  background: var(--dark-border);
  border-radius: 10px;
  overflow: hidden;
}

.loading-bar-fill {
  height: 100%;
  background: var(--gold-gradient);
  border-radius: 10px;
  animation: none;
  width: 100%;
}

@keyframes loadFill {
  0% { width: 0%; }
  100% { width: 100%; }
}


/* ================================================
   الاستجابة للشاشات الصغيرة
   ================================================ */
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    width: var(--sidebar-width);
    transform: translateX(100%);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .sidebar.collapsed {
    width: var(--sidebar-width);
    transform: translateX(100%);
  }

  .main-content {
    margin-right: 0 !important;
  }

  .topbar { padding: 0 16px; }
  .page-content { padding: 16px; }

  .stats-grid { grid-template-columns: 1fr 1fr; }

  .grid-2,
  .grid-3 { grid-template-columns: 1fr; }

  .form-row.cols-2,
  .form-row.cols-3 { grid-template-columns: 1fr; }

  .pricing-grid { grid-template-columns: 1fr; }

  .gold-price-tag { display: none; }

  .modal { max-width: 100%; border-radius: 16px 16px 0 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }

  .dashboard-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-container { padding: 30px 20px; }
}

/* ================================================
   Overlay للموبايل
   ================================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 999;
}

.sidebar-overlay.show { display: block; }

/* ================================================
   تحسينات الطباعة والتفاصيل
   ================================================ */
.text-gold { color: var(--gold-primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

.fw-bold { font-weight: 700; }
.fw-800 { font-weight: 800; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

.divider { height: 1px; background: var(--dark-border); margin: 16px 0; }

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state i { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.5; }
.empty-state p { font-size: 0.95rem; }

/* ================================================
   أنيميشن
   ================================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-anim { animation: fadeIn 0.35s ease; }

/* ================================================
   مؤشر عيار الذهب
   ================================================ */
.karat-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.karat-btn {
  padding: 7px 14px;
  border: 1px solid var(--dark-border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.karat-btn:hover { border-color: var(--gold-primary); color: var(--gold-primary); }
.karat-btn.active {
  background: var(--gold-primary);
  border-color: var(--gold-primary);
  color: #000;
  font-weight: 700;
}

/* كمبوهات جميلة */
.select-styled {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  padding-left: 36px;
}

/* إضاءة الحد للبطاقات المميزة */
.gold-glow {
  box-shadow: 0 0 0 2px var(--gold-primary), var(--shadow-gold);
}
