/* Panel · Canto Litúrgico — mismo lenguaje visual que el sitio */
:root {
  --cream: #F4EFE6; --cream2: #EDE6D8; --white: #fff;
  --dark: #1A120A; --dark2: #231C13; --dk-card: #2D2318;
  --amber: #B8722A; --amber-lt: #CD8F47; --amber-d: #98591A;
  --text: #1C1610; --body: #3D3328; --muted: #6F6050;
  --line: rgba(184,114,42,.22); --line-soft: rgba(184,114,42,.12);
  --field: #D9CDB8; --danger: #A32D2D; --ok: #2F6B3F;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --ui: 'Lato', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: light; }
body { font-family: var(--ui); background: var(--cream); color: var(--text); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.boot { padding: 4rem 1rem; text-align: center; color: var(--muted); font-family: var(--serif); font-size: 1.3rem; font-style: italic; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* ─── Botones ─── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .62rem 1.15rem; border: 1px solid var(--text); background: var(--text); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; transition: background .2s, border-color .2s, color .2s; white-space: nowrap; }
.btn:hover { background: var(--amber-d); border-color: var(--amber-d); }
.btn-accent { background: var(--amber-d); border-color: var(--amber-d); }
.btn-accent:hover { background: var(--text); border-color: var(--text); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--field); }
.btn-ghost:hover { background: var(--cream2); color: var(--text); border-color: var(--amber); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #7e2020; border-color: #7e2020; }
.btn-sm { padding: .38rem .75rem; font-size: .66rem; letter-spacing: .1em; }
.btn[disabled] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn-icon { padding: .38rem .6rem; font-size: .85rem; letter-spacing: 0; }

/* ─── Login / pantallas completas ─── */
.center { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: radial-gradient(1200px 500px at 50% -10%, rgba(184,114,42,.14), transparent 70%), var(--cream); }
.auth-card { width: min(420px, 100%); background: var(--white); border: 1px solid var(--line); border-top: 2px solid var(--amber); padding: 2.4rem 2rem 2rem; box-shadow: 0 18px 40px rgba(28,16,10,.08); }
.orn { display: flex; align-items: center; justify-content: center; gap: .8rem; margin-bottom: 1rem; color: var(--amber); }
.orn i { display: block; width: 40px; height: 1px; background: var(--amber); opacity: .5; }
.auth-card h1 { font-family: var(--serif); font-weight: 500; font-size: 2rem; text-align: center; line-height: 1.1; }
.auth-card .sub { text-align: center; color: var(--muted); font-style: italic; font-family: var(--serif); font-size: 1.1rem; margin: .3rem 0 1.6rem; }
.auth-card .btn { width: 100%; margin-top: .6rem; padding: .8rem; }
.auth-card .field + .field { margin-top: 1rem; }
.auth-card form .field + .field, .auth-card .grid { margin-top: 0; }
.auth-card .form-error { margin-top: 1rem; }
.auth-card .btn { margin-top: 1.2rem; }
.auth-note { margin-top: 1.3rem; text-align: center; font-size: .8rem; color: var(--muted); }
.auth-note a { color: var(--amber-d); }

/* ─── Estructura ─── */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side { background: var(--dark); color: #F0E8DC; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 1.6rem 0 1rem; border-right: 1px solid var(--line); overflow-y: auto; }
.brand { padding: 0 1.5rem 1.4rem; border-bottom: 1px solid rgba(184,114,42,.2); margin-bottom: 1rem; }
.brand b { display: block; font-family: var(--serif); font-weight: 500; font-size: 1.35rem; letter-spacing: .04em; line-height: 1.1; }
.brand small { display: block; margin-top: .25rem; font-size: .6rem; letter-spacing: .3em; text-transform: uppercase; color: var(--amber-lt); }
.nav { display: flex; flex-direction: column; padding: 0 .7rem; gap: 2px; }
.nav .grp { font-size: .58rem; letter-spacing: .28em; text-transform: uppercase; color: rgba(240,232,220,.38); padding: 1rem .8rem .4rem; }
.nav button { display: flex; align-items: center; justify-content: space-between; gap: .6rem; width: 100%; text-align: left; padding: .62rem .8rem; background: none; border: 0; border-left: 2px solid transparent; color: rgba(240,232,220,.72); font-size: .88rem; transition: background .15s, color .15s; }
.nav button:hover { background: rgba(184,114,42,.1); color: #fff; }
.nav button[aria-current="page"] { background: rgba(184,114,42,.16); color: #fff; border-left-color: var(--amber-lt); }
.nav .count { font-size: .7rem; min-width: 1.5rem; text-align: center; padding: .05rem .4rem; border: 1px solid rgba(184,114,42,.4); color: var(--amber-lt); }
.nav .warn { color: #F2B65C; border-color: #F2B65C; }
.side-foot { margin-top: auto; padding: 1rem 1.5rem 0; display: flex; flex-direction: column; gap: .6rem; border-top: 1px solid rgba(184,114,42,.2); }
.side-foot a, .side-foot button { background: none; border: 0; padding: 0; text-align: left; color: rgba(240,232,220,.6); font-size: .82rem; text-decoration: none; }
.side-foot a:hover, .side-foot button:hover { color: var(--amber-lt); }
.side-foot .who { font-size: .72rem; color: rgba(240,232,220,.4); }

.main { min-width: 0; }
.bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 2.2rem 2.6rem 1.4rem; border-bottom: 1px solid var(--line-soft); }
.bar h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1.1; }
.bar p { color: var(--muted); margin-top: .3rem; max-width: 60ch; }
.content { padding: 1.6rem 2.6rem 4rem; max-width: 1000px; }

/* ─── Listas ─── */
.list { display: flex; flex-direction: column; gap: .7rem; }
.row { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; background: var(--white); border: 1px solid var(--line-soft); padding: .8rem 1rem; transition: border-color .2s, box-shadow .2s; }
.row:hover { border-color: var(--line); box-shadow: 0 6px 18px rgba(28,16,10,.06); }
.thumb { width: 64px; height: 64px; background: var(--cream2); border: 1px solid var(--line-soft); display: grid; place-items: center; overflow: hidden; color: var(--amber); font-family: var(--serif); font-size: 1.1rem; font-weight: 600; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.round { border-radius: 50%; }
.thumb.doc { font-family: var(--ui); font-size: .62rem; letter-spacing: .12em; font-weight: 700; }
.row-title { font-family: var(--serif); font-size: 1.28rem; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.row-sub { color: var(--muted); font-size: .86rem; overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .35rem; }
.tag { font-size: .6rem; letter-spacing: .13em; text-transform: uppercase; font-weight: 700; padding: .1rem .5rem; border: 1px solid var(--line); color: var(--amber-d); }
.tag.warn { color: #8A5A00; background: #FFF3D6; border-color: #E8C46E; }
.actions { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.empty { text-align: center; padding: 3.5rem 1rem; color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 1.25rem; background: var(--white); border: 1px dashed var(--field); }

/* ─── Tarjetas / formularios ─── */
.card { background: var(--white); border: 1px solid var(--line-soft); border-top: 2px solid var(--amber); padding: 1.6rem; }
.card + .card { margin-top: 1.2rem; }
.card h3 { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; margin-bottom: .2rem; }
.card .lead { color: var(--muted); margin-bottom: 1.2rem; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.2rem; }
.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.field.full, .grid > .field:not(.half) { grid-column: 1 / -1; }
.field > label, .field > .lbl { font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; color: var(--body); }
.req { color: var(--danger); margin-left: .15rem; }
.hint { font-size: .8rem; color: var(--muted); }
input[type=text], input[type=email], input[type=password], textarea, select { width: 100%; padding: .6rem .7rem; border: 1px solid var(--field); background: #FFFEFC; border-radius: 0; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; min-height: 5rem; line-height: 1.5; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(184,114,42,.16); }
.field.err input, .field.err textarea { border-color: var(--danger); }
.field .msg { color: var(--danger); font-size: .8rem; }
.choice { display: flex; flex-direction: column; gap: .45rem; }
.choice label { display: flex; align-items: center; gap: .55rem; text-transform: none; letter-spacing: 0; font-size: .92rem; font-weight: 400; cursor: pointer; padding: .55rem .7rem; border: 1px solid var(--field); background: #FFFEFC; }
.choice label:has(input:checked) { border-color: var(--amber); background: #FBF3E6; }
.choice input { accent-color: var(--amber-d); }
.social { display: grid; gap: .5rem; }
.social .s { display: grid; grid-template-columns: 5.2rem 1fr; align-items: center; gap: .6rem; font-size: .8rem; color: var(--muted); }

.media { display: grid; grid-template-columns: 84px 1fr; gap: .9rem; align-items: start; }
.media .thumb { width: 84px; height: 84px; }
.media .ctl { display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.media .btns { display: flex; gap: .5rem; flex-wrap: wrap; }

.form-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.4rem; align-items: center; flex-wrap: wrap; }
.form-error { flex: 1 1 100%; color: var(--danger); background: #FCEDED; border: 1px solid #E8B7B7; padding: .55rem .8rem; font-size: .88rem; white-space: pre-line; }
.notice { background: #FBF3E6; border: 1px solid var(--line); padding: .8rem 1rem; margin-bottom: 1.2rem; font-size: .9rem; color: var(--body); }

/* ─── Modales ─── */
dialog { border: 0; padding: 0; background: var(--white); color: var(--text); width: min(680px, 94vw); max-height: 92vh; margin: auto; box-shadow: 0 30px 80px rgba(0,0,0,.35); border-top: 2px solid var(--amber); overflow: hidden; }
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: rgba(20,12,5,.62); backdrop-filter: blur(2px); }
.m-head { padding: 1.3rem 1.6rem .9rem; border-bottom: 1px solid var(--line-soft); display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.m-head h3 { font-family: var(--serif); font-size: 1.6rem; font-weight: 500; line-height: 1.1; }
.m-body { padding: 1.3rem 1.6rem; overflow-y: auto; }
.m-foot { padding: 1rem 1.6rem 1.3rem; border-top: 1px solid var(--line-soft); display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; align-items: center; background: #FDFBF7; }
dialog.small { width: min(440px, 94vw); }
dialog.wide { width: min(820px, 94vw); }

.drop { border: 1px dashed var(--amber); background: #FBF3E6; padding: 1.3rem; text-align: center; color: var(--body); margin-bottom: 1.1rem; transition: background .2s; }
.drop.over { background: #F6E3C2; }
.drop .btn { margin-top: .6rem; }
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .7rem; }
.lib button { background: var(--white); border: 1px solid var(--line-soft); padding: 0; text-align: left; overflow: hidden; display: flex; flex-direction: column; }
.lib button:hover { border-color: var(--amber); box-shadow: 0 4px 14px rgba(28,16,10,.1); }
.lib .pic { aspect-ratio: 1; background: var(--cream2); }
.lib img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib span { padding: .35rem .5rem; font-size: .72rem; color: var(--muted); overflow-wrap: anywhere; line-height: 1.3; }
.lib.docs { grid-template-columns: 1fr; }
.lib.docs button { flex-direction: row; align-items: center; justify-content: space-between; padding: .6rem .8rem; gap: 1rem; }
.lib.docs span { padding: 0; font-size: .88rem; color: var(--text); }
.lib.docs small { color: var(--muted); white-space: nowrap; }
.lib-title { font-size: .62rem; letter-spacing: .22em; text-transform: uppercase; font-weight: 700; color: var(--amber-d); margin: 1rem 0 .5rem; }

/* ─── Fecha de inicio, contraseñas, usuarios ─── */
.choice.inline { flex-direction: row; flex-wrap: wrap; }
.choice.inline label { flex: 1 1 10rem; }
.start { display: flex; flex-direction: column; gap: .6rem; }
input[type=date] { width: 100%; padding: .6rem .7rem; border: 1px solid var(--field); background: #FFFEFC; border-radius: 0; font: inherit; }
input[type=date]:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(184,114,42,.16); }
.inline-ctl { display: flex; gap: .5rem; align-items: stretch; }
.inline-ctl input { flex: 1; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: .04em; }
.creds { background: var(--cream2); border: 1px solid var(--line); padding: .9rem 1rem; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .85rem; white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: .8rem; user-select: all; }

/* ─── Copias ─── */
table { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--line-soft); }
th, td { padding: .7rem 1rem; text-align: left; border-bottom: 1px solid var(--line-soft); font-size: .9rem; }
th { font-size: .62rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); background: #FDFBF7; }
td.r { text-align: right; }

/* ─── Aviso flotante ─── */
.toasts { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: .5rem; align-items: center; pointer-events: none; width: min(92vw, 520px); }
.toast { pointer-events: auto; background: var(--dark); color: #F0E8DC; padding: .75rem 1.2rem; border-left: 3px solid var(--amber-lt); box-shadow: 0 10px 30px rgba(0,0,0,.3); font-size: .9rem; animation: up .25s ease-out; white-space: pre-line; }
.toast.bad { border-left-color: #E56B6B; background: #3A1414; }
@keyframes up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ─── Móvil ─── */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; padding: 1rem 0 0; flex-direction: column; }
  .brand { padding: 0 1rem .8rem; margin-bottom: .4rem; border: 0; }
  .nav { flex-direction: row; overflow-x: auto; padding: 0 .6rem; gap: .2rem; -webkit-overflow-scrolling: touch; }
  .nav .grp { display: none; }
  .nav button { width: auto; white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; }
  .nav button[aria-current="page"] { border-bottom-color: var(--amber-lt); }
  .side-foot { flex-direction: row; align-items: center; justify-content: space-between; margin-top: .4rem; padding: .7rem 1rem; }
  .side-foot .who { display: none; }
  .bar { padding: 1.5rem 1rem 1rem; }
  .content { padding: 1.2rem 1rem 3rem; }
  .row { grid-template-columns: auto 1fr; }
  .row .actions { grid-column: 1 / -1; justify-content: flex-start; }
  .grid { grid-template-columns: 1fr; }
  .media { grid-template-columns: 1fr; }
  .m-head, .m-body, .m-foot { padding-left: 1.1rem; padding-right: 1.1rem; }
  table, thead, tbody, tr, th, td { display: block; }
  thead { display: none; }
  td.r { text-align: left; }
}

.card.sep{margin-top:1.2rem}
.auth-note a{cursor:pointer}
.auth-card h1 + .notice{margin-top:1.2rem}
