:root {
  --lumenac-blue: #0b3d91;
  --lumenac-blue-dark: #082a66;
  --lumenac-accent: #f2a900;
  --bg: #f4f6f9;
  --text: #1c2530;
  --muted: #5b6b7c;
  --danger: #c0392b;
  --ok: #1e8449;
  --border: #d8dee5;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.4;
}

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

.app-header {
  background: var(--lumenac-blue);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-header__brand img {
  height: 34px;
  width: auto;
  display: block;
}

.app-header__brand span {
  font-weight: 700;
  font-size: 1.1rem;
}

.app-header__user {
  font-size: 0.85rem;
  text-align: right;
}

.app-header__user form {
  margin-top: 4px;
}

.app-nav {
  display: flex;
  overflow-x: auto;
  background: var(--lumenac-blue-dark);
  -webkit-overflow-scrolling: touch;
}

.app-nav a {
  color: #fff;
  text-decoration: none;
  padding: 12px 16px;
  font-size: 0.95rem;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}

.app-nav a.active {
  border-bottom-color: var(--lumenac-accent);
  font-weight: 600;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 48px;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

h1 {
  font-size: 1.4rem;
  margin: 0 0 12px;
}

h2 {
  font-size: 1.1rem;
  margin: 0 0 10px;
}

.step-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 6px;
}

fieldset {
  border: none;
  padding: 0;
  margin: 0 0 20px;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  appearance: none;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.choice-grid--shift {
  grid-template-columns: repeat(2, 1fr);
}

.choice-btn {
  position: relative;
}

.choice-btn input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.choice-btn span {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 56px;
  padding: 10px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-weight: 600;
  background: #fff;
}

.choice-btn input:checked + span {
  border-color: var(--lumenac-blue);
  background: #e8effb;
  color: var(--lumenac-blue);
}

.btn {
  display: inline-block;
  border: none;
  border-radius: 10px;
  padding: 14px 20px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

.btn-primary {
  background: var(--lumenac-blue);
  color: #fff;
  width: 100%;
}

.btn-secondary {
  background: #fff;
  color: var(--lumenac-blue);
  border: 2px solid var(--lumenac-blue);
  width: 100%;
}

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

.btn-small {
  padding: 8px 12px;
  font-size: 0.85rem;
  width: auto;
}

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-weight: 600;
}

.alert-success {
  background: #e3f6e8;
  color: var(--ok);
  border: 1px solid #bfe6cb;
}

.alert-error {
  background: #fdecea;
  color: var(--danger);
  border: 1px solid #f5c6c0;
}

.error-text {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: -4px;
  margin-bottom: 10px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.summary-tile {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.summary-tile strong {
  display: block;
  font-size: 1.4rem;
  color: var(--lumenac-blue);
}

.summary-tile span {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
}

.machine-card h2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef1f5;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
}

.badge-correction {
  background: #fff3cd;
  color: #8a6100;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table th,
table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
}

.entry-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.entry-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.entry-list li:last-child {
  border-bottom: none;
}

.filters-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.filters-form .full {
  grid-column: 1 / -1;
}

.whatsapp-box {
  background: #f0fdf4;
  border: 1px solid #bfe6cb;
  border-radius: 10px;
  padding: 12px;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  max-height: 400px;
  overflow-y: auto;
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 32px 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 10px 30px rgba(11, 61, 145, 0.12);
  text-align: center;
}

.login-card img {
  height: 56px;
  margin-bottom: 16px;
}

.pagination {
  margin-top: 16px;
}

@media (min-width: 480px) {
  .summary-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
