/* ==========================================================================
   CATEQUESE ONLINE — Layout (Shell, Topbar, Sidebar, Breadcrumb)
   ========================================================================== */

/* ===== App shell ===== */
.app-shell {
  display: flex;
  min-height: calc(100vh - var(--topbar-height));
  position: relative;
}

/* ===== Topbar ===== */
.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  background: var(--color-bg);
  border-bottom: var(--border-width-thick) solid var(--color-gold);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-4);
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.topbar .back-btn, .topbar .icon-btn {
  background: transparent; border: none; cursor: pointer;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full); color: var(--color-text-secondary);
}
.topbar .back-btn:hover, .topbar .icon-btn:hover { background: var(--color-bg-secondary); }
.topbar .only-mobile { display: none; }
.topbar .breadcrumb { display: flex; align-items: center; gap: var(--space-2); font-size: var(--font-size-sm); }
.topbar .breadcrumb span:first-child { color: var(--color-primary); font-weight: 700; }
.topbar .crumb-sep { color: var(--color-text-tertiary); }
.topbar .profile-chip {
  margin-left: auto; display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-1) var(--space-3); border-radius: var(--radius-full);
  background: var(--color-bg-secondary); font-size: var(--font-size-sm); font-weight: 600;
}
.topbar .profile-chip .dot {
  width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--color-success);
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-200) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--topbar-height));
  position: sticky;
  top: var(--topbar-height);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-brand .brand-mark {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--radius-full);
  background: rgba(255,255,255,.15); font-weight: 700; font-size: 1.2rem;
}
.sidebar-brand .brand-text { display: flex; flex-direction: column; }
.sidebar-brand .brand-text strong { color: #fff; font-size: 1.1rem; }
.sidebar-brand .brand-text span { color: rgba(255,255,255,.7); font-size: var(--font-size-xs); }

.sidebar-nav { flex: 1; padding: var(--space-2) 0; }
.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-4);
  color: rgba(255,255,255,.8);
  background: none;
  border: none;
  font-family: inherit;
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
  text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,.1); }
.nav-item.active { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; }
.nav-item svg { width: 18px; height: 18px; }
.nav-item span { flex: 1; }

.sidebar-footer {
  padding: var(--space-2) 0;
  border-top: 1px solid rgba(255,255,255,.1);
}

/* ===== Shell main ===== */
.shell-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.shell-content {
  flex: 1;
  padding: var(--space-6);
  overflow-y: auto;
}

.shell-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
}
@media (max-width: 768px) {
  .shell-overlay { display: block; }
  .app-shell.sidebar-open .shell-overlay { display: block; }
  .sidebar { position: fixed; inset: var(--topbar-height) 0 0 0; z-index: 999; transform: translateX(-100%); transition: transform var(--transition-normal); }
  .app-shell.sidebar-open .sidebar { transform: translateX(0); }
  .topbar .only-mobile { display: flex; }
}

/* ===== Content head ===== */
.content-head { margin-bottom: var(--space-6); }
.content-head h1 { color: var(--color-primary); }
.content-head--split { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-4); }
.head-actions { display: flex; gap: var(--space-2); flex-shrink: 0; }

/* ===== Info panel ===== */
.info-panel, .info-row {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}
.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--space-2) var(--space-4); border-bottom: 1px solid var(--color-border);
}
.info-row:last-child { border-bottom: none; }

/* ===== Eyebrow ===== */
.eyebrow-free {
  display: block; font-size: var(--font-size-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}

/* ===== Model tag soft ===== */
.model-tag--soft {
  background: var(--color-primary-50); color: var(--color-primary);
  font-size: var(--font-size-xs); font-weight: 600; padding: 2px 8px; border-radius: var(--radius-full);
}

/* ===== Badge ===== */
.badge {
  display: inline-flex; align-items: center; gap: var(--space-1);
  font-size: var(--font-size-xs); font-weight: 700; padding: 2px 8px;
  border-radius: var(--radius-full);
}
.badge-neutral { background: #f1f5f9; color: var(--color-text-secondary); }
.badge-success { background: var(--color-success-bg); color: #065f46; }
.badge-gold { background: #fff8e1; color: #92400e; }
.badge-navy { background: var(--color-primary-50); color: var(--color-primary); }
