/* VTU history page — keep separate so browsers do not serve a stale dashboard.css without these rules */
@keyframes vtu-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==================== VTU & bills history (vhx) ==================== */
body[data-page="vtu-history"] .dash-main {
  background:
    radial-gradient(1100px 380px at 8% -12%, rgba(37, 99, 235, .08), transparent 55%),
    radial-gradient(820px 300px at 100% 0%, rgba(14, 165, 233, .06), transparent 50%),
    #f1f5f9;
}
.vhx {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .85rem;
}
.vhx-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(125deg, #1d4ed8 0%, #2563eb 45%, #0ea5e9 100%);
  box-shadow: 0 14px 34px rgba(37, 99, 235, .26);
}
.vhx-hero::after {
  content: '';
  position: absolute;
  inset: -55% -10% auto auto;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255,255,255,.18), transparent 70%);
  pointer-events: none;
}
.vhx-hero-copy { position: relative; z-index: 1; min-width: 0; }
.vhx-hero-eyebrow {
  display: inline-block;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .85;
}
.vhx-hero h1 {
  margin: .25rem 0 .3rem;
  font-family: Poppins, Inter, sans-serif;
  font-size: clamp(1.25rem, 4.2vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.15;
}
.vhx-hero p { margin: 0; font-size: .84rem; line-height: 1.45; opacity: .92; max-width: 34rem; }
.vhx-hero-actions { position: relative; z-index: 1; display: flex; gap: .5rem; flex-wrap: wrap; }

.vhx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-height: 40px;
  padding: .5rem .9rem;
  border-radius: 12px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, box-shadow .15s, border-color .15s, transform .12s;
  -webkit-tap-highlight-color: transparent;
}
.vhx-btn:active { transform: translateY(1px); }
.vhx-btn--light { background: #fff; color: #1d4ed8; box-shadow: 0 4px 14px rgba(2, 21, 66, .16); }
.vhx-btn--ghost {
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .38);
  color: #fff;
}
.vhx-btn--ghost:hover { background: rgba(255, 255, 255, .26); }
.vhx-btn--primary { background: #2563eb; color: #fff; box-shadow: 0 6px 18px rgba(37, 99, 235, .28); }
.vhx-btn--primary:hover { background: #1d4ed8; }
.vhx-btn--soft { background: #eff6ff; color: #1d4ed8; border-color: #dbeafe; }
.vhx-btn--soft:hover { background: #dbeafe; }
.vhx-more .vhx-btn--ghost { background: #fff; border-color: #e2e8f0; color: #334155; }
.vhx-more .vhx-btn--ghost:hover { border-color: #bfdbfe; background: #f8fbff; }

.vhx-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .6rem;
}
.vhx-stat {
  background: #fff;
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 14px;
  padding: .7rem .8rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
  border-left: 3px solid #cbd5e1;
  min-width: 0;
}
.vhx-stat--green { border-left-color: #16a34a; }
.vhx-stat--amber { border-left-color: #f59e0b; }
.vhx-stat--blue { border-left-color: #2563eb; }
.vhx-stat-label {
  display: block;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #94a3b8;
}
.vhx-stat-value {
  display: block;
  margin-top: .15rem;
  font-family: Poppins, Inter, sans-serif;
  font-size: clamp(.95rem, 3.4vw, 1.15rem);
  font-weight: 800;
  letter-spacing: -.02em;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vhx-toolbar {
  background: #fff;
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 16px;
  padding: .85rem .9rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}
.vhx-search {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 0 .75rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  color: #94a3b8;
  transition: border-color .15s, background .15s;
}
.vhx-search:focus-within { border-color: #93c5fd; background: #fff; }
.vhx-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: inherit;
  font-size: 16px;
  color: #0f172a;
  padding: .6rem 0;
}
.vhx-chiprow {
  display: flex;
  gap: .4rem;
  margin-top: .65rem;
  overflow-x: auto;
  padding-bottom: .15rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.vhx-chiprow::-webkit-scrollbar { display: none; }
.vhx-chiprow--status { margin-top: .45rem; }
.vhx-chip {
  flex: 0 0 auto;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  border-radius: 999px;
  padding: .38rem .8rem;
  font-family: inherit;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.vhx-chip:hover { border-color: #bfdbfe; background: #f8fbff; }
.vhx-chip--active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .22);
}
.vhx-chiprow--status .vhx-chip--active {
  background: #0f172a;
  border-color: #0f172a;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .18);
}

.vhx-panel {
  background: #fff;
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
  overflow: hidden;
}
.vhx-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  padding: .9rem 1rem;
  border-bottom: 1px solid #eef2f7;
}
.vhx-panel-head h2 {
  margin: 0;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #0f172a;
}
.vhx-panel-note { font-size: .76rem; color: #94a3b8; }

.vhx-list { display: flex; flex-direction: column; }
.vhx-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.vhx-row:last-child { border-bottom: 0; }
.vhx-row:hover { background: #f8fbff; }
.vhx-details-btn:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.vhx-ic {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  background: #f1f5f9;
  flex-shrink: 0;
}
.vhx-ic--lg { width: 54px; height: 54px; border-radius: 16px; font-size: 1.35rem; }
.vhx-ic--blue { background: #e0edff; }
.vhx-ic--indigo { background: #e8e7ff; }
.vhx-ic--violet { background: #f3e8ff; }
.vhx-ic--amber { background: #fef3c7; }
.vhx-ic--green { background: #dcfce7; }
.vhx-row-main { min-width: 0; }
.vhx-row-title {
  display: block;
  font-size: .88rem;
  font-weight: 700;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vhx-row-meta {
  display: block;
  margin-top: .15rem;
  font-size: .76rem;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vhx-row-tag {
  display: inline-block;
  margin-top: .3rem;
  padding: .1rem .45rem;
  border-radius: 999px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-size: .68rem;
  font-weight: 700;
}
.vhx-row-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .25rem;
  text-align: right;
}
.vhx-row-amt {
  font-family: Poppins, Inter, sans-serif;
  font-size: .92rem;
  font-weight: 800;
  letter-spacing: -.01em;
  color: #0f172a;
  white-space: nowrap;
}
.vhx-details-btn {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  min-height: 36px;
  padding: .4rem .7rem;
  border-radius: 10px;
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: #1d4ed8;
  font-family: inherit;
  font-size: .76rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.vhx-details-btn:hover { background: #dbeafe; border-color: #bfdbfe; }

.vhx-row--skel { cursor: default; }
.vhx-row--skel:hover { background: transparent; }
.vhx-skel {
  display: block;
  border-radius: 8px;
  background: linear-gradient(90deg, #eef2f7 0%, #f8fafc 45%, #eef2f7 90%);
  background-size: 200% 100%;
  animation: vtu-shimmer 1.1s ease-in-out infinite;
}
.vhx-skel--ic { width: 44px; height: 44px; border-radius: 13px; }
.vhx-skel--line { height: 12px; width: 100%; }
.vhx-skel--amt { height: 12px; width: 68px; }

.vhx-more { padding: .9rem 1rem; display: flex; justify-content: center; }
.vhx-more:empty { display: none; }
.vhx-more-note { margin: 0; font-size: .76rem; color: #94a3b8; }
.vhx-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .35rem;
  padding: 2.75rem 1.5rem;
}
.vhx-empty-ic { font-size: 2.1rem; line-height: 1; opacity: .85; }
.vhx-empty strong { font-size: 1rem; color: #0f172a; }
.vhx-empty-note { font-size: .82rem; color: #64748b; max-width: 24rem; line-height: 1.5; }
.vhx-empty .vhx-btn { margin-top: .6rem; }

/* Details sheet */
.vhx-detail-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  padding: .35rem 0 1rem;
  border-bottom: 1px dashed #e2e8f0;
  text-align: center;
}
.vhx-detail-amt {
  font-family: Poppins, Inter, sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: #0f172a;
}
.vhx-detail--ok .vhx-detail-amt { color: #15803d; }
.vhx-detail--bad .vhx-detail-amt { color: #b91c1c; }
.vhx-detail--wait .vhx-detail-amt { color: #b45309; }
.vhx-detail-service { font-size: .84rem; color: #64748b; }
.vhx-secret {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .9rem;
  padding: .7rem .8rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
}
.vhx-secret-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #64748b;
  width: 100%;
}
.vhx-secret-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .92rem;
  font-weight: 700;
  color: #0f172a;
  word-break: break-all;
  flex: 1;
  min-width: 0;
}
.vhx-secret-units { font-size: .76rem; color: #64748b; }
.vhx-dl { margin: .9rem 0 0; }
.vhx-dl-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: .5rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: .84rem;
}
.vhx-dl-row:last-child { border-bottom: 0; }
.vhx-dl-row dt { color: #64748b; flex-shrink: 0; }
.vhx-dl-row dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
  color: #0f172a;
  min-width: 0;
  word-break: break-word;
}
.vhx-dl-row--strong dd { font-weight: 800; }
.vhx-copyline { display: inline-flex; align-items: center; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.vhx-copyline code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .78rem;
  background: #f1f5f9;
  border-radius: 6px;
  padding: .1rem .35rem;
  word-break: break-all;
}
.vhx-linkbtn {
  border: 0;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: .75rem;
  font-weight: 700;
  color: #2563eb;
  cursor: pointer;
}
.vhx-linkbtn:hover { text-decoration: underline; }
.vhx-detail-note {
  margin: .85rem 0 0;
  padding: .6rem .75rem;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: .78rem;
  line-height: 1.45;
}
.vhx-detail-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.vhx-detail-actions .vhx-btn { flex: 1; min-width: 8rem; }

@media (max-width: 720px) {
  .vhx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vhx-hero { padding: 1.1rem 1.05rem; }
  .vhx-hero-actions { width: 100%; }
  .vhx-hero-actions .vhx-btn { flex: 1; }
  .vhx-row {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    grid-template-areas:
      'icon main amount'
      'icon action action';
    row-gap: .55rem;
    padding: .8rem .85rem;
  }
  .vhx-ic { grid-area: icon; width: 42px; height: 42px; }
  .vhx-row-main { grid-area: main; }
  .vhx-row-right { grid-area: amount; }
  .vhx-details-btn { grid-area: action; justify-content: center; width: 100%; }
}
@media (max-width: 380px) {
  .vhx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
  .vhx-row { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .vhx-ic { width: 38px; height: 38px; font-size: 1rem; }
}

/* Details opens as a bottom sheet on phones */
@media (max-width: 640px) {
  body[data-page="vtu-history"] .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  body[data-page="vtu-history"] .modal-card {
    border-radius: 22px 22px 0 0;
    max-height: 88vh;
    transform: translateY(60px);
  }
  body[data-page="vtu-history"] .modal-head {
    position: relative;
    padding-top: 1.35rem;
  }
  body[data-page="vtu-history"] .modal-head::before {
    content: '';
    position: absolute;
    top: .55rem;
    left: 50%;
    transform: translateX(-50%);
    width: 38px;
    height: 4px;
    border-radius: 999px;
    background: #e2e8f0;
  }
  body[data-page="vtu-history"] .modal-body {
    padding: 1rem 1.1rem calc(1.35rem + env(safe-area-inset-bottom, 0px));
  }
}
