/* Server Selector Tool - stylesheet (Niyya apps family) */

:root {
  --ink: #1f2933;
  --ink-soft: #52616f;
  --muted: #7a8894;
  --line: #e2e8ef;
  --line-soft: #eef2f6;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --navy: #1f3b57;
  --navy-soft: #2c5c86;
  --accent: #2c5c86;
  --brand: #F2712C;
  --good: #15803d;
  --good-bg: #f0fdf4;
  --fair: #b45309;
  --bad: #dc2626;
  --great: #047857;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 32, 48, .05), 0 8px 24px rgba(16, 32, 48, .05);
  --font: "Segoe UI", Inter, -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--bg); }

.wrap { width: min(1260px, 100% - 32px); margin-inline: auto; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; color: var(--navy); }
h1 { font-size: 1.85rem; margin: 0 0 6px; }
h2 { font-size: 1.22rem; margin: 0 0 4px; }
h3 { font-size: 1rem; margin: 22px 0 10px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.d-block { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.lead { color: var(--ink-soft); max-width: 75ch; }

/* ---------- top bar ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-inner { display: flex; align-items: center; gap: 24px; min-height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-mark { display: flex; }
.brand-text strong { display: block; font-size: .96rem; color: var(--navy); }
.brand-text small { display: block; font-size: .72rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.topnav { display: flex; gap: 4px; margin-right: auto; }
.topnav a { padding: 7px 13px; border-radius: 8px; text-decoration: none; color: var(--ink-soft); font-size: .9rem; font-weight: 500; white-space: nowrap; }
.topnav a:hover { background: var(--line-soft); }
.topnav a.is-active { background: var(--navy); color: #fff; }
.nav-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px; border-radius: 9px; background: var(--brand); color: #fff; font-size: .7rem; font-weight: 700; }
.topbar-auth { display: flex; align-items: center; gap: 10px; }
.who { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--ink-soft); text-decoration: none; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: .78rem; font-weight: 600; }
.tag { font-style: normal; font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; padding: 2px 6px; border-radius: 4px; }
.tag-sandbox { background: #fef3c7; color: #92400e; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 17px; border-radius: 9px; border: 1px solid transparent;
  font: inherit; font-size: .9rem; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .13s, border-color .13s, color .13s; white-space: nowrap; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: #17304a; }
.btn-outline { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: #c3cfdb; }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--line-soft); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: 6px 12px; font-size: .82rem; }
.btn-xs { padding: 4px 9px; font-size: .78rem; border-radius: 7px; border-color: var(--line); }
.btn-xs.is-on { color: var(--good); border-color: #bbf7d0; background: var(--good-bg); }
.btn-lg { padding: 12px 24px; font-size: .98rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.inline { display: inline; }

/* ---------- notices ---------- */
.flash { margin-top: 16px; padding: 11px 15px; border-radius: 9px; font-size: .9rem; border: 1px solid; }
.flash-success { background: #f0fdf4; border-color: #bbf7d0; color: #14532d; }
.flash-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.flash-warn    { background: #fffbeb; border-color: #fde68a; color: #78350f; }
.flash-error   { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; }
.notice { margin: 18px 0; padding: 13px 16px; border-radius: 10px; font-size: .88rem; background: #f0f6ff; border: 1px solid #d5e4f7; color: #1e3a5f; }
.notice-warn { background: #fffbeb; border-color: #fde68a; color: #78350f; }

/* ---------- hero / page head ---------- */
.hero { display: flex; gap: 40px; align-items: flex-start; justify-content: space-between; padding: 34px 0 6px; }
.hero p { max-width: 70ch; color: var(--ink-soft); }
.hero-stats { display: flex; gap: 10px; flex-shrink: 0; }
.hero-stats div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; text-align: center; min-width: 88px; }
.hero-stats strong { display: block; font-size: 1.5rem; color: var(--navy); }
.hero-stats span { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.page-head { display: flex; gap: 24px; justify-content: space-between; align-items: flex-end; padding: 30px 0 18px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- cards / form ---------- */
.card-form { display: grid; gap: 18px; padding-bottom: 60px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px 24px; box-shadow: var(--shadow); margin: 0 0 18px; min-width: 0; }
.card-form .card { margin: 0; }
.card legend { font-weight: 700; color: var(--navy); font-size: .95rem; padding: 0 8px; margin-left: -8px; }
.field-intro { font-size: .86rem; color: var(--muted); margin: -2px 0 14px; }
.grid { display: grid; gap: 16px 20px; margin-top: 14px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
label, .label { display: block; font-size: .84rem; font-weight: 600; color: var(--ink-soft); }
label small, .label small { display: block; font-weight: 400; font-size: .76rem; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.label small { display: inline; }
input[type=text], input[type=email], input[type=number], input[type=search], select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; font: inherit; font-size: .92rem; color: var(--ink); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-weight: 500; }
.check input { width: 16px; height: 16px; }
.seg { display: inline-flex; margin-top: 6px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; flex-wrap: wrap; }
.seg label { display: flex; align-items: center; gap: 6px; padding: 8px 12px; font-weight: 500; cursor: pointer; }
.seg label + label { border-left: 1px solid var(--line); }
.seg label:has(input:checked) { background: var(--navy); color: #fff; }
.seg input { accent-color: var(--brand); }
[data-mode][hidden], [data-servers][hidden], [data-os][hidden] { display: none !important; }
.oem-pick { margin-top: 18px; }
.oem-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.oem-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid var(--line); border-left: 4px solid var(--oem); border-radius: 8px; cursor: pointer; font-weight: 500; }
.oem-chip small { color: var(--muted); }
.oem-chip:has(input:checked) { background: var(--line-soft); border-color: var(--oem); }
.form-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 14px; }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile span { display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.tile strong { display: block; font-size: 1.45rem; color: var(--navy); margin: 2px 0; }
.tile small { color: var(--muted); font-size: .78rem; }

/* ---------- recommendation ---------- */
.reco { border-top: 4px solid var(--oem, var(--navy)); }
.reco-head { display: flex; justify-content: space-between; gap: 24px; }
.reco-head h2 { font-size: 1.6rem; }
.links { font-size: .88rem; }
.reco-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.facts { display: grid; gap: 6px; margin: 0; }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.facts dt { color: var(--ink-soft); }
.facts dd { margin: 0; font-weight: 600; text-align: right; }
.gaps { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: #fef2f2; border: 1px solid #fecaca; color: #7f1d1d; font-size: .88rem; }
.gaps ul, .notes { margin: 6px 0 0; padding-left: 18px; }
.notes { font-size: .85rem; color: var(--ink-soft); margin-top: 10px; }
.ok { margin-top: 14px; padding: 10px 14px; border-radius: 10px; background: var(--good-bg); border: 1px solid #bbf7d0; color: #14532d; font-weight: 600; }
.fit-dial { position: relative; flex-shrink: 0; width: 132px; height: 132px; }
.fit-dial > div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.fit-dial strong { font-size: 1.7rem; color: var(--navy); line-height: 1; }
.fit-dial span { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.fit-great { color: var(--great); } .fit-good { color: var(--good); } .fit-fair { color: var(--fair); } .fit-poor { color: var(--bad); }
.criteria { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.criteria li { display: grid; grid-template-columns: 11em 1fr 3em; gap: 10px; align-items: center; font-size: .88rem; }
.criteria b { text-align: right; }
.fitbar { display: block; height: 8px; border-radius: 4px; background: var(--line-soft); overflow: hidden; }
.fitbar i { display: block; height: 100%; border-radius: 4px; background: currentColor; }
.fit { display: inline-grid; grid-template-columns: 70px auto; gap: 8px; align-items: center; }
.fit b { font-size: .86rem; }
.fit-inline { font-size: .9rem; padding: 3px 10px; border-radius: 20px; border: 1px solid currentColor; vertical-align: middle; }

/* ---------- OEM artwork ---------- */
.oem-shot { margin: 10px 0 12px; max-width: 420px; }
.oem-shot img { display: block; max-width: 100%; max-height: 140px; object-fit: contain; }
.oem-shot figcaption, .oem-art figcaption { font-size: .76rem; color: var(--muted); margin-top: 4px; }
.oem-art { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 24px; align-items: start; }
.oem-art figure { margin: 0; }
.oem-art img { display: block; max-width: 100%; max-height: 420px; object-fit: contain; border-radius: 6px; }
@media (max-width: 860px) { .oem-art { grid-template-columns: 1fr; } }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 0 12px; border-radius: var(--radius); }
.card .table-wrap { margin: 0; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; background: var(--surface); }
.table th, .table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #fafbfd; position: sticky; top: 0; }
.table tbody th { font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-compact td, .table-compact th { padding: 7px 9px; }
.table tr.is-chosen td { background: #fff7ed; }
.chk { width: 34px; }
.th-sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; }
.th-sort::after { content: "↕"; font-size: .9em; opacity: .45; }
.th-sort:hover { color: var(--ink); }
.th-sort:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 3px; }
th[aria-sort="ascending"] .th-sort::after { content: "▲"; opacity: 1; color: var(--accent); }
th[aria-sort="descending"] .th-sort::after { content: "▼"; opacity: 1; color: var(--accent); }
th.num .th-sort { justify-content: flex-end; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions > * + * { margin-left: 4px; }
.oem-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--oem, var(--navy)); margin-right: 7px; vertical-align: 1px; }
.pill { display: inline-block; font-size: .74rem; font-weight: 700; padding: 2px 9px; border-radius: 20px; }
.pill-ok { background: var(--good-bg); color: var(--good); }
.pill-bad { background: #fef2f2; color: var(--bad); cursor: help; }
.pill-info { background: #fff7ed; color: #c2410c; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.spec-table th { width: 30%; }

/* ---------- diagrams ---------- */
.tabs { display: inline-flex; background: var(--line-soft); padding: 3px; border-radius: 9px; }
.tab { border: 0; background: transparent; padding: 7px 14px; border-radius: 7px; font: inherit; font-size: .86rem; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.tab.is-active { background: #fff; color: var(--navy); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.diagram { display: none; border: 1px solid var(--line); border-radius: 10px; overflow: auto; background: #fff; }
.diagram.is-active { display: block; }
.diagram svg { display: block; width: 100%; height: auto; min-width: 760px; }

/* ---------- export ---------- */
.export-card { display: flex; justify-content: space-between; gap: 24px; align-items: center; flex-wrap: wrap; }
.export-card > div { max-width: 60ch; }
.export-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-export { background: #fff; border-color: var(--line); color: var(--ink); padding: 10px 16px; }
.btn-export:hover { border-color: #b9c6d3; }
.fmt { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; color: #fff; font-size: .75rem; font-weight: 800; }
.fmt-docx { background: #2B579A; } .fmt-pptx { background: #D24726; } .fmt-xlsx { background: #217346; }

/* ---------- compare ---------- */
.winner { display: flex; justify-content: space-between; align-items: center; gap: 20px; border-left: 5px solid var(--oem); flex-wrap: wrap; }
.compare-table { min-width: 720px; }
.compare-table thead th { text-transform: none; letter-spacing: 0; font-size: .9rem; color: var(--ink); border-top: 4px solid var(--oem, transparent); position: relative; min-width: 170px; }
.compare-table thead th:first-child { min-width: 150px; }
.compare-table .oem-name { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.compare-table .x { position: absolute; top: 4px; right: 6px; border: 0; background: none; font-size: 1.1rem; color: var(--muted); cursor: pointer; }
.compare-table td.is-best { background: var(--good-bg); }
.compare-table tr.group th { background: #fafbfd; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.mini { margin: 6px 0 0; padding-left: 16px; font-size: .78rem; color: var(--bad); }
.add-model { display: flex; gap: 8px; align-items: center; }
.add-model select { margin: 0; min-width: 220px; }
.empty { text-align: center; padding: 40px 24px; }

/* ---------- catalogue ---------- */
.filters { display: grid; grid-template-columns: 2fr repeat(4, 1fr); gap: 14px; align-items: end; }
.filters p { grid-column: 1 / -1; margin: 0; }

/* ---------- signin ---------- */
.signin { max-width: 560px; margin: 40px auto; }

/* ---------- footer ---------- */
.sitefoot { border-top: 1px solid var(--line); background: var(--surface); margin-top: 40px; padding: 18px 0; font-size: .84rem; }
.sitefoot-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sitefoot a { color: var(--ink-soft); }
.new-design { text-align: center; margin: 10px 0 30px; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .topbar-inner { flex-wrap: wrap; gap: 8px 16px; padding: 8px 0; }
  .topnav { order: 3; width: 100%; overflow-x: auto; }
  .hero { flex-direction: column; gap: 18px; }
  .grid-3, .grid-4, .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reco-body { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  h1 { font-size: 1.45rem; }
  .grid-3, .grid-4, .grid-5, .filters { grid-template-columns: 1fr; }
  .card { padding: 18px 16px; }
  .reco-head { flex-direction: column-reverse; align-items: flex-start; }
  .criteria li { grid-template-columns: 8.5em 1fr 2.6em; }
  .who-name { display: none; }
  .hero-stats div { min-width: 0; padding: 10px 12px; }
}
@media print {
  .topbar, .sitefoot, .export-card, .head-actions, .row-actions, .new-design { display: none !important; }
  body { background: #fff; }
}
