@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@600;700&display=swap");
@import url("https://perso-gamma-mocha.vercel.app/jds-theme.css");

:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface2: #263347;
  --border: #334155;
  --blue: #3b82f6;
  --blue-dk: #2563eb;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.12);
  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, 0.12);
  --amber: #f59e0b;
  --amber-bg: rgba(245, 158, 11, 0.12);
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: Outfit, Inter, sans-serif;
}

a {
  color: var(--blue);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.nav button {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.55rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
}

.nav button.active,
.nav button:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.nav button .badge {
  background: var(--red);
  color: #fff;
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  margin-left: 0.35rem;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.field textarea {
  min-height: 100px;
  resize: vertical;
}

.rent-item-picker {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.rent-item-picker select {
  flex: 1;
  min-width: 0;
}

.rent-item-picker .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.5rem;
}

.radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text);
  margin: 0;
  font-weight: 500;
}

.radio-group input[type="radio"] {
  margin: 0;
  width: 1rem;
  height: 1rem;
  accent-color: var(--blue);
  flex-shrink: 0;
}

@media (max-width: 700px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  border: none;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font: inherit;
}

.btn:hover {
  background: var(--blue-dk);
}

.btn-secondary {
  background: var(--surface2);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

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

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

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.stat {
  background: var(--surface2);
  border-radius: 8px;
  padding: 0.85rem;
  text-align: center;
}

.stat .val {
  font-size: 1.6rem;
  font-weight: 700;
  font-family: Outfit, sans-serif;
}

.stat .lbl {
  font-size: 0.8rem;
  color: var(--muted);
}

.rental-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 1rem;
  align-items: center;
}

.rental-card.status-green {
  border-left: 4px solid var(--green);
  background: var(--green-bg);
}

.rental-card.status-amber {
  border-left: 4px solid var(--amber);
  background: var(--amber-bg);
}

.rental-card.status-red {
  border-left: 4px solid var(--red);
  background: var(--red-bg);
}

.rental-card img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg);
}

.rental-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.rental-meta strong {
  color: var(--text);
}

.returned-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  margin-right: 0.4rem;
  border-radius: 3px;
  background: var(--green);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.message {
  margin-top: 0.75rem;
  padding: 0.65rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.message.error {
  background: var(--red-bg);
  color: var(--red);
}

.message.success {
  background: var(--green-bg);
  color: var(--green);
}

.hidden {
  display: none !important;
}

.login-wrap {
  max-width: 400px;
  margin: 4rem auto;
}

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.header-bar h1 {
  margin: 0;
  font-size: 1.5rem;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.game-item {
  background: var(--surface2);
  border-radius: 8px;
  padding: 0.75rem;
  border: 1px solid var(--border);
}

.game-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-game-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.modal-game-header img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg);
  flex-shrink: 0;
}

.photo-preview {
  max-width: 120px;
  max-height: 120px;
  border-radius: 8px;
  margin-top: 0.5rem;
}

.panel-rent-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-rent-header h2 {
  margin: 0;
}

.selected-game-preview {
  width: 88px;
  height: 88px;
  object-fit: contain;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 6px;
  flex-shrink: 0;
}

  max-height: 240px;
  overflow-y: auto;
  margin: 0.75rem 0;
}

.search-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.client-link {
  color: var(--blue);
  cursor: pointer;
  text-decoration: underline;
}
