/* layout.css — shell, sidebar, topbar, content column */

/* ── Login ─────────────────────────────────────────────── */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }

.login-card {
  width: 100%;
  max-width: 424px;
  background: var(--paper);
  border: var(--stroke);
  border-radius: var(--r-xl);
  box-shadow: var(--pop);
  padding: 34px;
  display: grid;
  gap: 18px;
}

.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.login-brand h1 { font-size: var(--fs-xl); }
.login-brand p  { color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; }

.brand-mark {
  width: 54px; height: 54px; flex: none;
  display: grid; place-items: center;
  background: var(--yellow);
  color: var(--ink);
  border: var(--stroke);
  border-radius: var(--r-md);
  box-shadow: var(--pop-sm);
}
.brand-mark.sm { width: 40px; height: 40px; border-radius: var(--r-sm); border: var(--stroke-2); }

.login-error {
  display: flex; align-items: flex-start; gap: 9px;
  background: #FDECEC;
  border: var(--stroke-2);
  border-color: var(--red);
  color: #93221F;
  border-radius: var(--r-md);
  padding: 11px 13px;
  font-size: var(--fs-sm);
  font-weight: 600;
}
.login-error .ico { color: var(--red); margin-top: 1px; }

.login-hint { color: var(--text-3); font-size: var(--fs-xs); text-align: center; }

/* ── Shell ─────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; height: 100vh; }

/* ── Sidebar ───────────────────────────────────────────── */
.sidebar {
  display: flex; flex-direction: column;
  background: var(--sidebar);
  border-right: 2px solid var(--line);
  min-height: 0;
}

.sidebar-head {
  background: var(--navy-deep);
  padding: 20px 16px 18px;
}

.brand-row { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.brand-text { display: grid; line-height: 1.3; min-width: 0; }
.brand-text strong { color: #fff; font-size: var(--fs-sm); font-weight: 800; letter-spacing: -0.01em; }
.brand-text span   { color: #9FB6D8; font-size: var(--fs-xs); font-weight: 500; }

.user-card {
  display: flex; align-items: center; gap: 11px;
  background: rgba(255,255,255,0.09);
  border: 1.5px solid rgba(255,255,255,0.16);
  border-radius: var(--r-md);
  padding: 10px;
}
/* A monogram rather than an emoji face: it always reflects the real account. */
.avatar {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  background: var(--yellow);
  color: var(--ink);
  border: var(--stroke-2);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.avatar.lg { width: 56px; height: 56px; font-size: var(--fs-lg); border-radius: var(--r-md); }
.avatar.sm { width: 30px; height: 30px; font-size: 11.5px; border-radius: 7px; border-width: 1.5px; }
.avatar.quiet { background: #DCE9F8; border-color: var(--line); color: var(--text-2); }

.user-meta { display: grid; gap: 4px; min-width: 0; }
.user-meta strong {
  color: #fff; font-size: var(--fs-sm); font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Nav ───────────────────────────────────────────────── */
.nav { flex: 1; overflow-y: auto; padding: 14px 12px; min-height: 0; }

.nav-group {
  color: var(--text-3); font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em; margin: 4px 0 8px 8px;
}

.nav-item {
  width: 100%;
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px;
  margin-bottom: 2px;
  background: transparent;
  border: 2px solid transparent;
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav-item:hover { background: rgba(27,58,138,0.07); color: var(--text); }

.nav-icon {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border: var(--stroke-2);
  border-radius: 8px;
  box-shadow: var(--pop-sm);
  color: var(--ink);
  background: #fff;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav-item:hover .nav-icon { background: #fff; }

/* Only the active row gets a filled chip — that is the single cue for where
   you are, so nothing else competes with it. */
.nav-item.active { background: #fff; border-color: var(--ink); font-weight: 700; color: var(--text); }
.nav-item.active .nav-icon { color: #fff; }

.nav-label { flex: 1; min-width: 0; }
.nav-badge {
  background: var(--red); color: #fff;
  border: 1.5px solid var(--ink);
  border-radius: 999px; min-width: 21px;
  padding: 1px 6px;
  font-size: 11px; font-weight: 800; text-align: center;
}

.sidebar-foot { padding: 14px; border-top: 2px solid var(--line); display: grid; gap: 11px; }

.conn { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); }
.conn .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); border: 1.5px solid var(--ink); }
.conn.is-down .dot { background: var(--red); }
.conn.is-down { color: var(--red); }

/* ── Main ──────────────────────────────────────────────── */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.topbar {
  display: flex; align-items: center; gap: 16px;
  background: var(--navy);
  border-bottom: var(--stroke);
  padding: 15px var(--gutter);
}
/* Caps here read as shop signage, which is the point — but they are confined
   to this one title. Field labels use sentence case. */
.topbar h2 {
  flex: 1;
  color: var(--yellow);
  font-size: var(--fs-lg);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.view-scroll { flex: 1; overflow-y: auto; min-height: 0; }

.content {
  width: 100%;
  max-width: var(--max-content);
  margin: 0 auto;
  padding: var(--gutter);
  display: grid;
  gap: 24px;
  align-content: start;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1080px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0;
    width: var(--sidebar-w);
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 6px 0 22px rgba(8, 22, 52, 0.38);
  }
  .shell.nav-open .sidebar { transform: translateX(0); }
  .shell.nav-open::after {
    content: ''; position: fixed; inset: 0;
    background: rgba(10,20,45,0.48); z-index: 30;
  }
  .menu-btn { display: grid !important; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .topbar { padding: 13px 16px; }
  .topbar h2 { font-size: var(--fs-md); }
  .login-card { padding: 24px; }
}
