/* ─── Design Tokens ─────────────────────────────────────────────────────────── */
:root {
  --bg-base: #0d0f14;
  --bg-surface: #151820;
  --bg-elevated: #1c2030;
  --bg-hover: #232840;
  --border: #2a3050;
  --border-subtle: #1e2438;

  --accent: #4f8ef7;
  --accent-hover: #6ba3ff;
  --accent-dim: rgba(79, 142, 247, 0.15);

  --success: #34d399;
  --success-dim: rgba(52, 211, 153, 0.15);
  --warning: #fbbf24;
  --warning-dim: rgba(251, 191, 36, 0.15);
  --danger: #f87171;
  --danger-dim: rgba(248, 113, 113, 0.15);
  --revert: #a78bfa;
  --revert-dim: rgba(167, 139, 250, 0.15);

  --text-primary: #e8ecf4;
  --text-secondary: #8b95b0;
  --text-muted: #4a5270;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);

  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --nav-width: 240px;
  --transition: 0.18s ease;
}

/* ─── Reset & Base ──────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

/* ─── Layout ────────────────────────────────────────────────────────────────── */
.layout {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* ─── Sidebar Nav ───────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--nav-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  padding: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo .logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.sidebar-logo .logo-sub {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 10px 4px;
  margin-top: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
}

.nav-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-link.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.nav-link .nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-user {
  padding: 14px 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #4f8ef7, #7c3aed);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

.logout-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}

.logout-btn:hover {
  color: var(--danger);
}

/* ─── Main Content ──────────────────────────────────────────────────────────── */
.main-content {
  margin-left: var(--nav-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-header {
  padding: 28px 32px 0;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 20px;
  margin-bottom: 28px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.page-body {
  padding: 0 32px 40px;
  flex: 1;
}

/* ─── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

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

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title .card-icon {
  font-size: 18px;
}

/* ─── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  font-family: var(--font);
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 142, 247, 0.4);
}

.btn-success {
  background: var(--success);
  color: #0d1a14;
}

.btn-success:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger);
  color: #1a0d0d;
}

.btn-danger:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-revert {
  background: var(--revert-dim);
  color: var(--revert);
  border: 1px solid rgba(167, 139, 250, 0.3);
  font-size: 12px;
  padding: 5px 10px;
}

.btn-revert:hover {
  background: rgba(167, 139, 250, 0.25);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-lg {
  padding: 11px 22px;
  font-size: 14px;
}

/* ─── Branch Deploy Buttons ─────────────────────────────────────────────────── */
.branch-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.branch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  font-family: var(--font-mono);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-color: var(--border);
}

.branch-btn:hover {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(79, 142, 247, 0.4);
  transform: translateY(-1px);
}



.branch-btn.branch-production,
.branch-btn.branch-main {
  border-color: rgba(251, 191, 36, 0.3);
  color: var(--warning);
  background: var(--warning-dim);
}

.branch-btn.branch-production:hover,
.branch-btn.branch-main:hover {
  background: rgba(251, 191, 36, 0.25);
  border-color: rgba(251, 191, 36, 0.6);
}

/* ─── Status Indicators ─────────────────────────────────────────────────────── */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot.ok {
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

.status-dot.error {
  background: var(--danger);
  box-shadow: 0 0 6px var(--danger);
}

.status-dot.loading {
  background: var(--warning);
  animation: pulse 1.2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

/* ─── Badges ────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-success {
  background: var(--success-dim);
  color: var(--success);
}

.badge-danger {
  background: var(--danger-dim);
  color: var(--danger);
}

.badge-warning {
  background: var(--warning-dim);
  color: var(--warning);
}

.badge-revert {
  background: var(--revert-dim);
  color: var(--revert);
}

.badge-info {
  background: var(--accent-dim);
  color: var(--accent);
}

/* ─── Table ─────────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-subtle);
}

tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition);
}

tbody tr:hover {
  background: var(--bg-hover);
}

tbody tr:last-child {
  border-bottom: none;
}

tbody td {
  padding: 12px 14px;
  color: var(--text-secondary);
  vertical-align: middle;
}

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ─── Modal ─────────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 420px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
  transform: translateY(12px) scale(0.97);
  transition: transform 0.2s ease;
}

.modal-backdrop.open .modal {
  transform: translateY(0) scale(1);
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.modal-body {
  color: var(--text-secondary);
  font-size: 13.5px;
  margin-bottom: 24px;
  line-height: 1.7;
}

.modal-body code {
  font-family: var(--font-mono);
  background: var(--bg-surface);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--accent);
  font-size: 12px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ─── Output Box ────────────────────────────────────────────────────────────── */
.output-box {
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 12px;
  display: none;
}

.output-box.visible {
  display: block;
}

/* ─── Deploy Result Inline ──────────────────────────────────────────────────── */
.deploy-result {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 500;
}

.deploy-result.visible {
  display: flex;
}

.deploy-result.success {
  color: var(--success);
}

.deploy-result.error {
  color: var(--danger);
}

/* ─── Spinner ───────────────────────────────────────────────────────────────── */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}

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

@keyframes pulseBorder {

  0%,
  100% {
    border-color: var(--accent);
    box-shadow: 0 0 0 0 rgba(79, 142, 247, 0);
  }

  50% {
    border-color: var(--accent-hover);
    box-shadow: 0 0 0 6px rgba(79, 142, 247, 0.2);
  }
}


/* ─── Grid Layouts ──────────────────────────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 900px) {

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* ─── Quick Action Cards ────────────────────────────────────────────────────── */
.quick-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.quick-card:hover {
  border-color: var(--accent);
  background: var(--bg-elevated);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.quick-card-icon {
  font-size: 28px;
  line-height: 1;
}

.quick-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.quick-card-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ─── Welcome Banner ────────────────────────────────────────────────────────── */
.welcome-banner {
  background: linear-gradient(135deg, rgba(79, 142, 247, 0.12), rgba(124, 58, 237, 0.12));
  border: 1px solid rgba(79, 142, 247, 0.2);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.welcome-banner .welcome-icon {
  font-size: 36px;
}

.welcome-banner h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.welcome-banner p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ─── Status Grid ───────────────────────────────────────────────────────────── */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.status-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.status-branch-name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-sha {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
}

.status-msg {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-time {
  font-size: 11px;
  color: var(--text-muted);
}

/* ─── Login Page ────────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(79, 142, 247, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(124, 58, 237, 0.06) 0%, transparent 60%);
}

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 380px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-logo {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 0 auto 20px;
}

.login-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 28px;
  line-height: 1.5;
}

.ms-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 20px;
  background: #2f2f2f;
  border: 1px solid #444;
  border-radius: var(--radius-md);
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
  text-decoration: none;
}

.ms-btn:hover {
  background: #3a3a3a;
  border-color: #666;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: white;
}

.ms-logo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.ms-logo span {
  display: block;
  border-radius: 1px;
}

.ms-logo span:nth-child(1) {
  background: #f25022;
}

.ms-logo span:nth-child(2) {
  background: #7fba00;
}

.ms-logo span:nth-child(3) {
  background: #00a4ef;
}

.ms-logo span:nth-child(4) {
  background: #ffb900;
}

.login-error {
  background: var(--danger-dim);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 16px;
  text-align: left;
}

/* ─── Empty State ───────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 13.5px;
}

/* ─── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ─── Page Actions Row ──────────────────────────────────────────────────────── */
.page-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

/* ─── Repo Section ──────────────────────────────────────────────────────────── */
.repo-section {
  margin-bottom: 24px;
}

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

.repo-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.repo-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.repo-host {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

/* ─── Notification Toast ────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: 380px;
  animation: slideIn 0.25s ease;
  pointer-events: all;
}

.toast.success {
  border-left: 3px solid var(--success);
}

.toast.error {
  border-left: 3px solid var(--danger);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ─── Mobile Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {

  /* Hide the sidebar entirely on mobile */
  .sidebar {
    display: none;
  }

  /* Main content takes full width */
  .main-content {
    margin-left: 0;
    padding-bottom: 72px;
    /* room for bottom nav */
  }

  /* Tighter page header */
  .page-header {
    padding: 18px 16px 14px;
    margin-bottom: 16px;
  }

  .page-title {
    font-size: 18px;
  }

  .page-subtitle {
    font-size: 12px;
  }

  /* Tighter page body */
  .page-body {
    padding: 0 12px 32px;
  }

  /* Cards */
  .card {
    padding: 16px;
    border-radius: var(--radius-md);
  }

  /* Grids collapse to single column */
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Branch buttons: full width, taller touch target */
  .branch-grid {
    flex-direction: column;
    gap: 10px;
  }

  .branch-btn {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
    font-size: 14px;
  }

  /* Deploy result */
  .deploy-result {
    flex-wrap: wrap;
    font-size: 12px;
  }

  /* History table: scroll horizontally on mobile */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 480px;
  }

  thead th,
  tbody td {
    padding: 10px 8px;
    font-size: 12px;
  }

  /* Page actions: left-align on mobile */
  .page-actions {
    justify-content: flex-start;
  }

  /* Welcome banner stacks vertically */
  .welcome-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 18px;
  }

  .welcome-banner h2 {
    font-size: 16px;
  }

  /* Status grid: 2 columns on mobile */
  .status-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  /* Modal: full-width on mobile */
  .modal {
    width: calc(100vw - 32px);
    max-width: 100%;
    padding: 22px 18px;
    border-radius: var(--radius-lg);
  }

  /* Toast: full width at bottom */
  .toast-container {
    bottom: 80px;
    /* above bottom nav */
    right: 12px;
    left: 12px;
  }

  .toast {
    min-width: 0;
    max-width: 100%;
  }

  /* Chain viz wraps nicely */
  .chain-viz {
    gap: 4px;
  }

  .chain-node {
    font-size: 11px;
    padding: 2px 8px;
  }

  /* Repo section */
  .repo-section {
    margin-bottom: 20px;
  }

  /* Pipeline link buttons stack */
  [style*="display: flex"][style*="gap: 12px"] {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ─── Mobile Bottom Navigation Bar ──────────────────────────────────────────── */
.mobile-nav {
  display: none;
}

@media (max-width: 768px) {
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    z-index: 200;
    align-items: stretch;
  }

  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: color var(--transition);
    padding: 8px 4px;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-item .mobile-nav-icon {
    font-size: 20px;
    line-height: 1;
  }

  .mobile-nav-item:hover,
  .mobile-nav-item.active {
    color: var(--accent);
  }

  .mobile-nav-item.active {
    background: var(--accent-dim);
    border-radius: 0;
  }
}