:root {
  --brand: #0b57d0;
  --accent: #11a37f;
  --hero-bg: linear-gradient(130deg, #eef4ff 0%, #f5fff9 48%, #fff7ef 100%);
  --surface: #ffffff;
  --line: #e7edf7;
  --muted: #667085;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 18px;
  --space-5: 24px;
  --space-6: 32px;
  --shadow-sm: 0 6px 16px rgba(16, 24, 40, .06);
  --shadow-md: 0 10px 26px rgba(16, 24, 40, .10);
}

body {
  font-family: "Manrope", "Segoe UI", Tahoma, sans-serif;
  background:
    radial-gradient(circle at 5% 5%, rgba(11, 87, 208, .08), transparent 25%),
    radial-gradient(circle at 95% 5%, rgba(17, 163, 127, .08), transparent 25%),
    #f5f7fb;
}

.hero {
  background: var(--hero-bg);
  border: 1px solid #d8e5ff;
  box-shadow: 0 10px 26px rgba(12, 33, 77, .08);
}

.hero-kicker {
  display: inline-block;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #36558f;
  font-weight: 700;
}

.kpi {
  border: 0;
  box-shadow: 0 8px 20px rgba(15, 22, 38, .06);
}

.kpi-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: #1d2939;
}

.card {
  border-color: #e7edf7;
  transition: transform .16s cubic-bezier(.2, .7, .2, 1), box-shadow .16s cubic-bezier(.2, .7, .2, 1), opacity .2s ease;
  border-radius: var(--radius-md);
}

.card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(12, 33, 77, .08);
}

.stats-strip .card .card-body {
  padding: 14px 16px;
}

.stat-number {
  font-size: 1.45rem;
  font-weight: 800;
  color: #1d2939;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.18;
  letter-spacing: -.01em;
}

p {
  line-height: 1.6;
}

.logo-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.logo-chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: .82rem;
  font-weight: 700;
  color: #344054;
}

.quote-tile {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: #fcfdff;
  font-size: .9rem;
}

.billing-toggle {
  display: inline-flex;
  border: 1px solid #d0ddf5;
  border-radius: 999px;
  padding: 4px;
  background: #f8fbff;
}

.billing-toggle button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 7px 14px;
  font-weight: 700;
  color: #344054;
}

.billing-toggle button.active {
  background: #e7f0ff;
  color: #0b57d0;
}

.table thead th {
  font-weight: 700;
  color: #344054;
  border-bottom-width: 1px;
}

.table tbody td {
  vertical-align: middle;
}

.table-sticky thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
}

.form-label {
  font-weight: 600;
  font-size: .92rem;
}

.form-control,
.form-select {
  border-color: #d7e2f1;
  transition: border-color .14s ease, box-shadow .14s ease, background-color .2s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: #6aa2ff;
  box-shadow: 0 0 0 .2rem rgba(13, 99, 236, .15);
}

.auth-shell {
  border-radius: 18px;
}

.auth-side {
  background: linear-gradient(140deg, #0b57d0, #0e6df3 60%, #11a37f);
}

.navbar .nav-link.active {
  color: #0b57d0;
}

.navbar-brand {
  letter-spacing: .2px;
}

.ad-slot {
  border: 1px dashed #adb5bd;
  padding: 12px;
  border-radius: 10px;
  background: #f8f9fa;
}

.invoice-paper {
  background: #fff;
  border: 1px solid #e8ecf4;
  border-radius: 12px;
  padding: 20px;
}

.invoice-paper.layout-boxed {
  box-shadow: 0 8px 20px rgba(0, 0, 0, .05);
}

.invoice-paper.layout-stripe table thead {
  background: #f8fafc;
}

.invoice-paper.layout-minimal table {
  border-color: #f0f0f0;
}

.watermark {
  position: absolute;
  inset: auto;
  top: 40%;
  left: 17%;
  font-size: 52px;
  transform: rotate(-30deg);
  opacity: .08;
  pointer-events: none;
}

.btn-primary {
  background: linear-gradient(90deg, #0b57d0, #0d63ec);
  border-color: #0b57d0;
}

.btn {
  transition: transform .12s ease, box-shadow .14s ease, opacity .2s ease, background-color .16s ease, border-color .16s ease, color .16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn.is-loading {
  pointer-events: none;
  opacity: .72;
}

.navbar {
  backdrop-filter: blur(6px);
}

.page-fade-in {
  animation: pageIn .24s cubic-bezier(.2, .7, .2, 1) both;
}

.content-stagger > * {
  animation: riseIn .28s cubic-bezier(.2, .7, .2, 1) both;
}

.content-stagger > *:nth-child(2) {
  animation-delay: .04s;
}

.content-stagger > *:nth-child(3) {
  animation-delay: .08s;
}

.content-stagger > *:nth-child(4) {
  animation-delay: .12s;
}

.reveal-in {
  animation: riseIn .3s cubic-bezier(.2, .7, .2, 1) both;
}

.page-header {
  margin-bottom: var(--space-4);
}

.page-header .title {
  margin-bottom: var(--space-1);
}

.content-stagger > section,
.content-stagger > .card,
.content-stagger > .row {
  margin-bottom: var(--space-5);
}

.content-stagger > :last-child {
  margin-bottom: 0;
}

.chart-skeleton {
  height: 220px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, #eef2f8 25%, #f7f9fc 37%, #eef2f8 63%);
  background-size: 400% 100%;
  animation: skeleton 1.2s ease infinite;
  margin-bottom: 12px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: .78rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status-paid {
  color: #0f8f57;
  background: #e8f9f0;
  border-color: #b9ebcf;
}

.status-pending {
  color: #9a6700;
  background: #fff7e0;
  border-color: #ffe39a;
}

.status-overdue {
  color: #b42318;
  background: #ffebe9;
  border-color: #ffc9c4;
}

.status-cancelled {
  color: #475467;
  background: #f2f4f7;
  border-color: #d0d5dd;
}

.sortable {
  cursor: pointer;
  user-select: none;
}

.sortable::after {
  content: " ↕";
  color: #98a2b3;
  font-weight: 400;
}

.app-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.app-nav-link {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: #344054;
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 4px;
}

.app-nav-link:hover {
  background: #eef4ff;
  color: #0b57d0;
}

.app-nav-link.active {
  background: #e7f0ff;
  color: #0b57d0;
}

.mobile-action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  z-index: 1050;
}

.mobile-action-bar a {
  color: #475467;
  text-decoration: none;
  font-size: .78rem;
  font-weight: 700;
  padding: 6px 8px;
  border-radius: 999px;
}

.mobile-action-bar a.active {
  color: #0b57d0;
  background: #e7f0ff;
}

.template-filter.active {
  background: #0b57d0;
  color: #fff;
  border-color: #0b57d0;
}

.invoice-stepper {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.invoice-stepper button {
  border: 1px solid #d0d9ed;
  border-radius: 999px;
  background: #fff;
  color: #344054;
  padding: 7px 12px;
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
}

.invoice-stepper button.active {
  background: #e8f1ff;
  color: #0b57d0;
  border-color: #8db4f7;
}

.sticky-editor-bar {
  position: fixed;
  bottom: 62px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 1045;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px;
  box-shadow: var(--shadow-sm);
}

.empty-state {
  max-width: 360px;
  margin: 0 auto;
}

main {
  padding-bottom: 74px;
}

@keyframes skeleton {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pageIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 991.98px) {
  .card:hover {
    transform: none;
    box-shadow: none;
  }

  main {
    padding-bottom: 96px;
  }

  .content-stagger > section,
  .content-stagger > .card,
  .content-stagger > .row {
    margin-bottom: var(--space-4);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }

  .btn:hover {
    transform: none;
  }
}

@media print {
  .no-print,
  nav,
  footer {
    display: none !important;
  }

  body {
    background: #fff !important;
  }

  .invoice-paper {
    border: 0;
  }

  .mobile-action-bar,
  .app-shell,
  .sticky-editor-bar {
    display: none !important;
  }
}
