:root {
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-secondary: #475569;
  --color-secondary-hover: #334155;
  --color-success: #16a34a;
  --color-error: #dc2626;
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
  width: 100%;
}

/* Navbar */
.navbar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 0;
  box-shadow: var(--shadow);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-primary);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.25rem;
}

.nav-links a {
  color: var(--color-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--color-primary);
}

/* Main content */
main {
  flex: 1;
  padding: 2rem 0;
}

/* Card */
.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 2rem;
}

.card-narrow {
  max-width: 420px;
  margin: 0 auto;
}

.card h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.subtitle {
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

/* Form */
.form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-weight: 600;
  font-size: 0.9rem;
}

.form-group input {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.2s;
}

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

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

.btn-secondary {
  background: var(--color-secondary);
  color: #fff;
}

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

/* Alerts */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.alert-success {
  background: #f0fdf4;
  color: var(--color-success);
  border: 1px solid #bbf7d0;
}

.alert-error {
  background: #fef2f2;
  color: var(--color-error);
  border: 1px solid #fecaca;
}

/* Admin */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.badge {
  background: var(--color-bg);
  color: var(--color-text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Table */
.table-wrapper {
  overflow-x: auto;
}

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

th, td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
  white-space: nowrap;
}

th {
  font-weight: 700;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tbody tr:hover {
  background: var(--color-bg);
}

td a {
  color: var(--color-primary);
  text-decoration: none;
}

td a:hover {
  text-decoration: underline;
}

.empty-state {
  text-align: center;
  color: var(--color-text-muted);
  padding: 2rem 0;
}

/* QR Code */
.qr-card {
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
}

.qr-container {
  margin: 1.5rem 0;
}

.qr-image {
  max-width: 300px;
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.qr-url {
  margin-top: 1rem;
}

.qr-url a {
  color: var(--color-primary);
  font-weight: 600;
  font-size: 1rem;
  word-break: break-all;
}

/* Footer */
.footer {
  text-align: center;
  padding: 1.25rem 0;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--color-border);
  margin-top: auto;
}

/* Responsive */
@media (max-width: 600px) {
  .card {
    padding: 1.25rem;
  }

  .admin-header {
    flex-direction: column;
    align-items: flex-start;
  }

  th, td {
    padding: 0.5rem;
    font-size: 0.8rem;
  }
}

/* Filter buttons */
.filter-btn {
  cursor: pointer;
  transition: all 0.2s ease;
}
.filter-btn.active {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}

/* Status badges in report */
table td span[style*="border-radius:20px"] {
  white-space: nowrap;
}

/* Textarea styling */
textarea:focus {
  border-color: #3b82f6;
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
