* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f4f6fb;
  color: #111;
}

/* Top header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: #ffffff;
  border-bottom: 1px solid #e7ebf3;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-title {
  font-size: 26px;
  font-weight: 800;
}

.header button,
.header a.header-btn {
  width: auto;
  min-width: 96px;
  padding: 12px 16px;
  font-size: 18px;
  font-weight: 700;
  border-radius: 12px;
  border: none;
  background: #eef2f7;
  color: #111;
  text-decoration: none;
  text-align: center;
}

/* Main page container */
.container {
  padding: 18px;
  max-width: 760px;
  margin: 0 auto;
}

/* Page titles */
.title {
  font-size: 34px;
  font-weight: 800;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 19px;
  color: #666;
  margin-bottom: 18px;
}

/* Cards */
.card {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

/* Labels */
label {
  display: block;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
}

/* Inputs */
input,
select,
textarea {
  width: 100%;
  padding: 18px;
  font-size: 22px;
  border-radius: 16px;
  border: 1px solid #d9dfeb;
  background: #fff;
  margin-bottom: 16px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #111;
}

/* Buttons */
button {
  width: 100%;
  padding: 18px;
  font-size: 22px;
  font-weight: 800;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  transition: 0.15s ease;
}

button:active {
  transform: scale(0.98);
}

.primary {
  background: #111;
  color: #fff;
}

.secondary {
  background: #eef2f7;
  color: #111;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Button groups */
.grid-buttons {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.inline-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.inline-actions > * {
  flex: 1;
  min-width: 140px;
}

/* Links styled as buttons */
a.button-link {
  display: block;
  text-decoration: none;
}

/* Result text */
.result p {
  font-size: 23px;
  margin: 14px 0;
  line-height: 1.5;
}

.result b {
  font-weight: 800;
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 16px;
}

.present {
  background: #dff6e3;
  color: #0b7a28;
}

.absent {
  background: #ffe1e1;
  color: #b42318;
}

/* Utility */
.small {
  font-size: 17px;
  color: #777;
}

.success {
  color: #0b7a28;
  font-weight: 700;
}

.error {
  color: #b42318;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

/* Camera wrapper */
#reader,
#reader2 {
  width: 100%;
  overflow: hidden;
  border-radius: 18px;
  background: #000;
  margin-top: 12px;
}

/* Dashboard cards */
.tile {
  border-radius: 20px;
  padding: 20px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

/* Mobile optimization */
@media (max-width: 768px) {
  .container {
    padding: 16px;
  }

  .header {
    padding: 14px 16px;
  }

  .header-title {
    font-size: 24px;
  }

  .title {
    font-size: 32px;
  }

  .subtitle {
    font-size: 18px;
  }

  input,
  select,
  textarea,
  button {
    font-size: 21px;
    padding: 18px;
  }

  .result p {
    font-size: 22px;
  }

  .badge {
    font-size: 19px;
  }
}