* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  background: #f5f7fb;
  color: #111827;
}

.top-bar {
  background: #0b1635;
  color: white;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.logo {
  width: 36px;
  height: 36px;
  border-radius: 12px;
}

.logo.large {
  width: 56px;
  height: 56px;
}

.brand-title {
  font-weight: 600;
}

.brand-subtitle {
  font-size: 12px;
  opacity: 0.8;
}

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

.nav a {
  color: #e5e7eb;
  text-decoration: none;
  font-size: 14px;
}

.nav a:hover {
  text-decoration: underline;
}

.logout-form {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.user-label {
  font-size: 12px;
  opacity: 0.8;
}

.container {
  max-width: 960px;
  margin: 24px auto 48px;
  background: white;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-header h1 {
  margin: 0;
  font-size: 22px;
}

.subtext {
  font-size: 13px;
  color: #6b7280;
  margin-top: 4px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e5e7eb;
}

.table th {
  text-align: left;
  background: #f9fafb;
  font-weight: 600;
}

.table .actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.table .empty {
  text-align: center;
  padding: 32px 0;
  color: #6b7280;
}

.btn {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  background: white;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #111827;
}

.btn.primary {
  background: #2563eb;
  border-color: #2563eb;
  color: white;
}

.btn.danger {
  background: #ef4444;
  border-color: #ef4444;
  color: white;
}

.btn.small {
  padding: 4px 10px;
  font-size: 12px;
}

.btn:hover {
  opacity: 0.92;
}

.form {
  max-width: 520px;
}

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

.form-row label {
  font-size: 13px;
  margin-bottom: 4px;
  font-weight: 500;
}

.form-row input,
.form-row select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 14px;
}

.form-row input:focus,
.form-row select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3);
}

.form-actions {
  margin-top: 12px;
}

.hint {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

.hint.small {
  font-size: 11px;
}

.footer {
  text-align: center;
  font-size: 12px;
  color: #9ca3af;
  padding: 12px 0 24px;
}

/* Login page */

.login-body {
  background: radial-gradient(circle at top left, #1d4ed8, #0b1635 40%, #ef4444);
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-wrapper {
  width: 100%;
  max-width: 420px;
  padding: 16px;
}

.login-card {
  background: white;
  padding: 24px;
  border-radius: 18px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.3);
}

.login-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.flash.error {
  background: #fee2e2;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 13px;
  color: #b91c1c;
  margin-bottom: 10px;
}

/* Split layout for payments */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.2fr);
  gap: 20px;
}

.h-small {
  margin: 0 0 8px;
  font-size: 16px;
}

.split-right .form {
  max-width: 100%;
}

.summary-card {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f3f4f6;
  font-size: 13px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

/* Invoice page */

.invoice-body {
  background: #e5e7eb;
}

.invoice {
  max-width: 900px;
  margin: 32px auto;
  background: white;
  padding: 32px;
  border-radius: 10px;
  box-shadow: 0 8px 25px rgba(15, 23, 42, 0.12);
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 16px;
  margin-bottom: 16px;
}

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

.invoice-meta {
  text-align: right;
  font-size: 13px;
}

.tax-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.invoice-billed {
  margin: 12px 0 20px;
  font-size: 13px;
}

.billed-to-label {
  font-weight: 600;
  margin-bottom: 2px;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 18px;
}

.invoice-table th,
.invoice-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e5e7eb;
}

.invoice-table th {
  text-align: left;
  background: #f9fafb;
}

.invoice-summary {
  max-width: 320px;
  margin-left: auto;
  font-size: 13px;
}

.invoice-footer {
  margin-top: 24px;
  font-size: 11px;
  color: #4b5563;
}
