/* GuaranteeApp — تم تیرهٔ مشترک (05 §۱: RTL، موبایل‌محور، فونت خوانا) */
:root {
  --bg: #0f172a;
  --card: #1e293b;
  --border: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #2563eb;
  --green-bg: #14532d;
  --green-tx: #bbf7d0;
  --yellow-bg: #713f12;
  --yellow-tx: #fef08a;
  --red-bg: #7f1d1d;
  --red-tx: #fecaca;
}

* { box-sizing: border-box; }

body.dark {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Vazirmatn, "Segoe UI", Tahoma, Arial, sans-serif;
  line-height: 1.7;
}

body.center { display: flex; align-items: center; justify-content: center; min-height: 100vh; }

.container { max-width: 720px; margin: 0 auto; padding: 16px; }
.container.narrow { max-width: 480px; width: 100%; text-align: center; }

.page-head h1 { font-size: 1.4rem; margin: 8px 0 16px; text-align: center; }

/* انتخاب نوع عملیات — دکمه‌های بزرگ (کارمند با دستکش) */
.op-switch { display: flex; gap: 12px; margin: 16px 0; }
.op-btn {
  flex: 1;
  font-size: 1.25rem;
  font-weight: 700;
  padding: 20px 8px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}
.op-btn.active { border-color: #60a5fa; background: #1d4ed8; }

/* دوربین */
.scanner #reader {
  width: 100%;
  min-height: 240px;
  border: 2px dashed var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: #020617;
}
.scanner #reader video { width: 100% !important; border-radius: 12px; }

.big-btn {
  width: 100%;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 16px;
  margin-top: 12px;
  border-radius: 14px;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.big-btn:disabled { opacity: 0.5; cursor: default; }

/* ورود دستی */
.manual { display: flex; gap: 8px; margin-top: 16px; }
.manual form { display: flex; gap: 8px; width: 100%; }
.manual input {
  flex: 1;
  min-width: 0;
  padding: 14px;
  font-size: 1.05rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  direction: ltr;
  text-align: left;
}
.manual .big-btn { margin-top: 0; width: auto; padding: 14px 22px; }

/* نوار پیام تک‌خطی */
.msg {
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  font-size: 1.1rem;
  min-height: 52px;
  background: var(--card);
  color: var(--muted);
  word-break: break-word;
}
.msg.green { background: var(--green-bg); color: var(--green-tx); }
.msg.yellow { background: var(--yellow-bg); color: var(--yellow-tx); }
.msg.red { background: var(--red-bg); color: var(--red-tx); }

.session { margin-top: 12px; color: var(--muted); text-align: center; }

/* صفحهٔ عمومی گارانتی */
.warranty-status { padding: 28px 18px; border-radius: 16px; font-size: 1.35rem; font-weight: 700; }
.warranty-status.ok { background: var(--green-bg); color: var(--green-tx); }
.warranty-status.info { background: #1e3a5f; color: #bfdbfe; }
.warranty-status.neutral, .warranty-status.loading { background: var(--card); color: var(--muted); font-weight: 400; }
.footnote { color: var(--muted); font-size: 0.85rem; margin-top: 20px; }

/* test.php */
.health-table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.health-table th, .health-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: right; font-size: 0.95rem; }
.health-table th { color: var(--muted); font-weight: 400; }
.test-step { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.test-step button {
  flex: 0 0 260px;
  padding: 12px;
  font-size: 0.95rem;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.test-step .res { flex: 1; font-size: 0.95rem; word-break: break-word; }
pre.logview {
  direction: ltr;
  text-align: left;
  background: #020617;
  color: #a5b4fc;
  padding: 12px;
  border-radius: 10px;
  max-height: 340px;
  overflow: auto;
  font-size: 0.78rem;
  white-space: pre-wrap;
}
.section-title { margin-top: 28px; font-size: 1.1rem; color: #60a5fa; }
.danger-btn { background: #b91c1c !important; }
