* {
  box-sizing: border-box;
  font-family: Inter, Segoe UI, Arial, sans-serif
}

:root {
  --sidebar: #0b74da;
  --muted: #6b7280;
  --surface: #fff;
  --accent: #0b74da
}

body,
html {
  height: 100%;
  margin: 0;
  background: #f3f4f6
}

.app {
  display: flex;
  min-height: 100vh
}

.sidebar {
  width: 220px;
  background: var(--sidebar);
  color: #fff;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0
}

.sidebar .brand {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px
}

.sidebar .sidebar-logo {
  height: 32px;
  width: auto;
  object-fit: contain
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 6px
}

.sidebar button,
.sidebar a {
  background: transparent;
  border: 0;
  color: #fff;
  padding: 10px;
  text-align: left;
  border-radius: 6px;
  cursor: pointer;
  display: block;
  text-decoration: none
}

.sidebar button.active,
.sidebar a.active,
.sidebar button:hover,
.sidebar a:hover {
  background: rgba(255, 255, 255, 0.08)
}

.sidebar a.active {
  background: rgba(255, 255, 255, 0.12);
  font-weight: 700;
  box-shadow: inset 4px 0 0 0 rgba(255, 255, 255, 0.16)
}

.content {
  flex: 1;
  padding: 18px;
  overflow: auto
}

.view {
  background: var(--surface);
  padding: 14px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(2, 6, 23, 0.06)
}

.hidden {
  display: none
}

.invoice-builder {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start
}

.invoice-builder form {
  flex: 2 1 420px;
  min-width: 320px
}

.preview-pane {
  flex: 1 1 320px;
  min-width: 260px;
  max-width: 480px
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap
}

.row label {
  flex: 1;
  display: flex;
  flex-direction: column;
  font-size: 13px;
  color: var(--muted)
}

.row input,
select {
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #fff
}

.box {
  padding: 8px;
  border: 1px dashed #e5e7eb;
  border-radius: 6px;
  background: #fafafa
}

.small {
  min-height: 48px
}

#items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 8px;
  min-width: 760px;
  border: 1px solid #e5e7eb
}

#items-table th,
#items-table td {
  padding: 6px;
  border: 1px solid #e5e7eb;
  white-space: nowrap;
  background: #fff
}

#items-table th {
  background: var(--accent);
  color: #fff;
  font-weight: 700
}

#items-table th.hs-col,
#items-table td.hs-col {
  width: 80px
}

#items-table th.uom-col,
#items-table td.uom-col {
  width: 60px
}

#items-table th.rate-col,
#items-table td.rate-col {
  width: 50px
}

#items-table input,
#items-table select {
  width: 100%;
  box-sizing: border-box
}

.table-scroll {
  overflow-x: auto;
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #e5e7eb;
  margin-top: 8px
}

.preview-table th,
.preview-table td {
  padding: 8px;
  border: 1px solid #e5e7eb;
  background: #fff
}

.preview-table th {
  background: var(--accent);
  color: #fff;
  font-weight: 700
}

table.list {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px
}

table.list th,
table.list td {
  padding: 8px;
  border: 1px solid #e5e7eb;
  text-align: left;
  background: #fff
}

table.list th {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-align: center
}

.text-right {
  text-align: right
}

.table-scroll {
  overflow-x: auto;
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 8px
}

.totals {
  display: flex;
  gap: 14px;
  justify-content: flex-end;
  font-weight: 600;
  margin-top: 6px
}

.actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px
}

.actions button {
  padding: 8px 12px;
  border-radius: 6px;
  border: 0;
  background: var(--accent);
  color: #fff;
  cursor: pointer
}

.preview-pane .invoice-card {
  background: #fff;
  border-radius: 6px;
  padding: 12px;
  border: 1px solid #eee;
  min-height: 200px
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center
}

.modal.hidden {
  display: none
}

.modal-content {
  width: 520px;
  background: #fff;
  padding: 16px;
  border-radius: 8px
}

#stepper {
  display: flex;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 12px 0
}

#stepper li {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  background: #f3f4f6;
  text-align: center
}

#stepper li.active {
  background: linear-gradient(90deg, var(--accent), #0066bf);
  color: #fff
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px
}

.modal-actions button {
  padding: 8px 12px;
  border-radius: 6px;
  border: 0;
  cursor: pointer
}

.modal-actions #step-next {
  background: var(--accent);
  color: #fff
}

.modal-actions button:disabled,
.modal-actions button.btn-disabled {
  background: #cbd5e1;
  color: #475569;
  cursor: not-allowed;
  opacity: 0.7
}

.modal-actions #step-next:disabled {
  background: #9ca3af;
  color: #fff
}

.small-btn {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #fff
}

.small-btn:disabled {
  background: #e5e7eb;
  color: #64748b;
  border-color: #e5e7eb;
  cursor: not-allowed;
  opacity: 0.8
}

.small-btn.edit {
  background: #e0f2fe;
  border-color: #bfdbfe;
  color: #0b74da;
  font-weight: 600;
  font-size: 11px;
  padding: 5px 7px
}

.small-btn.edit:hover {
  background: #d5e9fd
}

.small-btn.print {
  background: #e0f7f4;
  border-color: #b2ebe2;
  color: #0f766e;
  font-weight: 600;
  font-size: 11px;
  padding: 5px 7px
}

.small-btn.print:hover {
  background: #d2f1ea
}

.small-btn.send {
  background: #e5e7eb;
  border-color: #cbd5e1;
  color: #0f172a;
  font-weight: 700;
  font-size: 11px;
  padding: 5px 7px
}

.small-btn.send:hover {
  background: #dfe3e8
}

.small-btn.delete {
  background: #fee2e2;
  border-color: #fecdd3;
  color: #b91c1c;
  font-weight: 700;
  font-size: 11px;
  padding: 5px 7px
}

.small-btn.delete:hover {
  background: #fdd8d8
}

.shimmer-row td {
  padding: 10px;
  background: #f8fafc
}

.shimmer-line {
  height: 14px;
  border-radius: 8px;
  background: linear-gradient(90deg, #e5e7eb 0%, #f3f4f6 50%, #e5e7eb 100%);
  background-size: 200% 100%;
  animation: shimmer 1s ease-in-out infinite
}

@keyframes shimmer {
  0% {
    background-position: 200% 0
  }

  100% {
    background-position: -200% 0
  }
}

.invoice-card .hdr {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px
}

.invoice-card .logo {
  height: 48px;
  width: 48px;
  background: #eee;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center
}

.invoice-card table {
  width: 100%;
  border-collapse: collapse
}

.invoice-card .preview-table th {
  background: var(--accent);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 11px
}

.invoice-card td,
.invoice-card th {
  padding: 6px;
  border-bottom: 1px solid #f3f4f6
}

.qr-placeholder {
  height: 92px;
  min-width: 92px;
  border: 1px dashed #d1d5db;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #6b7280;
  padding: 6px;
  background: #fff
}

.preview-section {
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  margin-bottom: 10px;
  background: #fff
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 10px
}

.preview-box {
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff
}

.preview-label {
  font-weight: 700;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 6px;
  margin-bottom: 6px;
  display: block;
  color: #0f172a
}

.preview-footer {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-top: 8px;
  flex-wrap: wrap
}

.preview-totals {
  min-width: 240px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
  background: #fff
}

.preview-totals .row-line {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #e5e7eb;
  padding: 6px 0;
  font-weight: 600;
  font-size: 8px;
}

.preview-totals .row-line:last-child {
  border-bottom: 0;
  font-size: 8px
}

.preview-card {
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff
}

.preview-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb
}

.preview-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a
}

.preview-subtext {
  color: #6b7280;
  font-size: 12px
}

.preview-grid.tight {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr))
}

.preview-invoice {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 8px;
  background: #fff;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
  max-width: 760px;
  margin: 0 auto
}

.inv-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
  align-items: flex-start
}

.inv-company {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a
}

.inv-meta {
  min-width: 100px;
  max-width: 120px;
  flex: 1
}

.inv-title {
  font-size: 14px;
  font-weight: 800;
  color: #0b74da;
  text-align: right;
  margin: 0 0 6px;
  letter-spacing: 0.3px
}

.inv-meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px
}

.inv-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 7px;
  color: #0f172a;
  border: 1px solid #d9dde5;
  border-radius: 10px;
  padding: 6px 8px;
  background: #f8fafc
}

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

.inv-box {
  border: 1px solid #d9dde5;
  border-radius: 8px;
  background: #fff;
  overflow: hidden
}

.inv-band {
  background: #0b74da;
  color: #fff;
  font-weight: 700;
  padding: 8px 10px;
  font-size: 10px;
  letter-spacing: 0.3px
}

.inv-box .inv-content {
  padding: 9px;
  color: #0f172a;
  font-size: 10px;
  display: grid;
  gap: 2px
}

.inv-subtle {
  color: #6b7280;
  font-size: 10px
}

.inv-table-wrap {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow-x: auto;
  margin: 8px 0;
  background: #fff
}

.inv-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 100%
}

.inv-table th,
.inv-table td {
  border: 1px solid #e5e7eb;
  padding: 6px 8px;
  text-align: left;
  font-size: 8px;
  background: #fff
}

.inv-table th {
  background: #0b74da;
  color: #fff;
  font-weight: 700
}

.inv-footer-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-top: 10px
}

.inv-notes {
  flex: 1;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px;
  background: #fff;
  min-width: 100px
}

.inv-notes h5 {
  margin: 0 0 8px;
  font-size: 12px;
  color: #0f172a;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 6px
}

.qr-box {
  border: 1px dashed #d1d5db;
  border-radius: 8px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  background: #fafafa
}

.preview-totals.svelte {
  min-width: 100px
}

.bill-ship {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin: 12px 0
}

@media (min-width: 900px) {
  .inv-header {
    display: grid;
    grid-template-columns: 1fr 140px
  }

  .inv-meta {
    justify-self: end
  }

  .bill-ship {
    grid-template-columns: repeat(2, minmax(150px, 1fr))
  }
}

.form-card .section-box {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  margin-bottom: 12px
}

.form-card .section-title {
  font-weight: 700;
  margin: 0 0 8px;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 6px;
  color: #0f172a
}

.guide-hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  align-items: center;
  background: linear-gradient(135deg, #e9f2ff 0%, #dce9ff 40%, #eef4ff 100%);
  color: #0f172a;
  border: 1px solid #dbeafe
}

.guide-hero .eyebrow {
  color: #0b74da;
  font-weight: 800;
  letter-spacing: 0.06em
}

.guide-hero .muted {
  color: #475569
}

.guide-hero .ghost-btn {
  border-color: #0b74da;
  color: #0b74da;
  background: #fff
}

.guide-hero .ghost-btn:hover {
  background: #e8f1ff;
  border-color: #0b74da
}

.guide-title {
  margin: 6px 0 8px;
  font-size: 22px;
  color: #0f172a
}

.guide-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0
}

.guide-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap
}

.guide-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2)
}

.guide-checklist {
  display: grid;
  gap: 8px;
  align-content: start
}

.guide-badge {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  color: #0b74da;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08)
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px
}

.guide-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  display: grid;
  gap: 8px
}

.guide-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  flex-wrap: wrap
}

.guide-step {
  padding: 6px 10px;
  border-radius: 999px;
  background: #e0f2ff;
  color: #0b74da;
  font-weight: 700;
  font-size: 12px
}

.guide-list {
  padding-left: 16px;
  margin: 0;
  display: grid;
  gap: 6px
}

.guide-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center
}

.guide-note {
  color: #475569;
  font-size: 12px;
  font-weight: 600
}

.guide-card .small-btn {
  background: #0b74da;
  color: #fff;
  border-color: #0b74da
}

.guide-card .small-btn.ghost {
  background: #fff;
  color: #0b74da;
  border: 1px solid #d7e3f4
}

.guide-alert {
  background: #f8fafc;
  border: 1px solid #e0e7ff;
  box-shadow: none
}

.auth-body {
  background: radial-gradient(circle at 20% 20%, #e0f2ff 0, #f8fafc 40%, #f9fafb 100%);
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px
}

.auth-shell {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  max-width: 960px;
  width: 100%
}

.auth-card {
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  border: 1px solid #e5e7eb
}

.auth-brand {
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 6px;
  color: #0b74da;
  display: flex;
  align-items: center;
  gap: 10px
}

.auth-logo {
  height: 36px;
  width: auto;
  object-fit: contain
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px
}

.auth-form label {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  color: #6b7280
}

.auth-form input {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #d9dde5;
  font-size: 14px
}

.auth-btn {
  padding: 12px 14px;
  border: 0;
  border-radius: 10px;
  background: #0b74da;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(11, 116, 218, 0.25)
}

.auth-links {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 13px
}

.auth-links a {
  color: #0b74da;
  text-decoration: none
}

.auth-hero {
  background: linear-gradient(135deg, #0b74da, #0a5fb3);
  color: #fff;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(11, 116, 218, 0.3);
  display: flex;
  flex-direction: column;
  justify-content: center
}

.auth-hero h3 {
  margin: 8px 0
}

.auth-hero ul {
  padding-left: 18px;
  margin: 8px 0
}

.hero-badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 12px
}

.muted {
  color: #6b7280
}

.success {
  color: #15803d;
  font-size: 13px;
  margin-top: 6px
}

.auth-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  animation: fadeIn 0.25s ease
}

.auth-modal.hidden {
  display: none
}

.auth-modal-card {
  background: #fff;
  padding: 22px 20px;
  border-radius: 14px;
  max-width: 360px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  animation: popIn 0.3s ease
}

.auth-modal-card h3 {
  margin: 8px 0 6px
}

.auth-modal-card p {
  margin: 0 0 14px;
  color: #475569;
  font-size: 14px
}

.auth-modal-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 10px;
  background: linear-gradient(135deg, #0b74da, #0d8ad4);
  color: #fff;
  font-size: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 20px rgba(11, 116, 218, 0.3)
}

@keyframes fadeIn {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

@keyframes popIn {
  0% {
    transform: scale(0.9);
    opacity: 0
  }

  60% {
    transform: scale(1.03);
    opacity: 1
  }

  100% {
    transform: scale(1)
  }
}

.app-body {
  background: radial-gradient(circle at 15% 20%, #e0f2ff 0, #f8fafc 40%, #f6f7fb 100%);
  min-height: 100vh;
  margin: 0;
  padding: 18px
}

.admin-shell {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px
}

.panel {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  border: 1px solid #e5e7eb;
  padding: 16px
}

.sidebar-card {
  display: flex;
  flex-direction: column;
  gap: 12px
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eef2f7;
  justify-content: center
}

.panel-logo {
  height: 48px;
  width: auto;
  object-fit: contain
}

.panel-title {
  font-weight: 700;
  font-size: 18px;
  color: #0b74da
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0b74da, #0d8ad4);
  box-shadow: 0 6px 18px rgba(11, 116, 218, 0.4)
}

.panel-nav {
  display: flex;
  flex-direction: column;
  gap: 6px
}

.panel-nav a {
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: #0f172a;
  font-weight: 600;
  border: 1px solid transparent
}

.panel-nav a:hover {
  background: #f4f8ff;
  border-color: #d7e3f4;
  color: #0b74da
}

.panel-nav a.active {
  background: linear-gradient(135deg, #0b74da, #0d8ad4);
  color: #fff;
  box-shadow: 0 10px 20px rgba(11, 116, 218, 0.25)
}

.panel-footer {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid #eef2f7;
  display: flex;
  align-items: center;
  justify-content: space-between
}

.small-text {
  font-size: 12px
}

.ghost-btn {
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid #d7e3f4;
  background: #fff;
  color: #0b74da;
  font-weight: 700;
  cursor: pointer
}

.ghost-btn:hover {
  border-color: #0b74da;
  background: #f1f6ff
}

.form-card {
  display: flex;
  flex-direction: column;
  gap: 14px
}

.form-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px
}

.form-header h2 {
  margin: 2px 0 4px;
  font-size: 24px
}

.form-card p {
  margin: 0
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px
}

.form-grid label {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  color: #6b7280
}

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

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

.form-actions .auth-btn {
  box-shadow: none
}

.form-actions .ghost-btn {
  margin-left: 4px
}

.ghost-btn:disabled,
.ghost-btn.ghost-btn-disabled {
  opacity: 0.6;
  cursor: not-allowed
}

@media (max-width:980px) {
  .admin-shell {
    grid-template-columns: 1fr
  }

  .app {
    flex-direction: column
  }

  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap
  }

  .sidebar nav {
    flex-direction: row;
    flex-wrap: wrap
  }

  .content {
    padding: 12px
  }
}

@media (max-width:720px) {
  .row {
    flex-direction: column;
    align-items: stretch
  }

  .totals,
  .actions {
    flex-direction: column;
    align-items: flex-start
  }

  .preview-pane {
    max-width: 100%
  }

  .auth-shell {
    grid-template-columns: 1fr
  }

  .auth-hero {
    order: -1
  }

  .guide-hero {
    grid-template-columns: 1fr
  }
}

/* Validation styles */
.error {
  color: #b91c1c;
  font-size: 12px;
  margin-top: 6px;
  display: block
}

.input-error {
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.05)
}

/* highlight animation for newly added items */
.highlight {
  animation: hl 2s ease forwards
}

@keyframes hl {
  0% {
    background: rgba(59, 130, 246, 0.12)
  }

  50% {
    background: rgba(59, 130, 246, 0.06)
  }

  100% {
    background: transparent
  }
}

/* Landing page */
.landing-body {
  margin: 0;
  background: radial-gradient(circle at 10% 20%, #e0f2ff 0, #f8fafc 40%, #f6f7fb 100%);
  color: #0f172a
}

.landing-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 16px 60px
}

.landing-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  margin: 0 0 26px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08)
}

.landing-nav .logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #0f172a;
  text-decoration: none;
  font-size: 18px
}

.landing-nav .logo-img {
  height: 40px;
  width: auto;
  object-fit: contain
}

.landing-nav .logo-text {
  display: inline-block
}

.landing-nav .nav-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap
}

.landing-nav .nav-links a {
  color: #475569;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px
}

.landing-nav .nav-links a:hover {
  background: #e8f1fd;
  color: #0b74da
}

.toggle-group {
  display: inline-flex;
  align-items: center;
  background: #f7f9fd;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 4px;
  gap: 6px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08)
}

.toggle-option {
  padding: 10px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  color: #0b74da;
  border: 1px solid transparent;
  transition: all 0.15s ease
}

.toggle-option:hover {
  background: #e8f1fd;
  border-color: #d7e3f4
}

.toggle-option.active {
  background: linear-gradient(135deg, #0b74da, #0d8ad4);
  color: #fff;
  border-color: #0b74da;
  box-shadow: 0 8px 16px rgba(11, 116, 218, 0.28)
}

.btn-primary,
.btn-ghost {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease
}

.btn-primary {
  background: linear-gradient(135deg, #0b74da, #0d8ad4);
  color: #fff;
  border: 1px solid #0b74da;
  box-shadow: 0 10px 20px rgba(11, 116, 218, 0.25)
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(11, 116, 218, 0.3)
}

.btn-ghost {
  background: #fff;
  color: #0b74da;
  border: 1px solid #d7e3f4
}

.btn-ghost:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08)
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  align-items: center;
  padding: 10px 0 34px
}

.hero h1 {
  font-size: 36px;
  margin: 10px 0 12px;
  line-height: 1.1
}

.hero p {
  color: #475569;
  font-size: 16px;
  max-width: 540px;
  margin: 0
}

.hero-lead {
  color: #0f172a;
  font-size: 17px;
  font-weight: 600;
  max-width: 560px
}

.hero-card {
  background: linear-gradient(135deg, #0f1f3a, #0b74da);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 14px 36px rgba(11, 116, 218, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08)
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(11, 116, 218, 0.12);
  color: #0b74da;
  font-weight: 700;
  font-size: 13px
}

.stat-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px
}

.stat {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 150px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  gap: 2px
}

.stat strong {
  font-size: 22px
}

.stat span {
  color: #475569;
  font-size: 13px
}

.section {
  padding: 32px 0
}

.section h2 {
  margin: 0 0 12px;
  font-size: 30px
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px
}

.feature {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06)
}

.feature h3 {
  margin: 0 0 6px
}

.feature p {
  margin: 0;
  color: #475569;
  line-height: 1.5
}

.timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: stretch
}

.step {
  background: #0b74da;
  color: #e2edff;
  border-radius: 14px;
  padding: 14px;
  border: 1px solid #0a64bd;
  box-shadow: 0 12px 30px rgba(11, 116, 218, 0.28);
  flex: 1 1 230px;
  min-width: 200px;
  position: relative
}

.step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 700
}

.step h4 {
  color: #fff
}

.step-title {
  margin: 8px 0 6px;
  font-size: 18px
}

.step-copy {
  margin: 0;
  color: #e8f2ff;
  font-size: 15px;
  line-height: 1.4
}

.step-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  font-size: 22px;
  font-weight: 800;
  color: #0b74da;
  border: 2px solid #d7e3f4;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  flex: 0 0 auto;
  margin: 0 2px
}

.cta {
  margin-top: 40px;
  background: linear-gradient(135deg, #0b74da, #0d8ad4);
  color: #fff;
  border-radius: 16px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 14px 30px rgba(11, 116, 218, 0.32)
}

.cta h3 {
  margin: 0 0 6px
}

.cta p {
  margin: 0;
  color: rgba(255, 255, 255, 0.88)
}

@media (max-width:960px) {
  .landing-nav {
    flex-wrap: wrap
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 18px
  }

  .hero h1 {
    font-size: 32px
  }

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

@media (max-width:640px) {
  .landing-shell {
    padding: 14px 12px 50px
  }

  .landing-nav {
    position: static;
    gap: 0;
    justify-content: space-between;
    flex-direction: row;
    align-items: center;
    padding: 12px 16px
  }

  .landing-nav .logo {
    justify-content: flex-start;
    width: auto;
    margin-bottom: 0
  }

  .landing-nav .logo-img {
    height: 32px
  }

  .landing-nav .nav-links {
    display: none
  }

  .toggle-group {
    width: auto;
    padding: 3px;
    gap: 4px
  }

  .toggle-option {
    padding: 8px 12px;
    font-size: 13px
  }

  .hero h1 {
    font-size: 28px
  }

  .hero p,
  .hero-lead {
    font-size: 15px
  }

  .hero-card {
    width: 100%
  }

  .stat-row {
    flex-direction: column
  }

  .stat {
    width: 100%
  }

  .feature-grid {
    grid-template-columns: 1fr;
    gap: 10px
  }

  .timeline {
    flex-direction: column
  }

  .step-arrow {
    align-self: center;
    transform: rotate(90deg)
  }
}

@media (max-width:480px) {

  .btn-primary,
  .btn-ghost {
    width: 100%;
    text-align: center
  }

  .landing-nav {
    align-items: center
  }

  .landing-nav .nav-links {
    gap: 6px;
    justify-content: center
  }

  .toggle-group {
    flex-direction: column;
    align-items: stretch
  }

  .toggle-option {
    width: 100%;
    text-align: center
  }

  .hero h1 {
    font-size: 24px
  }

  .step-title {
    font-size: 16px
  }

  .step-copy {
    font-size: 14px
  }
}

.inv-subtext {
  font-size: 8px;
}

.status-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  animation: fadeIn 0.25s ease
}

.status-modal.hidden {
  display: none
}

.status-card {
  background: #fff;
  border-radius: 16px;
  padding: 18px 20px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  animation: popIn 0.35s ease;
  border: 1px solid #e5e7eb;
  display: grid;
  gap: 10px
}

.status-card.success {
  background: #ecfdf3;
  border-color: #bbf7d0
}

.status-card.error {
  background: #fef2f2;
  border-color: #fecdd3
}

.status-card.loading {
  background: #f8fafc;
  border-color: #e2e8f0
}

.status-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 22px;
  color: #0b74da;
  border: 2px solid #dbeafe
}

.status-icon.loading {
  border: 2px dashed #cbd5e1;
  animation: spin 1.2s linear infinite;
  color: #475569
}

.status-icon.success {
  background: #22c55e;
  color: #fff;
  border-color: #22c55e
}

.status-icon.error {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444
}

.status-title {
  margin: 0;
  font-size: 18px;
  color: #0f172a
}

.status-message {
  margin: 0;
  color: #475569;
  font-size: 14px
}

.status-actions {
  display: flex;
  justify-content: center
}

.status-actions .ghost-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer
}

.status-card.show {
  animation: popIn 0.25s ease
}

.auth-btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: 0;
  background: #0b74da;
  color: #fff;
  font-weight: 700;
  cursor: pointer
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

/* Scenario Tester Styles */
.st-container {
  padding: 20px;
}

.st-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 20px;
}

.st-sidebar {
  background: #f8fafc;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.st-content {
  background: white;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  padding: 20px;
  min-height: 500px;
}

.st-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}

.st-scenario-btn {
  padding: 8px;
  border: 1px solid #cbd5e1;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  text-align: center;
  transition: all 0.2s;
}

.st-scenario-btn:hover {
  border-color: #6366f1;
  color: #6366f1;
}

.st-scenario-btn.selected {
  background: #6366f1;
  color: white;
  border-color: #6366f1;
}

.st-controls label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #475569;
}

.st-controls input,
.st-controls select {
  width: 100%;
  padding: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  margin-bottom: 12px;
}

.st-btn {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  background: #6366f1;
  color: white;
  margin-top: 10px;
}

.st-btn.danger {
  background: #ef4444;
}

.st-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.st-stat-card {
  background: #f1f5f9;
  padding: 10px;
  border-radius: 6px;
  text-align: center;
}

.st-stat-label {
  font-size: 11px;
  text-transform: uppercase;
  color: #64748b;
}

.st-stat-val {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}

.st-result-item {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin-bottom: 10px;
  overflow: hidden;
}

.st-result-header {
  background: #f8fafc;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
}

.st-res-title {
  font-weight: 600;
  font-size: 14px;
}

.st-res-badge {
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 4px;
  font-weight: 700;
}

.st-res-badge.success {
  background: #dcfce7;
  color: #166534;
}

.st-res-badge.error {
  background: #fee2e2;
  color: #991b1b;
}

.st-res-badge.pending {
  background: #fef3c7;
  color: #92400e;
}

.st-res-body {
  padding: 10px;
  font-size: 13px;
  color: #334155;
}

.st-progress {
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  margin-bottom: 20px;
  overflow: hidden;
  display: none;
}

.st-progress-fill {
  height: 100%;
  background: #6366f1;
  width: 0%;
  transition: width 0.3s;
}