/* ============================================================
   GOFTAR — Application stylesheet
   RTL / Persian-first / Dark & Light / Responsive
   ============================================================ */

:root {
  --font: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;

  --primary: #0B8A7C;
  --primary-600: #0A7569;
  --primary-700: #08685E;
  --primary-soft: #E4F5F1;
  --on-primary: #ffffff;

  --bg: #f3f5fa;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --border: #e3e8f0;
  --border-2: #d3dae6;

  --text: #14202f;
  --muted: #5d6b82;
  --faint: #8b98ad;

  --danger: #d92632;
  --danger-soft: #fdebec;
  --warning: #b7791f;
  --warning-soft: #fdf3e0;
  --success: #128a4b;
  --success-soft: #e6f6ee;
  --info: #1f6fb2;
  --info-soft: #e7f1fa;

  --radius: 14px;
  --radius-lg: 18px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 6px 24px -8px rgba(16, 24, 40, .12), 0 2px 6px -2px rgba(16, 24, 40, .06);
  --shadow-lg: 0 24px 60px -12px rgba(10, 20, 40, .25);

  --sidebar-bg: #0d1a26;
  --sidebar-bg2: #10232f;
  --sidebar-text: #9fb3c6;
  --sidebar-active: #ffffff;

  --topbar-h: 64px;
  --sidebar-w: 256px;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

[data-theme="dark"] {
  --primary: #19b3a0;
  --primary-600: #16a593;
  --primary-700: #129583;
  --primary-soft: rgba(25, 179, 160, .14);
  --on-primary: #04110f;

  --bg: #0a111c;
  --surface: #111c2b;
  --surface-2: #162235;
  --border: #1e2c40;
  --border-2: #2a3a52;

  --text: #e7edf6;
  --muted: #9fb0c6;
  --faint: #6b7c93;

  --danger: #ff5c68;
  --danger-soft: rgba(255, 92, 104, .14);
  --warning: #f5b84d;
  --warning-soft: rgba(245, 184, 77, .15);
  --success: #3fd487;
  --success-soft: rgba(63, 212, 135, .14);
  --info: #6cb2ef;
  --info-soft: rgba(108, 178, 239, .15);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 8px 30px -6px rgba(0, 0, 0, .5);
  --shadow-lg: 0 30px 70px -10px rgba(0, 0, 0, .6);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; vertical-align: middle; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-600); }
h1, h2, h3, h4, h5 { line-height: 1.5; margin: 0 0 .5em; font-weight: 700; }
p { margin: 0 0 1em; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
ul { margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.is-hidden { display: none !important; }
.text-center { text-align: center; }
.flex { display: flex; align-items: center; gap: .5rem; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.flex-wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }

/* ============================================================
   App shell (sidebar + main)
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(8, 15, 26, .5);
  opacity: 0; pointer-events: none; transition: opacity .25s var(--ease); z-index: 60;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, var(--sidebar-bg2), var(--sidebar-bg) 30%);
  color: var(--sidebar-text);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  z-index: 70;
}
.sidebar__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 16px 12px;
}
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; }
.brand:hover { color: #fff; }
.brand__logo {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, #17c3ab, #0B8A7C);
  color: #fff; font-size: 18px;
  box-shadow: 0 6px 16px -6px rgba(23, 195, 171, .7);
}
.brand__name { font-size: 20px; font-weight: 700; letter-spacing: .3px; }
.sidebar__close { display: none; }

.sidebar__subcard {
  margin: 6px 12px 10px; padding: 12px; border-radius: var(--radius);
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07);
}
.sidebar__subcard-top { display: flex; flex-direction: column; gap: 2px; }

.sidebar__nav { flex: 1; overflow-y: auto; padding: 6px 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: .7rem; padding: 10px 12px;
  border-radius: 10px; color: var(--sidebar-text); font-size: 13.5px;
  border-inline-start: 3px solid transparent; transition: background .18s var(--ease), color .18s;
  position: relative;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #e6eef7; }
.nav-item__icon { width: 20px; text-align: center; font-size: 14px; opacity: .85; }
.nav-item.is-active {
  background: rgba(25, 179, 160, .16); color: var(--sidebar-active);
  border-inline-start-color: #17c3ab;
}
.nav-item.is-active .nav-item__icon { opacity: 1; }
.nav-item--danger { color: #ff8f96; }
.nav-item--danger:hover { background: rgba(255, 92, 104, .1); color: #ffb3b8; }
.nav-item__badge {
  margin-inline-start: auto; background: var(--danger); color: #fff;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 20px;
  display: grid; place-items: center; font-size: 11px; line-height: 1;
}
.sidebar__foot { padding: 10px 12px 16px; border-top: 1px solid rgba(255, 255, 255, .07); display: flex; flex-direction: column; gap: 2px; }

/* ---------- Main ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .75rem; padding: 0 22px;
  position: sticky; top: 0; z-index: 40;
}
.topbar__burger { display: none; }
.topbar__title h1 { font-size: 16px; margin: 0; font-weight: 700; }
.topbar__actions { margin-inline-start: auto; display: flex; align-items: center; gap: .4rem; position: relative; }

.main__content { padding: 24px; width: 100%; max-width: 1280px; margin: 0 auto; flex: 1; }
.app-footer {
  padding: 14px 24px; color: var(--faint); font-size: 12px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--surface);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: 1px solid transparent; border-radius: 11px;
  padding: 9px 18px; font-size: 13.5px; font-weight: 500; line-height: 1.6;
  transition: all .16s var(--ease); white-space: nowrap; user-select: none;
  text-decoration: none;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--primary:hover { background: var(--primary-600); color: var(--on-primary); }
.btn--soft { background: var(--primary-soft); color: var(--primary-700); }
.btn--soft:hover { background: color-mix(in srgb, var(--primary-soft) 60%, var(--primary)); color: var(--on-primary); }
.btn--outline { border-color: var(--border-2); background: var(--surface); color: var(--text); }
.btn--outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn--ghost { background: transparent; color: var(--muted); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { filter: brightness(.94); color: #fff; }
.btn--success { background: var(--success); color: #fff; }
.btn--success:hover { filter: brightness(.95); color: #fff; }
.btn--warning { background: var(--warning-soft); color: var(--warning); }
.btn--danger-soft { background: var(--danger-soft); color: var(--danger); }
.btn--warning-soft { background: var(--warning-soft); color: var(--warning); }
.btn--sm { padding: 5px 12px; font-size: 12.5px; border-radius: 9px; }
.btn--lg { padding: 12px 26px; font-size: 15px; border-radius: 13px; }
.btn--block { display: flex; width: 100%; }
.btn.is-copied { background: var(--success); color: #fff; border-color: transparent; }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border-radius: 10px; border: none; background: transparent; color: var(--muted);
  font-size: 15px; transition: all .16s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ============================================================
   Badges & status dots
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: 2px 10px; border-radius: 30px; font-size: 11.5px; font-weight: 500;
  line-height: 1.9; border: 1px solid transparent; white-space: nowrap;
}
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--info { background: var(--info-soft); color: var(--info); }
.badge--muted { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.badge--primary { background: var(--primary-soft); color: var(--primary-700); }
.badge-dot {
  position: absolute; top: 5px; inset-inline-end: 6px;
  min-width: 16px; height: 16px; border-radius: 20px; background: var(--danger);
  color: #fff; font-size: 9.5px; display: grid; place-items: center; padding: 0 4px;
  border: 2px solid var(--surface); line-height: 1;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.status-dot--online { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.status-dot--offline { background: #9aa7b8; }
.status-dot--away { background: #f59e0b; }

/* ============================================================
   Cards / layout primitives
   ============================================================ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.card__head {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.card__head h2, .card__head h3 { margin: 0; font-size: 14.5px; }
.card__body { padding: 20px; }
.card__body--flush { padding: 0; }

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-grid { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 22px; }

.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 18px; box-shadow: var(--shadow-sm);
  display: flex; align-items: flex-start; gap: 14px;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card__icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  font-size: 17px; flex: none;
}
.stat-card__icon--teal { background: var(--primary-soft); color: var(--primary-700); }
.stat-card__icon--blue { background: var(--info-soft); color: var(--info); }
.stat-card__icon--amber { background: var(--warning-soft); color: var(--warning); }
.stat-card__icon--red { background: var(--danger-soft); color: var(--danger); }
.stat-card__icon--green { background: var(--success-soft); color: var(--success); }
.stat-card__value { font-size: 21px; font-weight: 700; line-height: 1.4; }
.stat-card__label { color: var(--muted); font-size: 12px; }
.stat-card__hint { font-size: 11px; color: var(--faint); }

/* Page header row */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: 18px; margin: 0; }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

/* ============================================================
   Forms
   ============================================================ */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.field label .req { color: var(--danger); }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 14px; font-size: 13.5px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-2); border-radius: 11px;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
textarea.input { resize: vertical; min-height: 92px; line-height: 1.9; }
select.input { cursor: pointer; }
.input--invalid { border-color: var(--danger); }
.field-err { color: var(--danger); font-size: 11.5px; margin-top: 4px; display: block; }
.field-hint { color: var(--faint); font-size: 11.5px; margin-top: 4px; display: block; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }

.check { display: flex; align-items: flex-start; gap: .6rem; cursor: pointer; font-size: 13px; }
.check input { width: 17px; height: 17px; margin-top: 3px; accent-color: var(--primary); flex: none; cursor: pointer; }

.switch { position: relative; display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  width: 42px; height: 24px; border-radius: 30px; background: var(--border-2);
  transition: background .2s; position: relative; flex: none;
}
.switch__track::after {
  content: ''; position: absolute; top: 3px; inset-inline-start: 3px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s var(--ease);
}
.switch input:checked + .switch__track { background: var(--primary); }
.switch input:checked + .switch__track::after { transform: translateX(-18px); }
[dir="rtl"] .switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--primary); outline-offset: 2px; }

.input-with-icon { position: relative; }
.input-with-icon .input { padding-inline-start: 40px; }
.input-with-icon > i { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 13px; }

/* color input style */
input[type="color"] { -webkit-appearance: none; appearance: none; border: 1px solid var(--border-2); border-radius: 10px; padding: 3px; background: var(--surface); width: 54px; height: 40px; cursor: pointer; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
input[type="color"]::-webkit-color-swatch { border-radius: 7px; border: none; }

/* ============================================================
   Tables
   ============================================================ */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: start; font-weight: 600; color: var(--muted); font-size: 11.5px;
  padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2);
  white-space: nowrap;
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .14s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .row-actions { display: flex; gap: 6px; white-space: nowrap; }
.table--clickable tbody tr { cursor: pointer; }
.cell-main { font-weight: 600; }
.cell-sub { font-size: 11.5px; color: var(--faint); margin-top: 1px; }
.cell-strong { font-weight: 600; white-space: nowrap; }

/* ============================================================
   Alerts / toasts / empty / skeleton
   ============================================================ */
.alert {
  display: flex; align-items: flex-start; gap: .7rem; padding: 12px 16px;
  border-radius: 12px; font-size: 13px; margin-bottom: 16px; line-height: 1.9;
}
.alert i { margin-top: 4px; }
.alert--banner { align-items: center; }
.alert--banner .btn { margin-inline-start: auto; }
.alert--success { background: var(--success-soft); color: var(--success); }
.alert--warning { background: var(--warning-soft); color: var(--warning); }
.alert--danger, .alert--error { background: var(--danger-soft); color: var(--danger); }
.alert--info { background: var(--info-soft); color: var(--info); }

.toast {
  position: fixed; bottom: 22px; inset-inline-end: 22px; z-index: 200;
  display: flex; align-items: center; gap: .7rem;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  border-radius: 13px; padding: 13px 16px; font-size: 13px; max-width: 380px;
  animation: toast-in .25s var(--ease);
}
.toast--success { border-inline-start: 4px solid var(--success); }
.toast--error { border-inline-start: 4px solid var(--danger); }
.toast--warning { border-inline-start: 4px solid var(--warning); }
.toast--info { border-inline-start: 4px solid var(--info); }
.toast__close { border: none; background: transparent; color: var(--faint); margin-inline-start: auto; padding: 2px 6px; border-radius: 6px; }
.toast__close:hover { background: var(--surface-2); color: var(--text); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.empty {
  text-align: center; padding: 46px 20px; color: var(--muted);
}
.empty__icon {
  width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 50%;
  background: var(--surface-2); border: 1px dashed var(--border-2);
  display: grid; place-items: center; font-size: 26px; color: var(--faint);
}
.empty h3 { margin: 0 0 4px; font-size: 15px; color: var(--text); }
.empty p { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.empty--sm { padding: 18px 10px; font-size: 12.5px; }
.empty--sm .empty__icon { width: 42px; height: 42px; font-size: 16px; margin-bottom: 8px; }

.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skeleton-row { height: 14px; margin-bottom: 10px; border-radius: 6px; }
.skeleton-card { height: 110px; border-radius: var(--radius-lg); }

/* ============================================================
   Dropdown & user chip
   ============================================================ */
.dropdown { position: relative; }
.dropdown__menu {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 80;
  min-width: 210px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 13px; box-shadow: var(--shadow-lg); padding: 7px;
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity .16s var(--ease), transform .16s var(--ease);
}
.dropdown.is-open .dropdown__menu { opacity: 1; transform: none; pointer-events: auto; }
.dropdown__menu a, .dropdown__menu button.dropdown-item {
  display: flex; align-items: center; gap: .6rem; width: 100%;
  padding: 9px 11px; border-radius: 9px; color: var(--text);
  font-size: 13px; border: none; background: transparent; text-align: start;
}
.dropdown__menu a:hover, .dropdown__menu button.dropdown-item:hover { background: var(--surface-2); color: var(--primary); }
.dropdown__menu hr { border: none; border-top: 1px solid var(--border); margin: 6px 0; }
.dropdown__head { padding: 8px 11px 6px; font-weight: 700; font-size: 12px; color: var(--muted); }
.dropdown__foot { padding: 8px 11px; font-size: 12px; color: var(--primary); border-top: 1px solid var(--border); border-radius: 0 0 9px 9px !important; }
.dropdown__menu--notif { width: 330px; }

.userchip { display: flex; align-items: center; gap: .55rem; border: none; background: transparent; padding: 4px 6px; border-radius: 12px; color: var(--text); }
.userchip:hover { background: var(--surface-2); }
.userchip__avatar {
  width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #17c3ab, #0B8A7C);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.userchip__name { font-size: 13px; font-weight: 500; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userchip__caret { color: var(--faint); font-size: 10px; }

.notif-mini { max-height: 320px; overflow-y: auto; }
.notif-mini__item { display: flex; gap: .7rem; padding: 10px 11px; border-radius: 10px; }
.notif-mini__item:hover { background: var(--surface-2); }
.notif-mini__item.is-unread { background: var(--primary-soft); }
.notif-mini__icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 13px; flex: none; margin-top: 2px; }
.notif-mini__icon--success { background: var(--success-soft); color: var(--success); }
.notif-mini__icon--warning { background: var(--warning-soft); color: var(--warning); }
.notif-mini__icon--error, .notif-mini__icon--danger { background: var(--danger-soft); color: var(--danger); }
.notif-mini__icon--info { background: var(--info-soft); color: var(--info); }
.notif-mini__icon--order { background: var(--warning-soft); color: var(--warning); }
.notif-mini__icon--subscription { background: var(--primary-soft); color: var(--primary-700); }
.notif-mini__title { font-size: 12.5px; font-weight: 500; line-height: 1.7; }
.notif-mini__time { font-size: 11px; color: var(--faint); }

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 150; display: grid; place-items: center;
  background: rgba(8, 14, 24, .55); padding: 18px; overflow-y: auto;
  animation: fade-in .18s;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  width: 100%; max-width: 460px; max-height: calc(100vh - 40px); overflow-y: auto;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  animation: modal-in .22s var(--ease);
}
.modal-card--lg { max-width: 680px; }
.modal-card--xl { max-width: 880px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-card__head {
  display: flex; align-items: center; justify-content: space-between; padding: 17px 20px;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; z-index: 2;
}
.modal-card__head h3 { margin: 0; font-size: 15px; }
.modal-card__body { padding: 20px; }
.modal-card__foot { padding: 15px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-start; gap: .6rem; }
body.modal-open { overflow: hidden; }

/* ============================================================
   Segmented filter (filters)
   ============================================================ */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a {
  padding: 5px 13px; border-radius: 8px; font-size: 12.5px; color: var(--muted);
  display: inline-flex; align-items: center; gap: .4rem; transition: all .15s;
}
.seg a:hover { color: var(--text); }
.seg a.is-active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); font-weight: 600; }
.seg .seg__count { font-size: 10.5px; background: var(--border); color: var(--muted); border-radius: 20px; padding: 0 6px; line-height: 1.7; }
.seg a.is-active .seg__count { background: var(--primary-soft); color: var(--primary-700); }

/* ============================================================
   Conversations (list + thread)
   ============================================================ */
.conv-list { display: flex; flex-direction: column; }
.conv-item {
  display: flex; align-items: flex-start; gap: .8rem; padding: 13px 16px;
  border-bottom: 1px solid var(--border); transition: background .14s; position: relative;
  color: var(--text); width: 100%;
}
.conv-item:last-child { border-bottom: none; }
.conv-item:hover { background: var(--surface-2); }
.conv-item.is-unread .conv-item__title { font-weight: 700; }
.conv-item__avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: var(--primary-soft); color: var(--primary-700);
  display: grid; place-items: center; font-weight: 700; font-size: 14px; position: relative;
}
.conv-item.is-unread .conv-item__avatar { background: var(--primary); color: #fff; }
.conv-item__body { flex: 1; min-width: 0; }
.conv-item__title { font-size: 13px; font-weight: 500; display: flex; gap: .5rem; align-items: baseline; }
.conv-item__title .visitor-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-item__title .site-name { color: var(--faint); font-size: 11px; }
.conv-item__preview {
  font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; display: flex; align-items: center; gap: .35rem;
}
.conv-item__meta { text-align: start; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.conv-item__time { font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.conv-item__count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 20px; background: var(--danger);
  color: #fff; font-size: 10px; display: grid; place-items: center; line-height: 1;
}

/* thread */
.thread-shell { display: flex; gap: 18px; align-items: stretch; }
.thread-side { width: 330px; flex: none; }
.thread-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-box {
  display: flex; flex-direction: column; height: calc(100vh - 240px); min-height: 420px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
}
.chat-box--list { height: calc(100vh - 200px); min-height: 420px; overflow-y: auto; }
.chat-head {
  display: flex; align-items: center; gap: .8rem; padding: 12px 16px;
  border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.chat-head__info { flex: 1; min-width: 0; }
.chat-head__name { font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: .5rem; }
.chat-head__sub { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: .35rem; }
.chat-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.chat-day {
  text-align: center; font-size: 11px; color: var(--faint); margin: 6px 0;
  background: var(--surface); border-radius: 20px; padding: 2px 12px; align-self: center; border: 1px solid var(--border);
}
.msg { max-width: 76%; display: flex; flex-direction: column; gap: 3px; }
.msg--visitor { align-self: flex-start; align-items: flex-start; }
.msg--operator { align-self: flex-end; align-items: flex-end; }
.msg__bubble {
  padding: 9px 13px; border-radius: 15px; font-size: 13px; line-height: 1.9;
  word-break: break-word; white-space: pre-wrap; position: relative;
}
.msg--visitor .msg__bubble { background: var(--surface); border: 1px solid var(--border); border-start-start-radius: 4px; }
.msg--operator .msg__bubble { background: var(--primary); color: var(--on-primary); border-end-end-radius: 4px; }
[data-theme="dark"] .msg--visitor .msg__bubble { background: var(--surface-2); }
.msg__meta { font-size: 10px; color: var(--faint); display: flex; gap: .4rem; align-items: center; }
.msg--visitor .msg__meta { padding-inline-start: 6px; }
.msg--operator .msg__meta { padding-inline-end: 6px; }
.msg--operator .msg__meta .is-read { color: var(--success); }
.chat-input {
  border-top: 1px solid var(--border); padding: 12px 14px; background: var(--surface);
  display: flex; gap: .6rem; align-items: flex-end;
}
.chat-input textarea {
  flex: 1; border: 1px solid var(--border-2); background: var(--surface); color: var(--text);
  border-radius: 12px; padding: 10px 14px; resize: none; font-size: 13.5px; line-height: 1.7;
  min-height: 42px; max-height: 120px;
}
.chat-input textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.chat-send { width: 44px; height: 44px; border-radius: 12px; border: none; background: var(--primary); color: #fff; font-size: 16px; display: grid; place-items: center; }
.chat-send:hover { background: var(--primary-600); }
.typing-hint { font-size: 11px; color: var(--faint); padding: 4px 18px 0; }

/* ============================================================
   Visitors online/offline chips, stats numbers
   ============================================================ */
.online-chip { display: inline-flex; align-items: center; gap: .4rem; font-size: 12px; }

/* ============================================================
   Bar chart (CSS based)
   ============================================================ */
.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 220px; padding: 14px 6px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bar-col__value { font-size: 10.5px; color: var(--faint); }
.bar-col__bar { width: 100%; max-width: 44px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #19b3a0, #0B8A7C); min-height: 4px; transition: height .5s var(--ease); position: relative; }
.bar-col__bar--2 { background: linear-gradient(180deg, #f0b558, #d9942a); }
.bar-col__label { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.chart-legend { display: flex; gap: 1.2rem; justify-content: center; font-size: 12px; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ============================================================
   Pricing / plans
   ============================================================ */
.plan-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface);
  padding: 24px; display: flex; flex-direction: column; gap: 8px; position: relative;
  transition: transform .18s var(--ease), box-shadow .18s;
}
.plan-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.plan-card.is-current { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), var(--shadow); }
.plan-card.is-featured { border-color: var(--primary); }
.plan-card__tag { position: absolute; top: -11px; inset-inline-end: 18px; background: var(--primary); color: #fff; font-size: 11px; padding: 2px 12px; border-radius: 20px; }
.plan-card__name { font-size: 16px; font-weight: 700; }
.plan-card__price { font-size: 24px; font-weight: 700; color: var(--text); margin: 6px 0 0; }
.plan-card__price small { font-size: 12px; color: var(--muted); font-weight: 400; }
.plan-card__desc { font-size: 12.5px; color: var(--muted); }
.plan-card ul { list-style: none; margin: 10px 0 4px; display: grid; gap: 8px; }
.plan-card li { font-size: 12.5px; display: flex; gap: .55rem; align-items: flex-start; color: var(--text); }
.plan-card li i { color: var(--success); margin-top: 5px; font-size: 11px; }
.plan-card__foot { margin-top: auto; padding-top: 14px; }

/* ============================================================
   Widget settings preview
   ============================================================ */
.settings-layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 22px; align-items: start; }
.preview-stage {
  position: sticky; top: calc(var(--topbar-h) + 20px);
  background:
    radial-gradient(circle at 20% 15%, rgba(25, 179, 160, .12), transparent 45%),
    radial-gradient(circle at 80% 85%, rgba(15, 120, 190, .1), transparent 45%),
    var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  min-height: 460px; display: grid; place-items: center; overflow: hidden;
}
.preview-canvas { position: relative; width: 100%; height: 460px; }
.wp { position: absolute; font-family: var(--font); direction: rtl; }
.wp__fab {
  bottom: 18px; inset-inline-end: 18px; position: absolute; width: 56px; height: 56px;
  border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 22px;
  box-shadow: 0 10px 26px -6px rgba(0, 0, 0, .35); cursor: pointer; border: none;
  transition: transform .2s var(--ease);
}
.wp__fab:hover { transform: scale(1.06); }
.wp__win {
  bottom: 86px; inset-inline-end: 18px; position: absolute; width: 300px;
  background: var(--surface); border-radius: 16px; box-shadow: 0 24px 60px -10px rgba(10, 20, 40, .35);
  overflow: hidden; border: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.wp__head { padding: 12px 14px; color: #fff; display: flex; align-items: center; gap: .6rem; }
.wp__head i { font-size: 17px; }
.wp__head-title { font-weight: 700; font-size: 13px; }
.wp__head-sub { font-size: 10.5px; opacity: .85; }
.wp__body { padding: 12px; display: grid; gap: 8px; background: var(--surface-2); min-height: 120px; }
.wp__bubble { padding: 7px 11px; border-radius: 13px; font-size: 11.5px; line-height: 1.8; max-width: 85%; }
.wp__bubble--in { background: var(--surface); border: 1px solid var(--border); justify-self: start; }
.wp__bubble--out { justify-self: end; }
.wp__input { display: flex; gap: 6px; padding: 10px; background: var(--surface); border-top: 1px solid var(--border); }
.wp__input-fake { flex: 1; border: 1px solid var(--border-2); border-radius: 20px; height: 32px; padding: 0 12px; font-size: 11px; color: var(--faint); display: flex; align-items: center; }
.wp__input-btn { width: 32px; height: 32px; border-radius: 50%; border: none; color: #fff; font-size: 12px; display: grid; place-items: center; }
.wp__power { text-align: center; font-size: 9.5px; padding: 4px; color: var(--faint); background: var(--surface); }

/* ============================================================
   Install / code blocks & steps
   ============================================================ */
.codebox {
  position: relative; background: #0d1a26; color: #d6e4f2; border-radius: 13px;
  padding: 16px 16px 16px 46px; direction: ltr; text-align: left; overflow-x: auto;
  font-family: Consolas, 'Courier New', monospace; font-size: 12.5px; line-height: 1.8;
}
.codebox__copy { position: absolute; top: 10px; inset-inline-start: 10px; direction: rtl; }
.steps { display: grid; gap: 0; counter-reset: step; list-style: none; }
.steps li { display: flex; gap: 1rem; padding-bottom: 22px; position: relative; }
.steps li::before {
  content: ''; position: absolute; top: 34px; bottom: 2px; inset-inline-start: 16px;
  width: 2px; background: var(--border-2);
}
.steps li:last-child::before { display: none; }
.steps__num {
  counter-increment: step; width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--primary-soft); color: var(--primary-700); font-weight: 700;
  display: grid; place-items: center; font-size: 13px; z-index: 1;
}
.steps__num::before { content: counter(step); }
.steps__body { padding-top: 2px; }
.steps__body h4 { margin: 0 0 2px; font-size: 13.5px; }
.steps__body p { margin: 0; color: var(--muted); font-size: 12.5px; }

/* ============================================================
   Notifications page list
   ============================================================ */
.notif-list { display: flex; flex-direction: column; }
.notif-item { display: flex; gap: 1rem; padding: 15px 18px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.notif-item:last-child { border-bottom: none; }
.notif-item.is-unread { background: color-mix(in srgb, var(--primary-soft) 45%, var(--surface)); }
.notif-item__icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 15px; flex: none; }
.notif-item__title { font-weight: 600; font-size: 13.5px; }
.notif-item__msg { font-size: 12.5px; color: var(--muted); }
.notif-item__time { font-size: 11px; color: var(--faint); margin-top: 4px; }

/* ============================================================
   Misc: key/value, avatar stack, plan status, wizard pages
   ============================================================ */
.kv { display: flex; justify-content: space-between; gap: 1rem; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.kv:last-child { border-bottom: none; }
.kv__k { color: var(--muted); }
.kv__v { font-weight: 600; text-align: end; word-break: break-word; }
.avatar-lg { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg, #17c3ab, #0B8A7C); color: #fff; display: grid; place-items: center; font-size: 28px; font-weight: 700; }

.divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.site-badge { display: inline-flex; align-items: center; gap: .5rem; }
.site-badge .site-favicon { width: 22px; height: 22px; border-radius: 6px; background: var(--primary-soft); color: var(--primary-700); display: grid; place-items: center; font-size: 11px; }

/* Payments card visual */
.bankcard {
  position: relative; border-radius: 18px; padding: 22px; color: #fff; overflow: hidden;
  background: linear-gradient(135deg, #123a4a, #0B8A7C 130%);
  min-height: 178px; display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: var(--shadow);
}
.bankcard::before {
  content: ''; position: absolute; top: -60px; inset-inline-end: -40px; width: 190px; height: 190px;
  border-radius: 50%; background: rgba(255, 255, 255, .08);
}
.bankcard::after {
  content: ''; position: absolute; bottom: -70px; inset-inline-start: -30px; width: 150px; height: 150px;
  border-radius: 50%; background: rgba(255, 255, 255, .05);
}
.bankcard__top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.bankcard__brand { font-weight: 700; letter-spacing: .5px; }
.bankcard__chip { font-size: 22px; opacity: .9; }
.bankcard__number { font-size: 19px; letter-spacing: 2px; font-family: Consolas, monospace; direction: ltr; text-align: center; position: relative; z-index: 1; }
.bankcard__bottom { display: flex; justify-content: space-between; position: relative; z-index: 1; font-size: 12.5px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 992px) {
  .sidebar {
    position: fixed; inset-block: 0; inset-inline-start: 0; inset-inline-end: auto;
    transform: translateX(100%); transition: transform .28s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  body.drawer-open .sidebar { transform: translateX(0); }
  body.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
  .sidebar__close { display: grid; }
  .topbar__burger { display: grid; }
  .main__content { padding: 16px; }
  .settings-layout { grid-template-columns: 1fr; }
  .preview-stage { position: static; }
  .grid-4, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4, .stat-grid, .form-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 12px; }
  .topbar__title h1 { font-size: 14.5px; }
  .userchip__name, .userchip__caret { display: none; }
  .main__content { padding: 12px; }
  .dropdown__menu--notif { width: min(320px, calc(100vw - 24px)); }
  .toast { inset-inline-end: 12px; inset-inline-start: 12px; bottom: 12px; max-width: none; }
  .msg { max-width: 88%; }
  .thread-shell { flex-direction: column; }
  .thread-side { width: 100%; }
  .chat-box { height: calc(100vh - 300px); min-height: 360px; }
  .card__body { padding: 14px; }
  .codebox { font-size: 11px; }
  .app-footer { flex-direction: column; text-align: center; }
}

/* Widget settings page extras */
.preset-dot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border-2); cursor: pointer; transition: transform .15s; }
.preset-dot:hover { transform: scale(1.12); }
.seg-radio { cursor: pointer; }
.seg-radio input { position: absolute; opacity: 0; }
.seg-radio span {
  display: inline-flex; align-items: center; gap: .45rem; padding: 8px 16px;
  border: 1px solid var(--border-2); border-radius: 11px; font-size: 13px; color: var(--muted);
  transition: all .15s; background: var(--surface);
}
.seg-radio input:checked + span { border-color: var(--primary); color: var(--primary-700); background: var(--primary-soft); font-weight: 600; }

/* Preview canvas positioning helpers */
.wp__fab { bottom: 18px; position: absolute; }
.wp.wp-right .wp__fab { inset-inline-end: 18px; }
.wp.wp-left .wp__fab { inset-inline-end: auto; inset-inline-start: 18px; }
.wp__win { bottom: 88px; position: absolute; }
.wp.wp-right .wp__win { inset-inline-end: 18px; }
.wp.wp-left .wp__win { inset-inline-end: auto; inset-inline-start: 18px; }
.wp__power { position: absolute; bottom: 0; inset-inline-end: 18px; font-size: 10px; }
.wp.wp-left .wp__power { inset-inline-end: auto; inset-inline-start: 18px; }

/* Tablets portrait */
@media (min-width: 641px) and (max-width: 992px) {
  .thread-side { width: 260px; }
}

/* Dashboard two-column layout only on wide screens */
.grid-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
@media (max-width: 1100px) {
  .grid-main { grid-template-columns: 1fr; }
}

/* ============================================================
   Admin panel additions (sidebar accent, grid helpers, tabs)
   ============================================================ */
.sidebar--admin .brand__logo--admin { background: #1e293b; }
.sidebar--admin .nav-item.is-active { background: #1e293b; color: #fff; }
.userchip__avatar--admin { background: #1e293b; color: #fff; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 22px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

.input--sm { padding: 6px 10px; font-size: 12.5px; border-radius: 9px; }

/* Filter tabs (orders page, admin) */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; transition: .15s;
}
.tab span {
  background: var(--bg-soft, #eef2f1); border-radius: 999px; padding: 1px 8px; font-size: 11.5px;
}
.tab:hover { border-color: var(--primary); color: var(--primary); }
.tab.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.tab.is-active span { background: rgba(255,255,255,.22); color: #fff; }

/* ============================================================
   v2 additions: plan card, operators, tickets, android, gates
   ============================================================ */

/* Sidebar: burger + close ONLY on mobile (desktop hidden) */
.topbar__burger { display: none !important; }
.sidebar__close { display: none !important; }
@media (max-width: 992px) {
  .topbar__burger { display: grid !important; }
  .sidebar__close { display: grid !important; }
}

/* Sidebar plan subcard (beautified) */
.sidebar__plan-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.sidebar__plan-days { font-size: 11px; color: #7fd4c7; white-space: nowrap; }
.plan-progress { margin-top: 9px; }
.plan-progress__bar { height: 7px; border-radius: 6px; background: rgba(255,255,255,.12); overflow: hidden; }
.plan-progress__bar span {
  display: block; height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, #17c3ab, #0B8A7C);
  transition: width .5s var(--ease);
}
.plan-progress__bar span.plan-progress__fill--trial { background: linear-gradient(90deg, #f0b558, #d9942a); }
.plan-progress__meta {
  display: flex; justify-content: space-between; margin-top: 5px;
  font-size: 10.5px; color: #8ba3b8;
}

/* Operators grid */
.ops-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; padding: 18px; }
.op-card {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px 14px; text-align: center; display: grid; gap: 6px; justify-items: center;
  transition: transform .15s var(--ease), box-shadow .15s;
}
.op-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.op-card__ava {
  position: relative; width: 74px; height: 74px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary-700);
  display: grid; place-items: center; font-size: 26px; overflow: hidden;
}
.op-card__ava img { width: 100%; height: 100%; object-fit: cover; }
.op-card__state {
  position: absolute; bottom: 3px; inset-inline-end: 3px; width: 15px; height: 15px;
  border-radius: 50%; background: #9aa7b8; border: 2.5px solid var(--surface-2);
}
.op-card__state.is-on { background: #22c55e; }
.op-card__name { font-weight: 700; font-size: 14px; }
.op-card__sub { font-size: 11.5px; color: var(--muted); }
.op-card__actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; justify-content: center; }
.op-add-ava { display: grid; justify-items: center; gap: 6px; margin-bottom: 14px; }
.op-add-ava__prev {
  width: 74px; height: 74px; border-radius: 50%; border: 2px dashed var(--border-2);
  display: grid; place-items: center; color: var(--faint); font-size: 20px; overflow: hidden;
  background: var(--surface-2);
}
.op-add-ava__prev img { width: 100%; height: 100%; object-fit: cover; }

/* Tickets */
.ticket-list { display: flex; flex-direction: column; }
.ticket-item {
  display: flex; gap: 1rem; align-items: center; padding: 15px 18px;
  border-bottom: 1px solid var(--border); cursor: pointer; transition: background .14s;
}
.ticket-item:hover { background: var(--surface-2); }
.ticket-item.is-unread { background: color-mix(in srgb, var(--primary-soft) 40%, var(--surface)); }
.ticket-item__main { flex: 1; min-width: 0; }
.ticket-item__subject { font-weight: 700; font-size: 13.5px; }
.ticket-item__preview { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-item__rating { margin-top: 2px; }
.ticket-item__side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.ticket-item__time { font-size: 11px; color: var(--faint); }
.tthread { display: grid; gap: 12px; max-height: 320px; overflow-y: auto; padding: 4px; }
.tmsg { display: grid; gap: 3px; max-width: 85%; }
.tmsg--user { justify-self: start; }
.tmsg--admin { justify-self: end; align-items: end; }
.tmsg__who { font-size: 10.5px; color: var(--faint); }
.tmsg__bubble {
  padding: 10px 14px; border-radius: 13px; font-size: 13px; line-height: 1.9;
  background: var(--surface-2); border: 1px solid var(--border);
}
.tmsg--admin .tmsg__bubble { background: var(--primary-soft); border-color: transparent; }
.tmsg-reply { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 6px; }
.rate-box {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; display: grid; gap: 6px;
}
.stars { display: inline-flex; gap: 3px; font-size: 20px; color: #f5b301; direction: ltr; }
.stars .fa-star.is-off { color: var(--border-2); }
[data-star] { cursor: pointer; transition: transform .12s; }
[data-star]:hover { transform: scale(1.15); }

/* Android app page */
.android-hero { display: grid; grid-template-columns: 260px 1fr; overflow: hidden; }
@media (max-width: 800px) { .android-hero { grid-template-columns: 1fr; } }
.android-hero__visual {
  background: linear-gradient(160deg, #17c3ab 0%, #0B8A7C 55%, #075e54 100%);
  display: grid; place-items: center; position: relative; min-height: 260px; padding: 26px;
}
.android-hero__visual > i { font-size: 110px; color: rgba(255,255,255,.9); }
.android-hero__notif {
  position: absolute; bottom: 22px; inset-inline-start: 18px; inset-inline-end: 18px;
  background: rgba(255,255,255,.14); backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.25); color: #fff;
  border-radius: 13px; padding: 10px 14px; font-size: 12.5px;
  display: flex; align-items: center; gap: 8px;
  animation: notif-float 3.4s ease-in-out infinite;
}
@keyframes notif-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.android-hero__body { padding: 26px; }
.android-feats { list-style: none; display: grid; gap: 9px; margin: 12px 0 18px; }
.android-feats li { display: flex; align-items: center; gap: .7rem; font-size: 13.5px; }
.android-feats li i { color: var(--primary); width: 22px; text-align: center; }
.android-dl { background: #3ddc84; color: #06301c; font-weight: 700; }
.android-dl:hover { background: #34c974; color: #06301c; }
.android-req { margin-top: 18px; max-width: 420px; }

/* Gated controls */
.ws-gated-note { font-size: 11px; color: var(--warning); }
input[type="checkbox"]:disabled + .switch__track { opacity: .55; }

/* stat mini-bars (usage) */
.usage-wrap { display: grid; gap: 10px; }
.usage-row { display: grid; gap: 5px; }
.usage-row__head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.usage-row__bar { height: 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.usage-row__bar span { display: block; height: 100%; background: linear-gradient(90deg, #17c3ab, #0B8A7C); border-radius: 6px; }
.usage-row__bar span.is-full { background: linear-gradient(90deg, #f87171, #dc2626); }

/* Visitor info accordion in conversation page */
.vis-accordion__head {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; background: transparent; border: none;
  font-family: inherit; font-size: 14px; font-weight: 700; color: var(--text);
  cursor: pointer;
}
.vis-accordion__head:hover { background: var(--surface-2); }
.vis-accordion__chev { transition: transform .2s var(--ease); color: var(--muted); font-size: 12px; }
.vis-accordion__head[aria-expanded="true"] .vis-accordion__chev { transform: rotate(180deg); }
.vis-accordion__body { border-top: 1px solid var(--border); }

/* Plans grid (equal-height cards) */
.plans-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px; align-items: stretch;
}
.plan-card__feats { list-style: none; margin: 10px 0 4px; display: grid; gap: 8px; }
.plan-card__feats li { font-size: 12.5px; display: flex; gap: .55rem; align-items: flex-start; }
.plan-card__feats li i { color: var(--success); margin-top: 5px; font-size: 11px; flex: none; }
.plan-card__feats li.is-locked { color: var(--faint); }
.plan-card__feats li.is-locked i { color: var(--border-2); }
.plan-card__feats li .lock-hint { font-size: 10px; color: var(--faint); background: var(--surface-2); border-radius: 20px; padding: 0 7px; margin-inline-start: auto; white-space: nowrap; }

/* Installation page v2 */
.inst-card { margin-bottom: 16px; }
.inst-step-no {
  display: inline-grid; place-items: center; width: 26px; height: 26px;
  border-radius: 50%; background: var(--primary); color: #fff;
  font-size: 13px; margin-inline-end: 6px; vertical-align: middle;
}
.inst-grid-2 { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .inst-grid-2 { grid-template-columns: 1fr; } }
.inst-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.inst-tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); font-size: 13px; font-weight: 600; transition: .15s;
}
.inst-tab:hover { border-color: var(--primary); color: var(--primary); }
.inst-tab.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.inst-panel { display: none; }
.inst-panel.is-active { display: block; }
.inst-ol { margin: 0; padding-inline-start: 20px; display: grid; gap: 8px; font-size: 13.5px; }
.inst-ol code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 12px; }
.codebox code { display: block; padding-inline-end: 70px; word-break: break-all; }
