/* ═══════════════════════════════════════════════════════════
   Bill Style Variants
   Scoped under [data-bill-style="..."] on #bill-pdf-target
   ═══════════════════════════════════════════════════════════ */


/* ====================== CLEAN STYLE ====================== */

[data-bill-style="clean"] {
  font-family: 'DM Sans', -apple-system, sans-serif;
  font-size: 12px;
  color: #2d2d2d;
  line-height: 1.45;
  padding: 24px 32px;
}

/* Header */
[data-bill-style="clean"] .header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
[data-bill-style="clean"] .header h1 {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: -0.02em;
  margin: 0;
}
[data-bill-style="clean"] .header .sub {
  font-size: 12px;
  color: #999;
  margin-top: 3px;
}
[data-bill-style="clean"] .header .inv {
  text-align: right;
}
[data-bill-style="clean"] .header .inv-number {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: -0.02em;
}
[data-bill-style="clean"] .header .inv-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #bbb;
  font-weight: 600;
}

/* Separator */
[data-bill-style="clean"] .sep {
  height: 1px;
  background: #eee;
  margin: 0 0 8px 0;
}

/* Two-column info */
[data-bill-style="clean"] .info-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 16px;
}
[data-bill-style="clean"] .info-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #bbb;
  font-weight: 600;
  margin-bottom: 4px;
}
[data-bill-style="clean"] .info-val { font-size: 12px; }
[data-bill-style="clean"] .info-val strong { font-weight: 600; color: #1a1a1a; }

/* Key figures strip */
[data-bill-style="clean"] .key-figures {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: #eee;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 6px;
}
[data-bill-style="clean"] .key-fig {
  background: #fff;
  padding: 10px 12px;
  text-align: center;
}
[data-bill-style="clean"] .key-fig .kf-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #bbb;
  font-weight: 600;
  margin-bottom: 4px;
}
[data-bill-style="clean"] .key-fig .kf-value {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a1a;
}
[data-bill-style="clean"] .key-fig .kf-sub {
  font-size: 10px;
  color: #bbb;
  margin-top: 2px;
}
[data-bill-style="clean"] .key-fig.highlight { background: #f0fdfa; }
[data-bill-style="clean"] .key-fig.highlight .kf-value {
  color: var(--color-primary-600);
  font-size: 16px;
  font-weight: 800;
}

/* Note / message */
[data-bill-style="clean"] .note {
  font-size: 11px;
  color: #999;
  padding: 6px 0;
  border-bottom: 1px solid #eee;
  margin-bottom: 6px;
}

/* Table - minimal */
[data-bill-style="clean"] table.items {
  width: 100%;
  border-collapse: collapse;
}
[data-bill-style="clean"] table.items thead th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: #bbb;
  padding: 0 0 8px 0;
  border-bottom: 1px solid #1a1a1a;
  text-align: left;
}
[data-bill-style="clean"] table.items thead th.r { text-align: right; }
[data-bill-style="clean"] table.items tbody td {
  padding: 5px 0;
  border-bottom: none;
  font-size: 13px;
}
[data-bill-style="clean"] table.items tbody td.r {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
[data-bill-style="clean"] .text-dim { color: #bbb; }

/* Totals */
[data-bill-style="clean"] .totals-section {
  border-top: 2px solid #1a1a1a;
  margin-top: 2px;
  padding-top: 6px;
}
[data-bill-style="clean"] .totals-row {
  display: flex;
  justify-content: space-between;
  padding: 1px 0;
  font-size: 12px;
}
[data-bill-style="clean"] .totals-row .t-label { color: #999; }
[data-bill-style="clean"] .totals-row .t-value { font-variant-numeric: tabular-nums; }
[data-bill-style="clean"] .totals-row.bold .t-label { color: #1a1a1a; font-weight: 600; }
[data-bill-style="clean"] .totals-row.bold .t-value { font-weight: 600; }
[data-bill-style="clean"] .totals-row.grand {
  margin-top: 2px;
  padding: 4px 0 0;
  border-top: 1px solid #eee;
  font-size: 15px;
}
[data-bill-style="clean"] .totals-row.grand .t-label { color: #1a1a1a; font-weight: 700; }
[data-bill-style="clean"] .totals-row.grand .t-value { font-weight: 700; color: var(--color-primary-600); }

/* Rate reference */
[data-bill-style="clean"] .rate-ref {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #eee;
}
[data-bill-style="clean"] .rate-ref h4 {
  font-size: 11px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 6px 0;
  letter-spacing: -0.01em;
}
[data-bill-style="clean"] .rate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
[data-bill-style="clean"] .rate-group .rg-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #bbb;
  font-weight: 600;
  margin-bottom: 6px;
}
[data-bill-style="clean"] .rate-group ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
[data-bill-style="clean"] .rate-group ul li {
  font-size: 11px;
  color: #666;
  padding: 2px 0;
}
[data-bill-style="clean"] .rate-group ul li .rate-val {
  font-weight: 600;
  color: #2d2d2d;
}
[data-bill-style="clean"] .rate-notes {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eee;
  font-size: 11px;
  color: #999;
  white-space: pre-line;
}

/* Footer */
[data-bill-style="clean"] .footer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eee;
  font-size: 11px;
  color: #bbb;
  text-align: center;
}


/* ====================== CLASSIC STYLE ====================== */

[data-bill-style="classic"] {
  font-family: 'Source Sans 3', 'Georgia', serif;
  font-size: 13px;
  color: #1a1a1a;
  line-height: 1.5;
}

/* Banner */
[data-bill-style="classic"] .banner {
  background: #1a3a4a;
  color: #fff;
  padding: 24px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 4px solid #2a8a7a;
}
[data-bill-style="classic"] .banner h1 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
[data-bill-style="classic"] .banner .subtitle {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 2px;
}
[data-bill-style="classic"] .banner .invoice-num {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 13px;
  background: rgba(255,255,255,0.15);
  padding: 6px 14px;
  border-radius: 4px;
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* Body */
[data-bill-style="classic"] .body {
  padding: 28px 32px;
}

/* Statement header */
[data-bill-style="classic"] .stmt-header {
  text-align: center;
  font-family: 'Merriweather', Georgia, serif;
  font-size: 16px;
  font-weight: 700;
  color: #1a3a4a;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding-bottom: 16px;
  border-bottom: 2px solid #1a3a4a;
  margin-bottom: 20px;
}

/* Info row */
[data-bill-style="classic"] .info-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 24px;
}
[data-bill-style="classic"] .info-block { flex: 1; }
[data-bill-style="classic"] .info-block.right { text-align: right; }
[data-bill-style="classic"] .info-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
  font-weight: 600;
  margin-bottom: 4px;
}
[data-bill-style="classic"] .info-value { font-size: 13px; line-height: 1.6; }
[data-bill-style="classic"] .info-value strong { font-weight: 700; }

/* Usage box */
[data-bill-style="classic"] .usage-box {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 16px;
  border: 2px solid #2a8a7a;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  color: #1a3a4a;
}
[data-bill-style="classic"] .usage-box .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  font-weight: 600;
  display: block;
}
[data-bill-style="classic"] .usage-detail {
  font-size: 11px;
  color: #888;
  margin-top: 4px;
}

/* Message box */
[data-bill-style="classic"] .msg-box {
  background: #f7f5f2;
  border-left: 3px solid #2a8a7a;
  padding: 10px 14px;
  font-size: 12px;
  color: #555;
  margin-bottom: 20px;
  font-style: italic;
}

/* Ledger table */
[data-bill-style="classic"] table.ledger {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0;
}
[data-bill-style="classic"] table.ledger thead th {
  background: #f0ece7;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #555;
  padding: 8px 12px;
  border-top: 1px solid #c8c3bb;
  border-bottom: 1px solid #c8c3bb;
  text-align: left;
}
[data-bill-style="classic"] table.ledger thead th.r { text-align: right; }
[data-bill-style="classic"] table.ledger tbody td {
  padding: 7px 12px;
  border-bottom: 1px solid #eae7e2;
  font-size: 13px;
}
[data-bill-style="classic"] table.ledger tbody td.r {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
[data-bill-style="classic"] table.ledger tfoot td {
  padding: 6px 12px;
  font-size: 13px;
}
[data-bill-style="classic"] table.ledger tfoot td.r {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
[data-bill-style="classic"] table.ledger tfoot .subtotal-row td { border-top: 1px solid #ddd; }
[data-bill-style="classic"] table.ledger tfoot .label-cell { text-align: right; color: #888; }
[data-bill-style="classic"] table.ledger tfoot .total-row td {
  border-top: 2px solid #1a3a4a;
  font-size: 16px;
  font-weight: 700;
  padding: 10px 12px;
  color: #1a3a4a;
}
[data-bill-style="classic"] .text-muted { color: #888; }
[data-bill-style="classic"] .text-green { color: #16a34a; }
[data-bill-style="classic"] .text-red { color: #dc2626; }

/* Rate schedule */
[data-bill-style="classic"] .rate-section {
  margin-top: 24px;
  padding: 16px;
  background: #f7f5f2;
  border: 1px solid #e0dbd4;
}
[data-bill-style="classic"] .rate-section h3 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 13px;
  font-weight: 700;
  color: #1a3a4a;
  margin: 0 0 12px 0;
}
[data-bill-style="classic"] .rate-section .rate-group-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #888;
  margin-bottom: 4px;
  margin-top: 10px;
}
[data-bill-style="classic"] .rate-section .rate-group-label:first-of-type { margin-top: 0; }
[data-bill-style="classic"] .rate-section ul {
  list-style: none;
  padding: 0;
  margin: 0 0 8px 0;
}
[data-bill-style="classic"] .rate-section ul li {
  font-size: 12px;
  padding: 2px 0 2px 12px;
  position: relative;
  color: #444;
}
[data-bill-style="classic"] .rate-section ul li::before {
  content: "\2022";
  position: absolute;
  left: 0;
  color: #2a8a7a;
}

/* Footer */
[data-bill-style="classic"] .footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #ddd;
  font-size: 11px;
  color: #888;
  text-align: center;
}

/* Tear-off */
[data-bill-style="classic"] .tear-off {
  border-top: 2px dashed #c8c3bb;
  margin-top: 24px;
  padding: 16px 32px;
  background: #fafaf8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
[data-bill-style="classic"] .tear-off .tear-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  font-weight: 600;
}
[data-bill-style="classic"] .tear-off .tear-value {
  font-weight: 700;
  font-size: 14px;
  color: #1a3a4a;
}


/* ====================== MODERN STYLE ====================== */

[data-bill-style="modern"] {
  font-family: 'Figtree', -apple-system, sans-serif;
  font-size: 13px;
  color: #1c1917;
  line-height: 1.5;
  overflow: hidden;
  border-radius: 16px;
}

/* Gradient header */
[data-bill-style="modern"] .header {
  background: linear-gradient(135deg, var(--color-primary-600) 0%, var(--color-primary-800) 60%, var(--color-primary-700) 100%);
  color: #fff;
  padding: 32px;
  position: relative;
  overflow: hidden;
}
[data-bill-style="modern"] .header::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}
[data-bill-style="modern"] .header::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: 30%;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
}
[data-bill-style="modern"] .header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  z-index: 1;
}
[data-bill-style="modern"] .header h1 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0;
}
[data-bill-style="modern"] .header .address {
  font-size: 12px;
  opacity: 0.75;
  margin-top: 4px;
}
[data-bill-style="modern"] .invoice-badge {
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(8px);
  padding: 8px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* Amount hero */
[data-bill-style="modern"] .amount-hero {
  position: relative;
  z-index: 1;
  margin-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
[data-bill-style="modern"] .amount-hero .total-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.7;
  margin-bottom: 4px;
}
[data-bill-style="modern"] .amount-hero .total-amount {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
[data-bill-style="modern"] .amount-hero .period-pill {
  background: rgba(255,255,255,0.15);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* Body */
[data-bill-style="modern"] .body {
  padding: 28px 32px;
}

/* Info cards */
[data-bill-style="modern"] .info-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
[data-bill-style="modern"] .info-card {
  background: #fafaf9;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #e7e5e4;
}
[data-bill-style="modern"] .info-card .ic-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a8a29e;
  font-weight: 600;
  margin-bottom: 6px;
}
[data-bill-style="modern"] .info-card .ic-value { font-size: 13px; line-height: 1.6; }
[data-bill-style="modern"] .info-card .ic-value strong { font-weight: 700; }

/* Usage strip */
[data-bill-style="modern"] .usage-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
  border: 1px solid #99f6e4;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 24px;
}
[data-bill-style="modern"] .usage-strip .usage-icon {
  width: 40px;
  height: 40px;
  background: var(--color-primary-600);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}
[data-bill-style="modern"] .usage-strip .usage-main { flex: 1; }
[data-bill-style="modern"] .usage-strip .usage-val {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary-800);
}
[data-bill-style="modern"] .usage-strip .usage-detail {
  font-size: 11px;
  color: var(--color-primary-700);
  margin-top: 1px;
}

/* Message */
[data-bill-style="modern"] .msg {
  font-size: 12px;
  color: #78716c;
  background: #fafaf9;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  border-left: 3px solid #2dd4bf;
}

/* Table */
[data-bill-style="modern"] table.line-items {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0;
}
[data-bill-style="modern"] table.line-items thead th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: #a8a29e;
  padding: 10px 14px;
  border-bottom: 2px solid #e7e5e4;
  text-align: left;
}
[data-bill-style="modern"] table.line-items thead th.r { text-align: right; }
[data-bill-style="modern"] table.line-items tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid #f5f5f4;
  font-size: 13px;
}
[data-bill-style="modern"] table.line-items tbody td.r {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
[data-bill-style="modern"] table.line-items tbody tr:last-child td { border-bottom: none; }

/* Totals */
[data-bill-style="modern"] .totals {
  border-top: 2px solid #e7e5e4;
  padding-top: 12px;
  margin-top: 4px;
}
[data-bill-style="modern"] .totals .row {
  display: flex;
  justify-content: space-between;
  padding: 5px 14px;
  font-size: 13px;
}
[data-bill-style="modern"] .totals .row .label { color: #78716c; }
[data-bill-style="modern"] .totals .row .value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
[data-bill-style="modern"] .totals .row.current .label { font-weight: 600; color: #1c1917; }
[data-bill-style="modern"] .totals .row.current .value { font-weight: 600; }
[data-bill-style="modern"] .totals .grand-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding: 14px;
  background: linear-gradient(135deg, var(--color-primary-800), var(--color-primary-600));
  border-radius: 12px;
  color: #fff;
}
[data-bill-style="modern"] .totals .grand-total .label {
  font-weight: 700;
  font-size: 14px;
}
[data-bill-style="modern"] .totals .grand-total .value {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 22px;
  font-weight: 800;
}

/* Rate box */
[data-bill-style="modern"] .rate-box {
  margin-top: 24px;
  background: #fafaf9;
  border: 1px solid #e7e5e4;
  border-radius: 14px;
  padding: 18px;
}
[data-bill-style="modern"] .rate-box h3 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary-800);
  margin: 0 0 12px 0;
}
[data-bill-style="modern"] .rate-box .rate-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: #a8a29e;
  margin-bottom: 4px;
  margin-top: 10px;
}
[data-bill-style="modern"] .rate-box .rate-label:first-of-type { margin-top: 0; }
[data-bill-style="modern"] .rate-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
[data-bill-style="modern"] .rate-box ul li {
  font-size: 12px;
  padding: 3px 0 3px 16px;
  position: relative;
  color: #57534e;
}
[data-bill-style="modern"] .rate-box ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  background: #2dd4bf;
  border-radius: 50%;
}

/* Footer */
[data-bill-style="modern"] .footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #e7e5e4;
  text-align: center;
  font-size: 11px;
  color: #a8a29e;
}
