/* ═══════════════════════════════════════════════════
   ZAHIN — assets/css/zahin.css
   Design System v1.0
   ═══════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────── */
:root {
  --z-blue:       #1A3ADB;
  --z-blue-dark:  #1230B0;
  --z-blue-light: #E8EDFF;
  --z-navy:       #0D1B5E;
  --z-cyan:       #00B4D8;
  --z-success:    #10B981;
  --z-warning:    #F59E0B;
  --z-danger:     #EF4444;
  --z-gray-50:    #F9FAFB;
  --z-gray-100:   #F3F4F6;
  --z-gray-200:   #E5E7EB;
  --z-gray-400:   #9CA3AF;
  --z-gray-600:   #4B5563;
  --z-gray-800:   #1F2937;
  --z-white:      #FFFFFF;
  --z-radius:     10px;
  --z-radius-lg:  16px;
  --z-shadow:     0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --z-shadow-lg:  0 8px 32px rgba(26,58,219,.12);
  --z-font:       'Inter', 'Jost', system-ui, sans-serif;
  --z-sidebar-w:  240px;
}

/* ── Reset ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: var(--z-font); color: var(--z-gray-800); background: var(--z-gray-50); line-height: 1.6; }
a { color: var(--z-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ── Typography ─────────────────────────────────── */
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.375rem; font-weight: 700; }
h3 { font-size: 1.125rem; font-weight: 600; }
h4 { font-size: 1rem;     font-weight: 600; }

/* ── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--z-radius); font-size: .9rem;
  font-weight: 600; cursor: pointer; border: none; transition: all .18s ease;
  white-space: nowrap;
}
.btn-primary  { background: var(--z-blue); color: #fff; }
.btn-primary:hover { background: var(--z-blue-dark); text-decoration: none; }
.btn-outline  { background: transparent; border: 1.5px solid var(--z-blue); color: var(--z-blue); }
.btn-outline:hover { background: var(--z-blue-light); }
.btn-danger   { background: var(--z-danger); color: #fff; }
.btn-success  { background: var(--z-success); color: #fff; }
.btn-sm       { padding: 6px 14px; font-size: .8rem; }
.btn-full     { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Forms ──────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .85rem; font-weight: 600; color: var(--z-gray-600); margin-bottom: 6px;
}
.form-group label .label-link { font-weight: 400; color: var(--z-blue); }
.form-group .hint { font-weight: 400; color: var(--z-gray-400); font-size: .8rem; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--z-gray-200);
  border-radius: var(--z-radius); font-size: .9rem; background: var(--z-white);
  transition: border-color .15s ease; outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--z-blue); }
.input-with-icon { position: relative; }
.input-with-icon input { padding-right: 44px; }
.toggle-password {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--z-gray-400);
}
.form-check { display: flex; align-items: flex-start; gap: 10px; }
.form-check input { width: auto; margin-top: 3px; }
.form-check label { font-weight: 400; font-size: .85rem; color: var(--z-gray-600); }

/* ── Alerts ─────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--z-radius); font-size: .875rem;
  margin-bottom: 20px; border-left: 4px solid transparent;
}
.alert-error   { background: #FEF2F2; border-color: var(--z-danger);  color: #991B1B; }
.alert-success { background: #F0FDF4; border-color: var(--z-success); color: #166534; }
.alert-warning { background: #FFFBEB; border-color: var(--z-warning); color: #92400E; }
.alert-info    { background: var(--z-blue-light); border-color: var(--z-blue); color: var(--z-navy); }

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

/* ── Stat Cards ─────────────────────────────────── */
.stat-card {
  background: var(--z-white); border-radius: var(--z-radius-lg);
  box-shadow: var(--z-shadow); padding: 24px; position: relative; overflow: hidden;
}
.stat-card.primary { background: linear-gradient(135deg, var(--z-blue), var(--z-navy)); color: #fff; }
.stat-card .stat-label { font-size: .8rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--z-gray-400); margin-bottom: 8px; }
.stat-card.primary .stat-label { color: rgba(255,255,255,.7); }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.stat-card .stat-sub { font-size: .8rem; color: var(--z-gray-400); margin-top: 6px; }
.stat-card.primary .stat-sub { color: rgba(255,255,255,.6); }

/* ── Badge / Status ─────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600;
}
.badge-success  { background: #D1FAE5; color: #065F46; }
.badge-warning  { background: #FEF3C7; color: #92400E; }
.badge-danger   { background: #FEE2E2; color: #991B1B; }
.badge-info     { background: var(--z-blue-light); color: var(--z-navy); }
.badge-gray     { background: var(--z-gray-100); color: var(--z-gray-600); }

/* ── Table ──────────────────────────────────────── */
.z-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.z-table th {
  text-align: left; padding: 10px 14px; font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--z-gray-400);
  border-bottom: 1px solid var(--z-gray-200);
}
.z-table td { padding: 14px; border-bottom: 1px solid var(--z-gray-100); vertical-align: middle; }
.z-table tr:last-child td { border-bottom: none; }
.z-table tr:hover td { background: var(--z-gray-50); }
.table-wrap { overflow-x: auto; }

/* ── Auth pages ─────────────────────────────────── */
.auth-page { background: var(--z-blue-light); min-height: 100vh;
  display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-container { width: 100%; max-width: 440px; }
.auth-card { background: var(--z-white); border-radius: var(--z-radius-lg);
  box-shadow: var(--z-shadow-lg); padding: 40px 36px; }
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-title { font-size: 1.5rem; font-weight: 700; text-align: center; margin-bottom: 6px; }
.auth-subtitle { font-size: .875rem; color: var(--z-gray-400); text-align: center; margin-bottom: 28px; }
.auth-footer { text-align: center; font-size: .85rem; color: var(--z-gray-400); margin-top: 24px; }
.account-type-toggle { display: flex; background: var(--z-gray-100); border-radius: var(--z-radius);
  padding: 4px; margin-bottom: 20px; }
.type-option { flex: 1; position: relative; }
.type-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.type-option span {
  display: block; text-align: center; padding: 8px; font-size: .875rem; font-weight: 600;
  color: var(--z-gray-400); border-radius: 7px; cursor: pointer; transition: all .15s;
}
.type-option input:checked + span { background: var(--z-white); color: var(--z-blue);
  box-shadow: 0 1px 4px rgba(0,0,0,.1); }

/* ── Dashboard layout ───────────────────────────── */
.dash-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.dash-sidebar {
  width: var(--z-sidebar-w); background: var(--z-navy); color: #fff;
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0;
  height: 100vh; z-index: 100; overflow-y: auto;
}
.sidebar-logo { padding: 24px 20px 20px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-logo img { height: 36px; }
.sidebar-nav { flex: 1; padding: 16px 0; }
.sidebar-section { padding: 8px 20px 4px;
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: rgba(255,255,255,.35); }
.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; font-size: .875rem; font-weight: 500;
  color: rgba(255,255,255,.7); transition: all .15s; border-left: 3px solid transparent;
}
.sidebar-link:hover { color: #fff; background: rgba(255,255,255,.06); text-decoration: none; }
.sidebar-link.active { color: #fff; background: rgba(26,58,219,.4); border-left-color: var(--z-blue); }
.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.sidebar-user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--z-blue); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .875rem; color: #fff; flex-shrink: 0;
}
.sidebar-user-name { font-size: .85rem; font-weight: 600; color: #fff; }
.sidebar-user-role { font-size: .75rem; color: rgba(255,255,255,.4); }

/* Main content */
.dash-main { margin-left: var(--z-sidebar-w); flex: 1; display: flex; flex-direction: column; }
.dash-topbar {
  background: var(--z-white); border-bottom: 1px solid var(--z-gray-200);
  padding: 0 32px; height: 64px; display: flex; align-items: center;
  justify-content: space-between; position: sticky; top: 0; z-index: 50;
}
.dash-topbar-title { font-size: 1.1rem; font-weight: 700; }
.dash-content { padding: 32px; flex: 1; }

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ── KYC banner ─────────────────────────────────── */
.kyc-banner {
  background: linear-gradient(135deg, #FEF3C7, #FFFBEB);
  border: 1.5px solid var(--z-warning); border-radius: var(--z-radius-lg);
  padding: 16px 20px; display: flex; align-items: center; gap: 14px;
  margin-bottom: 28px;
}
.kyc-banner svg { color: var(--z-warning); flex-shrink: 0; }
.kyc-banner p { font-size: .875rem; color: #92400E; }

/* ── Amount input ───────────────────────────────── */
.amount-input-wrap { position: relative; }
.amount-input-wrap .currency-symbol {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-weight: 700; color: var(--z-gray-600);
}
.amount-input-wrap input { padding-left: 32px; font-size: 1.5rem; font-weight: 700; }

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .dash-sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .dash-sidebar.open { transform: translateX(0); }
  .dash-main { margin-left: 0; }
  .dash-content { padding: 20px 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
}
