:root {
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #23312c;
  background: #f4f6f3;
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-muted: #f7f9f7;
  --sidebar: #18231f;
  --sidebar-active: #263a33;
  --text: #23312c;
  --muted: #6f7c76;
  --line: #dfe5e1;
  --primary: #147d64;
  --primary-dark: #0e624e;
  --primary-soft: #e6f3ee;
  --ai: #6e56cf;
  --ai-soft: #f0edff;
  --warning: #a66a14;
  --danger: #b4474e;
  --shadow: 0 8px 24px rgba(23, 42, 35, .06);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-width: 320px; background: var(--bg); }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { border: 0; }
[hidden] { display: none !important; }

.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  grid-template-rows: 72px minmax(calc(100vh - 72px), auto);
  min-height: 100vh;
}

.topbar {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  min-width: 0;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(12px);
}

.topbar-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.eyebrow { margin: 0 0 3px; color: #7d8984; font-size: 10px; font-weight: 750; letter-spacing: 1.1px; }
h1 { margin: 0; color: #1f2c27; font-size: 20px; line-height: 1.15; letter-spacing: 0; }
h2 { margin: 0 0 6px; color: var(--text); font-size: 23px; letter-spacing: 0; }
h3 { letter-spacing: 0; }
p { margin: 0; color: var(--muted); }

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 20px;
}
.nav-toggle { display: none; }

.auth { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; color: var(--muted); font-size: 13px; }
.auth #userLabel { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; color: #42514b; }
.auth input { width: 145px; padding: 8px 10px; }
.auth select { width: auto; min-width: 88px; padding: 8px 28px 8px 10px; }
.is-authenticated .auth input, .is-authenticated #loginBtn { display: none; }

button {
  min-height: 38px;
  padding: 9px 13px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
button:hover { background: var(--primary-dark); }
button:active { transform: translateY(1px); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(20, 125, 100, .2); outline-offset: 1px; }
button.secondary { border: 1px solid var(--line); background: #f2f5f3; color: #3d4b46; }
button.secondary:hover { border-color: #c8d3ce; background: #e8eeeb; }

.tabs {
  grid-column: 1;
  grid-row: 1 / span 2;
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  height: 100vh;
  min-height: 0;
  padding: 18px 14px 24px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--sidebar);
  scrollbar-width: thin;
  scrollbar-color: #4d5f58 transparent;
}

.nav-brand { display: flex; align-items: center; gap: 11px; min-height: 45px; margin: 0 3px 18px; color: #f4faf7; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 8px; background: #2fa985; color: #fff; font-weight: 850; }
.brand-copy { display: grid; gap: 2px; min-width: 0; }
.brand-copy strong { font-size: 15px; }
.brand-copy small { color: #91a49d; font-size: 10px; }
.nav-section { margin: 14px 10px 5px; color: #82948d; font-size: 10px; font-weight: 750; letter-spacing: 1px; text-transform: uppercase; }
.tab {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 39px;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 6px;
  background: transparent;
  color: #b9c7c1;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  white-space: normal;
}
.tab::after { content: ""; position: absolute; left: 0; width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: #46c19c; opacity: 0; transform: scaleY(.4); }
.tab:hover { background: #202f2a; color: #f1f7f4; }
.tab.active { background: var(--sidebar-active); color: #fff; }
.tab.active::after { opacity: 1; transform: scaleY(1); }
.nav-icon { width: 16px; height: 16px; flex: 0 0 16px; background: currentColor; opacity: .8; mask: var(--nav-icon) center / contain no-repeat; -webkit-mask: var(--nav-icon) center / contain no-repeat; }
.tab.active .nav-icon { color: #55d0aa; opacity: 1; }
.tab-label { min-width: 0; }

.nav-backdrop { display: none; }
.nav-backdrop:hover, .nav-backdrop:active { background: rgba(13, 24, 19, .48); transform: none; }
.view { display: none; grid-column: 2; grid-row: 2; min-width: 0; padding: 28px clamp(22px, 3vw, 42px) 48px; }
.view.active { display: block; }

.toolbar, .page-heading, .console-heading, .welcome-panel, .console-hero, .automation-callout { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.toolbar { margin-bottom: 14px; }
.actions, .hero-actions { display: flex; align-items: center; gap: 8px; }

.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.metric, .panel, .status-card, .table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.metric { position: relative; min-height: 106px; padding: 17px 18px; overflow: hidden; }
.metric::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 2px; background: #88b6a7; }
.metric span { display: block; margin-bottom: 11px; color: var(--muted); font-size: 12px; }
.metric strong { display: block; color: #25463b; font-size: 25px; line-height: 1; }
.metric small { display: block; margin-top: 9px; color: #96a19c; font-size: 10px; }

.panel { margin-bottom: 14px; padding: 20px; }
.panel h3 { margin: 0; color: #2c3c36; font-size: 16px; }
.panel-title, .model-header, .persona-head, .status-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dashboard-grid, .overview-grid, .profile-layout, .insight-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 14px; }

.welcome-panel, .console-hero {
  margin-bottom: 20px;
  padding: 23px 25px;
  border: 1px solid #d9e7e1;
  border-radius: 8px;
  background: #f8fbf9;
}
.welcome-panel h2, .console-hero h2 { margin: 3px 0 7px; }
.page-heading, .console-heading { margin-bottom: 20px; }
.employee-view h2, .console-view h2 { font-size: 25px; color: #20332c; }
.employee-view p, .console-view p { color: var(--muted); line-height: 1.55; }
.gradient-chip { display: inline-block; margin-bottom: 9px; padding: 4px 9px; border-radius: 5px; background: var(--ai-soft); color: var(--ai); font-size: 10px; font-weight: 750; letter-spacing: .4px; }
.gradient-button, .small-gradient { background: var(--primary); box-shadow: none; }
.small-gradient { min-height: 30px; padding: 6px 9px; font-size: 11px; }
.section-kicker { display: inline-block; margin-bottom: 5px; color: #76857f; font-size: 10px; font-weight: 750; letter-spacing: 1px; text-transform: uppercase; }
.status-note { padding: 5px 9px; border-radius: 5px; background: #fff3d8; color: #926016; font-size: 11px; font-weight: 700; }

.inline-form { display: grid; align-items: stretch; gap: 9px; margin-bottom: 14px; }
.knowledge-form { grid-template-columns: minmax(150px, 1fr) 120px 130px minmax(280px, 2fr) auto; }
.domain-form { grid-template-columns: 120px minmax(240px, 1fr) 130px auto; max-width: 780px; }
.jobs-form, .experiment-form, .agent-form, .social-form, .asset-form, .user-form, .template-form { grid-template-columns: repeat(5, minmax(0, 1fr)); }
input, select, textarea { width: 100%; min-height: 40px; padding: 9px 10px; border: 1px solid #cfd8d3; border-radius: 5px; background: #fff; color: #1f2d28; }
input::placeholder, textarea::placeholder { color: #9aa5a0; }
textarea { min-height: 44px; max-height: 140px; resize: vertical; }
.form-card label, .model-form label { display: block; margin-top: 15px; color: #5e6d67; font-size: 12px; }
.form-card label:first-of-type { margin-top: 18px; }
.form-card input, .form-card textarea, .model-form input, .model-form select { margin-top: 6px; background: #fbfcfb; border-color: var(--line); }
.form-card textarea { min-height: 94px; }
.save-profile { width: 100%; margin-top: 20px; }

.table-wrap { overflow: auto; }
table { width: 100%; min-width: 850px; border-collapse: collapse; }
th, td { padding: 12px 13px; border-bottom: 1px solid #e8ece9; text-align: left; font-size: 13px; }
th { position: sticky; top: 0; z-index: 1; background: #f6f8f7; color: #62716b; font-size: 11px; font-weight: 750; }
tbody tr { transition: background-color .15s ease; }
tbody tr:hover { background: #f8faf9; }
tbody tr:last-child td { border-bottom: 0; }
.summary { max-width: 420px; color: #53635d; }
.empty { padding: 30px; color: #7c8984; text-align: center; }

.badge, .domain-status, .pill, .status-label, .source-pill { display: inline-block; border-radius: 5px; font-size: 11px; font-weight: 700; }
.badge { min-width: 25px; padding: 3px 6px; text-align: center; }
.domain-status, .pill, .status-label, .source-pill { padding: 4px 7px; }
.A { background: #dff4e8; color: #15754d; }
.B { background: #e4eefb; color: #376590; }
.C { background: #fff0c9; color: #886214; }
.D { background: #f9e2e4; color: #99434a; }
.status-ok { color: #17724e; font-weight: 700; }
.status-wait { color: #986314; font-weight: 700; }
.domain-status { background: #edf1ef; color: #5c6a65; }
.domain-status.active, .domain-status.succeeded, .domain-status.published, .pill.success, .status-label.following, .source-pill { background: #e1f2e9; color: #237452; }
.domain-status.pending, .domain-status.paused, .domain-status.draft, .pill.warning { background: #fff0cd; color: #8b6217; }
.domain-status.running, .domain-status.approved, .domain-status.review { background: #e5eef9; color: #3e6590; }
.domain-status.failed, .domain-status.rejected, .domain-status.cancelled { background: #f8e2e3; color: #99434a; }
.pill.neutral, .status-label.new { background: #edf1ef; color: #697670; }

.progress-track, .bar-track, .quota-track { overflow: hidden; border-radius: 4px; background: #e9eeeb; }
.progress-track { height: 7px; margin: 21px 0 9px; }
.progress-track span, .bar-track span, .quota-track span { display: block; height: 100%; border-radius: inherit; background: var(--primary); transition: width .3s ease; }
.link-button { min-height: 0; padding: 0; background: none; color: var(--primary); font-size: 12px; }
.link-button:hover { background: none; color: var(--primary-dark); }
.spark { color: var(--ai); font-size: 19px; }
.recommend-list { margin: 17px 0 0; padding-left: 18px; color: #65736d; line-height: 1.9; }
.empty-card { padding: 18px 0; color: #929d98; }
.run-item { display: flex; align-items: center; gap: 11px; padding: 12px 0; border-bottom: 1px solid #e9edea; }
.run-item:last-child { border-bottom: 0; }
.run-item > div { flex: 1; min-width: 0; }
.run-item strong, .run-item small { display: block; }
.run-item small { margin-top: 3px; color: #89958f; }
.run-icon { display: grid; place-items: center; width: 29px; height: 29px; flex: 0 0 29px; border-radius: 6px; background: var(--ai-soft); color: var(--ai); }

.completion-ring { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 84px; height: 84px; flex: 0 0 84px; border: 7px solid #dce9e4; border-top-color: var(--primary); border-radius: 50%; color: var(--primary); }
.completion-ring strong { font-size: 20px; }
.completion-ring span { color: #89968f; font-size: 10px; }
.persona-row { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 9px; margin-top: 11px; padding: 11px; border: 1px solid #e6ebe8; border-radius: 7px; background: #f8faf9; }
.persona-row small { display: block; margin-bottom: 5px; color: #7f8c86; font-size: 10px; }
.persona-row input { margin-top: 0 !important; }
.remove-persona, .danger-text { background: #fae9ea; color: var(--danger); }
.remove-persona:hover, .danger-text:hover { background: #f4d9db; color: #8d343b; }
.filterbar, .channel-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.filterbar input { max-width: 320px; }
.reference-table table { min-width: 1050px; }
.reason-button, .toggle-button { background: var(--ai-soft); color: var(--ai); }
.reason-button { min-height: 30px; padding: 5px 9px; font-size: 11px; }
.channel { flex: 1; border: 1px solid var(--line); background: #fff; color: #62716b; }
.channel.active { border-color: var(--primary); background: var(--primary); color: #fff; }
.channel.whatsapp { color: #237452; }

.model-card { padding: 0; overflow: hidden; }
.model-header { padding: 17px 20px; border-bottom: 1px solid var(--line); }
.model-header small { display: block; margin-top: 7px; color: #89958f; }
.model-stats { display: grid; grid-template-columns: repeat(4, 1fr); padding: 18px 20px; }
.model-stats div { border-right: 1px solid var(--line); text-align: center; }
.model-stats div:last-child { border-right: 0; }
.model-stats span, .model-stats strong { display: block; }
.model-stats span { margin-bottom: 7px; color: #7d8984; font-size: 11px; }
.model-stats strong { color: #285545; }
.model-form { display: grid; grid-template-columns: repeat(4, 1fr) auto; align-items: end; gap: 10px; }
.model-form label { margin: 0; }
.model-form button { height: 40px; }
.automation-callout { margin-bottom: 20px; padding: 19px 21px; border: 1px solid #dae6e1; border-radius: 8px; background: #f7faf8; }
.automation-callout strong { color: #28493e; }
.automation-callout p { margin-top: 7px; }
.mini-progress { display: inline-block; width: 100px; height: 6px; margin-right: 7px; overflow: hidden; border-radius: 4px; background: #e8eeeb; vertical-align: middle; }
.mini-progress span { display: block; height: 100%; background: var(--primary); }
.compact { min-height: 28px; margin-left: 4px; padding: 5px 7px; font-size: 10px; }
.muted { color: #929d98; }
.field-help, .note { color: #7c8984; font-size: 11px; line-height: 1.5; }
.field-help { margin-top: 9px; }
.note { margin: -2px 0 13px; }
.notice-banner { margin: 0 0 14px; padding: 11px 13px; border: 1px solid #d8e4df; border-radius: 7px; background: #f7faf8; color: #53645d; font-size: 12px; line-height: 1.5; }
.notice-banner.warning { border-color: #ecd8aa; background: #fff9eb; color: #775d1f; }

.bar-list, .quota-summary, .risk-list, .health-list, .overview-users, .attention-list { display: grid; gap: 10px; margin-top: 17px; }
.bar-row { display: grid; grid-template-columns: 27px 1fr 32px; align-items: center; gap: 9px; }
.bar-track, .quota-track { height: 7px; }
.quota-line { display: grid; grid-template-columns: 1fr auto; gap: 7px 11px; color: #65736d; font-size: 12px; }
.quota-line strong { color: #285545; }
.quota-line .quota-track { grid-column: 1 / -1; }
.status-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.status-card { padding: 17px; }
.status-card h3 { margin: 0; color: #2d3d37; font-size: 15px; }
.status-card small, .status-card span { color: #7d8984; font-size: 11px; }
.status-card strong { color: #285545; }
.compact-grid { grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 16px; }
.compact-grid div { display: grid; gap: 4px; padding-right: 7px; border-right: 1px solid var(--line); }
.compact-grid div:last-child { border-right: 0; }
.quota-track.large { height: 9px; margin: 18px 0 9px; }
.risk-stat strong { display: block; margin: 7px 0 3px; font-size: 24px; }
.risk-item { display: grid; grid-template-columns: 1.2fr 1fr auto; align-items: center; gap: 11px; padding: 11px 13px; border: 1px solid #eedfc8; border-radius: 7px; background: #fffaf1; color: #665a49; }
.risk-item span, .risk-item em { color: #8b7658; font-size: 11px; }
.risk-item em { color: #99651d; font-style: normal; }
.export-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.export-card { margin-bottom: 0; }
.export-card p { min-height: 40px; margin: 11px 0 16px; }
.export-card button { width: 100%; }

.console-metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.console-panel { min-height: 210px; }
.console-toolbar { margin-top: 8px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.console-toolbar h3 { margin: 0; color: #2d3d37; font-size: 15px; }
.table-caption { color: #8c9892; font-size: 11px; }
.health-row, .overview-user { display: flex; align-items: center; gap: 10px; padding: 10px 11px; border-radius: 6px; background: var(--surface-muted); }
.health-row > div, .overview-user > div { display: grid; flex: 1; gap: 3px; min-width: 0; }
.health-row strong, .overview-user strong { color: #34453e; font-size: 12px; }
.health-row small, .overview-user small { overflow: hidden; color: #839089; font-size: 10px; text-overflow: ellipsis; }
.health-dot { width: 8px; height: 8px; border-radius: 50%; background: #a5afaa; }
.health-dot.success { background: #2d9d6c; box-shadow: 0 0 0 3px #e2f3e9; }
.health-dot.warning { background: #c68a2a; box-shadow: 0 0 0 3px #fff1d5; }
.health-dot.danger { background: #c4545a; box-shadow: 0 0 0 3px #fae4e5; }
.avatar { display: grid; place-items: center; width: 29px; height: 29px; flex: 0 0 29px; border-radius: 6px; background: #dfeee8; color: var(--primary); font-size: 11px; font-weight: 750; }
.attention-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: #34453e; text-align: left; }
.attention-row:hover { background: #f7faf8; }
.attention-row > span:nth-child(2) { display: grid; flex: 1; gap: 3px; }
.attention-row strong { font-size: 12px; }
.attention-row small { color: #839089; font-size: 10px; }
.attention-icon { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 5px; background: #edf1ef; color: #5c6a65; font-weight: 800; }
.attention-row.warning .attention-icon { background: #fff0cd; color: #8b6217; }
.attention-row.danger .attention-icon { background: #f8e2e3; color: #99434a; }
.attention-arrow { color: #9aa5a0; font-size: 16px; }

[dir="rtl"] { font-family: Tahoma, "Segoe UI", sans-serif; }
[dir="rtl"] th, [dir="rtl"] td { text-align: right; }
[dir="rtl"] .tab { padding: 9px 12px; text-align: right; }
[dir="rtl"] .tab::after { right: 0; left: auto; border-radius: 3px 0 0 3px; }

@media (max-width: 1180px) {
  .console-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .model-form { grid-template-columns: 1fr 1fr; }
  .model-form button { grid-column: 1 / -1; }
  .knowledge-form, .domain-form, .user-form, .template-form { grid-template-columns: 1fr 1fr; max-width: none; }
}

@media (max-width: 960px) {
  .shell { display: block; min-height: 100vh; }
  .topbar { grid-column: auto; position: sticky; min-height: 66px; padding: 11px 16px; }
  .nav-toggle { display: grid; }
  .tabs {
    position: fixed;
    top: 0;
    left: 0;
    width: min(82vw, 300px);
    height: 100dvh;
    transform: translateX(-102%);
    box-shadow: 18px 0 45px rgba(8, 17, 13, .24);
  }
  [dir="rtl"] .tabs { right: 0; left: auto; transform: translateX(102%); }
  .nav-backdrop { position: fixed; inset: 0; z-index: 45; display: block; min-height: 0; padding: 0; border-radius: 0; background: rgba(13, 24, 19, .48); }
  .view { min-width: 0; padding: 22px 18px 42px; }
  .profile-layout, .dashboard-grid, .insight-grid, .overview-grid { grid-template-columns: 1fr; }
  .status-grid, .export-grid { grid-template-columns: 1fr 1fr; }
  .welcome-panel, .page-heading, .automation-callout, .console-hero, .console-heading { align-items: flex-start; flex-direction: column; }
  .console-heading .actions, .hero-actions { width: 100%; }
  .console-heading .actions button, .hero-actions button { flex: 1; }
  .filterbar { flex-wrap: wrap; }
  .persona-row { grid-template-columns: 1fr; }
  .risk-item { grid-template-columns: 1fr 1fr; }
  .risk-item em { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .topbar { align-items: flex-start; flex-wrap: wrap; gap: 9px; }
  .topbar-title { width: 100%; }
  h1 { font-size: 18px; }
  .eyebrow { font-size: 9px; }
  .auth { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .auth #userLabel { flex: 1; max-width: none; }
  .auth input { flex: 1 1 130px; width: auto; }
  .auth select { min-width: 82px; }
  .view { padding: 18px 14px 34px; }
  .metrics, .console-metrics { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric { min-height: 96px; padding: 14px; }
  .metric strong { font-size: 22px; }
  .employee-view h2, .console-view h2 { font-size: 22px; }
  .welcome-panel, .console-hero { padding: 18px; }
  .knowledge-form, .domain-form, .experiment-form, .agent-form, .social-form, .asset-form, .user-form, .template-form, .model-form { grid-template-columns: 1fr; }
  .model-form button { grid-column: auto; }
  .model-stats { grid-template-columns: 1fr 1fr; }
  .model-stats div { padding: 8px; border-right: 0; }
  .status-grid, .export-grid { grid-template-columns: 1fr; }
  .compact-grid { grid-template-columns: 1fr 1fr; }
  .compact-grid div:nth-child(2) { border-right: 0; }
  .bar-row { grid-template-columns: 25px 1fr 24px; }
  .risk-item { grid-template-columns: 1fr; }
  .risk-item em { grid-column: auto; }
  .actions { width: 100%; flex-wrap: wrap; }
  .actions button { flex: 1; }
}

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

/* Bright CRM workspace refresh: keeps every existing view and control, but aligns
   the shell, filtering, tables, forms, and marketing surfaces with the approved
   reference layout using iSales' cyan/teal brand instead of its purple palette. */
:root {
  --bg: #f4f8fb;
  --surface: #ffffff;
  --surface-muted: #f8fbfd;
  --sidebar: #ffffff;
  --sidebar-active: #e7f8f3;
  --text: #1d2b36;
  --muted: #71808c;
  --line: #e5edf2;
  --primary: #068c7d;
  --primary-dark: #056f65;
  --primary-soft: #e7f8f3;
  --ai: #087bb6;
  --ai-soft: #eaf6ff;
  --shadow: 0 8px 24px rgba(25, 69, 88, .055);
  color: var(--text);
  background: var(--bg);
}

html, body { background: linear-gradient(135deg, #f7fbff 0%, #f3faf8 58%, #f7fbff 100%); }
.shell { grid-template-columns: 232px minmax(0, 1fr); grid-template-rows: 68px minmax(calc(100vh - 68px), auto); }

.topbar {
  padding: 0 32px;
  border-bottom-color: var(--line);
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 1px 0 rgba(31, 74, 96, .025);
}
.eyebrow { color: #7c8b96; }
h1 { color: #18313e; font-size: 19px; }
h2, .employee-view h2, .console-view h2 { color: #18313e; }
.auth #userLabel { color: #405661; }
.auth input, .auth select, .icon-button {
  border-color: #e1eaef;
  border-radius: 10px;
  background: #fbfdfe;
}
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline-color: rgba(6, 140, 125, .22); }
button { border-radius: 9px; background: var(--primary); box-shadow: 0 4px 10px rgba(6, 140, 125, .14); }
button:hover { background: var(--primary-dark); box-shadow: 0 7px 16px rgba(6, 140, 125, .18); }
button.secondary { border-color: #dfe9ee; background: #fff; color: #46616d; box-shadow: none; }
button.secondary:hover { border-color: #a9d6d0; background: #f0fbf8; color: #05786d; }

.tabs {
  gap: 4px;
  padding: 17px 12px 24px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  scrollbar-color: #bdd1dc transparent;
}
.nav-brand { min-height: 46px; margin: 0 8px 16px; color: #17303c; }
.brand-mark { border-radius: 12px; background: linear-gradient(135deg, #08a494, #0b77bd); box-shadow: 0 7px 16px rgba(8, 132, 144, .2); }
.brand-copy small { color: #84949e; }
.nav-section { margin: 14px 10px 5px; color: #9aa8b1; font-size: 10px; }
.tab { min-height: 40px; padding: 9px 11px; border-radius: 10px; color: #526672; font-weight: 650; }
.tab::after { left: 7px; width: 3px; height: 17px; border-radius: 4px; background: #079988; }
.tab:hover { background: #f1f8f8; color: #087e73; }
.tab.active { background: linear-gradient(90deg, #e4f8f3, #edf9ff); color: #077e73; box-shadow: inset 0 0 0 1px rgba(7, 153, 136, .07); }
.tab.active .nav-icon { color: #079889; }
.more-tools-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 38px;
  margin-top: 9px;
  padding: 8px 12px;
  border: 1px dashed #cfe0e4;
  border-radius: 10px;
  background: #fbfdfe;
  color: #66808b;
  box-shadow: none;
  font-size: 12px;
  font-weight: 650;
}
.more-tools-toggle:hover { border-color: #9ecdc9; background: #f1fbf9; color: #087f74; box-shadow: none; }
.more-tools-toggle > span { font-size: 16px; transition: transform .18s ease; }
.more-tools-toggle.expanded > span { transform: rotate(180deg); }
.nav-more { display: flex; flex-direction: column; gap: 4px; padding-top: 3px; }
.nav-more .nav-section:first-child { margin-top: 13px; }

.view { padding: 28px clamp(22px, 3vw, 46px) 52px; }
.page-heading, .console-heading { margin-bottom: 18px; }
.page-heading > div > p, .console-heading > div > p { max-width: 720px; }
.gradient-chip {
  margin-bottom: 8px;
  padding: 5px 10px;
  border: 1px solid #cceae5;
  border-radius: 999px;
  background: #effbf8;
  color: #078275;
  letter-spacing: .25px;
}
.section-kicker { color: #0c8b7f; }
.welcome-panel, .console-hero, .automation-callout {
  border-color: #dbeef0;
  border-radius: 14px;
  background: linear-gradient(105deg, #ffffff 0%, #f4fcfb 53%, #eff9ff 100%);
  box-shadow: 0 9px 26px rgba(25, 80, 96, .045);
}
.welcome-panel, .console-hero { padding: 25px 27px; }

.metric, .panel, .status-card, .table-wrap {
  border-color: var(--line);
  border-radius: 12px;
  box-shadow: 0 7px 22px rgba(30, 81, 101, .045);
}
.metric { min-height: 108px; padding: 18px; }
.metric::before { height: 3px; background: linear-gradient(90deg, #0a9c8e, #22b9c6); }
.metric strong, .quota-line strong, .status-card strong, .model-stats strong { color: #173f4f; }
.metric span, .model-stats span { color: #70818c; }
.panel { padding: 21px; }
.panel h3, .status-card h3, .console-toolbar h3 { color: #263f4b; }
.link-button { color: #078477; box-shadow: none; }
.link-button:hover { background: transparent; color: #056a62; box-shadow: none; }

input, select, textarea {
  border-color: #dfe9ee;
  border-radius: 9px;
  background: #fcfeff;
  color: #233a46;
}
input:hover, select:hover, textarea:hover { border-color: #b7d6d9; }
.form-card input, .form-card textarea, .model-form input, .model-form select { border-color: #e0eaee; background: #fbfdfe; }
.form-card, .model-card { border-radius: 14px; }
.persona-row { border-color: #e3edf0; border-radius: 10px; background: #f9fcfd; }
.save-profile { min-height: 43px; }

.filterbar, .channel-tabs {
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 4px 14px rgba(26, 77, 98, .025);
}
.filterbar { gap: 9px; }
.filterbar input, .filterbar select { min-height: 38px; }
.filterbar input { max-width: 350px; }
.channel-tabs { padding: 7px; }
.channel { border-color: transparent; border-radius: 8px; background: transparent; color: #4c6470; box-shadow: none; }
.channel:hover { background: #effaf8; color: #067e72; box-shadow: none; }
.channel.active { border-color: transparent; background: linear-gradient(100deg, #078f81, #0786ac); box-shadow: 0 5px 12px rgba(4, 137, 128, .17); }
.channel.whatsapp { color: #168660; }

.table-wrap { background: #fff; }
table { min-width: 850px; }
th, td { padding: 14px 15px; border-bottom-color: #eaf0f3; }
th { background: #fbfdfe; color: #607480; font-size: 11px; }
tbody tr:hover { background: #f5fbfa; }
.reference-table { border-radius: 12px; }
.badge, .domain-status, .pill, .status-label, .source-pill, .reason-button { border-radius: 999px; }
.source-pill { background: #e8f8f4; color: #078474; }
.reason-button, .toggle-button { background: #eaf7ff; color: #087bb6; box-shadow: none; }
.reason-button:hover, .toggle-button:hover { background: #dceffb; color: #056da4; box-shadow: none; }
.progress-track, .bar-track, .quota-track, .mini-progress { background: #e9f0f3; }
.progress-track span, .bar-track span, .quota-track span, .mini-progress span { background: linear-gradient(90deg, #079789, #10adc0); }
.completion-ring { border-color: #d7e9e8; border-top-color: #079789; color: #057f73; }
.run-icon { border-radius: 9px; background: #e8f8f5; color: #078677; }
.model-header { padding: 19px 21px; background: linear-gradient(90deg, #fbfefd, #f2fbff); }
.model-stats { padding: 19px 20px; }
.automation-callout { padding: 20px 22px; }
.notice-banner { border-color: #dcebf0; border-radius: 10px; background: #f6fcfc; color: #4b6570; }
.notice-banner.warning { border-color: #f0dfb5; background: #fffaf0; }
.health-row, .overview-user { border-radius: 9px; background: #f7fbfc; }
.attention-row { border-color: #e1ebef; border-radius: 10px; }
.attention-row:hover { background: #f6fbfc; }

@media (max-width: 960px) {
  .tabs { box-shadow: 18px 0 45px rgba(21, 59, 76, .16); }
  .nav-backdrop { background: rgba(16, 47, 61, .36); }
  .topbar { padding: 11px 16px; }
}
