/* Dashboard Zirene — CSS propio, simple y funcional */

:root {
    --acento: #1D55C1;
    --titulos: #020B1B;
    --texto: #444;
    --borde: #e0e0e0;
    --fondo: #f4f5f7;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    color: var(--texto);
    background: var(--fondo);
}

a { color: var(--acento); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 22px; color: var(--titulos); margin: 0 0 20px; }

/* Layout */
.dash { display: flex; min-height: 100vh; }

.dash-sidebar {
    width: 210px;
    flex-shrink: 0;
    background: #16181d;
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 18px 0;
}

.dash-logo {
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 0 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.dash-sidebar nav { display: flex; flex-direction: column; padding-top: 10px; flex: 1; }

.dash-sidebar nav a {
    color: #c7c9ce;
    padding: 10px 20px;
    border-left: 3px solid transparent;
}

.dash-sidebar nav a:hover { color: #fff; text-decoration: none; }
.dash-sidebar nav a.activo { color: #fff; background: rgba(255,255,255,.06); border-left-color: var(--acento); }

.dash-logout { padding: 0 20px; }
.dash-logout button { background: none; border: 1px solid rgba(255,255,255,.25); color: #c7c9ce; padding: 6px 12px; cursor: pointer; width: 100%; }
.dash-logout button:hover { color: #fff; border-color: #fff; }

.dash-main { flex: 1; padding: 24px 28px; min-width: 0; }

/* Flash */
.flash { padding: 10px 14px; margin-bottom: 18px; border-left: 4px solid; }
.flash-ok { background: #e8f5e9; border-color: #2e7d32; color: #1b5e20; }
.flash-error { background: #fdecea; border-color: #c62828; color: #8e0000; }
.flash ul { margin: 0; padding-left: 18px; }

/* Barra superior de listados */
.barra-acciones { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.barra-acciones form { display: flex; gap: 8px; }

/* Tabla */
.tabla { width: 100%; border-collapse: collapse; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.tabla th, .tabla td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--borde); vertical-align: middle; }
.tabla th { background: #fafafa; color: var(--titulos); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.tabla tr:hover td { background: #f8f9fb; }
.tabla img.mini { width: 60px; height: 40px; object-fit: cover; display: block; }
.tabla .acciones { white-space: nowrap; }

.estado { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; }
.estado-pub { background: #e8f5e9; color: #1b5e20; }
.estado-borrador { background: #fff3e0; color: #b45309; }
.estado-programada { background: #e3f2fd; color: #1565c0; }

/* Columna ID discreta */
.col-id { color: #999; font-size: 12px; width: 48px; }
th.col-id a { color: #999; }

/* Encabezados ordenables */
.tabla th a { color: var(--titulos); }
.tabla th a:hover { color: var(--acento); }

/* Toggle de estado (botón que parece badge) */
.btn-toggle { border: 0; cursor: pointer; font: inherit; }
.btn-toggle:hover { filter: brightness(.95); }

/* Chips de destacados en el listado */
.col-destacados { white-space: nowrap; }
.chip-destacado {
    width: 24px; height: 24px; border-radius: 50%;
    border: 1px solid var(--borde); background: #fff; color: #bbb;
    font-size: 12px; font-weight: 700; cursor: pointer; margin-right: 2px;
}
.chip-destacado.on { background: var(--acento); border-color: var(--acento); color: #fff; }
.chip-destacado:hover { border-color: var(--acento); }

/* Formularios */
.form-card { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 22px 24px; max-width: 960px; }

label { display: block; margin-bottom: 14px; color: var(--titulos); font-weight: 600; }

input[type="text"], input[type="email"], input[type="password"], input[type="url"],
input[type="number"], input[type="datetime-local"], select, textarea {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 8px 10px;
    border: 1px solid var(--borde);
    border-radius: 3px;
    font: inherit;
    color: var(--texto);
    background: #fff;
}

textarea { min-height: 90px; resize: vertical; }
/* El atributo hidden debe ganarle a `display:block` de arriba (textarea espejo de Quill) */
[hidden] { display: none !important; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(29,85,193,.35); border-color: var(--acento); }

.form-fila { display: flex; gap: 18px; }
.form-fila > label { flex: 1; }

.ayuda { font-weight: 400; font-size: 12px; color: #888; }

/* Botones (guardado estilo Joomla) */
.btn {
    display: inline-block;
    padding: 8px 18px;
    border: 1px solid var(--borde);
    border-radius: 3px;
    background: #fff;
    color: var(--titulos);
    font: inherit;
    cursor: pointer;
}
.btn:hover { background: #f0f2f5; text-decoration: none; }
.btn-primario { background: var(--acento); border-color: var(--acento); color: #fff; }
.btn-primario:hover { background: #17449b; }
.btn-peligro { color: #c62828; border-color: #e5b4b4; }
.btn-peligro:hover { background: #fdecea; }
.btn-chico { padding: 3px 10px; font-size: 12px; }

.botonera { display: flex; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--borde); }

/* Barra superior del form: estado + botonera (estilo Joomla/BAMARTE) */
.barra-superior {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: #fafbfc;
    border: 1px solid var(--borde);
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 22px;
    position: sticky;
    top: 0;
    z-index: 5;
}
.botonera-superior { margin: 0; padding: 0; border-top: 0; }

/* Switch Publicada / Borrador */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; margin: 0; }
.switch input { display: none; }
.switch-track {
    width: 46px; height: 24px; border-radius: 999px;
    background: #c9ccd1; position: relative; transition: background .2s; flex-shrink: 0;
}
.switch-thumb {
    position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
    background: #fff; border-radius: 50%; transition: left .2s; box-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.switch.on .switch-track { background: #2e7d32; }
.switch.on .switch-thumb { left: 24px; }
.switch-label { font-size: 14px; color: var(--titulos); min-width: 74px; }
.switch.on .switch-label { color: #2e7d32; }

/* Previews de imágenes nuevas por subir */
.preview-nuevas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.thumb-nueva { margin: 0; position: relative; }
.thumb-nueva img {
    width: 110px; height: 80px; object-fit: cover;
    border: 2px dashed var(--acento); border-radius: 3px; display: block;
}
.thumb-nueva figcaption {
    position: absolute; top: 3px; left: 3px;
    background: var(--acento); color: #fff; font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .5px; padding: 1px 6px; border-radius: 2px;
}

/* Preview de imágenes */
.preview-imagen { max-width: 260px; max-height: 160px; object-fit: cover; display: block; margin: 6px 0; border: 1px solid var(--borde); }

/* Galería en el form de nota */
.galeria-admin { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 14px; }
.galeria-admin .fila-galeria { display: flex; align-items: center; gap: 12px; background: #fafafa; border: 1px solid var(--borde); padding: 6px 10px; }
.galeria-admin img { width: 90px; height: 60px; object-fit: cover; }
.galeria-admin .mover { display: flex; flex-direction: column; gap: 2px; }
.galeria-admin .mover button { border: 1px solid var(--borde); background: #fff; cursor: pointer; padding: 0 8px; line-height: 20px; }
.galeria-admin .eliminar-check { margin-left: auto; font-weight: 400; color: #c62828; display: flex; align-items: center; gap: 6px; }

/* Quill */
.editor-cuerpo { background: #fff; }
.editor-cuerpo .ql-editor { min-height: 320px; font-size: 15px; }
.ql-toolbar button.ql-mayusculas { width: auto; padding: 0 6px; font-weight: 700; font-size: 13px; }

/* Fieldset de estado/destacados */
.destacados-fieldset { border: 1px solid var(--borde); padding: 12px 16px; margin: 4px 0 8px; }
.destacados-fieldset legend { font-weight: 600; color: var(--titulos); padding: 0 6px; }
.check-inline { display: flex; align-items: center; gap: 8px; font-weight: 400; margin-bottom: 8px; }
.check-inline input[type="checkbox"] { width: auto; margin: 0; }

/* Contador meta description */
.contador { font-weight: 400; font-size: 12px; color: #888; }
.contador.excedido { color: #c62828; font-weight: 700; }

/* Paginación: forzar horizontal (el partial usa <ul class="paginacion">) */
nav[role="navigation"] { margin-top: 16px; }
.paginacion {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
}
.paginacion li { display: inline-flex; }
.paginacion a, .paginacion span {
    display: inline-block;
    min-width: 32px;
    text-align: center;
    line-height: 30px;
    padding: 0 8px;
    border: 1px solid var(--borde);
    background: #fff;
    color: var(--titulos);
    border-radius: 3px;
}
.paginacion a:hover { border-color: var(--acento); color: var(--acento); text-decoration: none; }
.paginacion .actual { background: var(--acento); border-color: var(--acento); color: #fff; }
.paginacion .btn-next { min-width: auto; }

/* Honeypot anti-bots: fuera de pantalla, invisible para humanos */
.hp-campo { position: absolute; left: -9999px; top: -9999px; height: 0; overflow: hidden; }

/* Login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.1); padding: 32px; width: 340px; }
.login-card h1 { text-align: center; letter-spacing: 3px; text-transform: uppercase; margin-bottom: 4px; }
.login-sub { text-align: center; color: #888; margin: 0 0 20px; }
.login-card button { width: 100%; margin-top: 6px; }
