/* =========================
       BILLING HERO
    ========================= */

.billing-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(120deg, #0758dc, #1687ef 60%, #08afd5);
  color: white;
  border-radius: 22px;
  padding: 27px 30px;
  margin-bottom: 22px;
  box-shadow: 0 16px 40px rgba(23, 105, 255, 0.16);
}

.billing-hero::before {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  border: 40px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  right: -90px;
  top: -130px;
}

.billing-hero::after {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  border: 25px solid rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  right: 110px;
  bottom: -120px;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-label {
  font-size: 11px;
  opacity: 0.78;
  margin-bottom: 8px;
}

.hero-title {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.7px;
}

.hero-description {
  margin-top: 7px;
  font-size: 12px;
  opacity: 0.8;
  max-width: 550px;
}

/* =========================
       SUMMARY
    ========================= */

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 25px;
}

.summary-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.summary-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.summary-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  background: #edf4ff;
  color: var(--blue);
}

.summary-icon.green {
  background: #e9fbf3;
  color: var(--green);
}

.summary-icon.orange {
  background: #fff5e8;
  color: var(--orange);
}

.summary-icon.red {
  background: #fff0f0;
  color: var(--red);
}

.summary-card small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 16px;
}

.summary-card h2 {
  margin-top: 6px;
  font-size: 21px;
  letter-spacing: -0.5px;
}

.summary-card p {
  font-size: 10px;
  color: var(--muted);
  margin-top: 5px;
}

.positive {
  color: var(--green) !important;
}

.negative {
  color: var(--red) !important;
}

/* =========================
       CONTENT GRID
    ========================= */

.billing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 20px;
  align-items: start;
}

.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.card-title h3 {
  font-size: 15px;
  font-weight: 750;
}

.card-title p {
  color: var(--muted);
  font-size: 10px;
  margin-top: 4px;
}

.filter-area {
  display: flex;
  gap: 8px;
}

.filter-area select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--text);
  font-size: 10px;
  outline: none;
}

/* =========================
       TABLE
    ========================= */

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th {
  padding: 12px 20px;
  text-align: left;
  background: #fafcff;
  color: #8491a5;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 16px 20px;
  border-bottom: 1px solid #eef2f7;
  font-size: 11px;
  vertical-align: middle;
  white-space: nowrap;
}

tbody tr {
  transition: 0.15s ease;
}

tbody tr:hover {
  background: #f9fbff;
}

tbody tr:last-child td {
  border-bottom: none;
}

.invoice-number {
  color: var(--blue);
  font-weight: 700;
  cursor: pointer;
}

.invoice-date {
  color: var(--muted);
  font-size: 10px;
}

.amount {
  font-weight: 700;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 700;
}

.status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status.paid {
  color: #159b68;
  background: #eafaf3;
}

.status.pending {
  color: #e18a20;
  background: #fff6e8;
}

.status.overdue {
  color: #dc4141;
  background: #fff0f0;
}

.action-btn {
  width: 31px;
  height: 31px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 13px;
  color: #657286;
  transition: 0.2s;
}

.action-btn:hover {
  color: var(--blue);
  border-color: #bcd2ff;
  background: #f4f8ff;
}

/* =========================
       RIGHT PANEL
    ========================= */

.side-card {
  padding: 20px;
  margin-bottom: 18px;
}

.side-title {
  font-size: 13px;
  font-weight: 750;
  margin-bottom: 18px;
}

.due-card {
  background: linear-gradient(145deg, #0d54cc, #1769ff);
  color: white;
  border: none;
  box-shadow: 0 15px 35px rgba(23, 105, 255, 0.18);
}

.due-label {
  font-size: 10px;
  opacity: 0.72;
}

.due-amount {
  font-size: 25px;
  font-weight: 800;
  margin-top: 8px;
  letter-spacing: -0.7px;
}

.due-date {
  margin-top: 7px;
  font-size: 10px;
  opacity: 0.75;
}

.pay-btn {
  width: 100%;
  border: none;
  margin-top: 18px;
  height: 40px;
  border-radius: 10px;
  background: white;
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s;
}

.pay-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.service-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.service-info:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.service-icon {
  width: 35px;
  height: 35px;
  border-radius: 10px;
  background: #eef5ff;
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.service-info strong {
  display: block;
  font-size: 11px;
}

.service-info span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-top: 3px;
}

/* =========================
       PAYMENT METHODS
    ========================= */

.payment-method {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.payment-method:last-child {
  border-bottom: none;
}

.payment-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.payment-logo {
  width: 35px;
  height: 30px;
  border-radius: 7px;
  background: #f3f6fa;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  color: #536174;
}

.payment-left strong {
  display: block;
  font-size: 10px;
}

.payment-left span {
  display: block;
  color: var(--muted);
  font-size: 8px;
  margin-top: 2px;
}

.default-badge {
  font-size: 8px;
  padding: 4px 6px;
  background: #eafaf3;
  color: var(--green);
  border-radius: 5px;
  font-weight: 700;
}

.view-all {
  display: block;
  text-align: center;
  margin-top: 14px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
}

/* =========================
       MODAL
    ========================= */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 30, 55, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 500;
  backdrop-filter: blur(4px);
}

.modal.show {
  display: flex;
}

.modal-box {
  width: 100%;
  max-width: 470px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-head {
  padding: 20px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.modal-head h3 {
  font-size: 15px;
}

.close-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: #f3f6fa;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
}

.invoice-detail {
  padding: 22px;
}

.invoice-brand {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 25px;
}

.invoice-brand strong {
  font-size: 17px;
}

.invoice-brand span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-top: 4px;
}

.invoice-code {
  text-align: right;
}

.invoice-code strong {
  font-size: 12px;
  color: var(--blue);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 10px;
}

.detail-row span:first-child {
  color: var(--muted);
}

.detail-total {
  display: flex;
  justify-content: space-between;
  padding-top: 18px;
  font-size: 13px;
  font-weight: 800;
}

.detail-total span:last-child {
  color: var(--blue);
}

.modal-actions {
  display: flex;
  gap: 10px;
  padding: 0 22px 22px;
}

.modal-actions button {
  flex: 1;
  height: 40px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.btn-secondary {
  background: white;
  border: 1px solid var(--border);
}

.btn-primary {
  background: var(--blue);
  border: none;
  color: white;
}

/* =========================
       TOAST
    ========================= */

.toast {
  position: fixed;
  right: 25px;
  bottom: 25px;
  background: #172230;
  color: white;
  padding: 13px 17px;
  border-radius: 10px;
  font-size: 10px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.18);
  transform: translateY(80px);
  opacity: 0;
  transition: 0.3s;
  z-index: 1000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* =========================
       MOBILE
    ========================= */

.mobile-menu {
  display: none;
}

@media (max-width: 1100px) {
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .billing-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  :root {
    --sidebar: 0px;
  }

  .sidebar {
    width: 250px;
    transform: translateX(-100%);
    transition: 0.25s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
  }

  .mobile-menu {
    display: flex;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: white;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-right: 12px;
  }

  .topbar {
    padding: 0 18px;
  }

  .page-heading {
    display: flex;
    align-items: center;
  }

  .content {
    padding: 22px 18px 40px;
  }

  .user-info {
    display: none;
  }
}

@media (max-width: 600px) {
  .summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .summary-card {
    padding: 15px;
  }

  .summary-card h2 {
    font-size: 17px;
  }

  .summary-icon {
    width: 34px;
    height: 34px;
  }

  .billing-hero {
    padding: 23px;
  }

  .hero-title {
    font-size: 21px;
  }

  .card-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .filter-area {
    width: 100%;
  }

  .filter-area select {
    flex: 1;
  }

  .top-actions {
    gap: 7px;
  }

  .notification {
    display: none;
  }
}
