:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --primary: #2563eb;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  line-height: 1.5;
}

.top-bar {
  background: #111827;
  color: #fff;
  padding: 1.25rem 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-group h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.docs-link {
  color: #93c5fd;
  text-decoration: none;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border: 1px solid rgba(147, 197, 253, 0.5);
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}

.docs-link:hover {
  background: rgba(147, 197, 253, 0.15);
  color: #bfdbfe;
}

.auth-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-label {
  font-weight: 600;
}

.auth-controls input {
  padding: 0.45rem 0.75rem;
  border-radius: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(17, 24, 39, 0.4);
  color: #fff;
  min-width: 180px;
}

.auth-controls input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

main {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.table-card {
  background: var(--surface);
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
  padding: 1.5rem;
}

.table-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.timestamp {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 960px;
  position: relative;
}

th,
td {
  padding: 0.75rem 0.9rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: #fff;
}

th {
  font-weight: 600;
  background: #f9fafb;
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody tr:nth-child(even) {
  background: #fdfdfd;
}

tbody tr:hover {
  background: #f3f4f6;
}

tr:nth-child(even) td {
  background: #fdfdfd;
}

tr:hover td {
  background: #f3f4f6;
}

.table-wrapper table th:first-child,
.table-wrapper table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  box-shadow: 6px 0 12px rgba(15, 23, 42, 0.08);
}

.table-wrapper table th:first-child {
  z-index: 4;
}

.table-wrapper table th:last-child,
.table-wrapper table td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  box-shadow: -6px 0 12px rgba(15, 23, 42, 0.08);
}

.table-wrapper table th:last-child {
  z-index: 4;
}

tbody tr:nth-child(even) td:first-child,
tbody tr:nth-child(even) td:last-child {
  background: #fdfdfd;
}

tbody tr:hover td:first-child,
tbody tr:hover td:last-child {
  background: #f3f4f6;
}

.status-stack {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: center;
}

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

.btn {
  padding: 0.45rem 0.9rem;
  border-radius: 0.5rem;
  color: #fff;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.btn-success {
  background: var(--success);
}

.btn-warning {
  background: var(--warning);
  color: #111827;
}

.btn-danger {
  background: var(--danger);
}

.btn-secondary {
  background: #6b7280;
}

.btn-reserve {
  background: #7c3e0a;
}

.reservation-indicator {
  margin-left: 0.35rem;
  color: #7c3e0a;
  font-size: 0.85rem;
}

.actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.actions .btn {
  padding: 0.3rem 0.65rem;
  font-size: 0.85rem;
}

.status-pill {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  width: fit-content;
}

.status-AVAILABLE {
  background: #dcfce7;
  color: #047857;
}

.status-IN_USE {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-UNAVAILABLE {
  background: #fee2e2;
  color: #b91c1c;
}

.health-HEALTHY {
  background: #d1fae5;
  color: #047857;
}

.health-UNHEALTHY {
  background: #fee2e2;
  color: #b91c1c;
}

.health-CHECKING {
  background: #e0f2fe;
  color: #0369a1;
}

.flag-icon {
  font-size: 1.25rem;
}

.hidden {
  display: none !important;
}

@media (max-width: 768px) {
  .auth-controls {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-controls input {
    width: 100%;
  }

  main {
    padding: 1.5rem;
  }
}
