/* ============================================================
   modals.css — Modals, toast, worker cards, print receipts
   ============================================================ */

/* ─── Modal scaffold ─── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.78);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 13px;
  backdrop-filter: blur(5px);
}
.modal.show { display: flex; }
.modal-dialog {
  background: var(--navy2);
  border: 1px solid rgba(201,168,76,.18);
  border-radius: 14px;
  width: 100%;
  max-width: 580px;
  max-height: 93vh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.modal-dialog.sm { max-width: 400px; }
.modal-header {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--navy2);
  z-index: 1;
}
.modal-title { font-size: 14px; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  color: var(--gray);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--white); }
.modal-body { padding: 18px 20px; }
.modal-footer {
  padding: 11px 20px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
#mPwd { z-index: 600; }

/* Password input */
.pwd-input {
  width: 100%;
  background: rgba(15,31,61,.7);
  border: 2px solid rgba(224,85,85,.3);
  border-radius: var(--r2);
  padding: 11px 15px;
  color: var(--white);
  font-family: inherit;
  font-size: 14px;
  text-align: center;
  letter-spacing: 3px;
}
.pwd-input:focus { outline: none; border-color: var(--red); }
.err-box {
  background: rgba(224,85,85,.12);
  border: 1px solid rgba(224,85,85,.3);
  border-radius: var(--r2);
  padding: 10px;
  color: var(--red);
  font-size: 13px;
  margin-bottom: 12px;
  display: none;
}

/* ─── Worker cards ─── */
.wcard {
  background: linear-gradient(135deg, rgba(123,94,167,.05), rgba(15,31,61,.5));
  border: 1px solid rgba(123,94,167,.18);
  border-radius: var(--r);
  padding: 17px;
  margin-bottom: 11px;
}
.wcard-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
  font-weight: 900;
  color: var(--navy);
  flex-shrink: 0;
}
.wstat {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 10px 0;
}
.wsb {
  border-radius: 8px;
  padding: 9px;
  text-align: center;
}
.wsb.gold  { background: rgba(201,168,76,.08); border: 1px solid rgba(201,168,76,.18); }
.wsb.red   { background: rgba(224,85,85,.08);  border: 1px solid rgba(224,85,85,.18); }
.wsb.green { background: rgba(58,170,110,.08); border: 1px solid rgba(58,170,110,.18); }
.wsv { font-size: 13px; font-weight: 900; margin-bottom: 2px; }
.wsl { font-size: 10px; color: var(--gray); }

/* ─── Toast ─── */
.toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy2);
  border: 1px solid rgba(201,168,76,.25);
  border-radius: var(--r2);
  padding: 10px 20px;
  font-size: 13px;
  z-index: 1000;
  display: none;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.toast.show { display: block; }

/* ─── Dashboard section headers ─── */
.dash-section {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--r);
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.dash-proj { background: linear-gradient(135deg, rgba(201,168,76,.08), rgba(15,31,61,.3)); border: 1px solid rgba(201,168,76,.2); }
.dash-comp { background: linear-gradient(135deg, rgba(42,157,143,.08), rgba(15,31,61,.3)); border: 1px solid rgba(42,157,143,.2); }
.dash-icon  { font-size: 22px; }
.dash-title { font-size: 15px; font-weight: 900; color: var(--white); }
.dash-sub   { font-size: 11px; color: var(--gray); margin-top: 1px; width: 100%; }
.dash-proj .dash-title { color: var(--gold); }
.dash-comp .dash-title { color: var(--teal); }

/* ─── Owner hero ─── */
.owner-hero {
  background: linear-gradient(135deg, var(--navy3), rgba(42,157,143,.15));
  border: 1px solid rgba(42,157,143,.2);
  border-radius: var(--r);
  padding: 22px;
  margin-bottom: 16px;
  text-align: center;
}
.owner-proj-name { font-size: 22px; font-weight: 900; color: var(--teal); margin-bottom: 4px; }
.owner-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.owner-stat {
  background: rgba(15,31,61,.5);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}
.owner-stat .val { font-size: 18px; font-weight: 900; margin-bottom: 3px; }
.owner-stat .lbl { font-size: 10px; color: var(--gray); }

/* ─── Receipt print ─── */
@media print {
  body { background: #fff; color: #111; direction: rtl; }
  .sidebar, .topbar, .btn, .modal, .filter-bar, .no-print { display: none !important; }
  .main { margin: 0; padding: 0; }
  .print-receipt { display: block !important; position: static !important; background: #fff !important; padding: 20px !important; }
}
.print-receipt {
  display: none;
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 9999;
  overflow-y: auto;
  direction: rtl;
  color: #111;
}

/* ─── Responsive overrides ─── */
@media (max-width: 768px) {
  .fr { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .wstat { grid-template-columns: 1fr 1fr; }
}
