/* Nabrix support platform — shared styles (portal + admin).
   Brand tokens live in :root so the same template can be re-skinned. */

@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url('../fonts/cairo-arabic-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF,
    U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url('../fonts/cairo-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --navy: #141414;
  --teal: #2A9617;
  --teal-btn: #1F7012;
  --teal-deep: #17520E;
  --mint: #9BDB8C;
  --paper: #F7F7F5;
  --white: #FFFFFF;
  --amber-bg: #FDF0DC;
  --amber-fg: #7A4A06;
  --amber-line: #B7791F;
  --red-bg: #FBE4E1;
  --red-fg: #8C1D12;
  --required: #B42318;
  --ink-72: rgba(20, 20, 20, 0.72);
  --ink-68: rgba(20, 20, 20, 0.68);
  --ink-62: rgba(20, 20, 20, 0.62);
  --line: rgba(20, 20, 20, 0.1);
  --line-strong: rgba(20, 20, 20, 0.22);
  --grad: linear-gradient(135deg, #17520E, #141414);
  --font: 'Cairo', system-ui, sans-serif;
  --font-latin: 'Inter', 'Cairo', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--navy);
  background: var(--paper);
  line-height: 1.6;
}
html[lang='en'] body { font-family: var(--font-latin); }
a { color: var(--teal-btn); }
a:hover { color: var(--teal-deep); }
input, button, select, textarea { font-family: inherit; }
h1, h2, h3, p { margin: 0; }
.latin { font-family: var(--font-latin); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(42, 150, 23, 0.55); outline-offset: 2px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 28px;
  border: 0; border-radius: 999px;
  background: var(--teal-btn); color: var(--paper);
  font-size: 16px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--teal-deep); color: var(--paper); }
.btn[disabled] { opacity: 0.6; cursor: default; }
.btn-lg { min-height: 54px; padding: 0 36px; font-size: 17px; }
.btn-block { display: flex; width: 100%; }
.btn-ghost {
  background: var(--white); color: var(--navy);
  border: 1px solid var(--line-strong); font-weight: 600;
}
.btn-ghost:hover { background: var(--paper); color: var(--navy); }
.btn-dark { background: var(--navy); }
.btn-dark:hover { background: #000; }
.btn-mint { background: var(--mint); color: var(--navy); }
.btn-mint:hover { background: #9BDCD3; color: var(--navy); }
.btn-outline-light {
  background: transparent; color: var(--paper);
  border: 1px solid rgba(247, 247, 245, 0.6);
}
.btn-outline-light:hover { background: rgba(247, 247, 245, 0.1); color: var(--paper); }
.btn-sm { min-height: 46px; padding: 0 18px; font-size: 14px; font-weight: 600; }
.link-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0;
  border: 0; background: none; color: var(--teal-btn);
  font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.link-btn:hover { color: var(--teal-deep); }
.link-danger { color: var(--red-fg); font-size: 15px; font-weight: 700; }
/* a small text link with a full-height tap area that does not push its row taller */
.tap-link {
  display: inline-flex; align-items: center; min-height: 44px; margin-block: -12px;
  font-size: 14px; font-weight: 600; text-decoration: none;
}
.link-danger:hover { color: #5F130C; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field > label, .field-label { font-size: 14px; font-weight: 700; }
.auth .field > label { font-weight: 600; }
.req { color: var(--required); }
.input, .select, .textarea {
  width: 100%; height: 50px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--white); color: var(--navy); font-size: 16px;
}
.select { padding: 0 14px; }
.textarea { height: auto; padding: 14px 16px; line-height: 1.8; resize: vertical; }
.auth .input { height: 52px; }
.input[readonly] { background: var(--paper); border-color: rgba(20, 20, 20, 0.12); color: var(--ink-72); }
.input.ltr { direction: ltr; text-align: right; }
html[dir='ltr'] .input.ltr { text-align: left; }
.input[aria-invalid='true'], .select[aria-invalid='true'], .textarea[aria-invalid='true'] { border: 2px solid var(--required); }
.impact.invalid .impact-opt { border-color: var(--required); }
.hint { font-size: 13px; color: var(--ink-68); }
/* second step: the emailed code box (8 digits) */
.input.otp {
  height: 60px; font-family: var(--font-latin); font-size: 24px; font-weight: 600;
  letter-spacing: 0.26em; text-align: center; padding-inline: 6px 0;
}
.input.otp::placeholder { letter-spacing: 0.2em; color: rgba(20, 20, 20, 0.28); }
.two-resend { display: flex; justify-content: center; }
.two-resend .link-btn[disabled] { color: var(--ink-62); cursor: default; }
/* human check: space is reserved so the form does not jump when it appears */
.captcha { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.captcha-box { min-height: 65px; }
@media (max-width: 380px) {
  /* the check box needs 300px: on narrow phones it borrows part of the side padding */
  .captcha { margin-inline: -12px; }
}
.error-text { font-size: 14px; font-weight: 600; color: var(--red-fg); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }

.notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px; border-radius: 16px;
  background: rgba(155, 219, 140, 0.18); border: 1px solid rgba(42, 150, 23, 0.22);
  font-size: 14px; line-height: 1.8; color: var(--teal-deep);
}
.notice svg { flex: none; margin-top: 3px; }
.alert {
  padding: 14px 16px; border-radius: 14px;
  background: var(--red-bg); color: var(--red-fg);
  font-size: 14px; font-weight: 600; line-height: 1.8;
}
.alert-ok { background: rgba(155, 219, 140, 0.22); color: var(--teal-deep); }

/* ---------- language switch ---------- */
.lang { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(20, 20, 20, 0.06); }
.lang button {
  border: 0; cursor: pointer; padding: 6px 12px; min-height: 34px; border-radius: 999px;
  background: transparent; color: var(--ink-68); font-size: 13px; font-weight: 600;
}
.lang button[aria-pressed='true'] { background: var(--teal-btn); color: var(--paper); }
.auth .lang button { padding: 7px 14px; min-height: 36px; }

/* ---------- auth pages (login, invite) ---------- */
.auth { min-height: 100vh; display: flex; flex-wrap: wrap; }
.auth-form {
  flex: 1 1 420px; min-width: 0; padding: 32px 56px 40px;
  display: flex; flex-direction: column; gap: 32px;
}
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.auth-top img { height: 44px; width: auto; }
.auth-mid { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.auth-box { width: 100%; max-width: 420px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.auth-box h1 { font-size: 32px; font-weight: 700; line-height: 1.4; }
.auth-box .lead { font-size: 16px; line-height: 1.8; color: var(--ink-68); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-8 { display: flex; flex-direction: column; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.auth-foot { font-size: 13px; color: var(--ink-62); text-align: center; }
.auth-side {
  flex: 1 1 420px; min-width: 0; padding: 64px 56px;
  display: flex; flex-direction: column; justify-content: center; gap: 36px;
  background: var(--grad); color: var(--paper);
}
.mark-tile {
  width: 76px; height: 76px; border-radius: 20px; background: var(--paper);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 8px rgba(155, 219, 140, 0.14);
}
.mark-tile img { height: 44px; width: auto; }
.pill-outline {
  align-self: flex-start; padding: 6px 16px; border-radius: 999px;
  border: 1px solid rgba(155, 219, 140, 0.5); color: var(--mint);
  font-size: 13px; font-weight: 600;
}
.auth-side h2 { font-size: 36px; font-weight: 700; line-height: 1.5; }
.feature { display: flex; gap: 14px; align-items: flex-start; }
.feature-icon {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  background: rgba(155, 219, 140, 0.14);
  display: flex; align-items: center; justify-content: center;
}
.feature-title { font-size: 16px; font-weight: 700; }
.feature-text { font-size: 14px; line-height: 1.8; color: rgba(247, 247, 245, 0.75); }
.tagline { font-family: var(--font-latin); font-size: 13px; letter-spacing: 0.32em; color: var(--mint); }
html[dir='rtl'] .tagline { direction: ltr; text-align: right; }
.org-card {
  display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(155, 219, 140, 0.3);
}
.org-card .avatar { width: 48px; height: 48px; border-radius: 14px; background: var(--mint); color: var(--navy); font-size: 18px; }

/* centered card page (reset password) */
.center-page {
  min-height: 100vh; padding: 32px;
  display: flex; flex-direction: column; align-items: center; gap: 40px;
}
.center-page > img { height: 44px; width: auto; }
.center-mid { flex: 1; width: 100%; display: flex; align-items: center; justify-content: center; }
.center-card {
  width: 100%; max-width: 460px; padding: 36px;
  background: var(--white); border: 1px solid var(--line); border-radius: 22px;
  display: flex; flex-direction: column; gap: 22px;
}
.center-card h1 { font-size: 28px; font-weight: 700; line-height: 1.4; }
.icon-tile {
  width: 56px; height: 56px; border-radius: 16px; background: rgba(155, 219, 140, 0.22);
  display: flex; align-items: center; justify-content: center;
}

/* ---------- portal shell ---------- */
.topbar { background: var(--white); border-bottom: 1px solid var(--line); }
.topbar-in {
  max-width: 1120px; margin: 0 auto; padding: 14px 32px;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.topbar-in > a > img { display: block; height: 38px; width: auto; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a {
  padding: 10px 16px; border-radius: 999px;
  color: var(--ink-72); font-size: 15px; font-weight: 600; text-decoration: none;
}
.nav a[aria-current='page'] { background: rgba(42, 150, 23, 0.12); color: var(--teal-deep); font-weight: 700; }
.topbar-end { margin-inline-start: auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.me { display: flex; align-items: center; gap: 10px; color: var(--navy); text-decoration: none; }
.me:hover { color: var(--navy); }
.me-name { font-size: 14px; font-weight: 700; line-height: 1.5; }
.me-org { font-size: 12px; color: var(--ink-62); line-height: 1.5; }
.avatar {
  flex: none; width: 40px; height: 40px; border-radius: 999px;
  background: linear-gradient(135deg, #2A9617, #17520E); color: var(--paper);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
}
.avatar-dark { background: var(--navy); }
.avatar-team { border-radius: 12px; background: var(--paper); border: 1px solid var(--line); }
.avatar-team img { height: 22px; width: auto; }

.page { max-width: 1120px; margin: 0 auto; padding: 36px 32px 56px; display: flex; flex-direction: column; gap: 24px; }
.page-narrow { max-width: 820px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 30px; font-weight: 700; line-height: 1.4; }
.page-sub { font-size: 15px; color: var(--ink-68); }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: 18px;
  padding: 26px 28px; display: flex; flex-direction: column; gap: 18px;
}
.card h2 { font-size: 18px; font-weight: 700; }

/* ---------- tickets list ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  cursor: pointer; padding: 9px 18px; min-height: 44px; border-radius: 999px;
  border: 1px solid rgba(20, 20, 20, 0.18); background: var(--white); color: var(--navy);
  font-size: 14px; font-weight: 600;
}
.chip[aria-pressed='true'] { border-color: var(--navy); background: var(--navy); color: var(--paper); }
.search { flex: 0 1 300px; min-width: 200px; }
.search input {
  width: 100%; height: 44px; padding: 0 16px;
  border: 1px solid rgba(20, 20, 20, 0.18); border-radius: 999px;
  background: var(--white); font-size: 14px; color: var(--navy);
}
.table-card { background: var(--white); border: 1px solid var(--line); border-radius: 18px; overflow-x: auto; }
.table { min-width: 860px; }
.trow {
  display: grid; grid-template-columns: 110px minmax(0, 2.4fr) minmax(0, 1.3fr) minmax(0, 1fr) 150px 120px;
  gap: 16px; align-items: center; padding: 18px 24px;
  border-bottom: 1px solid rgba(20, 20, 20, 0.08); font-size: 15px;
}
.trow:last-child { border-bottom: 0; }
.thead {
  padding: 14px 24px; border-bottom: 1px solid var(--line);
  font-size: 13px; font-weight: 700; color: var(--ink-62);
}
.t-ref { font-family: var(--font-latin); font-size: 14px; font-weight: 600; color: var(--ink-72); white-space: nowrap; }
.t-title { font-weight: 700; color: var(--navy); text-decoration: none; line-height: 1.6; }
.t-title:hover { color: var(--teal-btn); }
.t-muted { color: var(--ink-72); }
.t-date { font-size: 14px; color: var(--ink-68); }
.empty { padding: 56px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.empty h2 { font-size: 20px; font-weight: 700; }
.empty p { font-size: 15px; color: var(--ink-68); }

/* ---------- status badges ---------- */
.badge {
  display: inline-block; padding: 5px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 700; white-space: nowrap;
}
.badge-lg { padding: 7px 18px; font-size: 14px; }
.st-new { background: var(--navy); color: var(--paper); }
.st-in_progress { background: rgba(42, 150, 23, 0.14); color: var(--teal-deep); }
.st-waiting_customer { background: var(--amber-bg); color: var(--amber-fg); }
.st-resolved { background: var(--teal-deep); color: var(--paper); }
.st-closed { background: rgba(20, 20, 20, 0.08); color: rgba(20, 20, 20, 0.78); }

/* ---------- new ticket ---------- */
.impact { margin: 0; padding: 0; border: 0; min-width: 0; }
.impact legend { padding: 0; margin-bottom: 10px; font-size: 14px; font-weight: 700; }
.impact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.impact-opt {
  display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 14px;
  border: 1px solid var(--line-strong); background: var(--white); cursor: pointer;
}
.impact-opt.on { border: 2px solid var(--teal-btn); padding: 15px; background: rgba(155, 219, 140, 0.16); }
.impact-opt input { margin-top: 6px; width: 18px; height: 18px; accent-color: var(--teal-btn); }
.impact-name { display: block; font-size: 15px; font-weight: 700; }
.impact-desc { display: block; font-size: 13px; line-height: 1.7; color: var(--ink-72); }
.dropzone {
  cursor: pointer; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 16px;
  border: 2px dashed rgba(42, 150, 23, 0.5); border-radius: 14px;
  background: rgba(155, 219, 140, 0.1); color: var(--teal-deep);
}
.dropzone.over { background: rgba(155, 219, 140, 0.28); }
.dropzone-title { font-size: 15px; font-weight: 700; }
.files { display: flex; gap: 10px; flex-wrap: wrap; }
.file {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  padding: 8px 14px; border-radius: 10px;
  background: var(--paper); border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--navy); text-decoration: none;
}
button.file { cursor: pointer; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-x { border: 0; background: none; cursor: pointer; padding: 4px; margin: -4px; color: var(--ink-62); display: inline-flex; }
.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- ticket page ---------- */
.back { align-self: flex-start; }
.back svg { transform: scaleX(1); }
html[dir='ltr'] .back svg { transform: scaleX(-1); }
.t-head { padding: 24px 28px; gap: 20px; }
.t-head-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.t-head h1 { font-size: 26px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.t-meta { font-size: 14px; color: var(--ink-68); }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.step { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-62); }
.step::before { content: ''; height: 6px; border-radius: 999px; background: rgba(20, 20, 20, 0.12); }
.step.done { font-weight: 700; color: var(--teal-deep); }
.step.done::before { background: var(--teal-btn); }
.t-cols { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.t-main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.t-side { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.msg { padding: 22px 24px; gap: 12px; }
.msg-team { border-color: rgba(42, 150, 23, 0.35); }
.msg-head { display: flex; align-items: center; gap: 12px; }
.msg-name { font-size: 15px; font-weight: 700; line-height: 1.6; }
.msg-time { font-size: 13px; color: var(--ink-62); line-height: 1.6; }
.msg-body { font-size: 16px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.composer { padding: 20px 24px; gap: 14px; }
.composer > label { font-size: 15px; font-weight: 700; }
.details h2 { font-size: 17px; }
.details { padding: 22px 24px; gap: 14px; }
.kv { display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; }
.kv dt, .kv .k { color: var(--ink-68); }
.kv .v { font-weight: 700; text-align: end; overflow-wrap: anywhere; }
.dark-card {
  background: var(--grad); color: var(--paper); border-radius: 18px;
  padding: 22px 24px; display: flex; flex-direction: column; gap: 10px;
}
.dark-card h2 { font-size: 16px; font-weight: 700; }
.dark-card p { font-size: 14px; line-height: 1.8; color: rgba(247, 247, 245, 0.78); }
.resolve-card { padding: 26px 28px; gap: 16px; }
.resolve-card h2 { font-size: 20px; }
.escalate { border: 2px solid var(--amber-line); padding: 24px 28px; gap: 16px; }
.escalate-head { display: flex; align-items: flex-start; gap: 12px; }
.escalate-head svg { flex: none; margin-top: 3px; }
.escalate p { font-size: 14px; line-height: 1.8; color: var(--ink-72); }
.flag {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  background: var(--amber-bg); color: var(--amber-fg); font-size: 13px; font-weight: 700;
}

/* ---------- account ---------- */
.check { display: flex; gap: 12px; align-items: flex-start; min-height: 44px; cursor: pointer; }
.check input { margin-top: 5px; width: 20px; height: 20px; accent-color: var(--teal-btn); flex: none; }
.check-title { display: block; font-size: 15px; font-weight: 700; }
.check-desc { display: block; font-size: 13px; color: var(--ink-68); }

/* ---------- misc ---------- */
.loading { padding: 64px 24px; text-align: center; color: var(--ink-62); font-size: 15px; }
.toast {
  position: fixed; inset-inline: 0; bottom: 24px; margin: 0 auto; width: max-content; max-width: calc(100% - 32px);
  padding: 12px 20px; border-radius: 999px; background: var(--navy); color: var(--paper);
  font-size: 14px; font-weight: 600; box-shadow: 0 8px 24px rgba(20, 20, 20, 0.25); z-index: 20;
}

@media (max-width: 640px) {
  .auth-form { padding: 24px 20px 32px; }
  .auth-side { padding: 40px 24px; }
  .auth-side h2 { font-size: 28px; }
  .auth-box h1 { font-size: 26px; }
  .topbar-in { padding: 12px 16px; gap: 12px; }
  .page { padding: 24px 16px 40px; }
  .card { padding: 20px; }
  .t-head { padding: 20px; }
  .page-title { font-size: 26px; }
  .center-page { padding: 20px 16px; }
  .center-card { padding: 24px; }
  .me-text { display: none; }
  /* header: logo and account on the first line, navigation on the second */
  .topbar-in { gap: 8px 12px; }
  .topbar-in > a > img { height: 32px; }
  .topbar-in > a:first-child { display: flex; align-items: center; min-height: 44px; }
  .topbar-end { order: 2; gap: 10px; }
  .nav { order: 3; flex: 1 1 100%; }
  .nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; }
  .toolbar .search { flex: 1 1 100%; }
  .trow .t-title { display: block; padding-block: 6px; }
  /* the ticket list becomes stacked cards */
  .table { min-width: 0; }
  .thead { display: none; }
  .trow {
    grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 16px;
    grid-template-areas: 'ref status' 'title title' 'product date';
  }
  .trow .t-ref { grid-area: ref; }
  .trow .c-status { grid-area: status; }
  .trow .t-title { grid-area: title; }
  .trow .c-product { grid-area: product; font-size: 14px; }
  .trow .t-date { grid-area: date; }
  .trow .c-by { display: none; }
}

/* ======================================================================
   Admin panel
   ====================================================================== */
.admin { min-height: 100vh; display: flex; flex-wrap: wrap; }
.side {
  flex: 1 1 240px; min-width: 0; padding: 24px 18px;
  display: flex; flex-direction: column; gap: 28px;
  background: var(--grad); color: var(--paper);
}
.side-brand { display: flex; align-items: center; gap: 12px; }
.side-logo {
  flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--paper);
  display: flex; align-items: center; justify-content: center;
}
.side-logo img { height: 26px; width: auto; }
.side-name { font-family: var(--font-latin); font-size: 16px; font-weight: 600; letter-spacing: 0.18em; line-height: 1.5; }
.side-sub { font-size: 12px; color: var(--mint); line-height: 1.5; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 14px; border-radius: 12px;
  color: rgba(247, 247, 245, 0.78); font-size: 15px; font-weight: 600; text-decoration: none;
}
.side-nav a:hover { color: var(--paper); background: rgba(255, 255, 255, 0.06); }
.side-nav a[aria-current='page'] { background: rgba(155, 219, 140, 0.16); color: var(--paper); font-weight: 700; }
.side-nav a[aria-current='page'] svg { stroke: var(--mint); }
.side-count {
  margin-inline-start: auto; min-width: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--mint); color: var(--navy);
  font-family: var(--font-latin); font-size: 12px; font-weight: 600; text-align: center;
}
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.side-me { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.08); }
.side-me .avatar { width: 38px; height: 38px; background: var(--mint); color: var(--navy); }
.side-me-name { font-size: 14px; font-weight: 700; line-height: 1.5; }
.side-me-role { font-size: 12px; color: rgba(247, 247, 245, 0.75); line-height: 1.5; }
.side-foot .lang { align-self: flex-start; }
.side-foot .lang, .alogin > .lang { background: rgba(255, 255, 255, 0.1); }
.side-foot .lang button, .alogin > .lang button { color: rgba(247, 247, 245, 0.78); }
.side-foot .lang button[aria-pressed='true'], .alogin > .lang button[aria-pressed='true'] { background: var(--mint); color: var(--navy); }
.side-out {
  align-self: flex-start; border: 0; background: none; padding: 0; min-height: 44px; cursor: pointer;
  color: rgba(247, 247, 245, 0.78); font-size: 14px; font-weight: 600;
}
.side-out:hover { color: var(--paper); }
.side-menu { display: none; }

.amain { flex: 999 1 560px; min-width: 0; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 22px; }
.amain-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.amain-title { font-size: 28px; font-weight: 700; }
.amain-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.amain-tools .search { flex: 0 1 320px; width: 320px; min-width: 180px; }
.amain-tools .search input { height: 46px; }
.btn-46 { min-height: 46px; padding: 0 22px; font-size: 15px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.stat {
  background: var(--white); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 20px; display: flex; flex-direction: column; gap: 4px;
}
.stat-label { font-size: 13px; font-weight: 600; color: var(--ink-68); }
.stat-value { font-family: var(--font-latin); font-size: 32px; font-weight: 600; line-height: 1.3; }
.stat.bad { background: #FBE9E6; border-color: rgba(140, 29, 18, 0.25); }
.stat.bad .stat-label { font-weight: 700; color: var(--red-fg); }
.stat.bad .stat-value { color: var(--red-fg); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; }
.filters select {
  height: 44px; padding: 0 14px; border: 1px solid rgba(20, 20, 20, 0.18); border-radius: 999px;
  background: var(--white); font-size: 14px; font-weight: 600; color: var(--navy);
}
.atable { min-width: 900px; }
.arow {
  display: grid; grid-template-columns: 96px minmax(0, 2.4fr) minmax(0, 1.2fr) 96px 132px 110px 130px;
  gap: 14px; align-items: center; padding: 16px 22px;
  border-bottom: 1px solid rgba(20, 20, 20, 0.08); font-size: 14px;
}
.arow:last-child { border-bottom: 0; }
.arow.thead { padding: 14px 22px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--ink-62); }
.arow .t-ref { font-size: 14px; }
.a-title { display: block; font-size: 15px; font-weight: 700; color: var(--navy); text-decoration: none; line-height: 1.6; overflow-wrap: anywhere; }
.a-title:hover { color: var(--teal-btn); }
.a-sub { font-size: 13px; color: var(--ink-68); }
.a-strong { font-weight: 600; }
.a-none { color: var(--ink-68); }
.sla-late { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--red-fg); }

.badge-sm { padding: 4px 12px; }
.pr-urgent { background: var(--red-bg); color: var(--red-fg); }
.pr-high { background: var(--amber-bg); color: var(--amber-fg); }
.pr-normal { background: rgba(20, 20, 20, 0.08); color: var(--navy); }
.pr-low { background: rgba(20, 20, 20, 0.05); color: var(--ink-72); }
.badge-esc { background: var(--red-bg); color: var(--red-fg); }
.badge-line {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-strong); background: var(--white); color: var(--navy);
}

/* admin ticket page */
.a-head { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.a-head-badges { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.a-head h1 { font-size: 24px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.a-cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.a-col-main { flex: 999 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.a-col-side { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.amsg { padding: 20px 22px; gap: 10px; }
.amsg .avatar { width: 38px; height: 38px; }
.amsg .msg-body { font-size: 15px; }
.amsg-staff { border-color: rgba(42, 150, 23, 0.35); }
.amsg-staff .avatar { background: var(--mint); color: var(--navy); }
.amsg-role { font-size: 13px; font-weight: 600; color: var(--ink-62); }
.note { background: #FFF8EA; border: 1px dashed var(--amber-line); }
.note-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.note-tag { font-size: 13px; font-weight: 700; color: var(--amber-fg); }
.sysline {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 18px; border-radius: 14px;
  background: rgba(20, 20, 20, 0.05); font-size: 14px; color: rgba(20, 20, 20, 0.78);
}
.acomposer { padding: 18px 22px 20px; gap: 14px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  cursor: pointer; min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid rgba(20, 20, 20, 0.18); background: var(--white); color: var(--navy);
  font-size: 14px; font-weight: 600;
}
.tab[aria-pressed='true'] { border-color: var(--navy); background: var(--navy); color: var(--paper); font-weight: 700; }
.acomposer .textarea { font-size: 15px; }
.acomposer.is-note .textarea { background: #FFF8EA; border-color: var(--amber-line); }
.btn-48 { min-height: 48px; font-size: 15px; }
.btn-teal-line { background: var(--white); color: var(--teal-deep); border: 1px solid var(--teal-btn); }
.btn-teal-line:hover { background: rgba(155, 219, 140, 0.16); color: var(--teal-deep); }
.side-card { padding: 20px; gap: 12px; }
.side-card h2 { font-size: 15px; }
.side-card .field { gap: 6px; }
.side-card .field > label { font-size: 13px; }
.side-card .select { height: 46px; padding: 0 12px; font-size: 15px; }
.sla-card { background: var(--grad); color: var(--paper); border: 0; }
.sla-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.sla-row .k { color: rgba(247, 247, 245, 0.78); }
.sla-row .v { font-weight: 700; }
.sla-row .v.good { color: var(--mint); }
.sla-row .v.late { color: #FFB4A8; }
.side-card .kv { gap: 10px; }
.log { display: flex; flex-direction: column; gap: 10px; font-size: 13px; line-height: 1.7; }
.log b { font-weight: 700; }
.soon { padding: 56px 24px; text-align: center; color: var(--ink-68); font-size: 15px; }

/* admin sign-in */
.alogin {
  min-height: 100vh; padding: 32px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  color: var(--paper); background: var(--grad);
}
.alogin-brand { display: flex; align-items: center; gap: 14px; }
.alogin-logo {
  width: 56px; height: 56px; border-radius: 16px; background: var(--paper);
  display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 6px rgba(155, 219, 140, 0.14);
}
.alogin-logo img { height: 32px; width: auto; }
.alogin-card {
  width: 100%; max-width: 440px; padding: 36px; border-radius: 22px;
  background: var(--white); color: var(--navy); display: flex; flex-direction: column; gap: 20px;
}
.alogin-card h1 { font-size: 26px; font-weight: 700; line-height: 1.4; }
.alogin-card .field > label { font-weight: 600; }
.alogin-card .input { height: 52px; }
.alogin-foot { font-size: 14px; color: rgba(247, 247, 245, 0.78); text-align: center; }
.alogin-foot a { color: var(--mint); font-family: var(--font-latin); font-weight: 600; }

@media (min-width: 861px) {
  /* the side navigation stays in view while a long page scrolls */
  .side { position: sticky; top: 0; height: 100vh; align-self: flex-start; overflow-y: auto; max-width: 280px; }
}
@media (max-width: 860px) {
  .side { flex-basis: 100%; gap: 16px; padding: 16px; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .side-nav a { min-height: 44px; padding: 0 12px; }
  .side-foot { margin-top: 0; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .amain { padding: 20px 16px 40px; }
  .alogin { padding: 20px 16px; }
  .alogin-card { padding: 24px; }
  /* navigation folds behind a menu button */
  .side { padding: 12px 16px; gap: 12px; }
  .side-logo { width: 40px; height: 40px; }
  .side-menu {
    margin-inline-start: auto; display: inline-flex; align-items: center; gap: 8px;
    min-height: 44px; padding: 0 14px; border-radius: 12px; cursor: pointer;
    border: 1px solid rgba(247, 247, 245, 0.28); background: rgba(255, 255, 255, 0.08);
    color: var(--paper); font-size: 14px; font-weight: 700;
  }
  .side:not(.open) .side-nav, .side:not(.open) .side-foot { display: none; }
  .side-nav { flex-direction: column; flex-wrap: nowrap; }
  .side-nav a { min-height: 48px; }
  .side-foot { padding-top: 12px; border-top: 1px solid rgba(247, 247, 245, 0.14); }
  .side-foot .side-me { flex: 1 1 100%; }
  .side-foot .side-out { margin-inline-start: auto; }
  /* phones zoom the page when a field's text is under 16px, so keep every field at 16px */
  input, select, textarea { font-size: 16px !important; }
}
.alogin-foot a { display: inline-block; padding-block: 12px; }

/* ---------- admin: customers and organizations ---------- */
.amain-lead { display: flex; flex-direction: column; gap: 6px; }
.split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.split-main { flex: 999 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.split-side {
  flex: 1 1 300px; min-width: 0; padding: 24px; gap: 16px;
  border-color: rgba(42, 150, 23, 0.35);
}
.split-side h2 { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.split-side .input, .split-side .select { height: 48px; padding: 0 14px; font-size: 15px; }
.h-icon {
  flex: none; width: 40px; height: 40px; border-radius: 12px; background: rgba(155, 219, 140, 0.22);
  display: flex; align-items: center; justify-content: center;
}
.filters .search { flex: 1 1 220px; min-width: 180px; }
.ctable { min-width: 640px; }
.crow {
  display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1.3fr) 130px 150px;
  gap: 14px; align-items: center; padding: 14px 22px;
  border-bottom: 1px solid rgba(20, 20, 20, 0.08); font-size: 14px;
}
.crow:last-child { border-bottom: 0; }
.crow.thead { border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--ink-62); }
.c-name { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.c-mail { font-family: var(--font-latin); font-size: 13px; color: var(--ink-68); overflow-wrap: anywhere; }
.acc-active { background: rgba(42, 150, 23, 0.14); color: var(--teal-deep); }
.acc-pending { background: var(--amber-bg); color: var(--amber-fg); }
.acc-off { background: rgba(20, 20, 20, 0.08); color: rgba(20, 20, 20, 0.78); }
.mini-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.mini-btn {
  cursor: pointer; min-height: 36px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--white); color: var(--navy);
  font-size: 13px; font-weight: 600;
}
.mini-btn:hover { background: var(--paper); }
.mini-btn[disabled] { opacity: 0.6; cursor: default; }
.mini-link {
  cursor: pointer; border: 0; background: none; padding: 0; min-height: 28px;
  color: var(--teal-btn); font-size: 13px; font-weight: 600;
}
.mini-link.danger { color: var(--red-fg); }
.orgs { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.org { padding: 22px; gap: 16px; }
.org-head { display: flex; align-items: center; gap: 12px; }
.org-tile {
  flex: none; width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(135deg, #9BDB8C, #2A9617); color: var(--navy);
  display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700;
}
.org-name { font-size: 17px; font-weight: 700; line-height: 1.6; overflow-wrap: anywhere; }
.org-since { font-size: 13px; color: var(--ink-68); line-height: 1.6; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { padding: 4px 12px; border-radius: 999px; background: rgba(42, 150, 23, 0.12); color: var(--teal-deep); font-size: 13px; font-weight: 600; }
.org-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 14px; border-top: 1px solid rgba(20, 20, 20, 0.08); }
.org-num { font-family: var(--font-latin); font-size: 22px; font-weight: 600; }
.org-cap { font-size: 12px; color: var(--ink-68); }
.org-links { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.org-links a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 700; text-decoration: none; }

/* ---------- admin on phones: lists become stacked cards ---------- */
@media (max-width: 640px) {
  .amain-title { font-size: 24px; }
  .amain-tools { width: 100%; }
  .amain-tools .search { flex: 1 1 100%; width: auto; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px 16px; }
  .stat-value { font-size: 28px; }
  .filters select { flex: 1 1 calc(50% - 5px); min-width: 0; }
  .filters .search { flex: 1 1 100%; }

  .atable, .ctable { min-width: 0; }
  .arow.thead, .crow.thead { display: none; }
  .arow {
    grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 10px; padding: 16px;
    grid-template-areas: 'ref ref status' 'main main main' 'product product product' 'priority assignee sla';
  }
  .arow .t-ref { grid-area: ref; }
  .arow .c-priority { grid-area: priority; }
  .arow .c-status { grid-area: status; justify-self: end; }
  .arow .c-main { grid-area: main; }
  .arow .a-title { padding-block: 8px; }
  .arow .c-product { grid-area: product; font-size: 13px; }
  .arow .c-product:empty { display: none; }
  .arow .c-assignee { grid-area: assignee; font-size: 13px; }
  .arow .c-sla { grid-area: sla; justify-self: end; font-size: 13px; }

  .crow {
    grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 16px;
    grid-template-areas: 'who acc' 'org org' 'actions actions';
  }
  .crow .c-who { grid-area: who; }
  .crow .c-acc { grid-area: acc; align-self: start; }
  .crow .c-org { grid-area: org; font-size: 13px; }
  .crow .mini-actions { grid-area: actions; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 6px 16px; }
  .mini-btn { min-height: 40px; }
  .mini-link { min-height: 40px; }
  .split-side { padding: 20px; }
  .org { padding: 18px; }
}

/* ---------- admin: incidents ---------- */
.inc-open { background: var(--red-bg); color: var(--red-fg); }
.inc-monitoring { background: var(--amber-bg); color: var(--amber-fg); }
.inc-resolved { background: var(--teal-deep); color: var(--paper); }
.inc-cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.inc-list { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.inc-detail { flex: 999 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.inc-card {
  display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--white); color: var(--navy); text-decoration: none;
}
.inc-card:hover { color: var(--navy); border-color: var(--line-strong); }
.inc-card.on { border: 2px solid var(--teal-btn); padding: 17px; }
.inc-card .badge { align-self: flex-start; }
.inc-card-title { font-size: 15px; font-weight: 700; line-height: 1.6; overflow-wrap: anywhere; }
.inc-card-sub { font-size: 13px; color: var(--ink-68); }
.inc-back { display: none; }
.inc-head { padding: 22px 24px; gap: 16px; }
.inc-head-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.inc-head h2 { font-size: 22px; line-height: 1.5; overflow-wrap: anywhere; }
.inc-status {
  height: 46px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--white); font-size: 14px; font-weight: 700; color: var(--navy);
}
.inc-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; font-size: 14px; }
.inc-facts .k { color: var(--ink-68); }
.inc-facts .v { font-weight: 700; overflow-wrap: anywhere; }
.inc-card-pad { padding: 22px 24px; gap: 12px; }
.inc-card-pad h2 { font-size: 17px; }
.inc-reply { border-color: rgba(42, 150, 23, 0.35); gap: 14px; }
.inc-row {
  display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 12px 0;
  border-top: 1px solid rgba(20, 20, 20, 0.08); font-size: 14px;
}
.inc-row-title { flex: 1 1 220px; min-width: 0; font-weight: 700; color: var(--navy); text-decoration: none; overflow-wrap: anywhere; }
a.inc-row-title:hover { color: var(--teal-btn); }
.inc-picker {
  display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 14px;
  background: var(--paper); border: 1px solid var(--line);
}
.inc-picker .inc-row:first-of-type { border-top: 0; }
.canned-pick .select { height: 44px; font-size: 14px; max-width: 320px; }

/* ---------- admin: settings ---------- */
.set-card { padding: 24px; gap: 16px; }
.set-title { font-size: 19px; font-weight: 700; }
.set-form {
  display: flex; flex-direction: column; gap: 16px; padding: 20px; border-radius: 16px;
  background: var(--paper); border: 1px solid rgba(42, 150, 23, 0.35);
}
.set-form h3 { margin: 0; font-size: 16px; font-weight: 700; }
.set-table { overflow-x: auto; }
.set-frow {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.4fr) 110px 110px 90px 90px;
  gap: 12px; align-items: center; padding: 14px 4px; border-bottom: 1px solid rgba(20, 20, 20, 0.08);
  font-size: 14px; min-width: 680px;
}
.set-frow.thead, .set-srow.thead { padding: 12px 4px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--ink-62); }
.set-frow:last-child, .set-srow:last-child { border-bottom: 0; }
.set-frow .c-ar { font-weight: 700; overflow-wrap: anywhere; }
.set-frow .c-en { color: rgba(20, 20, 20, 0.78); overflow-wrap: anywhere; text-align: start; }
html[dir='rtl'] .set-frow .c-en { text-align: right; }
.set-yes { font-weight: 600; color: var(--teal-deep); }
.set-no { color: var(--ink-62); }
.set-cap { display: none; }
.set-srow {
  display: grid; grid-template-columns: 110px minmax(0, 1.8fr) 170px 170px;
  gap: 12px; align-items: center; padding: 14px 4px; border-bottom: 1px solid rgba(20, 20, 20, 0.08);
  font-size: 14px; min-width: 620px;
}
.set-srow .input { height: 46px; text-align: center; }
.set-close {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px; border-radius: 14px;
  background: rgba(155, 219, 140, 0.16); font-size: 14px; font-weight: 700;
}
.set-close .input { width: 84px; height: 44px; text-align: center; }
.set-options { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.set-options legend { padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 700; }
.set-option { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.set-option .input { height: 46px; }
.set-person {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 4px;
  border-top: 1px solid rgba(20, 20, 20, 0.08);
}
.set-avatar { width: 42px; height: 42px; background: var(--mint); color: var(--navy); font-size: 16px; }
.set-avatar-wait { background: var(--amber-bg); color: var(--amber-fg); }
.set-person-main { flex: 1 1 200px; min-width: 0; line-height: 1.6; }
.set-person-actions { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.set-role { width: auto; height: 42px; padding: 0 12px; font-size: 14px; }
.set-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.set-roles > div { padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); }
.set-role-name { font-size: 15px; font-weight: 700; }
.set-role-text { font-size: 13px; line-height: 1.8; color: var(--ink-72); }
.set-canned {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 4px;
  border-top: 1px solid rgba(20, 20, 20, 0.08); line-height: 1.7;
}
.set-preview { font-size: 13px; color: var(--ink-68); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-danger { border-color: var(--red-fg); color: var(--red-fg); }
.set-points { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.8; color: var(--ink-72); }
.set-split { display: flex; flex-direction: column; gap: 16px; padding-top: 18px; border-top: 1px solid rgba(20, 20, 20, 0.08); }

@media (max-width: 860px) {
  /* with an incident open, a phone shows the incident alone and a link back to the list */
  .inc-cols.has-selection .inc-list { display: none; }
  .inc-cols.has-selection .inc-back { display: inline-flex; align-self: flex-start; }
  .inc-cols:not(.has-selection) .inc-hint { display: none; }
}
@media (max-width: 640px) {
  .inc-head, .inc-card-pad, .set-card { padding: 18px; }
  .inc-head h2 { font-size: 20px; }
  .inc-status { width: 100%; }
  a.inc-row-title { padding-block: 8px; }
  .set-form { padding: 16px; }
  /* settings tables become stacked rows */
  .set-table { overflow-x: visible; }
  .set-frow.thead, .set-srow.thead { display: none; }
  .set-cap { display: inline; font-size: 13px; font-weight: 600; color: var(--ink-68); }
  .set-frow {
    min-width: 0; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px;
    grid-template-areas: 'ar act' 'en act' 'type type' 'vis req';
  }
  .set-frow .c-ar { grid-area: ar; }
  .set-frow .c-en { grid-area: en; font-size: 13px; }
  .set-frow .c-type { grid-area: type; font-size: 13px; color: var(--ink-68); }
  .set-frow .c-vis { grid-area: vis; font-size: 13px; }
  .set-frow .c-req { grid-area: req; font-size: 13px; }
  .set-frow .c-act { grid-area: act; align-self: center; }
  .set-srow { min-width: 0; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; }
  .set-srow > div:first-child, .set-srow .c-when { grid-column: 1 / -1; }
  .set-srow .c-num { display: flex; flex-direction: column; gap: 4px; }
  .set-srow label.set-cap { display: block; }
  .set-srow .input::placeholder { font-size: 12px; }
  .set-option { grid-template-columns: minmax(0, 1fr); padding-bottom: 10px; border-bottom: 1px solid rgba(20, 20, 20, 0.08); }
  .set-person-actions { flex: 1 1 100%; }
  .set-canned { align-items: flex-start; }
}

/* ---------- reports ---------- */
.rep-period {
  height: 46px; padding: 0 16px; border: 1px solid rgba(20, 20, 20, 0.18); border-radius: 999px;
  background: var(--white); font: inherit; font-size: 14px; font-weight: 600; color: var(--navy);
}
.rep-time { font-family: var(--font); font-size: 26px; font-weight: 700; line-height: 1.6; }
.stat.rep-sla { background: var(--grad); border-color: transparent; color: var(--paper); }
.stat.rep-sla .stat-label { color: var(--mint); }
.rep-note { margin-top: -8px; }
.rep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.rep-card { padding: 22px 24px; gap: 14px; }
.rep-card h2 { font-size: 17px; }
.rep-bars { display: grid; grid-template-columns: 110px minmax(0, 1fr) 40px; gap: 12px; align-items: center; font-size: 14px; }
.rep-bars.wide { grid-template-columns: 150px minmax(0, 1fr) 40px; }
.rep-name { overflow-wrap: anywhere; line-height: 1.5; }
.rep-track { height: 14px; border-radius: 999px; background: rgba(20, 20, 20, 0.07); }
.rep-fill { height: 14px; border-radius: 999px; }
.rep-num { font-family: var(--font-latin); font-weight: 600; text-align: end; }
.rep-sla-table { display: grid; grid-template-columns: minmax(0, 1fr) 90px 90px; gap: 10px 12px; align-items: center; font-size: 14px; }
.rep-sla-table .rep-num { text-align: start; }
.rep-sla-table .late { color: var(--red-fg); }
.rep-th { font-size: 13px; font-weight: 700; color: var(--ink-62); }

/* ---------- review inbox ---------- */
.ltr-inline { font-family: var(--font-latin); direction: ltr; unicode-bidi: isolate; }
.mail-cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.mail-list { flex: 999 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.mail-card { padding: 22px 24px; gap: 14px; }
.mail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mail-subject { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.mail-from { font-size: 13px; color: var(--ink-68); overflow-wrap: anywhere; }
.mail-unreg { background: var(--amber-bg); color: var(--amber-fg); }
.mail-body { font-size: 15px; line-height: 1.9; color: rgba(20, 20, 20, 0.82); white-space: pre-line; overflow-wrap: anywhere; }
.mail-ai { padding: 12px 14px; border-radius: 12px; background: rgba(155, 219, 140, 0.16); font-size: 14px; line-height: 1.8; color: var(--teal-deep); }
.mail-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.mail-org { width: auto; min-width: 170px; height: 46px; font-size: 15px; }
.mail-actions .btn-46 { padding: 0 18px; }
.mail-forward { border-color: var(--teal-btn); color: var(--teal-deep); }
.mail-how {
  flex: 1 1 280px; min-width: 0; background: var(--grad); color: var(--paper); border-radius: 18px; padding: 24px;
  display: flex; flex-direction: column; gap: 14px; font-size: 14px; line-height: 1.8;
}
.mail-how h2 { font-size: 17px; font-weight: 700; }
.mail-how .k { font-weight: 700; color: var(--mint); }
.mail-how .v { color: rgba(247, 247, 245, 0.82); }
@media (max-width: 640px) {
  .rep-card, .mail-card { padding: 18px; }
  .rep-grid { grid-template-columns: minmax(0, 1fr); }
  .rep-bars, .rep-bars.wide { grid-template-columns: 96px minmax(0, 1fr) 36px; gap: 10px; }
  .mail-actions > * { flex: 1 1 100%; }
  .mail-org { min-width: 0; width: 100%; }
}

/* ---------- assistant on the ticket page ---------- */
.ai-card {
  background: rgba(155, 219, 140, 0.16); border: 1px solid rgba(42, 150, 23, 0.4); border-radius: 18px;
  padding: 20px 22px; display: flex; flex-direction: column; gap: 14px;
}
.ai-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-head h2 { font-size: 16px; font-weight: 700; color: var(--teal-deep); }
.ai-note { font-size: 13px; color: var(--ink-68); }
.ai-summary { font-size: 15px; line-height: 1.9; white-space: pre-line; overflow-wrap: anywhere; }
.ai-wait { font-size: 14px; color: var(--ink-68); }
.ai-label { font-size: 13px; font-weight: 700; color: var(--teal-deep); }
.ai-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-chip {
  padding: 5px 12px; border-radius: 999px; background: var(--white); border: 1px solid rgba(42, 150, 23, 0.4);
  font-size: 13px; font-weight: 600;
}
.ai-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ai-suggest {
  border: 1px dashed rgba(42, 150, 23, 0.6); border-radius: 14px; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 10px; background: rgba(155, 219, 140, 0.1);
}
.ai-suggest-text { font-size: 15px; line-height: 1.9; white-space: pre-line; overflow-wrap: anywhere; }
.ai-use { border-color: var(--teal-btn); color: var(--teal-deep); font-weight: 700; }
@media (max-width: 640px) {
  .ai-card { padding: 18px; }
  .ai-actions > .btn { flex: 1 1 100%; }
}

/* team notes on a ticket (staff only) */
.notes-card { gap: 10px; }
.notes-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.notes-head h2 { margin: 0; }
.notes-private { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: #8a5a00;
  background: #FFF4DC; border-radius: 999px; padding: 3px 10px; }
.notes-text { min-height: 120px; resize: vertical; line-height: 1.7; }
.notes-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.notes-foot .hint { margin: 0; }

/* self sign-up link on the sign-in page (SynchyHome) */
.signup-line { margin: 0; text-align: center; font-size: 15px; color: var(--ink-68); }

/* field visit (SynchyHome) */
.visit-card { gap: 10px; }
.visit-when { font-size: 16px; font-weight: 700; }
.visit-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.visit-banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px;
  background: rgba(42, 150, 23, 0.12); border: 1px solid rgba(42, 150, 23, 0.35); }
.visit-banner b { font-size: 16px; }
