/* ============================================
   نظام إدارة الشيكات — Design System
   ============================================ */

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

:root {
  /* Color tokens — Sophisticated, financial-app appropriate */
  --primary-50:  #ECFDF5;
  --primary-100: #D1FAE5;
  --primary-200: #A7F3D0;
  --primary-500: #10B981;
  --primary-600: #059669;
  --primary-700: #047857;
  --primary-800: #065F46;
  --primary-900: #064E3B;

  --accent-100: #FEF3C7;
  --accent-500: #F59E0B;
  --accent-600: #D97706;
  --accent-700: #B45309;

  --success-100: #DCFCE7;
  --success-600: #16A34A;
  --success-800: #166534;

  --danger-100: #FEE2E2;
  --danger-600: #DC2626;
  --danger-800: #991B1B;

  --warning-100: #FEF9C3;
  --warning-600: #CA8A04;
  --warning-800: #854D0E;

  --info-100: #DBEAFE;
  --info-600: #2563EB;
  --info-800: #1E40AF;

  --neutral-50:  #FAFAF9;
  --neutral-100: #F5F5F4;
  --neutral-200: #E7E5E4;
  --neutral-300: #D6D3D1;
  --neutral-400: #A8A29E;
  --neutral-500: #78716C;
  --neutral-600: #57534E;
  --neutral-700: #44403C;
  --neutral-800: #292524;
  --neutral-900: #1C1917;

  /* Surfaces */
  --bg-page:     #F9F8F4;
  --bg-card:     #FFFFFF;
  --bg-soft:     var(--neutral-50);

  --text-primary:   var(--neutral-900);
  --text-secondary: var(--neutral-600);
  --text-muted:     var(--neutral-500);

  --border:        var(--neutral-200);
  --border-strong: var(--neutral-300);

  /* Shadows — subtle, no big blurry blooms */
  --shadow-xs: 0 1px 2px rgba(28, 25, 23, 0.04);
  --shadow-sm: 0 1px 3px rgba(28, 25, 23, 0.06);
  --shadow:    0 2px 6px rgba(28, 25, 23, 0.07);
  --shadow-md: 0 4px 12px rgba(28, 25, 23, 0.08);
  --shadow-lg: 0 12px 24px rgba(28, 25, 23, 0.1);

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;

  --font-arabic:    'Cairo', 'Tajawal', system-ui, sans-serif;
  --font-classical: 'Amiri', 'Cairo', serif;
  --font-mono:      'SF Mono', Menlo, monospace;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font-arabic);
  background: var(--bg-page);
  color: var(--text-primary);
  direction: rtl;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-700); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--primary-800); }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

/* ===== Auth Layout (login/change password) ===== */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at top, rgba(16, 185, 129, 0.07), transparent 60%),
    radial-gradient(ellipse at bottom, rgba(245, 158, 11, 0.04), transparent 60%),
    var(--bg-page);
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
}

.auth-card-header {
  padding: 32px 32px 0;
  text-align: center;
}

.auth-logo {
  display: inline-flex;
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--primary-700), var(--primary-900));
  border-radius: 16px;
  align-items: center; justify-content: center;
  font-size: 28px;
  color: #fff;
  box-shadow: 0 8px 20px rgba(4, 120, 87, 0.25);
  margin-bottom: 16px;
}

.auth-title { font-size: 1.4rem; font-weight: 800; margin-bottom: 4px; }
.auth-subtitle { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 24px; }

.auth-card-body { padding: 8px 32px 32px; }

/* ===== Navbar ===== */
.navbar {
  background: linear-gradient(135deg, var(--primary-900) 0%, var(--primary-700) 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.navbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 28px;
  color: #fff !important;
}

.brand-icon {
  width: 38px; height: 38px;
  background: rgba(245, 158, 11, 0.95);
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 800; font-size: 1.05rem; }
.brand-sub { font-size: 0.7rem; opacity: 0.65; }

.nav-links {
  display: flex;
  gap: 2px;
  flex: 1;
  list-style: none;
}

.nav-links a {
  color: rgba(255,255,255,0.78) !important;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.15s;
}

.nav-links a:hover { color: #fff !important; background: rgba(255,255,255,0.08); }
.nav-links a.active { background: rgba(255,255,255,0.14); color: #fff !important; }

.user-menu {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
}

.user-avatar {
  width: 30px; height: 30px;
  background: var(--accent-500);
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--neutral-900);
}

.user-info { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-size: 0.82rem; font-weight: 600; color: #fff; }
.user-role { font-size: 0.68rem; opacity: 0.65; }

.btn-logout {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  transition: background 0.15s;
}
.btn-logout:hover { background: rgba(255,255,255,0.18); }

/* ===== Layout ===== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 24px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.page-title {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title-icon {
  width: 38px; height: 38px;
  background: var(--primary-100);
  color: var(--primary-700);
  border-radius: var(--radius);
  display: grid; place-items: center;
  font-size: 18px;
}

.page-subtitle { color: var(--text-muted); font-size: 0.92rem; margin-top: 4px; }

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.card-title { font-weight: 700; font-size: 1rem; }
.card-body { padding: 20px; }

/* ===== Stats grid ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 3px; height: 100%;
  background: var(--primary-600);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.stat-card.accent::before { background: var(--accent-500); }
.stat-card.warning::before { background: var(--warning-600); }
.stat-card.success::before { background: var(--success-600); }
.stat-card.danger::before { background: var(--danger-600); }

.stat-icon {
  width: 36px; height: 36px;
  background: var(--primary-100);
  color: var(--primary-700);
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  font-size: 16px;
  margin-bottom: 10px;
}

.stat-card.accent .stat-icon { background: var(--accent-100); color: var(--accent-700); }
.stat-card.warning .stat-icon { background: var(--warning-100); color: var(--warning-800); }
.stat-card.success .stat-icon { background: var(--success-100); color: var(--success-800); }
.stat-card.danger .stat-icon { background: var(--danger-100); color: var(--danger-800); }

.stat-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; margin-bottom: 4px; }
.stat-value { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.stat-currency { font-size: 0.72rem; color: var(--text-muted); font-weight: 500; margin-right: 4px; }
.stat-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary { background: var(--primary-700); color: #fff; }
.btn-primary:hover { background: var(--primary-800); color: #fff; }

.btn-accent { background: var(--accent-600); color: #fff; }
.btn-accent:hover { background: var(--accent-700); color: #fff; }

.btn-secondary { background: var(--neutral-100); color: var(--text-primary); border-color: var(--border); }
.btn-secondary:hover { background: var(--neutral-200); color: var(--text-primary); }

.btn-danger { background: var(--danger-600); color: #fff; }
.btn-danger:hover { background: var(--danger-800); color: #fff; }

.btn-block { width: 100%; justify-content: center; }
.btn-lg { padding: 12px 24px; font-size: 0.98rem; }
.btn-sm { padding: 6px 12px; font-size: 0.82rem; }

/* ===== Forms ===== */
.form-group { display: flex; flex-direction: column; margin-bottom: 16px; }

.form-label {
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.form-label .required { color: var(--danger-600); }

.form-control {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-600);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.form-control.is-invalid {
  border-color: var(--danger-600);
}

.form-error {
  font-size: 0.8rem;
  color: var(--danger-600);
  margin-top: 4px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
}

.form-check input[type="checkbox"] {
  width: 16px; height: 16px;
  cursor: pointer;
  accent-color: var(--primary-700);
}

/* ===== Flash messages ===== */
.flash-container {
  position: fixed;
  top: 84px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  width: 90%;
  max-width: 480px;
  pointer-events: none;
}

.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 0.92rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: all;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateY(-12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.flash-icon {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.flash.success { background: var(--success-100); color: var(--success-800); border-right: 3px solid var(--success-600); }
.flash.success .flash-icon { background: var(--success-600); color: #fff; }

.flash.error { background: var(--danger-100); color: var(--danger-800); border-right: 3px solid var(--danger-600); }
.flash.error .flash-icon { background: var(--danger-600); color: #fff; }

.flash.warning { background: var(--warning-100); color: var(--warning-800); border-right: 3px solid var(--warning-600); }
.flash.warning .flash-icon { background: var(--warning-600); color: #fff; }

.flash.info { background: var(--info-100); color: var(--info-800); border-right: 3px solid var(--info-600); }
.flash.info .flash-icon { background: var(--info-600); color: #fff; }

/* ===== Status badges ===== */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.status-pending { background: var(--warning-100); color: var(--warning-800); }
.status-deposited { background: var(--info-100); color: var(--info-800); }
.status-cleared { background: var(--success-100); color: var(--success-800); }
.status-bounced { background: var(--danger-100); color: var(--danger-800); }
.status-cancelled { background: var(--neutral-200); color: var(--neutral-700); }
.status-lost { background: #FCE7F3; color: #831843; }
.status-endorsed { background: #E0E7FF; color: #312E81; }

/* ===== Error pages ===== */
.error-page {
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px 20px;
}

.error-code {
  font-size: 5rem;
  font-weight: 900;
  color: var(--primary-700);
  letter-spacing: -0.04em;
  line-height: 1;
}

.error-title { font-size: 1.5rem; font-weight: 700; margin: 12px 0; }
.error-description { color: var(--text-muted); margin-bottom: 24px; max-width: 480px; }

/* ===== Footer ===== */
.footer {
  margin-top: 48px;
  padding: 20px 24px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .container { padding: 20px 16px; }
  .navbar-inner { height: auto; min-height: 60px; padding: 12px 16px; flex-wrap: wrap; }
  .nav-links { width: 100%; padding: 8px 0; overflow-x: auto; }
  .brand { margin-left: 0; }
  .page-title { font-size: 1.3rem; }
  .stat-value { font-size: 1.4rem; }
  .user-menu { font-size: 0.78rem; }
}

/* ===== Tables ===== */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.table-toolbar {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.table-search { flex: 1; max-width: 360px; position: relative; }
.table-search input { padding-right: 36px; }
.table-search::before { content: '🔍'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; opacity: 0.5; }

.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }

.filter-pill {
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: #fff;
  text-decoration: none;
  transition: all 0.15s;
}
.filter-pill:hover { border-color: var(--primary-600); color: var(--primary-700); }
.filter-pill.active { background: var(--primary-700); color: #fff !important; border-color: var(--primary-700); }

.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table thead { background: var(--bg-soft); }
.table th {
  font-weight: 700;
  text-align: right;
  padding: 12px 16px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background 0.1s; }
.table tbody tr:hover { background: var(--bg-soft); }

.amount {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.actions-cell { display: flex; gap: 4px; }

.btn-icon {
  padding: 6px;
  width: 32px; height: 32px;
  justify-content: center;
}

.btn-outline {
  background: transparent;
  color: var(--primary-700);
  border-color: var(--primary-700);
}
.btn-outline:hover { background: var(--primary-700); color: #fff; }

/* ===== Type badges ===== */
.type-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
}
.type-out { background: var(--accent-100); color: var(--accent-700); }
.type-in { background: var(--primary-100); color: var(--primary-800); }

/* ===== Form rows ===== */
.form-row {
  display: grid;
  gap: 16px;
  margin-bottom: 14px;
}
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

@media (max-width: 720px) {
  .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr; }
}

.form-actions {
  display: flex;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  margin-top: 24px;
}

.form-tafqeet {
  background: var(--primary-50);
  border: 1px dashed var(--primary-500);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-classical);
  font-size: 1.02rem;
  color: var(--primary-900);
  min-height: 44px;
  line-height: 1.6;
}

/* ===== Detail view ===== */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.detail-item { display: flex; flex-direction: column; }
.detail-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; margin-bottom: 4px; }
.detail-value { font-size: 0.98rem; font-weight: 500; }

/* ===== Split layout ===== */
.split-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 22px;
}
@media (max-width: 900px) {
  .split-layout { grid-template-columns: 1fr; }
}

/* ===== Timeline ===== */
.timeline { position: relative; padding-right: 26px; }
.timeline::before {
  content: '';
  position: absolute;
  right: 9px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 14px; }
.timeline-item::before {
  content: '';
  position: absolute;
  right: -23px; top: 5px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--primary-600);
  border: 2px solid #fff;
}
.timeline-date { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 3px; }
.timeline-content { font-size: 0.92rem; }
.timeline-notes { font-size: 0.82rem; color: var(--text-muted); margin-top: 3px; }

/* ===== Empty state ===== */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-title { font-size: 1.05rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.empty-text { font-size: 0.9rem; margin-bottom: 16px; }

/* Helpers */
.flex { display: flex; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.fw-bold { font-weight: 700 !important; }
.text-muted { color: var(--text-muted) !important; }
.text-danger { color: var(--danger-600) !important; }
.text-primary { color: var(--primary-700) !important; }
.text-center { text-align: center; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

/* ============================================
   Phase 4 — Tables, Forms, Lists, Print
   ============================================ */

/* ===== Tables ===== */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.table-toolbar {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.table-search { flex: 1; max-width: 360px; position: relative; }
.table-search input { padding-right: 36px; }
.table-search::before {
  content: '🔍'; position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%); pointer-events: none; opacity: 0.5;
}

.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-pill {
  padding: 5px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-pill:hover { border-color: var(--primary-600); color: var(--primary-700); }
.filter-pill.active { background: var(--primary-700); color: #fff !important; border-color: var(--primary-700); }

.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table thead { background: var(--neutral-50); }
.table th {
  font-weight: 700; text-align: right;
  padding: 11px 14px;
  color: var(--text-secondary);
  font-size: 0.77rem;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background 0.1s; }
.table tbody tr:hover { background: var(--neutral-50); }

.check-num {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--primary-700);
}

.amount {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.amount-currency {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-right: 3px;
}

.actions-cell { display: flex; gap: 4px; }

.btn-icon { padding: 7px; width: 32px; height: 32px; justify-content: center; }

.type-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
}
.type-out { background: var(--accent-100); color: var(--accent-700); }
.type-in { background: var(--primary-100); color: var(--primary-800); }

.badge-soft { background: var(--neutral-100); color: var(--neutral-700); }

/* ===== Pagination ===== */
.pagination {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
}
.page-link {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: var(--neutral-100);
  color: var(--text-primary);
}
.page-link:hover { background: var(--neutral-200); color: var(--text-primary); }
.page-info { color: var(--text-muted); }

/* ===== Empty state ===== */
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty-icon { font-size: 50px; margin-bottom: 12px; opacity: 0.4; }
.empty-title { font-size: 1.1rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-text { font-size: 0.9rem; margin-bottom: 16px; }

/* ===== Form layouts ===== */
.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; }
@media (max-width: 720px) {
  .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr; }
}

.form-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.form-help-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--info-100);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border-right: 3px solid var(--info-600);
  margin-bottom: 16px;
}

.form-tafqeet {
  background: var(--primary-50);
  border: 1px dashed var(--primary-500);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-classical);
  font-size: 1.02rem;
  color: var(--primary-900);
  min-height: 44px;
  line-height: 1.6;
}

.form-actions {
  display: flex;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  margin-top: 24px;
  flex-wrap: wrap;
}

/* ===== Detail view ===== */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.detail-item { display: flex; flex-direction: column; }
.detail-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
}
.detail-value { font-size: 0.98rem; font-weight: 500; }

.amount-display {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary-800);
  text-align: center;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  padding: 8px 0;
}
.amount-currency-large {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 500;
}

.tafqeet-box {
  background: var(--primary-50);
  border-right: 4px solid var(--primary-600);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-classical);
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--primary-900);
  margin-top: 12px;
}

.notes-box {
  background: var(--neutral-50);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
  white-space: pre-wrap;
}

/* ===== Two-column layout ===== */
.split-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}
@media (max-width: 900px) {
  .split-layout { grid-template-columns: 1fr; }
}

/* ===== Timeline ===== */
.timeline {
  position: relative;
  padding-right: 24px;
}
.timeline::before {
  content: '';
  position: absolute;
  right: 7px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 14px; }
.timeline-item::before {
  content: '';
  position: absolute;
  right: -21px; top: 6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--primary-600);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--border);
}
.timeline-date { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 3px; }
.timeline-content { font-size: 0.92rem; }
.timeline-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 3px; }
.timeline-notes { font-size: 0.85rem; color: var(--text-secondary); margin-top: 4px; padding: 4px 8px; background: var(--neutral-50); border-radius: 4px; }

/* ===== Quick Actions ===== */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary) !important;
  transition: all 0.15s;
}
.quick-action:hover {
  background: var(--primary-50);
  border-color: var(--primary-500);
  color: var(--primary-800) !important;
  transform: translateY(-1px);
}
.quick-action-icon { font-size: 22px; }

/* ===== Helpers ===== */
.text-muted { color: var(--text-muted) !important; }
.text-success { color: var(--success-800) !important; }
.text-danger { color: var(--danger-600) !important; }
.text-warning { color: var(--warning-600) !important; }
.text-primary { color: var(--primary-700) !important; }
.text-center { text-align: center; }
.fw-bold { font-weight: 700 !important; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.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; }
