:root {
  --bg: #08162f;
  --card: #1d2b40;
  --card-2: #0b1326;
  --text: #ffffff;
  --muted: #c9d0da;
  --primary: #3367e0;
  --danger: #d64141;
  --warn: #b37a12;
  --gray: #5e6876;
  --border: rgba(255,255,255,0.10);
  --success: #1d8f61;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.hero {
  text-align: center;
  margin-bottom: 24px;
}

.hero h1 {
  margin: 0;
  font-size: 3rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 18px;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.header-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 180px;
}

.top-nav {
  display: flex;
  gap: 12px;
  align-items: center;
}

.nav-btn {
  width: auto;
  min-width: 160px;
  background: var(--card-2);
}

.nav-btn.active {
  background: var(--primary);
}

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

.stat-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-card strong {
  font-size: 2.4rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.span-2 {
  grid-column: span 2;
}

input, select, textarea, button {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--text);
  padding: 14px 16px;
  font-size: 1rem;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

button {
  background: var(--primary);
  cursor: pointer;
  font-weight: 700;
}

button.danger { background: var(--danger); }
button.warn { background: var(--warn); }
button.gray { background: var(--gray); }

.stack {
  display: grid;
  gap: 12px;
}

.item {
  background: rgba(0,0,0,0.15);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.project-item.project-current {
  border-color: rgba(29, 143, 97, 0.45);
  box-shadow: inset 0 0 0 1px rgba(29, 143, 97, 0.25);
}

.item-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.item-meta {
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.6;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.item-actions button {
  width: auto;
  min-width: 130px;
}

.badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  background: rgba(255,255,255,0.12);
}

.badge-current {
  background: rgba(29, 143, 97, 0.22);
  color: #dcfff1;
}

.console-box, .admin-log {
  background: #06101f;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  min-height: 260px;
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  color: #cfe7ff;
}

.console-row {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 12px;
  margin-top: 12px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: min(700px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
}

.modal-wide {
  width: min(880px, 100%);
}

.modal-card > * + * {
  margin-top: 12px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-actions button {
  width: auto;
  min-width: 140px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
}

.subtle-note {
  color: var(--muted);
  font-size: 0.95rem;
}

.input-label {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.toggle-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(0,0,0,0.12);
}

.toggle-item input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .auth-grid,
  .stats-grid,
  .form-grid,
  .form-grid-2,
  .console-row,
  .toggle-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

  .header-row,
  .section-head,
  .top-nav {
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    min-width: 0;
  }

  .nav-btn,
  .item-actions button,
  .modal-actions button {
    width: 100%;
  }
}
