/* ============================
   SilentByte Dashboard · CSS
   Mobile-First · App Layout
   Iconic Tech · Creator Edition
   ============================ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;600;700&family=Syne:wght@400;600;700;800&display=swap');

/* ========================
   TOKENS
   ======================== */
:root {
  --bg:        #080b12;
  --bg2:       #0d1220;
  --bg3:       #111827;
  --surface:   #141c2e;
  --surface2:  #1a2440;
  --border:    rgba(99,179,255,0.09);
  --border2:   rgba(99,179,255,0.16);
  --accent:    #3b82f6;
  --accent2:   #60a5fa;
  --accent3:   #93c5fd;
  --green:     #22d3a5;
  --orange:    #fb923c;
  --red:       #f87171;
  --yellow:    #facc15;
  --text:      #e2e8f0;
  --text2:     #94a3b8;
  --text3:     #475569;
  --mono:      'JetBrains Mono', monospace;
  --sans:      'Syne', sans-serif;
  --r:         12px;
  --r-sm:      8px;
  --r-xs:      6px;
  --sidebar-w: 240px;
  --nav-h:     60px;
  --header-h:  52px;
}

/* ========================
   RESET
   ======================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  height: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

@media (min-width: 769px) {
  ::-webkit-scrollbar { width: 4px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 4px; }
}

/* ========================
   BACKGROUND
   ======================== */
#particleCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

@media (max-width: 768px) {
  #particleCanvas { display: none; }
}

.grid-overlay {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(59,130,246,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

/* ========================
   DESKTOP SIDEBAR
   ======================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 50;
  overflow: hidden;
}

.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: 24px 28px 48px;
  position: relative;
  z-index: 1;
}

/* BRAND */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.brand-hex {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--accent), #1e40af);
  clip-path: polygon(50% 0%,100% 25%,100% 75%,50% 100%,0% 75%,0% 25%);
  animation: hex-pulse 4s ease-in-out infinite;
}

@keyframes hex-pulse {
  0%, 100% { filter: brightness(1); }
  50%       { filter: brightness(1.25) drop-shadow(0 0 8px var(--accent)); }
}

.brand-sb {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--sans);
  font-weight: 800;
  font-size: 11px;
  color: #fff;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.brand-text { display: flex; flex-direction: column; overflow: hidden; }

.brand-name {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  font-size: 9px;
  color: var(--text3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* PROFILE */
.sidebar-profile {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  min-height: 68px;
  flex-shrink: 0;
}

.profile-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
}

.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 1.5px solid var(--border2);
}

.avatar-ring {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  opacity: 0.45;
  pointer-events: none;
}

.status-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  border: 2px solid var(--bg2);
}

.profile-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}

.profile-name {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-email {
  font-size: 10px;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* Skeletons */
.skeleton-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface2);
  flex-shrink: 0;
  animation: shimmer 1.6s ease-in-out infinite;
}

.skeleton-lines { display: flex; flex-direction: column; gap: 6px; flex: 1; }

.skeleton-line {
  height: 8px;
  border-radius: 4px;
  background: var(--surface2);
  animation: shimmer 1.6s ease-in-out infinite;
}

.w70 { width: 70%; }
.w50 { width: 50%; }

@keyframes shimmer {
  0%, 100% { opacity: 0.35; }
  50%       { opacity: 0.7; }
}

/* NAV */
.sidebar-nav {
  flex: 1;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--text2);
  text-decoration: none;
  font-size: 12px;
  font-family: var(--mono);
  transition: background 0.15s, color 0.15s;
  position: relative;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.nav-item i { width: 16px; text-align: center; font-size: 13px; flex-shrink: 0; }

.nav-item:hover { color: var(--text); background: var(--surface); }

.nav-item.active {
  color: var(--accent2);
  background: rgba(59,130,246,0.1);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 25%; bottom: 25%;
  width: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.nav-item.coming-soon {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 20px;
  font-weight: 600;
}

.coming-tag {
  margin-left: auto;
  font-size: 9px;
  color: var(--orange);
  background: rgba(251,146,60,0.1);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(251,146,60,0.2);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* SIDEBAR FOOTER */
.sidebar-footer {
  padding: 10px 8px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.plan-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(251,146,60,0.07);
  border: 1px solid rgba(251,146,60,0.15);
  border-radius: var(--r-sm);
  font-size: 11px;
  color: var(--orange);
}

.logout-btn { color: var(--red) !important; }
.logout-btn:hover { background: rgba(248,113,113,0.08) !important; }

/* ========================
   MOBILE TOP HEADER
   ======================== */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 60;
}

.menu-toggle {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--r-xs);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-brand {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  flex: 1;
}

.mobile-status-dot {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
}

/* ========================
   MOBILE BOTTOM NAV
   ======================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--bg2);
  border-top: 1px solid var(--border);
  z-index: 60;
  align-items: stretch;
}

.mob-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text3);
  text-decoration: none;
  font-size: 9px;
  font-family: var(--mono);
  transition: color 0.15s;
  cursor: pointer;
  position: relative;
  padding: 8px 4px;
  user-select: none;
}

.mob-nav-item i { font-size: 17px; }

.mob-nav-item.active { color: var(--accent2); }

.mob-nav-item.active::after {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 2px;
  background: var(--accent);
  border-radius: 0 0 2px 2px;
}

.mob-nav-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 14px);
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  padding: 0 4px;
  border-radius: 10px;
  font-weight: 600;
  min-width: 16px;
  text-align: center;
}

/* ========================
   SIDEBAR OVERLAY
   ======================== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 55;
}

/* ========================
   TOPBAR
   ======================== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.topbar-left { display: flex; align-items: baseline; gap: 8px; }

.page-title {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 20px;
  color: var(--text);
}

.page-breadcrumb { font-size: 12px; color: var(--text3); }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.time-display {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent2);
  background: rgba(59,130,246,0.07);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: var(--r-sm);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.icon-btn {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.icon-btn:hover { color: var(--accent2); border-color: var(--accent); background: rgba(59,130,246,0.08); }
.icon-btn.spinning i { animation: spin 0.7s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ========================
   STATS STRIP
   ======================== */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  color: var(--accent2);
  flex-shrink: 0;
}

.stat-icon.green  { background: rgba(34,211,165,0.08); border-color: rgba(34,211,165,0.18); color: var(--green); }
.stat-icon.orange { background: rgba(251,146,60,0.08); border-color: rgba(251,146,60,0.18); color: var(--orange); }
.stat-icon.blue   { background: rgba(99,179,255,0.08); border-color: rgba(99,179,255,0.18); color: var(--accent3); }

.stat-body { display: flex; flex-direction: column; min-width: 0; }

.stat-val {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-label {
  font-size: 9px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 3px;
  white-space: nowrap;
}

/* ========================
   SECTIONS
   ======================== */
.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: 16px;
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.section-title i { color: var(--accent2); font-size: 13px; }

.section-title h2 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13px;
}

.terminal-dots { display: flex; gap: 5px; margin-left: 6px; }

.dot { width: 9px; height: 9px; border-radius: 50%; }
.dot.red    { background: #ff5f57; }
.dot.yellow { background: #ffbd2e; }
.dot.green  { background: #28ca41; }

.terminal-controls { display: flex; gap: 6px; }

.btn-outline {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: none;
  color: var(--text2);
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.btn-outline:hover { border-color: var(--accent); color: var(--accent2); }

/* ========================
   PROJECTS GRID
   ======================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  padding: 16px;
}

.projects-skeleton {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  padding: 16px;
}

.project-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  transition: border-color 0.2s;
}

.project-card:hover { border-color: var(--border2); }

.project-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.project-icon {
  width: 34px; height: 34px;
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.16);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent2);
  font-size: 13px;
}

.status-badge {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: capitalize;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.status-badge.live     { background: rgba(34,211,165,0.1); color: var(--green); border: 1px solid rgba(34,211,165,0.2); }
.status-badge.building { background: rgba(251,146,60,0.1); color: var(--orange); border: 1px solid rgba(251,146,60,0.2); }
.status-badge.error    { background: rgba(248,113,113,0.1); color: var(--red); border: 1px solid rgba(248,113,113,0.2); }

.project-name {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-url {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text2);
  background: rgba(0,0,0,0.2);
  border-radius: var(--r-xs);
  padding: 6px 8px;
  margin-bottom: 12px;
  overflow: hidden;
}

.project-url span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-url i    { color: var(--accent); flex-shrink: 0; font-size: 10px; }

.project-actions { display: flex; gap: 8px; }

.btn-visit {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 10px;
  background: var(--accent); color: #fff;
  border-radius: var(--r-sm);
  text-decoration: none;
  font-size: 11px;
  font-family: var(--mono);
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-visit:hover { background: var(--accent2); }

.btn-copy {
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  border-radius: var(--r-sm);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  transition: color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.btn-copy:hover  { color: var(--accent2); border-color: var(--accent); }
.btn-copy.copied { color: var(--green); border-color: var(--green); }
.btn-copy:disabled { opacity: 0.3; cursor: not-allowed; }

.skeleton-card {
  height: 150px;
  border-radius: var(--r);
  background: var(--surface2);
  animation: shimmer 1.6s ease-in-out infinite;
}

.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 24px; gap: 8px;
}

.empty-icon  { font-size: 36px; color: var(--text3); margin-bottom: 6px; }
.empty-title { font-family: var(--sans); font-weight: 600; font-size: 14px; color: var(--text2); }
.empty-sub   { font-size: 11px; color: var(--text3); text-align: center; line-height: 1.6; }

/* ========================
   TERMINAL
   ======================== */
.terminal-section { font-family: var(--mono); }

.terminal-wrapper {
  background: #060911;
  min-height: 260px;
  max-height: 380px;
  display: flex;
  flex-direction: column;
}

.terminal-wrapper.fullscreen {
  position: fixed;
  inset: 0;
  z-index: 200;
  max-height: 100dvh;
  border-radius: 0;
}

.terminal-body {
  flex: 1;
  padding: 14px 18px;
  overflow-y: auto;
  font-size: 11px;
  line-height: 1.9;
  overscroll-behavior: contain;
}

.terminal-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.timestamp { color: #2e3f5c; flex-shrink: 0; font-size: 10px; }

.terminal-line .log-text { word-break: break-all; }
.terminal-line.info    .log-text { color: #93c5fd; }
.terminal-line.success .log-text { color: var(--green); }
.terminal-line.warning .log-text { color: var(--yellow); }
.terminal-line.error   .log-text { color: var(--red); }
.terminal-line.welcome .log-text { color: var(--accent3); }
.terminal-line.cmd     .log-text { color: var(--text); }
.terminal-line.system  .log-text { color: #5a7099; }
.terminal-line.sb      .log-text { color: var(--accent2); font-weight: 600; }

.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-top: 1px solid rgba(59,130,246,0.08);
  background: #04060e;
}

.prompt-symbol { color: var(--green); font-size: 12px; flex-shrink: 0; }

.terminal-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 16px; /* Prevents iOS zoom on focus */
  caret-color: var(--green);
}

@media (min-width: 769px) {
  .terminal-input { font-size: 12px; }
}

.terminal-input::placeholder { color: #1e2d45; }

/* ========================
   GITHUB TIP SECTION
   ======================== */
.tip-section { padding: 0; }

.tip-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.tip-header i  { color: var(--text); font-size: 14px; }
.tip-header h2 { font-family: var(--sans); font-weight: 600; font-size: 13px; flex: 1; }

.tip-badge {
  font-size: 9px;
  padding: 2px 6px;
  background: rgba(59,130,246,0.1);
  color: var(--accent2);
  border: 1px solid rgba(59,130,246,0.18);
  border-radius: 4px;
  letter-spacing: 0.07em;
  font-weight: 600;
}

.tip-body { padding: 18px; }

.tip-body > p {
  font-size: 11px;
  color: var(--text2);
  line-height: 1.7;
  margin-bottom: 16px;
}

.tip-steps { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }

.tip-step {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.tip-step span { font-family: var(--sans); font-weight: 700; font-size: 16px; color: var(--surface2); line-height: 1; flex-shrink: 0; }
.tip-step p    { font-size: 11px; color: var(--text2); line-height: 1.5; margin: 0; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--accent); color: #fff;
  border-radius: var(--r-sm);
  text-decoration: none;
  font-size: 12px;
  font-family: var(--mono);
  font-weight: 600;
  transition: background 0.15s;
  cursor: pointer;
  border: none;
}

.btn-primary:hover { background: var(--accent2); }

/* ========================
   TOAST
   ======================== */
.toast-container {
  position: fixed;
  bottom: 80px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 300;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 11px;
  font-family: var(--mono);
  background: var(--surface2);
  border: 1px solid var(--border);
  animation: toast-in 0.25s ease-out, toast-out 0.25s ease-in 2.75s forwards;
  max-width: 280px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  pointer-events: auto;
}

.toast.success { border-color: rgba(34,211,165,0.25); color: var(--green); }
.toast.error   { border-color: rgba(248,113,113,0.25); color: var(--red); }
.toast.info    { border-color: rgba(59,130,246,0.25); color: var(--accent2); }

@keyframes toast-in  { from { opacity: 0; transform: translateY(8px); } }
@keyframes toast-out { to   { opacity: 0; transform: translateY(8px); } }

/* ========================
   FOOTER
   ======================== */
.dash-footer {
  padding: 16px 0 0;
  font-size: 10px;
  color: var(--text3);
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.footer-sep { color: var(--border2); }

/* ========================
   UTILS
   ======================== */
.hidden { display: none !important; }

/* ========================
   RESPONSIVE — TABLET
   ======================== */
@media (max-width: 1024px) {
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
}

/* ========================
   RESPONSIVE — MOBILE
   ======================== */
@media (max-width: 768px) {

  /* Sidebar becomes a drawer */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(.4,0,.2,1);
    z-index: 65;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }

  .sidebar-overlay.open { display: block; }

  /* Show mobile bars */
  .mobile-header     { display: flex; }
  .mobile-bottom-nav { display: flex; }

  /* Main content fills between top & bottom bars — no shifting */
  .main-content {
    margin-left: 0;
    padding: calc(var(--header-h) + 16px) 14px calc(var(--nav-h) + 16px);
    min-height: 100dvh;
  }

  /* Topbar */
  .topbar          { padding-bottom: 14px; margin-bottom: 14px; }
  .page-title      { font-size: 17px; }
  .page-breadcrumb { display: none; }
  .time-display    { font-size: 10px; padding: 4px 8px; }

  /* Stats 2×2 */
  .stats-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 14px;
  }

  .stat-card { padding: 12px; gap: 10px; }
  .stat-val  { font-size: 16px; }
  .stat-icon { width: 32px; height: 32px; font-size: 13px; }

  /* Projects: single column */
  .projects-grid     { grid-template-columns: 1fr; padding: 12px; gap: 10px; }
  .projects-skeleton { grid-template-columns: 1fr; padding: 12px; gap: 10px; }

  /* Section header */
  .section-header   { padding: 12px 14px; }
  .section-title h2 { font-size: 12px; }

  /* Terminal */
  .terminal-wrapper     { min-height: 220px; max-height: 300px; }
  .terminal-body        { padding: 12px 14px; }
  .terminal-input-row   { padding: 8px 14px; }

  /* Toast above bottom nav */
  .toast-container { bottom: calc(var(--nav-h) + 12px); right: 14px; }

  /* GitHub section */
  .tip-body { padding: 14px; }

  /* Footer */
  .dash-footer { font-size: 9px; }
}

/* ========================
   SMALL PHONE
   ======================== */
@media (max-width: 380px) {
  .main-content { padding-left: 10px; padding-right: 10px; }
  .stats-strip  { gap: 6px; }
  .stat-card    { padding: 10px; }
  .stat-val     { font-size: 15px; }
  .stat-label   { font-size: 8px; }
}

/* ========================
   iOS SAFE AREA
   ======================== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .mobile-bottom-nav {
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  }

  @media (max-width: 768px) {
    .main-content {
      padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
    }
    .toast-container {
      bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px);
    }
  }
}
