/* ────────────────────────────────────────────
   مالياتي — CSS مخصّص
   يكمّل Tailwind CDN
   ──────────────────────────────────────────── */

* {
  -webkit-tap-highlight-color: transparent;
}

body {
  font-feature-settings: 'kern' 1, 'liga' 1;
  -webkit-font-smoothing: antialiased;
}

/* أرقام لاتينية في كل مكان (المبالغ المالية) */
.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* عناوين ديسبلاي */
.font-display {
  font-feature-settings: 'kern' 1, 'liga' 1;
  letter-spacing: -0.01em;
}

/* البطاقة الأساسية */
.card {
  background: #FBF8F3;
  border: 1px solid #E5DDD0;
  border-radius: 12px;
  padding: 20px;
}

.card-tight {
  background: #FBF8F3;
  border: 1px solid #E5DDD0;
  border-radius: 10px;
  padding: 14px;
}

/* شريط التقدم */
.progress {
  height: 8px;
  background: #E5DDD0;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s ease-out;
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0.15) 0%, transparent 100%);
}

/* تنبيهات اللون */
.progress-bar.warn { background: #C97E4B; }
.progress-bar.danger { background: #7A2E2E; }
.progress-bar.success { background: #1E4D3B; }
.progress-bar.gold { background: #B89968; }

/* رقم كبير (للأرقام البارزة في Dashboard) */
.big-number {
  font-family: 'Amiri', serif;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
}

/* الأزرار */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: #1E4D3B;
  color: #FBF8F3;
}
.btn-primary:hover {
  background: #2D6B53;
  transform: translateY(-1px);
}

.btn-gold {
  background: #B89968;
  color: #FBF8F3;
}
.btn-gold:hover {
  background: #D4B888;
}

.btn-outline {
  background: transparent;
  color: #1E4D3B;
  border-color: #E5DDD0;
}
.btn-outline:hover {
  background: #F5F1EA;
  border-color: #1E4D3B;
}

.btn-danger {
  background: #7A2E2E;
  color: #FBF8F3;
}
.btn-danger:hover {
  background: #8B3A3A;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

/* الـ inputs */
.input,
.select,
.textarea {
  width: 100%;
  padding: 10px 14px;
  background: #FBF8F3;
  border: 1px solid #E5DDD0;
  border-radius: 10px;
  font-size: 14px;
  color: #1F1B16;
  font-family: inherit;
  transition: border-color 0.2s;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: #1E4D3B;
  box-shadow: 0 0 0 3px rgba(30, 77, 59, 0.08);
}

.textarea {
  resize: vertical;
  min-height: 120px;
  font-family: 'Courier New', monospace;
  direction: ltr;
  text-align: left;
}

.label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: #5C544A;
  font-weight: 500;
}

/* الجدول */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  text-align: right;
  padding: 12px 14px;
  background: #F5F1EA;
  font-size: 13px;
  color: #5C544A;
  font-weight: 600;
  border-bottom: 1px solid #E5DDD0;
}

.table td {
  padding: 14px;
  border-bottom: 1px solid #E5DDD0;
  font-size: 14px;
}

.table tr:hover td {
  background: #F5F1EA;
}

.table tr:last-child td {
  border-bottom: none;
}

/* Pill / badge */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

/* الـ tags الخاصة بالألوان */
.pill-emerald { background: rgba(30,77,59,0.1); color: #1E4D3B; }
.pill-gold { background: rgba(184,153,104,0.15); color: #8B7448; }
.pill-burgundy { background: rgba(122,46,46,0.1); color: #7A2E2E; }
.pill-sky { background: rgba(58,95,122,0.1); color: #3A5F7A; }
.pill-faint { background: #E5DDD0; color: #5C544A; }

/* خلفية المظروف (envelope) للبنود */
.envelope {
  border-right: 4px solid var(--cat-color, #1E4D3B);
  padding-right: 14px;
}

/* عنوان قسم */
.section-title {
  font-family: 'Amiri', serif;
  font-size: 22px;
  font-weight: 700;
  color: #1E4D3B;
  margin-bottom: 4px;
}

.section-subtitle {
  font-size: 13px;
  color: #8B8276;
  margin-bottom: 16px;
}

/* للجوال — تحسينات */
@media (max-width: 640px) {
  .card { padding: 16px; }
  .table th, .table td { padding: 10px 8px; font-size: 13px; }
  .big-number { font-size: 28px; }
}

/* السكرول الزخرفي */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: #F5F1EA;
}
::-webkit-scrollbar-thumb {
  background: #C9BFB1;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #B89968;
}

/* انيميشن خفيف للظهور */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeUp 0.3s ease-out;
}
