:root {
  --bg: #f6f7fb;
  --card: #fff;
  --text: #1d2433;
  --muted: #6b7280;
  --line: #dde3ee;
  --accent: #2b5cff;
  --green: #12805c;
  --yellow: #9a6b00;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

.topbar {
  background: #111827;
  color: #fff;
}

.topbar-inner {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand a,
.topnav a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.page {
  padding-top: 28px;
  padding-bottom: 40px;
}

h1, h2 {
  margin-top: 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 20px;
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 16px 0;
  flex-wrap: wrap;
}

.button {
  display: inline-block;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
}

.button.secondary {
  background: #4b5563;
}

.button.success {
  background: var(--green);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f3f5f9;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

input, select {
  height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.item-row {
  display: grid;
  grid-template-columns: 180px 1fr 120px 150px 130px;
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.badge.open {
  background: #fff5d7;
  color: var(--yellow);
}

.badge.paid {
  background: #dff7ee;
  color: var(--green);
}

.muted {
  color: var(--muted);
}

.fake-link {
  color: #2563eb;
  text-decoration: underline;
}

.disabled-link {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
  text-decoration: underline;
}

.badge.draft {
  background: #e5e7eb;
  color: #374151;
}

.live-summary {
  margin: 14px 0 6px 0;
  font-size: 1rem;
}

@media (max-width: 760px) {
  .item-row {
    grid-template-columns: 1fr;
  }
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.billing-table {
  min-width: 760px;
}

@media (max-width: 768px) {
  .wrap {
    padding: 0 12px;
  }

  .page {
    padding-top: 18px;
    padding-bottom: 24px;
  }

  h1 {
    font-size: 2rem;
    line-height: 1.1;
  }

  .table-card {
    padding: 12px;
  }

  .billing-table th,
  .billing-table td {
    white-space: nowrap;
    padding: 10px 12px;
  }
}
