/* ==========================================================================
   Adzra Billing — dashboard redesign (v3)
   Loaded after adzra-theme-v2.css. Scoped to the .dz-* dashboard namespace.
   ========================================================================== */

.dz-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ------------------------------------------------------------- hero band --- */
.dz-hero {
  position: relative;
  overflow: hidden;
  padding: 18px 20px 17px;
  border-radius: 18px;
  color: #eafcf8;
  background:
    radial-gradient(120% 160% at 0% -30%, rgba(120, 240, 210, .30) 0%, rgba(120, 240, 210, 0) 55%),
    radial-gradient(110% 150% at 100% 0%, rgba(168, 217, 46, .22) 0%, rgba(168, 217, 46, 0) 55%),
    linear-gradient(118deg, #073e55 0%, #046872 45%, #07906a 100%);
  box-shadow: 0 1px 2px rgba(6, 46, 52, .3), 0 24px 44px -30px rgba(6, 46, 52, .9);
}

.dz-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(160deg, rgba(0, 0, 0, .55), transparent 65%);
  mask-image: linear-gradient(160deg, rgba(0, 0, 0, .55), transparent 65%);
}

.dz-hero-main {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 26px;
}

.dz-hero-id {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.dz-hero-glyph {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-size: 21px;
  color: #d8fff4;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}

.dz-hero-idtext { min-width: 0; }

.dz-hero-name {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.015em;
  line-height: 1.15;
  color: #fff;
  overflow-wrap: anywhere;
}

.dz-hero-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 6px;
  font-size: 12px;
  color: rgba(226, 250, 246, .8);
}

.dz-hero-chips span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.dz-hero-chips i { opacity: .72; font-size: 12px; }

.dz-hero-clock {
  margin-left: auto;
  text-align: right;
  padding-left: 18px;
  border-left: 1px solid rgba(255, 255, 255, .16);
}

.dz-clock-time {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.dz-clock-date {
  margin-top: 5px;
  font-size: 12px;
  color: rgba(226, 250, 246, .78);
}

.dz-clock-uptime {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  color: #d8fff4;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
}

/* live resource bars */
.dz-hero-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 24px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .14);
}

.dz-hstat { min-width: 0; }

.dz-hstat-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.dz-hstat-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: rgba(226, 250, 246, .72);
}

.dz-hstat-value {
  font-size: 13.5px;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.dz-track {
  height: 6px;
  margin-top: 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .17);
  overflow: hidden;
}

.dz-track > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #7ff0c4, #ddff9c);
  transition: width .5s ease;
}

.dz-hstat.is-warn .dz-track > i { background: linear-gradient(90deg, #ffd98a, #ffb44c); }
.dz-hstat.is-danger .dz-track > i { background: linear-gradient(90deg, #ffb9ad, #ff7f6f); }

.dz-hstat-hint {
  margin-top: 5px;
  font-size: 10.5px;
  color: rgba(226, 250, 246, .6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ------------------------------------------------------------ KPI tiles --- */
#r_2.dz-kpis,
.dz-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.dz-kpi {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  padding: 15px 15px 15px 16px;
  color: var(--az-ink);
  background: var(--az-surface);
  border: 1px solid var(--az-line);
  border-radius: 15px;
  box-shadow: var(--az-shadow-sm);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.dz-kpi::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #00b3a4;
}

.dz-kpi:hover {
  transform: translateY(-2px);
  color: var(--az-ink);
  border-color: #cadfe2;
  box-shadow: 0 18px 30px -24px rgba(12, 42, 51, .8);
}

.dz-kpi-ico {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  font-size: 17px;
  color: #00998f;
  background: #e9f7f5;
  border: 1px solid #dcf0ec;
}

.dz-kpi--green .dz-kpi-ico { color: #0a9d6c; background: #e9f7ef; border-color: #d9f0e4; }
.dz-kpi--green::before { background: #0aa06e; }
.dz-kpi--amber .dz-kpi-ico { color: #c9861a; background: #fdf4e3; border-color: #f7e8cd; }
.dz-kpi--amber::before { background: #efa62b; }
.dz-kpi--blue .dz-kpi-ico { color: #0b7fb0; background: #eaf5fb; border-color: #dbeaf5; }
.dz-kpi--blue::before { background: #0b7fb0; }

.dz-kpi-main { min-width: 0; display: block; }

.dz-kpi-value {
  display: block;
  font-size: 25px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.025em;
  color: var(--az-ink);
  font-variant-numeric: tabular-nums;
}

.dz-kpi-unit {
  margin-left: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--az-muted);
}

.dz-kpi-label {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--az-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dz-kpi--action .dz-kpi-value { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.dz-kpi--action { background: #fcfefe; }

.dz-kpi-go {
  margin-left: auto;
  flex: 0 0 auto;
  font-size: 15px;
  color: #b9ccd1;
  transition: color .18s ease, transform .18s ease;
}

.dz-kpi:hover .dz-kpi-go { color: var(--az-teal); transform: translateX(2px); }

/* ----------------------------------------------------------- page layout --- */
.dz-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.58fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.dz-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.dz-col > * { min-width: 0; }

/* --------------------------------------------------------------- cards --- */
.dz-card {
  margin: 0 !important;
  border-radius: 16px !important;
  overflow: hidden;
}

.dz-card-head {
  padding: 12px 16px !important;
  gap: 10px;
}

.dz-card-body { padding: 14px 16px !important; }

.dz-card-title {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--az-ink);
}

.dz-card-title a { color: var(--az-ink); }
.dz-card-title a:hover { color: var(--az-teal); }

.dz-ico {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 13px;
  color: var(--az-teal);
  background: linear-gradient(135deg, #e9f8f4, #eef7fd);
  border: 1px solid #dcf0ec;
}

.dz-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}

.dz-badge--teal { color: #04776f; background: #e6f7f3; border: 1px solid #ccede7; }
.dz-badge--soft { color: #55737c; background: #f2f8f9; border: 1px solid #e2ecee; font-weight: 600; }

.dz-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--az-teal);
  white-space: nowrap;
}

.dz-link:hover { color: #00736f; }
.dz-link i { font-size: 13px; }

.dz-legend {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--az-muted);
  white-space: nowrap;
}

.dz-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  display: inline-block;
  margin-left: 6px;
}

.dz-legend-tx { background: #00998f; }
.dz-legend-rx { background: #0b7fb0; margin-left: 10px; }

/* -------------------------------------------------------------- traffic --- */
.dz-chart { width: 100%; height: 300px; }

/* ---------------------------------------------------------------- logs --- */
.dz-live {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #0a8a63;
  background: #e9f8f0;
  border: 1px solid #d3efe0;
}

.dz-live i { font-size: 6px; animation: dzPulse 1.8s ease-in-out infinite; }

@keyframes dzPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .25; }
}

.dz-log-wrap {
  max-height: 380px;
  overflow: auto;
  border: 1px solid var(--az-line);
  border-radius: 12px;
  background: #fdfefe;
}

.dz-log-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
}

.dz-log-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 12px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #6b8288;
  background: #f6fafb;
  border-bottom: 1px solid var(--az-line-strong);
  white-space: nowrap;
}

.dz-log-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #eef3f4;
  vertical-align: middle;
  color: var(--az-ink-soft);
}

.dz-log-table tbody tr:last-child td { border-bottom: 0; }
.dz-log-table tbody tr:hover td { background: #f6fbfa; }

.dz-log-time {
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 11.5px;
  color: #6b8288;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.dz-log-who {
  color: #24424b;
  font-weight: 600;
  white-space: nowrap;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dz-log-msg { position: relative; padding-left: 24px !important; }

.dz-log-dot {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: #97b3b8;
}

.dz-log-dot.is-ok { background: #0aa06e; box-shadow: 0 0 0 3px rgba(10, 160, 110, .14); }
.dz-log-dot.is-bad { background: #e0483f; box-shadow: 0 0 0 3px rgba(224, 72, 63, .13); }
.dz-log-dot.is-muted { background: #a6bcc1; }
.dz-log-dot.is-info { background: #2f9bd6; box-shadow: 0 0 0 3px rgba(47, 155, 214, .12); }

.dz-log-none {
  padding: 26px 12px !important;
  text-align: center;
  color: var(--az-muted);
}

.dz-log-none i { margin-right: 6px; }

/* --------------------------------------------------------------- income --- */
.dz-income-wrap { min-width: 0; }

.dz-income {
  position: relative;
  overflow: hidden;
  padding: 16px 16px 14px;
  background: var(--az-surface);
  border: 1px solid var(--az-line);
  border-radius: 16px;
  box-shadow: var(--az-shadow);
}

.dz-income::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0b7fb0, #00998f 48%, #a8d92e);
}

.dz-income-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.dz-income-heading { min-width: 0; }

.dz-income-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--az-ink);
  line-height: 1.2;
}

.dz-income-sub {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--az-muted);
}

.dz-income-head .dz-badge { margin-left: auto; }

.dz-income-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.dz-income-period { padding: 0 12px; min-width: 0; }
.dz-income-period:first-child { padding-left: 0; }
.dz-income-period + .dz-income-period { border-left: 1px solid #e9f0f1; }

.dz-income-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--az-muted);
}

.dz-income-total {
  margin: 5px 0 10px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: #173d48;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.dz-income-rows {
  display: grid;
  gap: 6px;
  margin: 0;
}

.dz-income-rows > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
}

.dz-income-rows dt { font-weight: 600; color: #7d9298; }
.dz-income-rows dd { margin: 0; font-weight: 700; color: #34505a; font-variant-numeric: tabular-nums; }
.dz-income-rows dd.is-up { color: #00866b; }

.dz-income-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 11px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  color: #55737c;
  background: #f2f8f9;
  border: 1px solid #e4edef;
}

.dz-income-count i { color: var(--az-teal); font-size: 11px; }

/* ----------------------------------------------------------------- PPP --- */
.dz-chipline {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}

.dz-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  color: #4c6871;
  background: #f5fafb;
  border: 1px solid #e4edef;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

.dz-chip b { color: #173d48; font-variant-numeric: tabular-nums; }
.dz-chip i { color: var(--az-teal); font-size: 11px; }
.dz-chip:hover { color: #06635f; border-color: #cce6e2; background: #eef8f6; }

.dz-chip--go { color: #04776f; border-color: #ccebe6; background: #eaf8f5; }
.dz-chip--go i { font-size: 10px; }

.dz-tablewrap { overflow-x: auto; border-radius: 10px; }

.dz-table { width: 100%; font-size: 12.5px; }
.dz-table th { padding: 7px 9px !important; font-size: 10.5px !important; }
.dz-table td { padding: 7px 9px !important; white-space: nowrap; }

.dz-strong { font-weight: 700; color: #22434d; }
.dz-mono { font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: 11.5px; }
.dz-muted { color: var(--az-muted); }

.dz-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 22px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--az-muted);
  background: #fbfdfd;
  border: 1px dashed #dbe8ea;
  border-radius: 12px;
}

.dz-empty i { font-size: 18px; color: #b7ccd1; }
.dz-empty .fa-spin { color: var(--az-teal); }

/* --------------------------------------------------------------- notice --- */
.dz-notice {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: #245d3f;
  background: #e9f8f0;
  border: 1px solid #c3e9d5;
}

.dz-notice i { color: #0a9d6c; }

/* ----------------------------------------------------------- responsive --- */
@media (max-width: 1200px) {
  .dz-grid { grid-template-columns: minmax(0, 1fr); }
  #r_2.dz-kpis, .dz-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .dz-hero-clock {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
    text-align: left;
  }
  .dz-hero-main { gap: 14px; }
  .dz-clock-time { font-size: 26px; }
  .dz-chart { height: 260px; }
}

@media (max-width: 620px) {
  .dz-page { gap: 12px; }
  .dz-hero { padding: 15px 15px 14px; border-radius: 15px; }
  .dz-hero-stats { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .dz-hero-glyph { width: 42px; height: 42px; font-size: 18px; }
  .dz-hero-name { font-size: 18px; }
  #r_2.dz-kpis, .dz-kpis { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .dz-kpi { padding: 12px 13px; }
  .dz-kpi-value { font-size: 22px; }
  .dz-income-grid { grid-template-columns: minmax(0, 1fr); }
  .dz-income-period { padding: 0; }
  .dz-income-period + .dz-income-period {
    margin-top: 12px;
    padding-top: 12px;
    border-left: 0;
    border-top: 1px solid #e9f0f1;
  }
  .dz-chart { height: 220px; }
  .dz-log-table thead th:nth-child(2),
  .dz-log-table tbody td:nth-child(2) { display: none; }
}

@media print {
  .dz-hero { background: #fff !important; color: #000 !important; box-shadow: none; }
  .dz-hero::after, .dz-live { display: none; }
  .dz-chart { height: 240px; }
}