/* =====================================================================
   Daem — IT help desk · design 2.0 "Triage desk"
   Calm teal desk, signal colours only where time runs out.
   Type: Rubik (Latin + Arabic). Logical properties everywhere (RTL).
   ===================================================================== */

@font-face { font-family: "Rubik"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url("../fonts/rubik-latin-wght-normal.woff2") format("woff2");
  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: "Rubik"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url("../fonts/rubik-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Rubik"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url("../fonts/rubik-arabic-wght-normal.woff2") format("woff2");
  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: "Daem Devanagari"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url("../fonts/noto-sans-devanagari-wght.woff2") format("woff2");
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF; }
@font-face { font-family: "Daem Urdu"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url("../fonts/noto-sans-arabic-wght.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200F, U+FB50-FDFF, U+FE70-FEFC; }

/* ------------------------------------------------------------- tokens */
:root {
  --font: "Rubik", "Daem Devanagari", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;

  --bg: #edf3f2;            /* fog */
  --surface: #ffffff;
  --surface-2: #f5f9f8;
  --surface-3: #e6efed;
  --line: #d6e3e0;
  --line-strong: #bccfcb;
  --ink: #13282b;           /* desk ink */
  --ink-2: #44605f;
  --ink-3: #6f8a89;

  --teal: #0b7f78;
  --teal-strong: #08625c;
  --teal-soft: #dbf0ec;
  --teal-ink: #0b3d3a;

  --amber: #a86a00;  --amber-soft: #fcefd2;  --amber-line: #e9a92a;
  --red: #c0392b;    --red-soft: #fbe4e0;    --red-line: #de5a4b;
  --green: #22764a;  --green-soft: #def2e5;
  --blue: #2a63a8;   --blue-soft: #e1ebf8;
  --violet: #5b4bb5; --violet-soft: #e9e6f8;
  --grey-soft: #e8eeed;

  --sidebar-bg: #ffffff;
  --r-xl: 18px; --r-lg: 14px; --r-md: 10px; --r-sm: 7px;
  --shadow: 0 1px 2px rgba(19, 40, 43, .05), 0 10px 26px -14px rgba(11, 127, 120, .28);
  --shadow-pop: 0 12px 36px -10px rgba(19, 40, 43, .35);
  --focus: 0 0 0 3px rgba(11, 127, 120, .32);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0c1718;
  --surface: #122123;
  --surface-2: #162a2c;
  --surface-3: #1c3436;
  --line: #22393b;
  --line-strong: #2f4d50;
  --ink: #e4efed;
  --ink-2: #a9c1be;
  --ink-3: #7e9a97;
  --teal: #35c0b1;
  --teal-strong: #5ad4c6;
  --teal-soft: #123d3a;
  --teal-ink: #d7f4ef;
  --amber: #f1b44b;  --amber-soft: #3a2c0f;  --amber-line: #d89a2b;
  --red: #f0806f;    --red-soft: #3e1d19;    --red-line: #e0614f;
  --green: #66c98f;  --green-soft: #15331f;
  --blue: #7fb0ec;   --blue-soft: #16294a;
  --violet: #a99cf2; --violet-soft: #272152;
  --grey-soft: #1d2f31;
  --sidebar-bg: #0f1d1f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 30px -16px rgba(0, 0, 0, .6);
  --shadow-pop: 0 16px 40px -10px rgba(0, 0, 0, .7);
  --focus: 0 0 0 3px rgba(53, 192, 177, .38);
  color-scheme: dark;
}

/* ------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--bg);
  font-feature-settings: "tnum" 0; -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-strong); text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; text-wrap: balance; }
p { margin: 0 0 .7em; }
small { font-size: 12.5px; }
code { font-size: .92em; background: var(--surface-3); border-radius: 5px; padding: 1px 5px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
::selection { background: var(--teal-soft); }
[hidden] { display: none !important; }
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--teal); color: #fff; padding: 8px 14px; border-radius: var(--r-md); }
.skip-link:focus { top: 12px; color: #fff; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* Text people typed keeps its own direction (English inside Arabic and the other way round). */
.post-text, .ticket-subject, .row-title, .clock-subject, .article-title, .article-excerpt, .article-body, .kb-suggest-title, .kb-suggest-excerpt, .article-h { unicode-bidi: plaintext; }

/* ------------------------------------------------------------- shell */
.app { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 16px;
  padding: 20px 16px 16px; background: var(--sidebar-bg); border-inline-end: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); padding: 2px 6px; }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand-logo { width: 36px; height: 36px; color: var(--teal); flex: none; }
.brand-text { display: flex; flex-direction: column; font-size: 19px; font-weight: 700; letter-spacing: -.01em; line-height: 1.1; }
.brand-sub { font-size: 12px; font-weight: 400; color: var(--ink-3); letter-spacing: 0; margin-top: 3px; }
.sidebar-new { justify-content: center; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { margin: 14px 10px 6px; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.nav-label:first-child { margin-top: 2px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r-md); color: var(--ink-2); font-weight: 450; }
.nav-item svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav-item.active { background: var(--teal-soft); color: var(--teal-ink); font-weight: 600; }
.nav-item.active::before { content: ""; position: absolute; inset-inline-start: -16px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--teal); }
[dir="rtl"] .nav-item.active::before { border-radius: 4px 0 0 4px; }
.nav-count { margin-inline-start: auto; }
.queue-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: var(--r-md); color: var(--ink-2); }
.queue-item:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.queue-count { min-width: 30px; padding: 1px 8px; border-radius: 999px; background: var(--surface-3); color: var(--ink); font-weight: 600; font-size: 13px; text-align: center; font-variant-numeric: tabular-nums; }
.queue-item.is-alert .queue-count { background: var(--red-soft); color: var(--red); }
.sidebar-foot { margin-top: auto; padding: 10px 10px 0; font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--line); }
.sidebar-overlay { display: none; }
.sidebar-lang { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 12px 28px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); }
.page-title { font-size: 21px; font-weight: 600; letter-spacing: -.015em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-search { position: relative; margin-inline-start: auto; width: min(320px, 32vw); }
.topbar-search svg { position: absolute; inset-inline-start: 12px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.topbar-search input { width: 100%; height: 38px; padding-inline: 38px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; }
.topbar-search input:focus { outline: none; border-color: var(--teal); box-shadow: var(--focus); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.nav-toggle { display: none; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r-md); border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--surface); border-color: var(--line); color: var(--ink); text-decoration: none; }
.bell-badge { position: absolute; top: 3px; inset-inline-end: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg); }
.lang-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.lang-btn { padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.lang-btn:hover { text-decoration: none; color: var(--ink); }
.lang-btn.on { background: var(--teal); color: #fff; }
.user-menu { position: relative; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 8px 4px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
[dir="rtl"] .user-chip { padding: 4px 4px 4px 8px; }
.user-chip:hover { border-color: var(--line-strong); }
.user-meta { display: flex; flex-direction: column; line-height: 1.15; text-align: start; }
.user-name { font-size: 13.5px; font-weight: 600; }
.user-role { font-size: 11.5px; color: var(--ink-3); }
.chev { width: 16px; height: 16px; color: var(--ink-3); }
.avatar { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--teal-soft); color: var(--teal-ink); font-weight: 600; font-size: 13px; }
.dropdown { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 210px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); z-index: 40; }
.dropdown a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-sm); color: var(--ink); }
.dropdown a svg { width: 17px; height: 17px; color: var(--ink-3); }
.dropdown a:hover { background: var(--surface-2); text-decoration: none; }
.dropdown a.danger, .dropdown a.danger svg { color: var(--red); }

.content { padding: 26px 28px 40px; display: flex; flex-direction: column; gap: 20px; max-width: 1480px; width: 100%; }
.footer { margin-top: auto; padding: 16px 28px 22px; font-size: 12.5px; color: var(--ink-3); display: flex; gap: 6px; flex-wrap: wrap; }
.foot-link { color: var(--ink-2); }

/* ------------------------------------------------------------- panels */
.panel { background: var(--surface); border-radius: var(--r-xl); padding: 20px 22px; box-shadow: var(--shadow); min-width: 0; }
.panel-muted { background: var(--surface-2); box-shadow: none; border: 1px solid var(--line); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head .panel-title { margin-bottom: 0; }
.panel-title { font-size: 16.5px; font-weight: 600; margin-bottom: 14px; letter-spacing: -.005em; }
.mini-title { font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin: 16px 0 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.result-count { font-size: 13px; color: var(--ink-3); }
.result-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 6px; }
.queue-chip { display: inline-flex; align-items: center; gap: 8px; padding: 3px 6px 3px 12px; border-radius: 999px; background: var(--teal-soft); color: var(--teal-ink); font-size: 13px; font-weight: 500; }
[dir="rtl"] .queue-chip { padding: 3px 12px 3px 6px; }
.queue-chip.is-alert { background: var(--red-soft); color: var(--red); }
.queue-chip a { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: inherit; font-size: 15px; line-height: 1; }
.queue-chip a:hover { background: rgba(0, 0, 0, .08); text-decoration: none; }
.queue-item.on { background: var(--teal-soft); color: var(--teal-ink); font-weight: 600; }
.empty { padding: 26px 16px; text-align: center; color: var(--ink-3); background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); }
.muted-text, .cell-muted { color: var(--ink-3); }
.cell-muted { font-size: 13px; }
.link { font-weight: 500; font-size: 14px; }
.text-danger { color: var(--red) !important; }

/* ------------------------------------------------------------- desk strip (dashboard numbers) */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow); overflow: hidden; }
.stat-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px 20px 16px; color: var(--ink); border-inline-start: 1px solid var(--line); }
.stat-card:first-child { border-inline-start: 0; }
.stat-card-link:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.stat-value { font-size: 32px; font-weight: 600; letter-spacing: -.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 13px; color: var(--ink-3); }
.stat-warn .stat-value { color: var(--red); }
.stat-warn::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 3px; background: var(--red-line); }

/* ------------------------------------------------------------- dashboard: the answer clock */
.dash-main { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.dash-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.panel-hint { margin: 2px 0 0; font-size: 13.5px; color: var(--ink-3); }
.panel-clock .panel-head { align-items: flex-start; }
.clock-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.clock-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 10px 14px 10px 10px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); }
[dir="rtl"] .clock-row { padding: 10px 10px 10px 14px; }
.clock-time { display: flex; align-items: center; gap: 8px; align-self: stretch; min-width: 150px; white-space: nowrap; padding: 8px 12px; border-radius: var(--r-md); background: var(--teal-soft); color: var(--teal-ink); font-weight: 600; font-size: 14px; line-height: 1.25; font-variant-numeric: tabular-nums; }
.clock-time svg { width: 18px; height: 18px; flex: none; }
.clock-warning .clock-time { background: var(--amber-soft); color: var(--amber); }
.clock-breached { border-color: color-mix(in srgb, var(--red-line) 45%, var(--line)); }
.clock-breached .clock-time { background: var(--red-line); color: #fff; }
.clock-main { display: flex; flex-direction: column; min-width: 0; color: var(--ink); }
.clock-main:hover { text-decoration: none; }
.clock-main:hover .clock-subject { color: var(--teal-strong); }
.clock-ref { font-size: 12.5px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.clock-subject { font-weight: 500; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.clock-meta { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clock-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 13px; text-align: end; }
.empty-good { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 30%, transparent); color: var(--green); }
.panel-ask { background: var(--teal-ink); color: #e6f5f2; box-shadow: none; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.panel-ask .panel-title { color: #fff; font-size: 20px; margin-bottom: 4px; }
.panel-ask p { color: #b8dcd6; max-width: 46ch; }
.panel-ask .btn-primary { background: #35c0b1; border-color: #35c0b1; color: #06201e; margin-top: 6px; }
.panel-ask .btn-primary:hover { background: #5ad4c6; border-color: #5ad4c6; color: #06201e; }
[data-theme="dark"] .panel-ask { background: var(--teal-soft); }
a.hbar { color: inherit; border-radius: var(--r-sm); }
a.hbar:hover { text-decoration: none; background: var(--surface-2); box-shadow: 0 0 0 6px var(--surface-2); }
.activity-time { margin-inline-start: 4px; }
.activity-time::before { content: "· "; }
.act-login, .act-logout { background: var(--ink-3); }
.act-kb { background: var(--violet); }
.act-user, .act-settings, .act-category { background: var(--blue); }
.act-first { background: var(--green); }
.act-report { background: var(--amber-line); }
.meta-clock { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--teal); }
.meta-clock svg { width: 15px; height: 15px; }
.sla-text-warning { color: var(--amber); }
.sla-text-breached { color: var(--red); }
.meta-item .sla-bar { margin-top: 8px; }
.att svg, .file-label svg { width: 16px; height: 16px; flex: none; }

/* ------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r-md); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 14.5px; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn:hover { border-color: var(--teal); color: var(--teal-strong); text-decoration: none; }
.btn-primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-strong); border-color: var(--teal-strong); color: #fff; }
[data-theme="dark"] .btn-primary { color: #06201e; }
[data-theme="dark"] .btn-primary:hover { color: #06201e; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.btn-soft { background: var(--teal-soft); border-color: transparent; color: var(--teal-ink); }
.btn-soft:hover { background: var(--teal); color: #fff; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13.5px; border-radius: var(--r-sm); }
.btn-block { width: 100%; justify-content: center; }
.btn.text-danger:hover { border-color: var(--red); }

/* ------------------------------------------------------------- forms */
.field-label { display: block; margin: 14px 0 6px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.input { width: 100%; min-height: 42px; padding: 9px 13px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; }
.input::placeholder { color: var(--ink-3); }
.input:hover { border-color: var(--ink-3); }
.input:focus { outline: none; border-color: var(--teal); box-shadow: var(--focus); }
textarea.input { min-height: 110px; resize: vertical; line-height: 1.55; }
.input-select { appearance: none; -webkit-appearance: none; padding-inline-end: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f8a89' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 16px; background-position: right 12px center; }
[dir="rtl"] .input-select { background-position: left 12px center; }
.input-sm { min-height: 34px; padding: 5px 11px; font-size: 14px; border-radius: var(--r-sm); }
.inline-form { display: inline-flex; align-items: center; gap: 8px; margin: 0; flex-wrap: wrap; }
.check-label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check-label input { width: 17px; height: 17px; accent-color: var(--teal); }
.file-label { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); color: var(--ink-2); font-size: 14px; cursor: pointer; }
.file-label:hover { border-color: var(--teal); color: var(--teal); }
.file-label input { width: 1px; height: 1px; opacity: 0; position: absolute; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.filters:last-child { margin-bottom: 0; }
.filters .input-select { width: auto; min-width: 150px; min-height: 40px; }
.filter-search { position: relative; flex: 1 1 260px; display: flex; align-items: center; }
.filter-search svg { position: absolute; inset-inline-start: 12px; width: 17px; height: 17px; color: var(--ink-3); }
.filter-search input { width: 100%; height: 40px; padding-inline: 38px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font: inherit; }
.filter-search input:focus { outline: none; border-color: var(--teal); box-shadow: var(--focus); }
.filter-date { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-2); }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
form:not(.inline-form):not(.filters):not(.ctl):not(.kb-search) > .btn:last-child { margin-top: 18px; }
.suggest-wrap { position: relative; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* ------------------------------------------------------------- flash */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-lg); font-size: 14.5px; border: 1px solid transparent; }
.flash::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: currentColor; }
.flash ul { margin: 0; padding-inline-start: 18px; }
.flash-success { background: var(--green-soft); color: var(--green); border-color: color-mix(in srgb, var(--green) 25%, transparent); }
.flash-error { background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 25%, transparent); }
.flash-warning { background: var(--amber-soft); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 25%, transparent); }
.flash-info { background: var(--blue-soft); color: var(--blue); border-color: color-mix(in srgb, var(--blue) 25%, transparent); }
.flash-list { margin: 0; padding-inline-start: 18px; }

/* ------------------------------------------------------------- badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; line-height: 1.6; white-space: nowrap; background: var(--grey-soft); color: var(--ink-2); }
.badge-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-new { background: var(--blue-soft); color: var(--blue); }
.badge-open { background: var(--teal-soft); color: var(--teal-ink); }
.badge-open::before { background: var(--teal); }
.badge-in_progress { background: var(--violet-soft); color: var(--violet); }
.badge-waiting { background: var(--amber-soft); color: var(--amber); }
.badge-resolved { background: var(--green-soft); color: var(--green); }
.badge-closed { background: var(--grey-soft); color: var(--ink-3); }
.badge-priority { border-radius: var(--r-sm); background: transparent; border: 1px solid var(--line-strong); color: var(--ink-2); padding: 1px 9px; }
.badge-p-low { color: var(--ink-3); }
.badge-p-medium { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 40%, transparent); }
.badge-p-high { color: var(--amber); border-color: color-mix(in srgb, var(--amber-line) 60%, transparent); background: var(--amber-soft); }
.badge-p-urgent { color: #fff; border-color: var(--red-line); background: var(--red-line); }
.badge-cat { background: var(--surface-3); color: var(--ink-2); }
.badge-role { background: var(--surface-3); color: var(--ink-2); font-size: 11.5px; }
.badge-role-admin { background: var(--teal-ink); color: #fff; }
[data-theme="dark"] .badge-role-admin { background: var(--teal); color: #06201e; }
.badge-role-agent { background: var(--teal-soft); color: var(--teal-ink); }
.badge-internal { background: var(--amber-soft); color: var(--amber); }
.badge-draft { background: var(--amber-soft); color: var(--amber); }
.badge-active { background: var(--green-soft); color: var(--green); }
.badge-inactive { background: var(--grey-soft); color: var(--ink-3); }
.badge-audit { background: var(--surface-3); color: var(--ink-2); font-size: 12px; }

/* ------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; margin-inline: -4px; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14.5px; }
.table th { text-align: start; font-size: 12.5px; font-weight: 500; color: var(--ink-3); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.cell-subject { min-width: 220px; }
.cell-subject .row-title { display: block; color: var(--ink); font-weight: 500; }
.cell-subject .row-title:hover { color: var(--teal-strong); }
.cell-subject .cell-muted { display: block; font-size: 12.5px; }
.cell-actions { text-align: end; white-space: nowrap; }
.cell-nowrap { white-space: nowrap; }
.cell-ref { white-space: nowrap; width: 1%; }
.ref-link { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 13.5px; letter-spacing: .01em; }
.ref-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--teal-soft); color: var(--teal-ink); font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }

/* SLA: the answer clock under a ticket number */
.sla-bar { display: block; width: 100%; min-width: 92px; height: 4px; margin-top: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.sla-bar span { display: block; height: 100%; border-radius: 4px; background: var(--teal); }
.sla-warning span { background: var(--amber-line); }
.sla-breached span { background: var(--red-line); width: 100% !important; }
.sla-answered span { background: var(--green); opacity: .55; }
.sla-late span { background: var(--red-line); opacity: .55; }
.sla-flag { margin-inline-start: 6px; }
.sla-chip { display: inline-flex; align-items: center; gap: 5px; margin-inline-start: 8px; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.sla-breach { background: var(--red-soft); color: var(--red); }
.sla-ok { background: var(--green-soft); color: var(--green); }
.sla-warn { background: var(--amber-soft); color: var(--amber); }

/* ------------------------------------------------------------- pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 18px; }
.page-btn { padding: 6px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-md); color: var(--ink); font-size: 14px; }
.page-btn:hover { border-color: var(--teal); text-decoration: none; }
.page-info { font-size: 13.5px; color: var(--ink-3); }
.dir-arrow { display: inline-block; }
[dir="rtl"] .dir-arrow { transform: scaleX(-1); }

/* ------------------------------------------------------------- charts */
.bars { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 6px; align-items: end; height: 210px; padding-top: 6px; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; min-width: 0; }
.bar-value { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.bar-track { flex: 1; width: 100%; max-width: 28px; display: flex; align-items: flex-end; border-radius: 7px; background: var(--surface-2); }
.bar-fill { width: 100%; border-radius: 7px; background: var(--teal); min-height: 0; }
.bar-col:last-child .bar-fill { background: var(--teal-strong); box-shadow: 0 0 0 2px var(--teal-soft); }
.bar-label { font-size: 11px; color: var(--ink-3); white-space: nowrap; transform: rotate(-35deg); transform-origin: center; height: 22px; }
[dir="rtl"] .bar-label { transform: rotate(35deg); }
.hbar-list { display: flex; flex-direction: column; gap: 12px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 160px) minmax(0, 1fr) 44px; gap: 12px; align-items: center; }
.hbar-label { font-size: 14px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { display: block; height: 10px; border-radius: 10px; background: var(--surface-3); overflow: hidden; }
.hbar-fill { display: block; height: 100%; border-radius: 10px; background: var(--teal); }
.hbar-urgent { background: var(--red-line); }
.hbar-high { background: var(--amber-line); }
.hbar-medium { background: var(--blue); }
.hbar-low { background: var(--ink-3); }
.hbar-agent { background: var(--teal); }
.hbar-value { font-weight: 600; text-align: end; font-variant-numeric: tabular-nums; }

/* activity + notifications */
.activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.activity li { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.activity li:last-child { border-bottom: 0; }
.activity-dot { flex: none; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--teal); }
.activity-text strong { font-weight: 600; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif { display: flex; gap: 12px; align-items: flex-start; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.notif:last-child { border-bottom: 0; }
.notif-dot { flex: none; width: 9px; height: 9px; margin-top: 7px; border-radius: 50%; background: var(--line-strong); }
.notif-unread .notif-dot { background: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.notif-text { flex: 1; min-width: 0; }
.notif-unread .notif-text { font-weight: 500; }

/* ------------------------------------------------------------- ticket page */
.ticket-head-panel { padding: 22px 24px; }
.ticket-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.ticket-title { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1 1 360px; }
.ticket-subject { font-size: 23px; font-weight: 600; letter-spacing: -.015em; }
.ticket-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.ticket-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ticket-actions .input-select { min-height: 36px; width: auto; min-width: 140px; font-size: 14px; border-radius: var(--r-sm); }
.ticket-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.ctl { display: flex; flex-direction: column; gap: 5px; margin: 0; min-width: 0; }
.ctl-label { font-size: 12.5px; color: var(--ink-3); }
.ctl .input-select { min-height: 40px; font-weight: 500; }
.ctl-status-new .input-select { border-color: color-mix(in srgb, var(--blue) 45%, var(--line-strong)); }
.ctl-status-waiting .input-select { border-color: var(--amber-line); }
.ctl-priority-urgent .input-select { border-color: var(--red-line); color: var(--red); }
.ctl-priority-high .input-select { border-color: var(--amber-line); }
.meta-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-top: 18px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.meta-item { display: flex; flex-direction: column; gap: 3px; padding: 11px 14px; background: var(--surface); }
.meta-label { font-size: 12.5px; color: var(--ink-3); }
.meta-value { font-size: 14.5px; font-weight: 500; }
.thread { display: flex; flex-direction: column; gap: 14px; }
.post { display: flex; gap: 14px; }
.post .avatar { width: 38px; height: 38px; font-size: 14px; }
.post-body { flex: 1; min-width: 0; background: var(--surface); border-radius: var(--r-xl); border-start-start-radius: 6px; padding: 14px 18px; box-shadow: var(--shadow); }
.post-internal .post-body { background: var(--amber-soft); box-shadow: none; border: 1px dashed var(--amber-line); }
.post-staff .post-body { box-shadow: inset 3px 0 0 var(--teal), var(--shadow); }
[dir="rtl"] .post-staff .post-body { box-shadow: inset -3px 0 0 var(--teal), var(--shadow); }
.post-staff .avatar { background: var(--teal); color: #fff; }
[data-theme="dark"] .post-staff .avatar { color: #06201e; }
.post-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 14px; }
.post-time { margin-inline-start: auto; font-size: 12.5px; color: var(--ink-3); }
.post-text { overflow-wrap: anywhere; }
.post-text p:last-child { margin-bottom: 0; }
.post-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.att { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; color: var(--ink); }
.att:hover { border-color: var(--teal); text-decoration: none; }
.reply-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.reply-left { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* ------------------------------------------------------------- knowledge base */
.kb-layout { grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); align-items: start; }
.kb-search { position: relative; display: flex; align-items: center; margin: 0 0 6px; }
.kb-search svg { position: absolute; inset-inline-start: 12px; width: 17px; height: 17px; color: var(--ink-3); }
.kb-search input { width: 100%; height: 42px; padding-inline: 38px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; }
.kb-search input:focus { outline: none; border-color: var(--teal); box-shadow: var(--focus); }
.kb-cats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.kb-cats a { display: block; padding: 7px 10px; border-radius: var(--r-md); color: var(--ink-2); }
.kb-cats a:hover { background: var(--surface); text-decoration: none; color: var(--ink); }
.kb-cats a.on { background: var(--teal-soft); color: var(--teal-ink); font-weight: 600; }
.article-list { list-style: none; margin: 0; padding: 0; }
.article-row { display: flex; flex-direction: column; gap: 6px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.article-row:first-child { padding-top: 0; }
.article-row:last-child { border-bottom: 0; }
.article-title { font-size: 16.5px; font-weight: 600; color: var(--ink); }
.article-title:hover { color: var(--teal-strong); }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.article-excerpt { color: var(--ink-2); font-size: 14.5px; }
.article-panel { padding: 30px 34px; }
.article-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; padding-bottom: 18px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.article-h { font-size: 28px; font-weight: 600; letter-spacing: -.02em; margin-bottom: 10px; }
.article-body { font-size: 16px; line-height: 1.75; max-width: 72ch; }
.article-body ol, .article-body ul { padding-inline-start: 22px; }
.article-feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.kb-mini { list-style: none; margin: 0; padding: 0; }
.kb-mini li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kb-mini li:last-child { border-bottom: 0; }
.kb-suggest { position: absolute; inset-inline: 0; top: calc(100% + 6px); z-index: 30; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); }
.kb-suggest-item { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border-radius: var(--r-md); color: var(--ink); }
.kb-suggest-item:hover { background: var(--teal-soft); text-decoration: none; }
.kb-suggest-title { font-weight: 600; font-size: 14.5px; }
.kb-suggest-excerpt { font-size: 13px; color: var(--ink-3); }
.steps { margin: 0; padding-inline-start: 20px; color: var(--ink-2); }
.steps li { margin-bottom: 6px; }

/* ------------------------------------------------------------- login + error (standalone) */
body.standalone { min-height: 100vh; }
.login-lang { position: fixed; top: 18px; inset-inline-end: 22px; z-index: 5; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.login-story { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 44px 52px; background: #0b3d3a; color: #e6f5f2; overflow: hidden; }
.login-story .brand { color: #fff; }
.login-story .brand-logo { color: #35c0b1; }
.login-story .brand-sub { color: #9cc9c3; }
.login-headline { font-size: clamp(30px, 3.6vw, 46px); font-weight: 500; letter-spacing: -.025em; line-height: 1.08; max-width: 15ch; color: #fff; }
.login-text { max-width: 44ch; margin-top: 16px; color: #b8dcd6; font-size: 16px; }
.login-doc { position: relative; z-index: 1; align-self: flex-start; color: #cfeae5; text-decoration: underline; text-underline-offset: 4px; }
.login-doc:hover { color: #fff; }
.login-steps { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 10px; max-width: 420px; }
.login-steps li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 12px; background: rgba(255, 255, 255, .06); color: #dff2ee; font-size: 14.5px; }
.login-steps b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #35c0b1; color: #06201e; font-weight: 600; }
.login-clock { position: absolute; inset-inline-end: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 22px solid rgba(53, 192, 177, .13); }
.login-clock::after { content: ""; position: absolute; inset: 60px; border-radius: 50%; border: 2px dashed rgba(53, 192, 177, .25); }
.login-wrap { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.login-card { width: min(410px, 100%); }
.login-card h1 { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-bottom: 6px; }
.login-card .muted-text { margin-bottom: 18px; }
.login-card .btn-primary { margin-top: 22px; height: 46px; font-size: 15.5px; }
.login-card .flash { margin-bottom: 12px; }
.login-brand { display: none; }
.login-foot { margin: 16px 0 0; font-size: 13.5px; color: var(--ink-3); }
.error-card { width: min(480px, calc(100% - 32px)); margin: 16vh auto 0; padding: 36px 34px; text-align: center; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow); }
.error-mark { width: 52px; height: 52px; color: var(--teal); }
.error-card h1 { font-size: 64px; font-weight: 600; letter-spacing: -.04em; color: var(--teal); margin: 10px 0 4px; }
.error-title { font-size: 19px; font-weight: 600; }
.error-card p { color: var(--ink-2); }
.error-card .btn { margin-top: 10px; }

/* ------------------------------------------------------------- how-it-works page */
.doc-body { background: var(--bg); }
.doc-topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px max(16px, calc((100vw - 980px) / 2)); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.doc-wrap { max-width: 980px; margin: 0 auto; padding: 30px 16px 60px; display: flex; flex-direction: column; gap: 18px; }
.doc-hero { padding: 34px 34px 30px; border-radius: var(--r-xl); background: #0b3d3a; color: #e6f5f2; }
.doc-kicker { display: inline-block; font-size: 13px; color: #9cc9c3; margin-bottom: 8px; }
.doc-title { font-size: clamp(26px, 3.6vw, 38px); font-weight: 600; letter-spacing: -.02em; color: #fff; }
.doc-subtitle { margin: 8px 0 0; font-size: 17px; color: #cfeae5; }
.doc-intro { margin: 14px 0 0; max-width: 66ch; color: #b8dcd6; }
.doc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; }
.doc-actions .btn-primary { background: #35c0b1; border-color: #35c0b1; color: #06201e; }
.doc-toc { padding: 18px 22px; border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow); }
.doc-toc-title { font-weight: 600; margin-bottom: 8px; }
.doc-toc ol { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: 28px; }
.doc-toc li { margin-bottom: 4px; }
.doc-section { scroll-margin-top: 80px; }
.doc-h2 { display: flex; align-items: center; gap: 10px; font-size: 20px; margin-bottom: 12px; }
.doc-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--teal-soft); font-size: 18px; }
.doc-p { color: var(--ink-2); max-width: 72ch; }
.doc-ul, .doc-ol { margin: 0 0 12px; padding-inline-start: 22px; color: var(--ink-2); }
.doc-ul li, .doc-ol li { margin-bottom: 6px; }
.doc-note { display: flex; gap: 10px; padding: 12px 14px; margin: 10px 0; border-radius: var(--r-lg); background: var(--teal-soft); color: var(--teal-ink); }
.doc-note-icon { flex: none; }
.doc-flow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.doc-step { display: flex; flex-direction: column; padding: 9px 13px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.doc-step strong { font-size: 14px; }
.doc-step small { color: var(--ink-3); }
.doc-arrow { color: var(--ink-3); }
[dir="rtl"] .doc-arrow { transform: scaleX(-1); }
.doc-reopen { margin-top: 6px; font-size: 13.5px; color: var(--ink-3); }
.doc-foot { text-align: center; font-size: 13px; color: var(--ink-3); margin-top: 14px; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .topbar-search { display: none; }
  .user-meta { display: none; }
}
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 60; width: 284px; transform: translateX(-104%); transition: transform .22s ease; box-shadow: var(--shadow-pop); }
  [dir="rtl"] .sidebar { transform: translateX(104%); }
  body.sidebar-open .sidebar { transform: none; }
  .sidebar-overlay.show { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(8, 24, 26, .45); }
  .nav-toggle { display: inline-grid; }
  .topbar { padding: 10px 16px; gap: 8px; }
  .content { padding: 18px 16px 34px; }
  .grid-2, .kb-layout, .dash-main { grid-template-columns: minmax(0, 1fr); }
  .ticket-controls, .meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-shell { grid-template-columns: minmax(0, 1fr); }
  .login-story { padding: 30px 22px 34px; gap: 18px; }
  .login-steps, .login-clock { display: none; }
  .footer { padding: 14px 16px 20px; }
}
@media (max-width: 620px) {
  .page-title { font-size: 18px; }
  .topbar-actions .lang-switch, .topbar-actions .lang-menu { display: none; }
  .sidebar-lang { display: block; }
  .user-chip { padding: 3px; }
  .user-chip .chev { display: none; }
  /* ticket table becomes a list of cards */
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters .filter-search { grid-column: 1 / -1; }
  .filters .input-select { min-width: 0; width: 100%; }
  .filters .btn { justify-content: center; }
  .table-tickets thead { display: none; }
  .table-tickets, .table-tickets tbody { display: block; }
  .table-tickets tr { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "ref ref . upd" "sub sub sub sub" "pri sta . asg"; gap: 6px 8px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .table-tickets tbody tr:last-child { border-bottom: 0; }
  .table-tickets td { display: block; padding: 0; border: 0; min-width: 0; }
  .table-tickets tbody tr:hover td { background: transparent; }
  .table-tickets .cell-ref { grid-area: ref; width: auto; }
  .table-tickets .cell-ref .sla-bar { min-width: 120px; }
  .table-tickets .cell-subject { grid-area: sub; min-width: 0; }
  .table-tickets .cell-priority { grid-area: pri; }
  .table-tickets .cell-status { grid-area: sta; }
  .table-tickets .cell-assignee { grid-area: asg; text-align: end; font-size: 13px; }
  .table-tickets .cell-updated { grid-area: upd; text-align: end; }
  .table-tickets .cell-requester { display: none; }
  .lang-switch .lang-btn { padding: 3px 7px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-card { border-top: 1px solid var(--line); }
  .stat-card:nth-child(odd) { border-inline-start: 0; }
  .stat-value { font-size: 26px; }
  .panel { padding: 16px; border-radius: var(--r-lg); }
  .bars { gap: 3px; height: 180px; }
  .bar-label { display: none; }
  .hbar { grid-template-columns: minmax(70px, 110px) minmax(0, 1fr) 34px; }
  .clock-row { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 10px; }
  .clock-time { align-self: flex-start; }
  .clock-side { flex-direction: row; align-items: center; justify-content: space-between; }
  .doc-toc ol { columns: 1; }
  .article-panel { padding: 20px; }
}

/* ------------------------------------------------------------- print */
@media print {
  .sidebar, .topbar, .footer, .reply-bar, .ticket-actions, .skip-link { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
  .panel { box-shadow: none; border: 1px solid #ccc; }
}

/* ------------------------------------------------------------- task board (2.1) */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.board-panel { margin-block-end: 18px; }
.board-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-block-end: 14px; }
.board-tab { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font-weight: 500; font-size: 14px; }
.board-tab:hover { text-decoration: none; border-color: var(--line-strong); color: var(--ink); }
.board-tab.on { background: var(--teal); border-color: var(--teal); color: #fff; }
[data-theme="dark"] .board-tab.on { color: #06201e; }
.tab-count { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; background: rgba(0, 0, 0, .07); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.board-tab.on .tab-count { background: rgba(255, 255, 255, .25); }
.stage-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); flex: none; }
.tab-progress .stage-dot, .col-progress .stage-dot { background: var(--violet); }
.tab-done .stage-dot, .col-done .stage-dot { background: var(--green); }
.board-tab.on .stage-dot { background: #fff; }
.board-filters { margin: 0; }
.board-hint { margin: 10px 0 0; font-size: 13px; }

.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.board.board-one { grid-template-columns: minmax(0, 1fr); }
.board.board-one .col-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.board-col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 14px; min-width: 0; border-block-start: 4px solid var(--blue); }
.col-progress { border-block-start-color: var(--violet); }
.col-done { border-block-start-color: var(--green); }
.col-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.col-head h2 { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 16px; font-weight: 600; }
.col-count { min-width: 30px; padding: 2px 9px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-align: center; font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.col-note { margin: 4px 0 12px; color: var(--ink-3); font-size: 13px; }
.col-cards { display: flex; flex-direction: column; gap: 10px; min-height: 90px; border-radius: var(--r-lg); transition: background .15s, outline-color .15s; outline: 2px dashed transparent; outline-offset: 4px; }
.col-cards.drop-on { background: var(--teal-soft); outline-color: var(--teal); }
.col-empty { padding: 22px 12px; text-align: center; color: var(--ink-3); font-size: 13.5px; border: 1px dashed var(--line-strong); border-radius: var(--r-lg); }
.col-more { display: block; padding: 8px; text-align: center; font-size: 13.5px; font-weight: 500; }

.task-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 13px 11px; box-shadow: var(--shadow); border-inline-start: 4px solid var(--line-strong); }
.task-card[draggable="true"] { cursor: grab; }
.task-card.dragging { opacity: .45; cursor: grabbing; }
.task-card.just-moved { animation: card-pop .6s ease; }
@keyframes card-pop { 0% { box-shadow: var(--focus); } 100% { box-shadow: var(--shadow); } }
.task-card.prio-medium { border-inline-start-color: var(--blue); }
.task-card.prio-high { border-inline-start-color: var(--amber-line); }
.task-card.prio-urgent { border-inline-start-color: var(--red-line); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.card-top .badge { font-size: 11.5px; padding: 1px 8px; }
.card-title { display: block; margin: 7px 0 8px; color: var(--ink); font-weight: 600; font-size: 14.5px; line-height: 1.35; overflow-wrap: anywhere; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-block-end: 8px; }
.card-tags .badge { font-size: 11.5px; }
.task-card .sla-bar { margin-block-end: 9px; }
.card-foot { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 12.5px; }
.card-who { display: inline-flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-who svg { width: 14px; height: 14px; flex: none; }
.card-time { margin-inline-start: auto; white-space: nowrap; }
.avatar-sm { width: 26px; height: 26px; font-size: 11px; }
.avatar-empty { background: var(--surface-3); color: var(--ink-3); }
.card-move { display: flex; gap: 6px; margin-block-start: 10px; padding-block-start: 10px; border-block-start: 1px dashed var(--line); }
.card-move select { flex: 1; min-width: 0; }
@media (hover: hover) and (pointer: fine) {
  .js .card-move { display: none; }
  .js .task-card:hover .card-move, .js .task-card:focus-within .card-move { display: flex; }
}

.toast { position: fixed; inset-block-end: 22px; inset-inline-start: 50%; transform: translateX(-50%); z-index: 60; padding: 11px 18px; border-radius: var(--r-md); background: var(--ink); color: var(--surface); font-size: 14px; box-shadow: var(--shadow-pop); }
[dir="rtl"] .toast { transform: translateX(50%); }
.toast.is-error { background: var(--red); color: #fff; }

@media (max-width: 980px) {
  .board { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------- e-mail settings (2.1) */
.mail-panel { margin-top: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 20px; }
.form-grid .form-actions { grid-column: 1 / -1; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; }
.mail-test { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); display: flex; }
@media (max-width: 760px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------- avatars (2.1) */
.avatar.has-img { padding: 0; overflow: hidden; background: var(--surface-3); }
.avatar.has-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.avatar-xs { width: 20px; height: 20px; font-size: 9px; }
.card-who .avatar-xs { flex: none; }
.hbar-label { display: inline-flex; align-items: center; gap: 7px; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.avatar-big { width: 84px; height: 84px; font-size: 28px; box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--teal-soft); }
.avatar-head { display: flex; align-items: center; gap: 16px; margin-block-end: 16px; }
.avatar-head .who { font-weight: 600; font-size: 17px; }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; margin: 6px 0 4px; padding: 0; border: 0; }
.avatar-opt { position: relative; display: block; cursor: pointer; border-radius: 50%; }
.avatar-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.avatar-opt img, .avatar-opt .none { display: grid; place-items: center; width: 100%; aspect-ratio: 1; border-radius: 50%; object-fit: cover; background: var(--surface-3); border: 3px solid transparent; transition: transform .12s, border-color .12s; }
.avatar-opt .none { color: var(--ink-3); font-weight: 600; font-size: 13px; }
.avatar-opt:hover img, .avatar-opt:hover .none { transform: scale(1.05); }
.avatar-opt input:checked + img, .avatar-opt input:checked + .none { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.avatar-opt input:focus-visible + img, .avatar-opt input:focus-visible + .none { box-shadow: var(--focus); }
.avatar-opt input:checked ~ .tick { display: grid; }
.avatar-opt .tick { display: none; position: absolute; inset-block-start: -2px; inset-inline-end: -2px; width: 22px; height: 22px; place-items: center; border-radius: 50%; background: var(--teal); color: #fff; font-size: 13px; font-weight: 700; border: 2px solid var(--surface); }
.avatar-panel { margin-block-end: 18px; }

/* ------------------------------------------------------------- languages (2.2): Urdu font first, menu */
html[lang="ur"] { --font: "Daem Urdu", "Rubik", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif; }
html[lang="ur"] body { line-height: 1.75; }
html[lang="hi"] body { line-height: 1.65; }
.lang-menu { position: relative; display: inline-block; }
.lang-menu > summary { list-style: none; }
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-current { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: 13.5px; font-weight: 500; cursor: pointer; user-select: none; white-space: nowrap; }
.lang-current:hover { color: var(--ink); border-color: var(--line-strong); }
.lang-current:focus-visible { outline: none; box-shadow: var(--focus); }
.lang-globe { width: 17px; height: 17px; flex: none; }
.lang-chev { width: 14px; height: 14px; flex: none; transition: transform .18s ease; }
.lang-menu[open] .lang-chev { transform: rotate(180deg); }
.lang-list { position: absolute; inset-block-start: calc(100% + 8px); inset-inline-end: 0; z-index: 80; min-width: 210px; padding: 6px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-pop); display: grid; gap: 2px; animation: lang-pop .16s ease; }
@keyframes lang-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.lang-up .lang-list { inset-block-start: auto; inset-block-end: calc(100% + 8px); inset-inline-end: auto; inset-inline-start: 0; }
.lang-opt { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 12px; border-radius: var(--r-sm); color: var(--ink); font-size: 14.5px; }
.lang-opt:hover { background: var(--surface-2); text-decoration: none; }
.lang-opt.on { background: var(--teal-soft); color: var(--teal-ink); font-weight: 600; }
.lang-opt .lang-code { font-size: 11.5px; font-weight: 600; color: var(--ink-3); letter-spacing: .04em; font-family: "Rubik", system-ui, sans-serif; }
.lang-opt[lang="ur"] .lang-native { font-family: "Daem Urdu", "Rubik", sans-serif; }
.lang-opt[lang="hi"] .lang-native { font-family: "Daem Devanagari", "Rubik", sans-serif; }
.lang-current .lang-cur-label[lang="ur"] { font-family: "Daem Urdu", "Rubik", sans-serif; }
.lang-current .lang-cur-label[lang="hi"] { font-family: "Daem Devanagari", "Rubik", sans-serif; }
.login-lang .lang-current, .sidebar-lang .lang-current { background: var(--surface); }
.sidebar-lang .lang-menu, .sidebar-lang .lang-current { width: 100%; }
.sidebar-lang .lang-current { justify-content: flex-start; }
.sidebar-lang .lang-current .lang-chev { margin-inline-start: auto; }
@media (max-width: 760px) {
  .topbar-actions .lang-menu { display: none; }
}
.landing-opt { margin-top: 14px; }
