﻿:root {
  --bg: #0f1621;
  --panel: #1a2433;
  --panel-2: #232f44;
  --text: #eef2f7;
  --muted: #9cb0cc;
  --accent: #edbc7f;
  --accent-strong: #dca461;
  --danger: #ef6b73;
  --border: #2f3d55;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "SF Pro Display", sans-serif;
  background: radial-gradient(circle at top right, #273754 0%, var(--bg) 58%);
  color: var(--text);
}

.screen { min-height: 100vh; }
.hidden,
[hidden] { display: none !important; }

.auth-screen {
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(420px, 100%);
  background: linear-gradient(155deg, #1c2839, #142031);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.auth-card h1 { margin: 0 0 8px; color: var(--accent); }
.auth-card p { margin: 0 0 16px; color: var(--muted); }

label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: #121b29;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  background: var(--accent);
  color: #1b2434;
  cursor: pointer;
}
button:hover { background: var(--accent-strong); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.secondary { background: #2a3850; color: var(--text); }

.error { color: var(--danger); min-height: 20px; margin-top: 10px; }
.hint { color: var(--muted); min-height: 20px; margin-top: 10px; }

.app-screen {
  display: grid;
  grid-template-columns: 250px 1fr;
}

.sidebar {
  border-right: 1px solid var(--border);
  background: rgba(16, 24, 36, 0.8);
  backdrop-filter: blur(6px);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand { font-size: 22px; font-weight: 700; color: var(--accent); }
.brand span { font-size: 12px; color: var(--muted); font-weight: 500; }

nav { display: grid; gap: 8px; }
.nav-item {
  text-align: left;
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
}
.nav-item.active {
  border-color: var(--border);
  background: #202d42;
}

.logout { margin-top: auto; background: #3a1f2a; color: #ffdce0; }

.content { padding: 24px; display: grid; gap: 20px; }
.topbar { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.topbar h2 { margin: 0 0 6px; }
.topbar p { margin: 0; color: var(--muted); }

.user-chip {
  background: #1f2c40;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
}

.card {
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.95), rgba(22, 31, 46, 0.95));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}
.card h3 { margin: 0 0 12px; }

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

.actions { display: flex; gap: 8px; margin-top: 10px; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.report-form { margin-top: 14px; }
.field-grid-2,
.field-grid-3,
.field-grid-4 {
  display: grid;
  gap: 12px;
}
.field-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.leg-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.leg-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: rgba(17, 26, 39, 0.7);
}
.leg-card h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--accent);
}
.leg-card input { margin-bottom: 8px; }
.payload-preview {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(10, 16, 24, 0.6);
}
.payload-preview summary {
  cursor: pointer;
  color: var(--muted);
}
.payload-preview pre {
  margin: 8px 0 0;
  font-size: 12px;
  white-space: pre-wrap;
}
.day-list-section {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: rgba(10, 16, 24, 0.45);
}
.day-list-section h4 {
  margin: 0;
  color: var(--accent);
}
.list-grid-2 {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.tiny-btn {
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 8px;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px; border-bottom: 1px solid #2a3952; text-align: left; font-size: 13px; }
.status-pill { padding: 4px 8px; border-radius: 999px; font-size: 12px; }
.status-queued { background: #2f3f5e; }
.status-running { background: #6a4f21; }
.status-succeeded { background: #244836; }
.status-failed { background: #5c2730; }

@media (max-width: 960px) {
  .app-screen { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--border); }
  .grid { grid-template-columns: 1fr; }
  .field-grid-2,
  .field-grid-3,
  .field-grid-4,
  .list-grid-2,
  .leg-grid { grid-template-columns: 1fr; }
}
