* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: #0f1b2d;
  color: #1a1a1a;
  min-height: 100vh;
}
.wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.card {
  background: #fff;
  border-radius: 16px;
  padding: 32px 28px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
h1 {
  text-align: center;
  font-size: 22px;
  margin: 0 0 20px;
  color: #0f1b2d;
}
h1 span {
  font-size: 15px;
  font-weight: 400;
  color: #6b7280;
}
.clock {
  text-align: center;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #0f1b2d;
  margin-bottom: 24px;
  font-variant-numeric: tabular-nums;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
  margin: 16px 0 6px;
}
input[type="text"], input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 16px;
}
input:focus { outline: none; border-color: #0f1b2d; }
.pill-group {
  display: flex;
  gap: 10px;
}
.pill {
  flex: 1;
  padding: 14px 10px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  background: #f9fafb;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: #374151;
}
.pill.active { border-color: #0f1b2d; background: #0f1b2d; color: #fff; }
.pill.draw.active { background: #16a34a; border-color: #16a34a; }
.pill.return.active { background: #2563eb; border-color: #2563eb; }
.submit-btn {
  width: 100%;
  margin-top: 24px;
  padding: 14px;
  background: #0f1b2d;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.submit-btn:disabled { background: #9ca3af; cursor: not-allowed; }
.hidden { display: none !important; }
.success-msg { text-align: center; }
.success-msg .check {
  width: 56px; height: 56px; line-height: 56px;
  border-radius: 50%; background: #16a34a; color: #fff;
  font-size: 28px; margin: 0 auto 16px;
}
.success-msg p { font-size: 15px; color: #374151; line-height: 1.6; }
.error-msg {
  margin-top: 14px;
  padding: 10px 12px;
  background: #fee2e2;
  color: #991b1b;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
}

/* Admin dashboard */
.admin-wrap { align-items: flex-start; padding: 24px; }
.admin-wrap, .admin-header, .admin-panel { max-width: 1440px; margin: 0 auto; width: 100%; }
.admin-header { display: flex; justify-content: space-between; align-items: flex-start; color: #fff; }
.admin-header h1 { color: #fff; margin: 0; }
.whoami { color: #9ca3af; font-size: 13px; margin: 4px 0 0; }
.header-actions { display: flex; gap: 16px; align-items: center; }
.link-btn { background: none; border: none; color: #93c5fd; cursor: pointer; font-size: 14px; }
.account-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  margin: 16px 0;
  padding: 16px;
  background: #f9fafb;
  border-radius: 10px;
}
.account-form label { margin: 0 0 6px; }
.account-form select {
  width: 100%;
  padding: 12px 10px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
}
.small-submit { margin-top: 0; padding: 12px 18px; }
.success-inline {
  margin: 0 0 14px;
  padding: 10px 12px;
  background: #dcfce7;
  color: #166534;
  border-radius: 8px;
  font-size: 14px;
}
.small-btn.danger { border-color: #fca5a5; color: #b91c1c; background: #fef2f2; }

@media (max-width: 720px) {
  .account-form { grid-template-columns: 1fr; }
}
.admin-panel { margin-top: 20px; }
.hint { color: #9ca3af; font-size: 13px; padding: 20px 0; text-align: center; }
.records-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.small-btn {
  padding: 10px 16px;
  font-size: 14px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.small-btn.primary { background: #0f1b2d; color: #fff; border-color: #0f1b2d; }
.small-btn:disabled { opacity: 0.5; cursor: not-allowed; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #e5e7eb; white-space: nowrap; }
th { color: #6b7280; font-size: 12px; text-transform: uppercase; position: sticky; top: 0; background: #fff; }
.action-draw { color: #16a34a; font-weight: 700; }
.action-return { color: #2563eb; font-weight: 700; }
.login-card { margin: auto; }

.filter-bar {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}
.filter-field { display: flex; flex-direction: column; }
.filter-field label { margin: 0 0 6px; font-size: 12px; }
.filter-field input[type="date"] {
  padding: 10px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
}
.filter-spacer { flex: 1; min-width: 0; }
.stats-row { display: flex; gap: 16px; margin-top: 16px; flex-wrap: wrap; }
.stat-box {
  background: #fff;
  border-radius: 12px;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  min-width: 130px;
}
.stat-num { font-size: 28px; font-weight: 800; color: #0f1b2d; }
.stat-num.draw-color { color: #16a34a; }
.stat-num.return-color { color: #2563eb; }
.stat-label { font-size: 12px; color: #6b7280; margin-top: 4px; text-transform: uppercase; }
.records-full {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-top: 16px;
}
.records-full h2 { font-size: 16px; margin: 0 0 14px; color: #374151; }
.table-scroll { overflow-x: auto; max-height: 65vh; overflow-y: auto; }

@media (max-width: 720px) {
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-field input[type="date"] { width: 100%; }
  .filter-spacer { display: none; }
}
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 60px; }
.pw-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  color: #374151;
}
