/* layout.css
   Top bar, shell, breadcrumbs, stat strip and the generic panel.

   Part of the Teleport stylesheet, split by concern. index.html links these
   in source order; keep that order, the cascade depends on it. */

/* ── Top bar ────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 20;
  height: var(--nav-h); display: flex; align-items: center; gap: 12px;
  padding: 0 22px; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border-2);
}
.nav-badge {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent);
  box-shadow: 0 3px 10px rgba(255,87,87,0.28), inset 0 1px 0 rgba(255,255,255,0.22);
  transition: transform 0.12s;
}
.nav-badge:hover { transform: scale(1.05); }
.nav-badge img { width: 100%; height: 100%; object-fit: cover; display: block; }

.nav-titles { display: flex; flex-direction: column; line-height: 1.15; }
.nav-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.nav-subtitle { font-size: 11.5px; color: var(--label-2); }

/* Two destinations — the board, and browse. Everything else is a drill-down. */
.nav-tabs { display: flex; gap: 2px; margin-left: 14px; background: var(--surface-2); padding: 3px; border-radius: var(--r-sm); }
.nav-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px; border: none; background: none; cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: var(--label-2);
  border-radius: 6px; transition: background 0.14s, color 0.14s, box-shadow 0.14s;
}
.nav-tab svg { width: 14px; height: 14px; }
.nav-tab:hover { color: var(--label); }
.nav-tab.is-active { background: var(--surface); color: var(--accent-deep); box-shadow: var(--shadow-sm); }
:root[data-theme="dark"] .nav-tab.is-active { color: var(--accent); }

.nav-spacer { flex: 1; }
.nav-user { position: relative; }
.nav-user-trigger {
  display: flex; align-items: center; gap: 9px; padding: 5px 7px;
  background: none; border: none; cursor: pointer; border-radius: var(--r-sm);
  color: inherit; transition: background 0.14s;
}
.nav-user-trigger:hover { background: var(--surface-2); }
.nav-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-light); color: var(--accent-deep);
  font-size: 11.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
:root[data-theme="dark"] .nav-avatar { color: var(--accent); }
.nav-user-name { font-size: 13px; font-weight: 550; text-align: left; }
.nav-user-role { font-size: 11px; color: var(--label-2); text-transform: capitalize; text-align: left; }

.nav-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 180px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-md); padding: 4px; z-index: 200;
  animation: scaleIn 0.15s ease both; transform-origin: top right;
}
.nav-dropdown.hidden { display: none; }
.dropdown-item {
  display: block; width: 100%; text-align: left; padding: 9px 13px;
  font-size: 13.5px; background: none; border: none; cursor: pointer;
  color: var(--label); border-radius: var(--r-sm); transition: background 0.12s;
}
.dropdown-item:hover { background: var(--surface-2); }
.dropdown-item.danger { color: var(--red); }
.dropdown-item.danger:hover { background: var(--red-light); }

/* ── Shell ──────────────────────────────────────────────────────────── */
.shell { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 26px 22px 72px; }
.shell--player { max-width: 1180px; }

.greeting { margin-bottom: 20px; }
.greeting h1 { font-size: 25px; font-weight: 780; letter-spacing: -0.025em; }
.greeting p { font-size: 14px; color: var(--label-2); margin-top: 3px; }

body.booting .greeting,
body.booting .crumbs   { animation: fadeUp 0.4s cubic-bezier(0.16,1,0.3,1) both; }
body.booting .stats    { animation: fadeUp 0.4s cubic-bezier(0.16,1,0.3,1) 0.04s both; }
body.booting .panel,
body.booting .conf-grid,
body.booting .team-grid,
body.booting .team-hero,
body.booting .phero,
body.booting .blank    { animation: fadeUp 0.42s cubic-bezier(0.16,1,0.3,1) 0.07s both; }

/* ── Breadcrumbs ────────────────────────────────────────────────────── */
.crumbs { display: flex; align-items: center; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.crumb {
  font-size: 12.5px; font-weight: 550; color: var(--label-2);
  padding: 3px 8px; border-radius: var(--r-sm); transition: background 0.13s, color 0.13s;
}
a.crumb:hover { background: var(--surface-2); color: var(--accent-deep); }
:root[data-theme="dark"] a.crumb:hover { color: var(--accent); }
.crumb--now { color: var(--label); font-weight: 650; }
.crumb-sep { display: inline-flex; color: var(--label-3); }
.crumb-sep svg { width: 12px; height: 12px; }

/* ── Stat strip ─────────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat {
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-lg);
  padding: 14px 16px; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 13px;
}
.stat-ic { width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.stat-ic svg { width: 18px; height: 18px; }
.stat-ic--accent { background: var(--accent-light); color: var(--accent-deep); }
:root[data-theme="dark"] .stat-ic--accent { color: var(--accent); }
.stat-ic--gold   { background: var(--gold-light);   color: var(--gold);  }
.stat-ic--green  { background: var(--green-light);  color: var(--green); }
.stat-ic--slate  { background: var(--slate-light);  color: var(--slate); }
.stat-val { font-size: 21px; font-weight: 750; letter-spacing: -0.02em; line-height: 1; }
.stat-lbl { font-size: 11.5px; color: var(--label-2); margin-top: 3px; font-weight: 500; }

/* ── Panel — the generic bordered container every view builds on ────── */
.panel {
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 16px;
}
.panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 16px 13px; border-bottom: 1px solid var(--border-2);
}
.panel-ic { width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.panel-ic svg { width: 15px; height: 15px; }
.panel-ic--accent { background: var(--accent-light); color: var(--accent-deep); }
:root[data-theme="dark"] .panel-ic--accent { color: var(--accent); }
.panel-ic--gold  { background: var(--gold-light);  color: var(--gold);  }
.panel-ic--green { background: var(--green-light); color: var(--green); }
.panel-ic--slate { background: var(--slate-light); color: var(--slate); }
.panel-title { font-size: 14.5px; font-weight: 680; letter-spacing: -0.01em; }
.panel-meta { font-size: 12px; color: var(--label-2); font-weight: 500; }
.panel-spacer { flex: 1; }
.panel-body { padding: 10px; }

/* ── Segmented control (division tabs) ──────────────────────────────── */
.segs { display: inline-flex; gap: 3px; background: var(--surface-2); padding: 4px; border-radius: var(--r-md); margin-bottom: 20px; flex-wrap: wrap; }
.seg {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 8px 16px; border: none; background: none; cursor: pointer;
  border-radius: var(--r-sm); color: var(--label-2);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.seg:hover { color: var(--label); }
.seg.is-active { background: var(--surface); color: var(--label); box-shadow: var(--shadow-sm); }
.seg-label { font-size: 13.5px; font-weight: 650; letter-spacing: -0.01em; }
.seg-sub { font-size: 11px; color: var(--label-3); font-weight: 500; }
.seg.is-active .seg-sub { color: var(--accent-deep); }
:root[data-theme="dark"] .seg.is-active .seg-sub { color: var(--accent); }
