/* MenaCRM — design tokens, layout and components. Logical properties throughout so RTL is free. */

:root {
  --bg: #f4f6fa;
  --bg-grad: radial-gradient(1200px 500px at 80% -10%, #e7e9ff 0%, transparent 60%);
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --border: #e5e8f0;
  --border-strong: #d3d9e6;
  --text: #0f172a;
  --text-soft: #334155;
  --muted: #6b7688;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --on-primary: #ffffff;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --success: #059669;
  --ring: rgba(79, 70, 229, .32);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, .08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .18);
  --radius: 12px;
  --radius-sm: 9px;
  --radius-lg: 18px;
  --topbar-h: 68px;

  --st-contacted: #2563eb;
  --st-meeting: #7c3aed;
  --st-proposal: #d97706;
  --st-followup: #0891b2;
  --st-contracted: #059669;
  --st-lost: #dc2626;
  --st-cancelled: #64748b;
}

[data-theme="dark"] {
  --bg: #0a0d14;
  --bg-grad: radial-gradient(1100px 480px at 80% -10%, #1a1b3d 0%, transparent 60%);
  --surface: #12161f;
  --surface-2: #161b26;
  --surface-3: #1c2230;
  --border: #232a38;
  --border-strong: #313a4d;
  --text: #e8ecf4;
  --text-soft: #c2cad8;
  --muted: #8d99ad;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --primary-soft: #1e1f45;
  --danger: #f05252;
  --danger-soft: #2a1618;
  --success: #34d399;
  --ring: rgba(129, 140, 248, .38);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, .45);
  --shadow-lg: 0 28px 64px rgba(0, 0, 0, .6);

  --st-contacted: #60a5fa;
  --st-meeting: #a78bfa;
  --st-proposal: #fbbf24;
  --st-followup: #22d3ee;
  --st-contracted: #34d399;
  --st-lost: #f87171;
  --st-cancelled: #94a3b8;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg-grad), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, "Noto Sans Arabic", "Dubai", Tahoma, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }

::selection { background: color-mix(in srgb, var(--primary) 25%, transparent); }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; inset-block-start: -60px; inset-inline-start: 12px; z-index: 100;
  background: var(--surface); padding: 10px 16px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md); text-decoration: none; transition: inset-block-start .2s;
}
.skip-link:focus { inset-block-start: 12px; }

.is-hidden { display: none !important; }

/* Any `display` declaration outranks the UA rule for [hidden]; this keeps the attribute authoritative. */
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- topbar */

.topbar {
  position: sticky; inset-block-start: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(14px);
  border-block-end: 1px solid var(--border);
}

.topbar__inner {
  display: flex; align-items: center; gap: 14px;
  max-width: 1600px; margin-inline: auto;
  min-height: var(--topbar-h); padding: 12px 22px;
}

.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }

.brand__mark {
  display: grid; place-items: center; inline-size: 38px; block-size: 38px;
  border-radius: 11px; color: #fff;
  background: linear-gradient(140deg, var(--primary), #8b5cf6);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 40%, transparent);
}
.brand__mark svg { inline-size: 21px; block-size: 21px; }

.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__text strong { font-size: 16.5px; letter-spacing: -.02em; }
.brand__text small { color: var(--muted); font-size: 11.5px; }

.search {
  position: relative; flex: 1; max-inline-size: 640px; margin-inline: auto;
}
.search__icon {
  position: absolute; inset-inline-start: 13px; inset-block-start: 50%;
  transform: translateY(-50%); inline-size: 17px; block-size: 17px; color: var(--muted);
  pointer-events: none;
}
.search input {
  inline-size: 100%; padding: 11px 44px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 11px; transition: border-color .15s, box-shadow .15s, background .15s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus {
  outline: none; background: var(--surface);
  border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring);
}
.search input::-webkit-search-cancel-button { display: none; }

.search__clear {
  position: absolute; inset-inline-end: 40px; inset-block-start: 50%; transform: translateY(-50%);
  display: grid; place-items: center; inline-size: 24px; block-size: 24px;
  border: 0; border-radius: 50%; background: var(--surface-3); color: var(--muted); cursor: pointer;
}
.search__clear:hover { color: var(--text); }
.search__clear svg { inline-size: 13px; block-size: 13px; }

.search__hint {
  position: absolute; inset-inline-end: 12px; inset-block-start: 50%; transform: translateY(-50%);
  font-size: 11px; color: var(--muted); background: var(--surface-3);
  border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px;
}
.search input:focus ~ .search__hint { opacity: 0; }

.topbar__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: 10px; border: 1px solid transparent;
  background: transparent; font-weight: 550; white-space: nowrap; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .06s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn svg { inline-size: 16px; block-size: 16px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.btn--primary {
  background: var(--primary); color: var(--on-primary);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--primary) 32%, transparent);
}
.btn--primary:hover:not([disabled]) { background: var(--primary-hover); }

.btn--ghost { background: var(--surface); border-color: var(--border); color: var(--text-soft); }
.btn--ghost:hover { border-color: var(--border-strong); background: var(--surface-2); color: var(--text); }

.btn--quiet { color: var(--muted); }
.btn--quiet:hover { background: var(--surface-3); color: var(--text); }

.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { filter: brightness(1.06); }

.btn--danger-ghost { color: var(--danger); border-color: transparent; }
.btn--danger-ghost:hover { background: var(--danger-soft); }

.btn--sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }

.icon-btn {
  display: grid; place-items: center; inline-size: 36px; block-size: 36px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-soft); cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.icon-btn svg { inline-size: 17px; block-size: 17px; }
.icon-btn__label { font-weight: 650; font-size: 14px; }

[data-theme="light"] .icon-moon, [data-theme="dark"] .icon-sun { display: none; }

/* ---------------------------------------------------------------- menus */

.menu { position: relative; }
.menu__list {
  position: absolute; inset-block-start: calc(100% + 6px); inset-inline-end: 0; z-index: 50;
  min-inline-size: 190px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-md);
  animation: pop .12s ease-out;
}
.menu__list button {
  display: flex; align-items: center; gap: 9px; inline-size: 100%;
  padding: 8px 10px; border: 0; border-radius: 8px; background: transparent;
  text-align: start; cursor: pointer; color: var(--text-soft);
}
.menu__list button:hover { background: var(--surface-3); color: var(--text); }

@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }

/* ---------------------------------------------------------------- page */

.page { max-width: 1600px; margin-inline: auto; padding: 20px 22px 64px; }

.filters {
  display: flex; gap: 8px; flex-wrap: wrap; margin-block-end: 16px;
}

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-soft);
  font-weight: 550; transition: border-color .15s, background .15s, color .15s;
}
.chip:hover { border-color: var(--border-strong); }
.chip__dot { inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--chip-color, var(--muted)); }
.chip__count {
  min-inline-size: 22px; padding-inline: 6px; text-align: center;
  border-radius: 999px; background: var(--surface-3); color: var(--muted);
  font-size: 12px; font-weight: 650;
}
.chip[aria-pressed="true"] {
  background: color-mix(in srgb, var(--chip-color, var(--primary)) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--chip-color, var(--primary)) 45%, transparent);
  color: var(--chip-color, var(--primary));
}
.chip[aria-pressed="true"] .chip__count {
  background: color-mix(in srgb, var(--chip-color, var(--primary)) 20%, transparent);
  color: inherit;
}

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden;
}

.panel__bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 18px; border-block-end: 1px solid var(--border); background: var(--surface-2);
}
.result-count { margin: 0; color: var(--muted); font-size: 13px; }
.result-count b { color: var(--text); font-weight: 650; }

.page-size {
  display: flex; align-items: center; gap: 7px; margin-inline-start: auto;
  color: var(--muted); font-size: 13px;
}
.page-size select {
  padding: 5px 8px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer;
}

.bulk-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 4px 4px 4px 12px; border-radius: 10px;
  background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
}
.bulk-bar__count { font-size: 13px; font-weight: 600; color: var(--primary); }

/* ---------------------------------------------------------------- table */

.table-wrap { overflow-x: auto; }

.table { inline-size: 100%; border-collapse: collapse; }

.table thead th {
  position: sticky; inset-block-start: 0; z-index: 2;
  background: var(--surface);
  padding: 11px 14px; text-align: start; white-space: nowrap;
  font-size: 12px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); border-block-end: 1px solid var(--border);
}
.table thead th.sortable { padding: 0; }
.table thead th.sortable button {
  display: flex; align-items: center; gap: 5px; inline-size: 100%;
  padding: 11px 14px; border: 0; background: transparent; cursor: pointer;
  font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit;
}
.table thead th.sortable button:hover { color: var(--text); }
.caret { inline-size: 8px; block-size: 8px; opacity: 0; transition: opacity .15s; }
.table th[data-active] .caret, .table th[data-active] button { opacity: 1; color: var(--primary); }
.table th[data-active="asc"] .caret::before { content: "▲"; font-size: 8px; }
.table th[data-active="desc"] .caret::before { content: "▼"; font-size: 8px; }

.table tbody td {
  padding: 12px 14px; border-block-end: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.is-selected { background: color-mix(in srgb, var(--primary) 7%, var(--surface)); }
.table tbody tr:last-child td { border-block-end: 0; }

.col-check { inline-size: 44px; }
.col-actions { inline-size: 92px; }
.col-deal { min-inline-size: 220px; }

.lead-name { display: flex; align-items: center; gap: 10px; }
.avatar {
  display: grid; place-items: center; flex-shrink: 0;
  inline-size: 34px; block-size: 34px; border-radius: 10px;
  font-size: 12.5px; font-weight: 650; color: #fff;
  background: var(--avatar-bg, var(--primary));
}
.lead-name__text { display: flex; flex-direction: column; min-inline-size: 0; }
.lead-name__text strong { font-weight: 600; }
.lead-name__text small { color: var(--muted); font-size: 12px; }

.cell-link { color: var(--text-soft); text-decoration: none; }
.cell-link:hover { color: var(--primary); text-decoration: underline; }

.deal {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; color: var(--text-soft); max-inline-size: 340px;
}

.muted-cell { color: var(--muted); }
.date-cell { white-space: nowrap; }
.date-cell small { display: block; color: var(--muted); font-size: 11.5px; }

.status-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 10px 5px 9px; border-radius: 999px; cursor: pointer;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  color: var(--st); background: color-mix(in srgb, var(--st) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--st) 30%, transparent);
  transition: background .15s;
}
.status-btn:hover { background: color-mix(in srgb, var(--st) 22%, transparent); }
.status-btn .dot { inline-size: 7px; block-size: 7px; border-radius: 50%; background: currentColor; }
.status-btn svg { inline-size: 12px; block-size: 12px; opacity: .7; }

.status-pop {
  position: fixed; z-index: 60; min-inline-size: 190px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg); animation: pop .12s ease-out;
}
.status-pop button {
  display: flex; align-items: center; gap: 9px; inline-size: 100%;
  padding: 8px 10px; border: 0; border-radius: 8px; background: transparent;
  cursor: pointer; text-align: start; color: var(--text-soft); font-weight: 550;
}
.status-pop button:hover { background: var(--surface-3); color: var(--text); }
.status-pop button[aria-current="true"] { background: var(--surface-3); color: var(--text); }
.status-pop .dot { inline-size: 8px; block-size: 8px; border-radius: 50%; }

.row-actions { display: flex; gap: 2px; opacity: .35; transition: opacity .15s; }
tr:hover .row-actions, tr:focus-within .row-actions { opacity: 1; }
.row-actions button {
  display: grid; place-items: center; inline-size: 30px; block-size: 30px;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
}
.row-actions button:hover { background: var(--surface-3); color: var(--text); }
.row-actions button.danger:hover { background: var(--danger-soft); color: var(--danger); }
.row-actions svg { inline-size: 15px; block-size: 15px; }

.checkbox { display: inline-flex; align-items: center; cursor: pointer; }
.checkbox input { position: absolute; opacity: 0; inline-size: 0; block-size: 0; }
.checkbox span {
  inline-size: 17px; block-size: 17px; border-radius: 5px;
  border: 1.5px solid var(--border-strong); background: var(--surface);
  display: grid; place-items: center; transition: background .12s, border-color .12s;
}
.checkbox input:checked + span, .checkbox input:indeterminate + span {
  background: var(--primary); border-color: var(--primary);
}
.checkbox input:checked + span::after {
  content: ""; inline-size: 9px; block-size: 5px; margin-block-start: -2px;
  border: 2px solid #fff; border-block-start: 0; border-inline-end: 0; transform: rotate(-45deg);
}
.checkbox input:indeterminate + span::after {
  content: ""; inline-size: 9px; block-size: 2px; background: #fff; border-radius: 1px;
}
.checkbox input:focus-visible + span { box-shadow: 0 0 0 3px var(--ring); }
.checkbox--inline { gap: 9px; }
.checkbox--inline em { font-style: normal; color: var(--text-soft); }

/* skeleton + empty state */

.skeleton td > div {
  block-size: 12px; border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3));
  background-size: 200% 100%; animation: shimmer 1.2s infinite linear;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.empty { padding: 64px 24px; text-align: center; }
.empty svg { inline-size: 46px; block-size: 46px; color: var(--muted); opacity: .6; }
.empty h2 { margin-block: 14px 6px; font-size: 17px; }
.empty p { margin: 0 auto; max-inline-size: 420px; color: var(--muted); }
.empty__actions { display: flex; gap: 10px; justify-content: center; margin-block-start: 20px; }

.panel__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 18px; border-block-start: 1px solid var(--border); background: var(--surface-2);
}
.page-info { color: var(--muted); font-size: 13px; }
.pager { display: flex; gap: 4px; }
.pager button {
  min-inline-size: 34px; block-size: 34px; padding-inline: 9px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface);
  color: var(--text-soft); cursor: pointer; font-weight: 550;
}
.pager button:hover:not([disabled]) { border-color: var(--border-strong); background: var(--surface-3); }
.pager button[aria-current="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager button[disabled] { opacity: .4; cursor: not-allowed; }
.pager .ellipsis { border: 0; background: transparent; cursor: default; color: var(--muted); }

/* ---------------------------------------------------------------- overlays */

.overlay {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px);
  display: flex; justify-content: flex-end;
  animation: fade .15s ease-out;
}
.overlay--center { align-items: center; justify-content: center; padding: 20px; }
@keyframes fade { from { opacity: 0; } }

.drawer {
  inline-size: min(480px, 100%); block-size: 100%;
  display: flex; flex-direction: column;
  background: var(--surface); box-shadow: var(--shadow-lg);
  animation: slide-in .22s cubic-bezier(.22, 1, .36, 1);
}
@keyframes slide-in { from { transform: translateX(var(--slide-from, 100%)); } }
[dir="rtl"] .drawer { --slide-from: -100%; }

.drawer__head, .modal__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 20px; border-block-end: 1px solid var(--border);
}
.drawer__head h2, .modal__head h2 { font-size: 16px; }

.drawer__body { flex: 1; overflow-y: auto; padding: 20px; display: grid; gap: 16px; align-content: start; }

.drawer__foot, .modal__foot {
  display: flex; align-items: center; gap: 10px; justify-content: flex-end;
  padding: 14px 20px; border-block-start: 1px solid var(--border); background: var(--surface-2);
}
.spacer { flex: 1; }

.field { display: grid; gap: 6px; }
.field__label { font-size: 12.5px; font-weight: 600; color: var(--text-soft); }
.req { color: var(--danger); }
.field input, .field select, .field textarea {
  inline-size: 100%; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-block-size: 84px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring);
}
.field input.invalid { border-color: var(--danger); }
.field__meta { margin: 0; font-size: 12px; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.form-error {
  margin: 0; padding: 10px 12px; border-radius: 10px;
  background: var(--danger-soft); color: var(--danger); font-size: 13px;
  border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent);
}

.modal {
  inline-size: min(560px, 100%); max-block-size: 90vh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  animation: rise .18s cubic-bezier(.22, 1, .36, 1);
}
.modal--sm { inline-size: min(420px, 100%); }
.modal__body { padding: 20px; overflow-y: auto; display: grid; gap: 14px; }
.modal__body p { margin: 0; color: var(--text-soft); }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.98); } }

.dropzone {
  display: grid; place-items: center; gap: 4px; padding: 30px 20px; text-align: center;
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--primary); background: var(--primary-soft); }
.dropzone svg { inline-size: 30px; block-size: 30px; color: var(--primary); }
.dropzone__title { margin: 6px 0 0; font-weight: 600; }
.dropzone__hint { margin: 0; color: var(--muted); font-size: 13px; }
.dropzone.has-file svg { color: var(--success); }

.import-note { font-size: 12.5px; color: var(--muted); line-height: 1.65; }

.template-link {
  display: inline-flex; align-items: center; gap: 7px; justify-self: start;
  font-size: 13px; font-weight: 550; text-decoration: none;
}
.template-link:hover { text-decoration: underline; }
.template-link svg { inline-size: 15px; block-size: 15px; }

.import-result {
  display: grid; gap: 10px; padding: 14px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border);
}
.import-stats { display: flex; gap: 18px; flex-wrap: wrap; }
.import-stat { display: grid; }
.import-stat b { font-size: 19px; font-weight: 680; }
.import-stat span { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.import-errors { margin: 0; padding-inline-start: 18px; color: var(--muted); font-size: 12.5px; display: grid; gap: 4px; }

/* ---------------------------------------------------------------- toasts */

.toasts {
  position: fixed; inset-block-end: 20px; inset-inline-end: 20px; z-index: 90;
  display: grid; gap: 10px; justify-items: end;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 15px; min-inline-size: 240px; max-inline-size: 380px;
  background: var(--surface); border: 1px solid var(--border);
  border-inline-start: 3px solid var(--tone, var(--primary));
  border-radius: 11px; box-shadow: var(--shadow-md);
  animation: toast-in .2s cubic-bezier(.22, 1, .36, 1);
}
.toast.is-out { animation: toast-out .2s forwards; }
.toast svg { inline-size: 17px; block-size: 17px; color: var(--tone, var(--primary)); flex-shrink: 0; }
.toast--success { --tone: var(--success); }
.toast--error { --tone: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ---------------------------------------------------------------- sign-in page */

.auth-body { min-block-size: 100vh; }

.auth-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-block-size: 100vh; }

.auth-side {
  display: flex; flex-direction: column; justify-content: center; gap: 22px;
  padding: 48px clamp(32px, 6vw, 84px); color: #fff;
  background: linear-gradient(150deg, #4f46e5 0%, #6d28d9 55%, #9333ea 100%);
}
.auth-side h2 { font-size: clamp(24px, 3vw, 34px); line-height: 1.25; max-inline-size: 12em; }
.brand--lg .brand__mark { inline-size: 44px; block-size: 44px; background: rgba(255, 255, 255, .18); box-shadow: none; }
.brand--lg .brand__text strong { font-size: 20px; color: #fff; }

.auth-points { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; max-inline-size: 30em; }
.auth-points li { position: relative; padding-inline-start: 28px; color: rgba(255, 255, 255, .88); }
.auth-points li::before {
  content: ""; position: absolute; inset-inline-start: 0; inset-block-start: 7px;
  inline-size: 8px; block-size: 8px; border-radius: 50%; background: rgba(255, 255, 255, .75);
}

.auth-main { position: relative; display: grid; place-items: center; padding: 48px 24px; }
.auth-topbar { position: absolute; inset-block-start: 18px; inset-inline-end: 18px; display: flex; gap: 8px; }

.auth-card { inline-size: min(400px, 100%); display: grid; gap: 6px; }
.auth-card h1 { font-size: 26px; }
.auth-sub { margin: 0 0 18px; color: var(--muted); }
.auth-card form { display: grid; gap: 16px; }
.auth-remember { margin-block-start: -4px; }
.auth-foot { margin-block-start: 22px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }

.btn--block { justify-content: center; inline-size: 100%; padding-block: 11px; }

.password-wrap { position: relative; display: block; }
.password-eye {
  position: absolute; inset-inline-end: 6px; inset-block-start: 50%; transform: translateY(-50%);
  display: grid; place-items: center; inline-size: 32px; block-size: 32px;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
}
.password-eye:hover { color: var(--text); background: var(--surface-3); }
.password-eye.is-on { color: var(--primary); }
.password-eye svg { inline-size: 17px; block-size: 17px; }
.password-wrap input { padding-inline-end: 44px; }

/* ---------------------------------------------------------------- account menu */

.user-chip {
  display: inline-flex; align-items: center; gap: 9px; padding: 5px 11px 5px 5px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text-soft); cursor: pointer; font-weight: 550;
}
.user-chip:hover { border-color: var(--border-strong); background: var(--surface-2); }
.user-chip .avatar { inline-size: 28px; block-size: 28px; border-radius: 50%; font-size: 11px; }
.user-chip svg { inline-size: 13px; block-size: 13px; opacity: .6; }
.user-chip__name { max-inline-size: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.menu__head {
  padding: 9px 10px 10px; border-block-end: 1px solid var(--border); margin-block-end: 5px;
  display: grid; gap: 1px;
}
.menu__head strong { font-size: 13px; }
.menu__head small { color: var(--muted); font-size: 12px; word-break: break-all; }

.notice {
  display: flex; gap: 9px; padding: 11px 13px; border-radius: 10px; font-size: 13px;
  background: color-mix(in srgb, var(--st-proposal) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--st-proposal) 32%, transparent);
  color: var(--text-soft);
}
.notice svg { inline-size: 17px; block-size: 17px; color: var(--st-proposal); flex-shrink: 0; }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1320px) {
  .user-chip__name { display: none; }
}

@media (max-width: 1180px) {
  .col-email, .col-updated { display: none; }
}

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

@media (max-width: 980px) {
  .topbar__inner { flex-wrap: wrap; }
  .search { order: 3; flex-basis: 100%; max-inline-size: none; margin-inline: 0; }
  .search__hint { display: none; }
  .topbar__actions { margin-inline-start: auto; }
  .btn--ghost span, .btn--primary span { display: none; }
  .btn { padding-inline: 11px; }
}

@media (max-width: 760px) {
  .page { padding: 16px 12px 48px; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; inline-size: 100%; }
  .table tbody tr {
    position: relative; padding: 14px 14px 14px 44px;
    border-block-end: 1px solid var(--border);
  }
  [dir="rtl"] .table tbody tr { padding: 14px 44px 14px 14px; }
  .table tbody td { border: 0; padding: 3px 0; }
  .table td.col-check { position: absolute; inset-block-start: 16px; inset-inline-start: 14px; inline-size: auto; padding: 0; }
  .table td.col-actions { position: absolute; inset-block-start: 10px; inset-inline-end: 8px; inline-size: auto; }
  .row-actions { opacity: 1; }
  .table td[data-label]:not(:empty)::before {
    content: attr(data-label) ": "; color: var(--muted); font-size: 12px; font-weight: 600;
  }
  .table td.col-name::before, .table td.col-status::before { content: none; }
  .table td.col-status { padding-block-start: 8px; }
  .deal { max-inline-size: none; }
  .panel__foot { justify-content: center; }
  .toasts { inset-inline: 12px; justify-items: stretch; }
  .toast { max-inline-size: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
