:root {
  --primary: #1a56db;
  --danger: #dc2626;
  --success: #16a34a;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --border: #e2e8f0;
  --radius: 8px;
}

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

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

header {
  background: var(--primary);
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 { font-size: 1.25rem; }
header nav { display: flex; gap: 0.5rem; }
header button {
  background: rgba(255,255,255,0.2);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
}

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

.view { background: var(--card); border-radius: var(--radius); padding: 2rem; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

h2 { margin-bottom: 1.5rem; }
h3 { margin: 1rem 0 0.5rem; }

input[type="text"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  margin-bottom: 1rem;
}

button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-size: 1rem;
  cursor: pointer;
}

button:hover { opacity: 0.9; }

.error { color: var(--danger); margin-top: 0.5rem; }
.success { color: var(--success); }

.search-bar { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.search-bar input { margin-bottom: 0; flex: 1; }

.enrollment-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.enrollment-card:hover { border-color: var(--primary); }
.enrollment-card .status { font-weight: 600; text-transform: uppercase; font-size: 0.85rem; }
.enrollment-card .status.pending_pin { color: #d97706; }
.enrollment-card .status.ready { color: var(--primary); }
.enrollment-card .status.issued { color: var(--success); }

#sig-canvas {
  border: 2px solid var(--text);
  border-radius: var(--radius);
  display: block;
  margin: 1rem auto;
  touch-action: none;
  background: white;
  max-width: 100%;
}

.canvas-actions { display: flex; gap: 0.5rem; justify-content: center; margin-top: 1rem; }
.canvas-actions button:first-child { background: var(--danger); }

#enrollment-info p { margin: 0.25rem 0; }
#enrollment-info { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }

/* New enrollment form */
#form-new-enroll label { display: block; margin-bottom: 1rem; }
#form-new-enroll input { display: block; width: 100%; max-width: 400px; padding: 0.5rem; margin-top: 0.25rem; border: 1px solid #ccc; border-radius: 4px; }
.form-actions { margin-top: 1.5rem; display: flex; gap: 1rem; }
.form-actions button { padding: 0.5rem 1.5rem; border: none; border-radius: 4px; cursor: pointer; }
.form-actions button[type="submit"] { background: #1a73e8; color: white; }
.form-actions button[type="button"] { background: #e0e0e0; }
#btn-new-enroll { background: #1a73e8; color: white; border: none; padding: 0.5rem 1rem; border-radius: 4px; cursor: pointer; margin-left: 0.5rem; }
