:root {
  --bg: #0f1419;
  --card: #1a2332;
  --text: #e7ecf3;
  --muted: #8b9cb3;
  --accent: #3b82f6;
  --danger: #ef4444;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid #243044;
}
.logo { color: var(--text); text-decoration: none; font-weight: 700; }
.header nav a, .header nav button {
  margin-right: 1rem;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
}
.main { max-width: 900px; margin: 2rem auto; padding: 0 1rem; }
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.auth-card { max-width: 400px; margin: 4rem auto; }
label { display: block; margin: 0.75rem 0 0.25rem; color: var(--muted); font-size: 0.9rem; }
input, textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #0f172a;
  color: var(--text);
}
.btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  background: #334155;
}
.btn.primary { background: var(--accent); }
.btn.danger { background: var(--danger); }
button:disabled, .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.row { display: flex; justify-content: space-between; align-items: center; }
.grid { display: grid; gap: 1rem; margin-top: 1rem; }
.app-item {
  background: var(--card);
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid #243044;
}
.muted { color: var(--muted); font-size: 0.9rem; }
.msg { margin-top: 1rem; color: #fbbf24; }
.hidden { display: none; }
.commits-panel { margin-top: 0.5rem; }
.commit-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.commit-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  width: 100%;
  margin-bottom: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #0f172a;
  color: var(--text);
  font: inherit;
  text-align: right;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.commit-item:hover {
  border-color: var(--accent);
  background: #1e293b;
}
.commit-item-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  min-width: 0;
}
.commit-item-title { font-weight: 600; }
.commit-item-cost {
  color: #86efac;
  font-size: 0.85rem;
}
.commit-item-date {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal.hidden { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}
.modal-content {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid #334155;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}
.modal-close-x {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}
.modal-close-x:hover { color: var(--text); }
body.modal-open { overflow: hidden; }
.commit-description {
  margin: 1rem 0 1.25rem;
  padding: 1rem;
  border-radius: 8px;
  background: #0f172a;
  border: 1px solid #334155;
  white-space: pre-wrap;
  line-height: 1.7;
}
.commit-rollback-hint { margin-top: 0.5rem; font-size: 0.85rem; }
.btn.btn-link {
  margin-top: 0;
  margin-bottom: 1rem;
  padding: 0;
  background: none;
  color: var(--accent);
}
