* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  min-height: 100vh;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

h1 {
  text-align: center;
  margin-bottom: 24px;
  color: #38bdf8;
  font-size: 1.8em;
}

h2 {
  margin-bottom: 16px;
  color: #94a3b8;
  font-size: 1.1em;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.card {
  background: #1e293b;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid #334155;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: #94a3b8;
  font-size: 0.9em;
}

.form-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.form-row-half {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.form-row-half .form-group {
  flex: 1;
  margin-bottom: 0;
}

input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="time"], input[type="tel"], select, textarea {
  background-color: #0f172a;
  border: 1px solid #334155;
  color: #e2e8f0;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.95em;
  width: 100%;
  min-width: 0;
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394a3b8' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

input[type="date"], input[type="time"] {
  padding-right: 12px;
  color-scheme: dark;
}

textarea {
  width: 100%;
  resize: vertical;
  font-family: monospace;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #38bdf8;
}

button {
  background: #334155;
  color: #e2e8f0;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95em;
  white-space: nowrap;
  transition: background 0.2s;
}

button:hover { background: #475569; }

.btn-primary {
  background: #1e40af;
  color: white;
  width: 100%;
  padding: 12px;
  font-weight: 600;
}
.btn-primary:hover { background: #1d4ed8; }

.btn-secondary { background: #1e40af; padding: 12px; font-weight: 600; }
.btn-secondary:hover { background: #1d4ed8; }

.btn-danger { background: #991b1b; }
.btn-danger:hover { background: #b91c1c; }

.btn-success { background: #1e40af; }
.btn-success:hover { background: #1d4ed8; }

.btn-sm { padding: 4px 12px; font-size: 0.85em; }

#login-status {
  margin-bottom: 16px;
}

.status {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.9em;
  display: none;
}

.status.success { display: block; background: #064e3b; color: #6ee7b7; }
.status.error { display: block; background: #450a0a; color: #fca5a5; }
.status.info { display: block; background: #1e3a5f; color: #93c5fd; }

.player-row {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

.player-row input.player-search { flex: 1; min-width: 0; }
.player-row select.player-select { flex: 2; min-width: 0; }

.player-fixed {
  color: #38bdf8;
  cursor: default;
  border-color: #1e40af;
  background: #1e293b;
}

.pref-row {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
  align-items: center;
}

.pref-row select { flex: 1; }

.pref-row .pref-num {
  color: #64748b;
  font-size: 0.85em;
  min-width: 20px;
  text-align: center;
}

.pref-row .btn-remove {
  background: #991b1b;
  padding: 6px 10px;
  font-size: 0.85em;
  flex: none;
}
.pref-row .btn-remove:hover { background: #b91c1c; }

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: none;
}

/* Reservations list */
.reservation-item {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.reservation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.reservation-item h3 {
  color: #38bdf8;
  margin-bottom: 0;
}

.reservation-status {
  font-size: 0.8em;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
}

.status-pending { background: #854d0e; color: #fde68a; }
.status-ok { background: #166534; color: #86efac; }
.status-failed { background: #991b1b; color: #fca5a5; }

.error-detail {
  color: #f87171;
  font-size: 0.85em;
}

.reservation-item .meta {
  color: #64748b;
  font-size: 0.85em;
  margin-bottom: 8px;
}

.reservation-item .meta span {
  margin-right: 16px;
}

.reservation-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  justify-content: flex-end;
}

.reservation-actions button {
  font-size: 0.85em;
  padding: 6px 14px;
  font-weight: normal;
}

/* Slots grid */
.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.slot-item {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 0.9em;
  color: #6ee7b7;
}

/* Logs */
.log-item {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 12px;
  margin-top: 10px;
  font-size: 0.85em;
}

.log-item .log-time {
  color: #64748b;
  margin-bottom: 4px;
}

.log-item .log-name {
  color: #38bdf8;
  font-weight: 600;
}

.log-item.log-success { border-left: 3px solid #22c55e; }
.log-item.log-fail { border-left: 3px solid #ef4444; }

.log-steps {
  margin-top: 8px;
  padding-left: 12px;
  color: #94a3b8;
}

.log-steps div { margin-bottom: 2px; }

.schedule-info {
  display: none;
  margin: 12px 0;
  padding: 10px 14px;
  background: #1e3a5f;
  color: #93c5fd;
  border-radius: 8px;
  font-size: 0.9em;
}

.push-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #334155;
}

.push-section h3 {
  color: #a78bfa;
  font-size: 1em;
  margin-bottom: 10px;
}

.push-desc {
  color: #94a3b8;
  font-size: 0.9em;
  margin-bottom: 10px;
  line-height: 1.5;
}

.push-hint {
  color: #fbbf24;
  font-size: 0.85em;
  margin-top: 8px;
  line-height: 1.5;
}

small { color: #64748b; }

@media (max-width: 600px) {
  .form-row { flex-direction: column; }
  .form-row-half { flex-direction: column; gap: 0; }
  .form-row-half .form-group { margin-bottom: 16px; }
}
