/* Shared design system for the IntelliMart / QUIBA demo. Colors are CSS variables so light and
   dark themes redefine the same names — every component (tags, tables, status dots, charts,
   buttons) reads from these, never a hardcoded color. */
:root {
  --bg: #f7f8fb; --card: #ffffff; --ink: #0f172a; --mut: #55607a; --line: #e2e5eb;
  --acc: #2563eb; --acc-ink: #ffffff; --acc2: #059669; --link: #1d4ed8;
  --ok: #16a34a; --bad: #dc2626; --warn: #b45309;
  --tag-bg: #fff7ed; --tag-ink: #9a3412; --tag-line: #fed7aa;
  --lock-bg: #f1f5f9; --lock-ink: #475569;
  --shadow: 0 1px 2px rgba(15, 23, 42, .07);
}
:root[data-theme="dark"] {
  --bg: #0b1220; --card: #121b2e; --ink: #e8eef9; --mut: #9fb0cc; --line: #233150;
  --acc: #2f6fe4; --acc-ink: #ffffff; --acc2: #22c55e; --link: #7db0ff;
  --ok: #22c55e; --bad: #f87171; --warn: #fbbf24;
  --tag-bg: #1e293b; --tag-ink: #fbbf24; --tag-line: #92400e;
  --lock-bg: #1a2338; --lock-ink: #9fb0cc;
  --shadow: 0 1px 2px rgba(0, 0, 0, .45);
}
* { box-sizing: border-box }
html, body { margin: 0 }
body { font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--link) }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px }
header { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; gap: 10px; flex-wrap: wrap }
.logo { font-weight: 900; font-size: 20px; letter-spacing: .4px }
.logo span { color: var(--acc) }
.who { color: var(--mut); font-size: 13px }
.head-l { display: flex; flex-direction: column; gap: 2px }
.head-r { display: flex; align-items: center; gap: 6px; flex-wrap: wrap }
.btn { display: inline-block; border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 700; cursor: pointer; background: var(--acc); color: var(--acc-ink); text-decoration: none; font-size: 14px; font-family: inherit }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink) }
.btn.sm { padding: 6px 10px; font-size: 12.5px; border-radius: 8px }
.btn.locked, .btn[disabled] { opacity: .5; cursor: not-allowed }
.lang-btn { border: 1px solid var(--line); background: var(--card); color: var(--mut); padding: 5px 9px; font-size: 12px; font-weight: 800; border-radius: 7px; cursor: pointer; margin-left: 3px; font-family: inherit }
.lang-btn.on { color: var(--acc-ink); background: var(--acc); border-color: var(--acc) }
.theme-btn { border: 1px solid var(--line); background: var(--card); border-radius: 7px; padding: 5px 9px; cursor: pointer; font-size: 14px; line-height: 1 }
.tag { display: inline-block; background: var(--tag-bg); color: var(--tag-ink); border: 1px solid var(--tag-line); border-radius: 999px; padding: 3px 12px; font-size: 12px; font-weight: 700 }
.hero { padding: 40px 0 20px }
.hero h1 { font-size: clamp(26px, 5vw, 44px); line-height: 1.12; margin: 10px 0 }
.hero p { color: var(--mut); font-size: 17px; max-width: 700px }
.grid { display: grid; gap: 16px }
.plans { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin: 22px 0 }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: var(--shadow) }
.card.hot { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc) }
.price { font-size: 32px; font-weight: 800 }
.price small { font-size: 13px; color: var(--mut); font-weight: 500 }
.sub { color: var(--mut); font-size: 14px; margin: 4px 0 12px }
ul.feat { padding-left: 18px; margin: 10px 0 16px }
ul.feat li { margin: 5px 0 }
.why { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin: 8px 0 40px }
.why h3 { margin: 0 0 6px }
.why p { color: var(--mut); margin: 0 }
footer { color: var(--mut); font-size: 12.5px; padding: 24px 0; border-top: 1px solid var(--line); margin-top: 16px }
.pw { display: inline-block; background: var(--lock-bg); color: var(--lock-ink); border-radius: 8px; padding: 3px 10px; font-size: 11.5px; font-weight: 700 }
.kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 10px 0 18px }
.k { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: var(--shadow) }
.k b { font-size: 22px; display: block }
.k span { color: var(--mut); font-size: 12.5px }
nav.tabs { display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 14px; -webkit-overflow-scrolling: touch; scrollbar-width: thin }
nav.tabs button { background: none; border: 0; color: var(--mut); padding: 9px 11px; cursor: pointer; font-weight: 700; font-size: 13.5px; border-bottom: 2px solid transparent; white-space: nowrap; display: flex; align-items: center; gap: 4px; font-family: inherit }
nav.tabs button.on { color: var(--ink); border-color: var(--acc) }
nav.tabs button.locked { opacity: .55 }
.tblwrap { overflow-x: auto; -webkit-overflow-scrolling: touch }
table { width: 100%; border-collapse: collapse; min-width: 520px }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); font-size: 13.5px }
th { color: var(--mut); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .03em }
tr.clickable { cursor: pointer }
tr.clickable:hover { background: rgba(37, 99, 235, .07) }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px }
.dot.ok { background: var(--ok) } .dot.bad { background: var(--bad) } .dot.warn { background: var(--warn) }
.muted { color: var(--mut) }
.chart-card { padding: 14px 16px }
.chart-card h4 { margin: 0 0 10px; font-size: 12.5px; color: var(--mut); text-transform: uppercase; letter-spacing: .03em }
.charts { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin: 0 0 18px }
.charts canvas { max-height: 220px }
label { display: block; font-weight: 700; margin: 12px 0 4px; font-size: 13.5px }
input, select, textarea { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: var(--card); color: var(--ink) }
.overlay { position: fixed; inset: 0; background: rgba(3, 7, 18, .55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50 }
.overlay[hidden] { display: none }
.modal { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; max-width: 520px; width: 100%; max-height: 88vh; overflow: auto; box-shadow: 0 20px 50px rgba(0, 0, 0, .35) }
.modal h3 { margin: 0 0 4px; padding-right: 24px }
.modal .close { float: right; background: none; border: 0; color: var(--mut); font-size: 20px; cursor: pointer; line-height: 1 }
.modal-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px }
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px }
.toasts { position: fixed; left: 16px; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; align-items: center; z-index: 80; pointer-events: none }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 13.5px; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; max-width: 420px; text-align: center }
.toast.show { opacity: 1; transform: translateY(0) }
.gate { max-width: 560px; margin: 60px auto }
.gate .card { padding: 32px 24px; text-align: center }
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow-y: auto; padding: 4px 2px }
.msg { max-width: 82%; padding: 9px 13px; border-radius: 12px; font-size: 14px; line-height: 1.4 }
.msg.user { align-self: flex-end; background: var(--acc); color: var(--acc-ink); border-bottom-right-radius: 3px }
.msg.bot { align-self: flex-start; background: var(--lock-bg); color: var(--ink); border-bottom-left-radius: 3px }
.chat-form { display: flex; gap: 8px; margin-top: 12px }
.chat-form input { flex: 1 }
.admin-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; gap: 6px }
.badge { display: inline-block; background: var(--lock-bg); color: var(--lock-ink); border-radius: 6px; padding: 2px 8px; font-size: 11.5px; font-weight: 700 }
@media (max-width: 640px) {
  header { padding: 12px 0 }
  .hero { padding: 24px 0 14px }
  .wrap { padding: 0 14px }
  nav.tabs button { padding: 8px 9px; font-size: 12px }
  .k b { font-size: 19px }
  .modal { padding: 16px }
  .price { font-size: 28px }
}
