/* Kompozycje aplikacji „Obłożenie sal”, których design system INFOTECH IoT nie ma.
   Wyłącznie zmienne z tokens.css: bez surowych kolorów i nazw fontów. */

html { scroll-padding-top: var(--nav-height); }
body { min-height: 100vh; display: flex; flex-direction: column; }
main.page { flex: 1; padding-top: var(--space-8); padding-bottom: var(--space-16); }
a { color: inherit; }
[hidden] { display: none !important; }

/* nawigacja */
.app-name { margin-left: var(--space-2); padding-left: var(--space-3); border-left: 1px solid var(--border); color: var(--muted-foreground); font-size: 14px; line-height: 20px; font-weight: 500; }
@media (max-width: 639px) { .app-name { border-left: 0; padding-left: 0; } }
.ii-nav-link[aria-current="page"] { background: var(--accent); color: var(--foreground); }
.menu-meta { padding: 8px; font-size: 14px; line-height: 20px; border-bottom: 1px solid var(--border); margin-bottom: 4px; overflow-wrap: anywhere; }
.menu-meta span { color: var(--muted-foreground); font-size: 12px; }
.menu-meta .ii-badge { margin-top: 6px; }
.ii-menu form { margin: 0; }
.floating-tools { position: fixed; right: var(--space-4); bottom: var(--space-4); z-index: 30; }
.theme-icon-sun { display: none; }
[data-theme="dark"] .theme-icon-sun { display: block; }
[data-theme="dark"] .theme-icon-moon { display: none; }

/* nagłówki stron */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-8); }
.page-head h1 { margin: 0; text-wrap: balance; }
.page-head p { margin: var(--space-2) 0 0; color: var(--muted-foreground); text-wrap: pretty; max-width: var(--measure-2xl); }
@media (max-width: 767px) { .t-page-title { font-size: 30px; line-height: 36px; } }
.section { margin-top: var(--space-12); }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.section-head h2 { margin: 0; display: flex; align-items: center; gap: var(--space-3); }
.muted { color: var(--muted-foreground); }
.t-tabular { font-variant-numeric: tabular-nums; }
.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }

/* komunikaty */
.flash { margin-bottom: var(--space-6); }
.flash-ok { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); border: 1px solid var(--status-good-line); background: var(--status-good-soft); color: var(--status-good-text); border-radius: var(--radius-lg); font-size: 14px; line-height: 20px; }
.field-help { margin: 0; font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.form-errors:empty { display: none; }
.form-errors { margin-top: var(--space-2); }

/* siatki */
.metrics { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.room-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-2 { display: grid; gap: var(--space-6); grid-template-columns: 1fr; }
@media (min-width: 1024px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.form-grid { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
@media (min-width: 768px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.form-grid .span-2 { grid-column: 1 / -1; }

/* kafelek sali */
.room-tile { gap: var(--space-4); transition: box-shadow 150ms, border-color 150ms; }
.room-tile:hover { box-shadow: var(--shadow-md); }
.room-tile-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.room-tile-meta { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); font-size: 14px; line-height: 20px; color: var(--muted-foreground); }
.room-tile-meta span { display: inline-flex; align-items: center; gap: 6px; }
.chips-col { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

/* tabele */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
table.data th { text-align: left; font-weight: 500; color: var(--muted-foreground); padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data td { padding: var(--space-3); border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data code, .mono { font-family: var(--font-sans); font-variant-numeric: tabular-nums; font-size: 13px; overflow-wrap: anywhere; }
.bar { height: 8px; border-radius: var(--radius-full); background: var(--muted); min-width: 80px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--chart-1); border-radius: var(--radius-full); }

/* oś czasu dnia */
.timeline { width: 100%; height: auto; display: block; overflow: visible; }
.timeline .hours rect { fill: var(--muted); }
.timeline .grid line { stroke: var(--border); stroke-width: 1; }
.timeline .axis text { fill: var(--muted-foreground); font-size: 22px; font-family: var(--font-sans); }
.timeline .lane-label { fill: var(--muted-foreground); font-size: 22px; font-family: var(--font-sans); }
.timeline .s-session { fill: var(--chart-1); }
.timeline .s-motion { stroke: var(--chart-2); stroke-width: 3; }
.timeline .s-light { fill: var(--chart-4); }
.timeline .s-door { fill: var(--chart-3); }
.timeline .now { stroke: var(--foreground); stroke-width: 2; stroke-dasharray: 6 6; }
.legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend .l-session { background: var(--chart-1); }
.legend .l-motion { background: var(--chart-2); }
.legend .l-light { background: var(--chart-4); }
.legend .l-door { background: var(--chart-3); }
.legend .l-hours { background: var(--muted); border: 1px solid var(--border); }

/* heatmapa */
.heatmap { display: grid; grid-template-columns: 32px repeat(16, minmax(18px, 1fr)); gap: 3px; font-size: 12px; line-height: 16px; }
.heatmap .h { color: var(--muted-foreground); text-align: center; font-variant-numeric: tabular-nums; }
.heatmap .d { color: var(--muted-foreground); display: flex; align-items: center; }
.heatmap .c { aspect-ratio: 1.6; border-radius: 4px; background: color-mix(in oklab, var(--foreground) calc(var(--v) * 1%), var(--muted)); border: 1px solid var(--border); }
@media (max-width: 639px) { .heatmap { grid-template-columns: 24px repeat(16, minmax(12px, 1fr)); gap: 2px; } }

/* picker czujników */
.area-list { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.area-item { text-align: left; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 6px; padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); color: var(--foreground); transition: border-color 150ms, background-color 150ms; }
.area-item:hover { background: var(--accent); }
.area-item:focus-visible { outline: none; border-color: var(--ring); box-shadow: var(--focus-ring); }
.area-item.is-on { border-color: var(--primary); }
.check { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-2) 0; font-size: 14px; line-height: 20px; }
.check input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--primary); }
.check small { display: block; color: var(--muted-foreground); font-size: 12px; line-height: 16px; }
.device { padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.device:last-child { border-bottom: 0; }

/* klucz API pokazany raz */
.secret { display: block; padding: var(--space-3) var(--space-4); border: 1px dashed var(--border); border-radius: var(--radius-md); background: var(--muted-section); overflow-wrap: anywhere; font-family: var(--font-sans); font-variant-numeric: tabular-nums; font-size: 14px; line-height: 20px; }
pre.code { font-family: var(--font-sans); font-variant-numeric: tabular-nums; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--muted-section); border: 1px solid var(--border); overflow-x: auto; font-size: 13px; line-height: 20px; }

/* postęp zadania */
.progress { height: 8px; border-radius: var(--radius-full); background: var(--muted); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); transition: width 300ms; }

/* logowanie i błędy: siatka kropek jak w Hero */
.center-page { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; padding: var(--space-16) var(--space-4); overflow: hidden; }
.center-card { position: relative; z-index: 1; width: 100%; max-width: 420px; text-align: center; }
.center-card .ii-card-content { display: flex; flex-direction: column; align-items: center; gap: var(--space-4); }
.center-card h1 { margin: 0; }
.center-card p { margin: 0; color: var(--muted-foreground); }
.center-card .ii-btn { width: 100%; }

/* znaki technologii (Assets → Technologies): rysowane na biało, w jasnym motywie odwrócone */
.tech-logo { filter: invert(1); }
[data-theme="dark"] .tech-logo { filter: none; }
