:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #1f2a44;
  --muted: #6b778c;
  --primary: #2f6fed;
  --primary_dark: #2459c9;
  --border: #e2e7f0;
  --sidebar: #1f2a3b;
  --sidebar_text: #cfd6e5;
  --card_shadow: 0 10px 30px rgba(25, 32, 56, 0.08);
  --accent: #0f5aa9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app_shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar);
  color: var(--sidebar_text);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand_badge {
  width: 36px;
  height: 36px;
  background: #2c3a55;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
}

.brand_name {
  font-weight: 600;
  color: #fff;
}

.nav_group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav_item {
  text-decoration: none;
  color: var(--sidebar_text);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
}

.nav_item.active,
.nav_item:hover {
  background: #27354f;
  color: #ffffff;
}

.sidebar_footer {
  margin-top: auto;
}

.plan_card {
  background: #243149;
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--card_shadow);
}

.plan_title {
  margin: 0 0 6px;
  font-weight: 600;
  color: #fff;
}

.plan_text {
  margin: 0 0 12px;
  font-size: 13px;
  color: #b7c2d9;
}

.primary_btn,
.ghost_btn {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  cursor: pointer;
}

.primary_btn {
  background: var(--primary);
  color: #fff;
}

.primary_btn:hover {
  background: var(--primary_dark);
}

.ghost_btn {
  background: #eef2f9;
  color: var(--text);
}

.main_content {
  padding: 32px 40px 60px;
}

.top_bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.top_bar h1 {
  margin: 0 0 6px;
  font-size: 24px;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.top_actions {
  display: flex;
  gap: 10px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--card_shadow);
  margin: 24px 0;
}

.panel_header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.panel_header h3 {
  margin: 0;
  font-size: 16px;
}

.panel_meta {
  color: var(--muted);
  font-size: 12px;
}

.invoice_sheet {
  background: #fff;
  border: 1px solid #c7d2e6;
  border-radius: 14px;
  padding: 24px;
  max-width: 900px;
  margin: 0 auto;
  box-shadow: 0 12px 40px rgba(31, 42, 68, 0.1);
}

.invoice_header {
  display: grid;
  grid-template-columns: 160px 1fr 160px;
  gap: 20px;
  align-items: start;
  border-bottom: 3px solid var(--accent);
  padding-bottom: 16px;
}

.qr_block {
  text-align: center;
}

.qr_label {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--muted);
}

.qr_box {
  width: 120px;
  height: 120px;
  border: 2px solid #111827;
  margin: 0 auto;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.qr_note {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

.issuer_block h2 {
  margin: 0 0 6px;
}

.issuer_block p {
  margin: 2px 0;
  color: var(--muted);
  font-size: 13px;
}

.invoice_title {
  text-align: right;
}

.invoice_title h1 {
  margin: 0 0 12px;
  font-size: 28px;
  color: #0f172a;
}

.invoice_logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: #0f172a;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  margin-left: auto;
}

.invoice_info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.info_card {
  background: #f1f4fa;
  border-radius: 12px;
  padding: 12px 14px;
}

.info_card h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #0f5aa9;
}

.info_card p {
  margin: 4px 0;
  font-size: 13px;
}

.info_card.compact {
  display: grid;
  place-items: center;
  text-align: center;
}

.invoice_table {
  border: 1px solid #c7d2e6;
  border-radius: 12px;
  overflow: hidden;
}

.table_header,
.table_row {
  display: grid;
  grid-template-columns: 140px 1fr 90px 90px 70px 110px;
  gap: 8px;
  padding: 10px 12px;
  font-size: 13px;
}

.table_header {
  background: #0f5aa9;
  color: #fff;
  font-weight: 600;
}

.table_row {
  border-bottom: 1px solid #e2e7f0;
  background: #fff;
}

.table_row:last-child {
  border-bottom: none;
}

.table_cell_muted {
  color: var(--muted);
  font-size: 12px;
}

.invoice_totals {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  margin-top: 20px;
}

.payment_box {
  border: 1px solid #c7d2e6;
  border-radius: 12px;
  padding: 12px 14px;
  background: #f8f9fd;
}

.payment_box h4 {
  margin: 0 0 8px;
  color: #0f5aa9;
}

.payment_box p {
  margin: 4px 0;
  font-size: 13px;
}

.totals_box {
  border: 1px solid #c7d2e6;
  border-radius: 12px;
  padding: 12px 14px;
  background: #f1f4fa;
}

.totals_row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
}

.totals_row.total {
  font-weight: 700;
  color: #0f5aa9;
  border-top: 2px solid #0f5aa9;
  margin-top: 6px;
  padding-top: 8px;
}

@media (max-width: 1100px) {
  .invoice_header {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .invoice_title {
    text-align: left;
  }

  .invoice_logo {
    margin-left: 0;
  }

  .invoice_totals {
    grid-template-columns: 1fr;
  }

  .table_header,
  .table_row {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #fff;
  }

  .sidebar,
  .top_bar,
  .panel_header,
  .plan_card {
    display: none !important;
  }

  .main_content {
    padding: 0;
  }

  .panel {
    border: none;
    box-shadow: none;
    padding: 0;
  }

  .invoice_sheet {
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0;
    max-width: none;
  }
}
