/* ================================================================
   EMERGENCIAS – Estilos públicos + panel
   ================================================================ */

/* ── Sección principal (index.php) ─────────────────────────── */
.emergencias-preview {
    background: linear-gradient(160deg, #1a1a1a 0%, #2a1a0a 100%);
    color: #fff;
}
.emergencias-preview .section-label { color: #ff7b00; }
.emergencias-preview .section-title { color: #fff; }
.emergencias-preview .section-title::after {
    background: linear-gradient(90deg, #d32f2f, #ff7b00);
}

/* 112 banner */
.em-112-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    border-radius: 20px;
    padding: 28px 40px;
    max-width: 600px;
    margin: 0 auto 50px;
    box-shadow: 0 10px 40px rgba(211,47,47,.4);
}
.em-112-num {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(4rem, 10vw, 6rem);
    line-height: 1;
    color: #fff;
    letter-spacing: 4px;
}
.em-112-info { text-align: left; }
.em-112-info strong {
    display: block;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
}
.em-112-info span {
    font-size: .85rem;
    color: rgba(255,255,255,.75);
    letter-spacing: .5px;
}

/* Grid de cuerpos */
.cuerpos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    max-width: 1100px;
    margin: 0 auto 50px;
    padding: 0 20px;
}
.cuerpo-card {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 18px;
    padding: 28px 20px;
    text-align: center;
    text-decoration: none;
    transition: transform .25s, background .25s, box-shadow .25s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.cuerpo-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: var(--cuerpo-color, #ff7b00);
    border-radius: 18px 18px 0 0;
}
.cuerpo-card:hover {
    transform: translateY(-6px);
    background: rgba(255,255,255,.10);
    box-shadow: 0 14px 40px rgba(0,0,0,.3);
}
.cuerpo-card .cuerpo-icono {
    font-size: 2.2rem;
    margin-bottom: 12px;
    color: var(--cuerpo-color, #ff7b00);
}
.cuerpo-card .cuerpo-nombre {
    font-weight: 700;
    font-size: .92rem;
    color: #fff;
    letter-spacing: .5px;
    margin-bottom: 10px;
    line-height: 1.3;
}
.cuerpo-card .cuerpo-tel {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--cuerpo-color, #ff7b00);
    color: #fff;
    padding: 6px 14px;
    border-radius: 50px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 2px;
    margin-top: 4px;
}

/* Mini-noticias en index.php */
.em-news-mini {
    max-width: 900px;
    margin: 0 auto 40px;
    padding: 0 20px;
}
.em-news-mini h3 {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #ff7b00;
    text-align: center;
    margin-bottom: 22px;
}
.em-news-mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}
.em-news-mini-card {
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 14px;
    padding: 18px 20px;
    text-decoration: none;
    color: #fff;
    transition: background .2s, transform .2s;
    display: block;
}
.em-news-mini-card:hover { background: rgba(255,255,255,.12); transform: translateY(-3px); }
.em-news-mini-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 50px;
    margin-bottom: 10px;
    color: #fff;
}
.em-news-mini-card h4 {
    font-size: .93rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.4;
    margin-bottom: 6px;
}
.em-news-mini-card p {
    font-size: .8rem;
    color: rgba(255,255,255,.6);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.em-actions {
    text-align: center;
    margin-top: 10px;
}

/* ── Página pública /emergencias/ ───────────────────────────── */
.em-hero {
    background: linear-gradient(160deg, #1a1a1a 0%, #2a1a0a 100%);
    padding: 90px 20px 60px;
    text-align: center;
    color: #fff;
}
.em-hero .section-label { color: #ff7b00; }
.em-hero h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: 6px;
    color: #fff;
    margin-bottom: 10px;
}
.em-hero p {
    color: rgba(255,255,255,.65);
    font-size: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* Tabs de cuerpos */
.em-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 40px 20px 10px;
    max-width: 1100px;
    margin: 0 auto;
}
.em-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 50px;
    border: 2px solid rgba(0,0,0,.1);
    background: #fff;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all .2s;
    color: #555;
}
.em-tab-btn.active, .em-tab-btn:hover {
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(0,0,0,.15);
}

/* Ficha de cuerpo (card grande) */
.em-cuerpo-ficha {
    background: #fff;
    border-radius: 20px;
    padding: 36px 32px;
    max-width: 1100px;
    margin: 30px auto 0;
    box-shadow: 0 8px 40px rgba(0,0,0,.08);
    display: flex;
    gap: 28px;
    align-items: flex-start;
    border-top: 5px solid var(--cuerpo-color, #ff7b00);
}
.em-cuerpo-ficha-icon {
    font-size: 3.5rem;
    color: var(--cuerpo-color, #ff7b00);
    flex-shrink: 0;
    width: 80px;
    text-align: center;
}
.em-cuerpo-ficha-info h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.8rem;
    letter-spacing: 3px;
    color: #1a1a1a;
    margin-bottom: 8px;
}
.em-cuerpo-ficha-info p {
    color: #555;
    line-height: 1.7;
    margin-bottom: 16px;
}
.em-tel-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--cuerpo-color, #ff7b00);
    color: #fff;
    padding: 8px 20px;
    border-radius: 50px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.3rem;
    letter-spacing: 3px;
    text-decoration: none;
    transition: opacity .2s;
}
.em-tel-badge:hover { opacity: .85; }

/* Feed de noticias público */
.em-feed {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
}
.em-feed-title {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #ff7b00;
    margin-bottom: 22px;
}
.em-feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
.em-feed-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,.07);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform .25s, box-shadow .25s;
    display: flex;
    flex-direction: column;
    border-top: 4px solid var(--cuerpo-color, #ff7b00);
}
.em-feed-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 40px rgba(0,0,0,.12);
}
.em-feed-card-img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}
.em-feed-card-img-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--cuerpo-color, #ff7b00);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: rgba(255,255,255,.5);
}
.em-feed-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.em-feed-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.em-tipo-badge {
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 50px;
    color: #fff;
}
.em-tipo-noticia  { background: #1a4d8f; }
.em-tipo-consejo  { background: #3bb44a; }
.em-tipo-aviso    { background: #d32f2f; }

.em-feed-card-fecha { font-size: .75rem; color: #aaa; }
.em-feed-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.4;
    margin-bottom: 8px;
}
.em-feed-card p {
    font-size: .85rem;
    color: #666;
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.em-feed-card-source {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    font-size: .75rem;
    color: #888;
    font-weight: 600;
}
.em-feed-empty {
    text-align: center;
    color: #aaa;
    padding: 50px 20px;
    font-size: 1rem;
}

/* ── Panel (dashboard, nuevo, editar, admin) ─────────────────── */
body.panel-body {
    background: #f5f5f5;
    min-height: 100vh;
}
.panel-topbar {
    background: #1a1a1a;
    color: #fff;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 16px;
}
.panel-topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: .9rem;
    letter-spacing: 1px;
    flex-shrink: 0;
}
.panel-topbar-brand img { height: 32px; }
.panel-topbar-brand span { color: #ff7b00; }
.panel-topbar-user {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: .83rem;
    color: rgba(255,255,255,.7);
}
.panel-topbar-user a {
    color: rgba(255,255,255,.5);
    text-decoration: none;
    font-size: .8rem;
    transition: color .2s;
}
.panel-topbar-user a:hover { color: #fff; }

.panel-wrap {
    max-width: 1000px;
    margin: 0 auto;
    padding: 36px 20px 60px;
}
.panel-header {
    margin-bottom: 30px;
}
.panel-header h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.2rem;
    letter-spacing: 3px;
    color: #1a1a1a;
    margin-bottom: 4px;
}
.panel-header p { color: #777; font-size: .88rem; }

.panel-cuerpo-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: 50px;
    color: #fff;
    font-weight: 700;
    font-size: .85rem;
    margin-bottom: 28px;
}

/* Tabla de posts */
.panel-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
}
.panel-table th {
    background: #f8f8f8;
    padding: 12px 16px;
    text-align: left;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #888;
    border-bottom: 1px solid #eee;
}
.panel-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: .88rem;
    color: #333;
    vertical-align: middle;
}
.panel-table tr:last-child td { border-bottom: none; }
.panel-table tr:hover td { background: #fafafa; }
.panel-table-empty {
    text-align: center;
    color: #aaa;
    padding: 40px !important;
}

/* Formulario del panel */
.panel-card {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
    margin-bottom: 24px;
}
.panel-card h2 {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #ff7b00;
    margin-bottom: 20px;
}
.pform-group { margin-bottom: 20px; }
.pform-group label {
    display: block;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 7px;
}
.pform-control {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-size: .93rem;
    color: #222;
    font-family: inherit;
    background: #fff;
    box-sizing: border-box;
    transition: border-color .2s, box-shadow .2s;
}
.pform-control:focus {
    outline: none;
    border-color: #ff7b00;
    box-shadow: 0 0 0 3px rgba(255,123,0,.1);
}
textarea.pform-control { min-height: 160px; resize: vertical; }

.pform-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
@media (max-width: 600px) { .pform-row { grid-template-columns: 1fr; } }

.panel-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 50px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.05rem;
    letter-spacing: 2px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s;
}
.panel-btn-primary {
    background: linear-gradient(135deg, #ff7b00, #f5a623);
    color: #fff;
    box-shadow: 0 6px 20px rgba(255,123,0,.3);
}
.panel-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(255,123,0,.45); }
.panel-btn-secondary {
    background: #f0f0f0;
    color: #555;
}
.panel-btn-secondary:hover { background: #e5e5e5; }
.panel-btn-danger {
    background: #fff0f0;
    color: #d32f2f;
    border: 1px solid #ffc0c0;
}
.panel-btn-danger:hover { background: #ffd8d8; }
.panel-btn-sm {
    padding: 6px 14px;
    font-size: .85rem;
    letter-spacing: 1px;
}

/* Alert messages */
.panel-alert {
    padding: 13px 18px;
    border-radius: 10px;
    font-size: .88rem;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.panel-alert-ok  { background: #f0fff4; border: 1px solid #9ae6b4; color: #276749; }
.panel-alert-err { background: #fff5f5; border: 1px solid #feb2b2; color: #c53030; }

/* Preview imagen */
.img-preview {
    max-width: 260px;
    border-radius: 10px;
    margin-top: 10px;
    display: none;
}

/* Admin: tabs */
.admin-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #eee;
    margin-bottom: 28px;
}
.admin-tab {
    padding: 10px 22px;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #aaa;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .2s, border-color .2s;
    text-decoration: none;
}
.admin-tab.active { color: #ff7b00; border-color: #ff7b00; }

/* Cuerpo page (emergencias/cuerpo.php) */
.em-cuerpo-hero {
    padding: 80px 20px 50px;
    text-align: center;
    color: #fff;
}
.em-cuerpo-hero h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2.5rem, 7vw, 5rem);
    letter-spacing: 5px;
    margin-bottom: 12px;
}
.em-cuerpo-hero p { color: rgba(255,255,255,.7); max-width: 560px; margin: 0 auto 24px; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .cuerpos-grid { grid-template-columns: repeat(2, 1fr); }
    .em-112-banner { flex-direction: column; gap: 12px; text-align: center; padding: 24px; }
    .em-112-info { text-align: center; }
    .em-cuerpo-ficha { flex-direction: column; }
    .em-cuerpo-ficha-icon { width: 100%; font-size: 2.5rem; }
    .panel-topbar { padding: 0 16px; }
    .panel-card { padding: 22px 18px; }
}
@media (max-width: 480px) {
    .cuerpos-grid { grid-template-columns: 1fr; }
}
