/* ═══════════════════════════════════════════════════════════════════
   catering.css — تقارير الإعاشة (دش بورد + إنشاء + عرض)
   ═══════════════════════════════════════════════════════════════════ */

/* ── Section description (نبذة فوق كل قسم في الموقع) ──────── */
.section-desc {
  font-size: .8rem;
  color: #64748b;
  background: #f8fafc;
  border-right: 3px solid #cbd5e1;
  padding: .55rem .9rem;
  border-radius: 8px;
  margin: -.4rem 0 1rem;
  line-height: 1.6;
  font-weight: 500;
}
.section-desc strong { color: #8b2424; font-weight: 700; }

/* ── Catering top bar / hero ───────────────────────────────── */
.cat-hero {
  background: linear-gradient(135deg,#f59e0b 0%,#d97706 100%);
  color: #fff; padding: 1.2rem 1.5rem;
  border-radius: 16px; margin-bottom: 1.2rem;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 1rem;
  box-shadow: 0 8px 24px rgba(217,119,6,.25);
}
.cat-hero h2 { margin: 0 0 .3rem; font-size: 1.3rem; font-weight: 800; }
.cat-hero p  { margin: 0; opacity: .92; font-size: .85rem; }
.cat-hero-btn {
  background: #fff; color: #d97706; border: 0;
  padding: .65rem 1.3rem; border-radius: 10px;
  font-family: inherit; font-weight: 800; font-size: .9rem;
  cursor: pointer; transition: all .15s;
  display: inline-flex; align-items: center; gap: .4rem;
}
.cat-hero-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.18); }

/* ── Catering Stats ────────────────────────────────────────── */
.cat-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1rem; margin-bottom: 1.2rem;
}
@media (max-width: 900px) { .cat-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .cat-stats { grid-template-columns: 1fr 1fr; } }

.cat-stat {
  background: #fff; border-radius: 14px; padding: 1rem;
  border: 1px solid #eef2f6; display: flex; align-items: center; gap: .85rem;
  box-shadow: 0 1px 3px rgba(15,23,42,.04);
}
.cat-stat-ico {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
}
.cat-stat-ico--orange { background: #fef3c7; color: #d97706; }
.cat-stat-ico--blue   { background: #dbeafe; color: #2563eb; }
.cat-stat-ico--green  { background: #FEE2E2; color: #B91C1C; }
.cat-stat-ico--purple { background: #ede9fe; color: #7c3aed; }
.cat-stat-label { font-size: .76rem; color: #64748b; font-weight: 600; }
.cat-stat-value { font-size: 1.4rem; font-weight: 800; color: #0f172a; line-height: 1.2; }
.cat-stat-sub   { font-size: .7rem; color: #94a3b8; margin-top: .15rem; }

/* ── Reports table ─────────────────────────────────────────── */
.cat-table-wrap {
  background: #fff; border-radius: 14px; border: 1px solid #eef2f6;
  overflow: hidden;
}
.cat-table {
  width: 100%; border-collapse: collapse; font-size: .88rem;
}
.cat-table th, .cat-table td {
  text-align: right; padding: .85rem 1rem; border-bottom: 1px solid #f1f5f9;
}
.cat-table th {
  background: #f8fafc; font-weight: 800; color: #475569; font-size: .8rem;
}
.cat-table tbody tg:hover { background: #fafbfc; }
.cat-pill {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .25rem .65rem; border-radius: 999px;
  font-size: .72rem; font-weight: 700;
}
.cat-pill--breakfast { background: #fef3c7; color: #92400e; }
.cat-pill--lunch     { background: #dbeafe; color: #1e40af; }
.cat-pill--dinner    { background: #ede9fe; color: #5b21b6; }
.cat-pill--mina      { background: #FEE2E2; color: #166534; }
.cat-pill--muzdalifa { background: #e0f2fe; color: #075985; }
.cat-pill--arafat    { background: #fce7f3; color: #9d174d; }

.cat-progress { display: flex; align-items: center; gap: .5rem; min-width: 140px; }
.cat-progress-bar {
  flex: 1; height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden;
}
.cat-progress-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg,#dc3838,#B91C1C);
  transition: width .3s;
}
.cat-progress-fill.low  { background: linear-gradient(90deg,#f87171,#ef4444); }
.cat-progress-fill.mid  { background: linear-gradient(90deg,#fbbf24,#f59e0b); }
.cat-progress-pct { font-weight: 700; font-size: .82rem; color: #0f172a; min-width: 40px; }

.cat-empty {
  text-align: center; padding: 3rem 1rem; color: #64748b;
}
.cat-empty .ico { font-size: 3rem; display: block; margin-bottom: .5rem; }

/* ── Modal (create wizagd) ─────────────────────────────────── */
.cat-modal {
  display: none; position: fixed; inset: 0; z-index: 9000;
  background: rgba(15,23,42,.6); backdrop-filter: blur(4px);
  align-items: center; justify-content: center; padding: 1rem;
}
.cat-modal.show { display: flex; }
.cat-modal-card {
  background: #fff; border-radius: 18px; width: 100%; max-width: 540px;
  max-height: 92vh; overflow-y: auto; padding: 1.6rem 1.7rem;
  box-shadow: 0 24px 60px rgba(0,0,0,.3);
  animation: catSlide .3s ease;
}
@keyframes catSlide { from { opacity:0; transform: translateY(20px); } to { opacity:1; transform:none; } }

.cat-modal-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem;
}
.cat-modal-title { font-size: 1.15rem; font-weight: 800; color: #8b2424; }
.cat-modal-close {
  background: none; border: 0; font-size: 1.5rem; cursor: pointer;
  color: #64748b; line-height: 1;
}
.cat-modal-close:hover { color: #0f172a; }

.cat-meal-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem;
  margin-bottom: 1rem;
}
.cat-meal-card {
  border: 2px solid #e2e8f0; border-radius: 14px;
  padding: 1.1rem .8rem; text-align: center; cursor: pointer;
  background: #fff; transition: all .15s; user-select: none;
}
.cat-meal-card:hover { border-color: #f59e0b; transform: translateY(-2px); }
.cat-meal-card.selected {
  border-color: #d97706; background: #fffbeb;
  box-shadow: 0 4px 12px rgba(217,119,6,.2);
}
.cat-meal-card .ico { font-size: 1.8rem; }
.cat-meal-card .lbl { font-weight: 800; margin-top: .35rem; color: #0f172a; font-size: .9rem; }

.cat-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-bottom: .8rem; }
@media (max-width: 480px) { .cat-form-row { grid-template-columns: 1fr; } }
.cat-form-group { display: flex; flex-direction: column; gap: .35rem; }
.cat-form-group label { font-size: .82rem; font-weight: 700; color: #334155; }
.cat-form-group input,
.cat-form-group select {
  padding: .6rem .8rem; border: 1px solid #e2e8f0; border-radius: 9px;
  font-family: inherit; font-size: .88rem; background: #fafbfc;
}
.cat-form-group input:focus,
.cat-form-group select:focus {
  outline: none; border-color: #d97706; background: #fff;
}

.cat-modal-footer {
  display: flex; justify-content: space-between; gap: .5rem;
  margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid #eef2f6;
}
.cat-btn {
  padding: .6rem 1.2rem; border-radius: 10px; border: 0;
  font-family: inherit; font-weight: 700; font-size: .85rem; cursor: pointer;
  transition: all .15s;
  display: inline-flex; align-items: center; gap: .35rem;
}
.cat-btn--ghost   { background: #f1f5f9; color: #0f172a; }
.cat-btn--ghost:hover { background: #e2e8f0; }
.cat-btn--primary { background: linear-gradient(135deg,#f59e0b,#d97706); color: #fff; }
.cat-btn--primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(217,119,6,.3); }
.cat-btn--success { background: linear-gradient(135deg,#dc3838,#B91C1C); color: #fff; }
.cat-btn--success:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(5,150,105,.3); }
.cat-btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

/* ── Report (checklist) View ───────────────────────────────── */
.cat-report { max-width: 1000px; margin: 0 auto; padding: 1.5rem 1.2rem 4rem; }

.cat-report-hero {
  background: linear-gradient(135deg,#1e293b 0%,#0f172a 100%);
  color: #fff; padding: 1.6rem; border-radius: 18px; margin-bottom: 1.2rem;
  display: grid; grid-template-columns: auto 1fr auto; gap: 1.2rem;
  align-items: center;
}
@media (max-width: 720px) {
  .cat-report-hero { grid-template-columns: 1fr; text-align: center; }
}
.cat-report-hero-icon {
  width: 70px; height: 70px; border-radius: 16px;
  background: rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem;
}
.cat-report-hero h1 { margin: 0 0 .25rem; font-size: 1.4rem; font-weight: 800; }
.cat-report-meta {
  display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem;
}
.cat-report-meta .chip {
  background: rgba(255,255,255,.18); padding: .35rem .8rem;
  border-radius: 999px; font-size: .78rem; font-weight: 700;
}
.cat-report-score {
  text-align: center; padding: .8rem 1rem;
  background: rgba(255,255,255,.1); border-radius: 14px; min-width: 110px;
}
.cat-report-score .pct { font-size: 2rem; font-weight: 900; }
.cat-report-score .lbl { font-size: .72rem; opacity: .85; margin-top: .2rem; }

/* Categories */
.cat-category {
  background: #fff; border: 1px solid #eef2f6; border-radius: 16px;
  padding: 1.2rem 1.4rem; margin-bottom: 1rem;
}
.cat-category-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: .7rem; border-bottom: 2px solid #fef3c7;
  margin-bottom: 1rem;
}
.cat-category-title {
  display: flex; align-items: center; gap: .55rem;
  font-size: 1.1rem; font-weight: 800; color: #0f172a;
}
.cat-category-progress {
  font-size: .82rem; font-weight: 700; color: #d97706;
  background: #fffbeb; padding: .35rem .8rem; border-radius: 999px;
}
.cat-item {
  padding: .8rem .9rem; background: #fafbfc; border-radius: 10px;
  border: 1px solid #eef2f6; margin-bottom: .55rem;
  transition: all .15s;
}
.cat-item.checked { background: #FEF2F2; border-color: #6ee7b7; }
.cat-item-head {
  display: flex; align-items: center; gap: .65rem; cursor: pointer; user-select: none;
}
.cat-item-check {
  width: 22px; height: 22px; border-radius: 6px;
  border: 2px solid #cbd5e1; background: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all .15s;
}
.cat-item.checked .cat-item-check {
  background: #dc3838; border-color: #dc3838; color: #fff;
}
.cat-item-name { font-weight: 700; flex: 1; font-size: .92rem; color: #1e293b; }
.cat-item-note {
  width: 100%; margin-top: .55rem; padding: .55rem .7rem;
  border: 1px solid #e2e8f0; border-radius: 8px; font-family: inherit;
  font-size: .82rem; background: #fff; resize: vertical; min-height: 38px;
}
.cat-item-note:focus { outline: none; border-color: #d97706; }
.cat-item-note[readonly] { background: #f8fafc; cursor: default; }
.cat-item-note.empty[readonly] { display: none; }

.cat-renal-note-wrap {
  background: #fff; border: 1px solid #eef2f6; border-radius: 16px;
  padding: 1.2rem 1.4rem; margin-bottom: 1rem;
}
.cat-renal-note-wrap label {
  display: block; font-weight: 800; color: #0f172a; margin-bottom: .55rem;
}
.cat-renal-note {
  width: 100%; min-height: 90px; padding: .7rem .9rem;
  border: 1px solid #e2e8f0; border-radius: 10px;
  font-family: inherit; font-size: .9rem; resize: vertical;
}

.cat-save-bar {
  position: sticky; bottom: 0; background: #fff;
  padding: .9rem 1rem; border-top: 1px solid #eef2f6;
  display: flex; justify-content: space-between; align-items: center;
  gap: .6rem; flex-wrap: wrap; z-index: 5;
  margin: 0 -1.4rem -1.2rem;
  border-radius: 0 0 16px 16px;
}

/* Toast */
.cat-toast-wrap {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: .4rem;
}
.cat-toast {
  background: #0f172a; color: #fff; padding: .75rem 1.2rem;
  border-radius: 10px; font-size: .88rem; font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: catToast .3s;
}
.cat-toast.ok  { background: #B91C1C; }
.cat-toast.err { background: #dc2626; }
@keyframes catToast { from { opacity:0; transform: translateY(-10px); } to { opacity:1; transform: none; } }

@media (max-width: 480px) {
  .cat-report { padding: 1rem .8rem 5rem; }
  .cat-report-hero { padding: 1.2rem; border-radius: 14px; }
  .cat-category { padding: 1rem; border-radius: 14px; }
  .cat-modal-card { padding: 1.2rem; border-radius: 14px; }
}
