/* HesaBee Affiliate – Main Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800;900&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  --primary: #00B4D8;
  --primary-dark: #0096B7;
  --primary-light: #e0f7fc;
  --secondary: #0B1E3D;
  --bg: #F0F4F8;
  --card: #ffffff;
  --text: #1A2B45;
  --text-muted: #5A7090;
  --border: #D6E4F0;
  --success: #10b981;
  --danger: #ef4444;
  --gold: #F4A835;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(11,30,61,.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Tajawal', 'DM Sans', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.6; }
body[dir="ltr"] { font-family: 'DM Sans', sans-serif; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ── Navbar ── */
.navbar {
  background: rgba(11,30,61,.92);
  backdrop-filter: blur(14px);
  padding: 0 0;
  height: 72px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(0,180,216,.2);
  box-shadow: 0 2px 16px rgba(11,30,61,.2);
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 100%; }
.navbar-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.navbar-brand img { height: 52px; display: block; }
.navbar-brand-text { font-family: 'Tajawal', sans-serif; font-weight: 800; color: #fff; line-height: 1.25; text-align: center; }
.navbar-brand-text span { color: var(--primary); }
.navbar-brand-text small { display: block; font-size: .72rem; font-weight: 500; color: rgba(255,255,255,.55); }
.navbar-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.navbar-nav a { color: rgba(255,255,255,.75); padding: 7px 13px; border-radius: 8px; font-size: .88rem; transition: .2s; }
.navbar-nav a:hover { background: rgba(0,180,216,.15); color: #fff; }
.lang-switcher { display: flex; gap: 4px; }
.lang-switcher a { color: rgba(255,255,255,.6); font-size: .78rem; padding: 5px 9px; border-radius: 6px; border: 1px solid rgba(255,255,255,.2); font-weight: 600; }
.lang-switcher a.active, .lang-switcher a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Cards ── */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; border: 1px solid var(--border); }
.card-header { border-bottom: 1px solid var(--border); padding-bottom: 16px; margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; }
.card-header h2 { font-size: 1.05rem; font-weight: 700; }

/* ── Stats ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: flex; align-items: center; gap: 16px; border: 1px solid var(--border); transition: .25s; }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(11,30,61,.12); border-color: var(--primary); }
.stat-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
.stat-icon.yellow { background: rgba(244,168,53,.15); color: #b45309; }
.stat-icon.green  { background: #d1fae5; color: #065f46; }
.stat-icon.blue   { background: rgba(0,180,216,.12); color: var(--primary-dark); }
.stat-icon.purple { background: #ede9fe; color: #5b21b6; }
.stat-value { font-size: 1.6rem; font-weight: 800; line-height: 1; color: var(--secondary); }
.stat-label { font-size: .82rem; color: var(--text-muted); margin-top: 4px; }

/* ── Referral box ── */
.ref-box { background: rgba(0,180,216,.06); border: 2px dashed var(--primary); border-radius: var(--radius); padding: 20px; margin-bottom: 24px; }
.ref-box label { font-weight: 700; font-size: .9rem; color: var(--primary-dark); margin-bottom: 8px; display: block; }
.ref-input-group { display: flex; gap: 8px; }
.ref-input-group input { flex: 1; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: .88rem; background: #fff; }
.btn-copy { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border: none; padding: 10px 18px; border-radius: 8px; cursor: pointer; font-weight: 700; font-size: .85rem; transition: .2s; white-space: nowrap; }
.btn-copy:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,180,216,.3); }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
thead th { background: var(--bg); padding: 11px 14px; text-align: start; font-weight: 700; font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; border-bottom: 2px solid var(--border); }
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(0,180,216,.04); }
.empty-row td { text-align: center; color: var(--text-muted); padding: 40px; }

/* ── Badges ── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .78rem; font-weight: 700; }
.badge-pending  { background: rgba(244,168,53,.15); color: #b45309; }
.badge-approved, .badge-active { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-monthly  { background: rgba(0,180,216,.12); color: var(--primary-dark); }
.badge-yearly   { background: #ede9fe; color: #5b21b6; }

/* ── Buttons ── */
.btn { display: inline-block; padding: 10px 22px; border-radius: 8px; font-weight: 700; font-size: .9rem; cursor: pointer; border: none; transition: .2s; text-align: center; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,180,216,.35); color: #fff; }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .88; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { opacity: .88; }
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 6px; font-size: .9rem; }
.form-control { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 8px; font-size: .9rem; transition: .2s; background: #fff; font-family: inherit; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,180,216,.12); }
.form-text { font-size: .8rem; color: var(--text-muted); margin-top: 4px; }

/* ── Auth ── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(160deg, var(--secondary) 0%, #0D2547 100%);
}
.auth-card {
  background: #fff;
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 24px 60px rgba(0,0,0,.3);
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo img { height: 90px; margin: 0 auto 12px; display: block; }
.auth-logo p { color: var(--text-muted); font-size: .9rem; margin-top: 4px; font-weight: 500; }

/* ── Alerts ── */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: .9rem; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-danger   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info     { background: rgba(0,180,216,.1); color: var(--primary-dark); border: 1px solid rgba(0,180,216,.3); }

/* ── Admin layout ── */
.admin-topbar { background: var(--secondary); color: #fff; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid rgba(0,180,216,.2); }
.admin-topbar h1 { font-size: 1.05rem; font-weight: 700; }
.admin-layout { display: flex; min-height: calc(100vh - 50px); }
.admin-sidebar { width: 230px; background: var(--secondary); padding: 20px 0; flex-shrink: 0; }
.admin-sidebar a { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.55); padding: 11px 20px; font-size: .88rem; transition: .2s; text-decoration: none; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(0,180,216,.1); color: #fff; border-inline-start: 3px solid var(--primary); }
.admin-content { flex: 1; padding: 28px; overflow-x: auto; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.admin-header h1 { font-size: 1.3rem; font-weight: 800; }

/* ── Page wrapper ── */
.page-wrap { padding: 28px 0; }
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 1.4rem; font-weight: 800; }
.page-header p { color: var(--text-muted); font-size: .9rem; margin-top: 4px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr !important; }
  .navbar-brand-text { display: none; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
}
