/* ============================================================
   style.css — TajirPro
   المسار: public_html/tajirpro/assets/css/style.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Almarai:wght@300;400;700;800&family=Cairo:wght@400;500;600;700;900&display=swap');

:root {
  --navy:   #1B2A4A;
  --navy2:  #243660;
  --gold:   #C4933F;
  --gold2:  #e8b96a;
  --bg:     #eef2f7;
  --white:  #ffffff;
  --text:   #1e293b;
  --muted:  #64748b;
  --border: #dde3ee;
  --red:    #dc3545;
  --green:  #28a745;
  --radius: 12px;
  --shadow: 0 1px 4px rgba(27,42,74,0.06), 0 4px 20px rgba(27,42,74,0.07);
  --shadow-sm: 0 1px 3px rgba(27,42,74,0.08);
  --sidebar-w: 260px;
  --input-bg: #f8fafd;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Cairo', 'Almarai', sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--text);
  background: var(--bg);
  direction: rtl;
  font-size: 15px;
  line-height: 1.6;
}
.dash-layout { background: var(--bg); }

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-body { background: linear-gradient(135deg, var(--navy) 0%, #2d4a7a 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-wrap { width: 100%; max-width: 460px; }
.auth-card { background: var(--white); border-radius: 16px; padding: 40px 36px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.auth-back { display: inline-block; color: var(--muted); font-size: 0.85rem; margin-bottom: 20px; }
.auth-back:hover { color: var(--navy); text-decoration: none; }
.auth-logo { font-family: 'Almarai', sans-serif; font-size: 1.6rem; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.auth-logo span { color: var(--gold); }
.auth-title { font-size: 1.3rem; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.auth-sub { color: var(--muted); font-size: 0.88rem; margin-bottom: 24px; }
.auth-form .form-group { margin-bottom: 16px; }
.auth-form label { display: block; font-size: 0.88rem; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.auth-form input, .auth-form select, .auth-form textarea {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border);
  border-radius: 8px; font-family: inherit; font-size: 0.9rem;
  color: var(--text); background: #fff; transition: border-color .2s;
  direction: rtl;
}
.auth-form input:focus, .auth-form select:focus, .auth-form textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(196,147,63,0.12);
}
.hint { font-size: 0.78rem; color: var(--muted); margin-top: 4px; display: block; }
.btn-submit {
  width: 100%; padding: 13px; background: var(--navy); color: #fff;
  border: none; border-radius: 10px; font-family: inherit; font-size: 1rem;
  font-weight: 700; cursor: pointer; transition: background .2s, transform .15s;
  margin-top: 8px;
}
.btn-submit:hover { background: var(--navy2); transform: translateY(-1px); }
.auth-footer-link { text-align: center; font-size: 0.88rem; color: var(--muted); margin-top: 20px; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 0.88rem; margin-bottom: 16px; }
.alert-err { background: #fde8e8; color: #c0392b; border: 1px solid #f5c6cb; }
.alert-ok  { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-warn{ background: #fff3cd; color: #856404; border: 1px solid #ffc107; }

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */
.dash-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #1B2A4A 0%, #152238 100%);
  color: #fff;
  position: fixed; top: 0; right: 0; height: 100vh;
  display: flex; flex-direction: column;
  overflow-y: auto; z-index: 999;
  transition: right .3s ease;
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
}
.sidebar-logo {
  padding: 24px 20px 20px; font-size: 1.4rem; font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-logo span { color: var(--gold); }
.sidebar-merchant { padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-merchant-name { font-size: 0.9rem; font-weight: 600; }
.sidebar-plan-badge {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  padding: 2px 10px; border-radius: 100px; margin-top: 4px;
  background: var(--gold); color: #fff;
}
.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 20px; color: rgba(255,255,255,0.75);
  font-size: 0.9rem; transition: all .2s; text-decoration: none;
  border-right: 3px solid transparent;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-right-color: var(--gold);
}
.sidebar-nav .nav-icon { font-size: 1.1rem; width: 22px; text-align: center; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.1); }
.sidebar-footer a { color: rgba(255,255,255,0.6); font-size: 0.85rem; }
.sidebar-footer a:hover { color: #fff; text-decoration: none; }

/* Main content */
.dash-main {
  margin-right: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 28px; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 40;
  box-shadow: 0 1px 0 var(--border), 0 2px 8px rgba(27,42,74,0.04);
}
.topbar-title { font-size: 1.05rem; font-weight: 800; color: var(--navy); display:flex; align-items:center; gap:8px; }
.topbar-title { font-size: 1.05rem; font-weight: 700; color: var(--navy); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.btn-menu { display: none; background: none; border: none; cursor: pointer; font-size: 1.3rem; color: var(--navy); }

/* Page content */
.page-content { padding: 28px; flex: 1; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 16px;
  transition: box-shadow .2s, transform .2s;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-icon {
  font-size: 1.6rem; width: 48px; height: 48px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(27,42,74,0.07), rgba(27,42,74,0.04));
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-label { font-size: 0.76rem; color: var(--muted); margin-bottom: 3px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value { font-size: 1.6rem; font-weight: 800; color: var(--navy); line-height: 1; }

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 20px;
}
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #f8fafd 0%, #ffffff 100%);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title {
  font-size: 0.92rem; font-weight: 800; color: var(--navy);
  display: flex; align-items: center; gap: 7px;
}
.card-body { padding: 20px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: #f4f7fb; padding: 11px 14px;
  text-align: right; font-size: 0.78rem;
  color: var(--muted); font-weight: 700;
  border-bottom: 2px solid var(--border);
  white-space: nowrap; letter-spacing: 0.03em; text-transform: uppercase;
}
tbody td { padding: 13px 14px; border-bottom: 1px solid #f0f4fa; font-size: 0.87rem; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafcff; }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 100px; font-size: 0.75rem; font-weight: 600; }
.badge-pending   { background: #fff3cd; color: #856404; }
.badge-confirmed { background: #d4edda; color: #155724; }
.badge-shipped   { background: #d1ecf1; color: #0c5460; }
.badge-delivered { background: #d4edda; color: #155724; }
.badge-cancelled { background: #f8d7da; color: #721c24; }
.badge-free      { background: #e9ecef; color: #495057; }
.badge-starter   { background: #fff3cd; color: #856404; }
.badge-pro       { background: #d4edda; color: #155724; }
.badge-active    { background: #d4edda; color: #155724; }
.badge-inactive  { background: #f8d7da; color: #721c24; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 9px;
  font-family: inherit; font-size: 0.85rem; font-weight: 700;
  cursor: pointer; border: none; transition: all .2s;
  text-decoration: none; white-space: nowrap;
}
.btn-sm { padding: 5px 12px; font-size: 0.78rem; border-radius: 7px; }
.btn-navy {
  background: var(--navy); color: #fff;
  box-shadow: 0 2px 8px rgba(27,42,74,0.25);
}
.btn-navy:hover { background: var(--navy2); color: #fff; text-decoration: none; box-shadow: 0 4px 14px rgba(27,42,74,0.3); transform: translateY(-1px); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #fff; box-shadow: 0 2px 8px rgba(196,147,63,0.3);
}
.btn-gold:hover { background: linear-gradient(135deg, var(--gold2), var(--gold)); color: #fff; text-decoration: none; box-shadow: 0 4px 14px rgba(196,147,63,0.4); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--navy); border: 1.5px solid var(--border); }
.btn-outline:hover { background: var(--bg); color: var(--navy); text-decoration: none; border-color: var(--navy); }
.btn-danger { background: var(--red); color: #fff; box-shadow: 0 2px 8px rgba(220,53,69,0.2); }
.btn-danger:hover { background: #c0392b; color: #fff; text-decoration: none; }
.btn-success { background: var(--green); color: #fff; }
.btn-wa { background: #25D366; color: #fff; box-shadow: 0 2px 8px rgba(37,211,102,0.25); }
.btn-wa:hover { background: #1da851; color: #fff; text-decoration: none; }

/* Forms inside dashboard */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: 9px; font-family: inherit; font-size: 0.88rem;
  color: var(--text); background: var(--input-bg);
  transition: border-color .2s, box-shadow .2s, background .2s;
  direction: rtl;
}
.form-control:focus {
  outline: none; border-color: var(--gold);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(196,147,63,0.14);
}
.form-control[readonly] { background: #f1f4f9; color: var(--muted); cursor: default; }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 700; color: var(--navy); margin-bottom: 5px; letter-spacing: 0.01em; }

/* 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: 20px; opacity: 0; pointer-events: none; transition: opacity .25s; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal { background: var(--white); border-radius: 14px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.2); transform: translateY(20px); transition: transform .25s; }
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { padding: 20px 24px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 1rem; font-weight: 700; color: var(--navy); }
.modal-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* Upgrade banner */
.upgrade-banner {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #fff; padding: 14px 20px; border-radius: 10px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.upgrade-banner-text { font-size: 0.9rem; font-weight: 600; }
.upgrade-banner-text small { display: block; font-weight: 400; opacity: 0.85; font-size: 0.78rem; margin-top: 2px; }
.btn-upgrade { background: #fff; color: var(--navy); padding: 8px 20px; border-radius: 8px; font-weight: 700; font-size: 0.85rem; text-decoration: none; }

/* Tabs */
.tabs { display: flex; gap: 4px; background: var(--bg); border-radius: 10px; padding: 4px; margin-bottom: 20px; flex-wrap: wrap; }
.tab-btn { padding: 7px 16px; border-radius: 7px; border: none; background: transparent; color: var(--muted); font-family: inherit; font-size: 0.85rem; cursor: pointer; font-weight: 500; transition: all .2s; }
.tab-btn.active { background: var(--white); color: var(--navy); font-weight: 700; box-shadow: 0 1px 6px rgba(0,0,0,0.08); }

/* Product image preview */
.img-preview { width: 80px; height: 80px; border-radius: 8px; object-fit: cover; border: 2px solid var(--border); }
.img-preview-lg { width: 120px; height: 120px; }

/* Copy input */
.copy-group { display: flex; gap: 8px; align-items: center; }
.copy-group input { flex: 1; }

/* Toast */
.toast-container { position: fixed; bottom: 24px; left: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 10px; font-size: 0.88rem; box-shadow: 0 4px 20px rgba(0,0,0,0.2); animation: slideIn .3s ease; max-width: 300px; }
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Mobile responsive */
@media (max-width: 768px) {
  .sidebar { right: calc(-1 * var(--sidebar-w)); }
  .sidebar.open { right: 0; box-shadow: -8px 0 40px rgba(0,0,0,0.35); }
  .dash-main { margin-right: 0; }
  .btn-menu { display: block; }
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  table { font-size: 0.82rem; }
  thead th, tbody td { padding: 8px 10px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
}


/* ============================================================
   SETTINGS — Payment accordions
   ============================================================ */
details[style*="border:1px solid var(--border)"] {
  transition: box-shadow .2s;
}
details[style*="border:1px solid var(--border)"][open] {
  box-shadow: 0 2px 12px rgba(27,42,74,0.07);
}
details summary::-webkit-details-marker { display: none; }
details summary { outline: none; }
details summary:hover { background: #f0f4f9 !important; }

/* Sidebar overlay */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 998; }
.modal-overlay.open { display: block; }

/* Page content spacing */
.page-content { padding: 24px 28px; flex: 1; }
