/* ==========================================================================
   Mediateka — panel de gestión
   ========================================================================== */
body.adm { padding-top: 0; background: #f3f3f1; font-weight: 400; font-size: 15px; }
.adm a { color: inherit; }
.adm a:hover { text-decoration: underline; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mute { color: #777; font-weight: 400; }
.warn { color: #a3470b; }
.hint { color: #666; font-size: 13px; margin: 8px 0; }
.nowrap { white-space: nowrap; }
code { background: #eee; padding: 1px 5px; border-radius: 3px; font-size: 13px; }

.adm-top {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 28px;
    padding: 0 24px; height: 60px; background: #fff; border-bottom: 1px solid #e2e2e2;
}
.adm-brand { display: flex; align-items: center; gap: 10px; }
.adm-brand span { font-size: 12px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: #777; }
.adm-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.adm-nav a { padding: 8px 12px; border-radius: 18px; font-size: 14px; font-weight: 500; }
.adm-nav a:hover { background: #f0f0f0; text-decoration: none; }
.adm-nav a[aria-current] { background: #000; color: #fff; }
.adm-user { margin-left: auto; display: flex; gap: 16px; font-size: 13px; color: #555; }
@media (max-width: 900px) { .adm-top { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 10px; } .adm-user { margin-left: 0; } }

.adm-main { padding: 24px; max-width: 1400px; margin: 0 auto; }
.adm-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 6px 0 16px; flex-wrap: wrap; }
.adm-head h1 { font-size: 22px; font-weight: 600; }
.adm-head h1 small, h2 small { font-size: 14px; color: #888; font-weight: 400; margin-left: 6px; }
.adm h2 { font-size: 15px; font-weight: 600; margin: 4px 0 12px; }

.msg { padding: 10px 14px; border-radius: 6px; margin-bottom: 10px; font-size: 14px; }
.msg-ok { background: #e6f4e8; color: #1d5b29; }
.msg-warn { background: #fff4e0; color: #7a4a07; }
.msg-error { background: #fde8e8; color: #8a1c1c; }

.btn {
    display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: 18px;
    border: 1px solid #000; background: #fff; color: #000; font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none !important;
}
.btn:hover { background: #f0f0f0; }
.btn-dark { background: #000; color: #fff; }
.btn-dark:hover { background: #333; }
.btn-danger { border-color: #b42318; color: #b42318; }
.btn-danger:hover { background: #fde8e8; }
.btn[disabled] { opacity: .4; cursor: default; }
.link { border: 0; background: none; padding: 0; text-decoration: underline; font-size: inherit; cursor: pointer; }

.card-box { background: #fff; border: 1px solid #e4e4e0; border-radius: 10px; padding: 18px 20px; margin-bottom: 16px; }
.card-box.narrow { max-width: 760px; }
.adm label { display: block; font-size: 13px; font-weight: 600; color: #333; margin-bottom: 12px; }
.adm input:not([type=checkbox]):not([type=file]), .adm textarea, .adm select {
    display: block; width: 100%; margin-top: 5px; padding: 8px 10px; border: 1px solid #c9c9c5; border-radius: 6px;
    font-size: 14px; font-weight: 400; background: #fff;
}
.adm textarea { resize: vertical; line-height: 1.5; }
.adm label.check { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; font-size: 14px; }
.adm label.check input { margin-top: 3px; accent-color: #000; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.list { list-style: disc; padding-left: 20px; line-height: 1.7; }
hr { border: 0; border-top: 1px solid #eee; margin: 18px 0; }
.summary { margin-bottom: 12px; }

.toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.toolbar input { flex: 1; margin: 0 !important; }
.toolbar select { width: auto !important; margin: 0 !important; }

.tbl { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e4e4e0; border-radius: 10px; overflow: hidden; font-size: 14px; }
.tbl th, .tbl td { padding: 8px 10px; border-bottom: 1px solid #eee; text-align: left; vertical-align: middle; }
.tbl th { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #777; background: #fafafa; }
.tbl-thumb img { width: 96px; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; }
.row-warn { background: #fff8ee; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; margin-right: 4px; white-space: nowrap; }
.tag-pub { background: #e6f4e8; color: #1d5b29; }
.tag-hid { background: #eef0f7; color: #33407a; }
.tag-priv { background: #fde8e8; color: #8a1c1c; }
.pager { display: flex; flex-wrap: wrap; gap: 4px; margin: 16px 0; }
.pager a { padding: 4px 10px; border-radius: 14px; background: #fff; border: 1px solid #ddd; font-size: 13px; }
.pager a[aria-current] { background: #000; color: #fff; border-color: #000; }

.vform { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 980px) { .vform { grid-template-columns: 1fr; } }
.vform-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; margin-bottom: 14px; }
.vform details { margin: -4px 0 12px; font-size: 13px; }
.vform summary { cursor: pointer; color: #555; margin-bottom: 8px; }
.pl-checks { max-height: 280px; overflow-y: auto; margin-top: 8px; }
.pl-checks label { margin-bottom: 4px !important; }
.ltabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid #eee; }
.ltabs button { border: 0; background: none; padding: 8px 14px; font-size: 14px; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.ltabs button[aria-selected="true"] { border-color: #000; }
fieldset { border: 0; padding: 0; margin: 0; }
.facets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 14px; padding: 12px 14px 0; background: #fafaf8; border-radius: 8px; margin: 6px 0 14px; }
.slug { display: flex; align-items: center; gap: 2px; color: #888; font-weight: 400; font-size: 13px; }
.slug input { margin-top: 0 !important; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.form-actions .btn-danger { margin-left: auto; }
.sticky-actions { position: sticky; bottom: 0; background: #fff; padding: 12px 0; border-top: 1px solid #eee; z-index: 5; }

.img-up { display: grid; gap: 10px; justify-items: start; margin-bottom: 12px; }
.img-up img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 6px; }
.img-up.is-busy { opacity: .5; pointer-events: none; }
.img-up label.btn { margin: 0; }

.pl-list { list-style: none; }
.pl-list li, .picked li {
    display: grid; grid-template-columns: 24px 96px minmax(0, 1fr) auto auto auto; align-items: center; gap: 14px;
    background: #fff; border: 1px solid #e4e4e0; border-radius: 8px; padding: 8px 12px; margin-bottom: 6px;
}
.pl-list img { width: 96px; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; }
.handle { cursor: grab; color: #aaa; font-size: 16px; user-select: none; text-align: center; letter-spacing: -2px; }
.sortable-ghost { opacity: .35; }
.sortable-chosen { box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.saved { position: fixed; right: 20px; bottom: 20px; background: #000; color: #fff; padding: 8px 14px; border-radius: 16px; font-size: 13px; }

.picker { margin-top: 4px; }
.picker-add { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center; }
.picker-add input[type=search] { margin: 0 !important; }
.picker-add label.check { margin: 0; white-space: nowrap; }
.picker-bulk { grid-column: 1 / -1; font-size: 13px; }
.picker-bulk textarea { margin-bottom: 8px; }
.picker-sugg {
    position: absolute; z-index: 20; left: 0; right: 0; top: 42px; max-height: 420px; overflow-y: auto;
    background: #fff; border: 1px solid #ccc; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: 4px;
}
.picker-sugg li { list-style: none; }
.picker-sugg li.mute { padding: 10px; }
.picker-sugg button { display: flex; width: 100%; gap: 10px; align-items: center; text-align: left; border: 0; background: none; padding: 6px; border-radius: 6px; font-size: 14px; cursor: pointer; }
.picker-sugg button:hover, .picker-sugg button:focus { background: #f1f1ee; outline: none; }
.picker-sugg button.is-in { opacity: .55; }
.picker-sugg img { width: 72px; aspect-ratio: 16/9; object-fit: cover; border-radius: 3px; flex: none; }
.picker-sugg small, .pk-t small { display: block; color: #888; font-size: 12px; }
.picker-count { font-size: 13px; color: #555; margin: 12px 0 8px; }
.picked { list-style: none; max-height: 70vh; overflow-y: auto; padding: 2px; }
.picked li { grid-template-columns: 24px 80px minmax(0, 1fr) auto auto; padding: 6px 10px; margin-bottom: 4px; }
.picked img { width: 80px; aspect-ratio: 16/9; object-fit: cover; border-radius: 3px; }
.pk-t { font-size: 14px; line-height: 1.3; }
.pk-d { font-size: 12px; color: #777; }
.pk-btns { display: flex; gap: 2px; }
.pk-btns button { width: 28px; height: 28px; border: 1px solid #ddd; background: #fff; border-radius: 50%; cursor: pointer; font-size: 14px; line-height: 1; }
.pk-btns button:hover { background: #000; color: #fff; border-color: #000; }
.picked li.flash { animation: flash 1.2s ease; }
@keyframes flash { 0% { background: #fff3c4; } 100% { background: #fff; } }

.home-row-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.home-row-head input { flex: 1; min-width: 140px; margin: 0 !important; }
.home-row-head label { margin: 0 !important; }
.three-line { display: grid; grid-template-columns: 90px 1fr 1.4fr 1.4fr; gap: 8px; align-items: center; margin-bottom: 8px; font-size: 13px; }
.three-line input { margin: 0 !important; }
@media (max-width: 700px) { .three-line { grid-template-columns: 1fr; } .two { grid-template-columns: 1fr; } }

.login { max-width: 360px; margin: 12vh auto; background: #fff; padding: 32px; border-radius: 12px; border: 1px solid #e4e4e0; }
.login h1 { font-size: 14px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: #777; margin: 14px 0 24px; }
.login .btn { width: 100%; justify-content: center; }
