/* ── Tab bar ──────────────────────────────────────────────── */
.tab-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 56px;
  z-index: 1200;
  display: flex;
  background: rgba(8, 12, 26, 0.97);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(14px);
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: none;
  background: none;
  color: #334155;
  cursor: pointer;
  padding: 4px 2px;
  position: relative;
  transition: color 0.15s;
  min-width: 0;
}

.tab-btn:hover { color: #64748b; }

.tab-btn.is-active { color: #34d399; }

.tab-btn.is-active::before {
  content: '';
  position: absolute;
  top: 0; left: 18%; right: 18%;
  height: 2px;
  background: #34d399;
  border-radius: 0 0 3px 3px;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.6);
}

.tab-btn.is-locked { color: #1e293b; cursor: default; }
.tab-btn.is-admin  { border-left: 1px solid rgba(255,255,255,0.05); }

.tab-icon  { font-size: 19px; line-height: 1; }
.tab-label {
  font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%; padding: 0 4px;
}

.tab-badge {
  position: absolute;
  top: 5px; right: calc(50% - 20px);
  background: #34d399; color: #0f172a;
  font-size: 9px; font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ── Adjust panels when tab bar is present ────────────────── */
.has-tabbar .left-panel,
.has-tabbar .dashboard  { bottom: 56px; }
.has-tabbar .paint-ruler,
.has-tabbar .line-ruler { bottom: 68px; }

/* ── Section panel (replaces left panel for source tabs) ──── */
.section-panel {
  position: absolute;
  top: 48px; left: 0; right: 0; bottom: 56px;
  z-index: 1150;
  background: rgba(8, 12, 26, 0.97);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.section-panel.is-hidden { display: none; }

.section-head {
  padding: 12px 16px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title {
  font-size: 11px; font-weight: 700;
  color: #f1f5f9;
  text-transform: uppercase; letter-spacing: 0.09em;
}
.section-count {
  font-size: 11px; color: #475569;
  font-family: monospace;
  margin-left: auto;
}

.section-body {
  flex: 1; overflow-y: auto;
  padding: 12px 16px;
  font-size: 12px; color: #64748b; line-height: 1.5;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}

/* ── Admin sub-navigation ─────────────────────────────────── */
.admin-nav {
  display: flex;
  padding: 0 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.admin-nav-btn {
  padding: 9px 14px;
  border: none; background: none;
  color: #475569; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color 0.15s;
}
.admin-nav-btn:hover { color: #94a3b8; }
.admin-nav-btn.is-active { color: #34d399; border-bottom-color: #34d399; }

.admin-body {
  flex: 1; overflow-y: auto;
  padding: 14px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}

/* ── Admin rows ───────────────────────────────────────────── */
.admin-row {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 12px; color: #94a3b8;
  gap: 10px;
}
.admin-row-label { display: flex; align-items: center; gap: 6px; }

.tier-pill-group { display: flex; gap: 4px; flex-shrink: 0; }
.tier-pill {
  padding: 4px 11px; border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  background: none; color: #334155;
  font-size: 10px; font-weight: 600;
  cursor: pointer; transition: all 0.12s;
}
.tier-pill[data-value="free"].active {
  background: rgba(52,211,153,0.12); border-color: #34d399; color: #34d399;
}
.tier-pill[data-value="pro"].active {
  background: rgba(245,158,11,0.12); border-color: #f59e0b; color: #f59e0b;
}

.admin-hint {
  font-size: 11px; color: #334155; margin-bottom: 14px; line-height: 1.5;
}

/* ── Auth button ──────────────────────────────────────────── */
.auth-user-btn {
  display: flex; align-items: center; gap: 6px;
  background: none;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 4px 10px 4px 4px;
  cursor: pointer; color: #94a3b8; font-size: 11px;
  transition: all 0.15s;
}
.auth-user-btn:hover { border-color: rgba(255,255,255,0.22); color: #e2e8f0; }

.auth-avatar {
  width: 26px; height: 26px;
  border-radius: 50%; object-fit: cover;
}
.auth-initial {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(52,211,153,0.15);
  border: 1px solid #34d399; color: #34d399;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
