/* ── Progress bar ─────────────────────────────────────────────────────────── */
.progress { background: var(--bg-4); border-radius: 99px; height: 5px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; transition: width 0.4s ease; }
.fill-green  { background: var(--accent); }
.fill-yellow { background: var(--warn); }
.fill-red    { background: var(--danger); }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.card-flush { padding: 0; overflow: hidden; }

.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.metric-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s;
}
.metric-card:hover { border-color: var(--border-2); }
.metric-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  display: grid; place-items: center;
  margin-bottom: 0.875rem;
}
.metric-icon.green  { background: var(--accent-dim); color: var(--accent); }
.metric-icon.yellow { background: var(--warn-dim);   color: var(--warn); }
.metric-icon.red    { background: var(--danger-dim);  color: var(--danger); }
.metric-icon.blue   { background: var(--info-dim);    color: var(--info); }
.metric-value { font-size: 1.625rem; font-weight: 700; color: var(--text); line-height: 1; letter-spacing: -0.02em; }
.metric-label { font-size: 0.75rem; color: var(--text-3); margin-top: 0.3rem; }
.metric-sub   { font-size: 0.7rem; color: var(--text-3); margin-top: 0.15rem; }

/* ── Table ────────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; min-width: 0; }
thead tr { border-bottom: 1px solid var(--border); }
th {
  text-align: left;
  padding: 0.625rem 1rem;
  font-size: 0.675rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
td { padding: 0.8rem 1rem; color: var(--text-2); border-bottom: 1px solid var(--border); }
td.nowrap, th { white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: var(--bg-3); }

.col-hide-sm  { }
.col-hide-md  { }

/* ── Mobile process/nginx card row ──────────────────────────────────────── */
.proc-card {
  display: none;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
}
.proc-card:last-child { border-bottom: none; }
.proc-card-top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.5rem; }
.proc-card-meta { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.proc-card-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.675rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.badge-green  { background: var(--accent-dim); color: var(--accent); border-color: var(--accent-glow); }
.badge-green::before  { background: var(--accent); }
.badge-red    { background: var(--danger-dim); color: var(--danger); border-color: rgba(239,68,68,.2); }
.badge-red::before    { background: var(--danger); }
.badge-yellow { background: var(--warn-dim);   color: var(--warn);   border-color: rgba(245,158,11,.2); }
.badge-yellow::before { background: var(--warn); }
.badge-gray   { background: var(--bg-4); color: var(--text-3); border-color: var(--border); }
.badge-gray::before   { display: none; }
.badge-blue   { background: var(--info-dim); color: var(--info); border-color: rgba(59,130,246,.2); }
.badge-blue::before   { background: var(--info); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.45rem 0.875rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.15s;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.btn svg { width: 0.875rem; height: 0.875rem; flex-shrink: 0; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.1); }

.btn-ghost { background: transparent; border-color: var(--border-2); color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { border-color: var(--text-3); color: var(--text); background: var(--bg-4); }

.btn-danger { background: var(--danger-dim); border-color: rgba(239,68,68,.25); color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: rgba(239,68,68,.18); }

.btn-icon {
  width: 32px; height: 32px; padding: 0;
  background: transparent;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  color: var(--text-2);
  display: grid; place-items: center;
}
.btn-icon svg { width: 0.875rem; height: 0.875rem; }
.btn-icon:hover { background: var(--bg-4); color: var(--text); border-color: var(--text-3); }

/* ── Inputs ───────────────────────────────────────────────────────────────── */
input, textarea {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55rem 0.875rem;
  color: var(--text);
  font-size: 0.875rem;
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}
input:focus, textarea:focus { border-color: var(--accent); }
input::placeholder { color: var(--text-3); }
label { font-size: 0.75rem; font-weight: 500; color: var(--text-2); display: block; margin-bottom: 0.375rem; }

/* ── Log terminal ─────────────────────────────────────────────────────────── */
.log-box {
  background: #060b14;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 0.7rem;
  color: #4ade80;
  padding: 1rem;
  overflow-y: auto;
  line-height: 1.65;
}
[data-theme="light"] .log-box { background: #0f1923; }
.log-box .log-err  { color: #f87171; }
.log-box .log-warn { color: #facc15; }
.log-box .log-info { color: #60a5fa; }
.log-line { display: block; }

/* ── Divider ──────────────────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); }

/* ── Alert ────────────────────────────────────────────────────────────────── */
.alert { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.875rem 1rem; border-radius: var(--radius); border: 1px solid transparent; font-size: 0.8rem; }
.alert-danger  { background: var(--danger-dim);  border-color: rgba(239,68,68,.2);  color: var(--danger); }
.alert-success { background: var(--accent-dim);  border-color: var(--accent-glow);  color: var(--accent); }
.alert-warn    { background: var(--warn-dim);    border-color: rgba(245,158,11,.2); color: var(--warn); }

/* ── Theme toggle ─────────────────────────────────────────────────────────── */
.theme-toggle {
  width: 38px; height: 20px;
  background: var(--bg-4);
  border: 1px solid var(--border-2);
  border-radius: 99px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.theme-toggle.on { background: var(--accent); border-color: var(--accent); }
.theme-knob {
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px; left: 2px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.theme-toggle.on .theme-knob { transform: translateX(18px); }

/* ── Spinner ─────────────────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 0.7s linear infinite; }

/* ── Deploy project card ──────────────────────────────────────────────────── */
.deploy-card { transition: border-color 0.2s; }
.deploy-card.deploying { border-color: var(--accent-glow); }

/* ── Stat dot (status indicator) ─────────────────────────────────────────── */
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-green  { background: var(--accent); box-shadow: 0 0 5px var(--accent-glow); }
.dot-red    { background: var(--danger); }
.dot-gray   { background: var(--text-3); }
.dot-yellow { background: var(--warn); }

/* ── Misc utils ───────────────────────────────────────────────────────────── */
.mono   { font-family: ui-monospace, monospace; font-size: 0.8em; }
.trunc  { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex   { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end  { justify-content: flex-end; }
.gap-1 { gap: 0.25rem; } .gap-2 { gap: 0.5rem; } .gap-3 { gap: 0.75rem; } .gap-4 { gap: 1rem; }
.flex-1 { flex: 1 1 0; } .flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.mt-1 { margin-top: 0.25rem; } .mt-2 { margin-top: 0.5rem; } .mt-3 { margin-top: 0.75rem; } .mt-4 { margin-top: 1rem; } .mt-6 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; } .mb-2 { margin-bottom: 0.5rem; } .mb-3 { margin-bottom: 0.75rem; } .mb-4 { margin-bottom: 1rem; } .mb-6 { margin-bottom: 1.5rem; }
.ml-auto { margin-left: auto; }
.p-0 { padding: 0; }
.text-xs  { font-size: 0.75rem; }
.text-sm  { font-size: 0.875rem; }
.text-lg  { font-size: 1.125rem; }
.text-xl  { font-size: 1.25rem; }
.font-medium  { font-weight: 500; }
.font-semibold{ font-weight: 600; }
.font-bold    { font-weight: 700; }
.text-accent  { color: var(--accent); }
.text-muted   { color: var(--text-3); }
.text-danger  { color: var(--danger); }
.text-warn    { color: var(--warn); }
.rounded      { border-radius: var(--radius); }
.shrink-0     { flex-shrink: 0; }
.hidden       { display: none !important; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.col-span-2   { grid-column: span 2; }
