:root {
  --brand: #0f766e;
  --bg: #f6f5f1;
  --surface: #ffffff;
  --text: #1c1b18;
  --muted: #6b6860;
  --line: #e4e1d8;
  --danger: #b42318;
  --ok: #157f3b;
  --warn: #a15c07;
  --radius: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141412;
    --surface: #1e1d1a;
    --text: #f1efe8;
    --muted: #a8a49a;
    --line: #34322d;
    --danger: #f97066;
    --ok: #4ade80;
    --warn: #fbbf24;
  }
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); }
a { color: var(--brand); }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; min-width: 0; }
.brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); flex: none; }
.brand-logo { width: 32px; height: 32px; object-fit: contain; border-radius: 6px; flex: none; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.container { max-width: 880px; margin: 0 auto; padding: 24px 16px 64px; }
h1 { font-size: 1.6rem; margin: 0 0 8px; line-height: 1.25; }
h2 { font-size: 1.25rem; margin: 0 0 8px; }
.h3 { font-size: 1.05rem; margin: 0 0 8px; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 40em; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.strong { font-weight: 600; }
.end { text-align: end; }

/* Urdu and Arabic: proper script fonts and more space between lines */
:lang(ur), :lang(ur) input, :lang(ur) select, :lang(ur) button {
  font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", serif;
}
:lang(ur) body { line-height: 2.2; }
:lang(ur) h1, :lang(ur) h2, :lang(ur) .h3 { line-height: 2; }
:lang(ar), :lang(ar) input, :lang(ar) select, :lang(ar) button {
  font-family: "Noto Naskh Arabic", "Segoe UI", Tahoma, serif;
}
:lang(ar) body { line-height: 1.8; }
/* Emails, links and numbers stay in a Latin font inside Urdu/Arabic pages */
[dir="ltr"], bdi { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

.lang-select { width: auto; min-height: 40px; padding: 4px 8px; }
.topbar .brand { flex: 1 1 auto; }
.topbar-right { flex: none; gap: 8px; }
.topbar .btn { white-space: nowrap; padding: 8px 12px; min-height: 40px; }

.hero { padding: 48px 0 24px; }
.hero h1 { font-size: 2.1rem; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin: 16px 0;
}

.form { display: grid; gap: 14px; margin: 8px 0; }
.field { display: grid; gap: 6px; }
.field-label { font-weight: 600; font-size: 0.95rem; }
.field-hint { font-size: 0.85rem; color: var(--muted); }
input, select {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%;
  min-height: 44px;
}
input[type="color"] { padding: 4px; width: 72px; }
input:focus, select:focus, .btn:focus-visible, .tab:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent); outline-offset: 1px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; border-radius: 10px; padding: 10px 16px; min-height: 44px;
  border: 1px solid var(--brand); background: var(--brand); color: #fff; cursor: pointer; text-decoration: none;
}
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.danger-text { color: var(--danger); border-color: var(--line); }
.linklike { font: inherit; background: none; border: 0; color: var(--brand); cursor: pointer; padding: 8px 0; text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 16px 0 0; }
.tab { padding: 10px 14px; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 600; }
.tab.active { color: var(--text); border-bottom-color: var(--brand); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat-value { font-size: 1.6rem; font-weight: 700; }
.stat-label { color: var(--muted); font-size: 0.875rem; }

.list { display: grid; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; }
.row-between { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.row-gap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.inline-fields { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; border: 1px solid var(--line); text-transform: capitalize; }
.badge.active { color: var(--ok); border-color: currentColor; }
.badge.pending { color: var(--warn); border-color: currentColor; }
.badge.suspended, .badge.disabled { color: var(--danger); border-color: currentColor; }

.linkbox { font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; word-break: break-all; margin: 8px 0 12px; }

.loading { padding: 48px 16px; text-align: center; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(20px);
  max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 10px;
  background: var(--text); color: var(--bg); opacity: 0; pointer-events: none; transition: all 0.2s; z-index: 20;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: #b42318; color: #fff; }
.toast.success { background: #157f3b; color: #fff; }

@media (max-width: 600px) {
  .hide-sm { display: none; }
  .inline-fields { grid-template-columns: 1fr; }
  .list-row { flex-direction: column; align-items: flex-start; }
  .row-gap { justify-content: flex-start; }
  .hero h1 { font-size: 1.7rem; }
}

/* Security Center and App errors */
.version { text-align: center; margin-top: 24px; }
.inline-filters { display: flex; gap: 12px; flex-wrap: wrap; }
.inline-filters .field { min-width: 140px; }
.row-gap.start { justify-content: flex-start; margin-bottom: 4px; }
.grow { flex: 1 1 auto; min-width: 0; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 0.9rem; word-break: break-word; }
.sec-row { border-inline-start: 4px solid transparent; padding-inline-start: 10px; }
.sec-row.sev-high { border-inline-start-color: var(--danger); }
.sec-row.sev-medium { border-inline-start-color: var(--warn); }
.badge.sev-high { color: var(--danger); border-color: currentColor; }
.badge.sev-medium { color: var(--warn); border-color: currentColor; }
.badge.sev-low { color: var(--muted); }
.warn-text { color: var(--warn); font-weight: 600; }

/* Warning / message pop-up from the platform */
.modal-backdrop {
  position: fixed; inset: 0; background: rgb(0 0 0 / 0.55); z-index: 30;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  background: var(--surface); border-radius: var(--radius); padding: 24px; max-width: 480px; width: 100%;
  border-top: 6px solid var(--brand);
}
.modal.warning { border-top-color: var(--warn); }
.modal.block { border-top-color: var(--danger); }
.notice-text { white-space: pre-wrap; font-size: 1.05rem; }
