/* ── Design tokens ── */
:root {
  --bg:          #F7F6F3;
  --surface:     #FFFFFF;
  --surface-2:   #F0EEE9;
  --border:      #E2DFD8;
  --border-strong: #C8C4BC;

  --text-primary:   #1A1916;
  --text-secondary: #6B6860;
  --text-muted:     #9E9C97;

  --accent:        #1B6B45;
  --accent-bg:     #EAF4EE;
  --accent-border: #A8D5BC;
  --accent-text:   #1B6B45;
  --accent-hover:  #155436;

  --warning-bg:    #FEF7E6;
  --warning-border:#F0C060;
  --warning-text:  #8A5D00;

  --danger-bg:     #FEF0EF;
  --danger-border: #F5B0AC;
  --danger-text:   #B42318;

  --success-bg:    #EAF4EE;
  --success-border:#A8D5BC;
  --success-text:  #1B6B45;

  --sidebar-w: 228px;
  --radius:    8px;
  --radius-lg: 12px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg); color: var(--text-primary); line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
input[type=number]::-webkit-inner-spin-button { opacity: 1; }

/* ── HTMX loading indicator ── */
.htmx-indicator { opacity: 0; transition: opacity 200ms; }
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator { opacity: 1; }
.htmx-settling { transition: all 200ms ease-out; }

/* ── Layout ── */
.app-shell { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}
.sidebar-logo {
  padding: 1.25rem 1rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.sidebar-logo .logo-mark {
  width: 28px; height: 28px;
  background: var(--accent);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.sidebar-logo .logo-text { font-size: 14px; font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.sidebar-logo .logo-sub  { font-size: 11px; color: var(--text-muted); }

.tenant-switcher {
  margin: 10px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
  transition: border-color 150ms;
}
.tenant-switcher:hover { border-color: var(--border-strong); }
.tenant-avatar {
  width: 28px; height: 28px;
  background: var(--accent-bg);
  border-radius: 6px;
  font-size: 11px; font-weight: 600;
  color: var(--accent-text);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tenant-info { flex: 1; min-width: 0; }
.tenant-name { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tenant-ntn  { font-size: 11px; color: var(--text-muted); }

.nav-section { padding: 8px 8px 0; }
.nav-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); padding: 0 8px; margin-bottom: 4px; font-weight: 500; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 13.5px;
  cursor: pointer;
  transition: background 120ms, color 120ms;
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--bg); color: var(--text-primary); }
.nav-item.active { background: var(--accent-bg); color: var(--accent-text); font-weight: 500; }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-badge { margin-left: auto; background: var(--warning-bg); color: var(--warning-text); font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 99px; }
.nav-badge.danger { background: var(--danger-bg); color: var(--danger-text); }

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 10px 8px;
}
.user-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius);
  cursor: pointer;
}
.user-row:hover { background: var(--bg); }
.user-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: var(--text-secondary); }
.user-name  { font-size: 12.5px; font-weight: 500; }
.user-role  { font-size: 11px; color: var(--text-muted); }

/* ── Main content ── */
.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 52px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 15px; font-weight: 500; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.content { padding: 1.5rem; flex: 1; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius);
  font-size: 13.5px; font-weight: 500; cursor: pointer;
  border: 1px solid transparent; transition: all 120ms;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--text-primary); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--bg); }
.btn-danger { background: var(--danger-bg); color: var(--danger-text); border-color: var(--danger-border); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: transparent; padding: 6px 10px; }
.btn-ghost:hover { background: var(--bg); color: var(--text-primary); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ── Cards ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.card-body { padding: 1.25rem; }
.card-header { padding: 1rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; border-radius: var(--radius-lg); }
.card-title { font-size: 13.5px; font-weight: 500;}

/* ── Metrics grid ── */
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 1.5rem; }
.metric-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem 1.25rem; }
.metric-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 500; margin-bottom: 6px; }
.metric-value { font-size: 22px; font-weight: 600; color: var(--text-primary); letter-spacing: -0.02em; }
.metric-sub   { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.metric-sub.up   { color: var(--success-text); }
.metric-sub.warn { color: var(--warning-text); }

/* ── Alerts / banners ── */
.alert { border-radius: var(--radius); padding: 10px 14px; display: flex; align-items: flex-start; gap: 9px; font-size: 13px; margin-bottom: 1rem; }
.alert svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }
.alert-warning { background: var(--warning-bg); border: 1px solid var(--warning-border); color: var(--warning-text); }
.alert-warning svg { stroke: var(--warning-text); }
.alert-danger  { background: var(--danger-bg);  border: 1px solid var(--danger-border);  color: var(--danger-text);  }
.alert-danger svg  { stroke: var(--danger-text); }
.alert-success { background: var(--success-bg); border: 1px solid var(--success-border); color: var(--success-text); }
.alert-success svg { stroke: var(--success-text); }
.alert-info    { background: #EFF6FF; border: 1px solid #BFDBFE; color: #1E40AF; }
.alert-info svg { stroke: #1E40AF; }
.alert a { font-weight: 600; text-decoration: underline; cursor: pointer; }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 500; }
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-bg); color: var(--success-text); border: 1px solid var(--success-border); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); border: 1px solid var(--warning-border); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger-text);  border: 1px solid var(--danger-border); }
.badge-neutral { background: var(--surface-2);  color: var(--text-secondary); border: 1px solid var(--border); }

/* ── Table ── */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; padding: 9px 14px; color: var(--text-muted); font-size: 11.5px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; background: #047857; border-bottom: 1px solid var(--border); }
td { padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text-primary); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #FAFAF8; }
.td-mono { font-family: var(--font-mono); font-size: 12.5px; }
.td-muted { color: var(--text-secondary); }
.td-actions { display: flex; gap: 4px; }

/* ── Forms ── */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12.5px; font-weight: 500; color: var(--text-secondary); }
.field .hint  { font-size: 11px; color: var(--text-muted); }
.field .req   { color: var(--danger-text); }
.input, input[type=text], input[type=email], input[type=number], input[type=date], input[type=password], select, textarea {
  width: 100%; padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 13.5px;
  transition: border-color 120ms, box-shadow 120ms;
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(27,107,69,0.12);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B6860' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }

/* ── Line items table inside form ── */
.items-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.items-table th { background: var(--bg); padding: 7px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); border-bottom: 1px solid var(--border); text-align: left; font-weight: 500; }
.items-table th.right, .items-table td.right { text-align: right; }
.items-table td { padding: 6px 4px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.items-table td input, .items-table td select { font-size: 12.5px; padding: 5px 7px; }
.items-table .del-btn { color: var(--text-muted); background: none; border: none; cursor: pointer; padding: 4px; border-radius: 4px; }
.items-table .del-btn:hover { color: var(--danger-text); background: var(--danger-bg); }
.items-table .computed { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); padding: 0 8px; }
.totals-block { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; padding-top: 12px; }
.totals-row { display: flex; align-items: center; gap: 2.5rem; font-size: 13.5px; }
.totals-row .lbl { color: var(--text-secondary); min-width: 120px; text-align: right; }
.totals-row .val { font-family: var(--font-mono); font-size: 13px; min-width: 130px; text-align: right; }
.totals-row.grand { font-size: 15px; font-weight: 600; border-top: 1px solid var(--border-strong); padding-top: 8px; margin-top: 4px; }

/* ── Invoice print ── */
.invoice-print { max-width: 700px; margin: 0 auto; }
.print-paper { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2.5rem; }
.fbr-verified-strip { background: var(--success-bg); border: 1px solid var(--success-border); border-radius: var(--radius); padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; margin: 1.25rem 0; }
.fbr-verified-strip .fbr-left { font-size: 12.5px; color: var(--success-text); line-height: 1.6; }
.fbr-pending-strip { background: var(--warning-bg); border: 1px solid var(--warning-border); border-radius: var(--radius); padding: 10px 14px; margin: 1.25rem 0; font-size: 12.5px; color: var(--warning-text); }
.qr-placeholder { width: 60px; height: 60px; border: 1px solid var(--success-border); border-radius: 4px; background: var(--surface); display: flex; align-items: center; justify-content: center; }
.inv-company-name { font-size: 22px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.02em; }
.inv-meta { font-size: 12px; color: var(--text-secondary); line-height: 1.7; margin-top: 4px; }
.inv-number { font-size: 24px; font-weight: 700; color: var(--text-primary); text-align: right; }
.inv-number-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); text-align: right; }
.party-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); font-weight: 500; margin-bottom: 5px; }
.party-name { font-size: 14px; font-weight: 600; }
.party-detail { font-size: 12px; color: var(--text-secondary); line-height: 1.7; }
.inv-footer { margin-top: 1.5rem; border-top: 1px solid var(--border); padding-top: 12px; font-size: 11px; color: var(--text-muted); line-height: 1.7; }

/* ── Auth pages ── */
/* ── Login page ── */

.auth-page {
  min-height: 100vh;
  position: relative;
  overflow: hidden;

  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;

  background:
    radial-gradient(
      circle at top left,
      rgba(27, 107, 69, 0.08),
      transparent 35%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(27, 107, 69, 0.05),
      transparent 30%
    ),
    var(--bg);
}


/* subtle background decoration */
.auth-page::before {
  content: "";
  position: absolute;

  width: 420px;
  height: 420px;

  border-radius: 50%;

  background: var(--accent-bg);

  top: -250px;
  right: -180px;

  opacity: 0.7;
}


.login-card {
  position: relative;

  width: 100%;
  max-width: 420px;

  padding: 2.25rem;

  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);

  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.03),
    0 18px 50px rgba(0, 0, 0, 0.06);

  z-index: 1;
}


/* ── Branding ── */

.login-card .logo-mark {
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: #fff;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.login-brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}


/* ── Heading ── */

.login-heading {
  margin-bottom: 1.5rem;
}

.login-heading .auth-title {
  font-size: 21px;
  letter-spacing: -0.02em;
}

.login-heading .auth-sub {
  margin-bottom: 0;
  line-height: 1.6;
}


/* ── Labels ── */

.login-card label {
  display: block;

  font-size: 12.5px;
  font-weight: 500;

  color: var(--text-secondary);

  margin-bottom: 6px;
}


.login-label-row {
  display: flex;

  align-items: center;
  justify-content: space-between;
}


.login-label-row label {
  margin-bottom: 6px;
}


/* ── Inputs ── */

.login-card input {
  height: 42px;

  padding: 9px 11px;

  border-radius: var(--radius);

  background: #FCFCFB;
}


.login-card input:hover {
  border-color: var(--border-strong);
}


.login-card input:focus {
  background: var(--surface);
}


/* ── Forgot password ── */

.forgot-password {
  font-size: 12px;

  color: var(--accent);

  margin-bottom: 6px;

  transition: color 120ms;
}


.forgot-password:hover {
  color: var(--accent-hover);

  text-decoration: underline;
}


/* ── Submit ── */

.login-submit {
  width: 100%;

  height: 42px;

  justify-content: center;

  margin-top: 4px;

  font-weight: 600;
}


/* ── Error ── */

.login-error {
  margin-bottom: 1.25rem;
}


/* ── Footer ── */

.login-footer {
  margin-top: 1.5rem;

  padding-top: 1.25rem;

  border-top: 1px solid var(--border);

  display: flex;

  justify-content: center;
}


.security-badge {
  display: flex;

  align-items: center;

  gap: 6px;

  color: var(--text-muted);

  font-size: 11.5px;
}


.security-badge svg {
  width: 13px;
  height: 13px;

  fill: none;

  stroke: currentColor;

  stroke-width: 1.8;

  stroke-linecap: round;
  stroke-linejoin: round;
}


/* ── Mobile ── */

@media (max-width: 480px) {

  .auth-page {
    padding: 1rem;
  }

  .login-card {
    padding: 1.5rem;
  }

}



/* ── Tenant selector (post-login) ── */
.tenant-select-grid { display: grid; gap: 10px; margin-top: 1rem; }
.tenant-option { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem; cursor: pointer; display: flex; align-items: center; gap: 12px; transition: border-color 150ms, box-shadow 150ms; }
.tenant-option:hover { border-color: var(--accent-border); box-shadow: 0 0 0 3px rgba(27,107,69,0.08); }
.tenant-option .t-avatar { width: 36px; height: 36px; border-radius: 8px; background: var(--accent-bg); color: var(--accent-text); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tenant-option .t-name { font-size: 14px; font-weight: 600; }
.tenant-option .t-ntn  { font-size: 12px; color: var(--text-muted); }
.tenant-option .t-arrow { margin-left: auto; color: var(--text-muted); }

/* ── Modal overlay ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal { background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); width: 100%; max-width: 520px; box-shadow: 0 20px 60px rgba(0,0,0,0.15); }
.modal-header { padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 15px; font-weight: 600; }
.modal-body { padding: 1.25rem; }
.modal-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state svg { width: 36px; height: 36px; stroke: var(--border-strong); margin: 0 auto 12px; display: block; }
.empty-state h3 { font-size: 14px; font-weight: 500; color: var(--text-secondary); margin-bottom: 4px; }
.empty-state p  { font-size: 13px; }

/* ── Toast ── */
#toast-container { position: fixed; bottom: 1.25rem; right: 1.25rem; display: flex; flex-direction: column; gap: 8px; z-index: 9999; pointer-events: none; }
.toast { background: var(--text-primary); color: #fff; padding: 10px 16px; border-radius: var(--radius); font-size: 13.5px; pointer-events: all; display: flex; align-items: center; gap: 8px; min-width: 220px; animation: slide-in 200ms ease-out; }
.toast.success { background: var(--accent); }
.toast.error   { background: #B42318; }
.toast.warning { background: #8A5D00; }
@keyframes slide-in { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform: translateY(0); } }

/* ── Pagination ── */
.pagination { display: flex; align-items: center; gap: 4px; padding: 12px 14px; border-top: 1px solid var(--border); }
.page-btn { padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; cursor: pointer; background: var(--surface); color: var(--text-secondary); }
.page-btn:hover { background: var(--bg); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-btn[disabled] { opacity: 0.4; cursor: default; }

/* ── Settings ── */
.settings-layout { display: grid; grid-template-columns: 200px 1fr; gap: 1.5rem; }
.settings-nav .s-item { padding: 7px 12px; border-radius: var(--radius); font-size: 13.5px; cursor: pointer; color: var(--text-secondary); margin-bottom: 2px; }
.settings-nav .s-item:hover { background: var(--bg); color: var(--text-primary); }
.settings-nav .s-item.active { background: var(--accent-bg); color: var(--accent-text); font-weight: 500; }
.section-title { font-size: 14px; font-weight: 600; margin-bottom: 1rem; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.form-group { margin-bottom: 1rem; }

/* ── FBR specific ── */
.fbr-status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 500; }
.fbr-synced  { background: var(--success-bg); color: var(--success-text); border: 1px solid var(--success-border); }
.fbr-pending { background: var(--warning-bg); color: var(--warning-text); border: 1px solid var(--warning-border); }
.fbr-rejected{ background: var(--danger-bg);  color: var(--danger-text);  border: 1px solid var(--danger-border); }
.fbr-draft   { background: var(--surface-2);  color: var(--text-secondary); border: 1px solid var(--border); }

/* ── Utility ── */
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.text-sm { font-size: 12.5px; } .text-muted { color: var(--text-muted); } .text-secondary { color: var(--text-secondary); }
.text-right { text-align: right; } .font-mono { font-family: var(--font-mono); font-size: 12.5px; }
.font-medium { font-weight: 500; } .font-semibold { font-weight: 600; }
.w-full { width: 100%; } .divider { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
.spinner.dark { border: 2px solid var(--border); border-top-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
@media print { .sidebar, .topbar, .topbar-actions, .btn, .no-print { display: none !important; } .main { margin-left: 0; } .print-paper { border: none; padding: 0; } }


/* ── Success Modal ── */
/* Main modal container */
.success-modal {
  background: var(--surface);

  /* Responsive width with a maximum size */
  width: 100%;
  max-width: 500px;

  padding: 2rem;

  border-radius: var(--radius-lg);
  border: 1px solid var(--border);

  text-align: center;

  /* Adds depth above the overlay */
  box-shadow: 0 20px 50px rgba(0, 0, 0, .2);
}


/* ── Success Icon ── */
/* Circular success/check icon displayed at the top */
.success-icon {
  width: 52px;
  height: 52px;

  /* Center icon and add space below it */
  margin: 0 auto 1rem;

  /* Creates the circular shape */
  border-radius: 50%;

  background: var(--accent);
  color: white;

  /* Center the checkmark inside the circle */
  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 26px;
  font-weight: 600;
}


/* ── Modal Heading ── */
.success-modal h2 {
  margin-bottom: .5rem;
}


/* ── Modal Description ── */
.success-modal p {
  color: var(--text-muted);
}


/* ── API / Invoice Response ── */
/* Displays the response returned by the invoice POST endpoint */
.invoice-response {
  margin: 1.25rem 0;
  padding: 1rem;

  background: var(--bg);

  border: 1px solid var(--border);
  border-radius: var(--radius);

  /* Monospace makes API/debug output easier to read */
  font-family: monospace;
  font-size: 12px;

  text-align: left;

  /* Prevent long response strings from overflowing */
  overflow-wrap: anywhere;
}


/* ── Modal Action Buttons ── */
/* Container for "Back to Invoices" and "Create Another" buttons */
.success-actions {
  margin-top: 1.5rem;

  display: flex;
  justify-content: center;

  /* Space between action buttons */
  gap: .75rem;
}
