@font-face {
  font-family: "GE Dinar One";
  src: url("/assets/GE-Dinar-One.otf") format("opentype");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --blue: #006eb6;
  --blue-dark: #28699c;
  --navy: #031246;
  --gold: #d3a35d;
  --ink: #111827;
  --muted: #5b6472;
  --line: #e5e7eb;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --ok: #157347;
  --ok-bg: #e6f4ec;
  --warn: #9a6a00;
  --warn-bg: #fdf3e2;
  --err: #b42318;
  --err-bg: #fdecea;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(3, 18, 70, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "GE Dinar One", "Segoe UI", Tahoma, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}

button, input, select {
  font-family: inherit;
  font-size: 1rem;
}

a { color: var(--blue); }

.brandbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  background: var(--surface);
  border-bottom: 3px solid var(--gold);
}

.brandbar img { height: 46px; width: auto; }

.brandbar .titles { display: flex; flex-direction: column; gap: 2px; }
.brandbar .titles b { font-size: 1rem; color: var(--navy); }
.brandbar .titles span { font-size: 0.8rem; color: var(--muted); }
.brandbar .spacer { flex: 1; }

.brandbar .who { font-size: 0.85rem; color: var(--muted); }

.btn {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 12px 20px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  background: var(--blue);
  color: #fff;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.btn:hover { background: var(--blue-dark); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--blue); border-color: var(--line); }
.btn.ghost:hover { background: #f0f4f8; }
.btn.small { padding: 8px 14px; font-size: 0.85rem; border-radius: 8px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.85rem; color: var(--muted); font-weight: 700; }
.field input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
  outline: none;
}
.field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 110, 182, 0.12); }

/* self check-in */
.self-wrap {
  min-height: calc(100vh - 79px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.self-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 34px;
  text-align: center;
}
.self-card h1 { margin: 0 0 6px; font-size: 1.5rem; color: var(--navy); }
.self-card p.lead { margin: 0 0 26px; color: var(--muted); }
.self-card .phone {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  font-size: 1.6rem;
  letter-spacing: 3px;
  text-align: center;
  direction: ltr;
  outline: none;
}
.self-card .phone:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0, 110, 182, 0.14); }
.self-card .btn { width: 100%; margin-top: 16px; padding: 16px; font-size: 1.05rem; }
.self-card .hint { margin-top: 14px; font-size: 0.8rem; color: var(--muted); }

/* toasts */
.toasts {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 50;
  width: min(460px, 92vw);
}
.toast {
  padding: 14px 18px;
  border-radius: 12px;
  font-weight: 700;
  box-shadow: var(--shadow);
  border: 1px solid transparent;
  animation: toast-in 0.18s ease-out;
}
.toast.ok { background: var(--ok-bg); color: var(--ok); border-color: #bfe3cd; }
.toast.warn { background: var(--warn-bg); color: var(--warn); border-color: #f3dcae; }
.toast.err { background: var(--err-bg); color: var(--err); border-color: #f4c7c2; }
.toast small { display: block; font-weight: 400; opacity: 0.85; margin-top: 2px; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* admin */
.page { max-width: 1080px; margin: 0 auto; padding: 22px; }
.login-wrap { min-height: calc(100vh - 79px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 380px; background: var(--surface);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px;
}
.login-card h1 { margin: 0 0 20px; font-size: 1.25rem; color: var(--navy); }
.login-card .field { margin-bottom: 14px; }
.login-card .btn { width: 100%; margin-top: 6px; }
.form-error { color: var(--err); font-size: 0.85rem; margin: 8px 0 0; min-height: 1.1em; }

.chips { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.chip {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 16px; min-width: 120px;
}
.chip b { display: block; font-size: 1.4rem; color: var(--navy); }
.chip span { font-size: 0.8rem; color: var(--muted); }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button {
  border: none; background: none; padding: 12px 16px; cursor: pointer;
  font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent;
}
.tabs button.active { color: var(--blue); border-color: var(--blue); }

.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .search { flex: 1; min-width: 220px; }
.toolbar .search input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; outline: none;
}
.toolbar .search input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 110, 182, 0.12); }

.add-form {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px; margin-bottom: 16px;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
}
.add-form .full { grid-column: 1 / -1; }
.add-form .row { display: flex; gap: 12px; align-items: center; }
.add-form label.check { display: flex; gap: 8px; align-items: center; font-size: 0.9rem; color: var(--muted); font-weight: 700; }

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: right; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #f0f4f8; color: var(--navy); font-weight: 700; }
tbody tr:last-child td { border-bottom: none; }
td.wrap { white-space: normal; max-width: 320px; color: var(--muted); }
td.ltr { direction: ltr; text-align: right; }

.date-input { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.pw-inline { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; width: 160px; }
.cell-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; }
.badge.here { background: var(--ok-bg); color: var(--ok); }
.badge.no { background: #eef1f4; color: var(--muted); }

.muted { color: var(--muted); }
.empty { padding: 40px; text-align: center; color: var(--muted); }

@media (max-width: 640px) {
  .add-form { grid-template-columns: 1fr; }
  .brandbar .titles span { display: none; }
}
