/**
 * layout.css
 * App shell structure: body, header, total bar, split layout, divider.
 * Defines the bones of the page — no component-level styles here.
 * Depends on: base.css
 */


/* ─── APP SHELL ──────────────────────────────────────────────────────────────── */

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
}

/**
 * .app-root
 * Top-level wrapper that fills the viewport and stacks
 * header → total-bar → split vertically.
 */
.app-root {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}


/* ─── HEADER ─────────────────────────────────────────────────────────────────── */

.app-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-6);
  background: var(--color-text);
  color: #fff;
  z-index: var(--z-sticky);
}

.app-header__brand h1 {
  font-size: var(--text-base);
  font-weight: var(--weight-extrabold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: var(--leading-tight);
}

.app-header__brand p {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: #888;
  margin-top: 0.1rem;
}

/* Centre slot — progress bar + save indicator */
.app-header__center {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex: 1;
  justify-content: center;
}

/* Right slot — action buttons */
.app-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* Save indicator */
.save-indicator {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: #888;
  opacity: 0;
  transition: opacity var(--transition-slow);
  white-space: nowrap;
}
.save-indicator.visible { opacity: 1; }


/* ─── PROGRESS BAR ───────────────────────────────────────────────────────────── */

.progress {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.progress__track {
  width: 120px;
  height: 5px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  overflow: hidden;
  flex-shrink: 0;
}

.progress__fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--color-yes);
  transition: width 0.3s ease, background 0.3s ease;
}

.progress__fill--partial { background: var(--color-warning); }

.progress__text {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: #aaa;
  white-space: nowrap;
}

.progress__text strong { color: #fff; font-weight: var(--weight-medium); }


/* ─── TOTAL BAR ──────────────────────────────────────────────────────────────── */

/**
 * .total-bar
 * Slim strip below the header showing live L1 / L2 / L3 / total counts.
 */
.total-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-2) var(--space-6);
  background: #111;
}

.total-bar__chip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: #888;
}

.total-bar__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.total-bar__dot--l1    { background: var(--color-l1); }
.total-bar__dot--l2    { background: var(--color-l2); }
.total-bar__dot--l3    { background: var(--color-l3); }
.total-bar__dot--total { background: #555; }

.total-bar__count { color: #fff; font-weight: var(--weight-medium); }


/* ─── SPLIT LAYOUT ───────────────────────────────────────────────────────────── */

/**
 * .split
 * Two-pane container that fills remaining viewport height.
 * Children (.pane-checklist, .pane-report) size themselves via JS
 * when the divider is dragged; default widths are set here.
 */
.split {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}


/* ─── CHECKLIST PANE ─────────────────────────────────────────────────────────── */

.pane-checklist {
  width: 58%;
  min-width: 240px;
  height: 100%;
  overflow-y: auto;
  padding: var(--space-4) var(--space-5) var(--space-8);
}


/* ─── DRAGGABLE DIVIDER ──────────────────────────────────────────────────────── */

.divider {
  flex-shrink: 0;
  width: 5px;
  height: 100%;
  background: var(--color-border-strong);
  cursor: col-resize;
  position: relative;
  transition: background var(--transition-base);
}

.divider:hover,
.divider--dragging {
  background: var(--color-accent);
}

/* Grip dots */
.divider::after {
  content: '⋮';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--color-text-muted);
  font-size: 0.9rem;
  pointer-events: none;
  opacity: 0.5;
  line-height: 1;
}

.divider:hover::after,
.divider--dragging::after {
  opacity: 1;
  color: #fff;
}


/* ─── REPORT PANE ────────────────────────────────────────────────────────────── */

.pane-report {
  flex: 1;
  min-width: 240px;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-dark-bg);
}


/* ─── PROJECT INFO BAR ───────────────────────────────────────────────────────── */

/**
 * .project-bar
 * Inline row of labelled inputs at the top of the checklist pane.
 */
.project-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.project-bar__label {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.project-bar__input {
  flex: 1;
  min-width: 100px;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition-base);
}

.project-bar__input:focus   { border-color: var(--color-accent); }
.project-bar__input--short  { max-width: 120px; }
.project-bar__input--medium { max-width: 160px; }
.project-bar__input--wide   { min-width: 200px; }
