:root {
  --primary: #7f0f14;
  --primary-dark: #5c0a0e;
  --primary-light: #ad0909;
  --accent: #c9a227;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --success: #047857;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Poppins', system-ui, sans-serif;
  background: linear-gradient(180deg, #faf7f7 0%, var(--bg) 180px, var(--bg) 100%);
  color: var(--text);
  min-height: 100vh;
  padding: 14px 12px 36px;
}
.page { max-width: 760px; margin: 0 auto; }
.site-header {
  background: var(--card);
  border-bottom: 3px solid var(--primary);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow);
  padding: 14px 16px 16px;
}
.site-logo { display: block; text-align: center; margin-bottom: 14px; }
.site-logo img {
  display: block;
  width: 100%;
  max-width: 460px;
  max-height: 78px;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 8px;
}
.site-nav { display: flex; flex-direction: column; gap: 8px; }
.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  transition: transform .15s, opacity .2s;
}
.nav-btn:hover { color: #fff; opacity: .94; transform: translateY(-1px); }
.nav-apgli { background: linear-gradient(135deg, #be185d, #db2777); }
.nav-billstatus { background: linear-gradient(135deg, #7f0f14, #ad0909); }
.nav-payslip { background: linear-gradient(135deg, #92400e, #b45309); }
.nav-telegram { background: linear-gradient(135deg, #1565c0, #1e88e5); }
.nav-whatsapp { background: linear-gradient(135deg, #2e7d32, #43a047); }
.card {
  background: var(--card);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 20px 22px;
}
.page-title {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  text-align: center;
  margin: 0 0 22px;
  padding: 16px 14px;
  border-radius: 12px;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: .02em;
}
.page-subtitle {
  text-align: center;
  color: var(--muted);
  font-size: .92rem;
  margin: -10px 0 22px;
  line-height: 1.5;
}
.ad-wrap { margin: 0 0 20px; text-align: center; }
.payslip-form { display: flex; flex-direction: column; gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-label {
  font-size: .92rem;
  font-weight: 600;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-label i { color: var(--primary); width: 16px; text-align: center; }
.form-input, .form-select {
  width: 100%;
  padding: 13px 14px;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: #111827;
  transition: border-color .2s, box-shadow .2s;
}
.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(127, 15, 20, .12);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-note {
  font-size: .84rem;
  color: var(--muted);
  line-height: 1.55;
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.form-note a { color: var(--primary); font-weight: 600; text-decoration: none; }
.form-note a:hover { text-decoration: underline; }
.btn-primary, .btn-download, .btn-outline, .bill-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  font-weight: 700;
  border-radius: 10px;
  transition: transform .15s, box-shadow .2s, background .2s;
}
.btn-primary {
  width: 100%;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  font-size: 1.02rem;
  box-shadow: 0 6px 18px rgba(127, 15, 20, .24);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(127, 15, 20, .3); }
.btn-download {
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--success), #059669);
  color: #fff;
  font-size: .95rem;
  box-shadow: 0 4px 14px rgba(5, 150, 105, .22);
}
.btn-download:hover { transform: translateY(-1px); }
.btn-outline {
  padding: 10px 16px;
  background: #fff;
  color: var(--primary);
  border: 2px solid var(--primary);
  font-size: .9rem;
}
.btn-outline:hover { background: #fff5f5; }
.alert-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: 12px;
  margin-bottom: 18px;
}
.alert-error {
  background: #fff5f5;
  border: 1px solid #fecaca;
  color: #991b1b;
}
.alert-icon { font-size: 1.3rem; line-height: 1; margin-top: 2px; }
.alert-body p { margin: 0 0 12px; line-height: 1.55; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.bill-card, .payslip-wrap, .info-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 16px;
  margin-bottom: 18px;
}
.data-table, .payslip-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}
.data-table th, .data-table td,
.payslip-table th, .payslip-table td {
  padding: 11px 10px;
  border: 1px solid var(--border);
  text-align: center;
}
.data-table th {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  font-weight: 700;
  font-size: .82rem;
}
.data-table tr:nth-child(even) { background: #fafafa; }
.bill-link {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  padding: 7px 12px;
  font-size: .82rem;
}
.bill-link:hover { background: #dbeafe; }
.payslip-wrap .result-actions,
.status-result .result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.payslip-wrap .result-actions .btn-outline,
.payslip-wrap .result-actions .btn-download,
.status-result .result-actions .btn-outline {
  flex: 1 1 calc(50% - 5px);
  min-width: 0;
}
#payslip {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.4);
}
.payslip-brand {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
  color: #fff;
  text-align: center;
  padding: 18px 16px;
}
.payslip-brand h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: .03em;
}
.payslip-brand p {
  font-size: .82rem;
  opacity: .92;
}
.payslip-meta {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
}
.payslip-meta .meta-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: .86rem;
}
.payslip-meta .meta-item:last-child { border-bottom: none; }
.payslip-meta .meta-label {
  flex: 0 0 42%;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  line-height: 1.35;
}
.payslip-meta .meta-label::after {
  content: " :";
  text-transform: none;
}
.payslip-meta .meta-value {
  flex: 1 1 58%;
  font-weight: 600;
  color: #111827;
  text-align: right;
  word-break: break-word;
}
.payslip-section-title {
  background: #f8fafc;
  color: var(--primary);
  font-weight: 700;
  text-align: center;
  padding: 10px;
  font-size: .88rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.payslip-table th {
  background: #f3f4f6;
  color: #374151;
  font-weight: 700;
  font-size: .8rem;
}
.payslip-table td.amount { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.payslip-table tr.total-row th,
.payslip-table tr.total-row td {
  background: #fff7ed;
  color: #9a3412;
  font-weight: 700;
}
.payslip-table tr.net-row th,
.payslip-table tr.net-row td {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  color: var(--success);
  font-weight: 800;
  font-size: 1rem;
}
.payslip-footer {
  text-align: center;
  padding: 12px;
  font-size: .76rem;
  color: var(--muted);
  background: #fafafa;
  border-top: 1px solid var(--border);
}
.payslip-brand::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin: 10px auto 0;
  border-radius: 2px;
}
.summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.summary-card {
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
  border: 1px solid var(--border);
  background: #fff;
}
.summary-card .sc-label {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: 6px;
}
.summary-card .sc-value {
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.summary-card.gross { border-top: 3px solid #d97706; }
.summary-card.gross .sc-value { color: #b45309; }
.summary-card.deduct { border-top: 3px solid #dc2626; }
.summary-card.deduct .sc-value { color: #b91c1c; }
.summary-card.net {
  border-top: 3px solid var(--success);
  background: linear-gradient(180deg, #ecfdf5 0%, #fff 100%);
}
.summary-card.net .sc-value { color: var(--success); font-size: 1.15rem; }
.info-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 14px;
  overflow: hidden;
}
.info-card summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 700;
  color: var(--primary);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fafafa;
}
.info-card summary::-webkit-details-marker { display: none; }
.info-card summary::after {
  content: "\f078";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: .8rem;
  color: var(--muted);
  transition: transform .2s;
}
.info-card[open] summary::after { transform: rotate(180deg); }
.info-card-body { padding: 14px 16px 16px; }
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}
.detail-item {
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.detail-item .d-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.detail-item .d-value {
  font-size: .88rem;
  font-weight: 600;
  color: #111827;
  word-break: break-word;
}
.flow-table { font-size: .8rem; }
.flow-table th {
  background: var(--primary);
  color: #fff;
  font-size: .74rem;
}
.status-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  background: #ecfdf5;
  color: var(--success);
}
.amount .rupee { font-weight: 700; }
.payslip-table tr.net-row td.amount {
  font-size: 1.1rem;
}
.status-banner {
  border-radius: 12px;
  padding: 18px 16px;
  text-align: center;
  margin-bottom: 18px;
}
.status-banner-success {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 2px solid #6ee7b7;
}
.status-banner-success .status-banner-value { color: var(--success); }
.status-banner-pending {
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border: 2px solid #fdba74;
}
.status-banner-pending .status-banner-value { color: #c2410c; }
.status-banner-warning {
  background: linear-gradient(135deg, #fefce8, #fef9c3);
  border: 2px solid #facc15;
}
.status-banner-warning .status-banner-value { color: #a16207; }
.status-banner-danger {
  background: linear-gradient(135deg, #fff1f2, #ffe4e6);
  border: 2px solid #fda4af;
}
.status-banner-danger .status-banner-value { color: #be123c; }
.status-banner-info {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border: 2px solid #93c5fd;
}
.status-banner-info .status-banner-value { color: #1d4ed8; }
.status-banner-label {
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin-bottom: 6px;
}
.status-banner-value {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.35;
}
.status-banner-sub {
  margin-top: 10px;
  font-size: .86rem;
  line-height: 1.5;
  color: #374151;
  font-weight: 500;
}
.timeline-note {
  font-size: .84rem;
  color: var(--muted);
  margin: 0 0 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.45;
}
.timeline-note i { color: #d97706; margin-top: 2px; }
.flow-table tr.flow-current {
  background: #fff7ed !important;
  box-shadow: inset 4px 0 0 #ea580c;
}
.flow-table tr.flow-current td {
  font-weight: 600;
}
.flow-status-badge {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}
.flow-badge-done {
  background: #ecfdf5;
  color: var(--success);
}
.flow-badge-pending {
  background: #fff7ed;
  color: #c2410c;
}
.flow-badge-danger {
  background: #fff1f2;
  color: #be123c;
}
.status-result { margin-top: 4px; }
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.82);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  flex-direction: column;
  gap: 14px;
}
.loading-overlay.is-active { display: flex; }
.loading-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #e5e7eb;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.loading-overlay p {
  font-weight: 600;
  color: var(--primary);
  font-size: .95rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.no-print {}
.is-hidden { display: none !important; }
.share-wrap {
  margin: 18px 0 4px;
  text-align: center;
}
.sharethis-inline-share-buttons {
  margin: 0 auto;
}
@media print {
  .no-print, .site-header, .ad-wrap, .result-actions, .info-card, .summary-cards, .loading-overlay, .sharethis-inline-share-buttons { display: none !important; }
}
@media (min-width: 560px) {
  .site-nav { flex-direction: row; flex-wrap: wrap; }
  .nav-btn { flex: 1 1 30%; min-width: 150px; }
}
@media (max-width: 560px) {
  .card { padding: 18px 14px; }
  .form-row { grid-template-columns: 1fr; }
  .payslip-meta .meta-item {
    gap: 10px;
    padding: 11px 12px;
  }
  .payslip-meta .meta-label {
    flex: 0 0 38%;
    font-size: .74rem;
  }
  .payslip-meta .meta-value {
    font-size: .84rem;
  }
  .payslip-wrap .result-actions,
  .status-result .result-actions {
    flex-direction: column;
  }
  .payslip-wrap .result-actions .btn-outline,
  .payslip-wrap .result-actions .btn-download,
  .status-result .result-actions .btn-outline {
    width: 100%;
    flex: 1 1 100%;
  }
  .data-table { font-size: .8rem; }
  .data-table th, .data-table td { padding: 9px 6px; }
  .summary-cards { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .flow-table { font-size: .72rem; }
  .flow-table th, .flow-table td { padding: 7px 5px; }
}
