:root {
  --bg: #f6f8fb;
  --bg-deep: #0f1720;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-raised: #ffffff;
  --line: #e3e8ef;
  --line-strong: #c8d1dd;
  --text: #0f1720;
  --muted: #5f6b7a;
  --faint: #8792a2;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --accent-soft: #e5f6f2;
  --blue: #2563eb;
  --blue-soft: #e9f0ff;
  --warn: #b45309;
  --warn-soft: #fff4df;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --ok: #15803d;
  --ok-soft: #eaf8ef;
  --shadow: 0 18px 40px rgba(18, 28, 45, 0.08);
  --shadow-soft: 0 1px 2px rgba(18, 28, 45, 0.06);
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  line-height: 1.45;
  letter-spacing: 0;
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  background:
    linear-gradient(180deg, #fbfcfe 0, var(--bg) 320px),
    var(--bg);
}

#appRoot { min-height: 100vh; }

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 38px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

button:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

button:active { transform: translateY(1px); }
button:disabled { cursor: not-allowed; opacity: 0.55; box-shadow: none; }

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

button.primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

button.ghost {
  background: var(--surface-soft);
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 9px 10px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

h1,
h2,
h3,
p { margin-top: 0; }

h1,
h2,
h3 {
  letter-spacing: 0;
}

.hidden { display: none !important; }
.mt { margin-top: 16px; }
.mt-sm { margin-top: 8px; }
.muted { color: var(--muted); font-size: 13px; }

.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 468px;
  background: #0d171b;
}

.auth-hero {
  min-height: 100vh;
  padding: 30px;
  color: #fff;
  background:
    linear-gradient(115deg, rgba(7, 18, 25, 0.94), rgba(12, 43, 40, 0.80) 52%, rgba(55, 61, 48, 0.68)),
    url("https://images.unsplash.com/photo-1552664730-d307ca884978?auto=format&fit=crop&w=1800&q=80") center / cover;
  display: grid;
  grid-template-rows: auto minmax(260px, 1fr) auto auto;
  gap: 18px;
}

.auth-hero-copy {
  align-self: center;
}

.auth-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-hero h1 {
  max-width: 760px;
  margin: 12px 0 16px;
  font-size: clamp(42px, 4.2vw, 58px);
  line-height: 1;
}

.auth-hero p {
  max-width: 640px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 17px;
  line-height: 1.55;
}

.auth-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.glass-button {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.glass-button:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.45);
}

.hero-preview {
  max-width: 620px;
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(9, 18, 24, 0.58);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(12px);
}

.preview-head,
.preview-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.preview-head {
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
}

.preview-head strong { color: #fff; }

.preview-card {
  min-height: 54px;
  padding: 10px 12px;
  border-left: 4px solid #22c55e;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.12);
}

.preview-card.hot { border-left-color: #f59e0b; }
.preview-card.done { border-left-color: #60a5fa; }
.preview-card strong { font-size: 14px; }

.preview-card span {
  color: rgba(255, 255, 255, 0.74);
  font-size: 13px;
  text-align: right;
}

.auth-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.auth-stats span {
  min-height: 72px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.11);
  display: grid;
  align-content: center;
  gap: 4px;
  line-height: 1.35;
}

.auth-stats strong { display: block; }

.auth-card {
  min-height: 100vh;
  padding: 32px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(247, 249, 252, 0.96), rgba(255, 255, 255, 0.98)),
    radial-gradient(circle at 20% 10%, rgba(15, 118, 110, 0.10), transparent 34%);
  border-left: 1px solid rgba(15, 23, 42, 0.08);
}

.auth-panel {
  width: 100%;
  max-width: 388px;
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 20px 48px rgba(18, 28, 45, 0.12);
}

.auth-card-head {
  display: grid;
  gap: 8px;
}

.auth-card-head h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

.auth-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
}

.tabs button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form h2 { margin-bottom: 2px; }
.hint { color: var(--muted); font-size: 13px; }

.auth-support {
  display: grid;
  gap: 3px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.auth-support strong {
  font-size: 13px;
}

.auth-support span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong { line-height: 1.1; }
.brand.large strong { font-size: 18px; }

.brand small {
  margin-top: 3px;
  color: inherit;
  opacity: 0.72;
  font-size: 12px;
}

.brand-mark,
.avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 8px;
  background: #dff7ef;
  color: #075e54;
  font-weight: 800;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  background: transparent;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  border-right: 1px solid var(--line);
  box-shadow: 8px 0 28px rgba(18, 28, 45, 0.04);
  backdrop-filter: blur(14px);
}

.sidebar .brand {
  padding: 8px;
  border-radius: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.nav-list {
  display: grid;
  align-content: start;
  gap: 5px;
}

.nav-list button {
  min-height: 42px;
  width: 100%;
  justify-content: flex-start;
  border-color: transparent;
  background: transparent;
  color: #526070;
  text-align: left;
}

.nav-list button:hover {
  background: var(--surface-soft);
  border-color: var(--line);
  box-shadow: none;
}

.nav-list button.active {
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-color: #c7ece2;
  box-shadow: none;
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 6px;
  background: #eef3f8;
  color: inherit;
  font-size: 11px;
  font-weight: 800;
}

.nav-list button.active .nav-icon {
  background: var(--accent-soft);
  color: var(--accent);
}

.sidebar-footer {
  display: grid;
  gap: 3px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--text);
}

.sidebar-footer small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-role {
  color: var(--accent);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.workspace {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 72px;
  padding: 12px 22px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid rgba(227, 232, 239, 0.86);
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(12px);
}

.topbar-main {
  min-width: 0;
}

.topbar h1 {
  margin: 2px 0 0;
  font-size: 23px;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eyebrow {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.topbar-actions {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.topbar-actions select {
  width: 210px;
  max-width: 100%;
}

.avatar {
  border: 0;
  padding: 0;
  min-height: 38px;
  background: #101723;
  color: #fff;
}

.main-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 392px;
  min-height: 0;
}

.main-layout.no-detail { grid-template-columns: 1fr; }

.content-area {
  min-width: 0;
  padding: 24px;
  overflow: auto;
}

.dashboard-hero {
  min-height: 220px;
  margin-bottom: 18px;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(318px, 420px);
  gap: 22px;
  align-items: stretch;
  border-radius: 8px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(229, 246, 242, 0.92), rgba(255, 255, 255, 0.96) 52%, rgba(233, 240, 255, 0.70)),
    var(--surface-raised);
  color: var(--text);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.dashboard-hero-copy {
  display: grid;
  align-content: center;
}

.dashboard-hero h2 {
  max-width: 660px;
  margin: 8px 0 10px;
  font-size: 34px;
  line-height: 1.08;
}

.dashboard-hero p {
  max-width: 600px;
  color: var(--muted);
  line-height: 1.55;
}

.dashboard-hero .eyebrow {
  color: var(--accent);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 12px;
}

.hero-actions button:not(.primary) {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

.live-panel {
  padding: 14px;
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.live-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.live-panel-head span {
  color: var(--muted);
  font-size: 12px;
}

.live-panel-head strong {
  display: block;
  margin-top: 2px;
}

.mini-list {
  display: grid;
  gap: 9px;
}

.live-panel .empty-state {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--muted);
}

.lead-preview {
  width: 100%;
  min-height: 72px;
  padding: 12px;
  display: grid;
  gap: 4px;
  text-align: left;
  border-radius: 8px;
  border-color: rgba(255, 255, 255, 0.20);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
}

.lead-preview span,
.lead-preview i {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.lead-preview strong { font-size: 15px; }

.detail-panel {
  border-left: 1px solid var(--line);
  background: #fbfcfe;
  padding: 18px;
  overflow: auto;
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.view-header h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.view-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.setup-guide {
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 14px;
  align-items: stretch;
}

.setup-guide-main,
.setup-next,
.setup-step {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
}

.setup-guide-main {
  padding: 20px;
  display: grid;
  align-content: center;
  gap: 10px;
}

.setup-guide-main h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.12;
}

.setup-guide-main p,
.setup-next p {
  margin: 0;
  color: var(--muted);
}

.setup-progress {
  margin-top: 4px;
  display: grid;
  gap: 9px;
}

.setup-progress > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.setup-progress strong {
  font-size: 22px;
}

.setup-progress span {
  color: var(--muted);
  font-size: 13px;
}

.setup-next {
  padding: 16px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.setup-next strong {
  font-size: 18px;
}

.setup-steps {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.setup-step {
  min-height: 92px;
  padding: 10px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  justify-content: stretch;
  align-content: start;
  text-align: left;
  gap: 5px 8px;
  color: var(--text);
  white-space: normal;
}

.setup-step span {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.setup-step strong {
  min-width: 0;
  font-size: 13px;
  line-height: 1.22;
}

.setup-step small {
  color: var(--muted);
  font-size: 11px;
}

.setup-step.done {
  border-color: #b6dec5;
  background: #f5fcf7;
}

.setup-step.done span {
  background: var(--ok);
  color: #fff;
}

.grid-2,
.grid-3 {
  display: grid;
  gap: 14px;
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.panel,
.metric,
.list-item,
.stage-column {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.panel {
  padding: 16px;
}

.panel h3 {
  margin-bottom: 12px;
  font-size: 16px;
  line-height: 1.2;
}

.panel p,
.list-item p {
  color: var(--muted);
  margin-bottom: 0;
}

.form-grid {
  display: grid;
  gap: 11px;
}

.form-row {
  display: flex;
  gap: 8px;
  align-items: end;
}

.form-row > * { flex: 1; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  position: relative;
  min-height: 108px;
  padding: 17px;
  display: grid;
  align-content: center;
  gap: 8px;
  overflow: hidden;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent);
}

.metric:nth-child(2)::before { background: var(--blue); }
.metric:nth-child(3)::before { background: var(--warn); }
.metric:nth-child(4)::before { background: var(--ok); }

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.metric strong {
  font-size: 29px;
  line-height: 1;
}

.check-list,
.quick-actions,
.list {
  display: grid;
  gap: 9px;
}

.task-preview {
  min-height: 58px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.task-preview strong,
.task-preview span {
  display: block;
}

.task-preview span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 28px;
}

.dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 999px;
  background: var(--warn);
}

.dot.ok { background: var(--ok); }

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.ok { color: var(--ok); border-color: #b6dec5; background: var(--ok-soft); }
.status-pill.warn { color: var(--warn); border-color: #f1d29b; background: var(--warn-soft); }
.status-pill.danger { color: var(--danger); border-color: #efb7b0; background: var(--danger-soft); }

.sync-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.sync-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  margin-right: 7px;
  background: var(--warn);
}

.sync-pill.ok {
  color: var(--ok);
  border-color: #b6dec5;
  background: var(--ok-soft);
}

.sync-pill.ok::before { background: var(--ok); }

.toast-stack {
  position: fixed;
  right: 18px;
  top: 88px;
  z-index: 30;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
}

.toast {
  padding: 12px;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.toast.lead { border-left-color: var(--accent); }
.toast.message { border-left-color: var(--blue); }
.toast.task { border-left-color: var(--warn); }
.toast.ticket { border-left-color: var(--danger); }

.toast span {
  color: var(--muted);
  font-size: 13px;
}

.kanban-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(284px, 324px);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x proximity;
}

.stage-column {
  min-height: min(620px, calc(100vh - 180px));
  padding: 12px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  background: #f6f8fb;
  scroll-snap-align: start;
}

.stage-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.stage-head h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.stage-head span {
  color: var(--muted);
  font-size: 12px;
}

.card-list {
  display: grid;
  align-content: start;
  gap: 10px;
}

.journey-card {
  padding: 12px;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  cursor: grab;
}

.journey-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.journey-card.selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.journey-card span {
  color: var(--muted);
  font-size: 12px;
}

.pill-row,
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.segmented {
  margin-top: 2px;
}

.segmented button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface-soft);
}

.progress {
  height: 7px;
  background: #e7edf5;
  border-radius: 999px;
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.list-item {
  padding: 12px;
  display: grid;
  gap: 7px;
  box-shadow: none;
}

.list-item strong {
  line-height: 1.25;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.table tr:last-child td { border-bottom: 0; }

.table th {
  background: #f6f8fb;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.detail-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.detail-title h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.detail-title span {
  color: var(--muted);
  font-size: 13px;
}

.detail-section {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}

.detail-section h3 {
  margin-bottom: 10px;
  font-size: 15px;
}

.chat {
  max-height: 310px;
  overflow: auto;
  display: grid;
  gap: 8px;
}

.message {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--blue-soft);
}

.message.customer { background: #fff7ed; }
.message.bot { background: var(--ok-soft); }
.message.agent { background: #f4f0ff; }
.message p { margin: 4px 0 0; }

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
}

.alert {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.alert.danger { color: var(--danger); background: var(--danger-soft); border-color: #efb7b0; }
.alert.ok { color: var(--ok); background: var(--ok-soft); border-color: #b6dec5; }
.alert.warn { color: var(--warn); background: var(--warn-soft); border-color: #f1d29b; }
.alert.floating { margin: 12px 22px 0; }

.auth-panel .alert {
  padding: 9px 10px;
  font-size: 13px;
  line-height: 1.45;
}

.auth-panel .alert.ok {
  color: #0b6b47;
  background: #f1fbf5;
}

.empty-auth {
  min-height: 100vh;
  display: grid;
  place-content: center;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(16, 23, 35, 0.92), rgba(15, 118, 110, 0.50)),
    url("https://images.unsplash.com/photo-1552664730-d307ca884978?auto=format&fit=crop&w=1600&q=80") center / cover;
}

.empty-auth-card {
  width: min(430px, calc(100vw - 44px));
  padding: 22px;
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 48px rgba(18, 28, 45, 0.18);
}

.empty-auth-card h1 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.1;
}

.empty-auth-card p {
  margin-bottom: 2px;
  color: var(--muted);
}

@media (max-width: 1320px) {
  .topbar {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .topbar-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 1120px) {
  .auth-layout,
  .app-shell,
  .main-layout,
  .dashboard-hero,
  .setup-guide {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    height: auto;
    z-index: 19;
    grid-template-rows: auto auto;
  }

  .sidebar-footer {
    display: none;
  }

  .nav-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .setup-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nav-list button {
    justify-content: center;
  }

  .detail-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .auth-hero,
  .auth-card,
  .content-area {
    padding: 18px;
  }

  .auth-hero,
  .auth-card {
    min-height: auto;
  }

  .auth-hero h1 {
    font-size: 36px;
  }

  .auth-stats,
  .metric-grid,
  .grid-2,
  .grid-3,
  .dashboard-hero,
  .setup-steps {
    grid-template-columns: 1fr;
  }

  .dashboard-hero {
    padding: 18px;
  }

  .dashboard-hero h2 {
    font-size: 28px;
  }

  .setup-guide-main h2 {
    font-size: 24px;
  }

  .topbar,
  .view-header,
  .form-row,
  .row,
  .task-preview {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions,
  .hero-actions,
  .auth-hero-actions {
    align-items: stretch;
  }

  .topbar-actions > *,
  .hero-actions > *,
  .auth-hero-actions > * {
    width: 100%;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-list button {
    justify-content: flex-start;
  }

  .kanban-board {
    grid-auto-columns: minmax(260px, 86vw);
  }

  .preview-card,
  .preview-head,
  .live-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .preview-card span {
    text-align: left;
  }
}
