/* Laat console: page layouts only. Tokens, native elements and components come from /ui/ui.css (see docs/UI.md). */

/* top bar */
.bar { position: sticky; top: 0; z-index: var(--z-bar); display: flex; align-items: center; gap: var(--sp-3); padding: calc(6px + env(safe-area-inset-top)) 12px 6px;
  background: var(--bg); border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; flex: none; border-radius: var(--radius-sm); }
.brand .logo { display: block; width: 32px; height: 32px; }
.brand .logo-mark { stroke: var(--text); }
.brand .logo-art { stroke: var(--pink); }
.brand .logo-tech { stroke: var(--teal); }
/* the logo is inline (index.html) so L and T take the theme text colour; the triangles keep the brand pink and teal */

/* rail: one icon per place (title and aria-label carry the name) */
.rail { display: flex; align-items: center; gap: var(--sp-1); flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.rail-gap { flex: 1; }
.rail-link { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; width: var(--tap); height: var(--tap);
  border-radius: var(--radius); color: var(--muted); text-decoration: none; --icon-size: 22px; }
.rail-link:hover { background: var(--surface); color: var(--text); }
.rail-link[aria-current=page] { color: var(--accent); background: var(--accent-soft); }
.rail-link.soon { opacity: .4; cursor: not-allowed; }
.rail-link.soon:hover { background: none; color: var(--muted); }

/* tabs (settings) */
.tabs { display: flex; gap: var(--sp-1); overflow-x: auto; scrollbar-width: none; margin: 0 0 var(--sp-4); border-bottom: 1px solid var(--border); }
.tab { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: var(--tap); padding: 0 var(--sp-3); white-space: nowrap; color: var(--muted);
  text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab[aria-current=page] { color: var(--text); border-bottom-color: var(--accent); }
.settings .item > laat-icon { color: var(--muted); }
.settings .item.is-stub .item-main { opacity: .55; }
.settings laat-card p { margin: 0 0 var(--sp-2); }
.settings laat-card > :last-child { margin-bottom: 0; }

/* layout */
.view { max-width: 920px; margin: 0 auto; padding-bottom: calc(48px + env(safe-area-inset-bottom)); }
.pad-y { padding: 14px; }
.narrow { max-width: 420px; margin: 40px auto 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.crumbs { margin: 0 0 6px; font-size: .9rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 14px; margin-bottom: 10px; }
details.card { padding: 10px 14px; }
details summary { cursor: pointer; color: var(--accent); font-weight: 600; }
details[open] summary { margin-bottom: 10px; }

/* forms */
.saving { opacity: .6; }
.search { font-size: 1.05rem; min-height: 48px; margin: 10px 0; }
.adder { display: grid; grid-template-columns: 2fr auto 1.3fr auto; gap: 8px; margin-bottom: 14px; }
.adder input[type=date] { width: auto; }
details .adder, .card .adder { margin-bottom: 0; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
@media (max-width: 640px) {
  .adder { grid-template-columns: 1fr 1fr; }
  .adder > :first-child { grid-column: 1 / -1; }
}

/* lists */
.item-main { flex: 1; display: flex; flex-direction: column; text-decoration: none; color: var(--text); min-width: 0; }
.item-main .muted { font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.filters .sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }

/* state and type pills */
.pill.type-art { color: var(--art); border-color: currentColor; }
.pill.type-tech { color: var(--tech); border-color: currentColor; }
.pill.st-active { color: var(--ok); border-color: currentColor; }
.pill.st-lead, .pill.st-prospect { color: var(--accent); border-color: currentColor; }
.pill.st-paused { color: var(--warn); border-color: currentColor; }
.pill.st-done, .pill.st-cancelled, .pill.st-inactive { color: var(--muted); }
/* filter toggles (to move to a shared component when the timeline chips land) */
.chip { display: inline-block; font-size: .82rem; padding: 3px 10px; border-radius: var(--radius-pill); border: 1px solid var(--border); text-decoration: none; color: var(--text);
  max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }

/* tasks */
.group h2 { display: flex; gap: 8px; align-items: baseline; }
.group-late h2 { color: var(--error); }
.task { display: flex; align-items: center; gap: 10px; padding: 8px 12px; min-height: 48px; }
.task input[type=checkbox] { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--ok); }
.task-title { flex: 1; text-align: left; background: none; border: 0; padding: 4px 0; min-height: 0; justify-content: flex-start; white-space: normal; }
.task-title:hover { background: none; }
.task.high .task-title { font-weight: 650; }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.due { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.due.late { color: var(--error); font-weight: 600; }
.tasks details { margin-top: 14px; }
.tasks details summary { color: var(--muted); font-weight: 400; }
@media (max-width: 640px) { .task { flex-wrap: wrap; } .task-meta { width: 100%; padding-left: 30px; justify-content: flex-start; } }

/* module cards on a project */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 10px 0; }
.cards:empty { display: none; }
.module-card { margin: 0; }
.mini { margin: 4px 0; padding-left: 18px; font-size: .9rem; }

dialog .row .field { flex: 1; }

.key { font-size: .85rem; color: var(--muted); letter-spacing: .03em; }

/* dashboard (home): key figures, then what needs attention */
.dash { max-width: 1180px; margin: 0 auto; }
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.dash-date { margin: 0 0 2px; font-size: var(--fs-sm); }
.dash-date::first-letter { text-transform: uppercase; }
.dash-figures { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--sp-3); }
.dash-figures laat-card p { margin: 0; font-size: var(--fs-sm); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
.dash-block h2 { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.dash-item { color: var(--text); text-decoration: none; }
.dash-item > laat-icon { color: var(--muted); flex: none; }
.dash-label { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 820px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .dash-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
  .dash-figures laat-card p { display: none; }
  .dash-figures laat-card[state=stub] .pill { display: none; }
}
.view > [hidden] { display: none; }

/* phone: the rail becomes a bar stuck to the bottom of the screen, within thumb reach; the logo stays at the top and scrolls away */
@media (max-width: 640px) {
  .bar { position: static; }
  .rail { position: fixed; z-index: var(--z-bar); left: 0; right: 0; bottom: 0; justify-content: space-around; gap: 0;
    padding: 4px 8px calc(4px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--border); }
  .rail:empty { display: none; }
  .rail-gap { display: none; }
  .view { padding-bottom: calc(var(--tap) + 56px + env(safe-area-inset-bottom)); }
  laat-toast { bottom: calc(var(--tap) + 8px + var(--sp-5) + env(safe-area-inset-bottom)); }
}
