:root {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #182a3d;
  background: #eef3f7;
  font-size: 16px;
  line-height: 1.5;
  --line: #dce5ee;
  --muted: #52677b;
  --navy: #153757;
  --accent: #115a75;
  --accent-light: #e9f5f8;
  --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); line-height: 1.12; letter-spacing: -.045em; }
h2 { font-size: 1.14rem; line-height: 1.35; letter-spacing: -.02em; }
h3 { font-size: 1rem; }
h1 + p, h2 + p { margin-top: .35rem; }
input, select, textarea, button { font: inherit; color: inherit; }
input:not([type=checkbox]):not([type=hidden]), select, textarea {
  border: 1px solid #becdd9; border-radius: 7px; background: white; padding: .55rem .7rem;
  width: 100%; min-width: 0; min-height: 44px;
}
input[type=file] { padding-block: .55rem; }
textarea { resize: vertical; }
input[type=checkbox] { width: 19px; height: 19px; margin: 0 .4rem 0 0; accent-color: var(--accent); flex: none; }
label { font-size: .9rem; font-weight: 600; display: block; min-width: 0; }
label > input:not([type=checkbox]), label > select, label > textarea,
.stack > div > input, .stack > div > select, .stack > div > textarea { margin-top: .26rem; }
::placeholder { color: #677b8e; }
:focus-visible { outline: 3px solid #2983ac; outline-offset: 3px; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; border: 1px solid #c5d3de;
  border-radius: 8px; background: #fff; color: var(--navy); padding: .52rem .82rem; min-height: 44px;
  font-size: .9rem; line-height: 1.22; font-weight: 650; cursor: pointer; text-decoration: none; text-align: center;
}
button:hover, .button:hover { background: #eff5fa; }
.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.primary:hover { background: #225476; color: #fff; }
button:disabled { opacity: .55; cursor: default; }
.plain { border: 0; background: transparent; color: var(--accent); padding-inline: 0; }
small, .muted, .helptext { color: var(--muted); }
small, .helptext { font-size: .8rem; }
.helptext ul { padding-left: 1.15rem; }
[hidden] { display: none !important; }
.skip { position: fixed; z-index: 5; top: -5rem; left: 1rem; padding: .65rem; background: white; }
.skip:focus { top: 1rem; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 205px minmax(0, 1fr); }
.sidebar {
  background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column;
  padding: 1.65rem 1.05rem; gap: 2rem; position: sticky; top: 0; height: 100svh;
}
.brand { display: inline-flex; align-items: center; gap: .6rem; color: #17344f; font-size: 1.18rem; font-weight: 750; text-decoration: none; letter-spacing: -.035em; }
.brand-mark { position: relative; display: inline-block; width: 28px; height: 30px; border-radius: 7px; background: #174c67; flex: none; }
.brand-mark::before { content: ""; position: absolute; inset: 8px 7px; border-top: 2px solid #e0eff3; border-bottom: 2px solid #e0eff3; }
.brand-mark::after { content: ""; position: absolute; left: 7px; right: 11px; top: 14px; border-top: 2px solid #e0eff3; }
.sidebar nav { display: grid; gap: .25rem; }
.sidebar nav a, .tabs a { border-radius: 7px; color: #42586e; font-size: .94rem; text-decoration: none; font-weight: 600; padding: .58rem .66rem; white-space: nowrap; }
.sidebar nav a:hover, .tabs a:hover { background: #f2f6f9; }
.sidebar nav a[aria-current], .tabs a[aria-current] { color: #104d66; background: var(--accent-light); }
.sidebar-footer { margin-top: auto; padding: .55rem .65rem 0; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.sidebar-footer > a { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; }
.app-shell main { width: 100%; max-width: 1330px; padding: clamp(1rem, 3.8vw, 3.5rem); margin: 0 auto; min-width: 0; }
.head { margin-bottom: 1.45rem; }
.head .back { display: inline-block; margin-bottom: .5rem; font-size: .9rem; }
.head p { margin-top: .45rem; }
.overline { color: #3a6176; font-size: .83rem; margin: 0 0 .45rem !important; font-weight: 650; }
.between, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.between { justify-content: space-between; gap: .85rem; }
.compact { margin-bottom: .85rem; }
.between > * { min-width: 0; }
.stack { display: grid; gap: .8rem; align-content: start; }
.stack > button { justify-self: start; }
.stack > div > label { display: block; }
.panel {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(.8rem, 2vw, 1.35rem); min-width: 0;
}
.panel + .panel, .review-group + .review-group { margin-top: .9rem; }
.narrow { max-width: 650px; }
.numbers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-bottom: .95rem; }
.metric { display: grid; align-content: start; gap: .25rem; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem 1rem; color: inherit; text-decoration: none; }
a.metric:hover { border-color: #86acba; }
.metric > span { color: #4c647a; font-size: .87rem; font-weight: 650; }
.metric strong { color: #173c57; font-size: 2rem; font-weight: 700; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.dashboard, .day-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: .95rem; align-items: start; }
.dashboard { margin-bottom: .95rem; }
.day-layout { grid-template-columns: minmax(275px, .95fr) minmax(0, 1.23fr); }
.image-layout { grid-template-columns: minmax(0, 1.15fr) minmax(280px, .9fr); }
.category-row { display: grid; grid-template-columns: minmax(116px, 1fr) minmax(40px, 2fr) 2rem 3.5rem; align-items: center; gap: .5rem; padding-block: .5rem; font-size: .87rem; }
.category-row strong, .category-row > span:last-child { text-align: right; }
.category-name { display: flex; gap: .45rem; align-items: center; }
.category-name i { border-radius: 50%; display: inline-block; width: 9px; height: 9px; flex: none; background: var(--tag-ink, #586e83); }
.papa { --tag-bg: #e4f0f9; --tag-ink: #215d89; }
.mama { --tag-bg: #efe9fa; --tag-ink: #624989; }
.compartida, .done, .success { --tag-bg: #e5f3ed; --tag-ink: #2c6e55; }
.sin_determinar, .queued { --tag-bg: #f1f3f6; --tag-ink: #56687b; }
.running { --tag-bg: #f5efdf; --tag-ink: #6c500f; }
.error { --tag-bg: #ffefed; --tag-ink: #a23531; }
.tag { display: inline-flex; align-items: center; line-height: 1.25; border-radius: 5px; padding: .24rem .45rem; background: var(--tag-bg, #edf2f6); color: var(--tag-ink, #495e73); font-size: .81rem; font-weight: 650; }
progress { width: 100%; height: .5rem; border: 0; border-radius: 99px; accent-color: var(--tag-ink, #287d95); background: #edf2f6; }
progress::-webkit-progress-bar { background: #edf2f6; border-radius: 99px; }
progress::-webkit-progress-value { background: var(--tag-ink, #287d95); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--tag-ink, #287d95); border-radius: 99px; }
.line-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .45rem .8rem; min-height: 44px; padding: .6rem 0; border-bottom: 1px solid #edf1f5; text-decoration: none; overflow-wrap: anywhere; }
.line-item:last-child { border-bottom: 0; }
a.line-item { color: inherit; }
a.line-item:hover strong, a.line-item:hover > span:first-child { text-decoration: underline; }
.empty { color: var(--muted); margin-block: .6rem .15rem; }
.filter { display: flex; flex-wrap: wrap; gap: .65rem .8rem; align-items: end; margin: .85rem 0; }
.filter label { flex: 0 1 auto; }
.filter input, .filter select { min-width: 132px !important; }
.filter input[type=checkbox] { min-width: initial !important; }
.bulk { margin-top: .8rem; }
.check { display: flex; align-items: center; gap: .35rem; min-height: 42px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .8rem; }
.month { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 5px; }
.weekday { text-align: center; font-size: .83rem; font-weight: 650; color: var(--muted); padding: .2rem 0; }
.tile { display: flex; align-items: start; flex-direction: column; gap: .12rem; min-height: 80px; padding: .4rem .5rem; text-decoration: none; background: var(--tag-bg, #f5f8fa); color: var(--tag-ink, #53687d); border: 1px solid #e3eaf1; border-radius: 8px; overflow-wrap: anywhere; }
.tile strong { color: #19364f; font-size: .99rem; }
.tile > span { font-size: .77rem; }
.tile:hover { outline: 1px solid #6391a7; }
.tile.blank { background: #f8fafb; border-color: #f2f4f6; color: #677786; }
.tile.blank:hover { outline: none; }
.drop {
  display: grid; justify-items: center; gap: .2rem; min-height: 180px; align-content: center; text-align: center;
  border: 1.5px dashed #88afbe; border-radius: 10px; background: #f3f9fb; color: var(--accent); cursor: pointer; padding: .9rem;
}
.drop:has(+ input:focus-visible), .drop.is-dragging { outline: 3px solid #6db4c2; }
.drop strong { font-size: 1.05rem; }
.drop-icon { display: grid; place-items: center; border-radius: 8px; width: 38px; height: 37px; margin-bottom: .25rem; font-size: 1.55rem; line-height: 1; background: #dceef3; }
.upload-queue { margin: 0; padding: 0; list-style: none; }
.upload-queue li { display: grid; grid-template-columns: minmax(130px, 2fr) minmax(90px, 1fr) minmax(100px, 1.3fr) auto; align-items: center; gap: .4rem .7rem; padding-block: .45rem; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.table-scroll { overflow: auto; }
table { border-collapse: collapse; text-align: left; width: 100%; }
th, td { padding: .61rem .63rem; font-size: .89rem; border-bottom: 1px solid #e8eef3; }
th { font-weight: 650; background: #f1f5f8; }
td { vertical-align: top; }
.error-text { color: #9f2d29; }
.alert { padding: .65rem .8rem; margin-bottom: .85rem; border-radius: 8px; background: var(--tag-bg, #e9f5f8); color: var(--tag-ink, #1a576d); border: 1px solid #dbe5eb; }
.errorlist { color: #9e3027; margin: .3rem 0; padding-left: 1.2rem; font-size: .9rem; }
details { min-width: 0; }
summary { cursor: pointer; font-weight: 600; }
details[open] summary { margin-bottom: .6rem; }
.tabs { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .75rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill,minmax(188px,1fr)); gap: .75rem; margin-top: .5rem; }
.gallery.inside { grid-template-columns: repeat(auto-fill,minmax(140px,1fr)); }
.evidence { display: grid; align-content: start; gap: .37rem; min-width: 0; }
.evidence.panel { padding: .55rem; }
.evidence a { display: grid; gap: .32rem; text-decoration: none; overflow-wrap: anywhere; }
.evidence a:hover { text-decoration: underline; }
.evidence img { width: 100%; aspect-ratio: 4/3; object-fit: contain; border-radius: 7px; background: #edf2f6; }
.evidence .actions { gap: .35rem; }
.evidence .actions button { min-height: 36px; padding: .3rem .5rem; }
.select-evidence { display: flex; align-items: center; min-height: 34px; }
.media-panel img { width: 100%; max-height: 570px; object-fit: contain; background: #f0f4f7; border-radius: 7px; }
.metadata dt { font-size: .82rem; font-weight: 650; color: var(--muted); }
.metadata dd { margin: .1rem 0 .58rem; overflow-wrap: anywhere; }
.audit-row { padding-block: .65rem; border-bottom: 1px solid #edf1f5; }
.audit-row summary > span { margin-inline: .25rem; overflow-wrap: anywhere; }
.pager { margin-top: .85rem; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 1.25rem; background: radial-gradient(circle at 20% 0%, #e2f1f3 0, #eef3f7 53%); }
.auth-shell main { width: min(100%, 418px); }
.auth-card { background: #fff; padding: clamp(1.2rem, 5vw, 2.1rem); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 16px 45px #1537570e; }
.auth-card h1 { font-size: 2rem; margin: 1.15rem 0 .95rem; }
.auth-card .stack { gap: .42rem; }
.auth-card input { margin-bottom: .5rem; }
.auth-card button { margin-top: .3rem; justify-self: stretch; }
.auth-link { display: block; margin-top: .9rem; font-size: .89rem; }
@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 172px minmax(0, 1fr); }
  .sidebar { padding-inline: .7rem; }
  .app-shell main { padding: 1.4rem; }
  .dashboard, .day-layout { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar { position: static; padding: .65rem .85rem .3rem; gap: .3rem; height: auto; border: 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; }
  .sidebar .brand { grid-column: 1; grid-row: 1; }
  .sidebar nav { grid-column: 1 / -1; grid-row: 2; display: flex; overflow-x: auto; padding: .25rem 0; gap: .12rem; }
  .sidebar nav a { padding: .48rem .55rem; font-size: .87rem; }
  .sidebar-footer { grid-column: 2; grid-row: 1; border: 0; padding: 0; margin: 0; }
  .app-shell main { padding: 1rem .8rem; }
  .numbers { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .5rem; }
  .metric { padding: .68rem; }
  .metric strong { font-size: 1.7rem; }
  .tile { min-height: 59px; padding: .3rem .21rem; border-radius: 5px; line-height: 1.12; }
  .tile > span { font-size: .62rem; }
  .tile > small { font-size: .62rem; }
  .month { gap: 3px; }
  .weekday { font-size: .74rem; }
  .upload-queue li { grid-template-columns: minmax(0,1fr) auto; }
  .gallery { grid-template-columns: repeat(auto-fill,minmax(135px,1fr)); }
}
@media (max-width: 420px) {
  .form-grid { grid-template-columns: minmax(0,1fr); }
  .calendar-panel .between button, .calendar-panel .between .button { padding-inline: .45rem; }
  .calendar-panel { padding-inline: .55rem; }
  .tag { font-size: .76rem; }
}
