:root {
  --navy: #0B1F33;
  --brand: #2563EB;
  --brand-dark: #1D4ED8;
  --border: #E2E8F0;
  --muted: #64748B;
  --surface: #FFFFFF;
  --bg: #F8FAFC;
  --ring: rgba(37, 99, 235, .14);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-md: 0 18px 50px rgba(15, 23, 42, .10);
}

* {
  box-sizing: border-box
}

html {
  -webkit-text-size-adjust: 100%
}

body {
  overflow-x: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif
}

a {
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease
}

button,
input,
textarea,
select {
  font: inherit
}

img,
svg,
video {
  max-width: 100%;
  height: auto
}

.brand-mark {
  display: grid;
  height: 2.75rem;
  width: 2.75rem;
  place-items: center;
  border-radius: 14px;
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow-sm)
}

.brand-mark-sm {
  height: 1.85rem;
  width: 1.85rem;
  border-radius: 10px;
  display: inline-grid;
  vertical-align: middle;
  flex: 0 0 auto
}

.brand-logo {
  display: block;
  height: auto;
  max-width: 100%
}

.brand-logo-wordmark {
  height: 2.25rem;
  width: auto;
  max-width: min(230px, 48vw)
}

.brand-logo-sidebar {
  height: 2rem;
  width: auto;
  max-width: 190px
}

.dash-icon {
  display: inline-grid;
  height: 1.65rem;
  width: 1.65rem;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  color: #64748B
}

.dash-link-active .dash-icon {
  background: #DBEAFE;
  color: var(--brand-dark)
}

.dash-link:hover .dash-icon {
  background: #F1F5F9;
  color: #0F172A
}

.svg-icon-soft {
  display: grid;
  height: 2.6rem;
  width: 2.6rem;
  place-items: center;
  border-radius: 14px;
  background: #EFF6FF;
  color: var(--brand)
}

.status-icon {
  display: inline-grid;
  height: 2rem;
  width: 2rem;
  place-items: center;
  border-radius: 999px;
  flex: 0 0 auto
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: .75rem;
  z-index: 9999;
  transform: translateY(-160%);
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  padding: .7rem 1rem;
  font-weight: 900;
  box-shadow: var(--shadow-md)
}

.skip-link:focus {
  transform: translateY(0);
  outline: 3px solid #93C5FD;
  outline-offset: 3px
}

:focus-visible {
  outline: 3px solid #93C5FD;
  outline-offset: 3px;
  border-radius: 8px
}

.btn-primary,
.btn-secondary,
.btn-danger,
.btn-ghost {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border-radius: 1000px;
  padding: .68rem 1rem;
  font-size: .875rem;
  font-weight: 800;
  line-height: 1;
  transition: .18s ease;
  white-space: nowrap;
  touch-action: manipulation
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .18)
}

.btn-primary:hover {
  background: var(--brand-dark);
  transform: translateY(-1px)
}

.btn-secondary {
  background: #fff;
  color: #0F172A;
  border: 1px solid var(--border)
}

.btn-secondary:hover {
  border-color: #CBD5E1;
  background: #F8FAFC
}

.btn-danger {
  background: #DC2626;
  color: #fff
}

.btn-danger:hover {
  background: #B91C1C
}

.btn-ghost {
  background: transparent;
  color: #334155
}

.btn-ghost:hover {
  background: #F1F5F9;
  color: #0F172A
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm)
}

.card-premium {
  background: linear-gradient(180deg, #fff, #F8FAFC);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md)
}

.input,
.textarea,
.select,
.form-input {
  width: 100%;
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  background: #fff;
  font-size: .875rem;
  outline: none;
  transition: .15s ease;
  color: #0F172A
}

.input,
.select,
.form-input {
  height: 46px;
  padding: 0 .9rem
}

.textarea {
  min-height: 120px;
  padding: .8rem;
  resize: vertical
}

.input:focus,
.textarea:focus,
.select:focus,
.form-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--ring)
}

.input[disabled],
.textarea[disabled],
.select[disabled] {
  background: #F8FAFC;
  color: #94A3B8;
  cursor: not-allowed
}

.label,
.form-label {
  display: block;
  margin-bottom: .45rem;
  font-size: .875rem;
  font-weight: 800;
  color: #0F172A
}

.helper {
  margin-top: .35rem;
  font-size: .75rem;
  color: #64748B;
  line-height: 1.5
}

.section-title {
  font-size: 1rem;
  font-weight: 900;
  color: var(--navy);
  letter-spacing: -.01em
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border-radius: 999px;
  padding: .25rem .65rem;
  font-size: .75rem;
  font-weight: 800;
  text-transform: capitalize;
  background: #EFF6FF;
  color: #2563EB;
  line-height: 1.35;
  white-space: nowrap
}

.badge-new {
  background: #EFF6FF;
  color: #2563EB
}

.badge-reviewed {
  background: #F5F3FF;
  color: #7C3AED
}

.badge-invoice_sent,
.badge-awaiting_payment,
.badge-sent,
.badge-pending {
  background: #FFFBEB;
  color: #B45309
}

.badge-paid,
.badge-successful {
  background: #ECFDF5;
  color: #15803D
}

.badge-in_progress {
  background: #E0F2FE;
  color: #0369A1
}

.badge-completed {
  background: #DCFCE7;
  color: #166534
}

.badge-cancelled,
.badge-failed {
  background: #FEF2F2;
  color: #B91C1C
}

.badge-abandoned,
.badge-reversed {
  background: #F8FAFC;
  color: #475569;
  border: 1px solid #CBD5E1
}

.table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  -webkit-overflow-scrolling: touch
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .875rem;
  min-width: 720px
}

.table th {
  text-align: left;
  color: #64748B;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 900;
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--border);
  background: #F8FAFC;
  white-space: nowrap
}

.table td {
  padding: 1rem;
  border-bottom: 1px solid #EEF2F7;
  vertical-align: top;
  color: #334155
}

.table tr:last-child td {
  border-bottom: 0
}

.table tr:hover td {
  background: #FBFDFF
}

.nav-link {
  position: relative
}

.nav-link:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 2px;
  border-radius: 99px;
  background: var(--brand);
  opacity: 0;
  transform: scaleX(.6);
  transition: .18s
}

.nav-link:hover {
  color: var(--brand)
}

.nav-link:hover:after {
  opacity: 1;
  transform: scaleX(1)
}

.mobile-menu-button {
  display: inline-grid;
  height: 44px;
  width: 44px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: #0F172A
}

.mobile-menu-button span:not(.sr-only) {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 99px;
  background: #0F172A;
  margin: 2px 0
}

.mobile-nav-item {
  display: flex;
  align-items: center;
  min-height: 44px;
  border-radius: 12px;
  padding: .65rem .8rem
}

.mobile-nav-item:hover {
  background: #F1F5F9;
  color: var(--brand)
}

.dash-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  border-radius: 12px;
  padding: .8rem .9rem;
  color: #475569
}

.dash-link:hover {
  background: #F1F5F9;
  color: #0F172A
}

.dash-link-active {
  background: #EFF6FF;
  color: var(--brand-dark)
}

.mobile-tab {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: .5rem .8rem;
  font-size: .8rem;
  font-weight: 800;
  color: #475569;
  white-space: nowrap
}

.mobile-tab-active {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: var(--brand-dark)
}

.toast {
  position: fixed;
  right: 1rem;
  top: 1rem;
  z-index: 60;
  max-width: min(28rem, calc(100vw - 2rem));
  border-radius: 14px;
  padding: 1rem 1.1rem;
  font-size: .875rem;
  font-weight: 700;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .18)
}

.toast-success {
  background: #ECFDF5;
  border: 1px solid #BBF7D0;
  color: #166534
}

.toast-error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B
}

.metric {
  position: relative;
  overflow: hidden
}

.metric:after {
  content: "";
  position: absolute;
  right: -20px;
  top: -20px;
  width: 80px;
  height: 80px;
  border-radius: 999px;
  background: #EFF6FF;
  z-index: 0
}

.metric>* {
  position: relative;
  z-index: 1
}

.metric-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm)
}

.metric-card span {
  display: block;
  font-size: .75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #64748B
}

.metric-card strong {
  display: block;
  margin-top: .3rem;
  font-size: 1.45rem;
  line-height: 1.1;
  font-weight: 950;
  color: var(--navy)
}

.metric-card small {
  display: block;
  margin-top: .4rem;
  color: #64748B;
  font-weight: 700
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem
}

.page-title {
  font-size: clamp(1.7rem, 3vw, 2.15rem);
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: -.03em;
  color: var(--navy)
}

.page-subtitle {
  margin-top: .35rem;
  color: #64748B;
  line-height: 1.6
}

.empty-state {
  border: 1px dashed #CBD5E1;
  border-radius: 14px;
  background: #F8FAFC;
  padding: 2rem;
  text-align: center;
  color: #64748B
}

.timeline-dot {
  width: .65rem;
  height: .65rem;
  border-radius: 999px;
  background: var(--brand);
  box-shadow: 0 0 0 4px #DBEAFE
}

.scrollbar-hide::-webkit-scrollbar {
  display: none
}

.code-box {
  overflow: auto;
  border: 1px solid #DBEAFE;
  background: #EFF6FF;
  border-radius: 12px;
  padding: .85rem 1rem;
  font-size: .85rem;
  font-weight: 800;
  color: #1E3A8A;
  white-space: nowrap
}

.mobile-bottom-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(16px);
  padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 30px rgba(15, 23, 42, .08)
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: #E2E8F0;
  border-radius: 10px
}

.skeleton:after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  animation: shimmer 1.4s infinite
}

@keyframes shimmer {
  100% {
    transform: translateX(100%)
  }
}

@media(max-width:768px) {

  .card,
  .card-premium {
    padding: 1rem;
    border-radius: 14px
  }

  .page-head {
    display: block
  }

  .page-head .btn-primary,
  .page-head .btn-secondary {
    width: 100%;
    margin-top: 1rem
  }

  .table {
    min-width: 0
  }

  .table-mobile-card table,
  .table-mobile-card thead,
  .table-mobile-card tbody,
  .table-mobile-card th,
  .table-mobile-card td,
  .table-mobile-card tr {
    display: block
  }

  .table-mobile-card th {
    display: none
  }

  .table-mobile-card tr {
    border-bottom: 1px solid var(--border);
    padding: .85rem
  }

  .table-mobile-card tr:last-child {
    border-bottom: 0
  }

  .table-mobile-card td {
    border: 0 !important;
    padding: .35rem 0 !important;
    background: transparent !important
  }

  .table-mobile-card td:before {
    content: attr(data-label);
    display: block;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 900;
    color: #94A3B8;
    margin-bottom: .12rem
  }

  .toast {
    left: 1rem;
    right: 1rem;
    top: .75rem
  }

  .empty-state {
    padding: 1.25rem
  }

  .btn-primary,
  .btn-secondary,
  .btn-danger,
  .btn-ghost {
    min-height: 46px
  }

  .mobile-full {
    width: 100%
  }
}

@media(max-width:480px) {
  .badge {
    white-space: normal
  }

  .page-title {
    font-size: 1.6rem
  }

  .card .text-4xl {
    font-size: 2rem
  }

  .mobile-bottom-cta .btn-primary {
    min-height: 48px
  }
}

@media(prefers-reduced-motion:reduce) {

  *,
  *:before,
  *:after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important
  }
}

@media print {

  header,
  footer,
  aside,
  .mobile-bottom-cta,
  .btn-primary,
  .btn-secondary,
  .btn-danger,
  .btn-ghost {
    display: none !important
  }

  body {
    background: #fff !important
  }

  .card,
  .card-premium,
  .table-wrap {
    box-shadow: none !important;
    border-color: #CBD5E1 !important
  }

  .lg\:pl-72 {
    padding-left: 0 !important
  }
}

/* Phase 13: production launch polish */
.dashboard-sidebar {
  max-height: 100vh;
  overflow: hidden
}

.dashboard-sidebar-nav {
  scrollbar-width: thin;
  scrollbar-color: #CBD5E1 transparent;
  overscroll-behavior: contain;
  padding-bottom: .25rem
}

.dashboard-sidebar-nav::-webkit-scrollbar {
  width: 8px
}

.dashboard-sidebar-nav::-webkit-scrollbar-track {
  background: transparent
}

.dashboard-sidebar-nav::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 999px;
  border: 2px solid #fff
}

.dashboard-sidebar-nav:focus-visible {
  outline: 3px solid #93C5FD;
  outline-offset: 2px
}

.launch-check-grid {
  grid-template-columns: minmax(0, 1fr) auto
}

@media(max-height:720px) {
  .dashboard-sidebar {
    padding-top: 1rem;
    padding-bottom: 1rem
  }

  .dashboard-sidebar .rounded-2xl {
    padding: .75rem
  }

  .dashboard-sidebar-nav {
    margin-top: 1rem
  }
}