* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background: #f4f6f8;
  color: #172033;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: 16px;
}

.card {
  width: min(100%, 680px);
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  box-shadow:
    0 12px 35px
    rgba(0, 0, 0, .09);
}

.app-card {
  margin-top: 4px;
}

.auth-card {
  max-width: 420px;
  margin-top: 14vh;
}

.hidden {
  display: none !important;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: 30px;
}

h2 {
  margin-bottom: 4px;
  font-size: 22px;
}

h3 {
  margin-bottom: 14px;
  font-size: 19px;
}

label {
  display: block;
  margin: 16px 0 6px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfd6df;
  border-radius: 12px;
  background: #fff;
  color: #172033;
}

input,
select {
  min-height: 50px;
  padding: 11px 14px;
  font-size: 17px;
}

textarea {
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.4;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid
    rgba(31, 122, 70, .18);
  border-color: #1f7a46;
}

button {
  width: 100%;
  min-height: 50px;
  margin-top: 18px;
  padding: 12px 16px;
  border: 0;
  border-radius: 12px;
  background: #1f7a46;
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  filter: brightness(.98);
}

button:disabled {
  opacity: .48;
  cursor: not-allowed;
}

.secondary {
  background: #e7e9ed;
  color: #111827;
}

.secondary-action {
  background: #e7e9ed;
  color: #344054;
}

.muted {
  color: #6b7280;
}

.small-text {
  font-size: 13px;
}

.msg {
  min-height: 24px;
  margin-top: 10px;
  font-weight: 700;
}

.msg.error {
  color: #b42318;
}

.msg.ok {
  color: #166534;
}


/* =========================================================
   TOPBAR
   ========================================================= */

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.app-title {
  font-size: 24px;
  font-weight: 900;
}

.compact-button {
  width: auto;
  min-height: 40px;
  margin: 0;
  padding: 8px 14px;
  font-size: 14px;
}


/* =========================================================
   NAV
   ========================================================= */

.main-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 18px 0 20px;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.nav-btn {
  width: auto;
  min-width: max-content;
  min-height: 38px;
  margin: 0;
  padding: 8px 12px;
  background: #eef1f4;
  color: #344054;
  font-size: 13px;
}

.nav-btn.active {
  background: #1f7a46;
  color: #fff;
}


/* =========================================================
   VIEWS
   ========================================================= */

.app-view {
  min-height: 200px;
}

.view-heading,
.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.view-header p {
  margin-bottom: 0;
}

.small-action {
  width: auto;
  min-width: max-content;
  min-height: 40px;
  margin: 0;
  padding: 8px 14px;
  font-size: 14px;
}


/* =========================================================
   RECOLECCIÓN
   ========================================================= */

.summary-strip {
  display: grid;
  grid-template-columns:
    repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.summary-strip > div {
  padding: 12px 8px;
  border: 1px solid #edf0f3;
  border-radius: 12px;
  background: #f8fafc;
  text-align: center;
}

.summary-strip span {
  display: block;
  margin-bottom: 4px;
  color: #6b7280;
  font-size: 12px;
}

.summary-strip strong {
  display: block;
  font-size: 17px;
}

.employee-info {
  min-height: 48px;
  margin-top: 8px;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
}

.kilos {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
}

.total-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding: 18px;
  border-radius: 14px;
  background: #edf8f1;
}

.total-box strong {
  font-size: 28px;
}

.recent-section {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid #e5e7eb;
}

.recent-title {
  margin-bottom: 10px;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recent-row {
  display: grid;
  grid-template-columns:
    1fr auto;
  gap: 8px 12px;
  padding: 12px;
  border: 1px solid #e6e9ed;
  border-radius: 12px;
  background: #fff;
}

.recent-row .name {
  font-weight: 800;
}

.recent-row .amount {
  font-weight: 800;
  text-align: right;
}

.recent-row .meta {
  color: #667085;
  font-size: 13px;
}

.right-text {
  text-align: right;
}

.empty-state {
  padding: 14px 0;
  color: #6b7280;
  text-align: center;
}


/* =========================================================
   MAESTROS
   ========================================================= */

.master-summary {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  color: #667085;
  font-size: 13px;
}

.master-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.master-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  background: #fff;
}

.master-row.inactive {
  opacity: .60;
  background: #fafafa;
}

.master-main {
  min-width: 0;
  flex: 1;
}

.master-name {
  font-weight: 850;
  overflow-wrap: anywhere;
}

.master-meta {
  margin-top: 4px;
  color: #667085;
  font-size: 13px;
}

.master-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.status-pill.active {
  background: #dcfae6;
  color: #166534;
}

.status-pill.inactive {
  background: #f2f4f7;
  color: #667085;
}

.mini-button {
  width: auto;
  min-width: max-content;
  min-height: 34px;
  margin: 0;
  padding: 6px 10px;
  background: #e9edf2;
  color: #344054;
  font-size: 12px;
}

.value-big {
  font-size: 21px;
}


/* =========================================================
   FORMULARIOS
   ========================================================= */

.master-form {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid #dfe3e8;
  border-radius: 14px;
  background: #fafbfc;
}

.form-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.form-title-row h3 {
  margin-bottom: 0;
}

.icon-button {
  width: 36px;
  min-height: 36px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  background: #eceff3;
  color: #344054;
  font-size: 22px;
  line-height: 1;
}

.form-grid {
  display: grid;
  gap: 0 12px;
}

.form-grid.two-cols {
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
}

.full-col {
  grid-column: 1 / -1;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.check-label input {
  width: 20px;
  min-height: 20px;
  margin: 0;
}

.form-actions {
  display: grid;
  grid-template-columns:
    1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.form-actions button {
  margin: 0;
}

.form-help {
  margin-top: 12px;
  color: #667085;
  font-size: 12px;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 520px) {

  .shell {
    padding: 8px;
  }

  .card {
    padding: 16px;
    border-radius: 14px;
  }

  .auth-card {
    margin-top: 6vh;
  }

  .app-title {
    font-size: 21px;
  }

  .summary-strip {
    gap: 5px;
  }

  .summary-strip > div {
    padding: 10px 5px;
  }

  .summary-strip strong {
    font-size: 14px;
  }

  .total-box strong {
    font-size: 25px;
  }

  .view-header {
    align-items: center;
  }

  .master-row {
    align-items: flex-start;
  }

  .master-right {
    flex-direction: column;
    align-items: flex-end;
  }

  .status-pill {
    display: none;
  }

  .form-grid.two-cols {
    grid-template-columns: 1fr;
  }

  .full-col {
    grid-column: auto;
  }
}


/* =========================================================
   DESKTOP
   ========================================================= */

@media (min-width: 800px) {

  .shell {
    padding: 28px 16px;
  }

  .card {
    padding: 28px;
  }

  .app-card {
    margin-top: 10px;
  }
}


/* =========================================================
   USUARIOS / REPORTES
   ========================================================= */

.password-box {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e4e7ec;
}

.inline-action {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.inline-action .small-action {
  align-self: end;
  min-height: 50px;
}

.report-panel {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #e4e7ec;
  border-radius: 14px;
  background: #fafbfc;
}

.report-panel h3 {
  margin-bottom: 10px;
}

.report-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.report-actions button {
  margin: 0;
}

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

.report-summary-grid > div {
  padding: 12px 8px;
  border: 1px solid #e6e9ed;
  border-radius: 12px;
  background: #fff;
  text-align: center;
}

.report-summary-grid span {
  display: block;
  color: #667085;
  font-size: 12px;
}

.report-summary-grid strong {
  display: block;
  margin-top: 4px;
}

.report-table-wrap {
  overflow-x: auto;
  margin-top: 14px;
}

.report-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 13px;
}

.report-table th,
.report-table td {
  padding: 9px 8px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
}

.report-table th {
  background: #f5f7f9;
}

.report-table small {
  color: #667085;
}

.compare-title {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  text-align: center;
}

@media (max-width: 520px) {
  .report-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .report-actions {
    grid-template-columns: 1fr;
  }

  .inline-action {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   SELECTOR MÓVIL DE EMPLEADO
   ========================================================= */

.no-scroll {
  overflow: hidden;
}

.employee-picker-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #cfd6df;
  border-radius: 12px;
  background: #fff;
  color: #172033;
  font-size: 17px;
  font-weight: 600;
  text-align: left;
}

.employee-picker-button:hover {
  filter: none;
  border-color: #1f7a46;
}

.picker-arrow {
  color: #667085;
  font-size: 22px;
  line-height: 1;
}

.employee-status-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
  color: #667085;
  font-size: 12px;
}

.pending-dot,
.registered-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.pending-dot {
  background: #cbd5e1;
}

.registered-dot {
  margin-left: 6px;
  background: #22a55b;
}

.picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
  background: rgba(15, 23, 42, .42);
}

.picker-sheet {
  width: min(100%, 640px);
  max-height: 82vh;
  overflow: hidden;
  border-radius: 18px 18px 12px 12px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(0,0,0,.22);
}

.picker-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.picker-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: calc(82vh - 78px);
  overflow-y: auto;
  padding: 10px;
  overscroll-behavior: contain;
}

.picker-employee {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 62px;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid #e1e6eb;
  border-radius: 12px;
  background: #fff;
  color: #172033;
  text-align: left;
}

.picker-employee.pending {
  background: #fff;
}

.picker-employee.registered {
  border-color: #b7e4c7;
  background: #eefaf2;
}

.picker-employee:hover {
  filter: none;
  border-color: #1f7a46;
}

.picker-employee-name {
  font-size: 14px;
  font-weight: 850;
}

.picker-employee-meta {
  margin-top: 3px;
  color: #667085;
  font-size: 11px;
}

.picker-employee-state {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 78px;
  font-size: 11px;
}

.picker-employee.registered .picker-employee-state {
  color: #166534;
}

.picker-employee.pending .picker-employee-state {
  color: #667085;
}

.already-registered {
  margin-top: 5px;
  color: #166534;
  font-size: 12px;
  font-weight: 700;
}

.pending-message {
  margin-top: 5px;
  color: #667085;
  font-size: 12px;
}

.msg.warning {
  color: #9a6700;
}

@media (min-width: 700px) {
  .picker-overlay {
    align-items: center;
  }

  .picker-sheet {
    border-radius: 18px;
    max-height: 76vh;
  }

  .picker-list {
    max-height: calc(76vh - 78px);
  }
}
