/* Fenix - estilo minimalista */
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f7f8fa;
    color: #1f2937;
    font-size: 14px;
}
.topbar {
    background: linear-gradient(180deg, #1e40af 0%, #1d3a9e 100%);
    color: white;
    padding: 0.55rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    position: sticky;
    top: 0;
    z-index: 60;
}
.topbar .brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    margin-right: 1.75rem;
}
.topbar .brand-logo {
    height: 52px;
    width: auto;
    display: block;
}
/* Ícono de los menús principales (Asientos, Reportes, etc.) */
.topbar .menu .ico {
    font-size: .95rem;
    margin-right: .35rem;
    line-height: 1;
}

/* ---- Menú con desplegables ---- */
.topbar .menu {
    display: flex;
    gap: 0.15rem;
    flex: 1;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    flex-wrap: wrap;
}
.topbar .menu > li { position: relative; }
.topbar .menu > li > a,
.topbar .menu > li > .group-label {
    display: inline-flex;
    align-items: center;
    gap: .15rem;
    color: rgba(255,255,255,0.92);
    text-decoration: none;
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    font-size: 0.92rem;
    font-family: inherit;
    white-space: nowrap;
    background: transparent;
    border: 0;
    cursor: pointer;
}
.topbar .menu > li > a:hover,
.topbar .menu > li > .group-label:hover,
.topbar .menu > li:focus-within > .group-label {
    background: rgba(255,255,255,0.16);
    color: #fff;
}
.topbar .menu > li.active > a,
.topbar .menu > li.active > .group-label {
    background: rgba(255,255,255,0.22);
    color: #fff;
    font-weight: 600;
}
.topbar .menu .caret { font-size: 0.62rem; opacity: 0.85; }

.topbar .dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 212px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.20);
    padding: 0.35rem;
    margin: 0;
    list-style: none;
    display: none;
    z-index: 70;
}
/* Puente invisible que rellena el hueco de 4px entre el botón y el menú,
   para que el mouse no pierda el :hover al bajar y el menú no se cierre. */
.topbar .dropdown::before {
    content: "";
    position: absolute;
    top: -4px;
    left: 0;
    right: 0;
    height: 4px;
}
.topbar .menu > li:hover .dropdown,
.topbar .menu > li:focus-within .dropdown { display: block; }
.topbar .dropdown li a {
    display: block;
    color: #1f2937;
    text-decoration: none;
    padding: 0.45rem 0.7rem;
    border-radius: 6px;
    font-size: 0.88rem;
    white-space: nowrap;
}
.topbar .dropdown li a:hover { background: #eff6ff; color: #1e40af; }
.topbar .dropdown .sep { height: 1px; background: #e5e7eb; margin: 0.3rem 0.25rem; }

.topbar .empresa-switcher { display: flex; align-items: center; gap: .4rem; }
.topbar .empresa-switcher label { font-size: .8rem; opacity: .9; }
.topbar .empresa-switcher select {
    padding: 0.32rem 0.5rem;
    border-radius: 6px;
    border: 0;
    font-size: 0.88rem;
    background: #fff;
    color: #1f2937;
}
.container {
    max-width: 1280px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}
h1 { font-size: 1.6rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.2rem; }
.subtitle { color: #6b7280; margin-top: 0; }

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}
.card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    border-top: 3px solid #1e40af;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: transform .12s ease, box-shadow .12s ease;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(30,64,175,0.12);
}
.card-label { color: #6b7280; font-size: 0.85rem; }
.card-value { font-size: 1.6rem; font-weight: 600; margin-top: 0.25rem; color: #1e3a8a; }

.balance-box {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    max-width: 500px;
}
.balance-box table { width: 100%; }
.balance-box td { padding: 0.25rem 0.5rem; }
.balance-box .num { text-align: right; font-variant-numeric: tabular-nums; }
.balance-box tr.ok { color: #059669; font-weight: 600; }
.balance-box tr.warn { color: #dc2626; font-weight: 600; }

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #1e40af;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    margin-right: 0.5rem;
    box-shadow: 0 1px 2px rgba(30,64,175,0.25);
    transition: background .12s ease, transform .12s ease, box-shadow .12s ease;
}
.btn:hover { background: #1e3a8a; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(30,64,175,0.30); }

.filtros {
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    display: flex;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.filtros label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; }
.filtros input, .filtros select {
    padding: 0.4rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.9rem;
}
.filtros button {
    padding: 0.5rem 1rem;
    background: #1e40af;
    color: white;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}

table.grid {
    width: 100%;
    background: white;
    border-collapse: collapse;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    font-size: 0.88rem;
}
table.grid th {
    background: #f3f4f6;
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
}
table.grid td {
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid #f3f4f6;
}
table.grid tr:hover { background: #f9fafb; }
table.grid .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
table.grid .total-row { background: #f3f4f6; font-weight: 600; }

.meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    background: white;
    padding: 1rem 1.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin: 1rem 0;
}

.pagination {
    margin: 1rem 0;
    text-align: center;
}
.pagination a { margin: 0 0.5rem; }

.warn { color: #dc2626; }
.ok { color: #059669; }

.badge-ok, .badge-info {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-ok { background: #d1fae5; color: #065f46; }
.badge-info { background: #dbeafe; color: #1e40af; }

footer {
    text-align: center;
    color: #6b7280;
    padding: 2rem;
    border-top: 1px solid #e5e7eb;
    margin-top: 3rem;
}

/* ---- Reportes: EERR + EP ------------------------------------------- */
.eerr-grid, .eep-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 1rem 0;
}
@media (max-width: 900px) {
    .eerr-grid, .eep-grid { grid-template-columns: 1fr; }
}
.eerr-block, .eep-block { min-width: 0; }
.eerr-block h2, .eep-block h2 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    color: #1e40af;
}
.eep-block h3 {
    font-size: 0.95rem;
    color: #6b7280;
    margin: 1rem 0 0.5rem;
}
.muted { color: #9ca3af; text-align: center; font-style: italic; }

.resumen-box {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    max-width: 520px;
}
.resumen-box.positive { border-color: #059669; }
.resumen-box.negative { border-color: #dc2626; }
.resumen-box table { width: 100%; }
.resumen-box td { padding: 0.3rem 0; }
.resumen-box .num { text-align: right; font-variant-numeric: tabular-nums; }
.resumen-box tr.total td {
    border-top: 1px solid #e5e7eb;
    padding-top: 0.5rem;
    font-size: 1.05rem;
}

/* Selector de moneda tipo grupo de botones (igual que el mayor). */
.moneda-vista {
    display: inline-flex; gap: 0; align-items: center;
    border: 1px solid #d1d5db; border-radius: 4px; overflow: hidden;
    vertical-align: middle;
}
.moneda-vista label {
    padding: 0.4rem 0.7rem;
    background: white; color: #6b7280;
    cursor: pointer; font-size: 0.85rem;
    border-right: 1px solid #d1d5db;
    margin: 0;
}
.moneda-vista label:last-child { border-right: 0; }
.moneda-vista input { display: none; }
.moneda-vista input:checked + label { background: #1e40af; color: white; }
