/* ============================================================
   Sanaco Chat — design system
   RTL-first, friendly/colorful, light primary.
   Themes: friendly | glass | crisp   ·  + dark toggle
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

:root {
  /* accent is injected by JS (tweak). default indigo */
  --accent: #5B5BD6;
  --accent-rgb: 91, 91, 214;
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, #fff);
  --accent-soft-2: color-mix(in srgb, var(--accent) 8%, #fff);

  /* neutrals — warm-cool slate */
  --bg: #f4f4f8;
  --bg-2: #ececf3;
  --surface: #ffffff;
  --surface-2: #f8f8fc;
  --surface-3: #f1f1f7;
  --border: #e7e7ee;
  --border-strong: #d9d9e3;
  --ink: #1b1b2b;
  --ink-2: #50506a;
  --ink-3: #8a8aa3;
  --ink-4: #b3b3c4;

  --shadow-sm: 0 1px 2px rgba(28,28,46,.05), 0 1px 3px rgba(28,28,46,.04);
  --shadow-md: 0 4px 14px rgba(28,28,46,.07), 0 2px 6px rgba(28,28,46,.04);
  --shadow-lg: 0 18px 48px rgba(28,28,46,.14), 0 6px 16px rgba(28,28,46,.07);

  --radius: 16px;
  --radius-sm: 11px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  /* density */
  --space: 20px;
  --row-h: 44px;
  --pad-card: 20px;
  --font-base: 15px;

  /* status / category colors */
  --red: #ef5da8;     /* using friendly pinks/greens for status */
  --rose: #f0517a;
  --amber: #f4a13a;
  --green: #2bb673;
  --teal: #18b6c4;
  --blue: #3d8bfd;
  --violet: #8b5cf6;
  --sky: #38bdf8;

  --sans: 'Vazirmatn', ui-sans-serif, system-ui, sans-serif;

  --sidebar-w: 268px;
  --topbar-h: 64px;

  color-scheme: light;
}

/* ---------- density ---------- */
[data-density="compact"] {
  --space: 14px;
  --row-h: 38px;
  --pad-card: 15px;
  --font-base: 14px;
}

/* ---------- radius variants ---------- */
[data-radius="sharp"] {
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
}

/* ============================================================
   THEME: glass
   ============================================================ */
[data-theme="glass"] {
  --bg: #eef0fb;
  --surface: rgba(255,255,255,.62);
  --surface-2: rgba(255,255,255,.42);
  --surface-3: rgba(255,255,255,.30);
  --border: rgba(255,255,255,.55);
  --border-strong: rgba(120,120,160,.22);
  --shadow-md: 0 8px 30px rgba(70,70,140,.12);
  --shadow-lg: 0 24px 60px rgba(70,70,140,.20);
}
[data-theme="glass"] body {
  background:
    radial-gradient(1100px 600px at 90% -8%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 60%),
    radial-gradient(900px 600px at -5% 110%, rgba(56,189,248,.28), transparent 55%),
    linear-gradient(135deg, #e9ecfb, #f2eefb 60%, #eafbff);
  background-attachment: fixed;
}
[data-theme="glass"] .surface,
[data-theme="glass"] .sidebar,
[data-theme="glass"] .topbar,
[data-theme="glass"] .card {
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
}

/* ============================================================
   THEME: crisp (Linear-like, flatter & sharper)
   ============================================================ */
[data-theme="crisp"] {
  --bg: #fbfbfd;
  --surface: #ffffff;
  --surface-2: #fafafb;
  --surface-3: #f4f4f7;
  --border: #ececf1;
  --border-strong: #e0e0e8;
  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 0 rgba(28,28,46,.03);
  --shadow-md: 0 1px 2px rgba(28,28,46,.06), 0 0 0 1px rgba(28,28,46,.02);
  --shadow-lg: 0 12px 32px rgba(28,28,46,.10);
}

/* ============================================================
   DARK
   ============================================================ */
[data-dark="true"] {
  color-scheme: dark;
  --bg: #14141c;
  --bg-2: #1b1b25;
  --surface: #1d1d27;
  --surface-2: #23232f;
  --surface-3: #2a2a37;
  --border: #2c2c3a;
  --border-strong: #3a3a4c;
  --ink: #f0f0f6;
  --ink-2: #b9b9cc;
  --ink-3: #8585a0;
  --ink-4: #5f5f78;
  --accent-soft: color-mix(in srgb, var(--accent) 22%, #1d1d27);
  --accent-soft-2: color-mix(in srgb, var(--accent) 14%, #1d1d27);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 6px 20px rgba(0,0,0,.45);
  --shadow-lg: 0 22px 56px rgba(0,0,0,.6);
}
[data-dark="true"][data-theme="glass"] {
  --surface: rgba(36,36,52,.55);
  --surface-2: rgba(36,36,52,.4);
  --surface-3: rgba(36,36,52,.3);
  --border: rgba(255,255,255,.08);
}
[data-dark="true"][data-theme="glass"] body {
  background:
    radial-gradient(1100px 600px at 90% -8%, color-mix(in srgb, var(--accent) 38%, transparent), transparent 60%),
    radial-gradient(900px 600px at -5% 110%, rgba(56,189,248,.18), transparent 55%),
    linear-gradient(135deg, #15151f, #1a1726 60%, #101a1f);
  background-attachment: fixed;
}

/* ============================================================
   base
   ============================================================ */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--sans);
  font-size: var(--font-base);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); background-clip: content-box; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }

/* ============================================================
   app shell
   ============================================================ */
#root { height: 100%; }
.app {
  height: 100vh;
  height: 100dvh; /* tracks the real visible viewport on mobile (address bar / keyboard) instead of the fixed layout viewport */
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  overflow: hidden;
}

/* ---------- sidebar ---------- */
.sidebar {
  background: var(--surface);
  border-inline-start: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  z-index: 5;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 18px 18px 14px;
}
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: linear-gradient(145deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #18b6c4));
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 19px;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 40%, transparent);
}
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: -.2px; line-height: 1.1; }
.brand-sub { font-size: 11px; color: var(--ink-3); font-weight: 500; }

.workspace-pick {
  margin: 0 12px 8px; padding: 9px 12px; border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2);
  transition: .15s;
}
.workspace-pick:hover { background: var(--surface-3); }
.ws-logo { width: 26px; height: 26px; border-radius: 8px; flex: none; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; background: var(--green); }
.ws-name { font-size: 13.5px; font-weight: 600; flex: 1; }

.nav { padding: 6px 12px; overflow-y: auto; flex: 1; min-height: 0; }
.nav-label {
  font-size: 11px; font-weight: 700; color: var(--ink-3);
  letter-spacing: .3px; padding: 14px 10px 6px; text-transform: none;
  display: flex; justify-content: space-between; align-items: center;
}
.nav-label button { color: var(--ink-3); display: grid; place-items: center; border-radius: 6px; width: 20px; height: 20px; }
.nav-label button:hover { background: var(--surface-3); color: var(--ink); }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 0 10px; height: var(--row-h); border-radius: var(--radius-sm);
  color: var(--ink-2); font-weight: 500; font-size: 14px;
  cursor: pointer; transition: .13s; position: relative; width: 100%;
}
.nav-item:hover { background: var(--surface-3); color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
[data-dark="true"] .nav-item.active { color: color-mix(in srgb, var(--accent) 70%, #fff); }
.nav-item .ic { flex: none; opacity: .95; }
.nav-item .badge {
  margin-inline-start: auto; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 99px; background: var(--rose); color: #fff;
  font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
.nav-item.active .badge { background: var(--accent); }
.chan-dot { width: 9px; height: 9px; border-radius: 99px; flex: none; }
.presence { width: 9px; height: 9px; border-radius: 99px; flex: none; }

.sidebar-foot {
  border-top: 1px solid var(--border); padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
}

/* ---------- avatars ---------- */
.av { border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-weight: 600; overflow: hidden; position: relative; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av-wrap { position: relative; flex: none; }
.av-status {
  position: absolute; inset-block-end: -1px; inset-inline-end: -1px;
  width: 12px; height: 12px; border-radius: 99px; border: 2.5px solid var(--surface);
}
.st-online { background: var(--green); }
.st-away { background: var(--amber); }
.st-dnd { background: var(--rose); }
.st-offline { background: var(--ink-4); }

/* ---------- main column ---------- */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar {
  height: var(--topbar-h); flex: none;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 22px;
  z-index: 4;
}
.topbar .ttl { font-size: 18px; font-weight: 700; letter-spacing: -.3px; display: flex; align-items: center; gap: 10px; }
.topbar .sub { color: var(--ink-3); font-weight: 500; font-size: 13px; }
.search {
  margin-inline-start: auto; display: flex; align-items: center; gap: 9px;
  background: var(--surface-3); border: 1px solid transparent;
  border-radius: var(--radius-pill); padding: 0 14px; height: 38px; width: 300px;
  color: var(--ink-3); transition: .15s;
}
.search:focus-within { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input { border: none; background: none; outline: none; flex: 1; font-size: 13.5px; color: var(--ink); }
.icon-btn {
  width: 38px; height: 38px; border-radius: var(--radius-sm); display: grid; place-items: center;
  color: var(--ink-2); position: relative; transition: .13s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn .dot { position: absolute; top: 8px; inset-inline-end: 8px; width: 8px; height: 8px; border-radius: 99px; background: var(--rose); border: 2px solid var(--surface); }

.content { flex: 1; min-height: 0; overflow: hidden; position: relative; }
.scroll { height: 100%; overflow-y: auto; }

/* ============================================================
   primitives
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  height: 38px; padding: 0 16px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 14px; transition: .14s; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 32%, transparent); }
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-ghost { background: var(--surface-3); color: var(--ink-2); }
.btn-ghost:hover { background: var(--border); color: var(--ink); }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-soft:hover { filter: brightness(.97); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-icon { width: 38px; padding: 0; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: var(--radius-pill);
  font-size: 12.5px; font-weight: 600; background: var(--surface-3); color: var(--ink-2);
  border: 1px solid transparent; cursor: pointer; transition: .13s;
}
.chip:hover { background: var(--border); }
.chip.on { background: var(--accent); color: #fff; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--radius-pill);
  font-size: 11.5px; font-weight: 700;
}
.tag-dot { width: 7px; height: 7px; border-radius: 99px; }

.divider { height: 1px; background: var(--border); border: none; margin: 0; }

/* status pills */
.s-new    { background: color-mix(in srgb,var(--blue) 16%,transparent);   color: color-mix(in srgb,var(--blue) 75%,var(--ink)); }
.s-prog   { background: color-mix(in srgb,var(--violet) 16%,transparent); color: color-mix(in srgb,var(--violet) 75%,var(--ink)); }
.s-review { background: color-mix(in srgb,var(--amber) 18%,transparent);  color: color-mix(in srgb,var(--amber) 80%,var(--ink)); }
.s-done   { background: color-mix(in srgb,var(--green) 16%,transparent);  color: color-mix(in srgb,var(--green) 72%,var(--ink)); }
.s-rej    { background: color-mix(in srgb,var(--rose) 16%,transparent);   color: color-mix(in srgb,var(--rose) 75%,var(--ink)); }

.p-high { color: var(--rose); }
.p-mid  { color: var(--amber); }
.p-low  { color: var(--green); }

/* fade-in helper */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fade { animation: fadeUp .32s cubic-bezier(.2,.7,.3,1) both; }

/* ============================================================
   DASHBOARD
   ============================================================ */
.dash { padding: var(--space); max-width: 1320px; margin: 0 auto; }
.dash-hero {
  border-radius: var(--radius-lg); padding: 26px 28px; margin-bottom: var(--space);
  color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 50%, #18b6c4));
  box-shadow: 0 16px 40px color-mix(in srgb, var(--accent) 30%, transparent);
}
.dash-hero::after {
  content: ""; position: absolute; inset-block: -40%; inset-inline-end: -6%; width: 320px;
  background: radial-gradient(circle, rgba(255,255,255,.22), transparent 62%);
}
.dash-hero h1 { margin: 0 0 5px; font-size: 25px; font-weight: 800; letter-spacing: -.4px; }
.dash-hero p { margin: 0; opacity: .9; font-size: 14.5px; max-width: 60ch; }
.hero-stats { display: flex; gap: 26px; margin-top: 18px; flex-wrap: wrap; }
.hero-stat .n { font-size: 26px; font-weight: 800; line-height: 1; }
.hero-stat .l { font-size: 12.5px; opacity: .85; margin-top: 4px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space); margin-bottom: var(--space); }
.metric { padding: var(--pad-card); display: flex; flex-direction: column; gap: 10px; }
.metric .top { display: flex; align-items: center; justify-content: space-between; }
.metric .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.metric .n { font-size: 28px; font-weight: 800; letter-spacing: -.5px; line-height: 1; }
.metric .l { color: var(--ink-3); font-size: 13px; font-weight: 500; }
.metric .trend { font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 3px; }
.trend.up { color: var(--green); }
.trend.down { color: var(--rose); }

.dash-cols { display: grid; grid-template-columns: 1.55fr 1fr; gap: var(--space); align-items: start; }
[data-dashlayout="focus"] .dash-cols { grid-template-columns: 1fr; }
[data-dashlayout="focus"] .metric-grid { grid-template-columns: repeat(2, 1fr); max-width: 640px; }

.panel { overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px var(--pad-card) 12px; }
.panel-head h3 { margin: 0; font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.panel-head .link { color: var(--accent); font-size: 13px; font-weight: 600; cursor: pointer; }

.task-row {
  display: flex; align-items: center; gap: 12px; padding: 11px var(--pad-card);
  border-top: 1px solid var(--border); cursor: pointer; transition: .12s;
}
.task-row:hover { background: var(--surface-2); }
.task-check { width: 20px; height: 20px; border-radius: 7px; border: 2px solid var(--border-strong); flex: none; display: grid; place-items: center; transition: .13s; }
.task-row:hover .task-check { border-color: var(--accent); }
.task-check.on { background: var(--green); border-color: var(--green); color: #fff; }
.task-title { font-size: 14px; font-weight: 600; flex: 1; min-width: 0; }
.task-title.done { text-decoration: line-through; color: var(--ink-3); }
.task-meta { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 12px; }

.feed-item { display: flex; gap: 12px; padding: 12px var(--pad-card); border-top: 1px solid var(--border); }
.feed-item .body { flex: 1; min-width: 0; }
.feed-item .who { font-weight: 600; font-size: 13.5px; }
.feed-item .txt { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.feed-item .tm { color: var(--ink-4); font-size: 11.5px; margin-top: 3px; }

.mini-bar { display: flex; align-items: flex-end; gap: 8px; height: 110px; padding: 8px var(--pad-card) var(--pad-card); }
.mini-bar .bar { flex: 1; background: var(--accent-soft); border-radius: 7px 7px 4px 4px; position: relative; transition: .4s; }
.mini-bar .bar > span { position: absolute; inset-block-end: 100%; inset-inline: 0; text-align: center; font-size: 11px; font-weight: 700; color: var(--ink-3); padding-bottom: 4px; }
.mini-bar .bar .fill { position: absolute; inset-inline: 0; inset-block-end: 0; background: linear-gradient(var(--accent), color-mix(in srgb,var(--accent) 60%,#18b6c4)); border-radius: 7px 7px 4px 4px; }
.mini-bar .lbl { text-align: center; font-size: 11px; color: var(--ink-4); }

.dmsg-row { display: flex; align-items: center; gap: 10px; padding: 10px var(--pad-card); border-top: 1px solid var(--border); transition: background .12s; }
.dmsg-row:hover { background: var(--surface-2); }
.deadline-row { display: flex; align-items: center; gap: 12px; padding: 11px var(--pad-card); border-top: 1px solid var(--border); }
.dl-date { width: 46px; height: 46px; border-radius: 12px; background: var(--surface-3); display: grid; place-items: center; flex: none; text-align: center; line-height: 1; }
.dl-date .d { font-size: 17px; font-weight: 800; }
.dl-date .m { font-size: 10px; color: var(--ink-3); margin-top: 2px; }

/* ============================================================
   CHAT
   ============================================================ */
.chat { display: grid; grid-template-columns: 296px 1fr; height: 100%; }
[data-chatlayout="full"] .chat { grid-template-columns: 256px 1fr; }
.chat-list { border-inline-end: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.chat-list-head { padding: 16px 16px 10px; display: flex; align-items: center; justify-content: space-between; }
.chat-list-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.chat-search { margin: 0 12px 8px; }
.chat-tabs { display: flex; gap: 6px; padding: 0 12px 8px; }
.chat-tab { flex: 1; text-align: center; padding: 7px; border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 600; color: var(--ink-3); cursor: pointer; }
.chat-tab.on { background: var(--accent-soft); color: var(--accent); }
.conv-list { overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; padding: 4px 8px 8px; }
.conv {
  display: flex; gap: 11px; padding: 10px; border-radius: var(--radius-sm); cursor: pointer; transition: .12s; align-items: center;
}
.conv:hover { background: var(--surface-3); }
.conv.active { background: var(--accent-soft); }
.conv .body { flex: 1; min-width: 0; }
.conv .top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.conv .nm { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .tm { font-size: 11px; color: var(--ink-4); flex: none; }
.conv .pv { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.conv .unread { min-width: 19px; height: 19px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; flex: none; }

.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface-2); }
.chat-head {
  height: 62px; flex: none; padding: 0 18px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 80%, transparent);
}
.chat-head .nm { font-weight: 700; font-size: 15.5px; }
.chat-head .st { font-size: 12px; color: var(--ink-3); }
.chat-head .acts { margin-inline-start: auto; display: flex; gap: 4px; }

.msgs { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 20px 22px; display: flex; flex-direction: column; gap: 3px; }
.day-sep { text-align: center; margin: 14px 0; position: relative; }
.day-sep span { background: var(--surface-3); color: var(--ink-3); font-size: 11.5px; font-weight: 600; padding: 4px 12px; border-radius: 99px; }

.msg { display: flex; gap: 10px; max-width: 76%; align-items: flex-end; }
.msg.me { margin-inline-start: auto; flex-direction: row-reverse; }
.msg .stack { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.msg.me .stack { align-items: flex-end; }
.msg .who { font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 2px; padding-inline: 4px; }
.bubble {
  padding: 9px 13px; border-radius: 17px; font-size: 14px; line-height: 1.55;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  position: relative; word-break: break-word; max-width: 100%;
}
.msg.me .bubble { background: var(--accent); color: #fff; border-color: transparent; }
.msg:not(.me) .bubble { border-end-start-radius: 6px; }
.msg.me .bubble { border-end-end-radius: 6px; }
.bubble .tm { font-size: 10.5px; opacity: .7; margin-inline-start: 8px; }
.bubble .ticks { display: inline-flex; vertical-align: -2px; margin-inline-start: 3px; }

[data-chatstyle="compact"] .msg { max-width: 100%; gap: 11px; align-items: flex-start; }
[data-chatstyle="compact"] .msg.me { flex-direction: row; margin-inline-start: 0; }
[data-chatstyle="compact"] .msg.me .stack { align-items: flex-start; }
[data-chatstyle="compact"] .bubble { background: transparent !important; border: none; box-shadow: none; padding: 1px 0; color: var(--ink) !important; border-radius: 0; }
[data-chatstyle="compact"] .msg .who { display: block; }
[data-chatstyle="compact"] .msg:not(.compact-first) .av-wrap { visibility: hidden; }

.voice { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.voice .play { width: 32px; height: 32px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); display: grid; place-items: center; flex: none; }
.msg.me .voice .play { background: rgba(255,255,255,.25); color: #fff; }
.wave { flex: 1; display: flex; align-items: center; gap: 2.5px; height: 26px; }
.wave i { width: 3px; border-radius: 9px; background: currentColor; opacity: .5; }
.voice .dur { font-size: 11.5px; opacity: .75; flex: none; }

.attach-img { border-radius: 12px; overflow: hidden; max-width: 260px; margin-top: 2px; border: 1px solid var(--border); }
.file-card { display: flex; align-items: center; gap: 11px; padding: 10px; background: var(--surface-3); border-radius: 11px; min-width: 200px; }
.msg.me .file-card { background: rgba(255,255,255,.18); }
.file-ico { width: 38px; height: 38px; border-radius: 9px; background: var(--rose); color: #fff; display: grid; place-items: center; flex: none; }

.reactions { display: flex; gap: 5px; margin-top: 5px; padding-inline: 2px; }
.rxn { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border); font-size: 12px; font-weight: 600; cursor: pointer; transition: .12s; }
.rxn:hover { border-color: var(--accent); }
.rxn.mine { background: var(--accent-soft); border-color: color-mix(in srgb,var(--accent) 40%,transparent); color: var(--accent); }

.msg-hover-acts {
  position: absolute; top: -14px; inset-inline-end: 8px; display: none; gap: 2px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-md); padding: 3px;
}
.msg:hover .msg-hover-acts { display: flex; }
.msg-hover-acts button { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; color: var(--ink-2); font-size: 15px; }
.msg-hover-acts button:hover { background: var(--surface-3); }

.typing { display: inline-flex; gap: 3px; padding: 11px 14px; }
.typing i { width: 7px; height: 7px; border-radius: 99px; background: var(--ink-4); animation: bounce 1.2s infinite; }
.typing i:nth-child(2){ animation-delay: .15s; } .typing i:nth-child(3){ animation-delay: .3s; }
@keyframes bounce { 0%,60%,100%{ transform: translateY(0); opacity:.5;} 30%{ transform: translateY(-5px); opacity:1;} }

/* reply preview bar above composer */
.reply-preview {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 10px; margin: 0 0 2px;
  background: var(--surface-2); border-radius: 10px 10px 0 0;
  border: 1.5px solid var(--border); border-bottom: none;
  color: var(--ink-2); font-size: 12.5px;
}
.reply-preview-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.reply-preview-from { font-weight: 700; color: var(--accent); font-size: 11.5px; }
.reply-preview-text { color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reply-preview-close { background: none; border: none; cursor: pointer; color: var(--ink-3); display: grid; place-items: center; padding: 2px; border-radius: 6px; flex-shrink: 0; }
.reply-preview-close:hover { background: var(--surface-3); color: var(--ink); }
.reply-preview + .attach-chip-bar,
.reply-preview + .composer-box,
.attach-chip-bar + .composer-box,
.composer-box-connected { border-radius: 0 0 var(--radius) var(--radius) !important; border-top: none !important; }

/* attached file chip above composer */
.attach-chip-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 12px 6px 10px;
  background: color-mix(in srgb,var(--accent) 8%,var(--surface-2));
  border: 1.5px solid var(--border); border-bottom: none;
  border-radius: 10px 10px 0 0; font-size: 12.5px;
}
.attach-chip-name { flex: 1; min-width: 0; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attach-chip-size { font-size: 11px; color: var(--ink-4); flex-shrink: 0; }

/* quoted message inside bubble */
.quoted-msg {
  display: flex; flex-direction: column; gap: 2px;
  padding: 5px 9px; margin-bottom: 6px;
  border-inline-start: 3px solid var(--accent);
  background: color-mix(in srgb,var(--accent) 8%,transparent);
  border-radius: 0 6px 6px 0; font-size: 12px;
}
.quoted-from { font-weight: 700; color: var(--accent); font-size: 11px; }
.quoted-text { color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }

.composer { flex: none; padding: 12px 18px 16px; position: relative; }
.composer-box {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 8px 8px 8px 12px; display: flex; align-items: flex-end; gap: 8px; transition: .15s; box-shadow: var(--shadow-sm);
}
.composer-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer-box textarea { flex: 1; border: none; outline: none; background: none; resize: none; font-size: 14.5px; line-height: 1.5; max-height: 120px; padding: 7px 4px; color: var(--ink); }
.composer-acts { display: flex; gap: 2px; }
.send-btn { width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; transition: .14s; }
.send-btn:hover { filter: brightness(1.07); }
.send-btn:disabled { opacity: .4; cursor: default; }

/* Task mention autocomplete */
.mention-popup {
  position: absolute; bottom: 100%; left: 0; right: 0; z-index: 90;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); max-height: 240px; overflow-y: auto; margin-bottom: 6px;
}
.mention-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer;
  font-size: 13.5px; transition: background .1s;
}
.mention-item:hover, .mention-item.active { background: var(--surface-2); }
.mention-title { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mention-team { font-size: 11px; font-weight: 600; }
.mention-badge { font-size: 10px; padding: 2px 7px; border-radius: 6px; background: var(--surface-3); color: var(--ink-3); }
.mention-badge.archived { background: #f1f5f9; color: #64748b; }
.mention-badge[data-status="done"] { background: #dcfce7; color: #166534; }
.mention-badge[data-status="inprogress"] { background: #fef3c7; color: #92400e; }

/* Task embed card in chat */
.task-card-embed {
  margin: 6px 0; padding: 10px 14px; border-radius: 10px;
  background: var(--surface-2, #f8fafc); border: 1px solid var(--border);
  border-right: 3px solid var(--accent); max-width: 300px; cursor: pointer;
}
.task-card-embed-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.task-card-embed-icon { font-size: 18px; flex-shrink: 0; }
.task-card-embed-title {
  font-size: 14px; font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.task-card-embed-body { display: flex; flex-direction: column; gap: 6px; }
.task-card-embed-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.task-card-embed-badge {
  font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; white-space: nowrap;
}
.task-card-embed-team {
  font-size: 11px; font-weight: 600; color: var(--accent); opacity: .8;
}
.task-card-embed-desc {
  font-size: 12px; color: var(--ink-3); line-height: 1.5;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.task-card-embed-members { display: flex; gap: -4px; margin-top: 2px; }
.task-card-embed-avatar {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10px; font-weight: 700; color: #fff; margin-inline-end: -4px;
  border: 2px solid var(--surface);
}

/* Message context menu */
.msg-context-menu {
  position: absolute; top: 100%; inset-inline-end: 0; z-index: 80; min-width: 130px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-lg); padding: 4px; animation: fadeUp .12s;
}
.msg-context-menu button {
  display: flex; align-items: center; gap: 6px; width: 100%; padding: 8px 12px;
  font-size: 13px; font-weight: 500; border: none; background: none; cursor: pointer;
  border-radius: 7px; color: var(--ink-2); font-family: inherit; text-align: right;
}
.msg-context-menu button:hover { background: var(--surface-2); }

/* right info panel in chat (full layout) */
.chat-info { width: 280px; border-inline-start: 1px solid var(--border); background: var(--surface); padding: 0; overflow-y: auto; }

/* ============================================================
   TASKS / KANBAN
   ============================================================ */
.tasks-wrap { display: flex; flex-direction: column; height: 100%; }
.tasks-bar { padding: 16px var(--space) 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.seg { display: flex; background: var(--surface-3); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.seg button { padding: 6px 13px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.board { flex: 1; min-height: 0; display: flex; gap: var(--space); padding: 4px var(--space) var(--space); overflow-x: auto; }
.col { width: 312px; flex: none; display: flex; flex-direction: column; min-height: 0; }
[data-density="compact"] .col { width: 280px; }
.col-head { display: flex; align-items: center; gap: 9px; padding: 6px 6px 12px; }
.col-head .dotc { width: 11px; height: 11px; border-radius: 99px; }
.col-head .nm { font-weight: 700; font-size: 14px; }
.col-head .ct { background: var(--surface-3); color: var(--ink-3); font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 99px; }
.col-head .add { margin-inline-start: auto; width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: var(--ink-3); }
.col-head .add:hover { background: var(--surface-3); color: var(--ink); }
.col-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px; border-radius: var(--radius); transition: .15s; }
.col-body.drop-on { background: var(--accent-soft-2); outline: 2px dashed color-mix(in srgb,var(--accent) 40%,transparent); outline-offset: -2px; }
.col-body.col-done-locked { cursor: not-allowed; }
.col-body.col-done-locked:hover { background: color-mix(in srgb,var(--ink-4) 6%,transparent); }

.tcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 13px; box-shadow: var(--shadow-sm); cursor: grab; transition: box-shadow .15s, transform .15s, opacity .15s;
  position: relative;
}
.tcard:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.tcard.dragging { opacity: .45; cursor: grabbing; }
.tcard .tcard-top { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; }
.tcard .label { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.tcard .tt { font-weight: 600; font-size: 14px; line-height: 1.4; margin: 0 0 6px; }
.tcard .desc { color: var(--ink-3); font-size: 12.5px; line-height: 1.5; margin: 0 0 11px; }
.tcard-foot { display: flex; align-items: center; gap: 10px; }
.tcard-foot .sp { margin-inline-start: auto; }
.tcard .meta-ic { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); font-size: 12px; font-weight: 600; }
.tcard .meta-ic.due-soon { color: var(--rose); }
.tcard .prog { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin: 9px 0; }
.tcard .prog > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }

/* board style: colorful column tops */
[data-taskstyle="colorful"] .col-body { background: var(--surface-2); padding: 10px; }
[data-taskstyle="colorful"] .col-head { padding: 10px 12px; border-radius: var(--radius) var(--radius) 0 0; color:#fff; margin-bottom:0; }
[data-taskstyle="colorful"] .col-head .ct { background: rgba(255,255,255,.25); color:#fff; }
[data-taskstyle="colorful"] .col-head .add { color: rgba(255,255,255,.85); }
[data-taskstyle="colorful"] .col-head .dotc { display: none; }
[data-taskstyle="colorful"] .col-c0 .col-head { background: var(--blue); }
[data-taskstyle="colorful"] .col-c1 .col-head { background: var(--violet); }
[data-taskstyle="colorful"] .col-c2 .col-head { background: var(--amber); }
[data-taskstyle="colorful"] .col-c3 .col-head { background: var(--green); }
[data-taskstyle="colorful"] .col-body { border-radius: 0 0 var(--radius) var(--radius); }

/* board style: minimal (no card borders, hairline) */
[data-taskstyle="minimal"] .tcard { box-shadow: none; border-color: var(--border); }
[data-taskstyle="minimal"] .tcard:hover { box-shadow: var(--shadow-sm); }

.avstack { display: flex; }
.avstack .av-wrap { margin-inline-start: -8px; border: 2px solid var(--surface); border-radius: 99px; }
.avstack .av-wrap:first-child { margin-inline-start: 0; }

/* ============================================================
   AI ASSISTANT
   ============================================================ */
.ai { display: grid; grid-template-columns: 268px 1fr; height: 100%; }
.ai-side { border-inline-end: 1px solid var(--border); background: var(--surface); padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.ai-side h4 { margin: 6px 4px; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.ai-newchat { display: flex; align-items: center; gap: 9px; justify-content: center; }
.ai-hist { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: var(--radius-sm); color: var(--ink-2); font-size: 13.5px; cursor: pointer; }
.ai-hist:hover { background: var(--surface-3); }
.ai-hist.on { background: var(--accent-soft); color: var(--accent); }
.ai-hist .ic { flex: none; opacity: .7; }
.ai-hist .t { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ai-main { display: flex; flex-direction: column; min-height: 0; background: var(--surface-2); }
.ai-stream { flex: 1; overflow-y: auto; padding: 26px 0; }
.ai-inner { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.ai-empty { text-align: center; padding: 6vh 24px; }
.ai-orb {
  width: 76px; height: 76px; border-radius: 24px; margin: 0 auto 20px;
  background: linear-gradient(145deg, var(--accent), #18b6c4); display: grid; place-items: center; color: #fff;
  box-shadow: 0 16px 40px color-mix(in srgb,var(--accent) 36%,transparent); animation: float 4s ease-in-out infinite;
}
@keyframes float { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(-8px);} }
.ai-empty h2 { font-size: 24px; font-weight: 800; margin: 0 0 8px; letter-spacing: -.4px; }
.ai-empty p { color: var(--ink-3); margin: 0 auto 26px; max-width: 46ch; }
.ai-suggest { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; max-width: 620px; margin: 0 auto; text-align: start; }
.sg-card { padding: 15px; text-align: start; display: flex; gap: 12px; align-items: flex-start; transition: .14s; cursor: pointer; }
.sg-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.sg-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; color: #fff; }
.sg-card .t { font-weight: 700; font-size: 14px; }
.sg-card .d { color: var(--ink-3); font-size: 12.5px; margin-top: 3px; line-height: 1.45; }

.ai-msg { display: flex; gap: 13px; margin-bottom: 24px; }
.ai-msg .ava { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; color: #fff; font-weight: 700; }
.ai-msg.user .ava { background: var(--ink-2); }
.ai-msg .ava.bot { background: linear-gradient(145deg, var(--accent), #18b6c4); }
.ai-msg .who { font-weight: 700; font-size: 13.5px; margin-bottom: 5px; }
.ai-body { flex: 1; min-width: 0; font-size: 14.5px; line-height: 1.7; color: var(--ink); }
.ai-body p { margin: 0 0 10px; }
.ai-body ul { margin: 0 0 10px; padding-inline-start: 20px; }
.ai-body li { margin-bottom: 5px; }
.ai-body strong { font-weight: 700; }
.ai-body .ai-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin: 4px 0 12px; }
.ai-body .ai-card h5 { margin: 0 0 8px; font-size: 14px; font-weight: 700; }
.ai-actions { display: flex; gap: 8px; margin-top: 12px; }
.cursor-blink::after { content:"▋"; margin-inline-start: 2px; animation: blink 1s steps(2) infinite; color: var(--accent); }
@keyframes blink { 50%{ opacity: 0; } }

.ai-composer { flex: none; padding: 12px 24px 22px; }
.ai-composer-inner { max-width: 760px; margin: 0 auto; }

/* ============================================================
   modal / task detail
   ============================================================ */
.scrim { position: fixed; inset: 0; background: rgba(20,20,34,.42); backdrop-filter: blur(3px); z-index: 60; display: grid; place-items: center; padding: 24px; animation: fadeUp .2s; }
.modal { background: var(--surface); border-radius: var(--radius-lg); width: 100%; max-width: 560px; max-height: 86vh; overflow-y: auto; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.modal-head { padding: 20px 22px 14px; display: flex; align-items: flex-start; gap: 12px; position: sticky; top: 0; background: var(--surface); z-index: 5; }
.modal-body { padding: 16px 22px 22px; }
.modal .close { margin-inline-start: auto; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--ink-3); }
.modal .close:hover { background: var(--surface-3); }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.field-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kv { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.kv .k { color: var(--ink-3); width: 96px; flex: none; }
.cmt { display: flex; gap: 10px; padding: 11px 0; }
.cmt .body { flex: 1; }
.cmt .bx { background: var(--surface-3); border-radius: 12px; padding: 9px 12px; font-size: 13.5px; line-height: 1.5; margin-top: 3px; }

/* notifications dropdown */
.dropdown { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; width: 360px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 50; overflow: hidden; animation: fadeUp .16s; }
.dropdown-head { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.dropdown-head h4 { margin: 0; font-size: 15px; font-weight: 700; }
.noti { display: flex; gap: 11px; padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: .12s; }
.noti:hover { background: var(--surface-2); }
.noti.unread { background: var(--accent-soft-2); }
.noti .ni { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; color: #fff; }
.noti .txt { flex: 1; font-size: 13px; line-height: 1.45; }
.noti .tm { color: var(--ink-4); font-size: 11px; margin-top: 3px; }

/* responsive guard — tablet */
@media (max-width: 1080px) {
  .app { grid-template-columns: 72px 1fr; }
  .sidebar .brand-name, .sidebar .brand-sub, .nav-label span, .nav-item span:not(.badge), .workspace-pick .ws-name, .sidebar-foot .uinfo { display: none; }
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .dash-cols { grid-template-columns: 1fr; }
}

/* hamburger: hidden on desktop/tablet */
.menu-btn { display: none; }
.chat-back { display: none; }
.sidebar-overlay { display: none; }

/* ============================================================
   MOBILE  (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {
  /* show mobile-only elements */
  .menu-btn { display: grid; }
  .chat-back { display: grid; }

  /* single-column layout — sidebar leaves grid flow */
  .app { grid-template-columns: 1fr; }

  /* sidebar: fixed slide-over drawer from the right (RTL) */
  .sidebar {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 280px;
    z-index: 100;
    transform: translateX(110%);
    transition: transform .28s cubic-bezier(.25,.8,.25,1);
    box-shadow: var(--shadow-lg);
    /* restore full text that tablet hides */
  }
  .sidebar .brand-name, .sidebar .brand-sub,
  .nav-label span, .nav-item span:not(.badge),
  .workspace-pick .ws-name, .sidebar-foot .uinfo { display: initial; }
  .nav-item { font-size: 14px; }
  [data-sidebar-open="true"] .sidebar { transform: translateX(0); }

  /* scrim behind drawer */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20,20,34,.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 99;
    animation: fadeUp .18s;
  }
  [data-sidebar-open="true"] .sidebar-overlay { display: block; }

  /* topbar */
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar .ttl { font-size: 16px; }
  /* search collapses to icon only */
  .search { width: 38px; overflow: hidden; flex: none; margin-inline-start: auto; }
  .search input { display: none; }

  /* dashboard */
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-cols { grid-template-columns: 1fr; }
  .dash { padding: 14px; }
  .dash-hero { padding: 18px 20px; }
  .dash-hero h1 { font-size: 20px; }
  .hero-stats { gap: 16px; margin-top: 14px; }

  /* chat: list / thread switching */
  .chat { grid-template-columns: 1fr; position: relative; height: 100%; }
  .chat-list { position: absolute; inset: 0; z-index: 2; background: var(--surface); }
  .chat-main { position: absolute; inset: 0; z-index: 1; }
  .chat-info { display: none !important; }
  .chat[data-mobile-view="chat"] .chat-list { display: none; }
  .chat[data-mobile-view="list"] .chat-main { display: none; }
  /* 16px+ prevents iOS Safari's auto-zoom-on-focus, which otherwise throws off
     the whole layout/scroll position the moment the composer is tapped */
  .composer-box textarea { font-size: 16px; }

  /* AI */
  .ai { grid-template-columns: 1fr; }
  .ai-side { display: none; }
  .ai-suggest { grid-template-columns: 1fr; }

  /* kanban */
  .col { width: 260px; }

  /* modal */
  .scrim { padding: 12px; }
  .modal { max-width: 100%; }
}

@media (max-width: 480px) {
  .metric-grid { grid-template-columns: 1fr; }
  .hero-stat .n { font-size: 22px; }
  .col { width: 240px; }
  .topbar .ttl .sub { display: none; }
}

.empty-hint { color: var(--ink-3); text-align: center; padding: 40px; font-size: 14px; }

/* ============================================================
   ROLE SWITCHER FAB
   ============================================================ */
.role-fab {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 18px 10px 14px;
  border-radius: var(--radius-pill);
  color: #fff;
  font-weight: 700; font-size: 13.5px;
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
  transition: .2s;
}
.role-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0,0,0,.30); filter: brightness(1.06); }
.role-fab-label { white-space: nowrap; }

.role-switcher-panel {
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.role-option {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 11px 14px;
  font-size: 13px; text-align: start;
  transition: .12s; cursor: pointer;
}
.role-option:hover { background: var(--surface-2); }
.role-option.active { background: var(--accent-soft-2); }
.role-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; }

/* ============================================================
   CALENDAR
   ============================================================ */
.cal-wrap { padding: var(--space); max-width: 1100px; margin: 0 auto; }
.cal-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.cal-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 18px; border-radius: var(--radius-pill);
  font-weight: 600; font-size: 13.5px; color: var(--ink-2);
  background: var(--surface-3); border: 1px solid transparent; cursor: pointer; transition: .14s;
}
.cal-tab.active { background: var(--accent); color: #fff; box-shadow: 0 4px 12px color-mix(in srgb,var(--accent) 30%,transparent); }
.cal-tab:not(.active):hover { background: var(--border); }

.cal-body { display: grid; grid-template-columns: 1fr 280px; gap: var(--space); align-items: start; }
@media (max-width: 900px) { .cal-body { grid-template-columns: 1fr; } }

.cal-main { padding: 16px; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-month-title { font-size: 17px; font-weight: 800; margin: 0; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
.cal-head-row .cal-dh {
  text-align: center; font-size: 12px; font-weight: 700; color: var(--ink-3);
  padding: 6px 0; border-radius: 6px;
}

.cal-cell {
  min-height: 72px; border-radius: 10px; padding: 6px;
  border: 1.5px solid transparent; cursor: pointer; transition: .12s; position: relative;
  background: var(--surface-2);
}
.cal-cell.empty { background: none; border-color: transparent; cursor: default; }
.cal-cell:not(.empty):hover { background: var(--accent-soft); border-color: color-mix(in srgb,var(--accent) 30%,transparent); }
.cal-cell.today { background: color-mix(in srgb,var(--accent) 10%,var(--surface)); border-color: var(--accent); }
.cal-cell.today .cal-day-n { background: var(--accent); color: #fff; }
.cal-cell.selected { background: var(--accent-soft); border-color: var(--accent); }
.cal-day-n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.cal-dots { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 4px; }
.cal-add-btn {
  position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  width: 22px; height: 22px; border-radius: 7px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 13px;
}
.cal-legend { display: flex; gap: 14px; padding: 12px 4px 0; flex-wrap: wrap; }
.cal-legend span { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-3); }

.cal-ev {
  display: block; font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 7px;
  border-left: 3px solid; margin-bottom: 5px; cursor: pointer; line-height: 1.4; transition: .12s;
}
.cal-ev:hover { filter: brightness(.97); }

.upcoming-ev {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--border); cursor: pointer; transition: .12s;
}
.upcoming-ev:hover { color: var(--accent); }
.upcoming-dot { width: 10px; height: 10px; border-radius: 99px; flex: none; }

/* ============================================================
   FORMS / MODALS (shared)
   ============================================================ */
.modal-bg {
  position: fixed; inset: 0; background: rgba(20,20,34,.44); backdrop-filter: blur(4px);
  z-index: 200; display: grid; place-items: center; padding: 24px; animation: fadeUp .2s;
}
.modal-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  width: 100%; box-shadow: var(--shadow-lg); overflow: hidden;
}
.modal-head {
  padding: 18px 20px 0; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border); padding-bottom: 14px; margin-bottom: 0;
}
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 800; }

.form-label { display: block; font-size: 12px; font-weight: 700; color: var(--ink-3); margin-bottom: 5px; }
.form-val   { font-size: 14px; font-weight: 600; }
.form-row   { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); padding: 6px 0; }
.form-input {
  display: block; width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--ink); font-size: 14px; font-family: inherit;
  outline: none; transition: .14s;
}
.form-input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }

.btn-primary { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: var(--radius-sm); background: var(--accent); color: #fff; font-weight: 700; font-size: 13.5px; transition: .14s; }
.btn-primary:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .45; cursor: default; transform: none; }
.btn-ghost  { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: var(--radius-sm); background: var(--surface-3); color: var(--ink-2); font-weight: 600; font-size: 13.5px; transition: .14s; }
.btn-ghost:hover { background: var(--border); color: var(--ink); }
.btn-danger { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: var(--radius-sm); background: color-mix(in srgb,var(--rose) 12%,transparent); color: var(--rose); font-weight: 700; font-size: 13px; transition: .14s; }
.btn-danger:hover { background: color-mix(in srgb,var(--rose) 18%,transparent); }
.btn-block { width: 100%; justify-content: center; }

/* ============================================================
   ALARM / OVERDUE
   ============================================================ */
.alarm-card { border-color: color-mix(in srgb,var(--rose) 25%,transparent); background: color-mix(in srgb,var(--rose) 4%,var(--surface)); }
.alarm-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; color: var(--rose); font-weight: 700; font-size: 14px; border-bottom: 1px solid color-mix(in srgb,var(--rose) 15%,transparent); }
.alarm-row { display: flex; align-items: center; gap: 10px; padding: 9px 18px; border-top: 1px solid var(--border); font-size: 13px; }
.dtask-row { display: flex; align-items: center; gap: 11px; padding: 11px var(--pad-card); border-top: 1px solid var(--border); cursor: pointer; transition: background .13s; }
.dtask-row:hover { background: var(--surface-2); }
.dtask-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 1px; }
.dtask-body { flex: 1; min-width: 0; }
.dtask-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 5px; }
.dtask-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.dtask-pill { font-size: 11px !important; padding: 2px 7px !important; }
.dtask-due { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.new-conv-btn { display: flex; align-items: center; gap: 8px; margin: 8px 12px 4px; padding: 9px 14px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); border: 1.5px dashed color-mix(in srgb,var(--accent) 35%,transparent); cursor: pointer; font-weight: 700; font-size: 13px; width: calc(100% - 24px); transition: background .13s; font-family: inherit; }
.new-conv-btn:hover { background: color-mix(in srgb,var(--accent) 15%,transparent); border-style: solid; }
.chat-new-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 20px; background: var(--accent); color: #fff; border: none; cursor: pointer; font-weight: 700; font-size: 12.5px; font-family: inherit; transition: opacity .13s; white-space: nowrap; }
.chat-new-btn:hover { opacity: .86; }
.sidebar-alarm {
  margin: 0 12px 8px; padding: 8px 12px; border-radius: var(--radius-sm);
  background: color-mix(in srgb,var(--rose) 12%,transparent); color: var(--rose);
  display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.sidebar-alarm:hover { background: color-mix(in srgb,var(--rose) 18%,transparent); }

/* ============================================================
   MIDDLE MANAGER
   ============================================================ */
.member-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--border); cursor: pointer; transition: .12s;
}
.member-row:hover { color: var(--accent); }
.member-stat { text-align: center; }
.member-stat .n { font-size: 20px; font-weight: 800; }
.member-stat .l { font-size: 11px; color: var(--ink-3); }

.approval-card { padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.approval-msg { display: flex; gap: 7px; padding: 9px 12px; background: var(--surface-2); border-radius: 9px; font-size: 13px; color: var(--ink-2); margin-top: 10px; line-height: 1.5; }

.incoming-req { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--border); }
.team-view { padding: var(--space); max-width: 900px; margin: 0 auto; }
.member-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.member-tab {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-radius: var(--radius); background: var(--surface); border: 1.5px solid var(--border);
  cursor: pointer; transition: .13s; text-align: start;
}
.member-tab:hover { border-color: var(--accent); }
.member-tab.active { border-color: var(--accent); background: var(--accent-soft); }

.team-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; flex: none; }
.member-assign-btn { border: 2px solid transparent; }
.member-assign-btn.selected { border-color: var(--accent); color: var(--accent); }

.empty-state { text-align: center; padding: 48px 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty-state p { color: var(--ink-3); font-size: 14px; }

/* ============================================================
   ORG DIRECTOR
   ============================================================ */
.team-overview-row { display: flex; align-items: center; gap: 12px; padding: 12px var(--pad-card); border-top: 1px solid var(--border); cursor: pointer; transition: .12s; }
.team-overview-row:hover { background: var(--surface-2); }
.team-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 16px; flex: none; }
.team-header { display: flex; align-items: center; gap: 14px; padding: 16px; cursor: pointer; }
.team-header:hover { background: var(--surface-2); }

.quick-action-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 10px; border-radius: var(--radius); background: var(--surface-2);
  border: 1px solid var(--border); cursor: pointer; font-size: 12.5px; font-weight: 600; transition: .14s;
}
.quick-action-btn:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.qa-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; }

/* data table */
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th { text-align: start; padding: 12px 16px; font-size: 12px; font-weight: 700; color: var(--ink-3); background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:hover td { background: var(--surface-2); }
.data-table tr:last-child td { border-bottom: none; }

.prog { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.prog > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }

/* bar chart generic */
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 100px; padding: 8px var(--pad-card) var(--pad-card); }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 5px; flex: 1; }
.bar-wrap { flex: 1; width: 100%; min-height: 4px; display: flex; align-items: flex-end; border-radius: 6px 6px 0 0; background: var(--surface-2); overflow: hidden; }
.bar-fill { width: 100%; background: linear-gradient(var(--accent), color-mix(in srgb,var(--accent) 55%,#18b6c4)); border-radius: 6px 6px 0 0; transition: height .4s; }
.bar-d { font-size: 11px; color: var(--ink-4); font-weight: 600; }

/* ============================================================
   SANATASK ADMIN
   ============================================================ */
.company-row { display: flex; align-items: center; gap: 12px; padding: 11px var(--pad-card); border-top: 1px solid var(--border); cursor: pointer; transition: .12s; }
.company-row:hover { background: var(--surface-2); }
.company-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb,var(--accent) 15%,transparent); color: var(--accent); font-weight: 800; font-size: 15px; flex: none; }

.crm-item { border: 1.5px solid var(--border); transition: .13s; }
.crm-item:hover { border-color: color-mix(in srgb,var(--accent) 40%,transparent); }
.crm-item.selected { border-color: var(--accent); background: var(--accent-soft); }

.api-key-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  font-family: monospace;
}
.api-key-box code { flex: 1; word-break: break-all; }

/* toggle switch */
.toggle-btn {
  width: 44px; height: 24px; border-radius: 99px; background: var(--border-strong);
  position: relative; transition: .2s; cursor: pointer; flex: none;
}
.toggle-btn.on { background: var(--accent); }
.toggle-thumb {
  position: absolute; top: 3px; width: 18px; height: 18px; border-radius: 99px;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: .2s;
  right: 3px;
}
[dir="rtl"] .toggle-thumb { right: auto; left: 3px; }
.toggle-btn.on .toggle-thumb { left: 3px; right: auto; }
[dir="rtl"] .toggle-btn.on .toggle-thumb { right: 3px; left: auto; }

/* ============================================================
   BAR CHART (shared util)
   ============================================================ */
.meta-ic { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); font-size: 12px; font-weight: 600; }
.meta-ic.due-soon { color: var(--rose); }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-wrap {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: var(--bg);
  overflow-y: auto;
  padding: 24px;
  z-index: 1000;
}
.login-card {
  width: 100%;
  max-width: 400px;
  padding: 32px;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}
.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: color-mix(in srgb, var(--rose) 12%, transparent);
  color: var(--rose);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
  margin-bottom: 16px;
}
.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.login-field label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
}
.login-input-box {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  background: var(--surface-2);
  transition: border-color .15s;
}
.login-input-box:focus-within { border-color: var(--accent); }
.login-input-box input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 14px;
  color: var(--ink);
  padding: 10px 0;
  font-family: inherit;
}
.login-eye {
  background: none;
  border: none;
  color: var(--ink-3);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.login-eye:hover { color: var(--ink); }
.login-divider {
  display: flex;
  align-items: center;
  margin: 20px 0 12px;
}
.login-divider span:first-child,
.login-divider span:last-child {
  flex: 1;
  height: 1px;
  background: var(--border);
}


/* ── Task modal: per-assignee rows ─────────────────────────────── */
.member-task-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

/* ── User picker dropdown ───────────────────────────────────────── */
.user-picker-drop {
  position: absolute;
  top: calc(100% + 4px);
  inset-inline-start: 0;
  inset-inline-end: 0;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 50;
  overflow: hidden;
  max-height: 240px;
  overflow-y: auto;
}
.user-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background .12s;
}
.user-picker-row:hover { background: var(--surface-2); }

/* ── Archive View ─────────────────────────────────────────────────────── */
.archive-view { padding: 0 2px; }

.archive-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.archive-search {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.archive-search-icon {
  position: absolute;
  inset-inline-start: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  pointer-events: none;
}
.archive-search-input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition: border-color .15s;
}
.archive-search-input:focus { border-color: var(--accent); }

.archive-date-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-soft);
}
.archive-date-input {
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.archive-date-input:focus { border-color: var(--accent); }

.arch-btn-reload {
  padding: 8px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .15s;
}
.arch-btn-reload:hover { opacity: .85; }

.archive-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.arch-stat {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-2);
  padding: 4px 12px;
  border-radius: 20px;
}
.arch-stat.secondary { color: var(--text-soft); font-weight: 400; }

.arch-loading, .arch-empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-soft);
  font-size: 14px;
}

.archive-list { display: flex; flex-direction: column; gap: 8px; }

.archive-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .15s;
}
.archive-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.archive-card.open { border-color: var(--accent); }

.archive-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
}
.arch-pri-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.arch-card-main { flex: 1; min-width: 0; }
.arch-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.arch-card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.arch-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1.5px solid currentColor;
  white-space: nowrap;
  color: var(--text-soft);
}
.arch-badge.neutral { color: var(--text-soft); border-color: var(--border); }

.arch-avatars { display: flex; gap: -4px; flex-shrink: 0; }
.arch-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-inline-start: -6px;
  flex-shrink: 0;
}
.arch-avatars .arch-avatar:first-child { margin-inline-start: 0; }

.arch-chevron { font-size: 10px; color: var(--text-soft); flex-shrink: 0; }

.archive-card-body {
  border-top: 1px solid var(--border);
  padding: 16px;
  background: var(--surface-2);
}
.arch-description {
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}
.arch-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 10px;
}
.arch-members-section { margin-bottom: 14px; }
.arch-member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.arch-member-row:last-child { border-bottom: none; }
.arch-member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.arch-member-info { flex: 1; min-width: 0; }
.arch-member-name { font-size: 13px; font-weight: 600; color: var(--text); }
.arch-member-note { font-size: 12px; color: var(--text-soft); margin-top: 2px; }
.arch-status-badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.arch-progress-note {
  width: 100%;
  font-size: 12px;
  color: var(--text-soft);
  font-style: italic;
  padding: 6px 10px;
  background: var(--surface);
  border-radius: 8px;
  margin-top: 4px;
}
.arch-footer {
  display: flex;
  gap: 16px;
  font-size: 11px;
  color: var(--text-soft);
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* Archive button on task cards */
.task-archive-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 11px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
  white-space: nowrap;
}
.task-archive-btn:hover {
  background: #f59e0b22;
  border-color: #f59e0b;
  color: #f59e0b;
}

.tasks-filter-sel {
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  min-width: 120px;
}
.tasks-filter-sel:focus { border-color: var(--accent); }

/* ============================================================
   LANDING PAGE
   ============================================================ */
:root {
  --lp-teal: #0DABA8;
  --lp-teal-dark: #098E8B;
  --lp-gold: #F5A623;
  --lp-dark: #1E293B;
  --lp-text: #334155;
  --lp-muted: #64748B;
  --lp-bg: #FAFBFC;
  --lp-card: #FFFFFF;
}

.lp { font-family: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif; color: var(--lp-text); background: #fff; overflow-x: hidden; scroll-behavior: smooth; }
.lp * { box-sizing: border-box; }
.lp-container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* ── NAV ── */
.lp-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; padding: 16px 0; transition: all .3s; }
.lp-nav.stuck { background: rgba(255,255,255,.92); backdrop-filter: blur(16px); box-shadow: 0 1px 12px rgba(0,0,0,.06); padding: 10px 0; }
.lp-nav-inner { display: flex; align-items: center; gap: 32px; }
.lp-logo-link { display: flex; align-items: center; flex-shrink: 0; }
.lp-logo-img { height: 64px; transition: height .2s; }
.lp-nav.stuck .lp-logo-img { height: 52px; }
.lp-nav-links { display: flex; gap: 28px; flex: 1; }
.lp-nav-links a { color: var(--lp-dark); text-decoration: none; font-size: 14.5px; font-weight: 600; opacity: .8; transition: opacity .2s, color .2s; }
.lp-nav-links a:hover { opacity: 1; color: var(--lp-teal); }
.lp-nav-actions { display: flex; gap: 10px; }
.lp-hamburger { display: none; background: none; border: none; cursor: pointer; padding: 6px; flex-direction: column; gap: 5px; }
.lp-hamburger span { display: block; width: 22px; height: 2px; background: var(--lp-dark); border-radius: 2px; transition: .3s; }

/* ── BUTTONS ── */
.lp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; border-radius: 10px; font-weight: 700; font-size: 14px; cursor: pointer; transition: all .25s; font-family: inherit; white-space: nowrap; }
.lp-btn-outline { background: transparent; color: var(--lp-dark); border: 1.5px solid #CBD5E1; padding: 9px 22px; }
.lp-btn-outline:hover { border-color: var(--lp-teal); color: var(--lp-teal); }
.lp-btn-primary { background: var(--lp-teal); color: #fff; padding: 10px 26px; box-shadow: 0 2px 8px rgba(13,171,168,.25); }
.lp-btn-primary:hover { background: var(--lp-teal-dark); box-shadow: 0 4px 16px rgba(13,171,168,.35); transform: translateY(-1px); }
.lp-btn-cta { background: linear-gradient(135deg, var(--lp-teal), var(--lp-teal-dark)); color: #fff; padding: 14px 36px; font-size: 16px; border-radius: 12px; box-shadow: 0 4px 20px rgba(13,171,168,.3); }
.lp-btn-cta:hover { box-shadow: 0 6px 28px rgba(13,171,168,.45); transform: translateY(-2px); }
.lp-btn-cta-lg { padding: 18px 48px; font-size: 18px; border-radius: 14px; }

/* ── HERO ── */
.lp-hero { position: relative; padding: 140px 0 80px; overflow: hidden; min-height: 92vh; display: flex; align-items: center; }
.lp-hero-bg { position: absolute; inset: 0; background: linear-gradient(160deg, #F0FDFA 0%, #E0F7F6 30%, #FFF7E6 70%, #FFFDF5 100%); z-index: 0; }
.lp-hero-bg::before { content: ''; position: absolute; top: -120px; right: -120px; width: 500px; height: 500px; border-radius: 50%; background: radial-gradient(circle, rgba(13,171,168,.12) 0%, transparent 70%); }
.lp-hero-bg::after { content: ''; position: absolute; bottom: -80px; left: -80px; width: 400px; height: 400px; border-radius: 50%; background: radial-gradient(circle, rgba(245,166,35,.1) 0%, transparent 70%); }
.lp-hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.lp-hero-content { }
.lp-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(13,171,168,.08); color: var(--lp-teal); font-size: 13px; font-weight: 700; padding: 6px 16px; border-radius: 99px; margin-bottom: 20px; border: 1px solid rgba(13,171,168,.15); }
.lp-hero h1 { font-size: 42px; font-weight: 900; line-height: 1.35; color: var(--lp-dark); margin: 0 0 18px; }
.lp-hero h1 span { color: var(--lp-teal); }
.lp-hero-sub { font-size: 17px; line-height: 1.75; color: var(--lp-muted); max-width: 480px; margin-bottom: 28px; }
.lp-hero-cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }
.lp-hero-note { font-size: 13px; color: var(--lp-muted); }
.lp-hero-trust { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--lp-muted); }
.lp-hero-trust strong { color: var(--lp-dark); }
.lp-trust-avatars { display: flex; }
.lp-trust-av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 800; border: 2.5px solid #fff; margin-inline-start: -10px; }
.lp-trust-av:first-child { margin-inline-start: 0; }

/* ── HERO VISUAL (mockup) ── */
.lp-hero-visual { display: flex; justify-content: center; }
.lp-mockup { width: 100%; max-width: 520px; background: var(--lp-card); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.06); overflow: hidden; border: 1px solid #E2E8F0; }
.lp-mockup-bar { display: flex; gap: 6px; padding: 12px 16px; background: #F8FAFC; border-bottom: 1px solid #E2E8F0; }
.lp-mockup-bar span { width: 10px; height: 10px; border-radius: 50%; }
.lp-mockup-bar span:nth-child(1) { background: #E5484D; }
.lp-mockup-bar span:nth-child(2) { background: #F5A623; }
.lp-mockup-bar span:nth-child(3) { background: #30A46C; }
.lp-mockup-body { display: flex; min-height: 280px; }
.lp-mock-sidebar { width: 56px; background: var(--lp-dark); padding: 14px 10px; display: flex; flex-direction: column; gap: 10px; }
.lp-mock-nav-item { height: 32px; border-radius: 8px; background: rgba(255,255,255,.06); }
.lp-mock-nav-item.active { background: var(--lp-teal); }
.lp-mock-main { flex: 1; display: flex; gap: 12px; padding: 16px; background: #F8FAFC; }
.lp-mock-col { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.lp-mock-card { border-radius: 8px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.06); border: 1px solid #E2E8F0; }
.lp-mock-card.accent { border-right: 3px solid var(--lp-teal); }
.lp-mock-card.gold { border-right: 3px solid var(--lp-gold); }

.lp-hero-wave { position: absolute; bottom: -1px; left: 0; right: 0; z-index: 2; }
.lp-hero-wave svg { display: block; width: 100%; height: 80px; }

/* ── SECTION HEADS ── */
.lp-section-head { text-align: center; margin-bottom: 48px; }
.lp-tag { display: inline-block; background: rgba(13,171,168,.08); color: var(--lp-teal); font-size: 13px; font-weight: 700; padding: 5px 16px; border-radius: 99px; margin-bottom: 14px; }
.lp-section-head h2 { font-size: 32px; font-weight: 900; color: var(--lp-dark); margin: 0 0 12px; }
.lp-section-head p { font-size: 16px; color: var(--lp-muted); max-width: 560px; margin: 0 auto; line-height: 1.7; }

/* ── FEATURES GRID ── */
.lp-features { padding: 80px 0; background: #fff; }
.lp-features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.lp-feature-card { background: var(--lp-bg); border: 1px solid #E2E8F0; border-radius: 16px; padding: 32px 28px; transition: all .3s; cursor: default; }
.lp-feature-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(13,171,168,.1); border-color: rgba(13,171,168,.25); }
.lp-feature-icon { width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(135deg, rgba(13,171,168,.1), rgba(13,171,168,.05)); color: var(--lp-teal); display: grid; place-items: center; margin-bottom: 18px; }
.lp-feature-card h3 { font-size: 17px; font-weight: 800; color: var(--lp-dark); margin: 0 0 10px; }
.lp-feature-card p { font-size: 14px; color: var(--lp-muted); line-height: 1.7; margin: 0; }

/* ── HOW ── */
.lp-how { padding: 80px 0; background: var(--lp-bg); }
.lp-steps { display: flex; gap: 24px; justify-content: center; }
.lp-step { flex: 1; max-width: 300px; text-align: center; position: relative; padding: 32px 24px; }
.lp-step-num { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, var(--lp-teal), var(--lp-teal-dark)); color: #fff; font-size: 22px; font-weight: 900; display: grid; place-items: center; margin: 0 auto 18px; box-shadow: 0 4px 16px rgba(13,171,168,.25); }
.lp-step h3 { font-size: 17px; font-weight: 800; color: var(--lp-dark); margin: 0 0 8px; }
.lp-step p { font-size: 14px; color: var(--lp-muted); line-height: 1.7; margin: 0; }
.lp-step-arrow { position: absolute; left: -32px; top: 48px; transform: scaleX(-1); }

/* ── STATS ── */
.lp-stats { padding: 80px 0; background: linear-gradient(135deg, var(--lp-dark) 0%, #0F172A 100%); }
.lp-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.lp-stat { text-align: center; padding: 24px; }
.lp-stat-val { font-size: 48px; font-weight: 900; color: #fff; letter-spacing: -1px; }
.lp-stat-val span { font-size: 28px; color: var(--lp-teal); margin-inline-start: 4px; }
.lp-stat-label { font-size: 15px; color: rgba(255,255,255,.6); margin-top: 6px; font-weight: 600; }

/* ── DEMO CTA ── */
.lp-demo-cta { padding: 80px 0; background: #fff; }
.lp-cta-card { text-align: center; background: linear-gradient(160deg, #F0FDFA, #FFF7E6); border: 1px solid rgba(13,171,168,.15); border-radius: 24px; padding: 64px 40px; max-width: 680px; margin: 0 auto; }
.lp-cta-card h2 { font-size: 30px; font-weight: 900; color: var(--lp-dark); margin: 0 0 12px; }
.lp-cta-card p { font-size: 16px; color: var(--lp-muted); margin: 0 0 28px; }

/* ── SLUG ENTRY ── */
.lp-slug-entry { padding: 48px 0; background: var(--lp-bg); text-align: center; }
.lp-slug-entry h3 { font-size: 18px; font-weight: 700; color: var(--lp-dark); margin: 0 0 16px; }
.lp-slug-form { display: flex; max-width: 420px; margin: 0 auto; gap: 10px; }
.lp-slug-form input { flex: 1; padding: 12px 18px; border: 1.5px solid #CBD5E1; border-radius: 10px; font-size: 15px; font-family: inherit; background: #fff; text-align: center; outline: none; transition: border-color .2s; }
.lp-slug-form input:focus { border-color: var(--lp-teal); }

/* ── FOOTER ── */
.lp-footer { padding: 40px 0 32px; background: var(--lp-dark); color: rgba(255,255,255,.7); }
.lp-footer-inner { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.lp-footer-brand { display: flex; align-items: center; gap: 12px; }
.lp-footer-brand div { color: #fff; }
.lp-footer-links { display: flex; gap: 24px; }
.lp-footer-links a { color: rgba(255,255,255,.6); text-decoration: none; font-size: 13.5px; font-weight: 600; transition: color .2s; }
.lp-footer-links a:hover { color: var(--lp-teal); }
.lp-footer-copy { font-size: 13px; text-align: center; color: rgba(255,255,255,.5); padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08); width: 100%; }
.lp-footer-copy a { color: var(--lp-gold); text-decoration: none; font-weight: 600; }
.lp-footer-copy a:hover { text-decoration: underline; }

/* ── HERO EXTRAS ── */
.lp-badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lp-teal); animation: lpPulse 2s infinite; }
@keyframes lpPulse { 0%,100% { opacity:1; } 50% { opacity:.4; } }
.lp-hero-orb { position: absolute; border-radius: 50%; filter: blur(60px); }
.lp-hero-orb1 { top: -100px; right: -60px; width: 420px; height: 420px; background: rgba(13,171,168,.1); animation: lpFloat 8s ease-in-out infinite; }
.lp-hero-orb2 { bottom: -60px; left: -40px; width: 340px; height: 340px; background: rgba(245,166,35,.08); animation: lpFloat 10s ease-in-out infinite reverse; }
.lp-hero-orb3 { top: 40%; left: 30%; width: 200px; height: 200px; background: rgba(91,91,214,.06); animation: lpFloat 12s ease-in-out infinite; }
@keyframes lpFloat { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-20px) scale(1.05); } }
.lp-hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.lp-chip { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid #E2E8F0; padding: 6px 14px; border-radius: 99px; font-size: 12.5px; font-weight: 600; color: var(--lp-dark); box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.lp-chip svg { color: var(--lp-teal); }

/* ── FEATURE TABS + LIST ── */
.lp-feat-tabs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 32px; }
.lp-feat-tab { display: inline-flex; align-items: center; gap: 6px; padding: 9px 20px; border-radius: 99px; border: 1.5px solid #E2E8F0; background: #fff; font-size: 13.5px; font-weight: 700; color: var(--lp-text); cursor: pointer; transition: all .2s; font-family: inherit; }
.lp-feat-tab:hover { border-color: var(--lp-teal); color: var(--lp-teal); }
.lp-feat-tab.active { background: var(--lp-teal); color: #fff; border-color: var(--lp-teal); }
.lp-feat-tab.active svg { color: #fff; }
.lp-feat-tab svg { color: var(--lp-teal); }
.lp-feat-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 24px; margin-bottom: 48px; }
.lp-feat-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 500; color: var(--lp-text); background: var(--lp-bg); border: 1px solid transparent; transition: all .2s; opacity: 0; animation: lpFadeUp .4s ease forwards; }
.lp-feat-item:hover { border-color: rgba(13,171,168,.2); background: #fff; box-shadow: 0 2px 8px rgba(13,171,168,.06); }
.lp-feat-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.lp-feat-sum-card { text-align: center; padding: 24px 16px; border-radius: 14px; background: var(--lp-bg); border: 1px solid #E2E8F0; cursor: pointer; transition: all .25s; }
.lp-feat-sum-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(13,171,168,.1); border-color: rgba(13,171,168,.25); }
.lp-feat-sum-icon { width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(135deg, rgba(13,171,168,.1), rgba(13,171,168,.04)); color: var(--lp-teal); display: grid; place-items: center; margin: 0 auto 10px; }
.lp-feat-sum-name { font-size: 14px; font-weight: 800; color: var(--lp-dark); }
.lp-feat-sum-count { font-size: 12px; color: var(--lp-teal); font-weight: 700; margin-top: 4px; }

/* ── STEP ICON ── */
.lp-step-icon { width: 48px; height: 48px; border-radius: 12px; background: rgba(13,171,168,.06); color: var(--lp-teal); display: grid; place-items: center; margin: 0 auto 12px; }

/* ── STAT ICON ── */
.lp-stat-icon { width: 52px; height: 52px; border-radius: 14px; background: rgba(13,171,168,.15); color: var(--lp-teal); display: grid; place-items: center; margin: 0 auto 12px; }

/* ── PRICING ── */
.lp-pricing { padding: 80px 0; background: var(--lp-bg); }
.lp-price-toggle { display: flex; justify-content: center; gap: 4px; background: #E2E8F0; border-radius: 99px; padding: 4px; width: fit-content; margin: 0 auto 40px; }
.lp-price-toggle button { padding: 10px 24px; border-radius: 99px; border: none; font-size: 14px; font-weight: 700; cursor: pointer; transition: all .2s; font-family: inherit; background: transparent; color: var(--lp-muted); }
.lp-price-toggle button.active { background: #fff; color: var(--lp-dark); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.lp-save-badge { display: inline-block; background: rgba(13,171,168,.12); color: var(--lp-teal); font-size: 11px; padding: 2px 8px; border-radius: 99px; margin-inline-start: 6px; }
.lp-plans { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.lp-plan-card { background: #fff; border: 1.5px solid #E2E8F0; border-radius: 18px; padding: 28px 20px; text-align: center; position: relative; transition: all .3s; }
.lp-plan-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,.08); }
.lp-plan-card.popular { border-color: var(--lp-teal); box-shadow: 0 8px 32px rgba(13,171,168,.15); transform: scale(1.04); z-index: 2; }
.lp-plan-card.popular:hover { transform: scale(1.04) translateY(-4px); }
.lp-plan-badge { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, var(--lp-teal), var(--lp-teal-dark)); color: #fff; font-size: 12px; font-weight: 800; padding: 5px 18px; border-radius: 99px; white-space: nowrap; }
.lp-plan-card h3 { font-size: 18px; font-weight: 800; color: var(--lp-dark); margin: 8px 0 6px; }
.lp-plan-users { font-size: 13px; color: var(--lp-muted); font-weight: 600; margin-bottom: 16px; }
.lp-plan-price { margin-bottom: 16px; }
.lp-plan-amount { font-size: 32px; font-weight: 900; color: var(--lp-dark); letter-spacing: -1px; }
.lp-plan-contact { font-size: 22px; color: var(--lp-teal); }
.lp-plan-unit { display: block; font-size: 12px; color: var(--lp-muted); margin-top: 4px; }
.lp-plan-gift { display: inline-flex; align-items: center; gap: 6px; background: rgba(245,166,35,.1); color: #B8860B; font-size: 13px; font-weight: 700; padding: 6px 14px; border-radius: 99px; margin-bottom: 16px; }
.lp-plan-feats { list-style: none; padding: 0; margin: 0 0 20px; text-align: right; }
.lp-plan-feats li { font-size: 13px; color: var(--lp-text); padding: 6px 0; border-bottom: 1px solid #F1F5F9; display: flex; align-items: center; gap: 8px; }
.lp-plan-feats li::before { content: '✓'; color: var(--lp-teal); font-weight: 800; font-size: 14px; }

/* ── TESTIMONIALS ── */
.lp-testimonials { padding: 80px 0; background: #fff; }
.lp-testi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.lp-testi-card { background: var(--lp-bg); border: 1px solid #E2E8F0; border-radius: 18px; padding: 32px; position: relative; transition: all .3s; }
.lp-testi-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.06); transform: translateY(-2px); }
.lp-testi-quote { position: absolute; top: 20px; left: 24px; }
.lp-testi-text { font-size: 15px; line-height: 1.8; color: var(--lp-text); margin: 0 0 20px; font-style: italic; }
.lp-testi-author { display: flex; align-items: center; gap: 12px; }
.lp-testi-av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 16px; font-weight: 800; flex-shrink: 0; }
.lp-testi-name { font-size: 14px; font-weight: 800; color: var(--lp-dark); }
.lp-testi-role { font-size: 12.5px; color: var(--lp-muted); margin-top: 2px; }

/* ── FOOTER EXPANDED ── */
.lp-footer { padding: 48px 0 32px; background: var(--lp-dark); color: rgba(255,255,255,.7); }
.lp-footer-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; margin-bottom: 32px; }
.lp-footer-brand { display: flex; align-items: center; gap: 14px; }
.lp-footer-cols { display: flex; gap: 56px; }
.lp-footer-cols h4 { color: #fff; font-size: 14px; font-weight: 800; margin: 0 0 12px; }
.lp-footer-cols a { display: block; color: rgba(255,255,255,.5); text-decoration: none; font-size: 13.5px; padding: 4px 0; transition: color .2s; }
.lp-footer-cols a:hover { color: var(--lp-teal); }
.lp-footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding-top: 20px; }

/* ── ANIMATIONS ── */
[data-anim] { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.lp [data-anim].lp-visible { opacity: 1; transform: translateY(0); }
@keyframes lpFadeUp { to { opacity: 1; transform: translateY(0); } }

/* ── RESPONSIVE ── */
@media (max-width: 1100px) { .lp-plans { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) {
  .lp-hero-inner { grid-template-columns: 1fr; text-align: center; }
  .lp-hero h1 { font-size: 32px; }
  .lp-hero-sub { max-width: 100%; }
  .lp-hero-cta { justify-content: center; }
  .lp-hero-trust { justify-content: center; }
  .lp-hero-chips { justify-content: center; }
  .lp-hero-visual { display: none; }
  .lp-feat-list { grid-template-columns: repeat(2, 1fr); }
  .lp-feat-summary { grid-template-columns: repeat(4, 1fr); }
  .lp-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .lp-steps { flex-direction: column; align-items: center; }
  .lp-plans { grid-template-columns: repeat(2, 1fr); }
  .lp-testi-grid { grid-template-columns: 1fr; }
  .lp-footer-top { flex-direction: column; align-items: center; text-align: center; }
  .lp-footer-cols { justify-content: center; }
  .lp-nav-links { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.97); backdrop-filter: blur(12px); flex-direction: column; justify-content: center; align-items: center; gap: 24px; z-index: 200; }
  .lp-nav-links.open { display: flex; }
  .lp-nav-links a { font-size: 20px; }
  .lp-nav-actions { display: none; }
  .lp-hamburger { display: flex; }
}
@media (max-width: 600px) {
  .lp-hero h1 { font-size: 26px; }
  .lp-feat-list { grid-template-columns: 1fr; }
  .lp-feat-summary { grid-template-columns: repeat(2, 1fr); }
  .lp-plans { grid-template-columns: 1fr; }
  .lp-plan-card.popular { transform: none; }
  .lp-plan-card.popular:hover { transform: translateY(-4px); }
  .lp-stats-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .lp-stat-val { font-size: 36px; }
  .lp-section-head h2 { font-size: 24px; }
  .lp-slug-form { flex-direction: column; }
  .lp-cta-card { padding: 40px 24px; }
  .lp-feat-tabs { gap: 6px; }
  .lp-feat-tab { padding: 7px 14px; font-size: 12px; }
}

/* ============================================================
   DEMO REGISTRATION
   ============================================================ */
.demo-reg { min-height: 100vh; background: linear-gradient(160deg, #F0FDFA, #FFF7E6); display: flex; align-items: center; justify-content: center; padding: 40px 20px; font-family: 'Vazirmatn','Segoe UI',Tahoma,sans-serif; }
.demo-reg-card { background: #fff; border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.08); max-width: 740px; width: 100%; padding: 40px; }
.demo-reg-header { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.demo-progress { margin-bottom: 32px; }
.demo-progress-bar { height: 4px; background: linear-gradient(90deg, #0DABA8, #098E8B); border-radius: 99px; transition: width .4s ease; }
.demo-progress-steps { display: flex; justify-content: space-between; margin-top: 12px; }
.demo-progress-step { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: #94A3B8; font-weight: 600; }
.demo-progress-step.active { color: #0DABA8; }
.demo-progress-step.done { color: #30A46C; }
.demo-step-dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #E2E8F0; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: #fff; transition: all .3s; }
.demo-progress-step.active .demo-step-dot { border-color: #0DABA8; color: #0DABA8; background: rgba(13,171,168,.08); }
.demo-progress-step.done .demo-step-dot { border-color: #30A46C; background: #30A46C; color: #fff; font-size: 14px; }
.demo-error { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; border-radius: 10px; padding: 10px 16px; font-size: 13.5px; font-weight: 600; margin-bottom: 16px; }
.demo-step-content h3 { font-size: 18px; font-weight: 800; color: #1E293B; margin: 0 0 18px; }
.demo-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.demo-field { display: flex; flex-direction: column; gap: 5px; }
.demo-field label { font-size: 13px; font-weight: 700; color: #334155; }
.demo-field label span { color: #E5484D; }
.demo-field input, .demo-field select { padding: 10px 14px; border: 1.5px solid #CBD5E1; border-radius: 10px; font-size: 14px; font-family: inherit; outline: none; transition: border-color .2s; background: #fff; }
.demo-field input:focus, .demo-field select:focus { border-color: #0DABA8; }

/* OTP verification step — centered, branded */
.tutorial-embed-wrap iframe, .tutorial-embed-wrap embed, .tutorial-embed-wrap object {
  width: 100% !important; height: 100% !important; border: none; display: block; position: absolute; inset: 0;
}
.tutorial-embed-wrap > div { width: 100%; height: 100%; position: relative; }

.demo-otp-wrap { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 6px 0 4px; }
.demo-otp-icon { width: 58px; height: 58px; border-radius: 50%; background: rgba(13,171,168,.1); color: #0DABA8; display: grid; place-items: center; margin-bottom: 16px; }
.demo-otp-wrap h3 { margin-bottom: 8px; }
.demo-otp-desc { color: #64748B; font-size: 14px; margin: 0 0 26px; max-width: 360px; }
.demo-otp-body { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 280px; align-items: center; }
.demo-otp-body .demo-field { width: 100%; align-items: center; }
.demo-otp-body .demo-field label { text-align: center; }
.demo-field input.demo-otp-input { text-align: center; font-size: 26px; letter-spacing: 10px; font-weight: 800; padding: 12px 14px; }

.demo-btn { width: 100%; padding: 12px 20px; border-radius: 10px; font-weight: 700; font-size: 14.5px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: all .2s; font-family: inherit; }
.demo-btn.primary { background: #0DABA8; color: #fff; box-shadow: 0 3px 12px rgba(13,171,168,.3); }
.demo-btn.primary:hover:not(:disabled) { background: #098E8B; box-shadow: 0 5px 18px rgba(13,171,168,.4); transform: translateY(-1px); }
.demo-btn.primary:disabled { background: #CBD5E1; box-shadow: none; cursor: not-allowed; }
.demo-btn.ghost { background: transparent; color: #64748B; padding: 6px 16px; box-shadow: none; }
.demo-btn.ghost:hover:not(:disabled) { color: #0DABA8; }
.demo-btn.ghost:disabled { color: #CBD5E1; cursor: not-allowed; }

.demo-slug-preview { font-size: 12px; color: #0DABA8; font-weight: 600; margin-top: 2px; }
.demo-slug-preview code { background: rgba(13,171,168,.08); padding: 2px 8px; border-radius: 6px; direction: ltr; display: inline-block; }
.demo-plan-check { font-size: 20px; color: var(--pc); }

/* Free trial — a single distinct banner, separated from the priced plans */
.demo-plan-trial { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border: 2px dashed #99D8D6; border-radius: 14px; cursor: pointer; transition: all .2s; background: repeating-linear-gradient(135deg, rgba(13,171,168,.04) 0 10px, transparent 10px 20px); margin-bottom: 18px; }
.demo-plan-trial:hover { border-color: #0DABA8; }
.demo-plan-trial.selected { border-style: solid; border-color: #0DABA8; background: rgba(13,171,168,.06); }
.demo-plan-trial-badge { background: #0DABA8; color: #fff; font-size: 11px; font-weight: 800; padding: 5px 12px; border-radius: 99px; flex-shrink: 0; }
.demo-plan-trial-info { flex: 1; }
.demo-plan-trial-name { font-size: 15px; font-weight: 800; color: #1E293B; }
.demo-plan-trial-desc { font-size: 12.5px; color: #64748B; margin-top: 2px; }
.demo-plan-trial .demo-plan-check { color: #0DABA8; }

/* Priced plans — premium card grid, pick one to pay & activate immediately */
.demo-plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.demo-plan-card { position: relative; padding: 20px 16px; border: 2px solid #E2E8F0; border-radius: 16px; cursor: pointer; transition: all .2s; text-align: center; background: #fff; }
.demo-plan-card:hover { border-color: var(--pc); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.06); }
.demo-plan-card.selected { border-color: var(--pc); background: color-mix(in srgb, var(--pc) 6%, white); box-shadow: 0 8px 20px color-mix(in srgb, var(--pc) 20%, transparent); }
.demo-plan-card-badge { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--pc); color: #fff; font-size: 10.5px; font-weight: 800; padding: 3px 12px; border-radius: 99px; white-space: nowrap; }
.demo-plan-card-name { font-size: 15px; font-weight: 800; color: #1E293B; margin-top: 4px; }
.demo-plan-card-users { font-size: 12px; color: #64748B; margin-top: 4px; }
.demo-plan-card-gift { display: inline-flex; align-items: center; gap: 4px; background: rgba(245,166,35,.12); color: #B8860B; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 99px; margin-top: 6px; }
.demo-plan-card-price { font-size: 16px; font-weight: 800; color: var(--pc); margin-top: 10px; }
.demo-plan-card-price span { font-size: 10.5px; font-weight: 600; color: #94A3B8; display: block; margin-top: 2px; }
.demo-plan-card-cta { margin-top: 12px; font-size: 12.5px; font-weight: 700; color: var(--pc); padding: 7px; border-radius: 8px; background: color-mix(in srgb, var(--pc) 10%, transparent); }
.demo-plan-card-phone { font-size: 15px; font-weight: 800; color: var(--pc); margin-top: 4px; }
.demo-plan-card-custom { --pc: #94A3B8; }
.demo-plan-card-custom .demo-plan-card-price { font-size: 14px; }
.demo-priorities { display: flex; flex-wrap: wrap; gap: 8px; }
.demo-prio { padding: 8px 16px; border-radius: 99px; border: 1.5px solid #E2E8F0; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .2s; font-family: inherit; background: #fff; color: #334155; }
.demo-prio:hover { border-color: #0DABA8; }
.demo-prio.active { background: #0DABA8; color: #fff; border-color: #0DABA8; }
.demo-add-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.demo-mode-btn { background: #FAFBFC; border: 2px dashed #CBD5E1; border-radius: 16px; padding: 32px 24px; text-align: center; cursor: pointer; transition: all .2s; font-family: inherit; }
.demo-mode-btn:hover { border-color: #0DABA8; background: rgba(13,171,168,.03); }
.demo-mode-icon { color: #0DABA8; margin-bottom: 10px; }
.demo-mode-title { font-size: 16px; font-weight: 800; color: #1E293B; margin-bottom: 4px; }
.demo-mode-desc { font-size: 13px; color: #64748B; }
.demo-excel-section { margin-top: 16px; }
.demo-excel-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.demo-back-mode { background: none; border: none; color: #64748B; font-size: 13px; cursor: pointer; font-family: inherit; margin-top: 8px; font-weight: 600; }
.demo-back-mode:hover { color: #0DABA8; }
.demo-manual-section { margin-top: 16px; }
.demo-add-row { display: flex; gap: 8px; flex-wrap: wrap; }
.demo-add-row input { flex: 1; min-width: 120px; padding: 9px 12px; border: 1.5px solid #CBD5E1; border-radius: 8px; font-size: 13px; font-family: inherit; outline: none; }
.demo-add-row input:focus { border-color: #0DABA8; }
.demo-personnel-list { margin-top: 20px; border: 1px solid #E2E8F0; border-radius: 12px; overflow: hidden; }
.demo-personnel-head { background: #F8FAFC; padding: 10px 16px; font-size: 13px; font-weight: 700; color: #334155; border-bottom: 1px solid #E2E8F0; }
.demo-person-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid #F1F5F9; }
.demo-person-row:last-child { border-bottom: none; }
.demo-person-av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 800; flex-shrink: 0; }
.demo-person-info { flex: 1; font-size: 14px; font-weight: 600; color: #1E293B; }
.demo-person-del { background: none; border: none; color: #94A3B8; cursor: pointer; font-size: 16px; padding: 4px 8px; border-radius: 6px; }
.demo-person-del:hover { color: #E5484D; background: #FEF2F2; }
.demo-confirm-summary { background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 14px; padding: 20px; margin-bottom: 16px; }
.demo-confirm-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #F1F5F9; font-size: 14px; }
.demo-confirm-row:last-child { border-bottom: none; }
.demo-confirm-row span { color: #64748B; }
.demo-confirm-row code { background: rgba(13,171,168,.08); padding: 2px 10px; border-radius: 6px; direction: ltr; color: #0DABA8; font-weight: 600; }
.demo-confirm-note { background: rgba(13,171,168,.06); border: 1px solid rgba(13,171,168,.15); border-radius: 10px; padding: 14px 18px; font-size: 13.5px; color: #0DABA8; font-weight: 600; }
.demo-success { text-align: center; }
.demo-success-icon { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg, #30A46C, #22c55e); color: #fff; font-size: 36px; display: grid; place-items: center; margin: 0 auto 20px; box-shadow: 0 8px 24px rgba(48,164,108,.3); }
.demo-success h2 { font-size: 24px; font-weight: 900; color: #1E293B; margin: 0 0 20px; }
.demo-success-box { background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 14px; padding: 20px; text-align: right; margin-bottom: 20px; }
.demo-success-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #F1F5F9; font-size: 14px; }
.demo-success-row:last-child { border-bottom: none; }
.demo-success-row span { color: #64748B; }
.demo-success-row a { color: #0DABA8; font-weight: 600; text-decoration: none; direction: ltr; }
.demo-success-actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }
.demo-personnel-details { margin-top: 16px; text-align: right; }
.demo-personnel-details summary { cursor: pointer; font-size: 14px; font-weight: 700; color: #0DABA8; }
.demo-tutorials { margin-top: 32px; text-align: right; }
.demo-tutorials h3 { font-size: 20px; font-weight: 800; color: #1E293B; margin: 0 0 16px; }
.demo-tutorial-card { background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 14px; padding: 20px; margin-bottom: 16px; }
.demo-tutorial-video { margin-bottom: 12px; border-radius: 10px; overflow: hidden; }
.demo-tutorial-video iframe { width: 100%; aspect-ratio: 16/9; border: none; border-radius: 10px; }
.demo-tutorial-card h4 { font-size: 16px; font-weight: 800; margin: 0 0 6px; color: #1E293B; }
.demo-tutorial-card p { font-size: 13.5px; color: #64748B; line-height: 1.7; margin: 0; }
.demo-nav-btns { display: flex; gap: 12px; margin-top: 28px; padding-top: 20px; border-top: 1px solid #F1F5F9; }
@media (max-width: 600px) {
  .demo-reg-card { padding: 24px 18px; }
  .demo-form-grid { grid-template-columns: 1fr; }
  .demo-plan-cards { grid-template-columns: repeat(2, 1fr); }
  .demo-plan-trial { flex-wrap: wrap; }
  .demo-add-mode { grid-template-columns: 1fr; }
  .demo-add-row { flex-direction: column; }
  .demo-progress-steps { gap: 2px; }
  .demo-progress-step span { display: none; }
}

/* ── Preloader — shown instantly on every page load, dismissed once the app knows what to render ── */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg, #f4f4f8);
  transition: opacity .35s ease;
}
#preloader.preloader-hide { opacity: 0; pointer-events: none; }
.preloader-inner { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.preloader-logo {
  width: 64px; height: 64px; border-radius: 18px;
  box-shadow: var(--shadow-lg, 0 18px 48px rgba(28,28,46,.14));
  animation: preloader-breathe 2.4s ease-in-out infinite;
}
.preloader-tasks { display: flex; gap: 10px; }
.preloader-check {
  width: 20px; height: 20px; border-radius: 7px;
  border: 2px solid var(--accent, #5B5BD6);
  position: relative;
  animation: preloader-fill 2.4s ease-in-out infinite;
}
.preloader-check::after {
  content: '';
  position: absolute; right: 5px; top: 1px;
  width: 6px; height: 10px;
  border-right: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(45deg) scale(0);
  transform-origin: center;
  animation: preloader-tick 2.4s ease-in-out infinite;
}
.preloader-check:nth-child(2) { animation-delay: .28s; }
.preloader-check:nth-child(2)::after { animation-delay: .28s; }
.preloader-check:nth-child(3) { animation-delay: .56s; }
.preloader-check:nth-child(3)::after { animation-delay: .56s; }
.preloader-text { font-size: 13.5px; color: var(--ink-3, #8a8aa3); }
@keyframes preloader-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@keyframes preloader-fill {
  0%, 15% { background: transparent; }
  30%, 78% { background: var(--accent, #5B5BD6); }
  93%, 100% { background: transparent; }
}
@keyframes preloader-tick {
  0%, 15% { opacity: 0; transform: rotate(45deg) scale(0); }
  30%, 78% { opacity: 1; transform: rotate(45deg) scale(1); }
  93%, 100% { opacity: 0; transform: rotate(45deg) scale(0); }
}
