*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: Arial, Helvetica, sans-serif; font-size: 14px; background: #eef0f5; color: #222; min-height: 100vh; }

/* ── PANEL CONFIG ── */
#app-panel { max-width: 960px; margin: 28px auto; padding-bottom: 40px; }
.app-header { background: #3a7d1e; color: white; border-radius: 10px 10px 0 0; padding: 20px 28px; display: flex; align-items: center; gap: 18px; }
.app-header-logo { display: flex; align-items: center; gap: 10px; }
.app-header-text h1 { font-size: 20px; font-weight: bold; margin-bottom: 3px; }
.app-header-text p { font-size: 12px; opacity: .85; }

.card { background: #fff; border-left: 1px solid #dde3ed; border-right: 1px solid #dde3ed; border-bottom: 1px solid #dde3ed; padding: 22px 28px; }
.card-title { font-size: 12px; font-weight: bold; color: #3a7d1e; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 14px; padding-bottom: 7px; border-bottom: 2px solid #d4ebc4; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

.fg { display: flex; flex-direction: column; gap: 4px; }
.fg label { font-size: 11px; font-weight: bold; color: #555; text-transform: uppercase; letter-spacing: .3px; }
.fg small { font-size: 10px; color: #888; margin-top: 2px; }
.fg input, .fg select { padding: 8px 11px; border: 1px solid #ccc; border-radius: 5px; font-size: 13px; background: #fafafa; color: #222; }
.fg input:focus, .fg select:focus { outline: none; border-color: #3a7d1e; background: #fff; }

.iess-info-banner { display: flex; align-items: center; gap: 14px; background: #e8f4e8; border: 1px solid #a8d4a8; border-radius: 6px; padding: 10px 14px; margin-bottom: 14px; }
.iess-badge { background: #2e7d32; color: white; font-size: 13px; font-weight: bold; padding: 6px 12px; border-radius: 4px; white-space: nowrap; }
.iess-info-banner strong { font-size: 13px; color: #1b5e20; display: block; margin-bottom: 2px; }
.iess-info-banner p { font-size: 11px; color: #2e7d32; }

.period-btn-group { display: flex; gap: 8px; flex-wrap: wrap; }
.pbtn { padding: 8px 18px; border: 1px solid #3a7d1e; border-radius: 5px; font-size: 13px; cursor: pointer; background: #fff; color: #3a7d1e; font-weight: bold; }
.pbtn:hover { background: #e8f4e0; }
.pbtn.active { background: #3a7d1e; color: #fff; }

.action-bar { background: #3a7d1e; border-radius: 0 0 10px 10px; padding: 18px 28px; display: flex; gap: 12px; }
.btn-primary { flex: 1; padding: 13px 28px; background: #fff; color: #3a7d1e; border: none; border-radius: 6px; font-size: 15px; font-weight: bold; cursor: pointer; }
.btn-primary:hover { background: #e8f4e0; }
.btn-secondary { padding: 13px 22px; background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.5); border-radius: 6px; font-size: 13px; font-weight: bold; cursor: pointer; }

#back-bar { position: sticky; top: 0; z-index: 100; background: #3a7d1e; padding: 10px 0; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.back-bar-inner { max-width: 920px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 0 12px; }
.btn-back { padding: 9px 18px; background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 5px; font-size: 13px; cursor: pointer; }
.btn-print { padding: 9px 18px; background: #1b5e20; color: #fff; border: none; border-radius: 5px; font-size: 13px; font-weight: bold; cursor: pointer; }
.back-bar-info { color: rgba(255,255,255,.8); font-size: 12px; margin-left: auto; }

/* ── ESTADO DE CUENTA ── */
#ec-output { max-width: 920px; margin: 0 auto; padding: 16px 0 40px; }
.ec-month-sep { text-align: center; font-size: 13px; font-weight: bold; color: #3a7d1e; padding: 16px 0 6px; text-transform: uppercase; letter-spacing: .5px; }

.ec-wrapper { font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #000; background: white; margin-bottom: 20px; }
.ec-page { background: white; border: 1px solid #999; margin-bottom: 4px; }

/* ── ENCABEZADO ── */
.ec-head-outer { border-bottom: 2.5px solid #3a7d1e; }

/* Fila superior: info banco izq + logo der */
.ec-head-top { display: flex; border-bottom: 1px solid #ccc; align-items: center; }
.ec-head-bank-info { flex: 1; padding: 5px 8px; font-size: 9px; line-height: 1.7; }
.ec-head-logo-cell {
  padding: 5px 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  border-left: 1px solid #ccc;
  min-width: 140px;
}
/* Texto junto al logo */
.bdl-txt {
  font-size: 13px;
  font-weight: bold;
  color: #2a2a2a;
  font-family: Georgia, serif;
  letter-spacing: .3px;
  white-space: nowrap;
}

/* Fila inferior */
.ec-head-bot { display: flex; }
.ec-head-client { flex: 1; padding: 5px 8px; font-size: 9.5px; line-height: 1.8; border-right: 1px solid #ccc; }
.ec-head-client .cname { font-weight: bold; font-size: 10px; }
.ec-head-session { flex: 1; padding: 5px 8px; font-size: 9.5px; line-height: 1.8; }

/* Título de página */
.ec-page-title { text-align: center; font-weight: bold; font-size: 11px; color: #1a3a6b; padding: 4px; border-bottom: 1px solid #ddd; letter-spacing: .3px; }

/* Cuerpo */
.ec-body { padding: 0 6px 6px; }

/* Títulos de sección — fondo gris exacto del PDF */
.ec-stitle { text-align: center; font-weight: bold; font-size: 10px; background: #c8d0dc; color: #000; padding: 3px 0; margin-top: 7px; border: 0.5px solid #b0baca; }

/* Tablas — cabeceras naranja-dorado exactas del PDF */
.ec-table { width: 100%; border-collapse: collapse; font-size: 9px; }
.ec-table th { background: #e8a820; color: #1a3a6b; font-weight: bold; padding: 2px 5px; border: 0.5px solid #c58a10; text-align: left; font-size: 9px; white-space: nowrap; }
.ec-table td { padding: 2px 5px; border: 0.5px solid #ccc; vertical-align: top; color: #000; font-size: 9px; }

/* Fila total */
.ec-tr-tot td { font-weight: bold; font-size: 9px; border-top: 0.5px solid #aaa; }
.ec-tr-tot .tc-lbl { text-align: right; color: #1a3a6b; }
.ec-tr-tot .tc-val { text-align: right; color: #e8a820; }

/* Pie de página */
.ec-footer { display: flex; border-top: 1px solid #999; margin-top: 6px; font-size: 8px; }
.ec-foot-left { padding: 4px 8px; border-right: 1px solid #ccc; min-width: 185px; }
.ec-foot-left table { border-collapse: collapse; width: 100%; }
.ec-foot-left td { padding: 0.5px 4px 0.5px 0; font-size: 8px; }
.ec-foot-left td:first-child { font-weight: bold; white-space: nowrap; padding-right: 8px; }
.ec-foot-left td:last-child { text-align: right; }
.ec-foot-right { flex: 1; padding: 4px 8px; font-size: 7.5px; line-height: 1.4; color: #333; }

/* Resumen */
.ec-res-table { width: 100%; border-collapse: collapse; font-size: 10px; margin-top: 2px; }
.ec-res-table td { padding: 3px 8px; border: 0.5px solid #ccc; }
.ec-res-table td:last-child { text-align: right; }
.ec-res-table tr:last-child td { font-weight: bold; background: #eef0f8; border-top: 1.5px solid #1a3a6b; }

/* COSEDE */
.ec-cosede { display: flex; align-items: center; justify-content: center; gap: 24px; border: 1px solid #ccc; margin: 8px 4px; padding: 12px 20px; }
.cosede-info { font-size: 11px; line-height: 1.6; }
.cosede-info strong { font-size: 13px; }
.cosede-url { font-weight: bold; font-size: 13px; display: block; margin-top: 3px; }

@media (max-width: 700px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  #app-panel { margin: 8px; }
  .card { padding: 14px; }
  .action-bar { flex-direction: column; }
}
