/* ============================================================
   be_panel.css  -  Kit de UI comun del panel (homogeneizacion)
   Enlazado desde Site.Master => afecta a todo el back.
   Paleta y componentes extraidos de be_equiposPro.
   ============================================================ */

:root {
    --bep-primary: #4b6c9e;
    --bep-primary-dark: #3a4f63;
    --bep-editar: #034af3;
    --bep-borrar: #dc3545;
    --bep-ok: #28a745;
    --bep-warn: #fd7e14;
    --bep-muted: #6c757d;
    --bep-borde: #ddd;
    --bep-bg-suave: #f8f9fa;
}

/* ---- Barra de filtros / acciones superiores ---- */
.be-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 8px 0 12px 0;
    font-size: 13px;
    background: var(--bep-bg-suave);
    border: 1px solid #e3e3ee;
    border-radius: 6px;
    padding: 10px 12px;
}
.be-filtros label { color: #333; }
.be-filtros input[type=text],
.be-filtros select {
    padding: 5px 8px;
    border: 1px solid #cfcfe0;
    border-radius: 5px;
    font-size: 13px;
    box-sizing: border-box;
}
.be-filtros input[type=text]:focus,
.be-filtros select:focus { border-color: var(--bep-primary); outline: none; }

/* ---- Botones ---- */
.be-btn {
    background: #fff;
    color: #333;
    border: 1px solid #bbb;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
}
.be-btn:hover { background: var(--bep-bg-suave); }
.be-btn-primary { background: var(--bep-primary); color: #fff; border-color: var(--bep-primary); }
.be-btn-primary:hover { background: var(--bep-primary-dark); }
.btn-configurar { background: var(--bep-muted); color: #fff; border: none; border-radius: 4px; padding: 6px 12px; font-size: 12px; cursor: pointer; }
.btn-configurar:hover { background: #5a6268; }
/* Boton "+ Nuevo" destacado (verde, alto contraste).
   Se fuerza color/decoracion porque Site.css define a:link/a:visited con mayor especificidad. */
.be-btn-nuevo,
a.be-btn-nuevo,
a.be-btn-nuevo:link,
a.be-btn-nuevo:visited,
a.be-btn-nuevo:hover,
a.be-btn-nuevo:active {
    display: inline-block;
    background: #1e7e34;
    color: #ffffff !important;
    border: none;
    border-radius: 4px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: bold;
    text-decoration: none !important;
    cursor: pointer;
}
.be-btn-nuevo:hover,
a.be-btn-nuevo:hover { background: #155d27; color: #ffffff !important; }

/* ---- Menu desplegable de acciones por fila (boton unico) ---- */
.dropdown-acciones { position: relative; display: inline-block; }
.btn-acciones {
    background: var(--bep-primary);
    color: #fff;
    padding: 6px 14px;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    min-width: 96px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.btn-acciones:hover { background: var(--bep-primary-dark); }
.dropdown-menu-acciones {
    display: none;
    position: absolute;
    background: #fff;
    min-width: 190px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.22);
    z-index: 1000;
    border-radius: 6px;
    border: 1px solid #c9c9da;
    margin-top: 3px;
    overflow: hidden;
}
.dropdown-menu-acciones a {
    color: #333;
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.12s ease, padding-left 0.12s ease;
}
.dropdown-menu-acciones a:last-child { border-bottom: none; }
.dropdown-menu-acciones a:hover { background: #eef2f8; padding-left: 20px; }
/* Apertura hacia arriba cuando no cabe por abajo (lo decide be_panel.js). */
.dropdown-menu-acciones.abre-arriba { top: auto; bottom: 100%; margin-top: 0; margin-bottom: 2px; }
.dropdown-menu-acciones a.accion-detalles { color: var(--bep-muted); }
.dropdown-menu-acciones a.accion-editar { color: var(--bep-editar); }
.dropdown-menu-acciones a.accion-borrar { color: var(--bep-borrar); }
.dropdown-menu-acciones a.accion-jugadores { color: var(--bep-ok); }
.dropdown-menu-acciones a.accion-adjuntos { color: var(--bep-warn); }

/* Variante: menu cuyos items son asp:Button (input submit) + enlaces, sin cambiar los controles.
   Se usa cuando los botones tienen handlers de servidor que no se pueden convertir a LinkButton. */
.dropdown-menu-botones input[type=submit],
.dropdown-menu-botones input[type=button],
.dropdown-menu-botones a {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: left !important;
    margin: 0 !important;
    border: none !important;
    border-bottom: 1px solid #f0f0f0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #333 !important;
    padding: 9px 14px !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    cursor: pointer;
    box-shadow: none !important;
}
.dropdown-menu-botones a { text-decoration: none !important; }
.dropdown-menu-botones input[type=submit]:hover,
.dropdown-menu-botones input[type=button]:hover,
.dropdown-menu-botones a:hover { background: var(--bep-bg-suave) !important; }
.dropdown-menu-botones input:last-child,
.dropdown-menu-botones a:last-child { border-bottom: none !important; }
/* Color por accion tambien para los botones/enlaces dentro del menu (calendario, etc.) */
.dropdown-menu-botones input[type=submit].accion-editar, .dropdown-menu-botones input[type=button].accion-editar, .dropdown-menu-botones a.accion-editar { color: var(--bep-editar) !important; }
.dropdown-menu-botones input[type=submit].accion-borrar, .dropdown-menu-botones input[type=button].accion-borrar, .dropdown-menu-botones a.accion-borrar { color: var(--bep-borrar) !important; }
.dropdown-menu-botones input[type=submit].accion-detalles, .dropdown-menu-botones input[type=button].accion-detalles, .dropdown-menu-botones a.accion-detalles { color: var(--bep-muted) !important; }
.dropdown-menu-botones input[type=submit].accion-jugadores, .dropdown-menu-botones input[type=button].accion-jugadores, .dropdown-menu-botones a.accion-jugadores { color: var(--bep-ok) !important; }
.dropdown-menu-botones input[type=submit].accion-adjuntos, .dropdown-menu-botones input[type=button].accion-adjuntos, .dropdown-menu-botones a.accion-adjuntos { color: var(--bep-warn) !important; }

/* ---- Tabla de listado (clase generica reutilizable) ---- */
.be-tabla {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--bep-borde);
    font-size: 12px;
}
.be-tabla th {
    background: var(--bep-primary);
    color: #fff;
    padding: 8px 6px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    border-right: 1px solid var(--bep-primary-dark);
    border-bottom: 2px solid var(--bep-primary-dark);
    white-space: nowrap;
    /* Cabecera fija al hacer scroll vertical (degrada bien si no aplica). */
    position: sticky;
    top: 0;
    z-index: 5;
}
.be-tabla td {
    padding: 6px 6px;
    border-bottom: 1px solid #e8e8e8;
    border-right: 1px solid #f0f0f0;
    vertical-align: middle;
    line-height: 1.4;
}
.be-tabla tbody tr:nth-child(even) { background: #f9f9f9; }
.be-tabla tbody tr:hover { background: #f0f4f8; }

/* ---- Badges de estado ---- */
.be-badge { font-size: 11px; padding: 2px 8px; border-radius: 5px; white-space: nowrap; }
.be-badge-ok { background: #e7f5ee; color: #0f6e56; }
.be-badge-warn { background: #faeeda; color: #854f0b; }
.be-badge-bad { background: #fceaea; color: #a32d2d; }
.be-badge-muted { background: #eee; color: #555; }

/* ---- Modal simple (configurador de columnas / confirmaciones) ---- */
.be-modal-fondo {
    display: none;
    position: fixed; left: 0; top: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.45); z-index: 2000;
}
.be-modal {
    background: #fff; border-radius: 8px; border: 1px solid var(--bep-borde);
    max-width: 420px; margin: 8% auto; padding: 16px 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.be-modal h4 { margin: 0 0 10px 0; color: var(--bep-primary-dark); }
.be-modal .be-cols label { display: block; padding: 4px 0; font-size: 13px; }

/* ---- Fichas de edicion (be_xxx_modi) ---- */
.ficha fieldset { border: 1px solid #99b; margin: 0 0 14px 0; padding: 10px 14px; }
.ficha legend { font-weight: bold; color: var(--bep-primary-dark); padding: 0 6px; cursor: pointer; -webkit-user-select: none; -ms-user-select: none; user-select: none; }
.ficha legend .tg { display: inline-block; width: 1.4em; color: #888; }
.ficha table { width: 100%; border-collapse: collapse; }
.ficha td { padding: 4px 8px; vertical-align: top; }
.ficha td.lbl { width: 250px; color: #333; }
.ficha .hint { display: block; font-weight: normal; color: #888; font-size: 11px; line-height: 1.2; margin-top: 2px; }
.ficha .acciones { margin: 8px 0 18px 0; }
.ficha input[type=text] { width: 230px; max-width: 100%; box-sizing: border-box; }
.ficha textarea { max-width: 100%; box-sizing: border-box; }

/* ---- Responsive ---- */
@media (max-width: 820px) {
    .be-filtros { flex-direction: column; align-items: stretch; }
    .ficha table, .ficha tbody, .ficha tr, .ficha td { display: block; width: auto !important; }
    .ficha td.lbl { color: var(--bep-primary-dark); font-weight: bold; padding-bottom: 0; }
    .ficha input[type=text] { width: 100%; }
}
