/* ===========================================================
   صندوق الجمعية العائلية — Design Tokens
   لوحة الألوان: أزرق/رمادي عصري — مؤسسي
=========================================================== */
:root{
  --paper:        #EEF2F7;   /* خلفية الصفحة */
  --plate:        #FFFFFF;   /* بطاقات */
  --ink:          #1B2733;   /* نص أساسي */
  --ink-soft:     #5C6B7A;   /* نص ثانوي */
  --line:         #DCE3EC;   /* حدود خفيفة */

  --primary:       #2354A6;   /* اللون الأساسي — أزرق مؤسسي */
  --primary-deep:  #163C78;
  --accent:        #64748B;   /* رمادي مزرق — لاسم الدورة */
  --accent-soft:   #E7ECF3;

  --donation:     #2F8F55;   /* أخضر التبرع */
  --donation-bg:  #EAF5EE;
  --expense:      #B5453A;   /* أحمر-قرميدي المصروف */
  --expense-bg:   #FBEBE9;

  --shadow-sm:    0 1px 2px rgba(27,39,51,.06), 0 1px 1px rgba(27,39,51,.04);
  --shadow-md:    0 8px 24px rgba(22,47,90,.10);
  --radius:       14px;
  --radius-sm:    9px;

  --font-display: 'Cairo', 'Tajawal', sans-serif;
  --font-body:    'IBM Plex Sans Arabic', 'Tajawal', sans-serif;
}

*{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; }

body{
  margin:0;
  min-height:100vh;
  background:
    radial-gradient(1200px 600px at 90% -10%, #E3E9F4 0%, transparent 60%),
    var(--paper);
  color:var(--ink);
  font-family:var(--font-body);
  direction:rtl;
  padding:20px 16px 60px;
}


.wrap{ max-width:880px; margin:0 auto; }

/* ===================== شريط علوي بسيط ===================== */
.app-top{
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:16px; padding:0 4px;
}
.app-title{
  font-family:var(--font-display); font-weight:800; font-size:15px;
  color:var(--primary-deep); letter-spacing:.2px; display:flex; align-items:center; gap:8px;
}
.app-title .dot{ width:8px; height:8px; border-radius:50%; background:var(--accent); }

/* ===================== تبويبات ===================== */
.tabs{
  display:flex; gap:6px; background:var(--accent-soft); padding:4px; border-radius:999px;
  margin-bottom:18px;
}
.tab{
  flex:1; border:none; background:transparent; cursor:pointer;
  display:flex; align-items:center; justify-content:center; gap:6px;
  padding:10px 12px; border-radius:999px; font-size:13px; font-weight:700;
  color:var(--ink-soft); font-family:var(--font-body);
  transition:background .12s, color .12s;
  white-space:nowrap;
}
.tab svg{ width:15px; height:15px; }
.tab.active{ background:var(--plate); color:var(--primary-deep); box-shadow:var(--shadow-sm); }
.tab-panel{ display:none; }
.tab-panel.active{ display:block; }

@media (max-width:480px){
  .tab{ font-size:11.5px; padding:9px 6px; }
  .tab svg{ width:13px; height:13px; }
}

/* ===================== رأس التبويب + زر إضافة ===================== */
.panel-head{
  display:flex; align-items:center; justify-content:space-between;
  margin:6px 4px 14px;
}
.panel-head h2{
  font-family:var(--font-display); font-size:16px; font-weight:800; color:var(--primary-deep); margin:0;
}
.btn-add{
  border:none; cursor:pointer; background:var(--primary); color:#fff;
  border-radius:999px; padding:9px 16px; font-weight:700; font-size:13px;
  display:flex; align-items:center; gap:6px; box-shadow:var(--shadow-sm);
  transition:filter .12s, transform .12s;
}
.btn-add:hover{ filter:brightness(1.08); }
.btn-add svg{ width:15px; height:15px; }

/* ===================== شبكة البطاقات (مشاريع / أرشيف) ===================== */
.cards-grid{
  display:grid; grid-template-columns:repeat(auto-fill, minmax(230px, 1fr));
  gap:14px;
}

/* ---- بطاقة مشروع ---- */
.project-card{
  background:var(--plate); border:1px solid var(--line); border-radius:var(--radius);
  padding:18px; box-shadow:var(--shadow-sm); display:flex; flex-direction:column; gap:10px;
}
.project-card-top{ display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
.project-name{ font-weight:700; font-size:15px; color:var(--ink); }
.status-badge{
  font-size:11px; font-weight:700; padding:3px 10px; border-radius:999px; white-space:nowrap;
}
.status-badge.active{ background:var(--donation-bg); color:var(--donation); }
.status-badge.closed{ background:#E4E9F0; color:var(--ink-soft); }
.project-meta{ font-size:12px; color:var(--ink-soft); display:flex; flex-direction:column; gap:4px; }
.project-spent{
  font-family:var(--font-display); font-weight:800; font-size:19px; color:var(--expense);
  font-variant-numeric:tabular-nums;
}
.project-spent .lbl{ font-family:var(--font-body); font-weight:600; font-size:11.5px; color:var(--ink-soft); display:block; }
.btn-close-project{
  border:1px solid var(--expense); background:transparent; color:var(--expense);
  border-radius:9px; padding:9px; font-weight:700; font-size:12.5px; cursor:pointer;
  transition:background .12s, color .12s;
}
.btn-close-project:hover{ background:var(--expense); color:#fff; }
.btn-close-project:disabled{ opacity:.5; cursor:default; background:transparent; color:var(--ink-soft); border-color:var(--line); }

/* ---- بطاقة أرشيف (دورة قديمة) ---- */
.cycle-card{
  background:var(--plate); border:1px solid var(--line); border-radius:var(--radius);
  padding:18px; box-shadow:var(--shadow-sm); cursor:pointer;
  display:flex; flex-direction:column; gap:8px;
  transition:box-shadow .12s, transform .12s;
}
.cycle-card:hover{ box-shadow:var(--shadow-md); transform:translateY(-1px); }
.cycle-card-top{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.cycle-name{ font-weight:700; font-size:15px; color:var(--primary-deep); }
.cycle-dates{ font-size:11.5px; color:var(--ink-soft); }
.cycle-final-balance{ font-family:var(--font-display); font-weight:800; font-size:18px; font-variant-numeric:tabular-nums; }

/* ===================== بطاقة تسليم الأمانة ===================== */
.handover-card{
  background:linear-gradient(180deg, var(--primary) 0%, var(--primary-deep) 100%); color:#fff;
  border-radius:var(--radius); padding:22px; box-shadow:var(--shadow-md);
  display:flex; flex-direction:column; gap:14px; margin-bottom:24px;
}
.handover-text h3{ margin:0 0 6px; font-family:var(--font-display); font-size:16px; font-weight:800; }
.handover-text p{ margin:0; font-size:12.5px; color:rgba(255,255,255,.75); line-height:1.7; }
.btn-handover{
  border:none; cursor:pointer; background:var(--accent); color:#fff;
  border-radius:var(--radius-sm); padding:13px 16px; font-weight:800; font-size:14px;
  box-shadow:var(--shadow-sm); transition:filter .12s, transform .12s;
}
.btn-handover:hover{ filter:brightness(1.06); transform:translateY(-1px); }

/* ===================== نوافذ التأكيد ===================== */
.modal-confirm{ max-width:380px; text-align:center; }
.confirm-text{ font-size:13.5px; color:var(--ink-soft); line-height:1.8; margin:0 0 6px; }
.handover-balance{
  font-family:var(--font-display); font-weight:800; font-size:32px; color:var(--primary-deep);
  margin:10px 0 18px; font-variant-numeric:tabular-nums;
}
.confirm-actions{ display:flex; gap:10px; margin-top:8px; }
.confirm-actions .btn-ghost, .confirm-actions .btn-danger{ flex:1; }
.btn-ghost{
  border:1px solid var(--line); background:transparent; color:var(--ink-soft);
  border-radius:9px; padding:12px; font-weight:700; font-size:13.5px; cursor:pointer;
}
.btn-danger{
  border:none; background:var(--expense); color:#fff;
  border-radius:9px; padding:12px; font-weight:700; font-size:13.5px; cursor:pointer;
  transition:filter .12s;
}
.btn-danger:hover{ filter:brightness(.94); }

.modal-head h3.project{ color:var(--primary); }
.modal-submit.project{ background:var(--primary); }

/* ===================== نافذة تقرير الدورة (Read-Only) ===================== */
.modal-wide{ max-width:560px; }
.report-stats{ display:flex; gap:10px; margin-bottom:16px; flex-wrap:wrap; }
.report-stat{
  flex:1; min-width:110px; background:#F4F7FB; border:1px solid var(--line); border-radius:var(--radius-sm);
  padding:12px; text-align:center;
}
.report-stat .lbl{ font-size:11px; color:var(--ink-soft); font-weight:600; }
.report-stat .val{ font-family:var(--font-display); font-weight:800; font-size:17px; margin-top:4px; font-variant-numeric:tabular-nums; }
.report-stat.donation .val{ color:var(--donation); }
.report-stat.expense .val{ color:var(--expense); }
.report-section-title{
  font-size:12.5px; font-weight:700; color:var(--ink-soft); margin:16px 0 8px;
}
.readonly-table{ width:100%; border-collapse:collapse; font-size:12.5px; }
.readonly-table th{
  text-align:start; color:var(--ink-soft); font-weight:700; padding:6px 8px;
  border-bottom:1px solid var(--line); position:sticky; top:0; background:var(--plate);
}
.readonly-table td{ padding:8px; border-bottom:1px solid var(--line); }
.readonly-scroll{ max-height:240px; overflow-y:auto; }

/* ===================== بطاقة الرصيد (دفتر الحسابات) ===================== */
.ledger-plate{
  position:relative;
  background:linear-gradient(180deg, var(--primary) 0%, var(--primary-deep) 100%);
  color:#fff;
  border-radius:var(--radius);
  padding:26px 24px 22px;
  box-shadow:var(--shadow-md);
  overflow:hidden;
  isolation:isolate;
}
.ledger-plate::before{
  /* خط تخريم علوي — إيحاء بصفحة إيصال/دفتر ممزوقة */
  content:"";
  position:absolute; inset-inline:0; top:0; height:10px;
  background-image:radial-gradient(circle at 10px 5px, var(--paper) 4px, transparent 4.5px);
  background-size:20px 10px;
  background-repeat:repeat-x;
  opacity:.9;
}
.ledger-plate::after{
  content:"";
  position:absolute; inset:0; z-index:-1;
  background-image:radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px);
  background-size:14px 14px;
}

.cycle-eyebrow{
  display:inline-flex; align-items:center; gap:6px;
  font-size:12.5px; font-weight:700; color:var(--accent-soft);
  background:rgba(100,116,139,.28); border:1px solid rgba(100,116,139,.45);
  padding:5px 12px 5px 10px; border-radius:999px; margin-top:6px;
}
.cycle-eyebrow svg{ width:13px; height:13px; }

.balance-row{ display:flex; align-items:baseline; gap:10px; margin-top:16px; flex-wrap:wrap; }
.balance-value{
  font-family:var(--font-display); font-weight:800;
  font-size:clamp(38px, 9vw, 54px);
  line-height:1; letter-spacing:-.5px;
  font-variant-numeric:tabular-nums;
}
.balance-currency{ font-size:18px; font-weight:600; color:rgba(255,255,255,.7); }
.balance-label{ font-size:12.5px; color:rgba(255,255,255,.6); margin-top:4px; }

.stat-strip{
  display:flex; gap:10px; margin-top:18px;
}
.stat-chip{
  flex:1; min-width:0;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.14);
  border-radius:var(--radius-sm);
  padding:10px 12px;
  display:flex; align-items:center; justify-content:space-between;
  gap:8px;
}
.stat-chip .label{ font-size:12px; color:rgba(255,255,255,.7); display:flex; align-items:center; gap:6px; }
.stat-chip .value{ font-weight:700; font-variant-numeric:tabular-nums; font-size:14.5px; }
.stat-chip.in .dot{ background:#6FD79B; }
.stat-chip.out .dot{ background:#EFA79E; }
.stat-chip.cash .dot{ background:#8FC6F5; }
.stat-chip.kind .dot{ background:#E8C77E; }
.stat-chip .dot{ width:7px; height:7px; border-radius:50%; display:inline-block; }
.stat-strip-secondary{ margin-top:10px; }

/* ===================== أزرار الإدخال السريع ===================== */
.action-row{ display:flex; gap:12px; margin-top:16px; }
.btn-action{
  flex:1; border:none; cursor:pointer; border-radius:var(--radius-sm);
  padding:15px 14px; font-family:var(--font-body); font-weight:700; font-size:15px;
  display:flex; align-items:center; justify-content:center; gap:8px;
  box-shadow:var(--shadow-sm);
  transition:transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn-action:hover{ transform:translateY(-1px); box-shadow:var(--shadow-md); }
.btn-action:active{ transform:translateY(0); filter:brightness(.96); }
.btn-action svg{ width:18px; height:18px; }
.btn-donation{ background:var(--donation); color:#fff; }
.btn-expense{ background:var(--expense); color:#fff; }

/* ===================== شريط البحث والفلاتر ===================== */
.toolbar{
  display:flex; gap:10px; margin-top:26px; margin-bottom:12px;
  flex-wrap:wrap; align-items:center;
}
.search-box{
  flex:1; min-width:180px; position:relative;
}
.search-box input{
  width:100%; padding:11px 40px 11px 14px; border-radius:999px;
  border:1px solid var(--line); background:var(--plate);
  font-family:var(--font-body); font-size:14px; color:var(--ink);
  outline:none; transition:border-color .12s;
}
.search-box input:focus{ border-color:var(--primary); }
.search-box svg{
  position:absolute; inset-inline-end:14px; top:50%; transform:translateY(-50%);
  width:16px; height:16px; color:var(--ink-soft); pointer-events:none;
}
#printLedgerBtn{ flex-shrink:0; }
.filter-pills{ display:flex; gap:6px; background:var(--accent-soft); padding:4px; border-radius:999px; }
.pill{
  border:none; background:transparent; cursor:pointer;
  padding:8px 14px; border-radius:999px; font-size:13px; font-weight:600;
  color:var(--ink-soft); font-family:var(--font-body);
  transition:background .12s, color .12s;
  white-space:nowrap;
}
.pill.active{ background:var(--plate); color:var(--primary-deep); box-shadow:var(--shadow-sm); }

/* ===================== جدول السجل ===================== */
.ledger-card{
  background:var(--plate); border-radius:var(--radius); border:1px solid var(--line);
  box-shadow:var(--shadow-sm); overflow:hidden;
}
.ledger-scroll{ overflow-x:auto; }
table.ledger{ width:100%; border-collapse:collapse; min-width:560px; }
table.ledger thead th{
  text-align:start; font-size:12px; font-weight:700; color:var(--ink-soft);
  padding:12px 14px; border-bottom:1px solid var(--line);
  background:#F4F7FB; position:sticky; top:0;
}
table.ledger tbody td{
  padding:13px 14px; font-size:13.5px; border-bottom:1px solid var(--line);
  vertical-align:middle;
}
table.ledger tbody tr:last-child td{ border-bottom:none; }
table.ledger tbody tr{ position:relative; transition:background .12s; }
table.ledger tbody tr:hover{ background:#F2F5FA; }
table.ledger tbody tr td:first-child{ border-inline-start:4px solid transparent; }
tr.row-donation td:first-child{ border-inline-start-color:var(--donation); }
tr.row-expense td:first-child{ border-inline-start-color:var(--expense); }

.type-tag{
  display:inline-flex; align-items:center; gap:5px;
  font-size:12px; font-weight:700; padding:4px 10px; border-radius:999px;
}
.type-tag.donation{ background:var(--donation-bg); color:var(--donation); }
.type-tag.expense{ background:var(--expense-bg); color:var(--expense); }

.kind-tag{
  display:inline-flex; align-items:center;
  font-size:11px; font-weight:600; padding:3px 8px; border-radius:999px;
  margin-inline-start:5px; margin-top:4px;
  background:#EEF1F6; color:var(--ink-soft);
}
.kind-tag.in_kind{ background:#FBF0DC; color:#9A7A28; }

.amount-cell{ font-variant-numeric:tabular-nums; font-weight:700; }
.amount-cell.donation{ color:var(--donation); }
.amount-cell.expense{ color:var(--expense); }

.person-cell{ font-weight:600; }
.notes-cell{ color:var(--ink-soft); font-size:12.5px; }
.project-tag{
  font-size:11.5px; color:var(--ink-soft); background:#E7ECF3; padding:2px 8px;
  border-radius:6px; display:inline-block; margin-top:3px;
}

.empty-state{ text-align:center; padding:48px 20px; color:var(--ink-soft); }
.empty-state svg{ width:38px; height:38px; margin-bottom:10px; opacity:.5; }
.empty-state p{ margin:0; font-size:13.5px; }

.skeleton-row td{ padding:13px 14px; }
.skeleton-bar{
  height:12px; border-radius:6px; background:linear-gradient(90deg, #E7ECF3 25%, #F0F3F8 50%, #E7ECF3 75%);
  background-size:200% 100%; animation:shimmer 1.3s infinite;
}
@keyframes shimmer{ 0%{background-position:200% 0;} 100%{background-position:-200% 0;} }

/* ===================== نوافذ الإدخال (Modal) ===================== */
.modal-overlay{
  position:fixed; inset:0; background:rgba(22,29,26,.45);
  display:flex; align-items:center; justify-content:center; padding:16px;
  opacity:0; pointer-events:none; transition:opacity .16s ease; z-index:50;
}
.modal-overlay.open{ opacity:1; pointer-events:auto; }
.modal-card{
  background:var(--plate); border-radius:var(--radius); width:100%; max-width:400px;
  padding:22px; box-shadow:var(--shadow-md);
  transform:translateY(10px) scale(.98); transition:transform .16s ease;
  max-height:92vh; overflow-y:auto;
}
.modal-overlay.open .modal-card{ transform:translateY(0) scale(1); }
.modal-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.modal-head h3{ margin:0; font-family:var(--font-display); font-size:17px; font-weight:800; }

/* نوافذ أكبر قليلاً لوضوح أفضل: التبرع، المصروف، مشروع جديد، وتأكيد إغلاق مشروع */
#donationModal .modal-card,
#expenseModal .modal-card,
#addProjectModal .modal-card,
#closeProjectModal .modal-card{
  max-width:460px; padding:26px;
}
#donationModal .modal-head h3,
#expenseModal .modal-head h3,
#addProjectModal .modal-head h3,
#closeProjectModal .modal-head h3{ font-size:19px; }
#donationModal .field label,
#expenseModal .field label,
#addProjectModal .field label{ font-size:13.5px; margin-bottom:7px; }
#donationModal .field input,
#donationModal .field select,
#donationModal .field textarea,
#expenseModal .field input,
#expenseModal .field select,
#expenseModal .field textarea,
#addProjectModal .field input,
#addProjectModal .field select,
#addProjectModal .field textarea{ font-size:15.5px; padding:13px 14px; }
#donationModal .modal-submit,
#expenseModal .modal-submit,
#addProjectModal .modal-submit{ font-size:15.5px; padding:15px; }
#closeProjectModal .confirm-text{ font-size:15px; }
.modal-head h3.donation{ color:var(--donation); }
.modal-head h3.expense{ color:var(--expense); }
.modal-close{ border:none; background:#E7ECF3; width:30px; height:30px; border-radius:50%; cursor:pointer;
  display:flex; align-items:center; justify-content:center; color:var(--ink-soft); }
.modal-close svg{ width:15px; height:15px; }

.field{ margin-bottom:13px; }
.field label{ display:block; font-size:12.5px; font-weight:700; color:var(--ink-soft); margin-bottom:6px; }
.field input, .field select, .field textarea{
  width:100%; padding:11px 12px; border-radius:9px; border:1px solid var(--line);
  font-family:var(--font-body); font-size:14px; color:var(--ink); background:#F7F9FC;
  outline:none; transition:border-color .12s;
}
.field input:focus, .field select:focus, .field textarea:focus{ border-color:var(--primary); background:#fff; }
.field textarea{ resize:vertical; min-height:56px; }
.field-error{ color:var(--expense); font-size:12px; margin-top:4px; display:none; }
.field.invalid input, .field.invalid textarea{ border-color:var(--expense); }
.field.invalid .field-error{ display:block; }

.segmented{
  display:flex; background:#F7F9FC; border:1px solid var(--line); border-radius:9px; padding:3px; gap:3px;
}
.segmented-option{
  flex:1; display:flex; align-items:center; justify-content:center;
  padding:9px 10px; border-radius:7px; cursor:pointer;
  font-size:13.5px; font-weight:700; color:var(--ink-soft);
  transition:background .12s, color .12s;
}
.segmented-option input{ position:absolute; opacity:0; width:0; height:0; pointer-events:none; }
.segmented-option.active{ background:var(--plate); color:var(--donation); box-shadow:var(--shadow-sm); }

.modal-submit{
  width:100%; border:none; padding:13px; border-radius:9px; color:#fff;
  font-weight:700; font-size:14.5px; cursor:pointer; margin-top:6px;
  transition:filter .12s, transform .12s;
}
.modal-submit:hover{ filter:brightness(.95); }
.modal-submit:active{ transform:scale(.99); }
.modal-submit.donation{ background:var(--donation); }
.modal-submit.expense{ background:var(--expense); }
.modal-submit:disabled{ opacity:.6; cursor:default; }

/* ===================== Toast ===================== */
.toast-stack{
  position:fixed; bottom:18px; inset-inline:0; display:flex; flex-direction:column;
  align-items:center; gap:8px; z-index:80; pointer-events:none; padding:0 16px;
}
.toast{
  background:var(--primary-deep); color:#fff; padding:11px 18px; border-radius:999px;
  font-size:13.5px; font-weight:600; box-shadow:var(--shadow-md);
  opacity:0; transform:translateY(8px); transition:opacity .18s, transform .18s;
  max-width:420px; text-align:center;
}
.toast.error{ background:var(--expense); }
.toast.show{ opacity:1; transform:translateY(0); }

/* ===================== حالة تحميل عامة / وصول-لوحة-المفاتيح ===================== */
:focus-visible{ outline:2px solid var(--primary); outline-offset:2px; }
@media (prefers-reduced-motion: reduce){
  *{ animation-duration:.001ms !important; transition-duration:.001ms !important; }
}

@media (max-width:480px){
  .action-row{ flex-direction:column; }
  .balance-value{ font-size:40px; }
  .toolbar{ flex-direction:column; align-items:stretch; }
  .filter-pills{ justify-content:space-between; }
}

/* ===================== شاشة تسجيل الدخول ===================== */
#appWrap{ display:none; }
.login-screen{
  position:fixed; inset:0; z-index:200;
  display:flex; align-items:center; justify-content:center; padding:20px;
  background:
    radial-gradient(1200px 600px at 90% -10%, #2A4A85 0%, transparent 60%),
    linear-gradient(180deg, var(--primary-deep) 0%, #101A2B 100%);
}
.login-screen.hidden{ display:none; }
.login-card{
  width:100%; max-width:360px; background:var(--plate); border-radius:var(--radius);
  padding:30px 26px; box-shadow:var(--shadow-md); text-align:center;
}
.login-title{
  font-family:var(--font-display); font-weight:800; font-size:16px; color:var(--primary-deep);
  display:flex; align-items:center; justify-content:center; gap:8px; margin-bottom:6px;
}
.login-title .dot{ width:8px; height:8px; border-radius:50%; background:var(--accent); }
.login-sub{ font-size:12.5px; color:var(--ink-soft); margin:0 0 20px; }
.login-card .field{ text-align:start; }
.login-submit{ background:var(--primary); }

/* ===================== زر أيقونة (الإعدادات) ===================== */
.btn-icon{
  border:1px solid var(--line); background:var(--plate); color:var(--ink-soft);
  width:36px; height:36px; border-radius:50%; cursor:pointer;
  display:flex; align-items:center; justify-content:center; box-shadow:var(--shadow-sm);
  transition:color .12s, border-color .12s;
}
.btn-icon:hover{ color:var(--primary); border-color:var(--primary); }
.btn-icon svg{ width:17px; height:17px; }

/* ===================== الإعدادات ===================== */
.settings-sep{ border:none; border-top:1px solid var(--line); margin:18px 0; }
.settings-logout{ width:100%; margin-top:14px; }

/* ===================== النسخ الاحتياطي ===================== */
.backup-section{ margin-bottom:2px; }
.backup-head{
  display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:6px;
}
.backup-head label{ font-size:12.5px; font-weight:700; color:var(--ink-soft); }
.btn-backup-now{
  border:1px solid var(--primary); background:var(--plate); color:var(--primary);
  font-family:var(--font-body); font-size:12.5px; font-weight:700; cursor:pointer;
  padding:7px 12px; border-radius:999px; white-space:nowrap; transition:background .12s, color .12s;
}
.btn-backup-now:hover{ background:var(--primary); color:#fff; }
.btn-backup-now:disabled{ opacity:.6; cursor:default; }
.backup-hint{ font-size:12px; color:var(--ink-soft); margin:0 0 10px; line-height:1.6; }
.backup-restore-box{ margin-top:14px; padding-top:14px; border-top:1px dashed var(--line); }
.btn-restore{ border-color:var(--expense, #C0392B); color:var(--expense, #C0392B); }
.btn-restore:hover{ background:var(--expense, #C0392B); color:#fff; }
.restore-progress{ text-align:center; padding:10px 0 2px; font-size:13.5px; color:var(--ink-soft); }
.backup-list{
  max-height:190px; overflow-y:auto; border:1px solid var(--line); border-radius:var(--radius-sm);
  background:#F7F9FC;
}
.backup-row{
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  padding:9px 12px; border-bottom:1px solid var(--line);
}
.backup-row:last-child{ border-bottom:none; }
.backup-row-info{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.backup-row-date{ font-size:12.5px; font-weight:700; color:var(--ink); white-space:nowrap; }
.backup-row-meta{ font-size:11px; color:var(--ink-soft); }
.backup-row-meta .tag-auto{ color:var(--primary); }
.backup-row-meta .tag-manual{ color:var(--donation); }
.backup-row-meta .tag-prerestore{ color:var(--expense, #B5453A); }
.backup-row-actions{ display:flex; gap:4px; flex-shrink:0; }
.btn-backup-dl, .btn-backup-del{
  border:1px solid var(--line); background:var(--plate); color:var(--ink-soft);
  width:28px; height:28px; border-radius:50%; cursor:pointer;
  display:flex; align-items:center; justify-content:center; transition:color .12s, border-color .12s;
}
.btn-backup-dl svg, .btn-backup-del svg{ width:13px; height:13px; }
.btn-backup-dl:hover{ color:var(--primary); border-color:var(--primary); }
.btn-backup-del:hover{ color:var(--expense); border-color:var(--expense); }
.backup-empty{ padding:16px 12px; text-align:center; font-size:12.5px; color:var(--ink-soft); }

/* ===================== الوصول عن بعد (VPN) ===================== */
.remote-section{ margin-bottom:2px; }
.switch{ position:relative; display:inline-block; width:40px; height:22px; flex-shrink:0; }
.switch input{ opacity:0; width:0; height:0; }
.switch-slider{
  position:absolute; cursor:pointer; inset:0; background:#D6DBE3; border-radius:999px; transition:background .15s;
}
.switch-slider::before{
  content:''; position:absolute; height:16px; width:16px; left:3px; bottom:3px;
  background:#fff; border-radius:50%; transition:transform .15s;
}
.switch input:checked + .switch-slider{ background:var(--primary); }
.switch input:checked + .switch-slider::before{ transform:translateX(-18px); }

.remote-body{ margin-top:14px; }
.remote-download{ width:100%; margin-top:10px; font-size:12.5px; }

.remote-device-row{
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  padding:9px 12px; border-bottom:1px solid var(--line);
}
.remote-device-row:last-child{ border-bottom:none; }
.remote-device-info{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.remote-device-name{ font-size:12.5px; font-weight:700; color:var(--ink); }
.remote-device-ip{ font-size:11px; color:var(--ink-soft); }
.remote-device-actions{ display:flex; align-items:center; gap:6px; flex-shrink:0; }
.remote-device-actions .switch{ width:32px; height:18px; }
.remote-device-actions .switch-slider::before{ height:12px; width:12px; }
.remote-device-actions .switch input:checked + .switch-slider::before{ transform:translateX(-14px); }
.btn-remote-view, .btn-remote-del{
  border:1px solid var(--line); background:var(--plate); color:var(--ink-soft);
  width:26px; height:26px; border-radius:50%; cursor:pointer;
  display:flex; align-items:center; justify-content:center; transition:color .12s, border-color .12s;
}
.btn-remote-view svg, .btn-remote-del svg{ width:12px; height:12px; }
.btn-remote-view:hover{ color:var(--primary); border-color:var(--primary); }
.btn-remote-del:hover{ color:var(--expense); border-color:var(--expense); }

.qr-wrap{ display:flex; justify-content:center; padding:10px 0 16px; }
.qr-wrap img{ width:180px; height:180px; border:1px solid var(--line); border-radius:var(--radius-sm); }
.remote-config-text{
  width:100%; font-family:monospace; font-size:11.5px; direction:ltr; text-align:left;
  border:1px solid var(--line); border-radius:var(--radius-sm); padding:10px; background:#F7F9FC;
  resize:vertical; margin-bottom:10px;
}

/* ===================== أزرار الطباعة ===================== */
.btn-print-row{
  border:1px solid var(--line); background:var(--plate); color:var(--ink-soft);
  width:30px; height:30px; border-radius:8px; cursor:pointer;
  display:flex; align-items:center; justify-content:center; transition:color .12s, border-color .12s;
}
.btn-print-row:hover{ color:var(--primary); border-color:var(--primary); }
.btn-print-row svg{ width:14px; height:14px; }

.row-actions{ display:flex; gap:6px; justify-content:flex-end; }
.btn-edit-row, .btn-delete-row{
  border:1px solid var(--line); background:var(--plate); color:var(--ink-soft);
  width:30px; height:30px; border-radius:8px; cursor:pointer;
  display:flex; align-items:center; justify-content:center; transition:color .12s, border-color .12s;
}
.btn-edit-row svg, .btn-delete-row svg{ width:14px; height:14px; }
.btn-edit-row:hover{ color:var(--primary); border-color:var(--primary); }
.btn-delete-row:hover{ color:var(--expense); border-color:var(--expense); }

.project-card-actions{ display:flex; gap:8px; }
.project-card-actions .btn-close-project{ flex:1; }
.btn-print-project{
  border:1px solid var(--line); background:transparent; color:var(--ink-soft);
  border-radius:9px; padding:0 12px; cursor:pointer; transition:color .12s, border-color .12s;
}
.btn-print-project:hover{ color:var(--primary); border-color:var(--primary); }
.btn-print-project svg{ width:15px; height:15px; }

.modal-head-actions{ display:flex; align-items:center; gap:8px; }
.btn-print{
  border:1px solid var(--line); background:transparent; color:var(--ink-soft);
  width:30px; height:30px; border-radius:50%; cursor:pointer;
  display:flex; align-items:center; justify-content:center; transition:color .12s, border-color .12s;
}
.btn-print:hover{ color:var(--primary); border-color:var(--primary); }
.btn-print svg{ width:14px; height:14px; }

