:root {
  --bg:      #0d0d0d;
  --surface: #1a1a1a;
  --border:  #2a2a2a;
  --text:    #e8e8e8;
  --muted:   #777;
  --orange:  #f7931a;
  --green:   #22c55e;
  --red:     #ef4444;
  --blue:    #3b82f6;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2.5rem 1rem;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 480px;
}

.wide {
  width: 100%;
  max-width: 1100px;
}

/* ── Typography ──────────────────────────────────────────────────────────── */

h1 {
  font-size: 1.4rem;
  color: var(--orange);
  margin-bottom: 1.5rem;
}

.label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 1.25rem;
  margin-bottom: 0.25rem;
}

.small  { font-size: 0.8rem; color: var(--muted); }
.mono   { font-family: 'Courier New', monospace; font-size: 0.82rem; word-break: break-all; }
.info   { font-size: 0.9rem; color: var(--muted); margin-top: 0.5rem; }

/* ── Form ────────────────────────────────────────────────────────────────── */

form { display: flex; flex-direction: column; gap: 1rem; }

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: var(--muted);
}

input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 1rem;
  padding: 0.6rem 0.8rem;
  outline: none;
  transition: border-color 0.15s;
}

input:focus { border-color: var(--orange); }
.req { color: var(--orange); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */

button, .btn {
  background: var(--orange);
  border: none;
  border-radius: 8px;
  color: #000;
  cursor: pointer;
  display: block;
  font-size: 1rem;
  font-weight: 700;
  margin-top: 0.5rem;
  padding: 0.75rem;
  text-align: center;
  text-decoration: none;
  transition: opacity 0.15s;
  width: 100%;
}

button:hover, .btn:hover { opacity: 0.85; }

/* ── Alerts ──────────────────────────────────────────────────────────────── */

.alert {
  background: rgba(239,68,68,0.12);
  border: 1px solid var(--red);
  border-radius: 6px;
  color: var(--red);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
}

/* ── Invoice ─────────────────────────────────────────────────────────────── */

.status {
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  padding: 1rem;
  text-align: center;
}

.status.confirmed { background: rgba(34,197,94,0.12);  color: var(--green);  border: 1px solid var(--green);  }
.status.pending   { background: rgba(247,147,26,0.12); color: var(--orange); border: 1px solid var(--orange); }
.status.expired   { background: rgba(239,68,68,0.12);  color: var(--red);    border: 1px solid var(--red);    }

.qr-wrap { display: flex; justify-content: center; margin: 1.5rem 0; }
.qr-wrap img { border-radius: 8px; border: 3px solid var(--orange); }

.amount {
  color: var(--orange);
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
}

.address {
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  padding: 0.75rem;
  transition: border-color 0.15s;
}

.address:hover { border-color: var(--orange); }
.copy-hint { color: var(--muted); font-size: 0.75rem; white-space: nowrap; flex-shrink: 0; }

.timer { font-family: monospace; font-size: 1.25rem; margin-top: 0.25rem; }

.amount-breakdown {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.highlight { color: var(--green); font-weight: 600; }

/* ── Admin ───────────────────────────────────────────────────────────────── */

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }

.filters a {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.875rem;
  padding: 0.4rem 1rem;
  text-decoration: none;
  transition: border-color 0.15s;
}

.filters a:hover, .filters a.active { border-color: var(--orange); color: var(--orange); }

table { border-collapse: collapse; font-size: 0.875rem; width: 100%; }

th {
  border-bottom: 2px solid var(--border);
  color: var(--muted);
  font-weight: 600;
  padding: 0.75rem;
  text-align: left;
}

td { border-bottom: 1px solid var(--border); padding: 0.75rem; }
tr:hover td { background: rgba(255,255,255,0.02); }

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

.badge {
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.6rem;
  text-transform: uppercase;
}

.badge.confirmed { background: rgba(34,197,94,0.12);  color: var(--green);  }
.badge.pending   { background: rgba(247,147,26,0.12); color: var(--orange); }
.badge.expired   { background: rgba(239,68,68,0.12);  color: var(--red);    }

/* ── Language switcher ───────────────────────────────────────────────────── */

.lang-switch {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.lang-switch a {
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.lang-switch a:hover  { border-color: var(--orange); color: var(--text); }
.lang-switch a.active { border-color: var(--orange); color: var(--orange); font-weight: 700; }

/* ── About / Contact section ─────────────────────────────────────────────── */

.about {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.about h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.about-name    { font-weight: 600; font-size: 0.95rem; }
.about-contact { font-size: 0.85rem; color: var(--muted); }
.about-area    { font-size: 0.85rem; color: var(--muted); }

/* ── RTL overrides ───────────────────────────────────────────────────────── */

/* Numbers, addresses, amounts always read left-to-right */
.ltr-value { direction: ltr; unicode-bidi: embed; }

[dir="rtl"] .lang-switch { justify-content: flex-start; }
[dir="rtl"] .address     { flex-direction: row-reverse; }
[dir="rtl"] .breakdown-row { flex-direction: row-reverse; }
[dir="rtl"] .copy-hint   { text-align: left; }
[dir="rtl"] .amount      { direction: ltr; }
[dir="rtl"] .timer       { direction: ltr; }
[dir="rtl"] input        { text-align: right; }
[dir="rtl"] input[type="number"],
[dir="rtl"] input[type="date"],
[dir="rtl"] input[type="tel"],
[dir="rtl"] input[type="email"] { text-align: left; direction: ltr; }

/* Arabic font boost — system Arabic fonts render slightly smaller */
[lang="ar"] body  { font-size: 1.05rem; }
[lang="ar"] label { font-size: 0.95rem; }
