:root {
  --bg: #fff;
  --panel: #fff;
  --text: #25262b;
  --muted: #69717d;
  --line: #e4e7ec;
  --accent: #862d46;
  --accent-strong: #692238;
  --danger: #ad2934;
  --success: #247446;
  --soft: #f8edf1;
  --blue: #2466a8;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
  letter-spacing: 0;
}
body {
  margin: 0;
  background: var(--bg);
}
a {
  color: var(--accent);
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
a,
button,
input,
select,
textarea {
  transition:
    background-color 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid #bc7790;
  outline-offset: 3px;
}
svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 28px;
  line-height: 1.25;
  font-weight: 700;
}
h2 {
  font-size: 20px;
  line-height: 1.35;
  margin-bottom: 18px;
}
h3 {
  font-size: 16px;
}
p {
  color: var(--muted);
  margin: 12px 0;
  line-height: 1.6;
}
.muted {
  color: var(--muted);
}
.full {
  grid-column: 1/-1;
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 20px;
  z-index: 99;
  padding: 12px;
  background: white;
}
.skip-link:focus {
  top: 10px;
}
.topbar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 224px;
  border-right: 1px solid var(--line);
  background: #fff;
  z-index: 20;
}
.topbar-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 28px 16px 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--accent);
  margin: 0 4px 36px;
}
.brand img {
  width: 44px;
  height: 52px;
  object-fit: contain;
}
.brand strong {
  font-size: 24px;
  line-height: 1.2;
}
.brand span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}
.topbar nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.nav-link,
.link-button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 11px 14px;
  border: 0;
  border-radius: 5px;
  color: #505761;
  background: transparent;
  font-weight: 600;
  font-size: 14px;
  text-align: left;
}
.nav-link:hover,
.link-button:hover {
  background: #f5f6f8;
}
.nav-link[aria-current="page"] {
  background: var(--soft);
  color: var(--accent);
  box-shadow: inset 3px 0 var(--accent);
}
.account {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.account-person {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0 8px 14px;
  min-width: 0;
}
.account-person div {
  min-width: 0;
}
.account-person strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.account-person small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.avatar {
  background: #f1f2f5;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  flex-shrink: 0;
}
.account .link-button {
  width: 100%;
}
.app-page main {
  margin-left: 224px;
  padding: 0 32px 48px;
  max-width: 1840px;
  min-width: 0;
}
.context-bar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 12px;
}
.context-bar span {
  display: flex;
  gap: 12px;
  align-items: center;
}
.context-bar strong {
  font-weight: 500;
  color: var(--text);
}
.context-bar time {
  white-space: nowrap;
}
.panel {
  padding: 0;
  margin: 0 0 30px;
  min-width: 0;
}
.panel + .panel {
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.page-heading {
  margin-bottom: 24px;
}
.page-heading p {
  font-size: 15px;
  margin-bottom: 0;
}
.schedule {
  display: flex;
  align-items: center;
  background: #f5f6f8;
  border-radius: 6px;
  margin-top: 22px;
  padding: 16px 20px;
  gap: 20px;
}
.schedule-item {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  justify-content: center;
}
.schedule-item + .schedule-item {
  border-left: 1px solid #dce0e6;
}
.schedule-item svg {
  width: 28px;
  height: 28px;
  color: var(--success);
}
.schedule-item:nth-child(2) svg {
  color: #b57912;
}
.schedule-item:nth-child(3) svg {
  color: var(--blue);
}
.schedule-item span {
  font-size: 12px;
  color: var(--muted);
}
.schedule-item strong {
  display: block;
  font-size: 17px;
  color: var(--text);
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 32px;
  margin-bottom: 24px;
}
.hero .panel {
  margin: 0;
}
.hero .panel + .panel {
  border-left: 1px solid var(--line);
  padding: 4px 0 0 28px;
  border-top: 0;
}
.hero .panel p {
  margin-bottom: 20px;
}
.economic-total {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.2;
}
.economic-total span {
  font-size: 18px;
  color: var(--muted);
  font-weight: 400;
}
.economic-meter {
  width: 100%;
  height: 6px;
  accent-color: var(--accent);
  margin-top: 16px;
}
.grid {
  display: grid;
  gap: 16px;
}
.stats {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  background: #f7f8fa;
  padding: 20px 0;
  border-radius: 6px;
  margin-bottom: 32px;
}
.stat {
  padding: 0 20px;
  border-right: 1px solid var(--line);
}
.stat:last-child {
  border: 0;
}
.stat strong {
  display: block;
  font-size: 27px;
  margin-top: 8px;
  font-weight: 650;
}
.stat span {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 6px;
  align-items: center;
}
.stat span:before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.stat:nth-child(1) span:before {
  background: #258553;
}
.stat:nth-child(2) span:before {
  background: #bf8a1e;
}
.stat:nth-child(3) span:before {
  background: #2674aa;
}
.stat:nth-child(4) span:before {
  background: #a86735;
}
.stat:nth-child(5) span:before {
  background: #865ba4;
}
.stat:nth-child(6) span:before {
  background: #5b69b0;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.form-grid > *,
.toolbar > * {
  min-width: 0;
}
label {
  display: grid;
  gap: 7px;
  color: #505761;
  font-size: 13px;
  font-weight: 600;
}
input,
select,
textarea {
  width: 100%;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid #cfd4dd;
  border-radius: 5px;
  background: white;
  color: var(--text);
  font-weight: 400;
  font-size: 14px;
  min-height: 40px;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}
input::placeholder,
textarea::placeholder {
  color: #858c96;
}
textarea {
  resize: vertical;
  min-height: 40px;
  height: 40px;
}
select:disabled,
input:disabled {
  background: #f2f3f5;
  color: var(--muted);
}
.button,
.btn-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  background: var(--accent);
  color: white;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
}
.button:hover,
.btn-login:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}
.button.secondary {
  background: #fff;
  border-color: #d6dbe2;
  color: #424b58;
}
.button.secondary:hover {
  background: #f5f6f8;
  border-color: #9da6b4;
}
.button.danger {
  background: #fff;
  color: var(--danger);
  border-color: #e9c9cd;
}
.button.danger:hover {
  background: #fff0f1;
}
.button.consult {
  background: var(--blue);
  border-color: var(--blue);
}
.button.consult:hover {
  background: #1b5188;
}
.actions {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-top: 16px;
}
.actions form {
  margin: 0;
}
.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
}
.toolbar .actions {
  margin: 0;
}
.consult-form {
  grid-template-columns: minmax(0, 1fr) 200px auto;
}
.consult-form .full {
  grid-column: auto;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.section-heading h2 {
  margin: 0;
}
.section-heading label {
  width: 300px;
  max-width: 100%;
}
.count {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 8px;
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  max-width: 100%;
  scrollbar-width: thin;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  text-align: left;
}
th {
  background: #f2f4f7;
  color: #515a68;
  font-size: 12px;
  font-weight: 600;
  padding: 13px 14px;
  white-space: nowrap;
}
td {
  padding: 14px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
  overflow-wrap: anywhere;
}
tbody tr:hover {
  background: #fafbfc;
}
td .actions {
  margin: 0;
  align-items: center;
}
td .button {
  font-size: 12px;
  padding: 8px 10px;
  white-space: nowrap;
}
td input,
td select,
td textarea {
  font-size: 13px;
}
td input[type="time"] {
  min-width: 112px;
}
td input[name="work_date"] {
  min-width: 116px;
}
td select {
  min-width: 140px;
}
td textarea {
  min-width: 150px;
}
td input[name="name"],
td input[name="email"] {
  min-width: 160px;
}
td input[name="password"] {
  min-width: 140px;
}
.week-table {
  min-width: 870px;
}
.week-table td:first-child {
  width: 140px;
  white-space: nowrap;
}
.day-name {
  display: block;
  font-weight: 600;
  margin-bottom: 3px;
}
.day-date {
  color: var(--muted);
  font-size: 12px;
}
.today-row {
  background: #fcf5f7;
}
.today-row:hover {
  background: #faf0f3;
}
.today-tag {
  display: inline-flex;
  margin-left: 6px;
  font-size: 10px;
  background: #f2e0e7;
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.saved-time {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 4px;
}
.badge:before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.ok {
  background: #edf7f0;
  color: #21633d;
}
.late {
  background: #fff5dc;
  color: #89600d;
}
.info {
  background: #eaf3fa;
  color: #2a6896;
}
.warn {
  background: #fcf0e6;
  color: #915423;
}
.medical {
  background: #f3edf8;
  color: #80589c;
}
.economic {
  background: #eff0fb;
  color: #5668a6;
}
.empty {
  background: #f0f2f5;
  color: #66707e;
}
.flash {
  padding: 14px 16px;
  border: 1px solid;
  border-radius: 5px;
  margin: 0 0 20px;
  font-size: 13px;
}
.flash.success {
  background: #eff8f1;
  color: #21633d;
  border-color: #cde5d3;
}
.flash.error {
  background: #fff2f3;
  color: #a32e3b;
  border-color: #edcbd1;
}
tr[hidden] {
  display: none;
}
.empty-result {
  text-align: center;
  padding: 32px;
  color: var(--muted);
}
.user-create {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  margin-bottom: 28px;
}
.user-create summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
}
.user-create summary::-webkit-details-marker {
  display: none;
}
.user-create .form-grid {
  padding-top: 22px;
  max-width: 900px;
}
.user-create[open] summary svg {
  transform: rotate(45deg);
}
.identity {
  font-size: 14px;
  color: var(--muted);
  margin: 10px 0 16px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 12px;
}
.app-footer {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 32px;
  color: var(--muted);
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.login-page {
  background: #f5f6f8;
  border-top: 4px solid var(--accent);
  min-height: 100vh;
}
.login-page main {
  min-height: calc(100vh - 4px);
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.login-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}
.login-box {
  width: 420px;
  max-width: 100%;
  background: white;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 30px #20242a08;
}
.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
}
.login-logo img {
  width: 78px;
  height: 78px;
  object-fit: contain;
}
.login-title {
  text-align: center;
  font-size: 23px;
  color: var(--text);
  font-weight: 700;
  line-height: 1.3;
}
.login-sub {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin: 10px 0 30px;
}
.login-form label {
  margin-bottom: 8px;
}
.login-field-wrap {
  position: relative;
  margin-bottom: 20px;
}
.login-field-wrap input {
  min-height: 46px;
}
.has-toggle input {
  padding-right: 48px;
}
.pw-toggle {
  position: absolute;
  right: 3px;
  top: 3px;
  height: 40px;
  width: 40px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 4px;
}
.pw-toggle:hover {
  background: #f5f6f8;
}
.btn-login {
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
}
.login-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-top: 1px solid var(--line);
  margin-top: 26px;
  padding-top: 20px;
  font-size: 11px;
  color: var(--muted);
}
.login-footer svg {
  width: 14px;
  height: 14px;
}
.page-foot {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 24px;
}
.login-page .flash {
  width: 420px;
  max-width: 100%;
}
.panel.capture-selection,
.panel.capture-records {
  border-top: 0;
  padding-top: 0;
}
.capture-heading {
  margin-bottom: 24px;
}
.capture-records .week-table td {
  padding-block: 12px;
}
td input[name="nsp"] {
  min-width: 100px;
}
@media (min-width: 1700px) {
  .app-page main {
    padding-inline: 48px;
  }
}
@media (max-width: 1150px) {
  .topbar {
    width: 200px;
  }
  .app-page main {
    margin-left: 200px;
    padding-inline: 24px;
  }
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 22px;
  }
  .stat:nth-child(3) {
    border: 0;
  }
  .consult-form {
    grid-template-columns: minmax(0, 1fr) 180px;
  }
  .consult-form .actions {
    grid-column: 1/-1;
  }
  .hero {
    grid-template-columns: minmax(0, 1fr) 200px;
  }
  .week-table td {
    padding: 12px;
  }
}
@media (max-width: 760px) {
  .topbar {
    position: static;
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .topbar-inner {
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
  }
  .brand {
    margin: 0;
    gap: 8px;
  }
  .brand img {
    width: 30px;
    height: 36px;
  }
  .brand strong {
    font-size: 19px;
  }
  .brand span {
    font-size: 10px;
  }
  .topbar nav {
    grid-column: 1/-1;
    grid-row: 2;
    flex-direction: row;
    gap: 6px;
  }
  .nav-link {
    flex: 1;
    justify-content: center;
    padding: 9px 8px;
    gap: 6px;
    font-size: 12px;
    min-height: 42px;
  }
  .nav-link svg {
    width: 16px;
  }
  .account {
    margin: 0;
    padding: 0;
    border: 0;
    grid-column: 2;
    grid-row: 1;
  }
  .account-person {
    display: none;
  }
  .account .link-button {
    font-size: 12px;
    padding: 8px;
    min-height: 40px;
  }
  .app-page main {
    margin: 0;
    padding: 0 16px 28px;
  }
  .context-bar {
    height: 48px;
    margin-bottom: 24px;
    font-size: 11px;
  }
  .context-bar span {
    gap: 6px;
  }
  h1 {
    font-size: 24px;
  }
  h2 {
    font-size: 18px;
  }
  .hero {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .hero .panel + .panel {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 20px 0 0;
  }
  .hero .panel p {
    margin-bottom: 12px;
  }
  .economic-total {
    font-size: 28px;
  }
  .economic-meter {
    max-width: 260px;
    display: block;
  }
  .schedule {
    gap: 8px;
    padding: 14px 8px;
  }
  .schedule-item {
    gap: 7px;
    justify-content: center;
  }
  .schedule-item svg {
    width: 20px;
    height: 20px;
  }
  .schedule-item span {
    font-size: 10px;
  }
  .schedule-item strong {
    font-size: 14px;
  }
  .form-grid,
  .toolbar,
  .consult-form {
    grid-template-columns: 1fr;
  }
  .toolbar .actions,
  .consult-form .actions {
    grid-column: auto;
  }
  .toolbar .button,
  .consult-form .button {
    width: 100%;
  }
  .toolbar .actions {
    display: block;
  }
  .stats {
    padding: 16px 0;
    row-gap: 20px;
  }
  .stat {
    padding: 0 12px;
  }
  .stat span {
    font-size: 11px;
  }
  .stat strong {
    font-size: 24px;
  }
  .panel {
    margin-bottom: 26px;
  }
  .page-heading p {
    font-size: 13px;
  }
  .section-heading label {
    width: 100%;
  }
  .app-footer {
    flex-direction: column;
    gap: 4px;
  }
  .login-box {
    padding: 28px 24px;
  }
  .login-title {
    font-size: 21px;
  }
}
@media (max-width: 760px) {
  .capture-records .table-wrap {
    border: 0;
    overflow: visible;
  }
  .week-table {
    display: block;
    min-width: 0;
  }
  .week-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .week-table tbody {
    display: grid;
    gap: 16px;
  }
  .week-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 14px;
    gap: 12px;
  }
  .capture-records .week-table td {
    display: block;
    border: 0;
    padding: 0;
    min-width: 0;
  }
  .week-table td:first-child {
    grid-column: 1/-1;
    width: auto;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
  }
  .week-table td:nth-child(n + 4) {
    grid-column: 1/-1;
  }
  .week-table td:before {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 5px;
  }
  .week-table td:nth-child(2):before {
    content: "Entrada";
  }
  .week-table td:nth-child(3):before {
    content: "Salida";
  }
  .week-table td:nth-child(4):before {
    content: "Tipo";
  }
  .week-table td:nth-child(5):before {
    content: "Observaciones";
  }
  .week-table td input,
  .week-table td select,
  .week-table td textarea {
    min-width: 0;
    width: 100%;
  }
  .week-table .button {
    width: 100%;
    min-height: 42px;
  }
  .week-table .day-name {
    display: inline-block;
    margin-right: 8px;
  }
  .week-table .day-date {
    display: inline-block;
  }
  .week-table .badge {
    margin-top: 5px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
