:root {
color-scheme: light;
--bg: #f0f4f8; --card: #fff; --ink: #1f2937; --mut: #6b7280; --line: #e5e7eb;
--navy: #3a4556; --red: #C8102E; --acc: #3b82f6; --green: #15803d;
/* tokens que usan las páginas portadas desde Claude */
--color-bg: var(--bg); --color-panel: var(--card); --color-fg: var(--ink); --color-fg-muted: var(--mut);
--color-border-line: var(--line); --color-ok: var(--green); --color-warn: #b45309; --color-bad: var(--red);
--font-anthropic-sans: Inter, system-ui, sans-serif; --font-anthropic-serif: Inter, system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 13px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; min-height: 100vh; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
/* Logo GILERA (reemplaza la "G") */
.mark { flex: none; width: 36px; height: 36px; border-radius: 50%; background: url(../img/gilera-logo.png) center / contain no-repeat; color: transparent; font-size: 0; overflow: hidden; }

/* Login */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { width: min(380px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 26px 24px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 30px rgba(15,23,42,.06); }
.auth-brand { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.auth-brand .mark { width: 44px; height: 44px; }
.auth-brand b { display: block; font-size: 16px; font-weight: 800; }
.auth-brand small { color: var(--mut); }

/* Shell */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.shell.mini { grid-template-columns: 64px minmax(0, 1fr); }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.side-h { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px; border-bottom: 1px solid var(--line); }
.brand { min-width: 0; flex: 1; }
.brand h1 { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: -.2px; }
.brand p { margin: 0; font-size: 11px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-f { margin-top: auto; padding: 12px 14px; border-top: 1px solid var(--line); }
.icon-btn { flex: none; border: 1px solid var(--line); background: #f8fafc; border-radius: 6px; width: 28px; height: 28px; display: grid; place-items: center; cursor: pointer; color: var(--mut); }
.icon-btn:hover { color: var(--ink); background: #eef2f7; }
.search { position: relative; padding: 12px 14px 6px; }
.search input { width: 100%; border: 1px solid #d1d5db; border-radius: 8px; padding: 8px 10px 8px 32px; background: #f8fafc; }
.search input:focus { background: #fff; border-color: var(--acc); outline: none; box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.search svg { position: absolute; left: 25px; top: calc(50% + 3px); transform: translateY(-50%); color: var(--mut); }
.nav { padding: 6px 8px 20px; display: flex; flex-direction: column; gap: 2px; }
.nav-i { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-weight: 600; }
.nav-i:hover { background: #f1f5f9; }
.nav-i[aria-current=true] { background: #eef2f7; }
.nav-i .dot { flex: none; width: 9px; height: 9px; border-radius: 3px; background: var(--ac, var(--navy)); }
.nav-i .lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-i .n, .nav-s .n { font-weight: 500; color: var(--mut); font-variant-numeric: tabular-nums; font-size: 12px; }
.nav-i .chev { flex: none; width: 10px; margin-left: -2px; text-align: center; font-size: 11px; line-height: 1; color: var(--mut); transition: transform .15s ease; }
.nav-g[data-open=true] > .nav-i .chev { transform: rotate(90deg); }
.nav-sub { display: none; flex-direction: column; margin: 0 0 6px 18px; border-left: 1px solid var(--line); }
.nav-g[data-open=true] .nav-sub { display: flex; }
.nav-s { display: flex; gap: 6px; width: 100%; border: 0; background: none; text-align: left; padding: 6px 10px 6px 12px; font-size: 12.5px; font-weight: 600; color: #374151; cursor: pointer; border-radius: 0 6px 6px 0; }
.nav-s:hover { background: #f1f5f9; }
.nav-s[aria-current=true] { background: #eef2f7; color: var(--ink); }
.nav-s .lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.shell.mini .side .brand, .shell.mini .side .search, .shell.mini .side .nav-i .lbl, .shell.mini .side .nav-i .n, .shell.mini .side .nav-i .chev, .shell.mini .side .nav-sub, .shell.mini .side .side-f { display: none !important; }
.shell.mini .side-h { flex-direction: column; padding: 12px 8px; }
.shell.mini .nav-i { justify-content: center; padding: 10px 0; }
.main { min-width: 0; }
.bar { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 24px; background: #fff; border-bottom: 1px solid var(--line); }
.bar h2 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.2px; }
.bar .cnt { color: var(--mut); }
.bar .sp { flex: 1; }
.menu-btn { display: none; }
.btn { font-weight: 600; font-size: 12px; border: 1px solid #d1d5db; background: #f8fafc; border-radius: 6px; padding: 7px 12px; cursor: pointer; }
.btn:hover { background: #f1f5f9; }
.btn.pri { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.pri:hover { background: #2e3746; }
.btn.ghost { background: none; border-color: transparent; color: var(--mut); padding-left: 0; }
.btn.wide { width: 100%; padding: 10px; font-size: 13px; }
.btn:disabled { opacity: .6; cursor: default; }
.btn.btn-danger { color: #b42318; border-color: #f3c4bf; }
.btn.btn-danger:hover:not(:disabled) { background: #fef3f2; }
.btn.exp { display: inline-flex; align-items: center; gap: 6px; background: var(--acc); border-color: var(--acc); color: #fff; padding: 5px 11px; }
.btn.exp:hover:not(:disabled) { background: #2563eb; border-color: #2563eb; }
.btn.exp:disabled { opacity: .7; cursor: progress; }
.scrim { display: none; }
@media (max-width: 860px) {
.shell, .shell.mini { grid-template-columns: minmax(0, 1fr); }
.side { position: fixed; z-index: 30; left: 0; top: 0; bottom: 0; width: min(284px, 86vw); height: auto; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 10px 40px rgba(15,23,42,.2); }
.shell.open .side { transform: none; }
.shell.open .scrim { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(15,23,42,.3); }
.menu-btn { display: grid; }
#collapse { display: none; }
}
.wrap { max-width: 1400px; margin: 0 auto; padding: 22px 24px 48px; }
.area { margin-bottom: 30px; }
.area-h { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; }
.area-h::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--ac, var(--navy)); align-self: center; }
.area-h h2 { margin: 0; font-size: 17px; font-weight: 700; }
.area-h span { color: var(--mut); font-variant-numeric: tabular-nums; }
.subsec { margin-bottom: 18px; }
.sub-h { margin: 0 0 8px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: #475569; display: flex; gap: 8px; }
.sub-h span { font-weight: 500; color: var(--mut); text-transform: none; letter-spacing: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); gap: 10px; }
.tile { position: relative; background: var(--card); border-radius: 8px; border: 1px solid var(--line); border-left: 3px solid var(--ac, var(--navy)); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; text-align: left; cursor: pointer; }
.tile:hover { border-color: #cbd5e1; border-left-color: var(--ac, var(--navy)); box-shadow: 0 6px 18px rgba(15,23,42,.07); }
.tile.off { cursor: default; opacity: .65; }
.tile.off:hover { box-shadow: none; }
.tile h3 { margin: 0; font-size: 13.5px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.tile p { margin: 0; color: var(--mut); font-size: 12px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { margin-top: auto; padding-top: 2px; display: flex; gap: 6px; flex-wrap: wrap; font-size: 11px; color: var(--mut); }
.meta:empty { display: none; }
.pill { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 600; background: #f1f5f9; color: #475569; }
.pill.mig { background: #fef3c7; color: #92400e; }
.pill.f-diaria { background: #dcfce7; color: #15803d; } .pill.f-semanal { background: #dbeafe; color: #1d4ed8; }
.pill.f-mensual { background: #e2e8f0; color: #475569; } .pill.f-manual { background: #fef3c7; color: #b45309; }
.empty { background: #fff; border: 1px dashed #cbd5e1; border-radius: 10px; padding: 28px; text-align: center; color: var(--mut); }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }
#dash { min-height: calc(100vh - 60px); }
#dash .loading { padding: 40px; text-align: center; color: var(--mut); }
@media (max-width: 700px) {
.bar, .wrap { padding-left: 16px; padding-right: 16px; }
.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}

/* Diálogos */
dialog { border: 0; border-radius: 12px; padding: 0; width: min(620px, calc(100vw - 32px)); box-shadow: 0 20px 50px rgba(15,23,42,.25); background: #fff; color: var(--ink); }
dialog.wide { width: min(980px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(15,23,42,.35); }
.dlg { padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; }
.dlg h2 { margin: 0 0 4px; font-size: 17px; }
.fld { display: flex; flex-direction: column; gap: 4px; }
.fld label { font-size: 11px; font-weight: 600; color: var(--mut); }
.fld input { border: 1px solid #d1d5db; border-radius: 6px; padding: 8px 10px; background: #fff; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0; }
@media (max-width: 600px) { .row2 { grid-template-columns: 1fr; } }
.chk { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.err { color: var(--red); font-size: 12px; min-height: 1em; }
.hint { font-size: 11.5px; color: var(--mut); margin: 0; }
.usr-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; max-height: 46vh; overflow-y: auto; }
.usr { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.usr:last-child { border-bottom: 0; }
.usr .who { flex: 1; min-width: 180px; }
.usr .who b { display: block; font-size: 13px; }
.usr .who small { color: var(--mut); }
.usr .acts2 { display: flex; gap: 6px; flex-wrap: wrap; }
.usr .acts2 .btn { padding: 4px 9px; font-size: 11.5px; }
.usr.inact { opacity: .55; }
.new-usr summary { list-style: none; display: inline-block; }
.new-usr summary::-webkit-details-marker { display: none; }
.new-usr[open] { border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.pass { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 10px 12px; font-size: 12.5px; }
.pass code { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 14px; font-weight: 600; user-select: all; }
.dlist { display: flex; flex-direction: column; gap: 2px; max-height: 52vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.dlist .grp { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--mut); margin: 8px 0 2px; }
.dlist .grp:first-child { margin-top: 0; }
.dlist label { display: flex; gap: 8px; align-items: center; padding: 2px 0; cursor: pointer; }
.p-nota { margin: -4px 0 0; align-self: flex-start; font-size: 11.5px; color: #1d4ed8; background: #eff6ff; border: 1px solid #dbeafe; border-radius: 999px; padding: 2px 10px; }
.pwrap { max-height: 56vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.ptab { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.ptab th, .ptab td { padding: 6px 12px; text-align: left; }
.ptab .c { text-align: center; width: 112px; white-space: nowrap; }
.ptab thead th { position: sticky; top: 0; z-index: 2; background: #f8fafc; color: var(--mut); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; border-bottom: 1px solid var(--line); padding-top: 8px; padding-bottom: 8px; }
.ptab .p-grp th, .ptab .p-grp td { background: #fff; border-top: 1px solid var(--line); padding-top: 10px; padding-bottom: 4px; }
.ptab tbody:first-of-type .p-grp th, .ptab tbody:first-of-type .p-grp td { border-top: 0; }
.ptab .p-grp th { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: #374151; }
.ptab .p-grp th::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--ac, var(--navy)); margin-right: 7px; }
.ptab .p-todos { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; color: var(--mut); cursor: pointer; }
.ptab .p-row td { border-top: 1px solid #f1f5f9; }
.ptab .p-row:hover td { background: #f8fafc; }
.ptab .p-n { overflow-wrap: anywhere; }
.ptab .p-n .pill { margin-left: 6px; }
.ptab input[type=checkbox] { accent-color: var(--acc); width: 15px; height: 15px; margin: 0; cursor: pointer; vertical-align: middle; }
.ptab input[type=checkbox]:disabled { cursor: not-allowed; opacity: .4; }
.logw { max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.logt { width: 100%; border-collapse: collapse; font-size: 12px; }
.logt th { position: sticky; top: 0; background: var(--navy); color: #fff; text-align: left; padding: 7px 9px; font-weight: 600; }
.logt td { padding: 6px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.logt td.bad { color: var(--red); font-weight: 600; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1f2937; color: #fff; font-size: 12.5px; padding: 9px 14px; border-radius: 8px; box-shadow: 0 8px 24px rgba(15,23,42,.25); max-width: calc(100vw - 32px); }
