:root {
  color-scheme: light;
  font: 100%/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: #171e15;
  background: #f4f5f2;
  --primary: #456b1d;
  --brand: #6fa82b;
  --line: #e3e7de;
  --muted: #576150;
  --surface: #fff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.shell { width: min(100% - 2.5rem, 72rem); margin-inline: auto; }
header { background: #171e15; color: #fff; }
.top, .heading, .dialog-head, .actions, .date-controls {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
}
.top { min-height: 4.6rem; padding-block: .6rem; }
.brand { display: flex; align-items: center; gap: .85rem; }
.brand img { display: block; object-fit: contain; }
.brand small { padding-inline-start: .85rem; border-inline-start: 1px solid #596355; color: #dee8d8; font-size: .875rem; }
nav { display: flex; gap: .2rem; padding: .2rem; border-radius: .8rem; background: #2a3426; }
nav button { background: transparent; color: #e1e9dd; border-color: transparent; }
nav button:hover { background: #3a4934; }
nav button[aria-pressed="true"] { background: #edf5e4; color: #253d18; }
main { padding-block: 3rem; container-type: inline-size; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.8rem, 1.28rem + 2.6vw, 3rem); line-height: 1.08; letter-spacing: -.05em; }
.heading { margin-bottom: 1.55rem; }
button, input, select, textarea { font: inherit; }
button {
  min-height: 2.75rem; padding: .5rem .95rem; border: 1px solid var(--line); border-radius: .7rem;
  color: #304626; background: var(--surface); font-weight: 650; cursor: pointer;
}
button:hover { background: #f0f5ec; }
button:active { filter: brightness(.94); }
button:disabled { opacity: .65; cursor: wait; }
button.primary { color: #fff; background: var(--primary); border-color: var(--primary); }
button.primary:hover { background: #365717; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
nav :focus-visible { outline-color: #a5d573; }
.board, .agenda { display: grid; gap: .95rem; align-items: start; }
.board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.agenda { grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.column { --state: #48602c; --tint: #e9f1dd; min-width: 0; padding: .85rem; background: #ebeee8; border-radius: 1rem; }
.column.pending { --state: #784918; --tint: #f6ebda; }
.column.scheduled { --state: #274f72; --tint: #e3eef8; }
.column h2 { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: 1rem; margin: .25rem .2rem .8rem; }
.count { font-size: .85rem; color: var(--state); background: var(--tint); border-radius: 2rem; padding: .16rem .58rem; }
.card { display: grid; gap: .35rem; background: var(--surface); border: 1px solid var(--line); border-radius: .85rem; padding: .95rem; overflow-wrap: anywhere; }
.card + .card { margin-top: .65rem; }
.agenda .card { margin: 0; }
.card button { justify-self: start; margin-top: .4rem; background: #eef4e8; border-color: transparent; }
.card button:hover { background: #e1edd7; }
.reference { color: var(--primary); font-size: .82rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.card h3 { font-size: 1.12rem; line-height: 1.25; letter-spacing: -.02em; }
.machine, .meta, .empty { color: var(--muted); }
.meta { font-size: .9rem; }
.empty { padding: .3rem .2rem .55rem; grid-column: 1 / -1; }
.filters {
  display: grid; grid-template-columns: minmax(0, 16rem) minmax(0, 17rem); align-items: end;
  gap: .75rem; margin-bottom: 1rem; padding: .85rem; border: 1px solid var(--line);
  border-radius: 1rem; background: var(--surface);
}
.date-controls { align-items: end; }
.date-controls label { flex: 1; }
label { display: grid; min-width: 0; gap: .3rem; font-weight: 650; font-size: .91rem; }
input, select, textarea {
  width: 100%; min-width: 0; min-height: 2.75rem; border-radius: .65rem; border: 1px solid #d6ddd1;
  padding: .5rem .65rem; background: #f7f8f5; color: #171e15; font-size: 1rem;
}
textarea { resize: vertical; min-height: 5rem; }
dialog {
  width: min(calc(100% - 2rem), 37rem); max-height: calc(100dvh - 2rem); color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: 1.25rem; padding: 1.2rem;
  box-shadow: 0 1rem 4rem #141d1730; container-type: inline-size; overscroll-behavior: contain;
}
dialog::backdrop { background: #19201870; }
.dialog-head { margin-bottom: 1rem; }
.dialog-head h2 { font-size: 1.3rem; letter-spacing: -.025em; outline: none; }
form, .optional-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
form .wide { grid-column: 1 / -1; }
.actions { justify-content: flex-start; flex-wrap: wrap; }
form .actions { padding-top: .8rem; border-top: 1px solid var(--line); }
.required { color: var(--primary); }
.optional { border: 1px solid var(--line); padding: .7rem .8rem; border-radius: .7rem; }
.optional summary { cursor: pointer; color: #40553a; min-height: 1.5rem; font-weight: 650; }
.optional-fields { margin-top: .8rem; }
dt { font-size: .9rem; color: var(--muted); font-weight: 650; }
dd { margin: .15rem 0 .8rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.error, #notice { border-radius: .65rem; padding: .65rem .8rem; margin-bottom: 1rem; }
.error { background: #faeae6; color: #802b1c; }
#notice { background: #e7f0dc; color: #365419; }
@container (width < 46rem) {
  .board { grid-template-columns: 1fr; }
}
@container (width < 28rem) {
  form, .optional-fields, .filters, .actions { grid-template-columns: minmax(0, 1fr); }
  .actions { display: grid; gap: .55rem; }
}
@media (max-width: 38rem) {
  .shell { width: calc(100% - 1.5rem); }
  main { padding-block: 1.5rem; }
  .top { flex-wrap: wrap; gap: .5rem; }
  nav { flex: 1 0 100%; }
  nav button { flex: 1; }
  .heading { align-items: stretch; flex-direction: column; margin-bottom: 1rem; }
  .card-action { width: 100%; }
  dialog { width: 100%; max-width: none; max-height: calc(100dvh - .75rem); margin: auto 0 0; border-radius: 1.2rem 1.2rem 0 0; padding-bottom: max(1rem, env(safe-area-inset-bottom)); }
}


.login-page { background: #e4e8e0; color: #10160f; }
.login-shell {
  display: grid; grid-template-columns: 1.15fr 1fr; width: min(calc(100% - 3rem), 72rem);
  min-height: 42rem; margin-inline: auto; padding: .75rem;
  border-radius: 2rem; background: #fff; box-shadow: 0 40px 90px -40px #10160f73;
}
.login-page { display: grid; align-items: center; min-height: 100dvh; padding-block: 1.5rem; }
.login-brand {
  display: flex; flex-direction: column; justify-content: space-between; align-items: start;
  padding: 2.5rem; background: #3f6c60 url('/malla-acceso.svg') center bottom / cover no-repeat;
  color: white; border-radius: 1.5rem;
}
.login-brand img { display: block; object-fit: contain; }
.login-brand p { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 750; letter-spacing: -.045em; line-height: 1.1; }
.login-panel { place-self: center; width: min(100% - 3rem, 23.5rem); }
.login-mark { display: block; margin-bottom: 1rem; }
.login-panel h1 { font-size: clamp(1.65rem, 3vw, 2rem); letter-spacing: -.04em; }
.login-description { margin-top: .65rem; color: #576150; }
.login-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: .45rem; margin-top: 1.75rem; }
.login-field { display: flex; align-items: center; position: relative; margin-bottom: .55rem; }
.login-field > svg { position: absolute; inset-inline-start: .9rem; color: #576150; pointer-events: none; }
.login-field input { height: 3rem; border: 1px solid #e7ebe3; background: #f3f5f0; padding-inline: 2.75rem .75rem; }
.login-field input[name="password"] { padding-inline-end: 3rem; }
#password-toggle {
  display: grid; place-items: center; position: absolute; inset-inline-end: .2rem; top: 50%;
  transform: translateY(-50%); width: 2.75rem; padding: 0;
  background: transparent; border: 0; color: #576150;
}
.login-form button[type="submit"] { height: 3rem; background: #10160f; border-color: #10160f; box-shadow: 0 10px 18px -10px #10160f9e; }
.login-form button[type="submit"]:hover { background: #283724; }
.login-private { margin-top: 2.5rem; text-align: center; font-size: .82rem; color: #576150; }
@media (max-width: 56rem) {
  .login-page {
    display: block; padding: 0;
    background: linear-gradient(to top, #0e1e1c91, #0e1e1c18), #3f6c60 url('/malla-acceso.svg') center / cover no-repeat;
  }
  .login-shell {
    display: flex; flex-direction: column; justify-content: center; gap: 2rem;
    width: min(100% - 2.5rem, 26rem); min-height: 100dvh; padding: 2rem 0;
    background: transparent; border-radius: 0; box-shadow: none;
  }
  .login-brand { align-items: center; gap: 1rem; padding: 0; background: transparent; }
  .login-panel { width: 100%; color: white; }
  .login-mark { display: none; }
  .login-panel h1, .login-description { text-align: center; }
  .login-description, .login-private { color: white; }
  .login-field input, .login-form button[type="submit"] { height: 3.5rem; border-radius: 2rem; }
  .login-private { margin-top: 1.65rem; }
}
