:root {
  --navy: #152545;
  --navy-deep: #081d3d;
  --primary: #5f63f2;
  --blue: #1d7ff0;
  --teal: #18b5bb;
  --green: #0f9f6e;
  --orange: #f7902f;
  --purple: #8138e5;
  --danger: #d92d3d;
  --warning: #e88420;
  --info: #1d7ff0;
  --success: #0f9f6e;
  --action: #5f63f2;
  --bg: #f4f7fc;
  --text: #101828;
  --muted: #667085;
  --line: #e8edf5;
  --card: #ffffff;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --shadow: 0 12px 30px rgba(27, 45, 81, 0.075);
  --shadow-soft: 0 6px 18px rgba(27, 45, 81, 0.055);
  --shadow-hover: 0 16px 34px rgba(27, 45, 81, 0.105);
  --focus: rgba(95, 99, 242, 0.38);
  --control-bg: #ffffff;
  --control-text: #071225;
  --sidebar-bg: linear-gradient(180deg, #081d3d, #06204a);
  --sidebar-muted: #8ea0bd;
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --tooltip-bg: #101828;
  --metric-teal-bg: linear-gradient(130deg, #eefeff, #fff);
  --metric-violet-bg: linear-gradient(130deg, #f7f5ff, #fff);
  --metric-orange-bg: linear-gradient(130deg, #fff5ec, #fff);
  --metric-blue-bg: linear-gradient(130deg, #f1f7ff, #fff);
}

.app-toast-area {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2100;
  display: grid;
  gap: 12px;
  width: min(390px, calc(100vw - 32px));
  pointer-events: none;
}

.app-toast {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 18px 48px rgba(15, 23, 42, .16);
  pointer-events: auto;
  animation: toastIn .22s ease both;
}

.app-toast.is-hiding {
  animation: toastOut .2s ease both;
}

.app-toast-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 18px;
}

.app-toast-success .app-toast-icon {
  background: rgba(20, 184, 166, .12);
  color: #0f9f8f;
}

.app-toast-error .app-toast-icon {
  background: rgba(239, 68, 68, .12);
  color: #dc2626;
}

.app-toast-message {
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.app-toast-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
}

.app-toast-close:hover,
.app-toast-close:focus {
  background: rgba(95, 99, 242, .08);
  color: var(--text);
  outline: none;
}

.app-confirm-dialog {
  max-width: 430px;
  margin-inline: auto;
}

.app-confirm-content {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 30px 70px rgba(15, 23, 42, .24);
}

.app-confirm-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(217, 45, 61, .11);
  color: var(--danger);
  font-size: 24px;
}

.app-confirm-copy h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.app-confirm-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.app-confirm-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 6px;
}

.app-confirm-actions .outline-action,
.app-confirm-actions .primary-action {
  width: auto;
  min-height: 42px;
}

.app-confirm-ok {
  background: linear-gradient(135deg, #ef4444, #c81e2b);
  box-shadow: 0 14px 28px rgba(217, 45, 61, .22);
}

.app-confirm-ok:hover,
.app-confirm-ok:focus {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(-8px) scale(.98);
  }
}

@media (max-width: 576px) {
  .app-toast-area {
    top: 12px;
    right: 12px;
    left: 12px;
    width: auto;
  }

  .app-confirm-content {
    grid-template-columns: 1fr;
    padding: 18px;
    border-radius: 18px;
  }

  .app-confirm-actions {
    flex-direction: column-reverse;
  }

  .app-confirm-actions .outline-action,
  .app-confirm-actions .primary-action {
    width: 100%;
    justify-content: center;
  }
}

:root[data-theme="dark"] {
  --navy: #0b1730;
  --navy-deep: #071226;
  --primary: #8f94ff;
  --blue: #5da8ff;
  --teal: #3dd5d8;
  --green: #36d399;
  --orange: #ffb366;
  --purple: #a78bfa;
  --danger: #ff6b7a;
  --warning: #ffb366;
  --info: #5da8ff;
  --success: #36d399;
  --action: #8f94ff;
  --bg: #08111f;
  --text: #ecf2ff;
  --muted: #a5b4c8;
  --line: rgba(179, 194, 219, 0.16);
  --card: #111b2e;
  --surface: rgba(12, 22, 39, 0.86);
  --surface-solid: #111b2e;
  --shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.22);
  --shadow-hover: 0 18px 40px rgba(0, 0, 0, 0.34);
  --focus: rgba(143, 148, 255, 0.48);
  --control-bg: #152238;
  --control-text: #ecf2ff;
  --sidebar-bg: linear-gradient(180deg, #050d1d, #071936);
  --sidebar-muted: #9cafca;
  --sidebar-hover: rgba(255, 255, 255, 0.09);
  --tooltip-bg: #0b1220;
  --metric-teal-bg: linear-gradient(130deg, rgba(61, 213, 216, 0.15), rgba(17, 27, 46, 0.98));
  --metric-violet-bg: linear-gradient(130deg, rgba(167, 139, 250, 0.16), rgba(17, 27, 46, 0.98));
  --metric-orange-bg: linear-gradient(130deg, rgba(255, 179, 102, 0.15), rgba(17, 27, 46, 0.98));
  --metric-blue-bg: linear-gradient(130deg, rgba(93, 168, 255, 0.15), rgba(17, 27, 46, 0.98));
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(circle at top left, #ffffff 0, var(--bg) 42%, #edf2fb 100%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

:root[data-theme="dark"] body {
  background: radial-gradient(circle at top left, #13233d 0, var(--bg) 46%, #050b15 100%);
}

a {
  text-decoration: none;
}

button,
select {
  font: inherit;
}

button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.app-shell {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
  padding: 0;
}

.sidebar {
  position: relative;
  z-index: 40;
  flex: 0 0 255px;
  width: 255px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 30px 20px;
  border-radius: 0;
  background: var(--sidebar-bg);
  color: #fff;
  box-shadow: 18px 0 40px rgba(5, 16, 38, 0.18);
  transition: flex-basis 0.24s ease, width 0.24s ease, padding 0.24s ease;
}

.brand-row,
.brand,
.topbar,
.topbar-copy,
.topbar-actions,
.panel-title-row,
.metric-head,
.wallet-top,
.goal-row,
.goal-meta {
  display: flex;
  align-items: center;
}

.brand-row {
  flex: 0 0 auto;
  justify-content: space-between;
  margin-bottom: 28px;
}

.brand {
  gap: 12px;
  color: #fff;
  font-size: 21px;
  min-width: 0;
}

.brand strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-logo {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.brand-logo img {
  display: block;
  max-width: 38px;
  max-height: 34px;
  object-fit: contain;
}

.brand-logo-login {
  width: 52px;
  height: 52px;
}

.brand-logo-login img {
  max-width: 44px;
  max-height: 40px;
}

.login-company-name {
  color: #fff;
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 850;
  letter-spacing: 0;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.42), 0 0 1px rgba(255, 255, 255, 0.9);
}

.login-company-name strong {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.38);
}

.brand-mark {
  position: relative;
  width: 36px;
  height: 30px;
}

.brand-mark span {
  position: absolute;
  width: 14px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(180deg, #18b5ff, #7346ff);
  transform: rotate(33deg);
  opacity: 0.94;
}

.brand-mark span:nth-child(1) {
  left: 2px;
  top: 5px;
}

.brand-mark span:nth-child(2) {
  left: 13px;
  top: 1px;
  background: linear-gradient(180deg, #885bff, #1aa9ff);
}

.brand-mark span:nth-child(3) {
  left: 23px;
  top: 7px;
  background: linear-gradient(180deg, #229fff, #7047ff);
}

.side-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: visible;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(142, 160, 189, 0.36) transparent;
}

.side-nav::-webkit-scrollbar {
  width: 6px;
}

.side-nav::-webkit-scrollbar-track {
  background: transparent;
}

.side-nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(142, 160, 189, 0.28);
}

.nav-group {
  margin-bottom: 24px;
}

.nav-group p {
  margin: 0 0 10px 10px;
  color: var(--sidebar-muted);
  font-size: 12px;
  font-weight: 600;
}

.nav-link {
  position: relative;
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 43px;
  padding: 0 13px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 650;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.submenu-toggle {
  text-align: left;
}

.submenu-chevron {
  margin-left: auto;
  width: auto !important;
  font-size: 13px !important;
  transition: transform 0.18s ease;
}

.has-submenu.open .submenu-chevron {
  transform: rotate(180deg);
}

.submenu {
  max-height: 0;
  padding-left: 35px;
  overflow: hidden;
  transition: max-height 0.2s ease, margin 0.2s ease;
}

.has-submenu.open .submenu {
  max-height: 220px;
  margin: 6px 0 8px;
}

.submenu a {
  display: block;
  padding: 8px 10px;
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 650;
  transition: background 0.16s ease, color 0.16s ease;
}

.flyout-title {
  display: none;
}

.submenu a:hover,
.submenu a.active {
  background: var(--sidebar-hover);
  color: #fff;
}

body.sidebar-collapsed .nav-link::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 14px);
  top: 50%;
  z-index: 60;
  padding: 8px 10px;
  border-radius: 7px;
  background: var(--tooltip-bg);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-6px, -50%);
  transition: opacity 0.16s ease, transform 0.16s ease;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.2);
}

body.sidebar-collapsed .nav-link::before {
  content: "";
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  z-index: 61;
  border: 6px solid transparent;
  border-right-color: var(--tooltip-bg);
  opacity: 0;
  pointer-events: none;
  transform: translate(-6px, -50%);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

body.sidebar-collapsed .nav-link:hover::after,
body.sidebar-collapsed .nav-link:hover::before,
body.sidebar-collapsed .nav-link:focus-visible::after,
body.sidebar-collapsed .nav-link:focus-visible::before {
  opacity: 1;
  transform: translate(0, -50%);
}

body.sidebar-collapsed .has-submenu > .nav-link::before,
body.sidebar-collapsed .has-submenu > .nav-link::after {
  display: none;
}

.nav-link i {
  width: 22px;
  font-size: 20px;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: linear-gradient(100deg, #1979ed, #7339d5);
  transform: translateX(2px);
}

.primary-action,
.outline-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.main-panel {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 100vh;
  border-radius: 0;
  background: var(--surface);
  backdrop-filter: blur(18px);
  transition: border-radius 0.24s ease;
}

.topbar {
  justify-content: space-between;
  gap: 22px;
  padding: 36px 34px 26px 42px;
}

.topbar h1 {
  margin: 0 0 8px;
  font-size: clamp(22px, 2vw, 27px);
  font-weight: 800;
}

.topbar p,
.panel-head p,
.metric-card p,
.placeholder-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.topbar-copy {
  gap: 14px;
}

.topbar-actions {
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.icon-btn {
  position: relative;
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--control-bg);
  color: var(--control-text);
  box-shadow: 0 10px 22px rgba(29, 42, 68, 0.06);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.icon-btn i {
  font-size: 21px;
}

.notification-btn span {
  position: absolute;
  top: 9px;
  right: 12px;
  width: 9px;
  height: 9px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--danger);
}

.primary-action {
  min-height: 48px;
  padding: 0 26px;
  background: linear-gradient(100deg, var(--info), var(--action));
  color: #fff;
  box-shadow: 0 12px 22px rgba(89, 75, 225, 0.32);
}

.primary-action i,
.outline-action i {
  margin-right: 8px;
}

.primary-action:hover,
.outline-action:hover,
.icon-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(73, 83, 142, 0.18);
}

.icon-btn:hover {
  border-color: #d6def0;
}

:root[data-theme="dark"] .icon-btn:hover {
  border-color: rgba(165, 180, 200, 0.28);
}

.user-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 12px 6px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--control-bg);
  color: var(--text);
  box-shadow: 0 10px 22px rgba(29, 42, 68, 0.06);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.user-menu-toggle:hover,
.user-menu-toggle:focus-visible,
.user-menu.show .user-menu-toggle {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--info) 26%, var(--line));
  box-shadow: 0 14px 30px rgba(73, 83, 142, 0.18);
}

.user-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--info), var(--action));
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.user-menu-copy {
  display: grid;
  min-width: 96px;
  text-align: left;
  line-height: 1.15;
}

.user-menu-copy strong {
  max-width: 150px;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.user-menu-toggle > i {
  color: var(--muted);
  font-size: 13px;
}

.user-dropdown {
  min-width: 220px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.user-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.user-dropdown .dropdown-item:hover,
.user-dropdown .dropdown-item:focus {
  background: color-mix(in srgb, var(--info) 10%, transparent);
  color: var(--text);
}

.user-dropdown .dropdown-item.text-danger {
  color: var(--danger) !important;
}

.user-dropdown .dropdown-divider {
  border-color: var(--line);
}

.sidebar-close {
  display: none;
}

.menu-toggle {
  display: inline-grid;
}

body.sidebar-collapsed .sidebar {
  flex-basis: 84px;
  width: 84px;
  padding: 30px 14px;
}

body.sidebar-collapsed .main-panel {
  width: auto;
  margin-left: 0;
}

body.sidebar-collapsed .brand {
  justify-content: center;
}

body.sidebar-collapsed .brand-logo {
  width: 40px;
  height: 40px;
}

body.sidebar-collapsed .brand-logo img {
  max-width: 34px;
  max-height: 31px;
}

body.sidebar-collapsed .brand strong,
body.sidebar-collapsed .nav-group p,
body.sidebar-collapsed .nav-link span,
body.sidebar-collapsed .submenu-chevron {
  display: none;
}

body.sidebar-collapsed .brand-row {
  justify-content: center;
}

body.sidebar-collapsed .nav-link {
  justify-content: center;
  padding: 0;
}

body.sidebar-collapsed .nav-link i {
  width: auto;
}

@media (min-width: 993px) {
  body.sidebar-collapsed .sidebar {
    overflow: visible;
  }

  body.sidebar-collapsed .side-nav {
    overflow: visible;
    padding-right: 0;
  }

  body.sidebar-collapsed .has-submenu {
    position: relative;
  }

  body.sidebar-collapsed .has-submenu .submenu {
    position: absolute;
    left: calc(100% + 14px);
    top: 0;
    z-index: 70;
    display: block;
    width: 190px;
    max-height: none;
    margin: 0;
    padding: 9px;
    overflow: visible;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9px;
    background: #101828;
    box-shadow: 0 18px 38px rgba(16, 24, 40, 0.28);
    opacity: 0;
    pointer-events: none;
    transform: translateX(-6px);
    transition: opacity 0.16s ease, transform 0.16s ease;
  }

  body.sidebar-collapsed .flyout-title {
    display: block;
    margin: 2px 4px 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
  }

  body.sidebar-collapsed .has-submenu .submenu::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 15px;
    border: 6px solid transparent;
    border-right-color: #101828;
  }

  body.sidebar-collapsed .has-submenu:hover .submenu,
  body.sidebar-collapsed .has-submenu:focus-within .submenu,
  body.sidebar-collapsed .has-submenu.flyout-open .submenu {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
  }

  body.sidebar-collapsed .submenu a {
    color: rgba(255, 255, 255, 0.78);
  }
}

.content-wrap {
  padding: 0 34px 16px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  margin-bottom: 22px;
}

.metric-card,
.panel,
.placeholder-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.metric-card,
.wallet-card,
.transaction-item {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.metric-card:hover,
.wallet-card:hover,
.transaction-item:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--info) 22%, var(--line));
  box-shadow: var(--shadow-hover);
}

.metric-card {
  min-height: 172px;
  padding: 22px;
  overflow: hidden;
}

.metric-card.teal { background: var(--metric-teal-bg); }
.metric-card.violet { background: var(--metric-violet-bg); }
.metric-card.orange { background: var(--metric-orange-bg); }
.metric-card.blue { background: var(--metric-blue-bg); }

.metric-head {
  gap: 13px;
}

.metric-head h2,
.panel h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.metric-icon,
.goal-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
}

.metric-icon {
  width: 40px;
  height: 40px;
  color: #fff;
  font-size: 20px;
}

.teal .metric-icon { background: var(--teal); }
.violet .metric-icon { background: #7567f0; }
.orange .metric-icon { background: var(--orange); }
.blue .metric-icon { background: #2292ee; }

.metric-value {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 24px;
}

.metric-value strong {
  font-size: clamp(23px, 2vw, 29px);
  letter-spacing: 0;
}

.metric-value span {
  color: var(--success);
  font-size: 13px;
  font-weight: 800;
}

.spark {
  height: 43px;
  margin-top: 10px;
}

.spark svg {
  width: 100%;
  height: 100%;
}

.spark path {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
}

.spark.line::after {
  content: "";
  display: block;
  height: 100%;
  margin-top: -43px;
  background: linear-gradient(180deg, currentColor, transparent);
  opacity: 0.08;
}

.teal .spark { color: var(--teal); }
.orange .spark { color: var(--orange); }
.blue .spark { color: var(--blue); }

.spark.bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  color: #8b75ed;
}

.spark.bars i {
  flex: 1 1 5px;
  min-width: 4px;
  border-radius: 6px 6px 0 0;
  background: currentColor;
  opacity: 0.78;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 22px;
}

.account-panel {
  grid-column: span 5;
}

.chart-panel {
  grid-column: span 7;
}

.transactions-panel {
  grid-column: span 8;
}

.goals-panel {
  grid-column: span 4;
}

.panel {
  padding: 22px;
}

.panel-head,
.panel-title-row {
  justify-content: space-between;
  gap: 16px;
}

.panel-head strong {
  display: block;
  margin-top: 6px;
  font-size: 23px;
}

.outline-action {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid #cfd8ea;
  background: var(--control-bg);
  color: var(--info);
  font-size: 13px;
}

.wallet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.wallet-card {
  min-height: 112px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(20, 39, 73, 0.05);
  background: var(--surface-solid);
}

.wallet-top {
  gap: 10px;
}

.wallet-top button {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.flag {
  font-size: 28px;
  line-height: 1;
}

.wallet-card strong {
  display: block;
  margin-top: 12px;
  font-size: 18px;
}

.wallet-card p {
  margin: 4px 0 0;
  color: var(--success);
  font-size: 13px;
  font-weight: 700;
}

.chart-panel {
  position: relative;
}

.chart-panel .form-select {
  width: 134px;
  height: 38px;
  border-color: var(--line);
  background-color: var(--control-bg);
  color: var(--control-text);
  font-size: 13px;
  font-weight: 650;
}

.chart-wrap {
  position: relative;
  height: 286px;
  margin-top: 10px;
}

.chart-tooltip {
  position: absolute;
  min-width: 144px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-solid) 94%, transparent);
  box-shadow: 0 14px 34px rgba(26, 39, 68, 0.16);
  font-size: 12px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.chart-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -18px;
  width: 1px;
  height: 18px;
  background: repeating-linear-gradient(to bottom, #7d8ca4 0 4px, transparent 4px 8px);
}

.chart-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.chart-tooltip b {
  display: block;
  margin-bottom: 9px;
}

.chart-tooltip p {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 6px 0;
  color: var(--muted);
}

.chart-tooltip strong {
  margin-left: auto;
  color: var(--text);
}

.dot,
.legend-row i {
  display: inline-block;
  border-radius: 999px;
}

.dot {
  width: 6px;
  height: 6px;
}

.blue { background: var(--blue); }
.purple { background: var(--purple); }
.teal { background: var(--teal); }

.legend-row {
  display: flex;
  justify-content: center;
  gap: 48px;
  color: #667085;
  font-size: 13px;
}

.legend-row i {
  width: 18px;
  height: 4px;
  margin-right: 8px;
  vertical-align: middle;
}

.compact h2 {
  flex: 1 1 auto;
}

.tabs {
  display: flex;
  gap: 22px;
}

.tabs button,
.panel-title-row a {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.tabs button {
  position: relative;
  padding: 0 0 10px;
}

.tabs button.active {
  color: var(--info);
}

.tabs button.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--info);
}

.table {
  min-width: 620px;
  margin: 16px 0 0;
}

.transaction-list-mobile {
  display: none;
}

.table th {
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

:root[data-theme="dark"] .table th {
  color: var(--muted);
}

:root[data-theme="dark"] .table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--muted);
  --bs-table-border-color: var(--line);
}

.table td {
  padding: 13px 8px;
  color: var(--muted);
  font-size: 13px;
  border-color: #eef2f7;
}

.tx-logo {
  display: inline-grid;
  width: 22px;
  height: 22px;
  margin-right: 12px;
  place-items: center;
  border-radius: 5px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.stripe { background: #123c7c; }
.shopify { background: #8bc34a; }
.google { background: #4285f4; }
.paypal { background: #0a65cc; }
.aws { background: #f3a71f; color: #152545; }

.positive {
  color: var(--success) !important;
  font-weight: 800;
}

.negative {
  color: var(--danger) !important;
  font-weight: 800;
}

.status {
  display: inline-block;
  min-width: 74px;
  padding: 5px 9px;
  border-radius: 999px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.status.success {
  background: color-mix(in srgb, var(--success) 16%, transparent);
  color: var(--success);
}

.status.completed {
  background: color-mix(in srgb, var(--info) 16%, transparent);
  color: var(--info);
}

.transaction-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
}

.transaction-main {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.transaction-main h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 800;
}

.transaction-main p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.transaction-side {
  display: grid;
  justify-items: end;
  gap: 8px;
  flex: 0 0 auto;
}

.goals-list {
  display: grid;
  gap: 23px;
  margin-top: 22px;
}

.goal-row {
  gap: 16px;
}

.goal-icon {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  font-size: 24px;
}

.goal-row.violet .goal-icon { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.goal-row.teal .goal-icon { background: color-mix(in srgb, var(--teal) 14%, transparent); color: var(--teal); }
.goal-row.orange .goal-icon { background: color-mix(in srgb, var(--warning) 14%, transparent); color: var(--warning); }
.goal-row.success-soft .goal-icon {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--success);
}

.goal-content {
  flex: 1;
}

.goal-meta {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.goal-meta p {
  margin: 0 0 4px;
  color: #667085;
  font-size: 13px;
  font-weight: 650;
}

.goal-meta strong {
  font-size: 18px;
}

.goal-meta span,
.goal-meta b {
  color: #59667a;
  font-size: 14px;
}

.progress {
  height: 7px;
  background: color-mix(in srgb, var(--muted) 16%, transparent);
}

.goal-row.violet .progress-bar { background: var(--primary); }
.goal-row.teal .progress-bar { background: var(--teal); }
.goal-row.orange .progress-bar { background: var(--orange); }
.goal-row.success-soft .progress-bar { background: var(--success); }

.top-clients {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.top-clients div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

.top-clients span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-clients strong {
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}

.placeholder-panel {
  min-height: 420px;
  padding: 42px;
}

.site-footer {
  padding: 0 34px 24px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

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

.module-kicker {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--info);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.module-header h2,
.modal-title {
  margin: 0;
  color: var(--text);
  font-size: 26px;
  font-weight: 800;
}

.module-header p {
  margin: 8px 0 0;
  color: var(--muted);
}

.module-panel {
  min-height: 520px;
}

.module-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(460px, 100%);
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control-bg);
  color: var(--muted);
}

.search-field input,
.search-field select {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.product-toolbar .search-field {
  width: auto;
  min-width: 180px;
  flex: 1 1 180px;
}

.product-toolbar .search-field:nth-child(2) {
  flex-basis: 280px;
}

.loader-text {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.clients-table-wrap {
  overflow-x: auto;
}

.clients-table {
  min-width: 980px;
}

.clients-table strong,
.client-card h3 {
  display: block;
  color: var(--text);
  font-size: 14px;
}

.clients-table small,
.muted-line {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.muted-line i {
  margin-right: 6px;
}

.id-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--info) 12%, transparent);
  color: var(--info);
  font-size: 12px;
  font-weight: 800;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.success {
  background: color-mix(in srgb, var(--success) 12%, transparent);
  color: var(--success);
}

.status-pill.muted {
  background: color-mix(in srgb, var(--muted) 12%, transparent);
  color: var(--muted);
}

.status-pill.warning {
  background: color-mix(in srgb, var(--warning) 13%, transparent);
  color: var(--warning);
}

.quote-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.75fr);
  gap: 22px;
  align-items: start;
}

.quote-create-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.36fr);
  gap: 22px;
  align-items: start;
}

.quote-form-panel {
  display: grid;
  gap: 18px;
}

.quote-workspace-form {
  display: grid;
  gap: 22px;
}

.quote-work-panel {
  overflow: hidden;
  border-radius: 18px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--info) 5%, transparent), transparent 36%),
    var(--surface-solid);
}

.quote-form-title {
  align-items: flex-start;
  gap: 16px;
}

.quote-work-hero {
  position: relative;
  padding: 2px 0 4px;
}

.quote-work-heading {
  min-width: 0;
}

.quote-work-heading h3 {
  margin: 4px 0 4px;
  color: var(--text);
  font-size: clamp(26px, 2.6vw, 38px);
  font-weight: 950;
  line-height: 1;
}

.quote-work-heading p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.quote-edit-status-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.quote-edit-status-line > span:not(.status-pill) {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.quote-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.quote-actions .btn,
.quote-actions .primary-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 8px;
  font-weight: 800;
}

.quote-section-block {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
}

.quote-section-title {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.quote-section-title > i {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary) 11%, transparent);
  color: var(--primary);
  font-size: 19px;
}

.quote-section-title h4 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 950;
}

.quote-section-title p,
.quote-products-title p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.quote-list-summary {
  display: grid;
  grid-template-columns: 1.15fr repeat(3, minmax(150px, .7fr));
  gap: 12px;
  margin-bottom: 16px;
}

.quote-summary-card {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
}

.quote-summary-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.quote-summary-card strong {
  color: var(--text);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.quote-summary-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quote-summary-card.pending {
  background: linear-gradient(145deg, color-mix(in srgb, var(--warning) 11%, transparent), var(--surface-solid));
}

.quote-summary-card.accepted {
  background: linear-gradient(145deg, color-mix(in srgb, var(--success) 10%, transparent), var(--surface-solid));
}

.quote-summary-card.rejected {
  background: linear-gradient(145deg, color-mix(in srgb, var(--muted) 10%, transparent), var(--surface-solid));
}

.quote-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.quote-flow-card {
  position: relative;
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.quote-flow-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--warning);
}

.quote-flow-card.accepted::before {
  background: var(--success);
}

.quote-flow-card.rejected::before {
  background: var(--muted);
}

.quote-flow-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--info) 20%, var(--line));
  box-shadow: var(--shadow-hover);
}

.quote-flow-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: flex-start;
}

.quote-flow-head h3 {
  margin: 10px 0 4px;
  color: var(--text);
  font-size: 17px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.quote-flow-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.quote-flow-status {
  display: grid;
  justify-items: end;
  gap: 10px;
  text-align: right;
}

.quote-flow-status strong {
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
  white-space: nowrap;
}

.quote-flow-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quote-flow-meta span,
.quote-contact-line span {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.quote-flow-meta i,
.quote-contact-line i {
  flex: 0 0 auto;
  color: var(--info);
}

.quote-flow-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.quote-contact-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  min-width: 0;
}

.quote-flow-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  gap: 8px;
}

.quote-form-body {
  display: grid;
  gap: 14px;
}

.quote-client-row,
.quote-options-row,
.quote-terms-row {
  display: grid;
  gap: 16px;
}

.quote-client-row {
  grid-template-columns: minmax(280px, 1fr) minmax(210px, 0.45fr);
}

.quote-options-row {
  grid-template-columns: repeat(3, minmax(170px, 1fr));
}

.quote-terms-row {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.quote-notes-row {
  display: grid;
  grid-template-columns: 1fr;
}

.quote-notes-settings-row {
  grid-template-columns: minmax(260px, 1fr) minmax(120px, .22fr) minmax(150px, .24fr);
  align-items: end;
  gap: 12px;
}

.quote-notes-settings-row-edit {
  grid-template-columns: minmax(260px, 1fr) minmax(120px, .18fr) minmax(150px, .22fr) minmax(130px, .18fr);
}

.quote-notes-settings-row .form-control {
  min-height: 40px;
}

.quote-form-body label,
.quote-notes-row label {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.field-shell {
  display: block;
}

.select2-clear-wrap {
  position: relative;
}

.select2-manual-clear {
  position: absolute;
  top: 50%;
  right: 38px;
  z-index: 3;
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.select2-manual-clear:hover,
.select2-manual-clear:focus-visible {
  background: var(--surface-solid);
  color: var(--danger);
}

.select2-manual-clear[hidden] {
  display: none;
}

.inline-label-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.link-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
}

.link-action:hover,
.link-action:focus-visible {
  color: var(--primary-strong);
  text-decoration: underline;
}

.select2-container--default .select2-selection--single {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  padding: 9px 38px 9px 14px;
  color: var(--text);
  line-height: 26px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 44px;
  right: 10px;
}

.select2-dropdown {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  outline: none;
}

.select2-dropdown .select2-search--dropdown {
  display: block;
  padding: 8px;
}

.select2-container--open .select2-search__field {
  min-height: 38px;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: var(--primary);
}

.quote-builder {
  position: sticky;
  top: 22px;
}

.quote-summary-panel {
  position: sticky;
  top: 22px;
}

.quote-products-panel {
  margin-top: 22px;
}

.quote-products-panel:focus {
  outline: 3px solid color-mix(in srgb, var(--info) 24%, transparent);
  outline-offset: 3px;
}

.quote-products-title {
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.quote-products-title .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 8px;
  font-weight: 850;
}

.quote-detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.quote-detail-actions .btn,
.quote-detail-actions .primary-action {
  min-height: 42px;
}

.quote-search-product-action {
  position: relative;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--info) 28%, var(--line));
  background: color-mix(in srgb, var(--info) 8%, var(--control-bg));
  color: var(--info);
}

.quote-search-product-action::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, .45) 42%, transparent 72%);
  opacity: 0;
  transform: translateX(-100%);
}

.quote-search-product-action:hover,
.quote-search-product-action:focus-visible {
  border-color: var(--info);
  background: color-mix(in srgb, var(--info) 14%, var(--control-bg));
  color: var(--info);
  box-shadow: 0 10px 22px color-mix(in srgb, var(--info) 14%, transparent);
}

.quote-search-product-action:hover::after,
.quote-search-product-action:focus-visible::after {
  opacity: 1;
  transform: translateX(100%);
  transition: transform .65s ease, opacity .2s ease;
}

.quote-products-panel .clients-table-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
}

.quote-products-panel .clients-table {
  min-width: 900px;
  margin: 0;
}

.quote-products-panel .clients-table thead th {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.quote-products-panel .clients-table tbody td {
  padding: 14px 16px;
  border-color: var(--line);
}

.quote-products-panel .clients-table tbody tr:nth-last-child(-n + 5) td {
  background: color-mix(in srgb, var(--info) 4%, transparent);
  color: var(--muted);
  font-weight: 850;
}

.quote-products-panel .clients-table tbody tr:last-child td {
  background: color-mix(in srgb, var(--success) 8%, transparent);
  color: var(--text);
  font-size: 15px;
}

.quote-product-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quote-product-picker-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--info) 5%, transparent), transparent 42%),
    var(--surface-solid);
  box-shadow: var(--shadow-soft);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.quote-product-picker-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--info) 24%, var(--line));
  box-shadow: var(--shadow);
}

.quote-product-picker-head {
  display: grid;
  gap: 6px;
}

.quote-product-picker-head strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.quote-product-picker-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.quote-product-picker-controls {
  display: grid;
  grid-template-columns: .7fr .8fr 1fr;
  gap: 8px;
}

.quote-product-picker-controls label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.quote-product-picker-controls .form-control {
  margin-top: 5px;
  min-height: 38px;
  border-radius: 8px;
}

.quote-product-add {
  width: 100%;
  min-height: 40px;
  gap: 8px;
}

.quote-product-add.is-added,
.quote-product-add:disabled {
  opacity: .72;
  cursor: progress;
}

.quote-item-adder,
.quote-items,
.quote-totals {
  display: grid;
  gap: 12px;
}

.quote-item-adder {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.quote-item-adder .form-grid {
  grid-column: 1 / -1;
}

.quote-item-adder-wide {
  grid-template-columns: minmax(260px, 1fr) minmax(110px, 0.2fr) minmax(130px, 0.22fr) auto;
  align-items: end;
  margin-bottom: 16px;
}

.quote-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-solid);
}

.quote-item strong,
.quote-total-row strong {
  color: var(--text);
}

.quote-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.quote-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.quote-tax-select {
  display: inline-block;
  width: auto;
  min-width: 150px;
  margin: 0 8px 0 0;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}

.template-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.template-card:hover,
.template-card.active {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--info) 38%, var(--line));
  box-shadow: var(--shadow);
}

.template-choice {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  cursor: pointer;
}

.template-choice input {
  accent-color: var(--info);
}

.template-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control-bg);
  padding: 0;
}

.template-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top;
}

.template-choice span {
  color: var(--text);
  font-weight: 850;
}

.template-card small {
  color: var(--muted);
}

.template-preview-full {
  display: block;
  width: 100%;
  max-height: 76vh;
  object-fit: contain;
}

.template-lightbox[hidden] {
  display: none;
}

.template-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.template-lightbox-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(8, 17, 36, 0.62);
}

.template-lightbox-panel {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--shadow-hover);
}

.template-lightbox-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.template-lightbox-header h3 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 850;
}

.template-lightbox-panel .template-preview-full {
  padding: 16px;
}

.product-search-panel-card {
  width: min(1120px, 100%);
  max-height: min(760px, calc(100vh - 32px));
}

.product-search-panel {
  align-items: start;
  padding-top: 20px;
}

.quote-item-panel {
  align-items: start;
  padding-top: 20px;
}

.quote-quick-panel {
  align-items: start;
  padding-top: 20px;
}

.quote-item-panel-card {
  width: min(620px, 100%);
  max-height: calc(100vh - 40px);
}

.quote-quick-panel-card {
  width: min(780px, 100%);
  max-height: calc(100vh - 40px);
}

.quote-contact-panel-card {
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
}

.product-search-body {
  display: grid;
  gap: 16px;
  padding: 18px;
  overflow: auto;
}

.product-search-body .module-toolbar {
  margin-bottom: 0;
}

.quote-item-edit-body {
  padding: 18px;
}

.quote-quick-body {
  padding: 18px;
}

.quote-item-edit-footer,
.quote-quick-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}

body.lightbox-open {
  overflow: hidden;
}

.contact-stack {
  display: grid;
  gap: 8px;
}

.contact-chip {
  display: grid;
  gap: 2px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-solid);
}

.contact-chip span {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.contact-chip i {
  margin-right: 5px;
}

.contact-chip small {
  color: var(--muted);
}

.contact-actions,
.action-row {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.link-icon,
.icon-btn-sm {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--control-bg);
  color: var(--info);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.link-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.icon-btn-sm {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.link-icon:hover,
.icon-btn-sm:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--info) 28%, var(--line));
  box-shadow: var(--shadow-soft);
}

.danger {
  color: var(--danger) !important;
}

.mobile-client-list {
  display: none;
}

.client-card,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
}

.client-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
}

.client-card h3 {
  margin: 10px 0 4px;
}

.client-card p {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 13px;
}

.client-card p i {
  margin-right: 6px;
}

.client-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.client-profile-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--info) 5%, transparent), transparent 38%),
    var(--surface-solid);
  box-shadow: var(--shadow-soft);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.client-profile-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--info) 22%, var(--line));
  box-shadow: var(--shadow-hover);
}

.client-profile-head {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: flex-start;
}

.client-avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--info), var(--primary));
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 14px 28px rgba(29, 127, 240, .2);
}

.client-title-block {
  min-width: 0;
}

.client-title-block h3 {
  margin: 6px 0 3px;
  color: var(--text);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.client-title-block p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.client-actions-menu .dropdown-menu {
  min-width: 190px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-hover);
}

.client-actions-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 9px;
  font-weight: 750;
}

.activity-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.activity-pill.active {
  background: color-mix(in srgb, var(--success) 12%, transparent);
  color: var(--success);
}

.activity-pill.idle {
  background: color-mix(in srgb, var(--muted) 12%, transparent);
  color: var(--muted);
}

.client-results-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.client-results-summary span {
  color: var(--text);
  font-weight: 850;
}

.client-address-line em {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-style: normal;
}

.client-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.client-metrics span {
  min-width: 0;
  padding: 8px 9px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg) 62%, transparent);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.client-metrics strong {
  display: inline;
  margin-right: 4px;
  color: var(--text);
  font-size: 13px;
}

.client-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.client-info-grid span {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  padding: 8px 9px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg) 50%, transparent);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.client-info-grid i {
  flex: 0 0 auto;
  color: var(--info);
}

.client-info-grid .span-2 {
  grid-column: 1 / -1;
}

.client-contact-section {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.client-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.link-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--info);
  font-size: 12px;
  font-weight: 850;
}

.link-action:hover,
.link-action:focus {
  color: var(--primary);
}

.client-contact-list {
  display: grid;
  gap: 7px;
}

.client-contact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--control-bg);
}

.client-contact-item div:first-child {
  min-width: 0;
}

.client-contact-item strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.client-contact-item strong i {
  margin-right: 6px;
  color: var(--info);
}

.client-contact-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.client-empty-line,
.client-more-contacts {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--warning) 10%, transparent);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.client-more-contacts {
  width: fit-content;
  border: 0;
  background: color-mix(in srgb, var(--info) 10%, transparent);
  color: var(--info);
}

.client-more-contacts:hover,
.client-more-contacts:focus {
  background: color-mix(in srgb, var(--info) 16%, transparent);
  color: var(--primary);
  outline: none;
}

.product-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.product-profile-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--success) 5%, transparent), transparent 40%),
    var(--surface-solid);
  box-shadow: var(--shadow-soft);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.product-profile-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--success) 22%, var(--line));
  box-shadow: var(--shadow-hover);
}

.product-profile-head {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: flex-start;
}

.product-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--success), var(--teal));
  color: #fff;
  font-size: 20px;
  box-shadow: 0 14px 28px rgba(15, 159, 110, .18);
}

.product-title-block {
  min-width: 0;
}

.product-title-block h3 {
  display: -webkit-box;
  margin: 6px 0 3px;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.25;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-title-block p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.product-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--success) 9%, transparent);
}

.product-price-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.product-price-row strong {
  color: var(--success);
  font-size: 20px;
  font-weight: 900;
  white-space: nowrap;
}

.product-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.product-info-grid .product-description-line em {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-style: normal;
}

.manufacturer-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.manufacturer-profile-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--purple) 5%, transparent), transparent 40%),
    var(--surface-solid);
  box-shadow: var(--shadow-soft);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.manufacturer-profile-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--purple) 22%, var(--line));
  box-shadow: var(--shadow-hover);
}

.manufacturer-profile-head {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: flex-start;
}

.manufacturer-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--purple), var(--primary));
  color: #fff;
  font-size: 20px;
  box-shadow: 0 14px 28px rgba(129, 56, 229, .18);
}

.manufacturer-product-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--purple) 9%, transparent);
}

.manufacturer-product-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.manufacturer-product-row strong {
  color: var(--purple);
  font-size: 22px;
  font-weight: 900;
}

.manufacturer-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.currency-card-grid,
.tax-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.currency-profile-card,
.tax-profile-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.currency-profile-card {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--blue) 5%, transparent), transparent 40%),
    var(--surface-solid);
}

.tax-profile-card {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--orange) 6%, transparent), transparent 40%),
    var(--surface-solid);
}

.currency-profile-card:hover,
.tax-profile-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.currency-profile-card:hover {
  border-color: color-mix(in srgb, var(--blue) 22%, var(--line));
}

.tax-profile-card:hover {
  border-color: color-mix(in srgb, var(--orange) 24%, var(--line));
}

.currency-profile-head,
.tax-profile-head {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: flex-start;
}

.tax-profile-head {
  grid-template-columns: 46px minmax(0, 1fr) auto auto;
}

.currency-icon,
.tax-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
}

.currency-icon {
  background: linear-gradient(135deg, var(--blue), var(--primary));
  box-shadow: 0 14px 28px rgba(29, 127, 240, .18);
}

.tax-icon {
  background: linear-gradient(135deg, var(--orange), var(--warning));
  box-shadow: 0 14px 28px rgba(247, 144, 47, .18);
}

.currency-format-row,
.tax-value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
}

.currency-format-row {
  background: color-mix(in srgb, var(--blue) 9%, transparent);
}

.tax-value-row {
  background: color-mix(in srgb, var(--orange) 11%, transparent);
}

.currency-format-row span,
.tax-value-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.currency-format-row strong {
  color: var(--blue);
  font-size: 20px;
  font-weight: 900;
}

.tax-value-row strong {
  color: var(--orange);
  font-size: 22px;
  font-weight: 900;
}

.currency-metrics,
.tax-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.user-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.user-profile-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--primary) 5%, transparent), transparent 40%),
    var(--surface-solid);
  box-shadow: var(--shadow-soft);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.user-profile-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary) 22%, var(--line));
  box-shadow: var(--shadow-hover);
}

.user-profile-head {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: flex-start;
}

.user-card-avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 14px 28px rgba(95, 99, 242, .18);
}

.user-role-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary) 9%, transparent);
}

.user-role-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.user-role-row strong {
  color: var(--primary);
  font-size: 16px;
  font-weight: 900;
  text-align: right;
  overflow-wrap: anywhere;
}

.user-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.user-info-grid span {
  overflow-wrap: anywhere;
}

.role-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.role-profile-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--blue) 6%, transparent), transparent 42%),
    var(--surface-solid);
  box-shadow: var(--shadow-soft);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.role-profile-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--blue) 24%, var(--line));
  box-shadow: var(--shadow-hover);
}

.role-profile-head {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: flex-start;
}

.role-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--blue), var(--primary));
  color: #fff;
  font-size: 20px;
  box-shadow: 0 14px 28px rgba(47, 128, 237, .18);
}

.role-permission-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--blue) 9%, transparent);
}

.role-permission-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.role-permission-row strong {
  color: var(--blue);
  font-size: 22px;
  font-weight: 900;
}

.role-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.role-permission-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.role-permission-chips span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--control-bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.role-permission-chips i {
  color: var(--blue);
}

.pagination-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.pagination-row button {
  min-width: 34px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control-bg);
  color: var(--muted);
  font-weight: 800;
}

.pagination-row.compact {
  max-width: 100%;
}

.pagination-row button:disabled {
  opacity: .42;
  cursor: not-allowed;
}

.pagination-row button:disabled:hover {
  border-color: var(--line);
  background: var(--control-bg);
  color: var(--muted);
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 34px;
  color: var(--muted);
  font-weight: 800;
}

.pagination-row button.active,
.pagination-row button:hover {
  border-color: var(--info);
  background: var(--info);
  color: #fff;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 300px;
  padding: 40px;
  text-align: center;
}

.empty-state i {
  color: var(--info);
  font-size: 34px;
}

.empty-state h3 {
  margin: 14px 0 6px;
  font-size: 18px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.app-modal .modal-content {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-hover);
}

.app-modal .modal-header,
.app-modal .modal-footer {
  border-color: var(--line);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-stack {
  display: grid;
  gap: 16px;
}

.form-grid label,
.form-stack label {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.form-grid .span-2 {
  grid-column: 1 / -1;
}

.form-control {
  margin-top: 7px;
  border-color: var(--line);
  background-color: var(--control-bg);
  color: var(--text);
}

.form-control:focus {
  border-color: var(--info);
  background-color: var(--control-bg);
  color: var(--text);
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--info) 18%, transparent);
}

.role-name-field {
  display: block;
  max-width: 520px;
  margin-bottom: 18px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.permission-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.permission-table {
  min-width: 720px;
  margin: 0;
}

.permission-table th,
.permission-table td {
  padding: 13px 16px;
}

.permission-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.permission-table label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.permission-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--info);
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.42fr);
  gap: 22px;
  align-items: start;
}

.company-preview {
  position: sticky;
  top: 22px;
  overflow: hidden;
}

.company-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, color-mix(in srgb, var(--info) 9%, transparent), transparent 52%);
  pointer-events: none;
}

.company-preview > * {
  position: relative;
  z-index: 1;
}

.company-logo-box {
  display: grid;
  min-height: 168px;
  margin: 14px 0 18px;
  padding: 18px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--info) 7%, transparent), transparent),
    var(--surface-solid);
}

.company-logo-box img {
  max-width: 100%;
  max-height: 132px;
  object-fit: contain;
}

.company-preview h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 20px;
  font-weight: 850;
}

.company-preview p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.55;
}

.company-meta {
  display: grid;
  gap: 10px;
}

.company-meta span {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.company-meta i {
  color: var(--info);
  font-size: 15px;
}

.settings-form {
  display: grid;
  gap: 20px;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

.login-page {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  width: min(1180px, calc(100% - 56px));
  min-height: min(720px, calc(100vh - 56px));
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
  border-radius: 24px;
  box-shadow: var(--shadow-hover);
  background:
    radial-gradient(circle at 16% 14%, color-mix(in srgb, var(--info) 28%, transparent), transparent 30%),
    radial-gradient(circle at 78% 72%, color-mix(in srgb, var(--primary) 24%, transparent), transparent 32%),
    linear-gradient(135deg, var(--bg), color-mix(in srgb, var(--bg) 74%, var(--info)));
}

body:has(.login-page) {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
}

.login-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(115deg, #000 0%, transparent 58%);
  opacity: 0.35;
  pointer-events: none;
}

.login-brand-panel,
.login-card {
  position: relative;
  z-index: 1;
}

.login-brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: auto;
  padding: clamp(34px, 5vw, 70px);
  background: linear-gradient(145deg, rgba(8, 29, 61, 0.97), rgba(6, 32, 74, 0.9));
  color: #fff;
}

.login-brand-panel .brand {
  position: absolute;
  top: clamp(28px, 4vw, 48px);
  left: clamp(34px, 5vw, 70px);
}

.login-brand-panel::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -120px;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.12), transparent 62%);
}

.login-brand-panel .brand {
  width: max-content;
}

.login-brand-panel h1 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(38px, 5vw, 68px);
  font-weight: 800;
  line-height: 0.98;
}

.login-brand-panel p {
  max-width: 560px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 16px;
  line-height: 1.7;
}

.login-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  justify-self: stretch;
  width: 100%;
  min-height: auto;
  padding: clamp(34px, 6vw, 86px);
  border: 0;
  border-radius: 0;
  background: color-mix(in srgb, var(--surface-solid) 94%, transparent);
  box-shadow: none;
  backdrop-filter: blur(18px);
}

.login-card::before {
  content: "";
  display: block;
  width: 56px;
  height: 5px;
  margin-bottom: 26px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--info), var(--action));
}

.login-theme {
  position: absolute;
  top: 28px;
  right: 28px;
}

.login-card h2 {
  margin: 0;
  color: var(--text);
  font-size: 34px;
  font-weight: 800;
}

.login-card > p {
  margin: 10px 0 30px;
  color: var(--muted);
  line-height: 1.55;
}

.login-card form {
  display: grid;
  gap: 20px;
  width: min(100%, 460px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-solid);
  box-shadow: var(--shadow);
}

.login-card > .module-kicker,
.login-card h2,
.login-card > p,
.login-card .alert,
.login-card form {
  margin-left: auto;
  margin-right: auto;
}

.login-card > .module-kicker,
.login-card h2,
.login-card > p,
.login-card .alert {
  max-width: 460px;
}

.login-card label {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.login-card .form-control {
  min-height: 52px;
  border-radius: 8px;
  padding-inline: 14px;
}

.login-card .primary-action {
  min-height: 52px;
  margin-top: 8px;
}

.login-helper-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--action);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.login-helper-link:hover,
.login-helper-link:focus-visible {
  color: var(--info);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.profile-card {
  display: grid;
  align-content: start;
  gap: 12px;
}

.profile-avatar {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--info), var(--action));
  color: #fff;
  font-size: 28px;
  font-weight: 900;
  box-shadow: var(--shadow-md);
}

.profile-card h3 {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 22px;
}

.profile-card p {
  margin: 0;
  color: var(--muted);
}

.profile-facts {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.profile-facts span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
}

.settings-title {
  margin: 6px 0 6px;
  color: var(--text);
  font-size: 22px;
  font-weight: 900;
}

.settings-description {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

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

@media (max-width: 1280px) {
  .app-shell {
    padding: 0;
  }

  .sidebar {
    flex-basis: 232px;
    width: 232px;
    min-height: 100vh;
    padding: 26px 16px;
  }

  .main-panel {
    min-height: 100vh;
  }

  .topbar {
    padding: 30px 28px 22px;
  }

  .content-wrap {
    padding-inline: 28px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

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

  .account-panel,
  .chart-panel,
  .transactions-panel,
  .goals-panel {
    grid-column: 1 / -1;
  }

  .chart-wrap {
    height: 320px;
  }
}

@media (max-width: 1200px) {
  .quote-list-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quote-card-grid {
    grid-template-columns: 1fr;
  }

  .client-card-grid,
  .product-card-grid,
  .manufacturer-card-grid,
  .currency-card-grid,
  .tax-card-grid,
  .user-card-grid,
  .role-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 992px) {
  .quote-layout {
    grid-template-columns: 1fr;
  }

  .quote-create-grid,
  .quote-item-adder-wide {
    grid-template-columns: 1fr;
  }

  .quote-form-title {
    align-items: stretch;
    flex-direction: column;
  }

  .quote-actions {
    justify-content: flex-start;
  }

  .quote-actions .btn,
  .quote-actions .primary-action {
    flex: 1 1 180px;
    justify-content: center;
  }

  .quote-flow-head {
    grid-template-columns: 1fr;
  }

  .quote-flow-status {
    justify-items: start;
    text-align: left;
  }

  .quote-client-row,
  .quote-options-row,
  .quote-terms-row,
  .quote-notes-settings-row,
  .quote-notes-settings-row-edit {
    grid-template-columns: 1fr;
  }

  .quote-builder {
    position: static;
  }

  .quote-summary-panel {
    position: static;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .company-preview {
    position: static;
  }

  .login-page {
    grid-template-columns: 1fr;
    width: min(100% - 28px, 520px);
    min-height: auto;
    border-radius: 18px;
    align-content: center;
  }

  .login-brand-panel {
    display: none;
  }

  .login-brand-panel h1 {
    max-width: 720px;
    font-size: clamp(34px, 8vw, 56px);
  }

  .login-card {
    width: 100%;
    min-height: auto;
    margin: 0;
    padding: 34px;
    border: 0;
    border-radius: 18px;
    box-shadow: none;
  }

  .app-shell {
    padding: 0;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    flex-basis: auto;
    min-height: 100vh;
    width: min(310px, 86vw);
    border-radius: 0;
    transition: transform 0.24s ease, width 0.24s ease, padding 0.24s ease;
    transform: translateX(-104%);
  }

  .side-nav {
    overflow-y: auto;
  }

  body.sidebar-collapsed .sidebar {
    flex-basis: auto;
    width: min(310px, 86vw);
    padding: 30px 20px;
  }

  body.sidebar-collapsed .main-panel {
    width: 100%;
    margin-left: 0;
  }

  body.sidebar-collapsed .brand {
    justify-content: flex-start;
  }

  body.sidebar-collapsed .brand strong,
  body.sidebar-collapsed .nav-group p,
  body.sidebar-collapsed .nav-link span {
    display: inline;
  }

  body.sidebar-collapsed .brand-row {
    justify-content: space-between;
  }

  body.sidebar-collapsed .nav-link {
    justify-content: flex-start;
    padding: 0 13px;
  }

  body.sidebar-collapsed .submenu-chevron {
    display: inline-block;
  }

  body.sidebar-collapsed .nav-link::before,
  body.sidebar-collapsed .nav-link::after {
    display: none;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(8, 17, 36, 0.48);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-close,
  .menu-toggle {
    display: inline-grid;
  }

  .main-panel {
    width: 100%;
    min-height: 100vh;
    margin-left: 0;
    border-radius: 0;
  }

  .topbar {
    align-items: flex-start;
    gap: 18px;
    padding: 22px 20px;
  }

  .content-wrap {
    padding: 0 20px 16px;
  }

  .topbar-copy {
    width: 100%;
    align-items: flex-start;
  }

  .topbar-copy > div {
    flex: 1 1 auto;
    min-width: 0;
  }

  .topbar h1 {
    font-size: 23px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }

  .primary-action {
    margin-left: auto;
  }

  .metric-card {
    min-height: 154px;
    padding: 19px;
  }

  .metric-value {
    margin-top: 18px;
  }

  .panel {
    padding: 20px;
  }
}

@media (max-width: 720px) {
  .quote-work-heading h3 {
    font-size: 28px;
  }

  .quote-section-block {
    padding: 14px;
    border-radius: 14px;
  }

  .quote-section-title {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .quote-section-title > i {
    width: 38px;
    height: 38px;
  }

  .quote-products-title {
    align-items: stretch;
    flex-direction: column;
  }

  .quote-products-title .btn {
    justify-content: center;
    width: 100%;
  }

  .quote-detail-actions {
    width: 100%;
  }

  .quote-detail-actions .btn,
  .quote-detail-actions .primary-action {
    flex: 1 1 150px;
    justify-content: center;
  }

  .quote-product-picker-grid,
  .quote-product-picker-controls {
    grid-template-columns: 1fr;
  }

  .quote-list-summary {
    grid-template-columns: 1fr;
  }

  .quote-flow-meta {
    grid-template-columns: 1fr;
  }

  .quote-flow-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .quote-flow-actions {
    justify-content: space-between;
  }

  .login-card {
    width: 100%;
    min-height: auto;
    margin-top: 0;
    padding: 24px;
  }

  .login-card form {
    padding: 20px;
  }

  .login-card h2 {
    font-size: 25px;
  }

  .login-theme {
    top: 18px;
    right: 18px;
  }

  .topbar {
    flex-direction: column;
    padding: 18px 16px 16px;
  }

  .topbar-actions {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 10px;
  }

  .primary-action {
    min-width: 0;
    padding: 0 16px;
    justify-content: center;
    white-space: nowrap;
  }

  .summary-grid,
  .wallet-grid {
    grid-template-columns: 1fr;
  }

  .summary-grid,
  .dashboard-grid {
    gap: 14px;
  }

  .content-wrap {
    padding: 0 14px 14px;
  }

  .topbar p {
    font-size: 13px;
    line-height: 1.45;
  }

  .metric-card {
    min-height: 142px;
    padding: 16px;
  }

  .metric-head {
    gap: 11px;
  }

  .metric-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .metric-head h2,
  .panel h2 {
    font-size: 16px;
  }

  .metric-value {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    margin-top: 16px;
  }

  .spark {
    height: 36px;
  }

  .spark.line::after {
    margin-top: -36px;
  }

  .panel-title-row,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .compact {
    gap: 10px;
  }

  .tabs {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .chart-panel .form-select {
    width: 100%;
  }

  .chart-wrap {
    height: 240px;
    margin-top: 4px;
  }

  .chart-tooltip {
    max-width: calc(100vw - 54px);
    padding: 12px;
    font-size: 11px;
  }

  .wallet-card {
    min-height: auto;
  }

  .goal-row {
    gap: 12px;
  }

  .goal-icon {
    width: 46px;
    height: 46px;
    font-size: 21px;
  }

  .table-responsive {
    display: none;
  }

  .transaction-list-mobile {
    display: grid;
    gap: 12px;
    margin-top: 16px;
  }

  .legend-row {
    gap: 16px;
    flex-wrap: wrap;
  }

  .module-header {
    flex-direction: column;
    margin-bottom: 14px;
  }

  .module-header h2 {
    font-size: 22px;
  }

  .module-header .primary-action {
    width: 100%;
  }

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

  .clients-table-wrap {
    display: none;
  }

  .mobile-client-list {
    display: grid;
    gap: 12px;
  }

  .pagination-row {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .settings-actions .primary-action {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .login-page {
    min-height: 100dvh;
  }

  .login-card {
    width: 100%;
    padding: 20px;
  }

  .topbar-copy {
    align-items: flex-start;
  }

  .icon-btn {
    width: 38px;
    height: 40px;
  }

  .icon-btn i {
    font-size: 18px;
  }

  .user-menu-copy {
    display: none;
  }

  .user-menu-toggle {
    min-height: 40px;
    padding: 4px 8px 4px 4px;
  }

  .user-avatar {
    width: 32px;
    height: 32px;
  }

  .topbar h1 {
    font-size: 20px;
    line-height: 1.2;
  }

  .primary-action {
    min-height: 40px;
    padding-inline: 12px;
    font-size: 0;
  }

  .primary-action i {
    margin-right: 0;
    font-size: 18px;
  }

  .primary-action span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .metric-card,
  .panel {
    padding: 15px;
  }

  .panel-title-row.compact {
    width: 100%;
  }

  .outline-action {
    width: 100%;
    justify-content: center;
  }

  .wallet-top {
    align-items: flex-start;
  }

  .chart-wrap {
    height: 220px;
  }

  .goal-row {
    align-items: flex-start;
  }

  .goal-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .transaction-item {
    flex-direction: column;
  }

  .transaction-side {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .client-card {
    flex-direction: column;
  }

  .client-card .action-row {
    width: 100%;
    justify-content: space-between;
  }

  .client-card-grid,
  .product-card-grid,
  .manufacturer-card-grid,
  .currency-card-grid,
  .tax-card-grid,
  .user-card-grid,
  .role-card-grid {
    grid-template-columns: 1fr;
  }

  .client-profile-head,
  .product-profile-head,
  .manufacturer-profile-head,
  .currency-profile-head,
  .tax-profile-head,
  .user-profile-head,
  .role-profile-head {
    grid-template-columns: 48px minmax(0, 1fr) auto;
  }

  .activity-pill {
    grid-column: 2 / 3;
    width: fit-content;
  }

  .client-avatar,
  .product-icon,
  .manufacturer-icon,
  .currency-icon,
  .tax-icon,
  .user-card-avatar,
  .role-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .client-metrics,
  .client-info-grid,
  .product-metrics,
  .product-info-grid,
  .manufacturer-metrics,
  .currency-metrics,
  .tax-metrics,
  .user-metrics,
  .user-info-grid,
  .role-metrics {
    grid-template-columns: 1fr;
  }

  .client-contact-item {
    align-items: flex-start;
  }
}
