/* TuckedIn admin — clean, functional, brand-aware */

:root {
  --navy: #1a1b3a;
  --navy-2: #252762;
  --cream: #faf3e0;
  --peach: #ff9a6b;
  --gold: #ffc988;
  --green: #2dbf78;
  --red: #e8556e;
  --muted: rgba(250, 243, 224, 0.6);
  --border: rgba(250, 243, 224, 0.12);
  --card: rgba(255, 255, 255, 0.04);
}

* { box-sizing: border-box; }

/* Force [hidden] to win over display rules below (e.g. .modal { display:flex } would otherwise show it) */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--navy);
  color: var(--cream);
  font-family: 'Quicksand', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  min-height: 100vh;
}

button { font-family: inherit; cursor: pointer; }

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}
.brand {
  font-weight: 700;
  font-size: 1.05rem;
}
.brand .muted { font-weight: 500; }
.status-area {
  flex: 1;
  font-size: 0.875rem;
  color: var(--muted);
}
.status-area.error { color: var(--red); }

/* Buttons */
.btn {
  border: 0;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.05s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn.primary {
  background: var(--peach);
  color: var(--navy);
}
.btn.primary:hover { background: var(--gold); }
.btn.ghost {
  background: transparent;
  color: var(--cream);
  border: 1px solid var(--border);
}
.btn.ghost:hover { background: rgba(255,255,255,0.06); }
.btn.success {
  background: var(--green);
  color: white;
}
.btn.success:hover { filter: brightness(1.1); }
.btn.danger {
  background: var(--red);
  color: white;
}
.btn.danger:hover { filter: brightness(1.1); }
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Login */
.login-screen {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  max-width: 400px;
  width: 100%;
}
.login-card h1 { margin: 0 0 0.5rem; font-size: 1.5rem; }
.login-card .muted { margin: 0 0 1.5rem; }
.login-card form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.login-card input {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  color: var(--cream);
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}
.login-card input:focus {
  outline: 2px solid var(--peach);
  outline-offset: 1px;
}

/* Queue */
.queue-screen {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}
.queue-screen h1 {
  font-size: 1.75rem;
  margin: 0 0 1.5rem;
}
.queue-count {
  font-weight: 500;
  color: var(--muted);
}
.queue {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.order-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.25rem;
  align-items: center;
}
@media (max-width: 700px) {
  .order-card {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.photos {
  display: flex;
  gap: 0.75rem;
}
.photo-wrap {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
}
.photo-wrap img {
  display: block;
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
  margin-bottom: 0.3rem;
  cursor: zoom-in;
  transition: transform 0.1s ease;
}
.photo-wrap img:hover { transform: scale(1.03); }
.photo-wrap img.broken {
  display: flex;
  align-items: center;
  justify-content: center;
}

.details {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}
.kid-line {
  font-size: 1.2rem;
  font-weight: 700;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.875rem;
  color: var(--muted);
}
.row strong {
  color: var(--cream);
  font-weight: 600;
}
.row a {
  color: var(--gold);
  text-decoration: none;
}
.row a:hover { text-decoration: underline; }
.muted { color: var(--muted); }

.actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 110px;
}
@media (max-width: 700px) {
  .actions { flex-direction: row; }
  .actions .btn { flex: 1; }
}

.empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
  font-size: 1.05rem;
}
.loading {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
}
.error {
  background: rgba(232, 85, 110, 0.15);
  color: var(--red);
  border: 1px solid var(--red);
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  font-size: 0.875rem;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.modal-card {
  background: var(--navy-2);
  border-radius: 14px;
  padding: 1.5rem;
  max-width: 480px;
  width: 100%;
}
.modal-card h2 { margin: 0 0 0.5rem; }
.modal-card textarea {
  width: 100%;
  margin: 1rem 0;
  background: rgba(0,0,0,0.3);
  color: var(--cream);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Photo lightbox (built dynamically) */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  cursor: zoom-out;
  padding: 1rem;
}
.lightbox img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 12px;
}
