/* Per-screen layout: detail two-column, rankings header, settings tabs,
   internal two-pane, Analitika frame, styleguide. */

/* ---- tender detail (screen 4) ---- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--space-5); }
.detail-main { min-width: 0; }
.detail-rail > .card + .card { margin-top: var(--space-3); }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-2); }
.detail-head .badge { flex: 0 0 auto; margin-top: 4px; font-size: 12px; padding: 4px 10px; }
.detail-inst { color: var(--ink-muted); margin-bottom: var(--space-5); }
.detail-desc { font-size: 14px; line-height: 22px; }
.similar-list { list-style: none; padding: 0; margin: 0; }
/* One column under 1200: the rail follows the page in the order the markup
   has it. CSS `order` moved the tracking card up but not the tab order, so a
   keyboard walk jumped over it and back (WCAG 2.4.3); .detail-jump in
   screen_core.css keeps the card one tap from the title instead.
   1199 and not 1023 because the rail is 300 px of a column the shell had
   already cut to 784 px: the lot table was left 370 px and hid 36 % of
   itself behind a sideways scroll from 1024 px to 1230 px. */
@media (max-width: 1199px) {
  .detail-grid { grid-template-columns: 1fr; gap: var(--space-4); }
}

/* ---- rankings (screen 6) ---- */
.rank-head .page-actions .select { width: auto; }
.rank-controls { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-3); }
@media (max-width: 719px) { .rank-head .page-actions { flex-direction: column; align-items: stretch; } .rank-head .page-actions .select { width: 100%; } }

/* ---- settings (screen 9) ---- */
.settings-cols { display: flex; gap: var(--space-4); flex-wrap: wrap; align-items: flex-start; }
.settings-main { flex: 1 1 320px; max-width: 480px; }
.settings-side { flex: 0 1 340px; }
.subscription-card { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; max-width: 856px; margin-top: var(--space-4); }

/* ---- team (screen 10) ---- */
.team-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-4); align-items: start; }
@media (max-width: 1023px) { .team-grid { grid-template-columns: 1fr; } }

/* ---- internal admin (screen 11) ---- */
.admin-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: calc(100vh - var(--topbar-h)); }
.admin-list { background: var(--surface-200); border-right: 1px solid var(--border); padding: 20px 16px; }
.company-item { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: var(--radius-md); border: 1px solid transparent; color: var(--ink); }
.company-item:hover { text-decoration: none; background: var(--surface-100); }
.company-item[aria-current] { background: var(--brand-soft); border-color: var(--brand); }
.company-name { font: 600 14px/20px var(--font-sans); }
.company-badges { display: flex; gap: 6px; }
.admin-detail { padding: 28px 40px; min-width: 0; }
.admin-cards { display: flex; gap: var(--space-4); flex-wrap: wrap; align-items: flex-start; }
.admin-cards > .card { flex: 1 1 360px; }
@media (max-width: 1023px) {
  .admin-grid { grid-template-columns: 1fr; }
  .admin-list { border-right: 0; border-bottom: 1px solid var(--border); }
  .admin-detail { padding: var(--space-4); }
}

/* ---- Analitika (iframe) ---- */
/* dvh: on iOS Safari 100vh is the large viewport, so the bottom of the frame
   (the report's fixed phone drawer) would sit under the browser toolbar. */
.page-analitika { height: 100vh; height: 100dvh; overflow: hidden; }
.page-analitika .app { height: 100vh; height: 100dvh; }
.page-analitika .app-body { height: 100vh; height: 100dvh; }
.page-analitika .main { padding: 0; max-width: none; display: flex; flex-direction: column; min-height: 0; }
.analitika-bar { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; padding: 10px var(--space-3); background: var(--surface-200); border-bottom: 1px solid var(--border); }
.analitika-title { font: 600 15px/22px var(--font-sans); }
.analitika-title .oblast { color: var(--ink); }
.analitika-meta { font: var(--text-body-small); color: var(--ink-muted); }
.analitika-open { margin-left: auto; font: 600 13px/18px var(--font-sans); white-space: nowrap; }
.analitika-loading { padding: 6px var(--space-3); font: var(--text-body-small); color: var(--ink-muted); background: var(--surface-100); }
.report-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; }
.report { display: block; width: 100%; height: 100%; min-height: 100%; border: 0; background: var(--surface-200); }
@media (max-width: 719px) {
  .analitika-bar { gap: var(--space-2); }
  .analitika-meta { display: none; }
}

/* ---- styleguide ---- */
.sg { margin: var(--space-5) 0; }
.sg > h2 { margin-bottom: var(--space-3); }
.sg .filters { margin-bottom: var(--space-3); }

/* ---- Dokumenti za tender (screen: /dokumenti) ---- */
/* The process is on the screen rather than in a manual nobody opens: a reader
   who has never prepared a package has to see, before the upload, which step
   is theirs and which is ours. */
.h-sub {
  font: var(--text-label);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  margin: var(--space-4) 0 var(--space-2);
}

.h-sub:first-of-type { margin-top: var(--space-3); }

.doc-steps {
  margin: 0 0 var(--space-2);
  padding-left: var(--space-5);
  font: var(--text-body-small);
}

.doc-steps li { margin-bottom: var(--space-2); max-width: 70ch; }

.doc-steps li:last-child { margin-bottom: 0; }
