/* ==========================================================================
   Etriton UIWebApp4.0 - Modern visual theme (piloto)
   Solo estilos de presentacion. No depende de logica de negocio ni cambia
   ningun ID de control de servidor. Se aplica unicamente en paginas que
   usan MasterPage.Modern.master o que referencian este archivo directamente
   (ej. pLogin.aspx), y todo queda encapsulado bajo ".etriton-modern".
   ========================================================================== */

.etriton-modern {
    --em-bg: #f3f4f7;
    --em-surface: #ffffff;
    --em-sidebar-bg: #1c2130;
    --em-sidebar-bg-hover: rgba(255, 255, 255, .06);
    --em-sidebar-text: #c7cad3;
    --em-sidebar-text-active: #ffffff;
    --em-text: #1f2430;
    --em-text-muted: #6b7280;
    --em-border: #e5e7eb;
    --em-primary: #b3122d;
    --em-primary-dark: #8c0000;
    --em-primary-soft: #fdeceb;
    --em-radius: 10px;
    --em-radius-sm: 6px;
    --em-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 12px rgba(16, 24, 40, .06);
    --em-sidebar-w: 250px;
    --em-topbar-h: 60px;

    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--em-text);
    background: var(--em-bg);
}

.etriton-modern * {
    box-sizing: border-box;
}

.etriton-modern a {
    color: var(--em-primary);
    text-decoration: none;
}

.etriton-modern a:hover {
    text-decoration: underline;
}

/* ---------- Shell layout: sidebar + topbar + content ---------- */

.etriton-modern .em-shell {
    min-height: 100%;
}

.etriton-modern .em-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--em-sidebar-w);
    background: var(--em-sidebar-bg);
    color: var(--em-sidebar-text);
    overflow-y: auto;
    z-index: 1030;
    transition: transform .2s ease;
}

.etriton-modern .em-sidebar-brand {
    display: flex;
    align-items: center;
    height: var(--em-topbar-h);
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.etriton-modern .em-sidebar-brand img {
    max-height: 34px;
    width: auto;
}

.etriton-modern .em-nav {
    padding: 12px 0 24px;
}

.etriton-modern .em-nav > li > a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    color: var(--em-sidebar-text);
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: .2px;
    cursor: pointer;
}

.etriton-modern .em-nav > li > a:hover,
.etriton-modern .em-nav .em-submenu a:hover {
    background: var(--em-sidebar-bg-hover);
    color: var(--em-sidebar-text-active);
    text-decoration: none;
}

.etriton-modern .em-nav .fa {
    width: 16px;
    text-align: center;
    opacity: .85;
}

.etriton-modern .em-nav .em-caret {
    margin-left: auto;
    transition: transform .15s ease;
    font-size: 11px;
    opacity: .6;
}

.etriton-modern .em-nav a[aria-expanded="true"] .em-caret {
    transform: rotate(180deg);
}

.etriton-modern .em-nav .em-submenu {
    list-style: none;
    margin: 0;
    padding: 4px 0 8px;
}

.etriton-modern .em-nav .em-submenu .em-submenu {
    padding-left: 14px;
}

.etriton-modern .em-nav .em-submenu a {
    display: block;
    padding: 8px 20px 8px 46px;
    font-size: 13px;
    color: var(--em-sidebar-text);
}

.etriton-modern .em-nav .em-submenu-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px 8px 46px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--em-sidebar-text);
}

.etriton-modern .em-main {
    margin-left: var(--em-sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.etriton-modern .em-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    height: var(--em-topbar-h);
    background: var(--em-surface);
    border-bottom: 1px solid var(--em-border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 16px;
}

.etriton-modern .em-sidebar-toggle {
    display: none;
    border: 0;
    background: transparent;
    font-size: 18px;
    color: var(--em-text);
    cursor: pointer;
}

.etriton-modern .em-topbar-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--em-text);
}

.etriton-modern .em-topbar-spacer {
    flex: 1;
}

.etriton-modern .em-user-menu a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--em-text);
    font-weight: 600;
    font-size: 13.5px;
}

.etriton-modern .em-content {
    padding: 24px;
    flex: 1;
}

/* ---------- Cards ---------- */

.etriton-modern .em-card {
    background: var(--em-surface);
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius);
    box-shadow: var(--em-shadow);
    padding: 20px 22px;
    margin-bottom: 20px;
}

.etriton-modern .em-card-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--em-text);
}

/* ---------- Forms (aplica a controles de servidor sin tocar su ID) ---------- */

.etriton-modern .em-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px 20px;
    align-items: end;
}

.etriton-modern .em-field label,
.etriton-modern .em-field-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--em-text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.etriton-modern input[type="text"],
.etriton-modern input[type="password"],
.etriton-modern input[type="email"],
.etriton-modern select,
.etriton-modern textarea {
    /* Ancho contenido por defecto (paginas viejas con table.filter, sin grid). */
    width: auto;
    min-width: 220px;
    max-width: 320px;
    padding: 8px 10px;
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius-sm);
    font-size: 13.5px;
    background: var(--em-surface);
    color: var(--em-text);
}

/* Dentro del grid nuevo (Login, Transaction Search) si queremos que ocupen
   toda la columna que les da el grid, no un ancho fijo. */
.etriton-modern .em-form-grid input[type="text"],
.etriton-modern .em-form-grid input[type="password"],
.etriton-modern .em-form-grid select,
.etriton-modern .em-auth-field input[type="text"],
.etriton-modern .em-auth-field input[type="password"],
.etriton-modern .em-auth-captcha input[type="text"] {
    width: 100%;
    max-width: none;
}

.etriton-modern input[type="text"]:focus,
.etriton-modern input[type="password"]:focus,
.etriton-modern select:focus {
    outline: none;
    border-color: var(--em-primary);
    box-shadow: 0 0 0 3px var(--em-primary-soft);
}

.etriton-modern .em-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.etriton-modern input[type="submit"],
.etriton-modern input[type="button"],
.etriton-modern .em-btn,
.etriton-modern .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--em-radius-sm);
    border: 1px solid var(--em-primary);
    background: var(--em-primary);
    color: #fff !important;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    text-decoration: none !important;
}

.etriton-modern input[type="submit"]:hover,
.etriton-modern .em-btn:hover,
.etriton-modern .btn:hover {
    background: var(--em-primary-dark);
    border-color: var(--em-primary-dark);
}

.etriton-modern .em-btn-secondary,
.etriton-modern .btn-default {
    background: var(--em-surface);
    border-color: var(--em-border);
    color: var(--em-text) !important;
}

.etriton-modern .em-btn-secondary:hover,
.etriton-modern .btn-default:hover {
    background: var(--em-bg);
}

/* ---------- Tablas de formulario ".filter" heredadas (sin reescribir markup) ---------- */

.etriton-modern .em-content > table.filter,
.etriton-modern .em-content table.filter {
    background: var(--em-surface);
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius);
    box-shadow: var(--em-shadow);
    padding: 18px 20px;
    margin-bottom: 20px;
    border-collapse: separate;
}

.etriton-modern table.filter td {
    padding: 8px 10px;
    border: 0;
    vertical-align: middle;
}

/* ---------- Tablas / GridView ---------- */

.etriton-modern .table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: var(--em-surface);
}

.etriton-modern .table th {
    background: #f8f9fb;
    color: var(--em-text-muted);
    text-transform: uppercase;
    font-size: 11.5px;
    letter-spacing: .3px;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--em-border);
    white-space: nowrap;
}

.etriton-modern .table td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--em-border);
}

.etriton-modern .table-striped tr:nth-child(even) td {
    background: #fafafa;
}

.etriton-modern .table-hover tr:hover td {
    background: var(--em-primary-soft);
}

.etriton-modern .table-responsive {
    overflow-x: auto;
    border-radius: var(--em-radius);
    border: 1px solid var(--em-border);
}

/* ---------- Errores / validacion ---------- */

.etriton-modern .SummaryErrors,
.etriton-modern .em-error {
    display: block;
    background: var(--em-primary-soft);
    border: 1px solid var(--em-primary);
    color: var(--em-primary-dark);
    border-radius: var(--em-radius-sm);
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 13px;
}

.etriton-modern .SummaryErrors:empty,
.etriton-modern .em-error:empty {
    display: none;
    padding: 0;
    margin: 0;
    border: 0;
}

/* ---------- Login (pagina independiente, sin master) ---------- */

.etriton-modern.em-auth-page {
    min-height: 100vh;
    background: linear-gradient(160deg, #001c42 0%, #060a18 65%, #0a0e1c 100%);
}

.etriton-modern .em-auth-layout {
    display: flex;
    min-height: 100vh;
}

.etriton-modern .em-auth-visual {
    flex: 1 1 55%;
    overflow: hidden;
}

.etriton-modern .em-auth-visual-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 96% center;
    display: block;
}

.etriton-modern .em-auth-form-panel {
    flex: 1 1 45%;
    min-width: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

@media (max-width: 860px) {
    .etriton-modern .em-auth-visual {
        display: none;
    }
}

.etriton-modern .em-auth-wrap {
    width: 100%;
    max-width: 380px;
}

.etriton-modern .em-auth-card {
    width: 100%;
    background: var(--em-surface);
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
    padding: 34px 30px;
}

.etriton-modern .em-auth-logo {
    display: block;
    max-height: 34px;
    margin: 0 auto 24px;
}

.etriton-modern .em-auth-title {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 22px;
}

.etriton-modern .em-auth-field {
    margin-bottom: 16px;
}

.etriton-modern .em-auth-captcha {
    margin-bottom: 16px;
}

.etriton-modern .em-auth-submit {
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .etriton-modern .em-sidebar {
        transform: translateX(-100%);
    }

    .etriton-modern .em-sidebar.em-open {
        transform: translateX(0);
    }

    .etriton-modern .em-main {
        margin-left: 0;
    }

    .etriton-modern .em-sidebar-toggle {
        display: inline-flex;
    }
}
