/* Mazoon Mail admin theme. Logical properties keep RTL and LTR in sync. */
:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --line: #e7eaf0;
  --brand: #0f4c81;
  --brand-600: #0d4170;
  --brand-50: #eef4fb;
  --accent: #2ec4b6;
  --side-1: #0a1a33;
  --side-2: #0e2a52;
  --good: #079455;
  --good-50: #ecfdf3;
  --bad: #d92d20;
  --bad-50: #fef3f2;
  --wait: #dc6803;
  --wait-50: #fffaeb;
  --info: #1570ef;
  --info-50: #eff8ff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --sidebar: 264px;
  --font: "Inter", system-ui, sans-serif;
}

/* Cairo for Arabic, Inter for English. */
:root[lang="ar"] { --font: "Cairo", system-ui, sans-serif; }

button, input { font-family: inherit; }

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.6;
}

a { color: var(--brand); text-decoration: none; }
svg { flex: none; }
.mono, code {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  direction: ltr;
  unicode-bidi: isolate;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--sidebar);
  background: linear-gradient(180deg, var(--side-1) 0%, var(--side-2) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 16px;
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 26px; color: #fff; }
.brand img { width: 42px; height: 42px; border-radius: 12px; box-shadow: 0 6px 16px rgba(46, 196, 182, .18); }
.brand .name { display: block; font-weight: 700; font-size: 17px; line-height: 1.25; }
.brand .sub { display: block; font-size: 12px; color: rgba(255, 255, 255, .55); }

.menu-label { font-size: 11.5px; letter-spacing: .04em; color: rgba(255, 255, 255, .4); padding: 14px 12px 6px; }
.menu { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.menu a, .menu .disabled {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255, 255, 255, .72);
  font-size: 14.5px;
  transition: background .15s, color .15s;
}
.menu svg { width: 19px; height: 19px; }
.menu a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.menu a.active { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 600; }
.menu a.active::before {
  content: "";
  position: absolute;
  inset-inline-start: -16px;
  inset-block: 8px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
}
[dir="rtl"] .menu a.active::before { border-radius: 4px 0 0 4px; }
.menu a.active svg { color: var(--accent); }
.menu .disabled { opacity: .42; cursor: default; }
.menu .count, .menu .soon {
  margin-inline-start: auto;
  font-size: 11px;
  border-radius: 999px;
  padding: 0 8px;
  background: rgba(255, 255, 255, .12);
}
.menu .count { background: var(--accent); color: var(--side-1); font-weight: 700; }

.side-user {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  background: var(--accent);
  color: var(--side-1);
}
.side-user .who { line-height: 1.3; font-size: 13.5px; }
.side-user .who small { color: rgba(255, 255, 255, .5); font-size: 12px; }

/* ---------- Top bar ---------- */
.content { margin-inline-start: var(--sidebar); min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 68px;
  padding: 0 32px;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.crumbs .current { color: var(--ink); font-weight: 600; }
.crumbs svg { width: 14px; height: 14px; opacity: .6; }
[dir="rtl"] .crumbs svg { transform: scaleX(-1); }

.search {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 280px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
}
.search input { border: 0; outline: 0; background: transparent; font: inherit; width: 100%; color: var(--ink); }
.search svg { width: 17px; height: 17px; }

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-2);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; }
.lang-btn { width: auto; padding: 0 12px; gap: 6px; display: flex; font-size: 13.5px; font-weight: 600; }

/* ---------- Page ---------- */
main { max-width: 1240px; margin: 0 auto; padding: 28px 32px 64px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head h1 { font-size: 24px; line-height: 1.3; margin: 0; letter-spacing: -.01em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .actions { display: flex; gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .08);
}
.btn:hover { background: var(--brand-600); }
.btn svg { width: 17px; height: 17px; }
.btn.ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 16px; margin: 0; }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

/* KPI cards */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi { display: flex; gap: 14px; align-items: center; padding: 18px 20px; margin: 0; }
.kpi .ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; }
.kpi .ico svg { width: 22px; height: 22px; }
.kpi .label { color: var(--muted); font-size: 13px; }
.kpi .value { font-size: 24px; font-weight: 700; line-height: 1.2; }
.tone-brand { background: var(--brand-50); color: var(--brand); }
.tone-good { background: var(--good-50); color: var(--good); }
.tone-wait { background: var(--wait-50); color: var(--wait); }
.tone-bad { background: var(--bad-50); color: var(--bad); }
.tone-info { background: var(--info-50); color: var(--info); }

/* Tables: every table is bordered, centered and highlights the hovered row. */
.table-wrap { overflow-x: auto; padding: 16px 22px 22px; }
table { width: 100%; border-collapse: collapse; border: 1px solid var(--line); }
th, td { padding: 12px 16px; text-align: center; border: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12.5px; font-weight: 600; color: var(--ink-2); background: var(--surface-2); white-space: nowrap; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--brand-50); }

.domain-cell { display: inline-flex; align-items: center; gap: 12px; text-align: start; color: var(--ink); font-weight: 600; }
.domain-cell .letter {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--brand-50); color: var(--brand);
  font-family: "IBM Plex Mono", monospace; font-weight: 700; text-transform: uppercase;
}
.domain-cell small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; }
.row-link { color: var(--muted); }
.row-link svg { width: 18px; height: 18px; }
[dir="rtl"] .flip { transform: scaleX(-1); }

/* Status pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.good { background: var(--good-50); color: var(--good); }
.pill.bad { background: var(--bad-50); color: var(--bad); }
.pill.wait { background: var(--wait-50); color: var(--wait); }
.pill.muted { background: #f2f4f7; color: var(--muted); }

/* Progress bar */
.progress { display: flex; align-items: center; gap: 10px; min-width: 150px; max-width: 220px; margin-inline: auto; }
.progress .bar { flex: 1; height: 6px; border-radius: 999px; background: #eef1f5; overflow: hidden; }
.progress .bar span { display: block; height: 100%; border-radius: inherit; background: var(--good); }
.progress .bar span.partial { background: var(--wait); }
.progress small { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

/* Setup stepper */
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); padding: 22px; gap: 8px; }
.step { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.step::after {
  content: ""; position: absolute; top: 17px;
  inset-inline-start: calc(50% + 24px); inset-inline-end: calc(-50% + 24px);
  height: 2px; background: var(--line);
}
.step:last-child::after { display: none; }
.step .dot {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  border: 2px solid var(--line); background: var(--surface); color: var(--muted);
  font-weight: 700; z-index: 1;
}
.step .dot svg { width: 18px; height: 18px; }
.step .title { font-weight: 600; font-size: 13.5px; }
.step .hint { color: var(--muted); font-size: 12.5px; }
.step.done .dot { background: var(--good); border-color: var(--good); color: #fff; }
.step.done::after { background: var(--good); }
.step.current .dot { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }

/* DNS records */
.rec-type { display: inline-block; min-width: 54px; text-align: center; padding: 2px 8px; border-radius: 6px; background: #f2f4f7; font-family: "IBM Plex Mono", monospace; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.rec-purpose { display: block; color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.value-box {
  display: flex; align-items: flex-start; gap: 8px;
  max-width: 340px; margin-inline: auto; text-align: start;
  padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-2);
}
.value-box code { flex: 1; font-size: 12.5px; word-break: break-all; color: var(--ink-2); }
.value-box { max-width: 520px; }
.found-line { display: flex; gap: 6px; margin: 6px auto 0; text-align: start; color: var(--bad); font-size: 12.5px; max-width: 520px; }
.found-line span { flex: none; font-weight: 600; }
.found-line code { color: var(--muted); font-size: 12px; word-break: break-all; }
.copy {
  border: 0; background: transparent; color: var(--muted);
  cursor: pointer; padding: 2px; border-radius: 6px; line-height: 0;
}
.copy:hover { color: var(--brand); background: var(--brand-50); }
.copy svg { width: 16px; height: 16px; }
.copy.copied { color: var(--good); }
.copy.copy-failed { color: var(--bad, #dc2626); }
[data-copy] { position: relative; }
[data-copy][data-feedback]::after {
  content: attr(data-feedback);
  position: absolute; bottom: calc(100% + 6px); inset-inline-end: 0;
  background: #0f172a; color: #fff; font-size: 12px; line-height: 1.6;
  padding: 2px 8px; border-radius: 6px; white-space: nowrap; z-index: 5;
}

.flash {
  display: flex; align-items: center; gap: 10px;
  background: var(--good-50); color: var(--good);
  border: 1px solid #abefc6; border-radius: 12px;
  padding: 12px 16px; margin-bottom: 20px; font-weight: 600;
}
.flash svg { width: 18px; height: 18px; }
.note { color: var(--muted); font-size: 13px; }
.callout { display: flex; gap: 10px; align-items: flex-start; padding: 14px 18px; border-radius: 12px; background: var(--info-50); color: #175cd3; font-size: 13.5px; }
.callout svg { width: 18px; height: 18px; margin-top: 2px; }
.empty { padding: 56px 20px; text-align: center; color: var(--muted); }

/* ---------- Small screens ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search { display: none; }
}
@media (max-width: 860px) {
  .sidebar { position: static; width: auto; flex-direction: row; align-items: center; gap: 6px; padding: 10px 12px; overflow-x: auto; }
  .brand { padding: 0 6px 0 0; }
  .brand .sub, .menu-label, .menu .soon, .side-user { display: none; }
  .menu { flex-direction: row; }
  .menu a, .menu .disabled { white-space: nowrap; }
  .menu a.active::before { display: none; }
  .content { margin-inline-start: 0; }
  .topbar { padding: 0 16px; height: 60px; }
  main { padding: 20px 16px 40px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .stepper { grid-template-columns: repeat(2, 1fr); row-gap: 20px; }
  .step::after { display: none; }
  th, td { padding: 10px 12px; }
  .table-wrap { padding: 12px; }
}

/* ---------- Forms ---------- */
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn.danger { background: var(--bad); }
.btn.danger:hover { background: #b42318; }
.btn.disabled { opacity: .45; pointer-events: none; }
.page-head .actions form { margin: 0; }

.form-card { padding: 0; }
.form-section { padding: 22px; border-bottom: 1px solid var(--line); }
.form-section h2 { font-size: 16px; margin: 0 0 4px; }
.form-section > .note { margin: 0 0 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; margin-top: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.wide { grid-column: 1 / -1; }
.field-label { font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.field-label b { color: var(--bad); }
.field input, .field select, .field textarea, .filters select, .inline-form input, .address-input input, .address-input select {
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: auto; padding: 10px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .filters select:focus, .inline-form input:focus, .address-input input:focus, .address-input select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-50);
}
.field select:disabled { background: var(--surface-2); color: var(--muted); }
.invalid { border-color: var(--bad) !important; }
.form-error { color: var(--bad); font-size: 12.5px; }
.form-error.pad { padding: 10px 22px 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.form-card > .callout { margin: 0 22px 22px; }

.address-input { display: flex; align-items: center; gap: 8px; }
.address-input input { flex: 1; font-family: "IBM Plex Mono", monospace; }
.address-input .at { font-weight: 700; color: var(--muted); }
.address-input select { min-width: 200px; font-family: "IBM Plex Mono", monospace; }

.inline-form { display: flex; gap: 8px; margin: 0; }
.inline-form input { width: 220px; font-family: "IBM Plex Mono", monospace; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px 22px 0; }
.search.inline { margin: 0; width: 300px; }
.filters select { min-width: 180px; }

.pager { display: flex; align-items: center; justify-content: space-between; padding: 0 22px 18px; }
.pager-links { display: flex; gap: 8px; }

.table-wrap.flush { padding: 12px 0 0; }

.secret {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px 18px; margin-bottom: 20px;
  border: 1px solid #fedf89; border-radius: 12px;
  background: var(--wait-50); color: var(--wait);
}
.secret svg { width: 20px; height: 20px; margin-top: 3px; }
.secret strong { display: block; margin-bottom: 8px; }
.secret .value-box { margin: 0; background: var(--surface); }
.secret code { font-size: 15px; font-weight: 600; color: var(--ink); letter-spacing: .04em; }

.danger-zone { border-color: #fecdca; }
.danger-zone .card-head { border-bottom: 0; }

@media (max-width: 860px) {
  .form-grid { grid-template-columns: 1fr; }
  .card-head { flex-direction: column; align-items: stretch; }
  .inline-form input, .search.inline { width: 100%; }
  .address-input { flex-wrap: wrap; }
}

/* ---------- Sign-in pages ---------- */
.side-user .logout { margin-inline-start: auto; }
.side-user .logout button { border: 0; background: transparent; color: rgba(255, 255, 255, .6); cursor: pointer; padding: 6px; border-radius: 8px; line-height: 0; }
.side-user .logout button:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.side-user .logout svg { width: 18px; height: 18px; }

.auth-page { display: grid; grid-template-columns: minmax(320px, 440px) 1fr; min-height: 100vh; }
.auth-side {
  background: linear-gradient(160deg, var(--side-1), var(--side-2));
  color: #fff;
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-brand { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 700; margin-bottom: 48px; }
.auth-brand img { width: 48px; height: 48px; border-radius: 13px; }
.auth-side h2 { font-size: 26px; line-height: 1.4; margin: 0 0 12px; }
.auth-side p { color: rgba(255, 255, 255, .7); margin: 0 0 28px; }
.auth-side ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.auth-side li { display: flex; align-items: center; gap: 12px; color: rgba(255, 255, 255, .85); }
.auth-side li svg { width: 20px; height: 20px; color: var(--accent); }

.auth-main { position: relative; display: grid; place-items: center; padding: 48px 24px; }
.auth-lang { position: absolute; top: 24px; inset-inline-end: 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 26px; margin: 0 0 6px; }
.auth-card .lead { color: var(--muted); margin: 0 0 24px; }
.auth-form { display: grid; gap: 16px; }
.btn.block { width: 100%; justify-content: center; height: 46px; }
.auth-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); margin-bottom: 18px; }
.auth-icon.good { background: var(--good-50); color: var(--good); }
.auth-icon svg { width: 26px; height: 26px; }
.code-field input { font-family: "IBM Plex Mono", monospace; font-size: 22px; letter-spacing: .3em; text-align: center; height: 52px; }
.setup-steps { margin: 0 0 18px; padding-inline-start: 20px; color: var(--ink-2); display: grid; gap: 4px; }
.qr { display: grid; place-items: center; padding: 16px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.qr svg { width: 200px; height: 200px; }
.secret-key { max-width: none; margin-bottom: 20px; }
.secret-key code { font-size: 13px; letter-spacing: .05em; }
.auth-alt { margin-top: 20px; text-align: center; }
.link-btn { border: 0; background: transparent; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; }
.recovery { margin-top: 18px; }
.recovery summary { cursor: pointer; color: var(--brand); font-weight: 600; margin-bottom: 12px; }
.recovery-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.recovery-codes code { padding: 8px; text-align: center; border: 1px dashed var(--line); border-radius: 8px; background: var(--surface-2); font-size: 14px; }

@media (max-width: 860px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}

/* ---------- Customer portal ---------- */
.topbar-gap { margin-inline-start: auto; }
.callout.warn { background: var(--wait-50); color: var(--wait); }
.checklist { list-style: none; margin: 0; padding: 8px 22px 18px; display: grid; gap: 4px; }
.checklist li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist .dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); color: var(--muted); font-weight: 700; font-size: 13px; flex: none; }
.checklist .dot svg { width: 16px; height: 16px; }
.checklist li.done .dot { background: var(--good); border-color: var(--good); color: #fff; }
.checklist li.current .dot { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.checklist .text { flex: 1; }
.checklist .text strong { display: block; }
.checklist .text span { color: var(--muted); font-size: 13px; }
.checklist li.done .text strong { color: var(--muted); text-decoration: line-through; }

.wizard-step { display: flex; gap: 16px; padding: 22px; border-bottom: 1px solid var(--line); }
.wizard-step:last-child { border-bottom: 0; }
.wizard-step > .dot { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); font-weight: 700; color: var(--muted); flex: none; }
.wizard-step > .dot svg { width: 18px; height: 18px; }
.wizard-step.done > .dot { background: var(--good); border-color: var(--good); color: #fff; }
.wizard-step.current > .dot { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.wizard-step.locked { opacity: .55; }
.wizard-step .body { flex: 1; min-width: 0; }
.wizard-step h3 { margin: 4px 0 4px; font-size: 16px; }
.wizard-step .body > p { margin: 0 0 14px; color: var(--muted); }
.wizard-step .table-wrap { padding: 0; }
.record-line { display: grid; grid-template-columns: auto auto 1fr; gap: 12px; align-items: center; margin-bottom: 14px; }
.record-line .value-box { max-width: none; margin: 0; }
.providers { margin-top: 14px; }
.providers summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.providers ul { margin: 10px 0 0; padding-inline-start: 20px; color: var(--ink-2); display: grid; gap: 6px; }

.plan-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.plan-card { position: relative; display: block; border: 1px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; text-align: center; }
.plan-card input { position: absolute; opacity: 0; }
.plan-card strong { display: block; font-size: 15px; }
.plan-card span { color: var(--muted); font-size: 12.5px; }
.plan-card:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.check-field { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); }
.check-field input { margin-top: 4px; }
.auth-card.wide { max-width: 560px; }
.auth-switch { text-align: center; margin-top: 18px; color: var(--muted); }

@media (max-width: 860px) {
  .plan-cards { grid-template-columns: 1fr; }
  .record-line { grid-template-columns: 1fr; }
}

/* ---------- Sending monitor ---------- */
.menu .count.alert { background: var(--bad); color: #fff; }
.limits-row td { background: var(--surface-2); }
.plain-select { height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font: inherit; min-width: 180px; }

/* ---------- Notifications ---------- */
.bell { position: relative; }
.bell-count {
  position: absolute; top: -6px; inset-inline-end: -6px;
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: var(--bad); color: #fff;
  font-size: 11px; font-weight: 700; display: grid; place-items: center;
  border: 2px solid var(--surface);
}
tr.unread td { background: var(--brand-50); font-weight: 600; }

/* ---------- System health ---------- */
.health-banner { display: flex; align-items: center; gap: 12px; padding: 16px 20px; margin-bottom: 24px; border-radius: 12px; font-weight: 700; font-size: 15px; }
.health-banner svg { width: 22px; height: 22px; }
.health-banner.good { background: var(--good-50); color: var(--good); border: 1px solid #abefc6; }
.health-banner.wait { background: var(--wait-50); color: var(--wait); border: 1px solid #fedf89; }
.health-banner.bad { background: var(--bad-50); color: var(--bad); border: 1px solid #fecdca; }
.health-banner.muted { background: #f2f4f7; color: var(--muted); border: 1px solid var(--line); }

/* ---------- Arabic sizing ----------
   Cairo is wider and taller than Inter at the same pixel size, so Arabic pages
   use a step smaller type to keep the same visual weight. */
:root[lang="ar"] body { font-size: 13.5px; }
:root[lang="ar"] .page-head h1 { font-size: 21px; }
:root[lang="ar"] .card-head h2 { font-size: 15px; }
:root[lang="ar"] .kpi .value { font-size: 21px; }
:root[lang="ar"] .kpi .label, :root[lang="ar"] .card-head p, :root[lang="ar"] .note { font-size: 12.5px; }
:root[lang="ar"] .menu a, :root[lang="ar"] .menu .disabled { font-size: 13.5px; }
:root[lang="ar"] .brand .name { font-size: 16px; }
:root[lang="ar"] th { font-size: 12px; }
:root[lang="ar"] td { font-size: 13px; }
:root[lang="ar"] .btn { font-size: 13.5px; }
:root[lang="ar"] .pill { font-size: 12px; }
:root[lang="ar"] .auth-card h1 { font-size: 23px; }
:root[lang="ar"] .auth-side h2 { font-size: 23px; }

/* ---------- Billing ---------- */
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-section h2 .pill { margin-inline-start: 8px; vertical-align: middle; }
.price-input { width: 96px; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; font-family: "IBM Plex Mono", monospace; text-align: center; }

.invoice-doc { padding: 28px; }
.invoice-top { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 20px; border-bottom: 2px solid var(--ink); }
.invoice-from { display: flex; flex-direction: column; gap: 2px; color: var(--ink-2); font-size: 13px; }
.invoice-from strong { font-size: 17px; color: var(--ink); margin-top: 6px; }
.invoice-logo { width: 44px; height: 44px; border-radius: 12px; }
.invoice-title { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: end; }
.invoice-title h2 { margin: 0; font-size: 22px; }
.invoice-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 20px 0; }
.invoice-meta > div { display: flex; flex-direction: column; gap: 2px; }
.invoice-meta .label { color: var(--muted); font-size: 12px; margin-top: 6px; }
.invoice-doc .table-wrap { padding: 0; }
.invoice-doc tfoot td { background: var(--surface-2); font-weight: 600; }
.invoice-doc tfoot tr.grand td { background: var(--brand-50); font-size: 15px; color: var(--ink); }
.invoice-bank { display: flex; flex-direction: column; gap: 4px; margin-top: 20px; padding: 16px 18px; border: 1px dashed var(--line); border-radius: 12px; color: var(--ink-2); font-size: 13px; }

@media (max-width: 860px) {
  .form-grid.four, .invoice-meta { grid-template-columns: 1fr; }
  .invoice-top { flex-direction: column; }
  .invoice-title { align-items: flex-start; text-align: start; }
}

/* Printing an invoice leaves only the document. */
@media print {
  .sidebar, .topbar, .no-print, .flash, .callout { display: none !important; }
  .content { margin: 0 !important; }
  main { padding: 0 !important; max-width: none; }
  body { background: #fff; }
  .invoice-doc { border: 0; box-shadow: none; padding: 0; }
  tbody tr:hover { background: none; }
}
.plan-card .plan-price { display: block; margin-top: 4px; color: var(--brand); font-weight: 600; }

/* ---------- Online payment choice ---------- */
.pay-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; padding: 18px 22px 22px; }
.pay-options form { margin: 0; }
.pay-option {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: start;
  padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  font: inherit; color: var(--ink); cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.pay-option:hover { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.pay-option strong { font-size: 15px; }
.pay-option span { color: var(--muted); font-size: 12.5px; }

/* ---------- Collapsed sidebar (icons only) ---------- */
.sidebar, .content { transition: width .2s ease, margin .2s ease; }
/* Round handle that sits half on the sidebar and half on the page. */
.side-toggle {
  position: fixed;
  top: 18px; /* centred on the 68px top bar */
  inset-inline-start: calc(var(--sidebar) - 16px);
  z-index: 20;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  padding: 0;
  border-radius: 50%;
  /* The white ring cuts a notch into the dark sidebar edge. */
  border: 3px solid var(--surface);
  background: linear-gradient(135deg, #3fd8c9 0%, var(--accent) 45%, #1b9c90 100%);
  color: var(--side-1);
  box-shadow: 0 4px 14px rgba(46, 196, 182, .35), 0 1px 3px rgba(10, 26, 51, .25);
  cursor: pointer;
  transition: inset-inline-start .25s ease, transform .2s ease, box-shadow .2s ease;
}
.side-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 0 0 4px rgba(46, 196, 182, .18), 0 6px 18px rgba(46, 196, 182, .45);
}
.side-toggle:active { transform: scale(.95); }
.side-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.side-toggle svg { width: 15px; height: 15px; stroke-width: 2.6; transition: transform .25s ease; }
/* The arrow points the way the menu will move: toward the sidebar when open, away when folded. */
[dir="ltr"] .side-toggle svg { transform: rotate(180deg); }
[dir="ltr"].side-collapsed .side-toggle svg { transform: none; }
[dir="rtl"].side-collapsed .side-toggle svg { transform: rotate(180deg); }
.side-collapsed { --sidebar: 76px; }
.side-collapsed .sidebar { padding-inline: 10px; }
.side-collapsed .brand { justify-content: center; padding-inline: 0; }
.side-collapsed .brand > span,
.side-collapsed .menu-label,
.side-collapsed .menu .label,
.side-collapsed .menu .soon,
.side-collapsed .side-user .who,
.side-collapsed .side-user .logout { display: none; }
.side-collapsed .menu { margin-top: 10px; }
.side-collapsed .menu a, .side-collapsed .menu .disabled { justify-content: center; padding-inline: 0; }
.side-collapsed .menu a.active::before { inset-inline-start: -10px; }
/* Counters shrink to a dot on the icon. */
.side-collapsed .menu .count {
  position: absolute; top: 4px; inset-inline-end: 10px;
  padding: 0; width: 9px; height: 9px; font-size: 0;
}
.side-collapsed .side-user { justify-content: center; padding: 8px; background: transparent; }
/* The page name appears beside the icon on hover while the menu is folded. */
.side-collapsed .menu a::after {
  content: attr(data-label);
  position: absolute; top: 50%; inset-inline-start: calc(100% + 14px);
  transform: translateY(-50%);
  background: var(--side-1); color: #fff;
  font-size: 13px; font-weight: 600; line-height: 1.5; white-space: nowrap;
  padding: 6px 12px; border-radius: 8px;
  box-shadow: 0 6px 18px rgba(16, 24, 40, .25);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .12s, visibility .12s;
}
.side-collapsed .menu a:hover::after,
.side-collapsed .menu a:focus-visible::after { opacity: 1; visibility: visible; }
@media (max-width: 860px) {
  .side-toggle { display: none; }
}

/* ---------- Page title in the top bar, breadcrumb above the content ---------- */
.topbar-title {
  margin: 0; font-size: 18px; font-weight: 700; line-height: 1.3; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  unicode-bidi: plaintext;
}
.page-crumbs { margin-bottom: 6px; }
/* The top bar now carries the title, so the page heading would repeat it. */
.page-head:not(.keep-title) h1 { display: none; }
.page-head:not(.keep-title) p { margin-top: 0; }

/* ---------- Phones: nothing may push the page wider than the screen ---------- */
code, .mono { overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .kpis { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .page-head { flex-wrap: wrap; align-items: flex-start; }
  .page-head .actions { flex-wrap: wrap; }
  .card-head { flex-wrap: wrap; }
  .inline-form { flex-wrap: wrap; }
  .inline-form input { min-width: 0; flex: 1 1 160px; }
}

/* ---------- DNS records: fixed columns so long values get the room ---------- */
.dns-table { table-layout: fixed; min-width: 720px; }
.dns-table th:nth-child(1) { width: 130px; }
.dns-table th:nth-child(2) { width: 32%; }
.dns-table th:nth-child(4) { width: 110px; }
.dns-table .value-box { max-width: none; }
.dns-table .value-box code { word-break: normal; overflow-wrap: anywhere; }
.dns-table .found-line { max-width: none; }

/* ---------- Connect your mail ---------- */
.connect-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 18px 22px 8px; }
.connect-box { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--surface-2); }
.connect-box-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.connect-box dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 14px; margin: 0; align-items: center; }
.connect-box dt { color: var(--muted); font-size: 13px; }
.connect-box dd { margin: 0; text-align: start; }
.connect-box .value-box { margin: 0; max-width: none; }
.connect-note { display: flex; gap: 8px; align-items: center; margin: 0; padding: 4px 22px 18px; color: var(--muted); font-size: 13px; }
.connect-note svg { width: 16px; height: 16px; }
.connect-guides { padding: 12px 22px 18px; display: flex; flex-direction: column; gap: 10px; }
.connect-guide { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.connect-guide summary { cursor: pointer; padding: 12px 16px; font-weight: 600; }
.connect-guide[open] summary { border-bottom: 1px solid var(--line); }
.connect-guide ol { margin: 0; padding: 12px 40px 14px 20px; line-height: 2; }
[dir="ltr"] .connect-guide ol { padding: 12px 20px 14px 40px; }
@media (max-width: 760px) { .connect-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Admin overview ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; margin-bottom: 16px; }
.dash-grid .card { margin-bottom: 0; }
.attention-list { list-style: none; margin: 0; padding: 8px 22px 14px; }
.attention-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.attention-list li:last-child { border-bottom: 0; }
.attention-list .what { flex: 1; font-weight: 500; }
.attention-list .ico, .all-clear .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.attention-list .ico svg, .all-clear .ico svg { width: 17px; height: 17px; }
.all-clear { display: flex; align-items: center; gap: 12px; padding: 28px 22px; color: var(--ink-2); font-weight: 500; }
.ses-summary { padding: 16px 22px 20px; display: flex; flex-direction: column; gap: 12px; }
.ses-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ses-row > span:first-child { color: var(--muted); font-size: 13.5px; }
.ses-bar { height: 8px; border-radius: 999px; background: #eef1f5; overflow: hidden; }
.ses-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #1b9c90); }
.ses-summary .note { margin: 0; }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Open this mailbox ---------- */
.access-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; padding: 18px 22px 22px; }
.access-tile {
  display: flex; gap: 12px; align-items: flex-start; text-align: start;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2); color: var(--ink);
}
a.access-tile { transition: border-color .15s, box-shadow .15s; }
a.access-tile:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(46, 196, 182, .15); }
.access-tile .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.access-tile .ico svg { width: 18px; height: 18px; }
.access-tile > span:last-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.access-tile small { color: var(--muted); font-size: 12.5px; }
.access-tile a { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; }
.access-tile a svg { width: 14px; height: 14px; }
.access-servers { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.access-servers b { font-weight: 600; }
.access-card .card-head .btn { flex: none; }

/* ---------- KPI cards: one-line label, figure with a small unit ---------- */
.kpi { gap: 12px; padding: 16px 18px; }
.kpi .ico { width: 40px; height: 40px; flex: none; }
.kpi .ico svg { width: 20px; height: 20px; }
.kpi > span:last-child { min-width: 0; flex: 1; }
.kpi .label { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .value { margin-top: 2px; white-space: nowrap; }
.kpi .value .unit { font-size: 13px; font-weight: 600; color: var(--muted); margin-inline-start: 5px; }
/* Inside scrollable tables, addresses stay on one line instead of breaking mid-name. */
table .mono:not(.value-box code) { overflow-wrap: normal; white-space: nowrap; }
