/* TenderIQ Analytics - app styles (scoped to .tiq-app) */
.tiq-app {
  --tiq-ink: #0b1430;
  --tiq-ink-2: #3b4766;
  --tiq-muted: #6b7794;
  --tiq-line: #dfe5f2;
  --tiq-bg: #f4f7fd;
  --tiq-card: #ffffff;
  --tiq-cyan: #06b6d4;
  --tiq-indigo: #4f46e5;
  --tiq-violet: #7c3aed;
  --tiq-pink: #db2777;
  --tiq-green: #059669;
  --tiq-amber: #d97706;
  --tiq-red: #dc2626;
  --tiq-grad: linear-gradient(120deg, #06b6d4 0%, #4f46e5 45%, #9333ea 75%, #db2777 100%);
  --tiq-radius: 16px;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--tiq-ink);
  font-size: 15px;
  line-height: 1.5;
  max-width: 1280px;
  margin: 0 auto;
  box-sizing: border-box;
}
.tiq-app *, .tiq-app *::before, .tiq-app *::after { box-sizing: border-box; }
.tiq-app h2, .tiq-app h3 { margin: 0; color: var(--tiq-ink); letter-spacing: -0.01em; }
.tiq-app h2 { font-size: 1.35rem; }
.tiq-app h3 { font-size: 1rem; margin: 0 0 .5rem; }
.tiq-app p { margin: .2rem 0 0; color: var(--tiq-ink-2); }
.tiq-shell { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.tiq-shell > *, .tiq-tabpanel, .tiq-table-wrap { min-width: 0; max-width: 100%; }

.tiq-panel {
  position: relative; background: var(--tiq-card); border-radius: var(--tiq-radius);
  padding: 26px; box-shadow: 0 18px 40px -22px rgba(30, 41, 99, .45), 0 2px 6px rgba(30, 41, 99, .06);
  border: 1px solid transparent;
  background-image: linear-gradient(#fff, #fff), var(--tiq-grad);
  background-origin: border-box; background-clip: padding-box, border-box;
}
.tiq-panel-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.tiq-step {
  flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 800; color: #fff; background: var(--tiq-grad); box-shadow: 0 8px 18px -8px rgba(79, 70, 229, .8);
}

/* Upload */
.tiq-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  padding: 34px 18px; border-radius: 14px; cursor: pointer; transition: .2s ease;
  border: 2px dashed #a5b4fc; color: var(--tiq-ink-2);
  background:
    radial-gradient(circle at 15% 20%, rgba(6, 182, 212, .12), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(219, 39, 119, .10), transparent 40%),
    linear-gradient(135deg, #f5f8ff, #f8f5ff);
}
.tiq-drop:hover, .tiq-drop.is-over { border-color: var(--tiq-indigo); transform: translateY(-1px); box-shadow: 0 14px 30px -18px rgba(79, 70, 229, .7); }
.tiq-drop:focus-within { outline: 3px solid rgba(79, 70, 229, .35); outline-offset: 3px; }
.tiq-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.tiq-drop strong { color: var(--tiq-ink); font-size: 1.05rem; }
.tiq-drop span:last-child { font-size: .85rem; color: var(--tiq-muted); }
.tiq-drop-icon { color: var(--tiq-indigo); background: #fff; border-radius: 50%; width: 70px; height: 70px; display: grid; place-items: center; box-shadow: 0 10px 22px -12px rgba(79, 70, 229, .8); }

.tiq-files { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.tiq-files li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--tiq-bg); border: 1px solid var(--tiq-line); }
.tiq-file-ico { font-size: .7rem; font-weight: 800; color: #fff; background: var(--tiq-red); border-radius: 6px; padding: 4px 6px; }
.tiq-file-name { flex: 1; font-weight: 600; overflow-wrap: anywhere; }
.tiq-files small { color: var(--tiq-muted); }

.tiq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 18px; margin-top: 20px; }
.tiq-field label { display: block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--tiq-ink-2); margin-bottom: 6px; }
.tiq-app input[type="text"], .tiq-app input[type="number"], .tiq-app input[type="search"], .tiq-app select {
  width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--tiq-line); border-radius: 10px;
  background: #fff; color: var(--tiq-ink); font: inherit; font-size: .95rem; transition: border-color .15s, box-shadow .15s;
}
.tiq-app input:focus, .tiq-app select:focus { outline: none; border-color: var(--tiq-indigo); box-shadow: 0 0 0 3px rgba(79, 70, 229, .18); }
.tiq-range { display: flex; align-items: center; gap: 8px; }
.tiq-range span { color: var(--tiq-muted); font-size: .85rem; }

.tiq-toggles { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 18px; }
.tiq-toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .9rem; color: var(--tiq-ink-2); }
.tiq-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tiq-switch { flex: none; width: 42px; height: 24px; border-radius: 999px; background: #cbd5e1; position: relative; transition: .2s; }
.tiq-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: .2s; }
.tiq-toggle input:checked + .tiq-switch { background: var(--tiq-grad); }
.tiq-toggle input:checked + .tiq-switch::after { left: 21px; }
.tiq-toggle input:focus-visible + .tiq-switch { outline: 3px solid rgba(79, 70, 229, .35); outline-offset: 2px; }

.tiq-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.tiq-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 11px;
  border: 1px solid var(--tiq-line); background: #fff; color: var(--tiq-ink); font: inherit; font-weight: 700; cursor: pointer; transition: .15s;
}
.tiq-btn:hover:not(:disabled) { border-color: var(--tiq-indigo); color: var(--tiq-indigo); }
.tiq-btn:disabled { opacity: .5; cursor: not-allowed; }
.tiq-btn:focus-visible, .tiq-tab:focus-visible, .tiq-dl:focus-visible, .tiq-x:focus-visible { outline: 3px solid rgba(79, 70, 229, .4); outline-offset: 2px; }
.tiq-btn-primary { border: 0; color: #fff; background: var(--tiq-grad); background-size: 140% 100%; box-shadow: 0 12px 24px -12px rgba(79, 70, 229, .9); }
.tiq-btn-primary:hover:not(:disabled) { color: #fff; background-position: 100% 0; transform: translateY(-1px); }
.tiq-btn-primary.is-busy span { display: inline-block; animation: tiq-spin 1s linear infinite; }
.tiq-btn-ghost { background: transparent; }
.tiq-btn-sm { min-height: 36px; padding: 6px 12px; font-size: .85rem; }
@keyframes tiq-spin { to { transform: rotate(360deg); } }

.tiq-progress { margin-top: 18px; }
.tiq-bar { height: 10px; background: #e7ecf7; border-radius: 999px; overflow: hidden; }
.tiq-bar span { display: block; height: 100%; width: 0; background: var(--tiq-grad); background-size: 200% 100%; animation: tiq-flow 2s linear infinite; transition: width .3s; }
@keyframes tiq-flow { to { background-position: -200% 0; } }
.tiq-progress p { font-size: .88rem; }
.tiq-alert { margin-top: 16px; padding: 12px 14px; border-radius: 10px; font-size: .92rem; }
.tiq-alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.tiq-alert-warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* Results */
.tiq-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tiq-stat { padding: 14px 16px; border-radius: 14px; color: #fff; background: var(--tiq-grad); background-size: 300% 100%; }
.tiq-stat:nth-child(2) { background-position: 25% 0; } .tiq-stat:nth-child(3) { background-position: 50% 0; } .tiq-stat:nth-child(4) { background-position: 75% 0; } .tiq-stat:nth-child(5) { background-position: 100% 0; }
.tiq-stat strong { display: block; font-size: 1.7rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tiq-stat span { font-size: .8rem; opacity: .92; }

.tiq-downloads { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 18px 0; }
.tiq-dl { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--tiq-line); background: #fff; cursor: pointer; font: inherit; color: var(--tiq-ink); transition: .15s; }
.tiq-dl:hover { border-color: var(--tiq-green); box-shadow: 0 10px 20px -14px rgba(5, 150, 105, .9); transform: translateY(-1px); }
.tiq-dl strong { display: block; font-size: .92rem; }
.tiq-dl small { color: var(--tiq-muted); font-size: .78rem; }
.tiq-dl-ico { flex: none; font-size: .62rem; font-weight: 800; letter-spacing: .03em; color: #fff; background: #107c41; border-radius: 7px; padding: 7px 6px; }
.tiq-dl-primary { border: 0; color: #fff; background: linear-gradient(120deg, #059669, #0d9488 60%, #0891b2); }
.tiq-dl-primary small { color: rgba(255,255,255,.85); }
.tiq-dl-primary .tiq-dl-ico { background: rgba(255,255,255,.22); }

.tiq-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--tiq-line); scrollbar-width: thin; }
.tiq-tab { position: relative; flex: none; padding: 10px 14px; border: 0; background: transparent; font: inherit; font-weight: 700; color: var(--tiq-muted); cursor: pointer; border-radius: 10px 10px 0 0; }
.tiq-tab:hover { color: var(--tiq-indigo); background: #f3f4ff; }
.tiq-tab.is-active { color: var(--tiq-indigo); }
.tiq-tab.is-active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px; background: var(--tiq-grad); }
.tiq-count:not(:empty) { margin-left: 6px; font-size: .72rem; padding: 1px 7px; border-radius: 999px; background: #eef2ff; color: var(--tiq-indigo); }
.tiq-tabpanel { padding-top: 16px; }

.tiq-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.tiq-toolbar .tiq-search { flex: 1 1 240px; max-width: 420px; }
.tiq-inline { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--tiq-ink-2); }
.tiq-inline select { width: auto; min-height: 36px; padding: 5px 8px; }

.tiq-table-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--tiq-line); border-radius: 12px; }
.tiq-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .86rem; }
.tiq-table th { position: sticky; top: 0; z-index: 1; background: #1e2a78; background-image: linear-gradient(120deg, #1e3a8a, #4338ca 60%, #6d28d9); color: #fff; text-align: left; font-weight: 700; padding: 10px; white-space: nowrap; }
.tiq-table td { padding: 8px 10px; border-bottom: 1px solid var(--tiq-line); vertical-align: top; color: var(--tiq-ink); }
.tiq-table tbody tr:nth-child(even) td { background: #fafbff; }
.tiq-table tbody tr:hover td { background: #f1f5ff; }
.tiq-table tfoot td { background: #eef2ff; font-weight: 700; }
.tiq-table select { min-height: 32px; padding: 4px 8px; font-size: .82rem; border-radius: 8px; width: auto; max-width: 220px; }
.tiq-wide { min-width: 320px; }
.tiq-mid { min-width: 190px; }
.tiq-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tiq-c { text-align: center; }
.tiq-src { color: var(--tiq-muted); font-size: .78rem; white-space: nowrap; }
.tiq-ed { cursor: text; }
.tiq-ed:focus, .tiq-oem-name:focus, .tiq-oem-model:focus { outline: 2px solid var(--tiq-indigo); outline-offset: -2px; background: #fff !important; }
.tiq-ed:hover { box-shadow: inset 0 0 0 1px #c7d2fe; }
.tiq-status { font-weight: 700; }
.tiq-st-complied { background: #dcfce7 !important; color: #166534 !important; border-color: #86efac !important; }
.tiq-st-not-complied { background: #fee2e2 !important; color: #991b1b !important; border-color: #fca5a5 !important; }
.tiq-st-partially-complied { background: #fef3c7 !important; color: #92400e !important; border-color: #fcd34d !important; }
.tiq-st-deviation { background: #dbeafe !important; color: #1e40af !important; border-color: #93c5fd !important; }
.tiq-st-to-verify { background: #f1f5f9 !important; color: #334155 !important; }
.tiq-oem td.tiq-oemcell { min-width: 170px; }
.tiq-oem-name { font-weight: 700; padding: 2px 4px; border-radius: 6px; min-height: 1.4em; }
.tiq-oem-model { font-size: .78rem; color: var(--tiq-muted); padding: 2px 4px; border-radius: 6px; min-height: 1.3em; margin: 2px 0 6px; }
.tiq-oem-model:empty::before { content: attr(data-ph); color: #a3acc2; }
.tiq-pill { display: inline-block; min-width: 28px; text-align: center; padding: 2px 8px; border-radius: 999px; font-weight: 800; }
.tiq-pill.is-ok { background: #dcfce7; color: #166534; }
.tiq-pill.is-low { background: #fee2e2; color: #991b1b; }
.tiq-x { width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--tiq-muted); font-size: 1.1rem; line-height: 1; cursor: pointer; }
.tiq-x:hover { color: var(--tiq-red); background: #fef2f2; border-color: #fecaca; }
.tiq-pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 10px; font-size: .85rem; color: var(--tiq-muted); }
.tiq-muted { color: var(--tiq-muted); }
.tiq-empty { padding: 28px; text-align: center; }
.tiq-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.tiq-summary { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 22px; }
.tiq-kv { display: grid; gap: 8px; }
.tiq-kv-row { display: grid; grid-template-columns: 200px 1fr; gap: 10px; align-items: center; }
.tiq-kv-row label { font-size: .8rem; font-weight: 700; color: var(--tiq-ink-2); }
.tiq-dates { background: linear-gradient(160deg, #f5f8ff, #faf5ff); border-radius: 14px; padding: 16px; border: 1px solid var(--tiq-line); }
.tiq-dates ul { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.tiq-dates li { display: flex; justify-content: space-between; gap: 10px; font-size: .88rem; padding-bottom: 8px; border-bottom: 1px dashed var(--tiq-line); }
.tiq-dates li span { color: var(--tiq-ink-2); }
.tiq-filelist li { display: block !important; overflow-wrap: anywhere; }

@media (max-width: 780px) {
  .tiq-panel { padding: 18px 16px; }
  .tiq-summary { grid-template-columns: 1fr; }
  .tiq-kv-row { grid-template-columns: 1fr; gap: 4px; }
  .tiq-actions .tiq-btn { flex: 1 1 auto; justify-content: center; }
  .tiq-stat strong { font-size: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) { .tiq-app * { animation: none !important; transition: none !important; } }
