:root {
  --blue: #0073cf;
  --blue-dark: #054f91;
  --navy: #0e3458;
  --navy-2: #f5faff;
  --teal: #20b6c7;
  --green: #30b26b;
  --gold: #f3a93c;
  --red: #e60012;
  --ink: #172033;
  --muted: #64748b;
  --line: #d8e0ea;
  --bg: #f4f8fc;
  --panel: #ffffff;
  --sidebar: #ffffff;
  --sidebar-2: #eef7ff;
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    linear-gradient(90deg, rgba(255,255,255,.88), rgba(255,255,255,.62)),
    url("http://124.222.106.63/SOCOTEXERP/GeneratedResources/Images/PCLoginBackground.png") center / cover no-repeat,
    #eaf1f9;
}
.login-panel {
  width: min(400px, calc(100vw - 32px));
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(164, 178, 196, .55);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(21, 52, 91, .24);
  padding: 30px;
}
.brand-row { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center;
  background: var(--blue); color: white; border-radius: 7px; font-weight: 800;
}
.login-panel h1 { font-size: 24px; margin: 0; }
.login-panel p { color: var(--muted); margin: 4px 0 0; }
.login-panel label { display: grid; gap: 7px; margin: 14px 0; color: #344054; }
.login-panel input {
  height: 40px; border: 1px solid #c9d3df; border-radius: 6px;
  padding: 0 11px; background: #fff;
}
.login-panel .check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.login-panel .check input { width: 16px; height: 16px; }
.login-panel button {
  width: 100%; height: 42px; border: 0; border-radius: 6px;
  background: var(--blue); color: white; margin-top: 10px;
}

.erp { min-height: 100vh; display: grid; grid-template-columns: 216px 1fr; background: var(--bg); font-size: 14px; }
.sidebar {
  background: var(--sidebar);
  color: #16395d; min-width: 0; display: grid; grid-template-rows: auto 1fr;
  border-right: 1px solid #dce8f4;
  box-shadow: 8px 0 26px rgba(0, 84, 148, .08);
}
.sidebar-brand { display: flex; gap: 9px; align-items: center; height: 52px; padding: 8px 12px; background: var(--sidebar-2); border-bottom: 1px solid #dceaf7; }
.sidebar-brand strong { font-size: 20px; letter-spacing: 0; line-height: 1; color: #073b6e; }
.sidebar-brand .brand-mark {
  width: 28px; height: 28px; border-radius: 7px; font-size: 7px; line-height: 1.05;
  background: linear-gradient(145deg, #0073cf, #20b6c7); color: white; text-align: center; font-weight: 800;
}
.sidebar-brand span { display: none; }
.nav-search {
  margin: 0 12px 12px; height: 34px; border: 1px solid rgba(255,255,255,.22);
  border-radius: 6px; background: rgba(255,255,255,.12); color: white; padding: 0 10px;
}
.nav-search::placeholder { color: #b8c9dd; }
#nav { overflow-y: auto; padding: 8px 0 18px; }
.nav-group { margin: 0; }
.nav-group-title {
  width: 100%; height: 43px; display: grid; grid-template-columns: 22px 1fr 16px; align-items: center;
  border: 0; border-radius: 0; background: transparent; color: #143b61;
  font-size: 14px; font-weight: 700; padding: 0 16px; cursor: pointer;
}
.nav-group-title:hover { background: #f0f8ff; color: var(--blue-dark); }
.nav-group-title small {
  font-size: 18px; line-height: 1; color: #87a4be; font-weight: 400; text-align: right;
}
.nav-group-items {
  display: grid; gap: 1px;
}
.nav-item {
  width: 100%; display: grid; grid-template-columns: 22px 1fr 16px; align-items: center;
  height: 38px; border: 0; border-radius: 0; background: transparent; color: #385b79;
  padding: 0 16px; text-align: left; font-weight: 600; font-size: 13px;
}
.nav-item:hover { background: #f3f9ff; color: var(--blue-dark); }
.nav-item.active { color: var(--blue-dark); background: #e6f5ff; box-shadow: inset 4px 0 0 var(--blue); }
.nav-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item small { color: #95abc1; text-align: right; font-size: 16px; font-weight: 400; }
.nav-icon {
  width: 17px; height: 17px; margin-right: 0; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.nav-group-title .nav-icon { color: var(--blue); }
.nav-item.active .nav-icon { color: var(--blue); }

.workspace { min-width: 0; display: grid; grid-template-rows: auto auto 1fr; }
.topbar {
  height: 46px; background: rgba(255,255,255,.98); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .03);
}
.topbar-spacer { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); font-size: 13px; }
.topbar-spacer strong { color: var(--navy); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.breadcrumb-root { color: var(--muted); white-space: nowrap; }
.breadcrumb-separator { color: #9aa9bb; }
.crumb { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.topbar h2 { font-size: 20px; margin: 0; font-weight: 650; }
.top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; height: 100%; }
.user-account { position: relative; display: inline-flex; align-items: center; height: 100%; }
.icon-button {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #344054;
}
.user-pill {
  height: 30px; display: inline-flex; align-items: center; gap: 7px;
  padding: 0 10px; border: 1px solid #cfe0ef; border-radius: 999px;
  color: #073b6e; font-weight: 700; background: #f5faff; line-height: 1;
  cursor: pointer; font-family: inherit; font-size: 14px;
}
.user-pill::before {
  display: none;
}
.user-pill::after { content: "⌄"; margin-left: 0; font-size: 12px; color: #073b6e; }
.account-menu {
  position: absolute;
  top: 40px;
  right: 0;
  min-width: 170px;
  padding: 6px 0;
  background: #fff;
  border: 1px solid #d7dee8;
  border-radius: 6px;
  box-shadow: 0 14px 32px rgba(16, 24, 40, .18);
  z-index: 90;
}
.account-menu button {
  width: 100%;
  height: 34px;
  padding: 0 18px;
  border: 0;
  background: #fff;
  color: #111827;
  text-align: left;
  font-family: inherit;
  font-size: 16px;
  cursor: pointer;
}
.account-menu button:hover { background: #eef8ff; color: var(--blue-dark); }
.bell-button {
  display: none;
}
.bell-button::before { content: ""; display: block; width: 24px; height: 24px; margin: 3px; border-radius: 50%; background: #e8eef5; }
.bell-button span {
  display: none;
  position: absolute; right: -4px; top: -3px; min-width: 30px; height: 17px; border-radius: 9px;
  background: #f00; color: #fff; font-size: 11px; line-height: 17px; font-weight: 800;
  box-shadow: 0 0 0 2px #fff;
}
.menu-button {
  border: 0; background: transparent; width: 30px; height: 30px; color: #7f8fa1; font-size: 22px;
  display: grid; place-items: center; line-height: 1; flex: 0 0 auto;
}
.tabs {
  height: 40px; display: flex; align-items: end; gap: 0; background: #fff;
  border-bottom: 1px solid var(--line); padding: 0 8px;
  overflow-x: auto; overflow-y: hidden;
}
.tab {
  height: 40px; display: flex; align-items: center; gap: 8px;
  border: 0; border-bottom: 3px solid transparent; border-radius: 0;
  background: #fff; padding: 0 15px; max-width: 170px; flex: 0 0 auto; font-size: 13px; color: #435168;
}
.tab.active { background: white; color: var(--blue-dark); border-bottom-color: var(--blue); font-weight: 700; }
.tab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab button { border: 0; background: transparent; color: #667085; }

.page-surface { min-width: 0; overflow: auto; padding: 14px; background: var(--bg); }
.page-card {
  min-width: 900px; background: white; border: 1px solid #dceaf7; border-radius: 12px;
  box-shadow: 0 14px 35px rgba(0, 84, 148, .08);
  overflow: hidden;
}
.page-toolbar {
  min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border: 0; border-bottom: 1px solid #dceaf7; background: #fbfdff;
}
.tool-left, .tool-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tool-right { margin-left: auto; }
.primary { border: 0; background: linear-gradient(135deg, var(--blue), var(--teal)); color: white; border-radius: 999px; height: 32px; padding: 0 12px; display: inline-flex; align-items: center; gap: 4px; box-shadow: 0 8px 18px rgba(0,115,207,.2); }
.secondary {
  border: 1px solid #cfd8e3; background: #fff; border-radius: 999px; height: 32px; padding: 0 10px;
  display: inline-flex; align-items: center; gap: 4px; font-size: 14px;
}
.secondary .nav-icon, .primary .nav-icon { width: 15px; height: 15px; margin-right: 0; }
.export-btn { color: var(--green); border-color: #9fe2c2; background: #f2fbf7; }
.disabled-btn { color: #b4b4b4; background: #f4f4f4; }
.reset-btn { color: var(--blue); }
.search-input { height: 32px; width: min(280px, 34vw); border: 1px solid #cbddeb; border-radius: 999px; padding: 0 13px; font-size: 14px; background: #fff; }
.meta-row {
  display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 10px;
  padding: 12px; background: #f7fbff; border-bottom: 1px solid #dceaf7;
}
.metric { border: 1px solid #dceaf7; border-radius: 11px; padding: 10px 12px; background: white; }
.metric strong { display: block; font-size: 17px; line-height: 1.15; }
.metric span { color: var(--muted); font-size: 12px; }

.ops-dashboard {
  display: grid;
  gap: 14px;
  min-width: 980px;
}
.ops-hero {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px;
  border: 1px solid #cbe4f7;
  border-radius: 14px;
  background:
    radial-gradient(circle at 82% 15%, rgba(255,255,255,.26), transparent 28%),
    linear-gradient(115deg, #0073cf, #129bd8 52%, #20b6c7),
    #0073cf;
  color: white;
  box-shadow: 0 20px 45px rgba(0, 115, 207, .22);
}
.ops-hero h1 { margin: 6px 0 8px; font-size: 28px; letter-spacing: 0; }
.ops-hero p { margin: 0; max-width: 720px; color: #d8e7f5; line-height: 1.55; }
.eyebrow { color: #e6fbff; font-weight: 800; font-size: 12px; letter-spacing: .08em; }
.assistant-cta {
  height: 38px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 999px;
  background: rgba(255,255,255,.2);
  color: white;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  white-space: nowrap;
}
.assistant-cta .nav-icon { margin: 0; }
.ops-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ops-kpis article {
  min-height: 96px;
  border: 1px solid #dceaf7;
  border-radius: 12px;
  background: #fff;
  padding: 14px 16px;
  box-shadow: 0 10px 28px rgba(0, 84, 148, .06);
}
.ops-kpis span,
.ops-kpis em { display: block; color: var(--muted); font-style: normal; font-size: 13px; }
.ops-kpis strong { display: block; margin: 8px 0 5px; color: var(--blue-dark); font-size: 30px; line-height: 1; }
.ops-grid { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 12px; }
.ops-panel {
  border: 1px solid #dceaf7;
  border-radius: 12px;
  background: #fff;
  min-height: 260px;
  box-shadow: 0 10px 28px rgba(0, 84, 148, .06);
  overflow: hidden;
}
.ops-panel header {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid #e2edf7;
  background: #fbfdff;
}
.ops-panel header span { font-weight: 800; color: #073b6e; }
.ops-panel header button {
  height: 28px;
  border: 1px solid #cdd8e5;
  border-radius: 6px;
  background: #f4faff;
  color: var(--blue);
  padding: 0 10px;
}
.pipeline { display: grid; gap: 10px; padding: 14px; }
.pipeline div { border-left: 4px solid var(--blue); background: #f7fbff; border-radius: 10px; padding: 12px 13px; }
.pipeline strong,
.insight-list strong { display: block; color: #073b6e; }
.pipeline span,
.insight-list span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.insight-list { list-style: none; margin: 0; padding: 14px; display: grid; gap: 12px; }
.insight-list li { border-bottom: 1px solid #edf2f7; padding-bottom: 12px; }
.insight-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.data-links { display: grid; gap: 10px; padding: 14px; }
.data-links button {
  height: 44px;
  border: 1px solid #dce5ef;
  border-radius: 10px;
  background: #fbfdff;
  color: #073b6e;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-weight: 700;
}
.data-links span { color: var(--blue); font-weight: 700; font-size: 12px; }

.home-dashboard {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 6px;
}
.welcome-card,
.todo-card {
  background: #fff;
  border: 1px solid #bfc7d1;
  border-radius: 5px;
  min-height: 176px;
  box-shadow: 0 2px 8px rgba(0,0,0,.22);
}
.welcome-card {
  padding: 16px 14px 10px;
  outline: 3px solid rgba(64, 169, 255, .25);
}
.hello { font-size: 14px; margin-bottom: 13px; }
.hello span { color: #1677ff; margin-left: 14px; }
.date-line { color: #888; font-size: 14px; margin-bottom: 9px; }
.quick-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.quick-card {
  height: 92px; border: 0; border-radius: 8px; background: #f0f0e8;
  display: grid; grid-template-columns: 42px 1fr; grid-template-rows: 44px 1fr;
  align-items: center; text-align: left; padding: 0 18px;
}
.quick-icon {
  color: #1e90ff; font-size: 32px; grid-row: span 2;
}
.quick-icon.task { font-size: 30px; }
.quick-card strong { font-size: 14px; }
.quick-card em {
  color: #ff9800; font-style: normal; font-size: 28px; font-weight: 700;
  text-decoration: underline; text-align: center;
}
.todo-card header {
  height: 28px; color: #006dff; font-weight: 700; font-size: 14px;
  padding: 6px 12px; border-bottom: 0;
}
.todo-card header::before { content: "▶"; margin-right: 3px; }
.todo-empty {
  padding: 55px 48px; color: #e60012; font-size: 22px;
}
.empty-cell {
  height: 120px; color: #8b96a8; text-align: center; font-size: 14px;
}
.erp-grid td { font-size: 15px; }
.fallback-card { min-height: calc(100vh - 92px); }
.fallback-card .page-toolbar { border-bottom-width: 4px; }
.fallback-grid td { font-size: 13px; }
.fallback-grid tbody tr:only-child td { background: #e8f5ff; }

table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th, td { border: 1px solid #dbe3ed; padding: 0 7px; height: 34px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
th { background: #f4f7fb; color: #5c6b80; font-weight: 600; text-align: left; font-size: 13px; }
tr:hover td { background: #f8fbff; }
tr:nth-child(odd):not(.selected-row) td { background: #f5faff; }
tr.selected-row td { background: #d7f4f0; }
tr.selected-row td:nth-child(3) { outline: 2px solid var(--teal); outline-offset: -2px; }
.row-number { text-align: center; color: #7d8999; background: #f6f8fb !important; }
.status { color: #067647; background: #ecfdf3; border-radius: 999px; padding: 2px 8px; }
.pagination {
  height: 38px; display: flex; justify-content: flex-start; align-items: center; gap: 8px;
  padding: 0 10px; color: #5d6c82; border-top: 1px solid var(--line); font-size: 13px; background: #fff;
}
.pagination strong {
  display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center;
  background: var(--blue); color: #fff; border-radius: 4px;
}
.pagination input { width: 58px; height: 26px; border: 1px solid #d4d7dd; text-align: center; }
.pagination select { height: 28px; border: 1px solid #d4d7dd; color: #666; }
.pagination em { margin-left: auto; font-style: normal; color: #5d6470; }
.page-arrow { width: 26px; height: 26px; border: 1px solid #d4d7dd; background: #f7f9fc; color: #9aa4b2; border-radius: 4px; }

.form-grid { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 12px; padding: 14px; background: #fff; }
.field { display: grid; gap: 6px; color: #475467; font-size: 13px; }
.field input, .field select, .field textarea {
  height: 34px; border: 1px solid var(--line); border-radius: 6px; padding: 0 9px; background: #fbfdff;
}
.field textarea { height: 76px; padding-top: 8px; resize: vertical; }
.field.wide { grid-column: span 2; }

.website-inquiry-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  align-items: start;
  padding: 12px;
}
.website-inquiry-detail {
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  color: var(--muted);
}
.website-inquiry-detail h3,
.website-inquiry-detail h4 {
  color: var(--navy);
  margin: 0 0 12px;
}
.website-inquiry-card {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 7px 10px;
  margin: 0 0 12px;
}
.website-inquiry-card dt {
  color: var(--muted);
  font-size: 12px;
}
.website-inquiry-card dd {
  margin: 0;
  color: var(--navy);
  font-weight: 700;
  word-break: break-word;
}
.website-inquiry-message {
  background: var(--navy-2);
  border-radius: 8px;
  padding: 10px;
  margin: 12px 0;
  color: var(--navy);
  line-height: 1.55;
  white-space: pre-wrap;
}
.website-inquiry-items {
  display: grid;
  gap: 8px;
}
.website-inquiry-items article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdff;
}
.website-inquiry-items strong,
.website-inquiry-items span,
.website-inquiry-items small,
.website-inquiry-items em {
  display: block;
}
.website-inquiry-items span,
.website-inquiry-items small,
.website-inquiry-items em {
  margin-top: 4px;
  color: var(--muted);
}
.website-inquiry-items em {
  font-style: normal;
  color: var(--navy);
}

.ai-workbench {
  min-height: calc(100vh - 86px);
}
.ai-status {
  color: #667085;
  font-size: 13px;
}
.ai-layout {
  display: grid;
  grid-template-columns: minmax(360px, 38%) 1fr;
  min-height: calc(100vh - 136px);
}
.ai-input-panel {
  border-right: 1px solid #d7d7d7;
  padding: 14px;
  background: #fbfcfe;
}
.mailbox-config {
  border: 1px solid #dceaf7;
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
  margin-bottom: 12px;
  display: grid;
  gap: 3px;
}
.mailbox-config strong { color: #073b6e; }
.mailbox-config span { color: #64748b; font-size: 12px; line-height: 1.45; }
.mailbox-config.warning { border-color: #f4cf87; background: #fffaf0; }
.mailbox-config.warning strong { color: #9a5b00; }
.mailbox-config.connected { border-color: #a8e1c2; background: #f2fbf7; }
.mailbox-config.connected strong { color: #067647; }
.ai-inbox-head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.ai-inbox-head strong { color: #073b6e; }
.ai-inbox-head input {
  height: 30px;
  border: 1px solid #cbddeb;
  border-radius: 999px;
  padding: 0 12px;
  background: #fff;
}
.ai-inbox {
  max-height: 210px;
  overflow: auto;
  border: 1px solid #dceaf7;
  border-radius: 10px;
  background: #fff;
  margin-bottom: 12px;
}
.email-row {
  width: 100%;
  min-height: 62px;
  border: 0;
  border-bottom: 1px solid #edf3f8;
  background: #fff;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 10px;
  text-align: left;
  padding: 9px 10px;
}
.email-row:last-child { border-bottom: 0; }
.email-row:hover,
.email-row.active { background: #eef8ff; }
.email-row strong,
.email-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.email-row strong { color: #073b6e; }
.email-row span { color: #64748b; font-size: 12px; }
.email-row em {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  color: var(--blue);
  font-style: normal;
  font-size: 12px;
}
.email-row[data-status="replied"] strong { color: var(--muted); }
.email-row[data-status="replied"]::after {
  content: "✓";
  color: var(--green);
  font-size: 11px;
  margin-left: 4px;
}
.email-erp-tag {
  font-size: 11px;
  color: var(--blue);
  background: var(--navy-2);
  border-radius: 4px;
  padding: 1px 5px;
  width: fit-content;
}
.inbox-empty { padding: 16px; }
.ai-input-panel .field {
  margin-bottom: 12px;
}
.ai-input-panel .field.wide {
  grid-column: auto;
}
.ai-input-panel textarea {
  height: 420px;
  line-height: 1.45;
}
.ai-result-panel {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 10px;
  padding: 12px;
}
.ai-box {
  border: 1px solid #d7d7d7;
  border-radius: 4px;
  background: #fff;
  padding: 12px;
}
.ai-box h3 {
  margin: 0 0 10px;
  font-size: 15px;
}
.erp-context-box { border-left: 4px solid var(--blue); }
.erp-customer-card {
  background: var(--navy-2);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 8px 0;
}
.erp-customer-card dl { margin: 0; }
.erp-customer-card dt { color: var(--muted); font-size: 12px; }
.erp-customer-card dd { margin: 0; font-weight: 600; color: var(--navy); }
.erp-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 10px 12px;
  color: #92400e;
  margin-bottom: 8px;
}
.confidence-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
}
.confidence-track {
  flex: 1;
  height: 6px;
  background: #e8edf4;
  border-radius: 3px;
}
.confidence-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--blue), var(--teal));
  transition: width 600ms ease;
}
.reply-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
}
.intent-tag {
  display: inline-block;
  font-size: 11px;
  color: var(--blue);
  background: #eef8ff;
  border: 1px solid #dceaf7;
  border-radius: 999px;
  padding: 1px 7px;
}
.ai-intel-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.link-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-weight: 700;
}
.ai-muted {
  color: #8a94a6;
  font-size: 14px;
}
.ai-list {
  margin: 8px 0 0;
  padding-left: 22px;
  color: #334155;
  line-height: 1.55;
}
.ai-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  margin: 8px 0 0;
}
.ai-facts div {
  border: 1px solid #e4edf6;
  border-radius: 4px;
  background: #f8fbff;
  padding: 8px;
}
.ai-facts dt {
  color: #64748b;
  font-size: 12px;
  margin-bottom: 3px;
}
.ai-facts dd {
  margin: 0;
  color: #0f172a;
  word-break: break-word;
}
.ai-match {
  width: 100%;
  border: 1px solid #dce6f2;
  border-radius: 4px;
  background: #f8fbff;
  color: #1f2937;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  text-align: left;
  padding: 9px 10px;
  margin-bottom: 8px;
}
.ai-match span {
  color: #667085;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-match em {
  color: #1688ff;
  font-style: normal;
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
}
.reply-box textarea {
  width: 100%;
  min-height: 260px;
  border: 1px solid #d7d7d7;
  border-radius: 4px;
  padding: 10px;
  resize: vertical;
  line-height: 1.45;
}

.modal {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .34);
  display: grid; place-items: center; z-index: 30;
}
.modal-card {
  width: min(720px, calc(100vw - 32px)); background: white; border-radius: 8px;
  border: 1px solid var(--line); box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
}
.modal-card header, .modal-card footer { height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid var(--line); }
.modal-card footer { border-top: 1px solid var(--line); border-bottom: 0; justify-content: flex-end; gap: 8px; }
.modal-card h3 { margin: 0; font-size: 18px; }
.modal-body { padding: 4px 0; }
.modal-card footer button { height: 34px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--line); background: white; }
.modal-card footer button[type=submit] { border-color: var(--blue); background: var(--blue); color: white; }
.toast {
  position: fixed; right: 20px; bottom: 20px; padding: 10px 14px; background: #101828;
  color: white; border-radius: 6px; z-index: 40; box-shadow: 0 16px 40px rgba(15, 23, 42, .25);
}

@media (max-width: 900px) {
  body { overflow-x: auto; }
  .erp {
    grid-template-columns: 176px minmax(760px, 1fr);
    width: max-content;
    min-width: 936px;
  }
  .sidebar {
    display: grid;
    position: sticky;
    left: 0;
    top: 0;
    z-index: 20;
    height: 100vh;
  }
  .sidebar-brand { height: 46px; padding: 6px 9px; }
  .sidebar-brand strong { font-size: 17px; }
  .sidebar-brand .brand-mark { width: 24px; height: 24px; font-size: 6px; }
  .nav-group-title { height: 40px; grid-template-columns: 20px 1fr 14px; padding: 0 10px; font-size: 13px; }
  .nav-item { height: 36px; grid-template-columns: 20px 1fr 14px; padding: 0 10px; font-size: 12px; }
  .nav-icon { width: 16px; height: 16px; }
  .topbar { height: 44px; align-items: center; padding: 0 12px; gap: 12px; }
  .meta-row, .form-grid { grid-template-columns: 1fr 1fr; }
  .website-inquiry-layout { grid-template-columns: 1fr; }
  .page-card { min-width: 760px; }
  .ops-dashboard { min-width: 760px; }
  .ops-hero { align-items: flex-start; flex-direction: column; }
  .ops-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-grid { grid-template-columns: 1fr; }
}
