/* Layout mechanics only (after bebras-design/orange-proposals/shared/base.css).
   Colour, type and shape come from tokens.css and components.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; -webkit-font-smoothing: antialiased; overflow-wrap: break-word; }
[hidden] { display: none !important; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul.plain, ol.plain { padding: 0; list-style: none; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }

.icon { width: 1.15em; height: 1.15em; flex: none; stroke-width: 1.75; }
.logo { height: auto; width: 100%; }
.brand-mark { display: none; }

/* app shell: sidebar + main */
.app {
  --sb-w: 256px; --sb-w-collapsed: 78px;
  display: grid;
  grid-template-columns: var(--sb-w) minmax(0, 1fr);
  min-height: 100vh;
}
.app.is-collapsed { --sb-w: var(--sb-w-collapsed); }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; min-width: 0;
  overflow-y: auto; overflow-x: hidden;
}
.sb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sb-brand { display: block; min-width: 0; text-decoration: none; }
.sb-nav { flex: 1; }
.sb-nav ul, .sb-foot ul { margin: 0; padding: 0; list-style: none; }
.nav-item { display: flex; align-items: center; text-decoration: none; min-width: 0; }
.nav-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-icon { display: grid; place-items: center; flex: none; }

@media (min-width: 901px) {
  .app.is-collapsed .nav-text, .app.is-collapsed .sb-label, .app.is-collapsed .nav-badge,
  .app.is-collapsed .sb-collapse-hide { display: none; }
  .app.is-collapsed .sb-head { flex-direction: column; }
  .app.is-collapsed .nav-item { justify-content: center; }
  .app.is-collapsed .brand-full { display: none; }
  .app.is-collapsed .brand-mark { display: block; }
}

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 5; }
.topbar-spacer { flex: 1; }
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; }
.crumbs > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { display: inline-grid; place-items: center; position: relative; flex: none; }
.menu-btn { display: none; }
.content { flex: 1; min-width: 0; outline: none; }
.page { min-width: 0; }

/* shared component mechanics */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; text-decoration: none; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; position: relative; }
.page-head-text { min-width: 0; flex: 1 1 320px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.card { min-width: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head-text { min-width: 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; }
.tag { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tag-dot { display: inline-block; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.field { display: flex; flex-direction: column; min-width: 0; }
.form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; min-width: 0; }
.form-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.dash > * { min-width: 0; }
.stack { display: flex; flex-direction: column; min-width: 0; }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-icon { transition: transform .2s; }
.faq-item[open] > summary .faq-icon { transform: rotate(180deg); }
.scrim { display: none; }

/* tablet and phone */
@media (max-width: 1180px) {
  .dash { grid-template-columns: minmax(0, 1fr); }
  .dash > * { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .app, .app.is-collapsed { grid-template-columns: minmax(0, 1fr); --sb-w: 280px; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; height: auto; width: min(var(--sb-w), 86vw); z-index: 40; transform: translateX(-102%); transition: transform .25s ease; visibility: hidden; }
  .app.is-open .sidebar { transform: none; visibility: visible; }
  .app.is-open .scrim { display: block; position: fixed; inset: 0; z-index: 30; }
  .menu-btn { display: inline-grid; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .page-actions { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
