:root {
  color-scheme: light;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --sidebar-top: #082a56;
  --sidebar-bottom: #0b356e;
  --blue-soft: #eaf1ff;
  --cyan: #0891b2;
  --cyan-soft: #e9f8fb;
  --green: #15966b;
  --green-dark: #0b7555;
  --green-soft: #e9f8f1;
  --amber: #c97808;
  --amber-soft: #fff5df;
  --red: #d94655;
  --red-soft: #fff0f2;
  --violet: #7454cc;
  --violet-soft: #f1edff;
  --ink: #12213b;
  --muted: #66758e;
  --line: #dce5f1;
  --line-soft: #edf2f8;
  --surface: #fff;
  --canvas: #f3f7fc;
  --shadow: 0 12px 34px rgba(31, 62, 104, .08);
  --shadow-soft: 0 5px 18px rgba(38, 65, 105, .05);
  --radius: 18px;
  --radius-sm: 12px;
  font-family: "Roboto", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--ink); background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid rgba(37, 99, 235, .22); outline-offset: 2px; }
a { color: inherit; text-decoration: none; }
svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.is-loading .app-shell { visibility: hidden; }
.loading-screen { position: fixed; inset: 0; z-index: 200; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); background: var(--canvas); font-size: 13px; }
body:not(.is-loading) .loading-screen { display: none; }
.loader-mark { width: 62px; height: 62px; display: grid; place-items: center; animation: pulse 1.2s ease-in-out infinite; }
.loader-mark img { width: 100%; height: 100%; object-fit: contain; }
@keyframes pulse { 50% { transform: translateY(-4px); } }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 60; width: 252px; padding: 22px 16px; display: flex; flex-direction: column; justify-content: space-between; color: #fff; background: radial-gradient(circle at 22% 8%, rgba(65,142,255,.28), transparent 28%), linear-gradient(180deg, var(--sidebar-top), var(--sidebar-bottom)); box-shadow: 12px 0 36px rgba(12,42,78,.08); transition: transform .22s ease; }
.brand { min-height: 80px; padding: 0 8px 21px; display: flex; align-items: center; border-bottom: 1px solid rgba(255,255,255,.13); }
.brand img { width: 100%; max-width: 176px; height: 58px; object-fit: contain; object-position: left center; }
.brand-fallback { font-size: 28px; font-weight: 900; letter-spacing: -.06em; }
.workspace-label { margin: 24px 12px 8px; color: #91afd6; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.side-nav { display: grid; gap: 5px; }
.nav-item { min-height: 45px; padding: 10px 12px; display: flex; align-items: center; gap: 11px; border-radius: 11px; color: #d7e8ff; font-size: 13px; font-weight: 650; transition: background .16s ease, color .16s ease, transform .16s ease; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.08); transform: translateX(2px); }
.nav-item.is-active { color: #fff; background: linear-gradient(90deg, var(--primary-dark), var(--primary)); box-shadow: 0 8px 18px rgba(5,26,55,.2); }
.nav-item small { min-width: 22px; margin-left: auto; padding: 3px 6px; border-radius: 999px; color: #d7e8ff; background: rgba(255,255,255,.1); font-size: 8px; text-align: center; }
.nav-icon { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.22); border-radius: 7px; }
.nav-icon svg { width: 14px; height: 14px; }
.sidebar-footer { display: grid; gap: 16px; padding: 14px; border: 1px solid rgba(255,255,255,.13); border-radius: 14px; background: rgba(255,255,255,.06); }
.sidebar-footer a { font-size: 11px; font-weight: 700; }
.sidebar-footer p { margin: 0; color: #a9c6ec; font-size: 9px; line-height: 1.5; }
.sidebar-footer p span { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #54e2a4; box-shadow: 0 0 0 5px rgba(84,226,164,.14); }

.main-column { margin-left: 252px; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 50; height: 76px; padding: 0 30px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid rgba(220,229,241,.92); background: rgba(255,255,255,.92); backdrop-filter: blur(16px); }
.breadcrumb { display: flex; gap: 9px; color: #8b99ad; font-size: 11px; }
.breadcrumb span::after { content: '/'; margin-left: 9px; color: #bcc7d6; }
.breadcrumb strong { color: var(--ink); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: #fff; background: linear-gradient(135deg, var(--sidebar-top), #3475d4); font-size: 12px; font-weight: 800; }
.user-copy { min-width: 130px; }
.user-copy strong, .user-copy small { display: block; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { font-size: 12px; }
.user-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.text-button { border: 0; color: var(--primary); background: transparent; font-size: 10px; font-weight: 800; cursor: pointer; }
.icon-button { display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: #fff; cursor: pointer; }
.icon-button.always { display: grid; place-items: center; font-size: 22px; }
.icon-button svg { width: 19px; height: 19px; }

main { width: min(1600px, 100%); margin: 0 auto; padding: 30px 30px 64px; }
.page-section { display: none; animation: sectionIn .18s ease; }
.page-section.is-active { display: block; }
@keyframes sectionIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.hero { position: relative; min-height: 188px; padding: 32px 36px; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 30px; border-radius: 22px; color: #fff; background: radial-gradient(circle at 80% 10%, rgba(68,153,255,.44), transparent 25%), linear-gradient(112deg, var(--sidebar-top), var(--sidebar-bottom) 65%, var(--primary) 120%); box-shadow: var(--shadow); }
.hero::after { content: ''; position: absolute; width: 260px; height: 260px; right: -80px; bottom: -150px; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; box-shadow: 0 0 0 34px rgba(255,255,255,.04), 0 0 0 68px rgba(255,255,255,.025); }
.hero > * { position: relative; z-index: 1; }
.hero-copy { min-width: 0; max-width: 900px; }
.eyebrow { margin: 0 0 8px; color: #9fc8ff; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.eyebrow.dark { color: var(--primary); }
.hero h1 { margin: 0; font-size: clamp(28px, 3vw, 42px); line-height: 1.08; letter-spacing: -.04em; }
.hero-copy > p:last-child { max-width: 790px; margin: 13px 0 0; color: #d8e8fb; font-size: 13px; line-height: 1.65; }
.hero-status { min-width: 246px; padding: 16px 18px; display: flex; align-items: center; gap: 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 15px; background: rgba(255,255,255,.1); backdrop-filter: blur(8px); }
.hero-status-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: #7df0bd; background: rgba(255,255,255,.12); }
.hero-status-icon svg { width: 21px; height: 21px; }
.hero-status strong, .hero-status small { display: block; }
.hero-status strong { font-size: 11px; }
.hero-status small { margin-top: 5px; color: #c2daf7; font-size: 9px; }

.kpi-grid { margin-top: 16px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.kpi-grid.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi-card { min-height: 112px; padding: 17px 16px; display: flex; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); }
.kpi-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 14px; font-size: 12px; font-weight: 900; }
.kpi-icon.blue { color: var(--primary); background: var(--blue-soft); }
.kpi-icon.cyan { color: var(--cyan); background: var(--cyan-soft); }
.kpi-icon.green { color: var(--green); background: var(--green-soft); }
.kpi-icon.amber { color: var(--amber); background: var(--amber-soft); }
.kpi-icon.red { color: var(--red); background: var(--red-soft); }
.kpi-icon.violet { color: var(--violet); background: var(--violet-soft); }
.kpi-card div > span { color: var(--muted); font-size: 9px; font-weight: 700; }
.kpi-card strong { display: block; margin: 5px 0 4px; font-size: 24px; letter-spacing: -.04em; }
.kpi-card small { color: #8594a9; font-size: 8.5px; line-height: 1.35; }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); }
.panel-heading { min-height: 66px; padding: 17px 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line-soft); }
.panel-heading h2 { margin: 3px 0 0; font-size: 16px; letter-spacing: -.025em; }
.panel-kicker { color: var(--primary); font-size: 8.5px; font-weight: 800; letter-spacing: .11em; }
.status-pill { padding: 6px 10px; border-radius: 999px; font-size: 8.5px; font-weight: 800; }
.status-pill.safe { color: var(--green-dark); background: var(--green-soft); }
.status-pill.warning { color: var(--amber); background: var(--amber-soft); }
.status-pill.danger { color: var(--red); background: var(--red-soft); }
.status-pill.info { color: var(--primary); background: var(--blue-soft); }
.status-pill.violet { color: var(--violet); background: var(--violet-soft); }

.schema-banner { margin-top: 16px; padding: 15px 17px; display: flex; align-items: center; gap: 13px; border: 1px solid #c9d9f5; border-radius: var(--radius); background: linear-gradient(135deg, #fff, #f6f9ff); }
.schema-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; color: var(--primary); background: var(--blue-soft); font-weight: 900; }
.schema-banner strong { font-size: 11px; }
.schema-banner p { margin: 4px 0 0; color: var(--muted); font-size: 9.5px; }
.schema-banner button { margin-left: auto; padding: 9px 13px; border: 1px solid #b9cdf4; border-radius: 10px; color: var(--primary); background: #fff; font-size: 9px; font-weight: 800; cursor: pointer; }

.dashboard-grid { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, .7fr); gap: 15px; align-items: start; }
.pipeline { padding: 22px; display: grid; grid-template-columns: repeat(7, auto); align-items: center; justify-content: space-between; gap: 10px; }
.pipeline div { min-width: 150px; }
.pipeline div > span { width: 28px; height: 28px; display: grid; place-items: center; margin-bottom: 12px; border-radius: 9px; color: var(--primary); background: var(--blue-soft); font-size: 9px; font-weight: 900; }
.pipeline strong, .pipeline small { display: block; }
.pipeline strong { font-size: 11px; }
.pipeline small { margin-top: 5px; color: var(--muted); font-size: 8.5px; line-height: 1.45; }
.pipeline i { color: #a9b9ce; font-style: normal; font-size: 18px; }
.attention-list { padding: 8px 18px 18px; display: grid; gap: 3px; }
.attention-item { padding: 12px 0; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid var(--line-soft); }
.attention-item:last-child { border-bottom: 0; }
.attention-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 5px var(--amber-soft); }
.attention-dot.red { background: var(--red); box-shadow: 0 0 0 5px var(--red-soft); }
.attention-dot.blue { background: var(--primary); box-shadow: 0 0 0 5px var(--blue-soft); }
.attention-item div { min-width: 0; }
.attention-item strong, .attention-item span { display: block; }
.attention-item strong { font-size: 10px; }
.attention-item span { margin-top: 3px; color: var(--muted); font-size: 8.5px; }
.attention-item b { margin-left: auto; color: var(--ink); font-size: 13px; }
.link-button { border: 0; color: var(--primary); background: transparent; font-size: 9px; font-weight: 800; cursor: pointer; }
.activity-panel { margin-top: 15px; }
.activity-list { padding: 10px 20px 18px; }
.activity-row { min-height: 56px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; border-bottom: 1px solid var(--line-soft); }
.activity-row:last-child { border-bottom: 0; }
.activity-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: var(--primary); background: var(--blue-soft); font-size: 10px; font-weight: 900; }
.activity-row strong, .activity-row small { display: block; }
.activity-row strong { font-size: 10px; }
.activity-row small { margin-top: 4px; color: var(--muted); font-size: 8.5px; }
.activity-row time { color: #91a0b4; font-size: 8px; }

.page-heading { margin-bottom: 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.page-heading h1 { margin: 0; font-size: 27px; letter-spacing: -.04em; }
.page-heading p:last-child { max-width: 720px; margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.primary-button, .ghost-button { min-height: 40px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 11px; font-size: 10px; font-weight: 800; cursor: pointer; }
.primary-button { border: 1px solid var(--primary); color: #fff; background: linear-gradient(135deg, var(--primary), #4668ef); box-shadow: 0 8px 18px rgba(37,99,235,.18); }
.primary-button:hover { transform: translateY(-1px); }
.ghost-button { border: 1px solid var(--line); color: #344762; background: #fff; }
.ghost-button.compact { min-height: 34px; padding: 0 11px; font-size: 9px; }
.ghost-button:hover { border-color: #b8c9e4; background: #f9fbff; }

.toolbar { margin-bottom: 14px; padding: 12px; display: grid; grid-template-columns: minmax(260px, 1fr) 190px 190px auto; gap: 10px; }
.search-field { min-height: 42px; padding: 0 13px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.search-field svg { width: 17px; height: 17px; color: #8290a4; }
.search-field input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 10px; }
.toolbar select, .field-grid select, .field-grid input, .field-grid textarea { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: #fff; font-size: 10px; }
.toolbar select { padding: 0 12px; }

.table-card { overflow: hidden; }
.table-wrap { overflow-x: auto; }
.table-wrap.wide table { min-width: 1220px; }
table { width: 100%; border-collapse: collapse; }
th { height: 44px; padding: 0 14px; color: #77869c; background: #f7f9fc; font-size: 8.5px; font-weight: 800; letter-spacing: .03em; text-align: left; white-space: nowrap; }
td { min-height: 62px; padding: 11px 14px; border-top: 1px solid var(--line-soft); color: #34445e; font-size: 9.5px; vertical-align: middle; }
tbody tr:hover { background: #fbfcff; }
.product-cell { min-width: 260px; display: flex; align-items: center; gap: 11px; }
.product-thumb { width: 48px; height: 48px; flex: 0 0 auto; overflow: hidden; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; color: var(--primary); background: var(--blue-soft); font-size: 11px; font-weight: 900; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-copy { min-width: 0; }
.product-copy strong, .product-copy small { display: block; }
.product-copy strong { max-width: 390px; overflow: hidden; color: #17325b; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.product-copy small { margin-top: 4px; color: #8a98aa; font-size: 8.5px; }
.metric-copy strong, .metric-copy small { display: block; }
.metric-copy strong { font-size: 11px; }
.metric-copy small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.row-actions { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.row-button { min-height: 30px; padding: 0 9px; border: 1px solid #c9d9f4; border-radius: 9px; color: var(--primary); background: #fff; font-size: 8px; font-weight: 800; cursor: pointer; }
.row-button:hover { background: var(--blue-soft); }
.row-button.danger { border-color: #f4c7ce; color: var(--red); }
.row-button.success { border-color: #bfe8d6; color: var(--green); }
.chip-list { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { padding: 5px 7px; border-radius: 999px; color: #49617f; background: #f0f4f9; font-size: 8px; font-weight: 700; }
.chip.blue { color: var(--primary); background: var(--blue-soft); }
.chip.green { color: var(--green-dark); background: var(--green-soft); }
.chip.amber { color: var(--amber); background: var(--amber-soft); }
.empty-state { min-height: 180px; padding: 40px 20px; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--muted); text-align: center; }
.empty-state strong { color: var(--ink); font-size: 13px; }
.empty-state span { font-size: 10px; }

.mapping-summary { margin-bottom: 15px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.mapping-summary article { padding: 17px 19px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-soft); }
.mapping-summary span, .mapping-summary strong, .mapping-summary small { display: block; }
.mapping-summary span { color: var(--muted); font-size: 9px; font-weight: 700; }
.mapping-summary strong { margin: 6px 0 3px; font-size: 23px; }
.mapping-summary small { color: #8997aa; font-size: 8.5px; }
.mapping-list { display: grid; gap: 12px; }
.mapping-card { padding: 17px; display: grid; grid-template-columns: minmax(0, 1fr) 46px minmax(0, 1fr) 250px; align-items: center; gap: 15px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-soft); }
.mapping-product { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mapping-arrow { color: #98a8bd; font-size: 20px; text-align: center; }
.match-score { padding: 13px; border-radius: 13px; background: #f7f9fc; }
.match-score strong { display: block; font-size: 20px; }
.match-score small { color: var(--muted); font-size: 8px; }
.signal-bars { margin-top: 8px; display: grid; gap: 5px; }
.signal-bar { display: grid; grid-template-columns: 52px 1fr 28px; align-items: center; gap: 6px; color: #7d8b9e; font-size: 7.5px; }
.signal-bar i { height: 5px; overflow: hidden; border-radius: 99px; background: #e4ebf4; }
.signal-bar i::after { content: ''; display: block; width: var(--score, 0%); height: 100%; border-radius: inherit; background: var(--primary); }
.mapping-actions { margin-top: 10px; display: flex; gap: 6px; }

.tabs { margin-bottom: 12px; padding: 5px; width: fit-content; display: flex; gap: 4px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.tabs button { min-height: 32px; padding: 0 11px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 9px; font-weight: 750; cursor: pointer; }
.tabs button.is-active { color: var(--primary); background: var(--blue-soft); }

.supplier-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.supplier-card { padding: 19px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-soft); }
.supplier-head { display: flex; align-items: center; gap: 12px; }
.supplier-avatar { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; color: #fff; background: linear-gradient(135deg, var(--sidebar-top), var(--primary)); font-size: 11px; font-weight: 900; }
.supplier-head strong, .supplier-head small { display: block; }
.supplier-head strong { font-size: 12px; }
.supplier-head small { margin-top: 4px; color: var(--muted); font-size: 8.5px; }
.supplier-stats { margin-top: 17px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.supplier-stats div { padding: 10px; border-radius: 11px; background: #f7f9fc; }
.supplier-stats strong, .supplier-stats span { display: block; }
.supplier-stats strong { font-size: 16px; }
.supplier-stats span { margin-top: 3px; color: var(--muted); font-size: 7.5px; }
.supplier-foot { margin-top: 15px; display: flex; align-items: center; justify-content: space-between; }

.history-panel { overflow: hidden; }
.history-list { padding: 0 20px; }
.history-item { position: relative; min-height: 75px; padding: 16px 0 16px 47px; border-bottom: 1px solid var(--line-soft); }
.history-item:last-child { border-bottom: 0; }
.history-item::before { content: ''; position: absolute; left: 14px; top: 22px; width: 12px; height: 12px; border: 3px solid #fff; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px var(--blue-soft); }
.history-item::after { content: ''; position: absolute; left: 19px; top: 37px; bottom: -17px; width: 1px; background: var(--line); }
.history-item:last-child::after { display: none; }
.history-item strong, .history-item small { display: block; }
.history-item strong { font-size: 10.5px; }
.history-item p { margin: 5px 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.history-item small { color: #94a1b3; font-size: 8px; }

.access-error { min-height: 220px; margin-top: 50px; padding: 30px; display: flex; align-items: center; gap: 18px; border: 1px solid #f3c6cc; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.access-error-icon { width: 50px; height: 50px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 15px; color: var(--red); background: var(--red-soft); font-size: 20px; font-weight: 900; }
.access-error strong { font-size: 15px; }
.access-error p { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.access-error a { margin-left: auto; color: var(--primary); font-size: 10px; font-weight: 800; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(5, 18, 36, .28); backdrop-filter: blur(2px); }
.detail-drawer { position: fixed; inset: 0 0 0 auto; z-index: 100; width: min(560px, 94vw); display: flex; flex-direction: column; border-left: 1px solid var(--line); background: #fff; box-shadow: -24px 0 60px rgba(15,39,73,.18); transform: translateX(104%); transition: transform .22s ease; }
.detail-drawer.is-open { transform: translateX(0); }
.drawer-head { min-height: 78px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 4px 0 0; font-size: 18px; letter-spacing: -.03em; }
.drawer-content { padding: 20px; overflow-y: auto; }
.drawer-card { margin-bottom: 13px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.drawer-card h3 { margin: 0 0 12px; font-size: 12px; }
.drawer-product { display: flex; gap: 13px; }
.drawer-product .product-thumb { width: 72px; height: 72px; }
.drawer-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.drawer-grid div { padding: 10px; border-radius: 10px; background: #f7f9fc; }
.drawer-grid span, .drawer-grid strong { display: block; }
.drawer-grid span { color: var(--muted); font-size: 7.5px; }
.drawer-grid strong { margin-top: 4px; font-size: 10px; }
.quote-matrix { overflow-x: auto; }
.quote-matrix table { min-width: 580px; }
.quote-matrix td, .quote-matrix th { padding: 8px; font-size: 8px; text-align: center; }
.chat-box { min-height: 220px; display: flex; flex-direction: column; }
.chat-messages { flex: 1; display: grid; align-content: start; gap: 8px; }
.chat-message { max-width: 83%; padding: 9px 11px; border-radius: 12px 12px 12px 4px; color: #40516b; background: #f0f4fa; font-size: 9px; line-height: 1.5; }
.chat-message.mine { margin-left: auto; border-radius: 12px 12px 4px 12px; color: #fff; background: var(--primary); }
.chat-compose { margin-top: 12px; display: flex; gap: 8px; }
.chat-compose input { flex: 1; min-height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; font-size: 9px; }

.cost-dialog { width: min(680px, calc(100vw - 30px)); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 30px 80px rgba(10,31,63,.24); }
.cost-dialog::backdrop { background: rgba(5,18,36,.42); backdrop-filter: blur(3px); }
.cost-dialog form { margin: 0; }
.dialog-head { padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 4px 0 0; font-size: 18px; }
.dialog-summary { margin: 18px 20px 0; padding: 13px; border: 1px solid #cddcf5; border-radius: 12px; background: #f7faff; color: #49617f; font-size: 9.5px; line-height: 1.55; }
.field-grid { padding: 18px 20px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
.field-grid label { color: #40516b; font-size: 9px; font-weight: 750; }
.field-grid input, .field-grid select, .field-grid textarea { margin-top: 7px; padding: 9px 11px; resize: vertical; }
.field-grid .full { grid-column: 1 / -1; }
.dialog-actions { padding: 14px 20px 20px; display: flex; justify-content: flex-end; gap: 9px; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 150; max-width: min(380px, calc(100vw - 48px)); padding: 13px 16px; border-radius: 12px; color: #fff; background: #152b4d; box-shadow: 0 16px 40px rgba(12,35,70,.24); font-size: 10px; line-height: 1.5; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.toast.is-visible { opacity: 1; transform: none; }
.toast.is-error { background: #a62939; }

@media (max-width: 1380px) {
  .kpi-grid.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .supplier-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mapping-card { grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr); }
  .mapping-card .match-score { grid-column: 1 / -1; }
}

@media (max-width: 1120px) {
  .sidebar { transform: translateX(-105%); }
  .sidebar.is-open { transform: translateX(0); }
  .main-column { margin-left: 0; }
  .icon-button.menu-button { display: grid; place-items: center; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pipeline i { display: none; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .topbar { height: 68px; padding: 0 15px; }
  .breadcrumb, .user-copy, #demo-button { display: none; }
  main { padding: 18px 14px 44px; }
  .hero { min-height: 0; padding: 24px; display: block; }
  .hero-status { margin-top: 18px; min-width: 0; }
  .kpi-grid.six, .kpi-grid, .mapping-summary, .supplier-grid { grid-template-columns: 1fr 1fr; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .pipeline { grid-template-columns: 1fr 1fr; }
  .toolbar { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .mapping-card { grid-template-columns: 1fr; }
  .mapping-arrow { transform: rotate(90deg); }
  .field-grid { grid-template-columns: 1fr; }
  .field-grid .full { grid-column: auto; }
}

@media (max-width: 480px) {
  .kpi-grid.six, .kpi-grid, .mapping-summary, .supplier-grid { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: 1fr; }
  .tabs { width: 100%; overflow-x: auto; }
  .tabs button { flex: 0 0 auto; }
}
