/* Al-Futtaim Procurement design system
   Base: Basecoat (shadcn/ui for plain HTML) + Lucide icons + Inter.
   Look: modern SAP Ariba / Fiori "Horizon" (white shell, side navigation, launchpad tiles, object pages),
   so users coming from Ariba feel at home. Our rules are unlayered, so they sit on top of Basecoat's layers. */

:root {
  --font-sans: "Inter Variable", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 0.75rem;
  --background: #f5f6f7;
  --foreground: #1d2d3e;
  --card: #ffffff;
  --card-foreground: #1d2d3e;
  --popover: #ffffff;
  --primary: #0070f2;
  --primary-foreground: #ffffff;
  --secondary: #eaecee;
  --secondary-foreground: #1d2d3e;
  --muted: #f2f4f6;
  --muted-foreground: #556b82;
  --accent: #ebf5fe;
  --accent-foreground: #0057d2;
  --destructive: #d20a0a;
  --border: #e5e7eb;
  --input: #d5dadd;
  --ring: #0070f2;
  --sidebar: #ffffff;

  --ink: var(--foreground);
  --ink-2: #32475c;
  --mute: var(--muted-foreground);
  --line: var(--border);
  --bg: var(--background);
  --accent-soft: var(--accent);
  --accent-2: #0057d2;
  --crit: #d20a0a; --crit-soft: #ffeaf4;
  --high: #e76500; --high-soft: #fff3e6;
  --med: #a45d00; --med-soft: #fff8d6;
  --low: #188918; --low-soft: #f5fae5;
  --ok: #188918;
  --info: #0070f2; --info-soft: #ebf5fe;
  --shadow-sm: 0 0 0 1px rgba(34, 54, 73, .04), 0 1px 2px rgba(34, 54, 73, .08);
  --shadow: 0 0 0 1px rgba(34, 54, 73, .05), 0 2px 8px -2px rgba(34, 54, 73, .12);
  --shadow-lg: 0 20px 50px -12px rgba(16, 32, 64, .35);
  --side-w: 248px;
}
body.supplier { --primary: #0b7a75; --ring: #0b7a75; --accent: #e6f5f4; --accent-foreground: #075e5a; --accent-2: #075e5a; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font-sans); background: var(--background); color: var(--foreground); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; }
svg.lucide { width: 1em; height: 1em; stroke-width: 2; flex: none; }

/* ---------- App frame: side navigation + top bar ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.col { min-width: 0; display: flex; flex-direction: column; }
.sidenav { position: sticky; top: 0; height: 100vh; background: var(--sidebar); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 60; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; color: var(--foreground); }
.side-brand:hover { text-decoration: none; }
.mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #1b90ff, #0057d2); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; letter-spacing: .3px; box-shadow: 0 2px 6px rgba(0, 87, 210, .35); flex: none; }
body.supplier .mark { background: linear-gradient(135deg, #14a39c, #075e5a); box-shadow: 0 2px 6px rgba(7, 94, 90, .35); }
.side-brand b { display: block; font-size: 14px; line-height: 1.2; }
.side-brand small { display: block; font-size: 11.5px; color: var(--muted-foreground); }
.app-switch { margin: 4px 12px 10px; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 10px; font-size: 12.5px; font-weight: 600; color: var(--foreground); background: var(--muted); }
.app-switch:hover { text-decoration: none; background: var(--accent); }
.app-switch .lucide { color: var(--primary); font-size: 16px; }
.app-switch span { margin-left: auto; color: var(--muted-foreground); font-weight: 500; }
.side-label { font-size: 11px; font-weight: 600; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: .06em; padding: 10px 20px 6px; }
.side-nav { flex: 1; overflow-y: auto; padding: 0 10px; display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 500; font-size: 13.5px; position: relative; }
.side-nav a .lucide { font-size: 17px; color: var(--muted-foreground); }
.side-nav a:hover { background: var(--muted); text-decoration: none; color: var(--foreground); }
.side-nav a.active { background: var(--accent); color: var(--accent-foreground); font-weight: 600; }
.side-nav a.active .lucide { color: var(--primary); }
.side-nav a.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); }
.nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--crit); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.side-foot { border-top: 1px solid var(--border); padding: 12px 16px 14px; }
.powered { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted-foreground); }
.powered img { height: 22px; }
.side-user { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.side-user b { display: block; font-size: 13px; line-height: 1.2; }
.side-user span { font-size: 11.5px; color: var(--muted-foreground); }

.topbar { height: 60px; background: rgba(255, 255, 255, .88); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 14px; padding: 0 24px; position: sticky; top: 0; z-index: 50; }
.topbar .crumb { font-size: 13px; color: var(--muted-foreground); white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.topbar .crumb b { color: var(--foreground); font-weight: 600; }
.topbar .search { flex: 1; max-width: 560px; margin: 0 auto; position: relative; }
.topbar .search .lucide { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-foreground); font-size: 16px; z-index: 1; }
.topbar .search input { width: 100%; height: 38px; padding-left: 36px !important; border-radius: 10px !important; background: var(--muted) !important; border-color: transparent !important; }
.topbar .search input:focus { background: #fff !important; border-color: var(--ring) !important; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-2); background: none; border: 0; cursor: pointer; position: relative; font-size: 18px; }
.icon-btn:hover { background: var(--muted); text-decoration: none; }
.badge-dot { position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--crit); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; border: 2px solid #fff; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #5d36ff, #0070f2); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
body.supplier .avatar { background: linear-gradient(135deg, #14a39c, #075e5a); }
.ai-badge { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 600; color: #5b3df5; background: linear-gradient(90deg, #f1edff, #e8f3ff); border: 1px solid #e0d9ff; white-space: nowrap; }

main { padding: 26px 28px 120px; max-width: 1440px; width: 100%; margin: 0 auto; flex: 1; }
@media (max-width: 960px) { .app { grid-template-columns: 1fr; } .sidenav { display: none; } main { padding: 18px 16px 110px; } .topbar .crumb { display: none; } }

/* ---------- Page header (object page style) ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.page-head p { margin: 4px 0 0; color: var(--muted-foreground); max-width: 820px; }
.crumbs { font-size: 12.5px; color: var(--muted-foreground); margin-bottom: 6px; }

/* ---------- Layout ---------- */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .g2, .g3, .g4, .g-main { grid-template-columns: 1fr; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }

/* ---------- Cards ---------- */
.card { background: var(--card); color: var(--card-foreground); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-sm); display: block; padding: 0; gap: 0; }
.card-h { padding: 16px 18px 10px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card-h h3 { font-size: 15px; font-weight: 600; }
.card-h .sub { color: var(--muted-foreground); font-size: 12.5px; }
.card-b { padding: 2px 18px 16px; }
.pad { padding: 18px; }
.card.pad h3 { font-weight: 600; font-size: 15px; }

/* ---------- Launchpad tiles (Ariba dashboard) ---------- */
.tile { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px 18px; cursor: pointer; transition: box-shadow .15s, transform .15s, border-color .15s; display: flex; flex-direction: column; min-height: 124px; color: inherit; position: relative; overflow: hidden; }
.tile:hover { box-shadow: var(--shadow); transform: translateY(-1px); border-color: #cfd8e3; text-decoration: none; }
.tile .t-title { font-weight: 600; font-size: 13.5px; color: var(--foreground); position: relative; z-index: 1; }
.tile .t-sub { font-size: 12.5px; color: var(--muted-foreground); position: relative; z-index: 1; }
.tile .t-num { font-size: 32px; font-weight: 600; margin-top: auto; color: var(--foreground); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; position: relative; z-index: 1; }
.tile .t-num small { font-size: 13px; color: var(--muted-foreground); font-weight: 500; margin-left: 4px; }
.tile.alert .t-num { color: var(--crit); }
.tile::after { content: ""; position: absolute; right: -26px; top: -26px; width: 92px; height: 92px; border-radius: 50%; background: var(--accent); opacity: .8; }
.tile.alert::after { background: var(--crit-soft); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted-foreground); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--border); background: #fafbfc; white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f7faff; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td b { font-weight: 600; }

/* ---------- Status pills (Horizon semantic colours) ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--muted); color: var(--ink-2); border: 1px solid transparent; line-height: 20px; }
.pill .lucide { font-size: 13px; }
.pill.blue { background: var(--info-soft); color: #0057d2; border-color: #cfe5ff; }
.pill.green, .pill.low { background: var(--low-soft); color: var(--ok); border-color: #d9eec0; }
.pill.red, .pill.critical { background: var(--crit-soft); color: #aa0808; border-color: #ffd0e4; }
.pill.orange, .pill.high { background: var(--high-soft); color: #b44f00; border-color: #ffdcb8; }
.pill.yellow, .pill.medium { background: var(--med-soft); color: var(--med); border-color: #f5e6a3; }
.pill.ai { background: linear-gradient(90deg, #f1edff, #e8f3ff); color: #5b3df5; border-color: #e0d9ff; }

/* ---------- Buttons (Basecoat .btn + our extra variants) ---------- */
.btn { gap: 7px; white-space: nowrap; cursor: pointer; text-decoration: none !important; font-family: inherit; }
.btn .lucide { font-size: 16px; }
.btn[data-variant='primary'] { background: var(--primary); color: var(--primary-foreground); }
.btn[data-variant='outline'] { background: #fff; color: var(--foreground); }
.btn.ai { background: linear-gradient(90deg, #6a46ff, #0070f2) !important; color: #fff !important; border: 0 !important; box-shadow: 0 2px 10px -2px rgba(90, 70, 255, .5); }
.btn.ai:hover { filter: brightness(1.06); }
.btn.approve { background: var(--ok) !important; color: #fff !important; border-color: var(--ok) !important; }
.btn.reject, .btn.danger { color: var(--crit) !important; border-color: #f5c2c2 !important; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Forms (Basecoat .input/.select/.textarea) ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 13px; font-weight: 500; color: var(--foreground); }
.field .input, .field .select, .field .textarea { width: 100%; background-color: #fff; }
.field textarea { min-height: 84px; }
.hint { font-size: 12.5px; color: var(--muted-foreground); }

/* ---------- AI finding banners ---------- */
.finding { border-radius: 12px; padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; border: 1px solid; background: #fff; }
.finding.critical { background: var(--crit-soft); border-color: #ffc9df; }
.finding.high { background: var(--high-soft); border-color: #ffd7ad; }
.finding.medium { background: var(--med-soft); border-color: #f0df98; }
.finding.low { background: var(--low-soft); border-color: #cfe8b2; }
.finding .f-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; color: #fff; font-weight: 800; font-size: 15px; }
.finding.critical .f-ico { background: var(--crit); }
.finding.high .f-ico { background: var(--high); }
.finding.medium .f-ico { background: var(--med); }
.finding.low .f-ico { background: var(--ok); }
.finding b { display: block; margin-bottom: 2px; font-weight: 600; }
.finding p { margin: 0; color: var(--ink-2); font-size: 13px; }
.ai-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: #5b3df5; letter-spacing: .04em; text-transform: uppercase; }
.ai-tag .lucide { font-size: 12px; }

/* ---------- Insights ---------- */
.insight { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.insight:last-child { border-bottom: 0; }
.insight .sev { width: 4px; border-radius: 4px; flex: none; }
.insight .sev.critical { background: var(--crit); } .insight .sev.high { background: var(--high); }
.insight .sev.medium { background: #e9b100; } .insight .sev.low { background: var(--ok); }
.insight b { font-size: 13.5px; font-weight: 600; }
.insight p { margin: 2px 0 0; color: var(--muted-foreground); font-size: 12.5px; }
a.insight:hover { background: #fafcff; text-decoration: none; }

.kv { display: grid; grid-template-columns: 160px 1fr; gap: 10px 14px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--muted-foreground); }
.kv dd { margin: 0; font-weight: 500; }
.muted { color: var(--muted-foreground); }
.small { font-size: 12.5px; }
.empty { padding: 32px; text-align: center; color: var(--muted-foreground); }
.bar { height: 8px; background: #edf0f3; border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--primary); border-radius: 6px; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; top: 72px; right: 22px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #fff; color: var(--foreground); padding: 12px 14px 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); border-left: 4px solid var(--primary); max-width: 400px; font-size: 13px; animation: tin .25s ease; }
.toast.ok { border-left-color: var(--ok); } .toast.warn { border-left-color: var(--high); }
@keyframes tin { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- Modal (shadcn dialog look) ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(8, 15, 30, .45); backdrop-filter: blur(2px); z-index: 200; display: grid; place-items: center; padding: 20px; animation: fin .18s; }
@keyframes fin { from { opacity: 0; } }
.modal { background: #fff; border-radius: 16px; width: min(800px, 100%); max-height: 92vh; overflow: auto; box-shadow: var(--shadow-lg); border: 1px solid var(--border); animation: pop .2s ease; }
@keyframes pop { from { transform: scale(.98); opacity: 0; } }
.modal-h { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-h h3 { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.modal-b { padding: 18px 20px; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; background: #fafbfc; }
.x { background: none; border: 0; font-size: 20px; cursor: pointer; color: var(--muted-foreground); width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; }
.x:hover { background: var(--muted); }

/* ---------- Notifications drawer ---------- */
.drawer { position: fixed; top: 64px; right: 16px; width: 400px; max-height: 72vh; overflow: auto; background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 120; border: 1px solid var(--border); }
.drawer .n { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.drawer .n.unread { background: #f4f9ff; }
.drawer .n time { display: block; color: var(--muted-foreground); font-size: 11.5px; margin-top: 3px; }

.foot { text-align: center; color: var(--muted-foreground); font-size: 12px; padding: 18px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.foot img { height: 16px; }

/* ---------- AI assistant ---------- */
.ai-fab { position: fixed; right: 24px; bottom: 24px; z-index: 150; height: 52px; padding: 0 18px 0 7px; border-radius: 30px; border: 0; cursor: pointer; background: linear-gradient(90deg, #6a46ff, #0070f2); color: #fff; display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; box-shadow: 0 12px 30px -8px rgba(70, 60, 230, .6); font-family: inherit; }
.ai-fab .orb, .ai-head .orb { width: 38px; height: 38px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #fff 0, #c9d4ff 22%, #7a62ff 58%, #2b2aa8 100%); box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); flex: none; }
.ai-panel { position: fixed; right: 24px; bottom: 24px; width: 410px; height: min(660px, calc(100vh - 96px)); z-index: 160; background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--border); transition: height .25s, width .25s; }
.ai-panel.hidden, .ai-fab.hidden { display: none; }
.ai-panel.mini { height: 250px; width: 360px; }
.ai-panel.mini .chips, .ai-panel.mini .ai-foot { display: none; }
.ai-head { background: linear-gradient(115deg, #17205a, #4a2fd1 58%, #0070f2); color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.ai-head .orb.talking { animation: pulse 1s infinite; }
.ai-head .orb.listening { animation: pulse .6s infinite; box-shadow: 0 0 0 4px rgba(78, 255, 180, .5); }
@keyframes pulse { 50% { transform: scale(1.08); box-shadow: 0 0 0 8px rgba(255, 255, 255, .15); } }
.ai-head b { display: block; font-size: 14.5px; font-weight: 600; }
.ai-head span { font-size: 11.5px; opacity: .8; }
.ai-head .ctrls { margin-left: auto; display: flex; gap: 4px; }
.ai-head select { background: rgba(255, 255, 255, .15); color: #fff; border: 0; border-radius: 7px; height: 30px; font-size: 12px; padding: 0 6px; font-family: inherit; }
.ai-head select option { color: #000; }
.ai-head button { background: rgba(255, 255, 255, .14); border: 0; color: #fff; width: 30px; height: 30px; border-radius: 7px; cursor: pointer; display: grid; place-items: center; font-size: 15px; }
.ai-head button:hover { background: rgba(255, 255, 255, .24); }
.ai-msgs { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; background: #f7f8fa; }
.msg { max-width: 86%; padding: 9px 13px; border-radius: 14px; font-size: 13.5px; white-space: pre-wrap; }
.msg.ai { background: #fff; border: 1px solid var(--border); border-top-left-radius: 4px; align-self: flex-start; box-shadow: var(--shadow-sm); }
.msg.me { background: var(--primary); color: #fff; border-top-right-radius: 4px; align-self: flex-end; }
.msg.step { background: #efeaff; color: #3b2a9e; font-size: 12px; align-self: flex-start; border-radius: 8px; padding: 6px 10px; }
.msg[dir="rtl"] { text-align: right; }
.typing { align-self: flex-start; color: var(--muted-foreground); font-size: 12px; padding: 4px 6px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 12px 0; background: #f7f8fa; }
.chip { border: 1px solid #ddd5ff; background: #fff; color: #5b3df5; border-radius: 99px; padding: 4px 11px; font-size: 12px; cursor: pointer; font-family: inherit; }
.chip:hover { background: #f3f0ff; }
.ai-input { display: flex; gap: 8px; padding: 10px 12px 12px; background: #f7f8fa; border-top: 1px solid var(--border); }
.ai-input input { flex: 1; height: 42px; border: 1px solid var(--input); border-radius: 22px; padding: 0 16px; font: inherit; outline: none; background: #fff; }
.ai-input input:focus { border-color: #7a62ff; box-shadow: 0 0 0 3px rgba(122, 98, 255, .15); }
.mic { width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer; background: #ece8ff; color: #5b3df5; display: grid; place-items: center; flex: none; font-size: 18px; }
.mic.on { background: var(--crit); color: #fff; animation: pulse .9s infinite; }
.send { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; cursor: pointer; flex: none; display: grid; place-items: center; font-size: 17px; }
.ai-foot { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 10.5px; color: var(--muted-foreground); padding: 0 0 9px; background: #f7f8fa; }
.ai-foot img { height: 14px; }

/* Screen driver */
.spot { position: fixed; z-index: 140; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(10, 18, 40, .42), 0 0 0 3px #7a62ff, 0 0 26px 6px rgba(122, 98, 255, .55); pointer-events: none; transition: all .35s ease; }
.spot-say { position: fixed; z-index: 141; background: #2a1f8f; color: #fff; padding: 9px 13px; border-radius: 10px; font-size: 13px; max-width: 320px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); pointer-events: none; transition: all .35s ease; }
.spot-say::before { content: "AI"; font-size: 10px; font-weight: 800; background: #7a62ff; padding: 1px 5px; border-radius: 4px; margin-right: 6px; }
.ai-cursor { position: fixed; z-index: 142; width: 22px; height: 22px; pointer-events: none; transition: all .45s cubic-bezier(.5, 0, .2, 1); }
.clicked { animation: clk .4s; }
@keyframes clk { 50% { transform: scale(.95); } }

/* ---------- Call screens (hotline, AI review) ---------- */
.call { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 470px; }
@media (max-width: 800px) { .call { grid-template-columns: 1fr; } }
.call-left { background: radial-gradient(600px 300px at 30% 0%, #3a2fc4 0, transparent 70%), linear-gradient(160deg, #0d1638, #1f1a78 60%, #0057d2); color: #fff; padding: 22px; display: flex; flex-direction: column; }
.call-left .orb-big { width: 120px; height: 120px; border-radius: 50%; margin: 16px auto 10px; background: radial-gradient(circle at 30% 30%, #fff 0, #c9d4ff 20%, #7a62ff 56%, #22249a 100%); box-shadow: 0 0 60px rgba(122, 98, 255, .6); transition: transform .2s; }
.call-left .orb-big.talking { animation: pulse 1s infinite; }
.call-left .orb-big.listening { box-shadow: 0 0 0 6px rgba(78, 255, 180, .45), 0 0 60px rgba(78, 255, 180, .4); }
.call-state { text-align: center; font-size: 13px; opacity: .85; min-height: 20px; }
.participants { display: flex; gap: 8px; justify-content: center; margin: 10px 0 14px; flex-wrap: wrap; }
.participants span { background: rgba(255, 255, 255, .12); padding: 4px 10px; border-radius: 99px; font-size: 12px; }
.participants span.join { background: #1f9d55; animation: tin .4s; }
.transcript { flex: 1; overflow-y: auto; background: rgba(0, 0, 0, .22); border-radius: 12px; padding: 10px 12px; font-size: 13px; max-height: 230px; }
.transcript p { margin: 0 0 8px; }
.transcript .who { font-weight: 700; font-size: 11px; opacity: .7; display: block; }
.call-left input { font-family: inherit; }
.call-right { padding: 20px; }
.capture { display: grid; gap: 8px; }
.capture div { border: 1px dashed #d2d8e2; border-radius: 10px; padding: 9px 12px; transition: all .3s; }
.capture div.got { border-style: solid; border-color: #b9dea0; background: var(--low-soft); }
.capture label { font-size: 11px; color: var(--muted-foreground); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.capture span { display: block; font-weight: 600; min-height: 20px; }

/* ---------- Welcome hero ---------- */
.welcome { background: radial-gradient(700px 260px at 85% -20%, rgba(255, 255, 255, .18), transparent 60%), linear-gradient(110deg, #0a2a63 0%, #0057d2 60%, #1b90ff 100%); color: #fff; border-radius: 16px; padding: 24px 26px; margin-bottom: 18px; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; box-shadow: var(--shadow); }
body.supplier .welcome { background: radial-gradient(700px 260px at 85% -20%, rgba(255, 255, 255, .18), transparent 60%), linear-gradient(110deg, #053b3a 0%, #0b7a75 60%, #14a39c 100%); }
.welcome h1 { font-size: 22px; font-weight: 700; }
.welcome p { margin: 4px 0 0; opacity: .88; }
.hotline-btn { display: flex; align-items: center; gap: 14px; background: #fff; color: var(--foreground); border: 0; padding: 12px 20px 12px 12px; border-radius: 14px; cursor: pointer; font-weight: 700; font-size: 15px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); font-family: inherit; text-align: left; }
.hotline-btn .ph { width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg, #22c55e, #15803d); display: grid; place-items: center; color: #fff; animation: ring 2.2s infinite; font-size: 20px; }
.hotline-btn small { display: block; font-weight: 500; color: var(--muted-foreground); font-size: 12px; }
@keyframes ring { 0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .5); } 50% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); } }

/* ---------- Progress steps ---------- */
.steps { display: flex; margin: 6px 0 4px; }
.steps div { flex: 1; text-align: center; font-size: 11.5px; color: var(--muted-foreground); position: relative; padding-top: 22px; }
.steps div::before { content: ""; position: absolute; top: 5px; left: 50%; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid #ccd3db; transform: translateX(-50%); z-index: 1; }
.steps div::after { content: ""; position: absolute; top: 10px; left: -50%; width: 100%; height: 2px; background: #dfe4ea; }
.steps div:first-child::after { display: none; }
.steps div.done { color: var(--foreground); font-weight: 600; }
.steps div.done::before { background: var(--primary); border-color: var(--primary); }
.steps div.done::after { background: var(--primary); }

.chart-bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 10px; }
.chart-bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.chart-bars .b i { width: 100%; background: linear-gradient(180deg, #4aa3ff, var(--primary)); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.chart-bars .b span { font-size: 10.5px; color: var(--muted-foreground); }

/* ---------- Timeline ---------- */
.tl { position: relative; padding-left: 4px; }
.tl-i { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 0 0 14px 18px; position: relative; font-size: 13px; }
.tl-i::before { content: ""; position: absolute; left: 0; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid #c3cbd6; }
.tl-i::after { content: ""; position: absolute; left: 5px; top: 17px; bottom: -2px; width: 2px; background: var(--border); }
.tl-i:last-child::after { display: none; }
.tl-i.done::before { background: var(--primary); border-color: var(--primary); }
.tl-i.key b { color: var(--high); }
.tl-i b { font-weight: 600; }
.tl-i p { margin: 1px 0 0; color: var(--muted-foreground); font-size: 12px; }
.tl-d { color: var(--muted-foreground); font-size: 12px; }

/* ---------- Vendor KPI ---------- */
.kpi-card { display: flex; gap: 18px; align-items: center; }
.kpi-score { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; text-align: center; line-height: 1; box-shadow: var(--shadow); }
.kpi-score span { font-size: 30px; font-weight: 700; display: block; }
.kpi-score small { font-size: 11px; opacity: .9; }
.grade-A { background: linear-gradient(135deg, #36b37e, #188918); } .grade-B { background: linear-gradient(135deg, #4aa3ff, #0057d2); }
.grade-C { background: linear-gradient(135deg, #f5a623, #c35500); } .grade-D { background: linear-gradient(135deg, #ff5c5c, #aa0808); } .grade- { background: #9aa4b2; }
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 18px; flex: 1; }
.kpi-c b { font-size: 19px; font-weight: 600; }
.grade-pill { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; color: #fff; font-weight: 700; font-size: 12px; }

/* ---------- Approvals ---------- */
.appr { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.appr .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0 14px; }
.appr-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.check { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.check:last-child { border-bottom: 0; }
.check i { font-style: normal; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; flex: none; font-weight: 800; color: #fff; font-size: 12px; }
.check i.ok { background: var(--ok); } .check i.warn { background: #e9a100; } .check i.fail { background: var(--crit); } .check i.info { background: #8a96a8; }
.check b { font-weight: 600; }
.check p { margin: 1px 0 0; color: var(--ink-2); }
.phone-note { background: #101828; color: #fff; border-radius: 14px; padding: 10px 12px; font-size: 12.5px; margin-bottom: 8px; box-shadow: var(--shadow); }
.phone-note b { display: block; font-size: 11px; opacity: .7; margin-bottom: 2px; font-weight: 500; }
.cov { font-size: 44px; font-weight: 300; color: var(--accent-2); line-height: 1; }
.doc { background: #fbfbf8; border: 1px solid #e6e3d8; border-radius: 10px; padding: 12px; font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; white-space: pre; overflow-x: auto; }
.cat-row input { width: 84px; }
@media print { body * { visibility: hidden; } #dn-print, #dn-print * { visibility: visible; } #dn-print { position: absolute; left: 0; top: 0; width: 100%; } }

/* ---------- Launcher ---------- */
.launch { min-height: 100vh; background: radial-gradient(1100px 560px at 12% -10%, #1b4fb8 0, transparent 60%), radial-gradient(900px 500px at 100% 110%, #0b5f5c 0, transparent 60%), #0a1530; color: #fff; padding: 40px 24px; }
.launch .wrap { max-width: 1120px; margin: 0 auto; }
.launch-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 32px; }
@media (max-width: 900px) { .launch-cards { grid-template-columns: 1fr; } }
.lc { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); border-radius: 18px; padding: 22px; color: #fff; display: flex; flex-direction: column; gap: 10px; transition: transform .15s, background .15s, border-color .15s; backdrop-filter: blur(6px); }
.lc:hover { transform: translateY(-3px); background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); text-decoration: none; }
.lc .ico { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; }
.lc h2 { font-size: 20px; font-weight: 600; }
.lc p { margin: 0; opacity: .8; font-size: 13.5px; }
.lc ul { margin: 4px 0 0; padding-left: 18px; opacity: .85; font-size: 13px; }
.lc .go { margin-top: auto; font-weight: 600; color: #8fc3ff; display: flex; align-items: center; gap: 6px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: #fff; }
.brand small { font-weight: 500; opacity: .7; font-size: 12px; display: block; }
