/* ===========================================================
   Panel de Administración - Estilos
   Paleta: azul brillante + naranja de acento, fondo blanco
   =========================================================== */
:root {
    --azul: #0057FF;
    --azul-oscuro: #003FBF;
    --naranja: #FF7A00;
    --naranja-oscuro: #E56900;
    --blanco: #FFFFFF;
    --gris-claro: #F4F6FB;
    --gris-borde: #DCE2F0;
    --texto: #1B2333;
    --texto-suave: #5B6478;
    --rojo: #E23A3A;
    --verde: #1FAA59;
    --radio: 10px;
    --sombra: 0 4px 16px rgba(0, 40, 120, 0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--gris-claro);
    color: var(--texto);
}

/* ---------- Login / instalación ---------- */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--azul) 0%, var(--azul-oscuro) 100%);
}
.login-box {
    background: var(--blanco);
    padding: 40px;
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    width: 100%;
    max-width: 380px;
}
.login-box h1 { margin: 0 0 4px; font-size: 22px; color: var(--azul); }
.login-box .subtitle { margin: 0 0 24px; color: var(--texto-suave); font-size: 14px; }
.login-box form { display: flex; flex-direction: column; gap: 16px; }
.login-box label { font-size: 14px; font-weight: 600; display: flex; flex-direction: column; gap: 6px; }
.footer-link { text-align: center; margin-top: 20px; font-size: 13px; }
.footer-link a { color: var(--azul); text-decoration: none; }

/* ---------- Navbar ---------- */
.navbar {
    background: var(--blanco);
    border-bottom: 3px solid var(--azul);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.navbar-brand { font-weight: 700; color: var(--azul); font-size: 18px; }
.navbar-links { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.navbar-links a { color: var(--texto); text-decoration: none; font-size: 14px; font-weight: 500; }
.navbar-links a:hover { color: var(--naranja); }
.navbar-logout { color: var(--rojo) !important; }

/* ---------- Layout general ---------- */
.container { max-width: 1000px; margin: 0 auto; padding: 32px 20px 60px; }
.container-narrow { max-width: 620px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-head h1 { margin: 0; font-size: 24px; }

/* ---------- Botones ---------- */
.btn {
    display: inline-block;
    background: var(--azul);
    color: var(--blanco);
    border: none;
    padding: 11px 20px;
    border-radius: var(--radio);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, transform .1s ease;
}
.btn:hover { background: var(--azul-oscuro); }
.btn:active { transform: scale(.98); }
.btn-accent { background: var(--naranja); }
.btn-accent:hover { background: var(--naranja-oscuro); }
.btn-outline { background: transparent; color: var(--azul); border: 2px solid var(--azul); padding: 9px 18px; }
.btn-outline:hover { background: var(--azul); color: var(--blanco); }
.btn-small { padding: 6px 12px; font-size: 13px; }
.btn-danger { background: var(--rojo); }
.btn-danger:hover { background: #c72e2e; }
.inline-form { display: inline-block; margin: 0; }

/* ---------- Alertas ---------- */
.alert { padding: 12px 16px; border-radius: var(--radio); font-size: 14px; margin-bottom: 18px; }
.alert-ok { background: #E7F8EF; color: var(--verde); border: 1px solid #B9EBD0; }
.alert-error { background: #FDECEC; color: var(--rojo); border: 1px solid #F6C6C6; }

/* ---------- Tabla ---------- */
.tabla { width: 100%; border-collapse: collapse; background: var(--blanco); border-radius: var(--radio); overflow: hidden; box-shadow: var(--sombra); }
.tabla th, .tabla td { padding: 14px 16px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--gris-borde); }
.tabla th { background: var(--azul); color: var(--blanco); font-weight: 600; }
.tabla tr:last-child td { border-bottom: none; }
.acciones { display: flex; gap: 8px; }
.muted { color: var(--texto-suave); font-style: italic; }
.empty-state { color: var(--texto-suave); text-align: center; padding: 40px; background: var(--blanco); border-radius: var(--radio); }

/* ---------- Badges de tipo ---------- */
.badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; color: var(--blanco); margin: 2px 4px 2px 0; }
.badge-texto { background: var(--azul); }
.badge-imagen { background: var(--naranja); }
.badge-video { background: #7A3FE0; }
.badge-pantalla { background: #1FAA59; }

/* ---------- Switch activo/inactivo ---------- */
.switch { border: none; padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 700; cursor: pointer; }
.switch.on { background: #E7F8EF; color: var(--verde); }
.switch.off { background: #F0F1F5; color: var(--texto-suave); }

/* ---------- Formularios ---------- */
.form-card { background: var(--blanco); padding: 28px; border-radius: var(--radio); box-shadow: var(--sombra); display: flex; flex-direction: column; gap: 18px; }
.form-card label { font-size: 14px; font-weight: 600; display: flex; flex-direction: column; gap: 6px; }
.form-card input[type=text], .form-card input[type=number], .form-card input[type=password], .form-card select, .form-card textarea, .form-card input[type=file] {
    padding: 10px 12px; border: 1px solid var(--gris-borde); border-radius: 8px; font-size: 14px; font-family: inherit;
}
.form-card input[type=color] { width: 60px; height: 40px; border: 1px solid var(--gris-borde); border-radius: 8px; padding: 2px; }
.form-card textarea { resize: vertical; }
.checkbox-label { flex-direction: row !important; align-items: center; gap: 8px !important; }
.campo-tipo { display: none; }
.nota-campo { font-size: 12px; color: var(--texto-suave); margin: -8px 0 0; font-weight: 400; display: none; }
.preview-img { max-width: 100%; max-height: 220px; border-radius: 8px; margin-top: 8px; border: 1px solid var(--gris-borde); }
.preview-logo { max-height: 80px; background: var(--gris-claro); padding: 8px; }
.preview-video { max-width: 100%; max-height: 220px; border-radius: 8px; margin-top: 8px; }

/* ---------- Barra de progreso de subida ---------- */
.progreso-wrap { display: flex; flex-direction: column; gap: 8px; }
.progreso-barra { width: 100%; height: 28px; background: var(--gris-claro); border-radius: 20px; overflow: hidden; border: 1px solid var(--gris-borde); position: relative; }
.progreso-relleno {
    height: 100%;
    width: 0%;
    min-width: 42px;
    background: linear-gradient(90deg, var(--azul), var(--naranja));
    transition: width .2s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    box-sizing: border-box;
}
.progreso-porcentaje { color: #FFFFFF; font-size: 12px; font-weight: 700; white-space: nowrap; }
.progreso-detalle { display: flex; justify-content: space-between; font-size: 12px; color: var(--texto-suave); font-weight: 600; }
.progreso-texto { font-size: 13px; color: var(--texto-suave); margin: 0; font-weight: 500; }

/* ---------- Selector de pantallas en el formulario de publicación ---------- */
.campo-pantallas { display: flex; flex-direction: column; gap: 10px; }
.campo-pantallas-titulo { font-size: 14px; font-weight: 600; }
.lista-pantallas-checkbox { display: flex; flex-direction: column; gap: 8px; background: var(--gris-claro); border-radius: 8px; padding: 12px 14px; }
.checkbox-pantalla { font-weight: 500 !important; }

/* ---------- Página "Pantallas" del panel ---------- */
.ayuda-pantallas { color: var(--texto-suave); font-size: 14px; margin: -10px 0 20px; }
.ayuda-pantallas a { color: var(--azul); }
.enlace-pantalla { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.input-enlace {
    flex: 1;
    min-width: 220px;
    padding: 8px 10px;
    border: 1px solid var(--gris-borde);
    border-radius: 8px;
    font-size: 13px;
    color: var(--texto-suave);
    background: var(--gris-claro);
}

/* ---------- Directorio de pantallas (display/index.php sin pantalla válida) ---------- */
.lista-enlaces-directorio { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.lista-enlaces-directorio .btn { text-align: center; }

/* ---------- Directorio público de manuales ---------- */
.enlace-manual {
    display: block;
    padding: 14px 16px;
    background: var(--blanco);
    border-radius: 8px;
    text-decoration: none;
    color: var(--texto);
    font-weight: 600;
    font-size: 14px;
    box-shadow: var(--sombra);
}
.enlace-manual:hover { color: var(--azul); }
