/* Reset and Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.price-matrix-wrap {
  overflow: auto;
  max-height: 68vh;
}

.price-matrix-table {
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
}

.price-matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background-color: #f8fafc !important;
  box-shadow: 0 1px 0 var(--border-color);
}

.price-matrix-table .sticky-col {
  position: sticky;
  z-index: 2;
  background: #ffffff;
  color: var(--text-primary);
}

.price-matrix-table thead .sticky-col {
  z-index: 5;
  background-color: #f8fafc !important;
}

.price-matrix-table .sticky-code { left: 0; min-width: 130px; }
.price-matrix-table .sticky-name { left: 130px; min-width: 260px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.price-matrix-table .sticky-brand { left: 390px; min-width: 150px; }
.price-matrix-table .sticky-package { left: 540px; min-width: 130px; box-shadow: 8px 0 12px rgba(15, 23, 42, 0.08); }
.price-matrix-table .price-col { min-width: 176px; text-align: right; }
.price-matrix-table .sku-code { font-weight: 700; color: var(--text-primary); }
.price-matrix-input { width: 128px; text-align: right; }
.price-matrix-value {
  display: inline-flex;
  width: 128px;
  min-height: 36px;
  align-items: center;
  justify-content: flex-end;
  padding: 0 0.75rem;
  color: var(--text-primary);
  font-weight: 700;
  white-space: nowrap;
}
.price-cell.missing .price-matrix-value {
  color: var(--text-muted);
  font-weight: 500;
}
.price-cell.dirty .price-matrix-input {
  border-color: var(--color-warning);
  background: rgba(245, 158, 11, 0.08);
}
.price-column-header {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}
.price-type-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}
.price-type-badge.specific {
  color: #047857;
  background: #d1fae5;
}
.price-type-badge.group {
  color: #1d4ed8;
  background: #dbeafe;
}
.price-type-badge.standard {
  color: #92400e;
  background: #fef3c7;
}
.price-cell-editor {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3rem;
  min-height: 36px;
}
.price-cell-editor .icon-btn {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.price-cell-editor .icon-btn:hover {
  color: var(--color-primary-hover);
  background: var(--color-primary-light);
}
.price-cell-status {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.68rem;
  font-weight: 600;
}
.price-cell-status.inherited { color: var(--text-muted); }
.price-cell-status.missing,
.missing-price { color: #b91c1c; }
.price-cell-status.direct { color: #047857; }
.price-cell.inherited .price-matrix-input {
  color: var(--text-muted);
  background: #f8fafc;
}

.price-matrix-controls {
  display: grid;
  grid-template-columns: minmax(240px, 1.2fr) minmax(220px, 1fr) repeat(3, minmax(150px, 0.7fr));
  gap: 0.75rem;
  align-items: center;
}

.price-list-picker {
  position: relative;
}

.price-list-picker summary {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  cursor: pointer;
  padding: 0.625rem 0.75rem 0.625rem 0.875rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #000000;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.price-list-picker summary::-webkit-details-marker {
  display: none;
}

.price-list-picker summary::after {
  content: "";
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 1.1rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 1.1rem;
}

.price-list-picker[open] summary {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--border-focus), inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.price-list-picker-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow: hidden;
  padding: 0.45rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-surface);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.price-list-picker-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.85rem;
  cursor: pointer;
}
.price-list-picker-option > label {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.price-list-picker-option:hover {
  background: var(--bg-surface-hover);
}

.price-list-picker-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.45rem;
  border-bottom: 1px solid var(--border-color);
}
.price-list-picker-search-wrap svg {
  width: 15px;
  color: var(--text-muted);
}

.invoice-variant-modal-content {
  width: min(680px, calc(100vw - 2rem));
  max-width: 680px;
  max-height: calc(100vh - 2rem);
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.2);
  animation: none;
}

.invoice-variant-overlay {
  z-index: 2500;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  animation: none;
}

.invoice-variant-overlay .modal-header {
  background: #ffffff;
}

.invoice-variant-overlay .modal-title {
  color: var(--text-primary);
}

.invoice-variant-overlay .modal-close:hover {
  background: #eef2f7;
  color: var(--text-primary);
}

html {
  scrollbar-gutter: stable;
}

body.invoice-variant-open {
  overflow: hidden;
}

.variant-modal-eyebrow {
  margin-bottom: 0.2rem;
  color: var(--color-primary);
  font-size: 0.78rem;
  font-weight: 800;
}

.variant-modal-brand {
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.variant-choice-list {
  display: grid;
  gap: 0.65rem;
  max-height: min(520px, calc(100vh - 190px));
  overflow-y: auto;
}

.variant-choice {
  width: 100%;
  min-height: 82px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.variant-choice:hover,
.variant-choice.highlighted {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.variant-choice:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.variant-choice-main,
.variant-choice-meta {
  min-width: 0;
}

.variant-choice-spec {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
}

.variant-choice-code,
.variant-choice-stock {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.variant-choice-price {
  display: block;
  color: var(--color-primary);
  font-size: 1rem;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.invoice-variant-display {
  display: block;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.35;
}

.invoice-variant-display small {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.7rem;
}

@media (max-width: 560px) {
  .variant-choice {
    grid-template-columns: 1fr;
  }

  .variant-choice-price {
    text-align: left;
  }
}

.product-family-editor {
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
}

.product-editor-section {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.product-editor-section + .product-editor-section {
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.product-editor-section h4 {
  font-size: 0.95rem;
}

.product-editor-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.product-editor-section-header p {
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.product-variants-editor-wrap {
  border-radius: 8px;
}

.product-variants-editor-table {
  min-width: 860px;
  table-layout: fixed;
}

.product-variants-editor-table th,
.product-variants-editor-table td {
  padding: 0.55rem;
}

.product-variants-editor-table th:nth-child(1) { width: 165px; }
.product-variants-editor-table th:nth-child(2) { width: 130px; }
.product-variants-editor-table th:nth-child(3) { width: 165px; }
.product-variants-editor-table th:nth-child(4) { width: 105px; }
.product-variants-editor-table th:nth-child(5) { width: 140px; }
.product-variants-editor-table th:nth-child(6) { width: 105px; }
.product-variants-editor-table th:nth-child(7) { width: 48px; }

.product-variants-editor-table .form-control {
  min-width: 0;
  padding: 0.5rem 0.6rem;
}
.price-list-picker-search-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
}
.price-list-picker-options {
  max-height: 220px;
  overflow: auto;
  padding-top: 0.3rem;
}
.price-list-picker-option label > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
}
.picker-actions {
  display: flex;
  gap: 0.15rem;
}
.picker-actions .icon-btn {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.picker-actions .icon-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}
.empty-table-cell,
.picker-empty {
  padding: 2.5rem;
  text-align: center;
  color: var(--text-muted);
}
.status-badge {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
}
.status-badge.active {
  color: #047857;
  background: #d1fae5;
}
.status-badge.inactive {
  color: #991b1b;
  background: #fee2e2;
}
.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.btn-success {
  background: #16a34a;
  border: 1px solid #15803d;
  color: #ffffff;
}
.btn-success:hover:not(:disabled) {
  background: #15803d;
}
.btn-success:disabled {
  background: #bbf7d0;
  border-color: #86efac;
  color: #166534 !important;
  opacity: 1;
  cursor: not-allowed;
}

@media (max-width: 1024px) {
  #pricelists-panel .controls-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  #pricelists-panel .controls-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .price-list-picker-menu {
    position: fixed;
    top: 20%;
    right: 1rem;
    left: 1rem;
    max-height: 60vh;
  }
}


/* Refined light technology section */
.landing-solutions {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 112px max(24px, calc((100vw - 1192px)/2));
  color: #143d59;
  background:
    radial-gradient(circle at 78% 45%, rgba(49, 139, 255, .16), transparent 28%),
    radial-gradient(circle at 92% 12%, rgba(41, 218, 132, .13), transparent 24%),
    linear-gradient(135deg, #f5fbff 0%, #edf8ff 48%, #f7fffb 100%);
}

.landing-solutions::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: .46;
  background-image:
    linear-gradient(rgba(18, 106, 176, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 106, 176, .055) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(90deg, transparent, #000 25%, #000 90%, transparent);
}

.landing-solutions::after {
  content: '';
  position: absolute;
  width: 420px;
  height: 420px;
  right: -180px;
  top: -220px;
  z-index: -1;
  border-radius: 50%;
  border: 72px solid rgba(26, 104, 255, .055);
  animation: solutionHalo 9s ease-in-out infinite;
}

.solution-panel {
  position: relative;
  min-height: 540px;
  display: grid;
  grid-template-columns: .88fr 1.12fr;
  align-items: center;
  gap: 76px;
}

.solution-copy {
  position: relative;
  z-index: 5;
  animation: solutionCopyIn .9s cubic-bezier(.2,.75,.25,1) both;
}

.solution-copy .section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  color: #067a4b;
  background: rgba(31, 214, 124, .11);
  border: 1px solid rgba(26, 188, 108, .18);
  border-radius: 999px;
  letter-spacing: .115em;
  box-shadow: 0 8px 24px rgba(24, 167, 96, .08);
}

.solution-copy .section-kicker::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #19c875;
  box-shadow: 0 0 0 5px rgba(25, 200, 117, .12);
  animation: solutionDot 2s ease-in-out infinite;
}

.solution-copy h2 {
  max-width: 590px;
  margin: 22px 0 23px;
  color: #0a2a43 !important;
  font-family: 'Lexend', sans-serif;
  font-size: clamp(42px, 4.25vw, 60px);
  font-weight: 750;
  line-height: 1.09;
  letter-spacing: -.052em;
  text-wrap: balance;
}

.solution-copy h2::after {
  content: '';
  display: block;
  width: 72px;
  height: 5px;
  margin-top: 22px;
  border-radius: 10px;
  background: linear-gradient(90deg, #0868ff, #24d585);
  box-shadow: 0 5px 14px rgba(8, 104, 255, .22);
}

.solution-copy > p {
  max-width: 535px;
  margin: 0;
  color: #567286;
  font-size: 16px;
  line-height: 1.8;
}

.solution-copy ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 30px 0 0;
}

.solution-copy li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  color: #244b64;
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(31, 112, 169, .13);
  border-radius: 11px;
  font-size: 13px;
  font-weight: 650;
  box-shadow: 0 8px 25px rgba(34, 92, 133, .075);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.solution-copy li:hover {
  transform: translateY(-3px);
  border-color: rgba(26, 196, 112, .33);
  box-shadow: 0 13px 30px rgba(34, 92, 133, .12);
}

.solution-copy li svg {
  width: 17px;
  height: 17px;
  padding: 3px;
  color: #fff;
  background: #19bf72;
  border-radius: 50%;
  stroke-width: 3;
}

.solution-rings {
  position: relative;
  min-height: 510px;
  display: grid;
  place-items: center;
  perspective: 1000px;
  animation: solutionVisualIn 1.05s .1s cubic-bezier(.2,.75,.25,1) both;
}

.solution-rings::before {
  content: '';
  position: absolute;
  width: 330px;
  height: 330px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(17, 109, 255, .15), rgba(46, 184, 255, .055) 46%, transparent 70%);
  filter: blur(3px);
  animation: solutionCoreBreath 4.2s ease-in-out infinite;
}

.solution-grid-glow {
  position: absolute;
  width: 470px;
  height: 360px;
  border: 1px solid rgba(55, 137, 205, .13);
  border-radius: 42% 58% 55% 45%;
  background: rgba(255,255,255,.34);
  box-shadow: inset 0 0 60px rgba(35, 139, 255, .06), 0 35px 80px rgba(36, 105, 155, .08);
  backdrop-filter: blur(3px);
  transform: rotate(-8deg);
}

.ring {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(14, 110, 204, .24);
  box-shadow: inset 0 0 22px rgba(26, 119, 230, .025);
  will-change: transform;
}

.ring::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  top: 9%;
  left: 23%;
  border-radius: 50%;
  background: #1682ff;
  box-shadow: 0 0 0 6px rgba(22,130,255,.1), 0 0 20px rgba(22,130,255,.55);
}

.ring span {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
  color: #184a69;
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(25, 108, 168, .14);
  border-radius: 13px;
  font-size: 11px;
  font-weight: 750;
  box-shadow: 0 13px 30px rgba(20, 84, 128, .14);
  backdrop-filter: blur(12px);
  white-space: nowrap;
}

.ring span small { display: none; }
.ring svg { width: 17px; color: #0871ed; }
.ring-a { width: 395px; height: 395px; animation: solutionOrbitA 18s linear infinite; }
.ring-a span { transform: translate(186px, -27px); animation: solutionCounterA 18s linear infinite; }
.ring-b { width: 222px; height: 222px; border-color: rgba(28, 200, 116, .42); animation: solutionCoreRing 4.2s ease-in-out infinite; }
.ring-b::before { content: ''; position: absolute; inset: 25px; border-radius: 50%; background: radial-gradient(circle at 36% 28%, #3190ff, #0964ec 55%, #0648b7); box-shadow: 0 24px 55px rgba(8, 95, 224, .28), inset 0 1px 2px rgba(255,255,255,.4); }
.ring-b::after { background: #23d783; box-shadow: 0 0 0 6px rgba(35,215,131,.13), 0 0 18px rgba(35,215,131,.5); }
.ring-b span { z-index: 2; flex-wrap: wrap; justify-content: center; width: 118px; padding: 13px 12px; color: #fff; background: rgba(8, 99, 237, .86); border-color: rgba(255,255,255,.26); font-size: 14px; box-shadow: 0 14px 30px rgba(3, 62, 161, .28); }
.ring-b span small { display: block; flex-basis: 100%; color: rgba(255,255,255,.73); font-size: 8px; font-weight: 550; text-align: center; letter-spacing: .02em; }
.ring-b svg { color: #fff; }
.ring-c { width: 520px; height: 300px; transform: rotate(25deg); animation: solutionOrbitC 24s linear infinite; }
.ring-c span { transform: translate(-240px, 32px) rotate(-25deg); animation: solutionCounterC 24s linear infinite; }

.solution-data-node {
  position: absolute;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  color: #1b4b67;
  background: rgba(255,255,255,.84);
  border: 1px solid rgba(23, 116, 180, .13);
  border-radius: 14px;
  box-shadow: 0 15px 35px rgba(28, 91, 133, .13);
  backdrop-filter: blur(12px);
  animation: solutionFloat 4s ease-in-out infinite;
}

.solution-data-node > svg { width: 20px; color: #1bc77a; }
.solution-data-node span { font-size: 11px; font-weight: 750; }
.solution-data-node small { display: block; margin-top: 2px; color: #7891a2; font-size: 8px; font-weight: 550; }
.node-stock { left: 1%; bottom: 13%; }
.node-report { right: 0; top: 12%; animation-delay: -1.8s; }
.node-report > svg { color: #0871ed; }

.landing-header,
.landing-hero-copy,
.product-preview,
.feature-card,
.landing-benefits > * {
  animation-fill-mode: both;
}

.landing-header { animation: landingFadeDown .7s ease-out both; }
.landing-hero-copy { animation: landingFadeUp .85s .08s cubic-bezier(.2,.75,.25,1) both; }
.product-preview { animation: landingPreviewIn 1s .18s cubic-bezier(.2,.75,.25,1) both; }
.feature-card { animation: landingFadeUp .7s cubic-bezier(.2,.75,.25,1) both; }
.feature-card:nth-child(2) { animation-delay: .08s; }
.feature-card:nth-child(3) { animation-delay: .16s; }
.feature-card:nth-child(4) { animation-delay: .24s; }

.landing-primary-button,
.landing-login-button {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.landing-primary-button::after,
.landing-login-button::after {
  content: '';
  position: absolute;
  z-index: 1;
  top: -80%;
  left: -45%;
  width: 28px;
  height: 250%;
  background: rgba(255,255,255,.34);
  transform: rotate(25deg);
  pointer-events: none;
  animation: landingButtonShine 5.2s ease-in-out infinite;
}

.orbit-one { animation: landingOrbitOne 22s linear infinite; }
.orbit-two { animation: landingOrbitTwo 28s linear infinite reverse; }
.hero-float-sales { animation: solutionFloat 4.6s ease-in-out infinite; }
.hero-float-stock { animation: solutionFloat 4.9s -2.1s ease-in-out infinite; }
.preview-chart-card { animation: landingSoftPulse 5s ease-in-out infinite; }
.chart-bars i { transform-origin: bottom; animation: landingBarGrow .9s cubic-bezier(.2,.75,.25,1) both; }
.chart-bars i:nth-child(2) { animation-delay: .06s; }
.chart-bars i:nth-child(3) { animation-delay: .12s; }
.chart-bars i:nth-child(4) { animation-delay: .18s; }
.chart-bars i:nth-child(5) { animation-delay: .24s; }
.chart-bars i:nth-child(6) { animation-delay: .3s; }
.chart-bars i:nth-child(7) { animation-delay: .36s; }
.mini-report span { transform-origin: bottom; animation: landingBarGrow .8s cubic-bezier(.2,.75,.25,1) both; }
.mini-report span:nth-child(2) { animation-delay: .07s; }
.mini-report span:nth-child(3) { animation-delay: .14s; }
.mini-report span:nth-child(4) { animation-delay: .21s; }
.mini-report span:nth-child(5) { animation-delay: .28s; }
.mini-report span:nth-child(6) { animation-delay: .35s; }
.feature-card:hover .feature-icon { animation: landingIconBounce .55s ease; }

@keyframes solutionCopyIn { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: translateX(0); } }
@keyframes solutionVisualIn { from { opacity: 0; transform: translateX(34px) scale(.96); } to { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes solutionOrbitA { to { transform: rotate(360deg); } }
@keyframes solutionOrbitC { from { transform: rotate(25deg); } to { transform: rotate(385deg); } }
@keyframes solutionCounterA { from { transform: translate(186px, -27px) rotate(0); } to { transform: translate(186px, -27px) rotate(-360deg); } }
@keyframes solutionCounterC { from { transform: translate(-240px, 32px) rotate(-25deg); } to { transform: translate(-240px, 32px) rotate(-385deg); } }
@keyframes solutionCoreRing { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
@keyframes solutionCoreBreath { 0%, 100% { opacity: .72; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.08); } }
@keyframes solutionFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-11px); } }
@keyframes solutionDot { 0%, 100% { box-shadow: 0 0 0 5px rgba(25,200,117,.12); } 50% { box-shadow: 0 0 0 9px rgba(25,200,117,.04); } }
@keyframes solutionHalo { 0%, 100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-25px,30px) scale(1.08); } }
@keyframes landingFadeDown { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes landingFadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes landingPreviewIn { from { opacity: 0; transform: perspective(1000px) rotateY(-9deg) rotateX(5deg) translateY(25px) scale(.96); } to { opacity: 1; transform: perspective(1000px) rotateY(-5deg) rotateX(2deg) translateY(0) scale(1); } }
@keyframes landingOrbitOne { from { transform: rotate(-20deg); } to { transform: rotate(340deg); } }
@keyframes landingOrbitTwo { from { transform: rotate(23deg); } to { transform: rotate(383deg); } }
@keyframes landingButtonShine { 0%, 58% { left: -45%; opacity: 0; } 66% { opacity: 1; } 82%, 100% { left: 125%; opacity: 0; } }
@keyframes landingBarGrow { from { transform: scaleY(.08); opacity: .2; } to { transform: scaleY(1); opacity: 1; } }
@keyframes landingSoftPulse { 0%, 100% { box-shadow: 0 0 0 rgba(30,119,255,0); } 50% { box-shadow: 0 9px 24px rgba(30,119,255,.08); } }
@keyframes landingIconBounce { 0%, 100% { transform: translateY(0) rotate(0); } 45% { transform: translateY(-5px) rotate(-4deg); } 70% { transform: translateY(1px) rotate(2deg); } }

@media (max-width: 960px) {
  .landing-solutions { padding-top: 90px; padding-bottom: 90px; }
  .solution-panel { grid-template-columns: 1fr; gap: 30px; }
  .solution-copy { text-align: center; }
  .solution-copy h2, .solution-copy > p { margin-left: auto; margin-right: auto; }
  .solution-copy h2::after { margin-left: auto; margin-right: auto; }
  .solution-copy ul { justify-content: center; width: auto; }
  .solution-rings { min-height: 490px; }
}

@media (max-width: 640px) {
  .landing-solutions { padding: 76px 18px 54px; }
  .solution-copy h2 { font-size: 39px; }
  .solution-copy > p { font-size: 15px; }
  .solution-copy ul { display: grid; grid-template-columns: 1fr; width: 100%; }
  .solution-copy li { justify-content: center; }
  .solution-rings { min-height: 390px; margin: 0; transform: scale(.72); }
  .node-stock { left: -9%; }
  .node-report { right: -9%; }
}

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


/* Feature cards share one neutral state; the hovered/focused card becomes active. */
#landing-page .feature-card {
  color: #09263e;
  background: #fbfdff;
  border-color: #dfe9f1;
  cursor: default;
  outline: none;
  transition:
    transform var(--motion-fast) var(--motion-ease),
    color var(--motion-fast) ease,
    background-color var(--motion-fast) ease,
    border-color var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease;
}

#landing-page .feature-card h3,
#landing-page .feature-card p,
#landing-page .feature-card .feature-number,
#landing-page .feature-card .feature-icon,
#landing-page .feature-card .mini-order,
#landing-page .feature-card .mini-report,
#landing-page .feature-card .mini-report span {
  transition:
    color var(--motion-fast) ease,
    background-color var(--motion-fast) ease,
    border-color var(--motion-fast) ease,
    transform var(--motion-fast) var(--motion-ease),
    box-shadow var(--motion-fast) ease;
}

#landing-page .feature-card .mini-order {
  color: #21475f;
  background: #edf5ff;
  border-color: #d5e7fb;
}

#landing-page .feature-card .mini-order small { color: #0d9f5f; }

#landing-page .feature-card:hover,
#landing-page .feature-card:focus-visible {
  color: #09263e;
  background: #f1f6ff;
  border-color: #b9d2fa;
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(37, 99, 235, .11);
}

#landing-page .feature-card:focus-visible {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .13), 0 14px 34px rgba(37, 99, 235, .11);
}

#landing-page .feature-card:hover h3,
#landing-page .feature-card:focus-visible h3 { color: #123354; }

#landing-page .feature-card:hover p,
#landing-page .feature-card:focus-visible p { color: #5d728b; }

#landing-page .feature-card:hover .feature-number,
#landing-page .feature-card:focus-visible .feature-number { color: #6f96c9; }

#landing-page .feature-card:hover .feature-icon,
#landing-page .feature-card:focus-visible .feature-icon {
  color: #1768e8;
  background: #deebff;
  transform: scale(1.035);
}

#landing-page .feature-card:hover .mini-order,
#landing-page .feature-card:focus-visible .mini-order {
  color: #21475f;
  background: #e7f1ff;
  border-color: #c9ddfa;
}

#landing-page .feature-card:hover .mini-order small,
#landing-page .feature-card:focus-visible .mini-order small { color: #0d9f5f; }

#landing-page .feature-card:hover .mini-report,
#landing-page .feature-card:focus-visible .mini-report {
  background: linear-gradient(180deg, #edf5ff, #e3eeff);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .06);
}

#landing-page .feature-card:hover .mini-report span,
#landing-page .feature-card:focus-visible .mini-report span {
  background: linear-gradient(180deg, #176cf5, #79afff);
}

@media (hover: none) {
  #landing-page .feature-card:hover {
    color: #09263e;
    background: #fbfdff;
    border-color: #dfe9f1;
    transform: none;
    box-shadow: none;
  }
}

/* Company identity bar and expanded footer. */
#landing-page .landing-topbar {
  position: relative;
  z-index: 30;
  color: #fff;
  background: linear-gradient(90deg, #075ff7, #0878eb);
  box-shadow: 0 5px 18px rgba(7,95,247,.13);
}

#landing-page .landing-topbar-inner {
  width: min(1240px, 100%);
  min-height: 38px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 11px;
  letter-spacing: .015em;
}

#landing-page .landing-topbar-inner > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

#landing-page .landing-topbar-inner svg { width: 14px; height: 14px; opacity: .88; }
#landing-page .landing-topbar-company { flex: 1; min-width: 0; }
#landing-page .landing-topbar-brand { color: rgba(255,255,255,.86); }
#landing-page .landing-topbar-phone {
  padding-left: 26px;
  border-left: 1px solid rgba(255,255,255,.25);
}

#landing-page .landing-footer {
  display: block;
  max-width: 1192px;
  margin: 0 auto;
  padding: 46px 0 28px;
  color: #557185;
  font-size: 12px;
  border-top: 1px solid #dce8f0;
}

#landing-page .landing-footer-main {
  display: grid;
  grid-template-columns: 1.05fr 1.55fr .9fr;
  gap: 56px;
  align-items: start;
  padding-bottom: 34px;
}

#landing-page .landing-footer-brand img { width: 124px; }
#landing-page .landing-footer-brand p {
  margin: 16px 0 0;
  color: #6b8394;
  line-height: 1.65;
}

#landing-page .landing-footer-label {
  display: block;
  margin-bottom: 9px;
  color: #0870e9;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

#landing-page .landing-footer-company > strong,
#landing-page .landing-footer-meta strong {
  display: block;
  color: #173f59;
  font-family: 'Lexend', sans-serif;
  font-size: 13px;
  line-height: 1.45;
}

#landing-page .landing-footer-company p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  color: #385e77;
  font-weight: 700;
}

#landing-page .landing-footer-company p svg { width: 15px; color: #0870e9; }
#landing-page .landing-footer-company p span { color: #a6b8c4; }
#landing-page .landing-footer-meta { display: grid; gap: 21px; }

#landing-page .landing-footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 22px;
  color: #8195a4;
  border-top: 1px solid #e6eef4;
  font-size: 11px;
}

@media (max-width: 960px) {
  #landing-page .landing-topbar-inner { gap: 18px; }
  #landing-page .landing-topbar-brand { display: none; }
  #landing-page .landing-footer { margin: 0 24px; }
  #landing-page .landing-footer-main { grid-template-columns: 1fr 1.5fr; gap: 38px; }
  #landing-page .landing-footer-meta { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  #landing-page .landing-topbar-inner {
    min-height: 42px;
    padding: 7px 18px;
    gap: 12px;
  }

  #landing-page .landing-topbar-company {
    overflow: hidden;
    font-size: 9px;
    text-overflow: ellipsis;
  }

  #landing-page .landing-topbar-company svg { display: none; }
  #landing-page .landing-topbar-phone {
    padding-left: 12px;
    border-left-color: rgba(255,255,255,.32);
    font-size: 10px;
  }

  #landing-page .landing-topbar-phone > strong { font-size: 11px; }
  #landing-page .landing-footer { margin: 0 18px; padding-top: 38px; }
  #landing-page .landing-footer-main { grid-template-columns: 1fr; gap: 30px; }
  #landing-page .landing-footer-meta { grid-column: auto; grid-template-columns: 1fr 1fr; gap: 18px; }
  #landing-page .landing-footer-bottom { flex-direction: column; gap: 7px; }
}

/* Give Vietnamese diacritics enough vertical room in multiline display headings. */
#landing-page .section-heading-row h2 {
  line-height: 1.24;
  letter-spacing: -.035em;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}

#landing-page .landing-benefits h2,
#landing-page .solution-copy h2 {
  line-height: 1.18;
}

@media (max-width: 640px) {
  #landing-page .section-heading-row h2 { line-height: 1.26; }
  #landing-page .landing-benefits h2,
  #landing-page .solution-copy h2 { line-height: 1.2; }
}

:root {
  /* Modern SoVie palette: blue accents on a predominantly white canvas */
  --bg-primary: #f5f8fc;
  --bg-secondary: #ffffff; /* Solid white background for sub-panels */
  --bg-surface: #ffffff; /* Solid white card surface like KiotViet */
  --bg-surface-hover: #f3f7ff;
  --border-color: #dfe7f1;
  --border-focus: rgba(37, 99, 235, 0.22);
  
  --text-primary: #10233f;
  --text-secondary: #41546d;
  --text-muted: #718096;
  
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-light: #eaf2ff;
  --nav-background-color: #ffffff;
  --nav-foreground-color: #334155;
  --nav-control-background: #eff5ff;
  --nav-active-background: #e8f1ff;
  
  --color-secondary: #0ea5a4;
  --color-secondary-hover: #0f8b8a;
  --color-secondary-light: #e7f8f7;
  
  --color-danger: #ef4444; /* Red */
  --color-danger-hover: #dc2626;
  --color-danger-light: rgba(239, 68, 68, 0.1);
  
  --color-warning: #f59e0b; /* Yellow/Amber */
  
  /* Layout shadows and typography */
  --glass-blur: blur(0px);
  --shadow-sm: 0 1px 2px rgba(16, 35, 63, 0.05), 0 4px 14px rgba(37, 99, 235, 0.04);
  --shadow-md: 0 8px 26px rgba(16, 35, 63, 0.08);
  --shadow-lg: 0 20px 55px rgba(16, 35, 63, 0.14);
  
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: var(--font-sans);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  background-image:
    radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.055) 0px, transparent 48%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* Layout */
.app-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
  position: relative;
}

/* Top Navbar (originally .sidebar) */
.sidebar {
  width: 100%;
  height: 60px;
  background-color: var(--nav-background-color); /* User-selectable navigation color */
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  border-right: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}



.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0;
  margin-bottom: 0;
  flex-shrink: 0;
}

.brand-project-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-project-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: row;
  gap: 0.35rem;
  align-items: center;
  flex: 1;
  margin: 0 2rem;
  overflow-x: auto;
  scrollbar-width: none; /* Hide scrollbar Firefox */
}
.nav-menu::-webkit-scrollbar {
  display: none; /* Hide scrollbar Chrome/Safari */
}

.nav-item {
  width: auto;
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  color: rgba(255, 255, 255, 0.9) !important;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
}

.nav-link.active {
  background-color: rgba(0, 0, 0, 0.15) !important;
  color: #ffffff !important;
  font-weight: 600;
}

.nav-link.active svg {
  stroke: #ffffff !important;
}

.purchase-menu-trigger {
  appearance: none;
  -webkit-appearance: none;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #ffffff !important;
  font-family: inherit;
  line-height: 1.2;
}

.purchase-menu-trigger:hover,
.purchase-menu-trigger:focus {
  background-color: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  outline: none;
}

.purchase-menu-trigger.active {
  background-color: rgba(0, 0, 0, 0.15) !important;
  color: #ffffff !important;
}

.purchase-menu-trigger svg {
  stroke: #ffffff !important;
}

.purchase-menu-chevron {
  width: 14px !important;
  height: 14px !important;
  transition: transform 0.2s ease;
}

.purchase-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  min-width: 500px;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 0.75rem 0;
  z-index: 1200;
}

.purchase-nav-item:hover .purchase-menu,
.purchase-nav-item:focus-within .purchase-menu {
  display: grid;
}

.purchase-nav-item:hover .purchase-menu-chevron,
.purchase-nav-item:focus-within .purchase-menu-chevron {
  transform: rotate(180deg);
}

.purchase-menu-section {
  padding: 0 1rem;
  min-width: 0;
}

.purchase-menu-section + .purchase-menu-section {
  border-left: 1px solid var(--border-color);
}

.purchase-menu-heading {
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.purchase-menu-link {
  color: var(--text-primary) !important;
  background: transparent !important;
  padding: 0.55rem 0 !important;
  border-radius: 0 !important;
  font-size: 0.9rem;
}

.purchase-menu-link:hover,
.purchase-menu-link.active {
  color: var(--color-primary) !important;
  background: transparent !important;
}

.staff-menu-trigger {
  appearance: none;
  -webkit-appearance: none;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #ffffff !important;
  font-family: inherit;
  line-height: 1.2;
}

.staff-menu-trigger:hover,
.staff-menu-trigger:focus {
  background-color: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  outline: none;
}

.staff-menu-trigger.active {
  background-color: rgba(0, 0, 0, 0.15) !important;
}

.staff-menu-trigger svg {
  stroke: #ffffff !important;
}

.staff-menu-chevron {
  width: 14px !important;
  height: 14px !important;
  transition: transform 0.2s ease;
}

.staff-menu {
  display: none;
  position: fixed;
  top: 56px;
  left: 8px;
  min-width: 230px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 0.45rem;
  z-index: 1200;
}

.staff-nav-item:hover .staff-menu,
.staff-nav-item:focus-within .staff-menu {
  display: grid;
}

.staff-nav-item:hover .staff-menu-chevron,
.staff-nav-item:focus-within .staff-menu-chevron {
  transform: rotate(180deg);
}

.staff-menu .staff-menu-link {
  display: flex !important;
  align-items: center;
  gap: 0.55rem;
  color: var(--text-primary) !important;
  background: transparent !important;
  padding: 0.65rem 0.75rem !important;
  border-radius: 6px !important;
  font-size: 0.9rem;
  white-space: nowrap;
}

.staff-menu .staff-menu-link svg {
  width: 16px;
  height: 16px;
  stroke: var(--color-primary) !important;
}

.staff-menu .staff-menu-link:hover,
.staff-menu .staff-menu-link.active {
  color: var(--color-primary) !important;
  background: var(--bg-surface-hover) !important;
}

/* Sidebar Actions in Navbar */
.sidebar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  position: relative;
  z-index: 1005;
  overflow: visible;
}

.sidebar-footer {
  display: none !important; /* Hide footer in horizontal header */
}

/* Main Content Area */
.main-content {
  flex: 1;
  margin-left: 0;
  margin-top: 60px; /* Offset for top navbar */
  padding: 0.75rem 1.5rem 1.5rem 1.5rem;
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
}

/* Header */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.page-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #fff;
}

/* Widgets Grid */
.widgets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.widget-card {
  background-color: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.widget-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-md);
}

.widget-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.widget-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.widget-value {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.widget-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.widget-icon-emerald {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}

.widget-icon-indigo {
  background-color: var(--color-secondary-light);
  color: var(--color-secondary);
}

.widget-icon-danger {
  background-color: var(--color-danger-light);
  color: var(--color-danger);
}

/* Panels */
.panel {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.panel.active {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  min-width: 0;
}

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

/* Cards & Glassmorphism Panels */
.glass-panel {
  background-color: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.panel-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Action Controls (search, filter, add) */
.controls-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.search-wrapper {
  position: relative;
  flex: 1;
  min-width: 250px;
}

.search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 18px;
  height: 18px;
}

.form-control-search {
  width: 100%;
  padding: 0.625rem 1rem 0.625rem 2.5rem;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.form-control-search:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--border-focus);
  background-color: #ffffff;
}

/* Inputs & Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  max-width: 100%;
  padding: 0.625rem 0.875rem;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--border-focus);
}

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

.form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

/* Custom Select Dropdowns */
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.25rem;
  padding-right: 2.25rem;
  width: 100%;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

select option {
  background-color: #111827;
  color: #f3f4f6;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background-color: var(--color-danger);
  color: #fff;
}

.btn-danger:hover {
  background-color: var(--color-danger-hover);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-indigo {
  background-color: var(--color-secondary);
  color: #fff;
}

.btn-indigo:hover {
  background-color: var(--color-secondary-hover);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn-teal {
  background-color: #0d9488;
  color: #fff;
}

.btn-teal:hover {
  background-color: #0f766e;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 6px;
}

.btn-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background-color: #ffffff;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.table th {
  background-color: #f8fafc;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  font-family: var(--font-heading);
}

.table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}

.table tr:last-child td {
  border-bottom: none;
}

.table tbody tr {
  transition: background-color 0.2s ease;
}

.table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.customers-table col[data-customer-column="address"] {
  width: 280px !important;
}

.customers-table col[data-customer-column="notes"] {
  width: 220px !important;
}

.customers-table .customer-notes-cell {
  font-size: 0.8rem;
  line-height: 1.35;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.customers-table col[data-customer-column="debt"] {
  width: 115px !important;
}

.customers-table col[data-customer-column="grossSales"] {
  width: 120px !important;
}

.customers-table col[data-customer-column="netSales"] {
  width: 140px !important;
}

.customers-table .customer-money-cell {
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  font-weight: 700 !important;
  font-variant-numeric: tabular-nums;
}

/* Danh sách khách hàng cuộn trong một vùng riêng để hàng tên cột luôn hiện. */
.customers-table-scroll {
  position: relative;
  max-height: clamp(320px, 65dvh, 720px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.customers-table-scroll .customers-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background-color: #f8fafc !important;
  box-shadow: inset 0 -1px 0 var(--border-color);
}

/* Color Indicator Badges */
.color-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(255, 255, 255, 0.05);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
  border: 1px solid var(--border-color);
}

.color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: inline-block;
}

/* Packaging Badges */
.package-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}

.package-thung {
  background-color: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.package-lon {
  background-color: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.package-hop {
  background-color: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

/* Price columns stylings */
.price-market {
  color: var(--text-secondary);
}

.price-discounted {
  color: var(--color-primary);
  font-weight: 600;
}

/* Actions Menu */
.actions-cell {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
}

.actions-cell button {
  flex-shrink: 0;
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeInModal 0.25s ease forwards;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background-color: #111827;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  width: 100%;
  max-width: 550px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: slideUpModal 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

@keyframes slideUpModal {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.02);
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background-color: rgba(255, 255, 255, 0.01);
}

/* Order Entry Specifics */
.invoice-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.summary-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 992px) {
  .summary-card-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}




.invoice-builder {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  z-index: 20;
}

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

.invoice-items-table th {
  padding: 0.75rem 0.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.invoice-items-table td {
  padding: 0.625rem 0.5rem;
  border-bottom: 1px solid var(--border-color);
  overflow: hidden;
}

.invoice-items-table .form-control {
  box-sizing: border-box;
}

.product-select-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 100;
}

.product-dropdown-container {
  flex: 1;
  position: relative;
  z-index: 100;
}

.custom-input-group {
  display: flex;
  align-items: center;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding-right: 0.5rem;
}

.custom-input-group:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--border-focus);
}

.custom-input-group .form-control {
  border: none;
  background: transparent;
  flex: 1;
  padding-right: 0.25rem;
}

.custom-input-group .form-control:focus {
  box-shadow: none;
}

.input-suffix {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  user-select: none;
}

/* Billing Summary Card */
.summary-card {
  position: sticky;
  top: 2rem;
  z-index: 5;
}

.summary-heading {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.875rem;
  font-size: 0.9rem;
}

.summary-row.total-row {
  border-top: 1px dashed var(--border-color);
  padding-top: 1rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.summary-row .label {
  color: var(--text-secondary);
}

.summary-row .value {
  font-weight: 500;
  color: #fff;
}

.summary-row.total-row .label {
  font-weight: 700;
  color: #fff;
  font-size: 1rem;
}

.summary-row.total-row .value-market {
  color: var(--text-secondary);
  text-decoration: line-through;
  font-size: 0.95rem;
  margin-right: 0.5rem;
}

.summary-row.total-row .value-final {
  color: var(--color-primary);
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
}

.saving-badge {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
  align-self: flex-start;
}

/* History View Mode Toggle */
.history-view-toggle-group {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.history-view-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  height: 30px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.history-view-mode-btn:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.05);
}

.history-view-mode-btn.active {
  background: var(--color-primary);
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.history-view-mode-btn.active svg {
  stroke: #ffffff;
}

/* History Grid / Container */
.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.history-grid.details-mode {
  display: block !important;
  width: 100%;
}

/* History Details Table */
.history-details-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.history-details-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(0, 0, 0, 0.03);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.75rem 0.85rem;
  border-bottom: 2px solid var(--border-color);
}

.history-details-table td {
  padding: 0.85rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
  vertical-align: middle;
}

.history-order-note-cell {
  max-width: 220px;
  color: var(--text-secondary);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-column-picker-popover {
  right: 0;
  left: auto;
}

.history-details-table tr:hover td {
  background-color: var(--bg-surface-hover);
}

.history-details-table .history-order-row {
  cursor: pointer;
  outline: none;
}

.history-details-table .history-order-row:focus-visible td {
  box-shadow: inset 0 2px 0 var(--color-primary), inset 0 -2px 0 var(--color-primary);
}

.history-details-table .history-order-row.is-expanded td {
  background: rgba(59, 130, 246, 0.055);
  border-bottom-color: transparent;
}

.history-row-toggle-cell {
  width: 72px;
}

.history-row-toggle {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-primary);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.history-row-toggle:hover {
  background: var(--color-primary-light);
}

.history-row-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform 0.22s ease;
}

.history-order-row.is-expanded .history-row-toggle svg {
  transform: rotate(180deg);
}

.history-details-table .history-expanded-row > td,
.history-details-table .history-expanded-row:hover > td {
  padding: 0;
  border-bottom: 0;
  background: transparent;
}

.history-expanded-motion {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.22s ease, opacity 0.2s ease;
}

.history-expanded-motion-inner {
  min-height: 0;
  overflow: hidden;
}

.history-expanded-row.is-expanded .history-expanded-motion {
  grid-template-rows: 1fr;
  opacity: 1;
}

.history-expanded-panel {
  display: grid;
  grid-template-columns: minmax(360px, 1.7fr) minmax(230px, 0.8fr) minmax(280px, 1fr);
  gap: 1.25rem;
  align-items: stretch;
  margin: 0 0.75rem 0.85rem;
  padding: 1rem;
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.055), rgba(16, 185, 129, 0.035));
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.history-expanded-products {
  grid-column: 1 / -1;
  min-width: 0;
}

.history-expanded-products-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.55rem;
}

.history-expanded-products-heading strong {
  color: var(--text-primary);
  font-size: 0.88rem;
}

.history-expanded-products-heading span {
  color: var(--text-muted);
  font-size: 0.76rem;
  white-space: nowrap;
}

.history-expanded-products-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-surface);
}

.history-expanded-products-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.history-expanded-products-table th,
.history-expanded-products-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.78rem;
  vertical-align: middle;
}

.history-expanded-products-table th {
  background: rgba(15, 23, 42, 0.04);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.history-expanded-products-table th:nth-child(n + 4) {
  text-align: right;
}

.history-expanded-products-table th:nth-child(3) {
  text-align: center;
}

.history-expanded-products-table tbody tr:last-child td {
  border-bottom: 0;
}

.history-expanded-products-table tbody tr:hover td {
  background: var(--bg-surface-hover);
}

.history-product-code {
  color: var(--color-primary);
  font-weight: 700;
  white-space: nowrap;
}

.history-product-name {
  color: var(--text-primary);
  font-weight: 600;
}

.history-product-color {
  color: var(--text-primary);
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.history-product-package {
  margin-top: 0.15rem;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.history-product-number {
  text-align: right;
  white-space: nowrap;
}

.history-product-total {
  color: var(--text-primary);
  font-weight: 800;
}

.history-expanded-products-empty {
  padding: 0.8rem;
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
}

.history-expanded-notes {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.45rem;
}

.history-expanded-notes label {
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
}

.history-order-notes-input {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  line-height: 1.45;
}

.history-order-notes-input[readonly] {
  cursor: default;
  opacity: 0.78;
}

.history-expanded-payment {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0.75rem 0;
}

.history-expanded-payment > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: baseline;
}

.history-expanded-payment dt {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.history-expanded-payment dd {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.history-expanded-payment .history-expanded-payable {
  margin-top: 0.15rem;
  padding-top: 0.55rem;
  border-top: 1px dashed var(--border-color);
}

.history-expanded-payment .history-expanded-payable dt,
.history-expanded-payment .history-expanded-payable dd {
  color: var(--color-primary);
  font-size: 0.95rem;
  font-weight: 800;
}

.history-expanded-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  gap: 0.5rem;
  align-content: center;
}

.history-detail-action {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.15;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.history-detail-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
  filter: brightness(1.03);
}

.history-detail-action:disabled {
  cursor: wait;
  opacity: 0.6;
  transform: none;
}

.history-detail-action svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

@media (max-width: 1100px) {
  .history-expanded-panel {
    width: min(calc(100vw - 4rem), 100%);
    position: sticky;
    left: 0.75rem;
    grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.9fr);
  }

  .history-expanded-notes {
    grid-column: 1 / -1;
  }
}


@media (max-width: 700px) {
  .history-expanded-panel {
    width: min(calc(100vw - 2.5rem), 100%);
    left: 0.5rem;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.85rem;
    margin: 0 0.5rem 0.65rem;
    padding: 0.8rem;
  }

  .history-expanded-notes {
    grid-column: auto;
  }

  .history-expanded-payment {
    padding: 0.25rem 0;
  }

  .history-expanded-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.history-details-items-preview {
  max-height: 90px;
  overflow-y: auto;
  font-size: 0.78rem;
  background: rgba(0, 0, 0, 0.02);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  line-height: 1.35;
}

.history-details-items-preview::-webkit-scrollbar {
  width: 4px;
}

.history-money-cell {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.88rem;
  white-space: nowrap;
}

.history-money-discount {
  color: #f59e0b;
}

.history-money-other-fee {
  color: #2563eb;
}

.history-money-total {
  color: var(--color-primary);
  font-size: 0.95rem;
}

.history-summary-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  margin: -0.25rem 0 1rem;
  border: 1px solid rgba(34, 197, 94, 0.24);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.1), rgba(20, 184, 166, 0.06));
}

.history-summary-item {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  padding-right: 1rem;
  border-right: 1px solid rgba(34, 197, 94, 0.2);
}

.history-summary-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
}

.history-summary-item strong {
  color: #16a34a;
  font-size: 1.1rem;
  font-weight: 800;
  white-space: nowrap;
}

.history-summary-item .history-summary-discount {
  color: #d97706;
}

.history-summary-item .history-summary-other-fee {
  color: #2563eb;
}

.history-summary-item .history-summary-after {
  color: #15803d;
}

.history-summary-meta {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.history-card-financials {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.02);
}

.history-card-financials > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.history-card-financials strong {
  color: var(--text-primary);
  font-size: 0.88rem;
  white-space: nowrap;
}

.history-creator-filter-wrap {
  position: relative;
  width: 220px;
  min-width: 180px;
}

.history-creator-filter-wrap .form-control {
  width: 100%;
  height: 42px;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
}

.history-creator-filter-wrap .suggestions-list {
  width: 100%;
}

.suggestion-brand-badge {
  flex-shrink: 0;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.history-table-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(48px, 1fr));
  gap: 6px;
  justify-content: center;
  align-items: center;
  max-width: 118px;
  margin: 0 auto;
}

.history-action-btn {
  height: 28px;
  min-width: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 7px;
  border: 1px solid transparent;
  padding: 0 8px;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.history-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
  filter: brightness(1.02);
}

.history-action-btn i {
  width: 13px;
  height: 13px;
  stroke-width: 2.5;
}

.history-action-print {
  background: #14b8a6;
  color: #fff;
}

.history-action-view {
  background: #0ea5a4;
  color: #fff;
}

.history-action-edit {
  background: var(--color-primary);
  color: #fff;
}

.history-action-copy {
  background: #6366f1;
  color: #fff;
}

.history-action-return {
  background: #f59e0b;
  color: #fff;
}

.history-action-delete {
  min-width: 28px;
  padding: 0;
  background: #fee2e2;
  color: #dc2626;
  border-color: #fecaca;
}

.invoice-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.25rem;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  cursor: pointer;
}

.invoice-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  background-color: var(--bg-surface-hover);
}

.invoice-card.status-draft {
  border-color: var(--color-danger) !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.15) !important;
}

.invoice-card.status-settled {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.15) !important;
}

.invoice-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.invoice-card-id {
  font-family: var(--font-heading);
  font-weight: 600;
  color: #fff;
}

.invoice-card-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.invoice-card-details {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.invoice-card-totals {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
  margin-top: 0.25rem;
}

.invoice-card-total-lbl {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.invoice-card-total-val {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-primary);
  font-size: 1.1rem;
}

/* Printable invoice template (Hidden on screen) */
#print-invoice-template {
  display: none;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background-color: #1f2937;
  border-left: 4px solid var(--color-primary);
  color: #fff;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideInToast 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  min-width: 280px;
}

.toast-danger {
  border-left-color: var(--color-danger);
}

.toast-warning {
  border-left-color: var(--color-warning);
}

@keyframes slideInToast {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast-fade-out {
  animation: fadeOutToast 0.3s ease forwards;
}

@keyframes fadeOutToast {
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* Empty States */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-secondary);
  background-color: rgba(255, 255, 255, 0.01);
  border: 1px dashed var(--border-color);
  border-radius: 12px;
  gap: 1rem;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
}

.empty-state-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
}

.empty-state-desc {
  font-size: 0.85rem;
  max-width: 320px;
}

/* Search Dropdown / Autocomplete */
.suggestions-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-top: 0.25rem;
  max-height: 280px;
  overflow-y: auto;
  z-index: 1050;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  list-style: none;
}

.suggestion-item {
  padding: 0.625rem 0.875rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.15s ease;
}

.suggestion-item:hover {
  background-color: var(--bg-primary);
  color: var(--color-primary);
}

.suggestion-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.suggestion-code {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.8rem;
}

.suggestion-name {
  color: var(--text-secondary);
}

.suggestion-price {
  font-size: 0.8rem;
  font-weight: 500;
}

/* ========================================
   HAMBURGER BUTTON & SIDEBAR OVERLAY
   ======================================== */


.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* Dashboard Filter Toolbar */
.dashboard-toolbar {
  position: relative;
  z-index: 100;
  overflow: visible;
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding: 1rem 1.5rem;
  border-radius: 16px;
}
.dashboard-toolbar .filter-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.dashboard-toolbar .filter-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0;
}

/* Charts and Top Products Section */
.dashboard-charts-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.chart-panel {
  padding: 1.5rem;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 320px;
}

.top-products-panel {
  padding: 1.5rem;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
}

.top-products-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
}

.top-product-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.85rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.top-product-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.top-product-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.top-product-name {
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 68%;
}

.top-product-sales {
  font-weight: 700;
  color: var(--color-primary);
}

.top-product-progress-bg {
  background: rgba(255, 255, 255, 0.05);
  height: 6px;
  border-radius: 3px;
  width: 100%;
  overflow: hidden;
}

.top-product-progress-bar {
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease-out;
}

.top-product-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.775rem;
  color: var(--text-secondary);
  margin-top: -0.1rem;
}

@media (max-width: 1024px) {
  .dashboard-charts-row {
    grid-template-columns: 1fr;
  }
}

/* Dashboard Grid (replaces inline style) */
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr);
  gap: 1.5rem;
  margin-top: 0.5rem;
}

/* Dashboard insight cards: ưu tiên trực quan, chỉ giữ bảng cho dữ liệu chi tiết. */
.dashboard-insights-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.dashboard-insight-card {
  min-width: 0;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-insight-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.09);
}

.dashboard-insight-company { grid-column: span 4; }
.dashboard-insight-brand { grid-column: span 8; }
.dashboard-insight-salesperson,
.dashboard-insight-customer { grid-column: span 6; }
.dashboard-insight-festival {
  grid-column: 1 / -1;
  order: 3;
  border-color: rgba(245, 158, 11, 0.28);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.06), rgba(255, 255, 255, 0.96));
}
.dashboard-insight-salesperson,
.dashboard-insight-customer { order: 2; }

.dashboard-insight-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.dashboard-insight-header > div { min-width: 0; }
.dashboard-insight-header .panel-title { font-size: 0.98rem; }
.dashboard-insight-header p {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.dashboard-insight-badge,
.dashboard-festival-total {
  flex: 0 0 auto;
  padding: 0.35rem 0.6rem;
  border: 1px solid rgba(16, 185, 129, 0.16);
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.08);
  color: #047857;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.dashboard-festival-title { color: #d97706; }
.dashboard-festival-total {
  border-color: rgba(245, 158, 11, 0.22);
  background: rgba(245, 158, 11, 0.1);
  color: #b45309;
}

.dashboard-breakdown-chart {
  position: relative;
  height: 290px;
  min-height: 250px;
}

.dashboard-breakdown-chart-tall { height: 310px; }
.dashboard-breakdown-chart-donut { height: 300px; }
.dashboard-breakdown-chart canvas { display: none; }

.dashboard-chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  border: 1px dashed rgba(148, 163, 184, 0.45);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.72);
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
}

.dashboard-festival-table {
  max-height: 210px;
  overflow: auto;
}

.dashboard-festival-table .table th,
.dashboard-festival-table .table td { padding: 0.7rem 0.85rem; }

@media (max-width: 1100px) {
  .dashboard-insight-company,
  .dashboard-insight-brand,
  .dashboard-insight-salesperson,
  .dashboard-insight-customer { grid-column: span 6; }
}

@media (max-width: 720px) {
  .dashboard-insights-grid { grid-template-columns: 1fr; }
  .dashboard-insight-company,
  .dashboard-insight-brand,
  .dashboard-insight-salesperson,
  .dashboard-insight-customer,
  .dashboard-insight-festival { grid-column: 1; }
  .dashboard-insight-header { align-items: center; }
  .dashboard-insight-header p { display: none; }
  .dashboard-breakdown-chart,
  .dashboard-breakdown-chart-tall,
  .dashboard-breakdown-chart-donut { height: 280px; }
}

/* Activity Log */
.activity-header-wrap { position: relative; }
.activity-header-button { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.32); border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; cursor: pointer; transition: .18s ease; }
.activity-header-button:hover,.activity-header-button:focus-visible { color: #fff; border-color: rgba(255,255,255,.75); background: rgba(255,255,255,.25); transform: translateY(-1px); outline: none; }
.activity-header-button svg { width: 18px; height: 18px; stroke: currentColor; }
.activity-dropdown { display: none; position: absolute; right: 0; top: 45px; z-index: 1200; width: min(410px, calc(100vw - 32px)); max-height: 620px; overflow: hidden; background: #fff; border: 1px solid var(--border-color); border-radius: 14px; box-shadow: 0 20px 50px rgba(15,23,42,.2); }
.activity-dropdown.active { display: block; animation: fadeIn .18s ease; }
.activity-dropdown-head { display: flex; justify-content: space-between; align-items: baseline; padding: 1rem; border-bottom: 1px solid var(--border-color); }
.activity-dropdown-head span { color: var(--text-muted); font-size: .72rem; }
.activity-dropdown-list { max-height: 480px; overflow-y: auto; }
.activity-dropdown-item { box-sizing: border-box; width: 100%; display: flex; gap: .75rem; padding: .8rem 1rem; margin: 0; border: 0; border-bottom: 1px solid rgba(148,163,184,.16); background: #fff; text-align: left; cursor: pointer; color: var(--text-primary); }
.activity-dropdown-item:hover { background: rgba(16,185,129,.06); }
.activity-dropdown-item:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px; background: rgba(16,185,129,.06); }
.activity-dropdown-item > span:last-child { min-width: 0; display: flex; flex-direction: column; gap: .18rem; }
.activity-dropdown-item small { color: var(--text-muted); }
.activity-dropdown-action { color: var(--text-primary); }
.activity-dropdown-info { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .4rem; margin-top: .18rem; }
.activity-dropdown-info small { margin-left: auto; white-space: nowrap; }
.activity-dropdown-meta { display: flex; align-items: center; min-width: 0; margin-top: .25rem; }
.activity-dropdown-meta .activity-target-link { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-view-all { width: 100%; display: flex; align-items: center; justify-content: center; gap: .4rem; border: 0; border-top: 1px solid var(--border-color); padding: .85rem; color: var(--color-primary); background: #fff; font-weight: 700; cursor: pointer; }
.activity-view-all svg { width: 15px; }
.activity-avatar { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#10b981,#0ea5e9); color: #fff; font-weight: 800; }
.activity-page-card { padding: 1.25rem; }
.activity-page-subtitle { margin: .25rem 0 0; color: var(--text-muted); font-size: .84rem; }
.activity-filters { display: grid; grid-template-columns: minmax(240px,2fr) repeat(5,minmax(140px,1fr)); gap: .65rem; margin: 1rem 0; }
.activity-table td { vertical-align: middle; }
.activity-actor { display: flex; align-items: center; gap: .65rem; }
.activity-actor div { display: flex; flex-direction: column; }
.activity-actor small { color: var(--text-muted); }
.activity-summary { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; }
.activity-target-link { border: 0; padding: 0; background: none; color: var(--color-primary); font: inherit; font-weight: 800; cursor: pointer; }
.activity-target-link:hover { text-decoration: underline; }
.activity-change-count,.activity-module-badge { display: inline-flex; border-radius: 999px; padding: .22rem .5rem; background: rgba(16,185,129,.1); color: #047857; font-size: .7rem; font-weight: 700; }
.activity-pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1rem; }
.activity-empty { padding: 2rem !important; text-align: center; color: var(--text-muted); }
.modal-content.activity-detail-modal { display: flex; flex-direction: column; width: min(95%, 820px); max-width: 820px; max-height: calc(100vh - 3rem); overflow: hidden; }
.modal-content.activity-detail-modal .modal-header { flex: 0 0 auto; background: #fff; position: sticky; top: 0; z-index: 2; }
.modal-content.activity-detail-modal .modal-title { color: var(--text-primary); }
.modal-content.activity-detail-modal .modal-close { color: var(--text-secondary); }
.modal-content.activity-detail-modal .modal-close:hover { color: var(--text-primary); background: var(--bg-surface-hover); }
.modal-content.activity-detail-modal .modal-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.activity-detail-meta { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .75rem; margin-bottom: 1.2rem; }
.activity-detail-meta > div { padding: .75rem; border: 1px solid var(--border-color); border-radius: 10px; display: flex; flex-direction: column; gap: .25rem; }
.activity-detail-meta span,.activity-diff-values span { color: var(--text-muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.activity-diff-list { display: grid; gap: .75rem; }
.activity-diff { border: 1px solid var(--border-color); border-radius: 12px; padding: .85rem; }
.activity-diff-values { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .7rem; margin-top: .6rem; }
.activity-diff-values pre { margin: .25rem 0 0; padding: .65rem; border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; background: #f8fafc; font: inherit; font-size: .82rem; }
.activity-diff-values > div:first-child pre { background: #fff1f2; color: #be123c; }
.activity-diff-values > div:last-child pre { background: #ecfdf5; color: #047857; }
.activity-items-summary { display: flex; align-items: center; gap: .55rem; margin: .65rem 0; color: var(--text-muted); font-size: .8rem; }
.activity-items-summary svg { width: 16px; color: var(--color-primary); }
.activity-items-diff ul { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .5rem; }
.activity-item-change { display: flex; flex-direction: column; gap: .18rem; padding: .65rem .75rem; border-radius: 9px; border-left: 4px solid #0ea5e9; background: #f8fafc; }
.activity-item-change span { color: var(--text-muted); font-size: .82rem; }
.activity-item-change.added { border-left-color: #10b981; background: #ecfdf5; }
.activity-item-change.removed { border-left-color: #f43f5e; background: #fff1f2; }
.activity-timeline { border-left: 2px solid rgba(16,185,129,.25); margin-left: .5rem; display: grid; gap: .3rem; }
.activity-timeline-item { position: relative; width: 100%; border: 0; background: none; padding: .65rem 1rem; text-align: left; cursor: pointer; display: grid; grid-template-columns: 150px 1fr; gap: .75rem; }
.activity-timeline-item::before { content: ''; position: absolute; left: -6px; top: 1rem; width: 10px; height: 10px; border-radius: 50%; background: #10b981; }
.activity-timeline-item:hover { background: rgba(16,185,129,.06); }
.activity-timeline-item time { color: var(--text-muted); font-size: .78rem; }
@media (max-width: 1100px) { .activity-filters { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 640px) { .activity-filters,.activity-detail-meta { grid-template-columns: 1fr; } .activity-diff-values { grid-template-columns: 1fr; } .activity-diff-values svg { transform: rotate(90deg); } .activity-timeline-item { grid-template-columns: 1fr; gap: .15rem; } .modal-content.activity-detail-modal { width: 100%; max-height: 100vh; height: 100vh; border-radius: 0; } }

/* ========================================
   RESPONSIVE: LARGE TABLETS (≤ 1200px)
   ======================================== */
@media (max-width: 1200px) {
  .widgets-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========================================
   RESPONSIVE: TABLETS (≤ 1024px)
   ======================================== */
@media (max-width: 1024px) {
  .summary-card {
    position: static;
  }

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

  .widgets-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .history-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }

  .history-summary-bar {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .history-summary-meta {
    grid-column: 1 / -1;
    text-align: right;
  }

  .main-content {
    padding: 0.75rem 1.25rem 1.25rem 1.25rem;
  }

  .page-title {
    font-size: 1.5rem;
  }
}

/* ========================================
   RESPONSIVE: MOBILE (≤ 768px)
   ======================================== */
@media (max-width: 768px) {

  /* Sidebar/Header mobile structure */
  .sidebar {
    height: 95px !important;
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-rows: 36px 36px !important;
    align-items: center !important;
    padding: 0.5rem 0.75rem !important;
    gap: 0.35rem 0.5rem !important;
  }

  .brand {
    grid-column: 1 !important;
    grid-row: 1 !important;
    justify-self: start !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    gap: 0.35rem !important;
  }

  .sidebar-actions {
    grid-column: 2 !important;
    grid-row: 1 !important;
    justify-self: end !important;
    display: flex !important;
    align-items: center !important;
    position: relative !important;
    z-index: 1005 !important;
    overflow: visible !important;
  }

  .nav-menu {
    grid-column: 1 / span 2 !important;
    grid-row: 2 !important;
    width: 100% !important;
    margin: 0 !important;
    gap: 0.2rem !important;
    padding: 0 !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
  }

  .nav-item {
    flex-shrink: 0 !important;
    margin-bottom: 0 !important;
  }

  .nav-link {
    padding: 0.35rem 0.55rem !important;
    font-size: 0.8rem !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    white-space: nowrap !important;
  }

  /* Main content full width */
  .main-content {
    margin-left: 0 !important;
    margin-top: 95px !important; /* Matches sidebar height exactly */
    padding: 0.75rem !important;
    gap: 0.75rem !important;
  }

  /* Header adjustments for spacing on mobile */
  .top-header {
    border-bottom: 1px solid var(--border-color) !important;
    padding-bottom: 0.5rem !important;
    align-items: flex-start !important;
    gap: 0.5rem;
  }

  .page-title {
    font-size: 1.15rem !important;
  }

  /* Dashboard */
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .widgets-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .widget-card {
    padding: 1rem;
    border-radius: 10px;
  }

  .widget-value {
    font-size: 1.15rem;
  }

  .widget-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }

  /* Glass panels */
  .glass-panel {
    padding: 1rem;
    border-radius: 10px;
  }

  /* Panel header wrap */
  .panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .panel-title {
    font-size: 1rem;
  }

  /* Controls - stack search and filters vertically */
  .controls-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .controls-row > div,
  .controls-row .filter-wrapper {
    width: 100% !important;
    min-width: 100% !important;
  }

  .search-wrapper {
    min-width: 100%;
  }

  /* Invoice table cells smaller */
  .invoice-items-table th {
    padding: 0.5rem 0.375rem;
    font-size: 0.7rem;
  }

  .invoice-items-table td {
    padding: 0.625rem 0.375rem;
    font-size: 0.825rem;
  }

  /* Product select row */
  .product-select-row {
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }

  .product-select-row .btn {
    width: 100%;
  }

  /* Summary card */
  .summary-card {
    position: static;
  }

  .summary-heading {
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  /* History grid */
  .history-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .history-summary-bar {
    grid-template-columns: 1fr;
  }

  .history-summary-item {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    padding: 0 0 0.45rem;
    border-right: 0;
    border-bottom: 1px solid rgba(34, 197, 94, 0.16);
  }

  .history-summary-meta {
    grid-column: auto;
    text-align: left;
  }

  /* Form rows - force 1 column and override inline grid styles */
  .form-row-2, .form-row-3 {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }

  /* Tables: scroll responsive with styled scrollbar */
  .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-responsive::-webkit-scrollbar {
    height: 6px;
  }
  .table-responsive::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
  }
  .table-responsive::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 4px;
  }

  .table th, .table td {
    padding: 0.625rem 0.5rem;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  /* Allow name columns to wrap but maintain minimum width */
  .table td.col-name, 
  .table td:nth-child(2), 
  .table td:nth-child(3) {
    white-space: normal;
    min-width: 180px;
    max-width: 300px;
    line-height: 1.4;
  }

  /* Toasts */
  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }

  .toast {
    min-width: auto;
    width: 100%;
  }

  /* Modals - Bottom sheet behavior */
  .modal-overlay {
    padding: 1rem 0.5rem;
    align-items: flex-end;
  }

  .modal-content {
    border-radius: 16px 16px 0 0;
    max-height: 85vh;
    overflow-y: auto;
    width: 100%;
  }

  .modal-footer {
    flex-direction: column-reverse;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
  }

  .modal-footer .btn {
    width: 100%;
    margin: 0 !important;
  }
}



/* ========================================
   RESPONSIVE: SMALL MOBILE (≤ 480px)
   ======================================== */
@media (max-width: 480px) {
  .main-content {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .page-title {
    font-size: 1.05rem;
  }

  .db-status-badge {
    font-size: 0.6rem;
    padding: 0.1rem 0.3rem;
  }

  /* Widgets single column */
  .widgets-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .widget-card {
    padding: 0.875rem;
  }

  .widget-value {
    font-size: 1.15rem;
  }

  /* Glass panels tighter */
  .glass-panel {
    padding: 0.75rem;
    border-radius: 8px;
  }

  .panel-title {
    font-size: 0.95rem;
  }

  /* Invoice items even tighter */
  .invoice-items-table th {
    padding: 0.375rem 0.25rem;
    font-size: 0.65rem;
  }

  .invoice-items-table td {
    padding: 0.5rem 0.25rem;
    font-size: 0.775rem;
  }

  /* Summary final total */
  .summary-row.total-row .value-final {
    font-size: 1.1rem;
  }

  /* Buttons */
  .btn {
    font-size: 0.8rem;
    padding: 0.45rem 0.875rem;
  }

  .btn-sm {
    font-size: 0.725rem;
    padding: 0.25rem 0.5rem;
  }

  /* Invoice card */
  .invoice-card {
    padding: 0.875rem;
    border-radius: 8px;
  }

  /* Modal full screen on small mobile */
  .modal-overlay {
    padding: 0;
  }

  .modal-content {
    border-radius: 0;
    max-width: 100%;
    max-height: 100vh;
    height: 100vh;
  }

  .modal-body {
    padding: 0.875rem;
  }

  .modal-header {
    padding: 0.875rem;
  }

  .modal-footer {
    padding: 0.75rem 0.875rem;
  }
}

#print-return-slip-template {
  display: none;
}

/* PRINT STYLES - Tối ưu in hóa đơn A4 */
@media print {
  html {
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 12pt;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .app-container,
  .toast-container,
  .modal-overlay {
    display: none !important;
  }

  #print-invoice-template {
    display: block !important;
    width: 100%;
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #000 !important;
    padding: 20px;
    background-color: #fff;
  }

  body.printing-return #print-invoice-template {
    display: none !important;
  }

  #print-return-slip-template {
    display: none;
  }

  body.printing-return #print-return-slip-template {
    display: block !important;
    width: 100%;
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #000 !important;
    padding: 20px;
    background-color: #fff;
  }


  .print-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px !important;
    border-bottom: 2.5px solid #000;
    padding-bottom: 6px !important;
  }

  .print-header h1 {
    font-size: 24pt;
    font-weight: 900;
    margin: 0;
    text-transform: uppercase;
    color: #000 !important;
  }

  .print-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 12px !important;
    font-size: 13pt;
    font-weight: bold;
    color: #000 !important;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px !important;
    table-layout: fixed;
  }

  .print-table th, 
  .print-table td {
    border: 1.5px solid #000;
    padding: 4px 6px;
    text-align: left;
    font-size: 11.5pt;
    word-wrap: break-word;
    word-break: normal;
    font-weight: bold;
    color: #000 !important;
  }

  .print-table th {
    background-color: #f2f2f2 !important;
    font-weight: bold;
    text-align: center;
  }
  
  .print-text-right {
    text-align: right !important;
  }
  
  .print-text-center {
    text-align: center !important;
  }

  .print-summary {
    float: right;
    width: 350px;
    margin-top: 6px;
  }

  .print-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 12pt;
    font-weight: bold;
    color: #000 !important;
  }

  .print-summary-row.grand-total {
    border-top: 2px solid #000;
    font-weight: bold;
    font-size: 14pt;
    padding-top: 4px;
  }

  .print-signatures {
    margin-top: 15px !important;
    display: flex;
    justify-content: space-between;
    clear: both;
    font-size: 12pt;
    font-weight: bold;
    color: #000 !important;
  }

  .print-sig-col {
    text-align: center;
    width: 40%;
  }

  .print-sig-space {
    height: 40px !important;
  }
  
  .print-color-box {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 1px solid #000;
    margin-right: 5px;
    vertical-align: middle;
  }
}

/* Drag and Drop Upload Zone */
.upload-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 2.25rem 1.5rem;
  text-align: center;
  background-color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--color-primary);
  background-color: rgba(16, 185, 129, 0.04);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.05);
}

.upload-icon {
  margin-bottom: 0.75rem;
  transition: transform 0.2s ease;
}

.upload-dropzone:hover .upload-icon {
  transform: translateY(-2px);
}

.upload-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.upload-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Database Connection Status Badges */
.db-status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.db-status-badge.status-local {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.db-status-badge.status-cloud {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  border: 1px solid rgba(16, 185, 129, 0.25);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

.db-status-badge.status-connecting {
  background-color: rgba(245, 158, 11, 0.12);
  color: var(--color-warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Table Inline Inputs (Premium Sheets Look) */
.table-inline-input {
  width: 100%;
  padding: 0.375rem 0.35rem;
  background-color: transparent;
  border: 1px solid transparent;
  color: var(--text-primary);
  font-size: 0.875rem;
  text-align: right;
  border-radius: 6px;
  transition: all 0.15s ease;
  font-weight: 500;
  -moz-appearance: textfield; /* Firefox */
}

/* Hide spin-buttons for Chrome, Safari, Edge, Opera */
.table-inline-input::-webkit-outer-spin-button,
.table-inline-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.table-inline-input:hover {
  background-color: rgba(0, 0, 0, 0.03);
  border-color: var(--border-color);
}

.table-inline-input:focus {
  outline: none;
  background-color: #ffffff;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--border-focus);
}

.table-inline-select {
  width: 100%;
  padding: 0.375rem 1.75rem 0.375rem 0.5rem;
  background-color: transparent;
  border: 1px solid transparent;
  color: var(--text-primary);
  font-size: 0.875rem;
  border-radius: 6px;
  transition: all 0.15s ease;
  font-weight: 500;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1rem;
}

.table-inline-select:hover {
  background-color: rgba(0, 0, 0, 0.03);
  border-color: var(--border-color);
}

.table-inline-select:focus {
  outline: none;
  background-color: #ffffff;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--border-focus);
}

.table-inline-input:disabled,
.table-inline-select:disabled {
  background-color: transparent !important;
  border-color: transparent !important;
  color: var(--text-primary) !important;
  cursor: default !important;
  pointer-events: none !important;
}

.table-inline-select:disabled {
  background-image: none !important;
  padding-right: 0.5rem !important;
}

/* Authentication & Login Screen Styles */
#app-layout.auth-hidden {
  display: none !important;
}

.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-primary);
  background-image: radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.08) 0%, transparent 60%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg);
  animation: authFadeInDown 0.4s ease;
}

.login-brand-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-brand-lockup img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 78px;
  object-fit: contain;
}

@keyframes authFadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Ensure headings and important values inherit primary text color */
.panel-title, .page-title, .widget-value, .invoice-card-id, .summary-heading, .empty-state-title, .top-product-name {
  color: var(--text-primary) !important;
}

/* Override inline white text colors */
td[style*="color: #fff"], 
td[style*="color:#fff"], 
span[style*="color: #fff"], 
span[style*="color:#fff"], 
strong[style*="color: #fff"], 
strong[style*="color:#fff"], 
div[style*="color: #fff"], 
div[style*="color:#fff"], 
h2[style*="color: #fff"],
h2[style*="color:#fff"] {
  color: var(--text-primary) !important;
}

/* Ensure buttons still have white text on strong primary/indigo/danger backgrounds */
.btn-primary, .btn-indigo, .btn-danger, .btn-teal, .pay-debt-btn, .quick-print-btn, .history-print-btn {
  color: #ffffff !important;
}

/* Secondary buttons: proper dark text and light gray background */
.btn-secondary, .history-load-btn {
  background-color: #e2e8f0 !important;
  color: var(--text-primary) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}
.btn-secondary:hover, .history-load-btn:hover {
  background-color: #cbd5e1 !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
}

/* Form controls light overrides */
.form-control, .form-control-search {
  background-color: #ffffff !important;
  color: var(--text-primary) !important;
  border: 1px solid #cbd5e1 !important; /* Slightly darker slate border for crisp visibility */
  border-radius: 8px !important;
  font-weight: 600 !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05) !important; /* Subtle inner shadow for premium look */
}
.form-control:focus, .form-control-search:focus {
  background-color: #ffffff !important;
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 3px var(--border-focus), inset 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

/* Custom select dropdown styling in light mode */
select.form-control {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.75rem center !important;
  background-size: 1.1rem !important;
  padding-right: 2.25rem !important;
}

/* Input group wrapper background fix */
.custom-input-group {
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  padding: 0 0.5rem !important;
  display: flex !important;
  align-items: center !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}
.custom-input-group:focus-within {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 3px var(--border-focus), inset 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}
.custom-input-group i {
  flex-shrink: 0 !important;
  margin-right: 0.5rem !important;
  color: #475569 !important;
  display: inline-flex !important;
  align-items: center !important;
}
.custom-input-group .form-control {
  background-color: transparent !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding-left: 0.25rem !important;
}
.custom-input-group .form-control:focus {
  background-color: transparent !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Table light mode overrides */
.table-responsive {
  background-color: #ffffff !important;
  border: 1px solid var(--border-color) !important;
}
.table th {
  background-color: #f8fafc !important;
  color: var(--text-secondary) !important;
  border-bottom: 1px solid var(--border-color) !important;
}
.table tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.015) !important;
}
.top-product-progress-bg {
  background-color: rgba(0, 0, 0, 0.05) !important;
}

/* Suggestion dropdown override */
.suggestions-list {
  background-color: #ffffff !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
  z-index: 1050 !important;
}
.suggestion-item:hover {
  background-color: var(--bg-primary) !important;
  color: var(--color-primary) !important;
}

/* Modal and Dropzone overrides */
.modal-content {
  background-color: #ffffff !important;
  color: var(--text-primary) !important;
  box-shadow: var(--shadow-lg) !important;
}
.upload-dropzone {
  background-color: var(--bg-primary) !important;
  border: 2px dashed var(--border-color) !important;
}
.upload-text {
  color: var(--text-primary) !important;
}

/* Chart view controls override */
.chart-controls {
  background: var(--bg-primary) !important;
  border-color: var(--border-color) !important;
}
.chart-view-btn.btn-secondary {
  color: var(--text-secondary) !important;
  background: transparent !important;
  border: none !important;
}
.chart-view-btn.btn-primary {
  color: #ffffff !important;
  background: var(--color-primary) !important;
}

/* Selected customer panel info card */
#invoice-customer-info-card {
  background: rgba(79, 70, 229, 0.05) !important;
  border-color: rgba(79, 70, 229, 0.15) !important;
}
#selected-customer-name-lbl {
  color: var(--text-primary) !important;
}

/* Quick customer form background */
#invoice-quick-customer-fields {
  background: rgba(0, 0, 0, 0.02) !important;
}

/* ========================================
   ACCESSIBILITY: BOLD TEXT & HIGH CONTRAST
   (Tối ưu cho người mắt kém / Cao tuổi)
   ======================================== */
body {
  font-weight: 500;
}

/* Tiêu đề siêu đậm */
h1, h2, h3, h4, h5, h6, .panel-title, .page-title, .summary-heading {
  font-weight: 800 !important;
  color: #000000 !important;
}

/* Nhãn biểu mẫu (Labels) cực kỳ nổi bật */
.form-label, label {
  font-weight: 700 !important;
  color: #000000 !important;
  font-size: 0.95rem !important;
}

/* Tiêu đề cột và ô trong bảng (Tables) đậm nét */
.table th {
  font-weight: 800 !important;
  color: #000000 !important;
  font-size: 0.95rem !important;
}

.table td {
  font-weight: 600 !important;
  color: #000000 !important;
  font-size: 0.925rem !important;
}

.table td strong {
  font-weight: 800 !important;
  color: #000000 !important;
}

/* Các trường nhập liệu (Inputs, Select, Search) chữ đen, đậm */
.form-control, .form-control-search, select.form-control {
  font-weight: 700 !important;
  color: #000000 !important;
}

/* Chữ gợi ý (Placeholders) tối màu hơn, dễ đọc */
input::placeholder,
textarea::placeholder,
.form-control::placeholder,
.form-control-search::placeholder {
  color: #475569 !important; /* Slate 600 thay vì xám nhạt */
  font-weight: 600 !important;
  opacity: 1 !important;
}

/* Tóm tắt đơn hàng và thanh toán */
.summary-row .label {
  color: #1e293b !important;
  font-weight: 700 !important;
}

.summary-row .value {
  color: #000000 !important;
  font-weight: 800 !important;
}

.summary-row.total-row .label {
  color: #000000 !important;
  font-weight: 800 !important;
}

.summary-row.total-row .value-final {
  font-weight: 800 !important;
}

/* Thẻ thông tin khách hàng đã chọn */
#invoice-customer-info-card div {
  color: #000000 !important;
  font-weight: 700 !important;
}

#invoice-customer-info-card span {
  font-weight: 800 !important;
}

/* Menu điều hướng bên trái (Sidebar) */
.nav-link {
  font-weight: 700 !important;
  color: #ffffff !important;
}

.nav-link.active {
  font-weight: 800 !important;
  color: #ffffff !important;
  background-color: rgba(0, 0, 0, 0.15) !important;
}

.purchase-menu .purchase-menu-heading {
  color: var(--text-secondary) !important;
}

.purchase-menu .purchase-menu-link {
  color: var(--text-primary) !important;
  font-weight: 500 !important;
}

.purchase-menu .purchase-menu-link:hover,
.purchase-menu .purchase-menu-link.active {
  color: var(--color-primary) !important;
  background: transparent !important;
}

.purchase-page {
  display: block;
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 105px);
  background: #f3f4f6;
  margin: -0.75rem;
  padding: 0.75rem;
}

.purchase-filters {
  background: #ffffff;
  border-radius: 8px;
  padding: 0.75rem;
  color: #111827;
}

.purchase-filters h2 {
  font-size: 1.35rem !important;
  margin-bottom: 1rem;
  color: #000000 !important;
}

.purchase-filter-block {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 1.35rem;
}

.purchase-filter-title {
  font-weight: 800;
  color: #111827;
}

.purchase-filter-block label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 500 !important;
  color: #111827 !important;
  font-size: 0.9rem !important;
}

.purchase-filter-block input[type="checkbox"],
.purchase-filter-block input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: #006ffd;
}

.purchase-radio-row {
  border: 1px solid #d1d5db;
  border-radius: 7px;
  padding: 0.45rem 0.55rem;
  justify-content: space-between;
}

.purchase-radio-row span {
  flex: 1;
}

.purchase-radio-row svg {
  width: 15px;
  height: 15px;
  color: #64748b;
}

.purchase-filter-input {
  height: 32px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  padding: 0 0.75rem;
  color: #111827;
  background: #ffffff;
}

.purchase-main {
  width: 100%;
  max-width: none;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.purchase-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.purchase-heading {
  min-width: 0;
}

.purchase-heading h2 {
  margin: 0;
  white-space: nowrap;
}

.purchase-heading small {
  display: block;
  margin-top: 0.2rem;
}

.purchase-search {
  width: min(500px, 45vw);
  height: 34px;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: #ffffff;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  padding: 0 0.6rem;
}

.purchase-search svg {
  width: 18px;
  height: 18px;
  color: #1f2937;
}

.purchase-search input {
  flex: 1;
  border: none;
  outline: none;
  color: #111827;
  font-size: 0.9rem;
}

.purchase-search button,
.purchase-tool-btn,
.purchase-primary-btn {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 8px;
  border: 1px solid #cfd8e3;
  background: #ffffff;
  color: #111827;
  font-weight: 700;
  padding: 0 0.75rem;
  cursor: pointer;
}

.purchase-search button,
.purchase-toolbar .purchase-search button {
  width: 34px;
  justify-content: center;
  padding: 0;
}

.purchase-primary-btn {
  border-color: #006ffd;
  color: #006ffd;
  flex: 0 0 auto;
  white-space: nowrap;
}

.purchase-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.purchase-actions svg,
.purchase-primary-btn svg,
.purchase-tool-btn svg {
  width: 17px;
  height: 17px;
}

.purchase-table-wrap {
  background: #ffffff;
  border-radius: 8px;
  overflow: auto;
  min-height: calc(100vh - 155px);
  width: 100%;
  max-width: 100%;
}

.purchase-table,
.purchase-items-table {
  width: 100%;
  border-collapse: collapse;
  color: #111827;
}

.purchase-table {
  min-width: 1120px;
  table-layout: auto;
}

.purchase-table th,
.purchase-table td {
  white-space: nowrap;
}

.purchase-empty {
  text-align: center !important;
  white-space: normal !important;
  padding: 3rem 1rem !important;
}

.purchase-row-toggle {
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  background: #fff;
  color: #006ffd;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
}

.purchase-table th {
  background: #e5f1ff !important;
  border-bottom: 1px solid #b7d5ff;
  color: #000000 !important;
  font-weight: 800 !important;
  padding: 0.75rem;
  text-align: left;
}

.purchase-table td {
  border-bottom: 1px solid #e5e7eb;
  color: #000000 !important;
  padding: 0.75rem;
  font-weight: 500 !important;
}

.purchase-total-row td {
  font-weight: 800 !important;
}

.purchase-row {
  cursor: pointer;
}

.purchase-row.active {
  outline: 2px solid #006ffd;
  outline-offset: -2px;
  background: #f1f7ff;
}

.purchase-status {
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  padding: 0.25rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 800;
}

.purchase-status.completed {
  background: #dcfce7;
  color: #16a34a;
}

.purchase-status.draft {
  background: #fef3c7;
  color: #b45309;
}

.purchase-status.cancelled {
  background: #fee2e2;
  color: #dc2626;
}

.purchase-empty {
  text-align: center;
  color: #64748b !important;
  padding: 4rem !important;
}

.purchase-detail {
  border-top: 1px solid #dbeafe;
  padding: 0.5rem 1.5rem 0.75rem;
  background: #ffffff;
}

.purchase-detail-tab {
  display: inline-block;
  color: #006ffd;
  border-bottom: 2px solid #006ffd;
  padding: 0.5rem 0;
  font-weight: 700;
  margin-bottom: 1rem;
}

.purchase-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.1rem;
}

.purchase-detail-code {
  font-size: 1.15rem;
  font-weight: 900;
  margin-right: 0.75rem;
}

.purchase-detail-meta {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.2fr;
  gap: 1rem 2rem;
  margin-bottom: 1.5rem;
}

.purchase-detail-meta div {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.purchase-detail-meta span {
  min-width: 82px;
}

.purchase-detail-meta a {
  color: #006ffd;
}

.purchase-detail-meta select,
.purchase-detail-meta input {
  height: 28px;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  padding: 0 0.5rem;
  color: #111827;
  background: #ffffff;
}

.purchase-items-table th {
  background: #eef0f2 !important;
  color: #000000 !important;
  padding: 0.7rem;
  border-bottom: 1px solid #d1d5db;
  text-align: left;
}

.purchase-items-table td {
  padding: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}

.purchase-items-table a,
.purchase-item-search-row span {
  color: #006ffd;
}

.purchase-item-search-row input {
  height: 32px;
  border: 1px solid #cfd8e3;
  border-radius: 7px;
  padding: 0 0.75rem;
}

.purchase-detail-bottom {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 360px;
  gap: 2rem;
  margin-top: 1.5rem;
}

.purchase-detail-bottom textarea {
  min-height: 120px;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  padding: 0.75rem;
  resize: vertical;
}

.purchase-summary {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.purchase-summary div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.purchase-detail-paid-input {
  width: 150px;
  height: 32px;
  border: 1px solid #cfd8e3;
  border-radius: 7px;
  padding: 0 0.55rem;
  text-align: right;
  font-weight: 700;
  background: #ffffff;
}

.purchase-detail-actions {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.6rem;
  align-items: center;
  border-top: 1px solid #e5e7eb;
  padding-top: 0.9rem;
  margin-top: 1.25rem;
}

.purchase-detail-actions button {
  height: 34px;
  border: 1px solid #cfd8e3;
  background: #ffffff;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #111827;
  font-weight: 700;
  padding: 0 0.75rem;
}

.purchase-detail-actions button.primary {
  background: #006ffd;
  border-color: #006ffd;
  color: #ffffff;
}

.purchase-detail-actions svg {
  width: 16px;
  height: 16px;
}

.purchase-entry-modal-content {
  width: min(920px, calc(100vw - 48px));
  max-width: min(920px, calc(100vw - 48px)) !important;
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#purchase-entry-modal {
  background-color: rgba(0, 0, 0, 0.58);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  animation: none !important;
}

#purchase-entry-modal .purchase-entry-modal-content {
  animation: none !important;
}

.purchase-entry-modal-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  overflow-y: auto;
  padding-right: 0.75rem;
}

.purchase-entry-modal-content .modal-footer {
  flex-shrink: 0;
}

.purchase-entry-items-wrap {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  overflow-x: auto;
  background: #ffffff;
}

.purchase-entry-items-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 720px;
}

.purchase-entry-items-table th {
  background: #eef0f2 !important;
  color: #000000 !important;
  padding: 0.55rem;
  text-align: left;
  border-bottom: 1px solid #d1d5db;
}

.purchase-entry-items-table td {
  padding: 0.45rem;
  border-bottom: 1px solid #e5e7eb;
}

.purchase-entry-items-table input {
  box-sizing: border-box;
  width: 100%;
  height: 32px;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  padding: 0 0.55rem;
  color: #111827;
  background: #ffffff;
  outline: none;
  transition: border-color 0.12s ease;
}

.purchase-entry-items-table input:hover,
.purchase-entry-items-table input:focus {
  border-color: #94a3b8;
  box-shadow: none !important;
}

.purchase-entry-qty,
.purchase-entry-price,
.purchase-entry-line-total {
  text-align: right;
}

.purchase-entry-line-total {
  font-weight: 800;
  color: #111827;
}

.purchase-entry-remove-row {
  margin: 0 auto;
  width: 30px;
  height: 30px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fff5f5;
  color: #dc2626;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.purchase-entry-remove-row svg {
  width: 15px;
  height: 15px;
}

.purchase-entry-total {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  align-items: center;
  margin-top: 0.65rem;
  color: #111827;
  font-weight: 800;
}

@media (max-width: 768px) {
  .purchase-menu {
    min-width: min(92vw, 360px);
    grid-template-columns: 1fr;
  }

  .purchase-menu-section + .purchase-menu-section {
    border-left: none;
    border-top: 1px solid var(--border-color);
    margin-top: 0.6rem;
    padding-top: 0.6rem;
  }

  .staff-menu {
    top: 91px;
    left: 8px;
    min-width: min(88vw, 260px);
  }

  .purchase-page {
    grid-template-columns: 1fr;
    margin: 0;
  }

  .purchase-toolbar,
  .purchase-actions {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .purchase-search {
    width: 100%;
  }

  .purchase-detail-meta,
  .purchase-detail-bottom,
  .purchase-detail-actions {
    grid-template-columns: 1fr;
  }

  .purchase-entry-modal-content {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px) !important;
  }

  .purchase-entry-modal-body {
    grid-template-columns: 1fr;
    padding-right: 0;
  }
}



/* ========================================================
   BẢNG SẢN PHẨM & Ô NHẬP LIỆU TRONG BẢNG (INLINE CONTROLS)
   ======================================================== */
/* Tối ưu đệm của dòng bảng hóa đơn để tăng không gian ngang */
.invoice-items-table th,
.invoice-items-table td {
  padding: 0.5rem 0.35rem 1.15rem 0.35rem !important; /* Đồng bộ đệm chân để giữ căn lề dọc thẳng hàng tắp */
  font-size: 0.85rem !important;
  vertical-align: middle !important;
}

.invoice-items-table td {
  color: #000000 !important;
  font-weight: 600;
}

.invoice-items-table td[style*="color: #fff"],
.invoice-items-table td[style*="color:#fff"] {
  color: #000000 !important;
}

.invoice-product-code-cell {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}

.invoice-product-code-cell > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.invoice-item-drag-handle {
  flex: 0 0 24px;
  width: 24px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  cursor: grab;
  touch-action: none;
}

.invoice-item-drag-handle:hover {
  color: var(--color-primary);
  background: rgba(34, 197, 94, 0.1);
}

.invoice-item-drag-handle:active {
  cursor: grabbing;
}

.invoice-item-drag-handle:disabled {
  opacity: 0.35;
  cursor: default;
}

.invoice-item-drag-handle i {
  width: 17px;
  height: 17px;
  pointer-events: none;
}

.invoice-item-row.is-dragging {
  opacity: 0.45;
}

.invoice-item-row.drag-drop-before {
  box-shadow: inset 0 3px 0 var(--color-primary);
}

.invoice-item-row.drag-drop-after {
  box-shadow: inset 0 -3px 0 var(--color-primary);
}

.form-control-inline {
  padding: 0.25rem 0.35rem !important; /* Đệm ngang nhỏ hơn chút */
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  background-color: #ffffff !important;
  color: #000000 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  outline: none !important;
  transition: all 0.2s ease !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03) !important;
  height: 32px !important;
  line-height: 1.2 !important;
}

.form-control-inline:focus {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 2px var(--border-focus), inset 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

select.form-control-inline {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.4rem center !important;
  background-size: 0.85rem !important;
  padding-right: 1.4rem !important; /* Giảm chút đệm phải của mũi tên select */
  width: 100% !important;
}

/* Fix độ rộng các trường cụ thể để không bị che khuất số */
.invoice-items-table .item-quantity {
  width: 100% !important;
  max-width: 52px !important;
  text-align: center !important;
  padding: 0.25rem 0.15rem !important;
}

.invoice-items-table .item-discount {
  width: 100% !important;
  max-width: 68px !important; /* Tăng rộng từ 55px lên 68px để chứa được cả phần thập phân như 77,5 */
  text-align: center !important;
  padding: 0.25rem 0.15rem !important;
}

.invoice-items-table .item-color-code {
  width: 100% !important;
  max-width: 80px !important;
  text-align: center !important;
}

/* ========================================================
   TỐI ƯU CÁC NÚT TRONG THẺ LỊCH SỬ ĐƠN HÀNG (HISTORY CARD)
   ======================================================== */
.order-actions .btn {
  padding-left: 0.35rem !important;
  padding-right: 0.35rem !important;
  font-size: 0.75rem !important;
  white-space: nowrap !important; /* Ngăn chặn tuyệt đối việc chữ bị rớt dòng */
}

.order-actions .history-return-print-btn {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========================================================
   THIẾT KẾ CARD CHO TÙY CHỌN IN HÓA ĐƠN (PRINT MODAL CARD OPTIONS)
   ======================================================== */
.print-type-option {
  display: flex !important;
  align-items: center !important;
  gap: 1.25rem !important;
  width: 100% !important;
  padding: 1.15rem !important;
  border-radius: 12px !important;
  border: 1px solid #cbd5e1 !important;
  background-color: #ffffff !important;
  color: var(--text-primary) !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  text-align: left !important;
  box-shadow: var(--shadow-sm) !important;
  margin-bottom: 0.75rem;
}

.print-type-option:hover {
  transform: translateY(-2px) !important;
  box-shadow: var(--shadow-md) !important;
  border-color: var(--color-primary-hover) !important;
  background-color: var(--color-primary-light) !important;
}

.print-type-option i {
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 10px !important;
  transition: all 0.2s ease !important;
}

/* Đặt tông màu riêng cho từng icon tương ứng */
.print-type-option-retail i {
  background-color: rgba(99, 102, 241, 0.1) !important;
  color: #10b981 !important;
}
.print-type-option-agent i {
  background-color: rgba(16, 185, 129, 0.1) !important;
  color: #10b981 !important;
}
.print-type-option-processing i {
  background-color: rgba(245, 158, 11, 0.12) !important;
  color: #d97706 !important;
}
.print-type-option-warehouse i {
  background-color: rgba(75, 85, 99, 0.1) !important;
  color: #4b5563 !important;
}

.print-type-option .option-title {
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  color: #000000 !important;
}

.print-type-option .option-desc {
  font-size: 0.75rem !important;
  color: #475569 !important;
  margin-top: 0.25rem !important;
  line-height: 1.3 !important;
  font-weight: 500 !important;
}

.form-control-inline::placeholder {
  color: #94a3b8 !important; /* Màu xám nhạt rõ ràng là gợi ý, không bị nhầm là giá trị */
  font-weight: 500 !important;
  opacity: 0.8 !important;
}

/* Ghi đè hiển thị nền trắng cho các option của select trong Light Mode */
select option {
  background-color: #ffffff !important;
  color: #000000 !important;
}

/* Đổi màu chữ bảng giá bán áp dụng thành màu đỏ để dễ nhận diện */
select#invoice-pricelist-select,
select#invoice-pricelist-select:disabled {
  color: #dc2626 !important; /* Đỏ chủ đạo nổi bật */
  font-weight: 800 !important;
}

/* Đảm bảo thẻ lịch sử đơn hàng chiếm toàn bộ chiều cao và thẳng hàng nút bấm ở đáy */
.order-card {
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
}

/* Searchable Select Dropdown Styles */
.searchable-select-wrapper {
  position: relative;
  width: 100%;
}

.searchable-select-trigger {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  cursor: pointer !important;
  padding: 0.5rem 1rem !important;
  height: 42px !important;
  border-radius: 8px !important;
  border: 1px solid var(--border-color) !important;
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  font-size: 0.9rem !important;
  user-select: none !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
}

.searchable-select-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.searchable-select-trigger:hover {
  border-color: rgba(16, 185, 129, 0.3) !important;
}

.searchable-select-wrapper:focus-within .searchable-select-trigger {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 3px var(--border-focus) !important;
}

.searchable-select-dropdown {
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1050 !important;
  margin-top: 4px !important;
  border-radius: 8px !important;
  border: 1px solid var(--border-color) !important;
  background-color: var(--bg-secondary) !important;
  box-shadow: var(--shadow-lg) !important;
  display: none;
  flex-direction: column !important;
  max-height: 280px !important;
  overflow: hidden !important;
  animation: selectDropdownFadeIn 0.15s ease-out !important;
}

@keyframes selectDropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.searchable-select-search-input {
  margin: 8px !important;
  width: calc(100% - 16px) !important;
  height: 36px !important;
  border-radius: 6px !important;
  background-color: var(--bg-primary) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
  padding: 0 10px !important;
  font-size: 0.85rem !important;
}

.searchable-select-search-input:focus {
  border-color: var(--color-primary) !important;
  outline: none !important;
}

.searchable-select-options-list {
  overflow-y: auto !important;
  flex: 1 !important;
  max-height: 180px !important;
  padding: 4px 0 !important;
}

.searchable-select-option-item {
  padding: 8px 12px !important;
  cursor: pointer !important;
  font-size: 0.85rem !important;
  color: var(--text-primary) !important;
  transition: background-color 0.15s !important;
  line-height: 1.35 !important;
  white-space: normal !important;
}

.searchable-select-option-item:hover {
  background-color: var(--bg-primary) !important;
}

.searchable-select-option-item.selected {
  background-color: var(--color-primary-light) !important;
  color: var(--color-primary-hover) !important;
  font-weight: 600 !important;
}

/* Spin animation for refresh button */
.spin-animation {
  animation: spin 1s linear infinite !important;
}

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

/* KiotViet Cashbook Styles */
.so-quy-container {
  display: flex;
  gap: 1.25rem;
  width: 100%;
  align-items: flex-start;
  margin-top: 0.25rem;
}

@media (max-width: 1024px) {
  .so-quy-container {
    flex-direction: column;
    align-items: stretch;
  }
  .so-quy-sidebar {
    width: 100% !important;
  }
}

.so-quy-sidebar {
  width: 250px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.so-quy-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.so-quy-sidebar-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  border-bottom: 2px solid #22c55e;
  padding-bottom: 0.25rem;
  display: inline-block;
}

.filter-group-sec {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.filter-group-sec:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.filter-group-sec-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.custom-radio-group, .custom-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.custom-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.custom-control input {
  cursor: pointer;
  accent-color: #22c55e;
  width: 15px;
  height: 15px;
}

.so-quy-stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 768px) {
  .so-quy-stats-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0.5rem;
  border-right: 1px solid var(--border-color);
}

.stat-item:last-child {
  border-right: none;
}

@media (max-width: 768px) {
  .stat-item:nth-child(2) {
    border-right: none;
  }
}

.stat-item-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.15rem;
}

.stat-item-value {
  font-size: 1.15rem;
  font-weight: 700;
  word-break: break-all;
  text-align: right;
}

.color-quy-dau-ky {
  color: var(--text-primary);
}
.color-tong-thu {
  color: #22c55e;
}
.color-tong-chi {
  color: var(--color-danger);
}
.color-ton-quy {
  color: var(--color-primary);
}

.so-quy-table-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.so-quy-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  margin-top: 0.35rem;
  border-top: 1px solid var(--border-color);
}

.so-quy-pagination-summary {
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.so-quy-pagination-controls,
.so-quy-page-size-label {
  display: flex;
  align-items: center;
}

.so-quy-pagination-controls {
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.so-quy-page-size-label {
  gap: 0.5rem;
  margin-right: 0.35rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
  white-space: nowrap;
}

.so-quy-page-size-label .form-control {
  width: 72px;
  height: 34px;
  padding: 0.25rem 1.65rem 0.25rem 0.55rem;
}

.so-quy-pagination-controls .btn {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.so-quy-pagination-controls .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.so-quy-pagination-controls .btn i {
  width: 15px;
  height: 15px;
}

.so-quy-page-icon {
  width: 34px;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.so-quy-page-info {
  min-width: 92px;
  text-align: center;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
}

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

  .so-quy-pagination-controls {
    justify-content: flex-start;
  }
}

.so-quy-search-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.so-quy-search-wrapper {
  position: relative;
  flex: 1;
  max-width: 320px;
  min-width: 220px;
}

.so-quy-search-wrapper i {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 14px;
  height: 14px;
}

.so-quy-search-input {
  width: 100%;
  padding: 0.55rem 0.75rem 0.55rem 2.1rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.85rem;
  height: 38px;
}

.so-quy-search-input:focus {
  border-color: #22c55e;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 112, 210, 0.1);
}

.so-quy-buttons-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn-kiot-outline-blue {
  background: #ffffff !important;
  color: #22c55e !important;
  border: 1px solid #22c55e !important;
  padding: 0.5rem 0.85rem !important;
  border-radius: 6px !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  cursor: pointer;
  transition: all 0.2s;
  height: 38px;
}

.btn-kiot-outline-blue:hover {
  background: rgba(0, 112, 210, 0.05) !important;
  transform: translateY(-1px);
}

.btn-kiot-outline-gray {
  background: #ffffff !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  padding: 0.5rem 0.85rem !important;
  border-radius: 6px !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  cursor: pointer;
  transition: all 0.2s;
  height: 38px;
}

.btn-kiot-outline-gray:hover {
  background: var(--bg-primary) !important;
  transform: translateY(-1px);
}

.segmented-control {
  display: flex;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  height: 34px;
}

.segmented-btn {
  flex: 1;
  text-align: center;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.2;
}

.segmented-btn:hover {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-primary);
}

.segmented-btn.active {
  background: #22c55e !important;
  color: #ffffff !important;
  font-weight: 600;
}

.star-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: #ccd0d5;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.star-btn:hover {
  color: #f59e0b;
}

.star-btn.starred {
  color: #f59e0b;
}

.so-quy-table th {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-color) !important;
  background-color: var(--bg-primary);
}

.so-quy-table td {
  font-size: 0.85rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-color) !important;
}

.so-quy-table tr:hover td {
  background-color: rgba(0, 112, 210, 0.02) !important;
}

.badge-status {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-block;
}

.badge-status-paid {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-primary);
}

.badge-status-cancelled {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
}

.so-quy-transaction-row {
  cursor: pointer;
  transition: background-color 0.16s ease;
}

.so-quy-transaction-row:focus-visible {
  outline: 2px solid #22c55e;
  outline-offset: -2px;
}

.so-quy-transaction-row.is-expanded td {
  background: #f0f7ff !important;
  border-top: 2px solid #1687ef;
}

.so-quy-inline-detail-row > td,
.so-quy-table .so-quy-inline-detail-row:hover > td {
  padding: 0 !important;
  background: #fff !important;
  border: 2px solid #1687ef !important;
  border-top: 0 !important;
}

.so-quy-inline-detail {
  color: #1f2937;
  background: #fff;
}

.so-quy-inline-tab {
  width: max-content;
  padding: 0.75rem 1.5rem 0.55rem;
  color: #087bea;
  font-weight: 700;
  border-bottom: 2px solid #1687ef;
}

.so-quy-inline-heading,
.so-quy-inline-meta,
.so-quy-inline-grid,
.so-quy-inline-wide-field,
.so-quy-inline-note {
  margin-inline: 1.5rem;
}

.so-quy-inline-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
}

.so-quy-inline-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  font-size: 1rem;
}

.so-quy-inline-title strong > span {
  font-weight: 600;
}

.so-quy-accounting-badge {
  display: inline-flex;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: #dc2626;
  background: #fee2e2;
  font-size: 0.75rem;
  font-weight: 600;
}

.so-quy-accounting-badge.is-accounting {
  color: #047857;
  background: #d1fae5;
}

.so-quy-inline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0;
  padding: 0.8rem 0 1rem;
  font-size: 0.82rem;
}

.so-quy-inline-meta > span {
  padding: 0 0.85rem;
  border-right: 1px solid var(--border-color);
}

.so-quy-inline-meta > span:first-child { padding-left: 0; }
.so-quy-inline-meta > span:last-child { border-right: 0; }

.so-quy-inline-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
  padding: 0.8rem 0 1rem;
}

.so-quy-inline-field,
.so-quy-inline-wide-field {
  min-width: 0;
}

.so-quy-inline-field > span,
.so-quy-inline-wide-field > span {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.so-quy-inline-field > strong {
  display: block;
  min-height: 1.75rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border-color);
  overflow-wrap: anywhere;
}

.so-quy-inline-amount.is-receipt { color: #087bea; }
.so-quy-inline-amount.is-payment { color: var(--color-danger); }
.so-quy-inline-amount.is-cancelled { color: var(--text-muted); text-decoration: line-through; }

.so-quy-inline-wide-field {
  padding: 0.4rem 0 0.9rem;
  border-bottom: 1px solid var(--border-color);
}

.so-quy-inline-wide-field > strong {
  display: block;
  color: #087bea;
  overflow-wrap: anywhere;
}

.so-quy-inline-wide-field > small {
  display: block;
  margin-top: 0.35rem;
  color: var(--text-secondary);
}

.so-quy-inline-note {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 3.5rem;
  padding: 0.8rem 0;
  color: var(--text-secondary);
}

.so-quy-inline-note svg,
.so-quy-inline-actions svg {
  width: 16px;
  height: 16px;
}

.so-quy-inline-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  border-top: 1px solid var(--border-color);
}

.so-quy-inline-actions > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.so-quy-inline-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

@media (max-width: 1100px) {
  .so-quy-inline-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .so-quy-inline-heading,
  .so-quy-inline-meta,
  .so-quy-inline-grid,
  .so-quy-inline-wide-field,
  .so-quy-inline-note { margin-inline: 0.9rem; }
  .so-quy-inline-grid { grid-template-columns: 1fr; gap: 0.8rem; }
  .so-quy-inline-actions { align-items: stretch; flex-direction: column; padding-inline: 0.9rem; }
  .so-quy-inline-actions > div:last-child { justify-content: flex-end; }
}

/* Cashbook receipt/payment creation: wide, grouped and responsive. */
.cashbook-create-modal-content {
  display: flex;
  flex-direction: column;
  width: min(94vw, 840px) !important;
  max-width: 840px !important;
  max-height: calc(100vh - 3rem);
  overflow: hidden;
}

.cashbook-create-header {
  position: relative;
  flex: 0 0 auto;
  align-items: flex-start;
  padding: 1.15rem 1.5rem;
  overflow: hidden;
}

.cashbook-create-header::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #16a34a;
}

.cashbook-create-payment .cashbook-create-header::before {
  background: #ef4444;
}

.cashbook-create-header p {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.cashbook-create-form {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.cashbook-create-body {
  display: grid;
  gap: 1rem;
  min-height: 0;
  padding: 1.1rem 1.5rem !important;
  overflow-y: auto;
  background: #f8fafc;
}

.cashbook-create-section {
  padding: 1rem 1.1rem 1.1rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.cashbook-create-section-heading {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}

.cashbook-create-section-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 8px;
  color: #047857;
  background: #d1fae5;
  font-size: 0.78rem;
  font-weight: 800;
}

.cashbook-create-payment .cashbook-create-section-index {
  color: #b91c1c;
  background: #fee2e2;
}

.cashbook-create-section-heading > div {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.cashbook-create-section-heading strong {
  color: var(--text-primary);
  font-size: 0.9rem;
}

.cashbook-create-section-heading small,
.cashbook-create-field-hint {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.cashbook-create-field-hint {
  display: block;
  margin-top: 0.28rem;
}

.cashbook-create-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1.1rem;
}

.cashbook-create-grid .form-group {
  min-width: 0;
  margin: 0;
}

.cashbook-create-grid .form-control {
  width: 100%;
  min-height: 42px;
}

.cashbook-datetime-24h {
  display: grid;
  grid-template-columns: minmax(128px, 1fr) 80px 8px 80px;
  align-items: center;
  gap: 0.35rem;
}

.cashbook-datetime-24h .form-control {
  min-width: 0;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
  font-variant-numeric: tabular-nums;
}

.cashbook-datetime-24h .cashbook-hour-input,
.cashbook-datetime-24h .cashbook-minute-input {
  width: 80px;
  padding-left: 0.65rem;
  padding-right: 1.75rem;
  font-weight: 700;
}

.cashbook-time-separator {
  color: var(--text-primary);
  font-weight: 800;
  text-align: center;
}

.cashbook-create-field-full {
  grid-column: 1 / -1;
}

.cashbook-create-value-input {
  color: #047857;
  min-height: 50px !important;
  padding: 0.65rem 0.85rem;
  border-width: 2px;
  border-color: #86efac;
  background: #f0fdf4;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.025em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cashbook-create-payment .cashbook-create-value-input {
  color: #dc2626;
  border-color: #fca5a5;
  background: #fff7f7;
}

.cashbook-create-value-input:focus {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.14);
}

.cashbook-create-payment .cashbook-create-value-input:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.14);
}

.cashbook-create-value-input::placeholder {
  color: #94a3b8;
  opacity: 1;
}

.cashbook-create-accounting-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid #bbf7d0;
  border-radius: 9px;
  background: #f0fdf4;
  cursor: pointer;
}

.cashbook-create-payment .cashbook-create-accounting-option {
  border-color: #fecaca;
  background: #fff7f7;
}

.cashbook-create-accounting-option input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  accent-color: #16a34a;
}

.cashbook-create-payment .cashbook-create-accounting-option input {
  accent-color: #ef4444;
}

.cashbook-create-accounting-option > span {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cashbook-create-accounting-option strong { font-size: 0.83rem; }
.cashbook-create-accounting-option small { color: var(--text-muted); font-size: 0.72rem; }
.cashbook-create-grid textarea { min-height: 78px; resize: vertical; }

.cashbook-create-footer {
  flex: 0 0 auto;
  gap: 0.65rem;
  margin: 0;
  padding: 0.9rem 1.5rem 1rem;
  background: #fff;
}

.cashbook-create-footer .btn {
  min-width: 120px;
}

.cashbook-create-receipt .cashbook-create-submit {
  background: #16a34a !important;
  border-color: #16a34a !important;
  color: #fff !important;
}

.cashbook-create-payment .cashbook-create-submit {
  background: #ef4444 !important;
  border-color: #ef4444 !important;
  color: #fff !important;
}

@media (max-width: 720px) {
  .cashbook-create-modal-content {
    width: 100% !important;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
  }
  .cashbook-create-header,
  .cashbook-create-body,
  .cashbook-create-footer { padding-inline: 1rem !important; }
  .cashbook-create-grid { grid-template-columns: 1fr; }
  .cashbook-create-field-full { grid-column: 1; }
  .cashbook-create-footer .btn { flex: 1; min-width: 0; }
}

/* Cashbook edit: spacious grouped layout instead of a narrow single column. */
.cashbook-edit-modal-content {
  display: flex;
  flex-direction: column;
  width: min(94vw, 940px) !important;
  max-width: 940px !important;
  max-height: calc(100vh - 3rem);
  overflow: hidden;
}

.cashbook-edit-header {
  flex: 0 0 auto;
  align-items: flex-start;
  padding: 1.15rem 1.5rem;
}

.cashbook-edit-header p {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.cashbook-edit-form {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.cashbook-edit-body {
  display: grid;
  gap: 1rem;
  min-height: 0;
  padding: 1.1rem 1.5rem !important;
  overflow-y: auto;
  background: #f8fafc;
}

.cashbook-edit-section {
  padding: 1rem 1.1rem 1.1rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.cashbook-edit-section-heading {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}

.cashbook-edit-section-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 8px;
  color: #047857;
  background: #d1fae5;
  font-size: 0.78rem;
  font-weight: 800;
}

.cashbook-edit-section-heading > div {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.cashbook-edit-section-heading strong {
  color: var(--text-primary);
  font-size: 0.9rem;
}

.cashbook-edit-section-heading small {
  color: var(--text-muted);
  font-size: 0.73rem;
}

.cashbook-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1.1rem;
}

.cashbook-edit-grid .form-group {
  min-width: 0;
  margin: 0;
}

.cashbook-edit-grid .form-control {
  width: 100%;
  min-height: 42px;
}

.cashbook-edit-grid input[readonly] {
  color: #475569;
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.cashbook-edit-value-input {
  color: #047857;
  font-size: 1rem;
  font-weight: 700;
}

.cashbook-edit-accounting-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  grid-column: 1 / -1;
  padding: 0.75rem 0.9rem;
  border: 1px solid #dbeafe;
  border-radius: 9px;
  background: #f0f7ff;
  cursor: pointer;
}

.cashbook-edit-accounting-option input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  accent-color: #16a34a;
}

.cashbook-edit-accounting-option > span {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cashbook-edit-accounting-option strong {
  font-size: 0.83rem;
}

.cashbook-edit-accounting-option small {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.cashbook-edit-note-group {
  grid-column: 1 / -1;
}

.cashbook-edit-note-group textarea {
  min-height: 78px;
  resize: vertical;
}

.cashbook-edit-guidance {
  padding: 0.75rem 0.9rem;
  border-left: 3px solid #22c55e;
  border-radius: 6px;
  color: var(--text-secondary);
  background: #f0fdf4;
  font-size: 0.76rem;
  line-height: 1.5;
}

.cashbook-edit-footer {
  flex: 0 0 auto;
  gap: 0.65rem;
  margin: 0;
  padding: 0.9rem 1.5rem 1rem;
  background: #fff;
}

.cashbook-edit-footer .btn {
  min-width: 110px;
}

@media (max-width: 720px) {
  .cashbook-edit-modal-content {
    width: 100% !important;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
  }
  .cashbook-edit-header,
  .cashbook-edit-body,
  .cashbook-edit-footer { padding-inline: 1rem !important; }
  .cashbook-edit-grid { grid-template-columns: 1fr; }
  .cashbook-edit-accounting-option,
  .cashbook-edit-note-group { grid-column: 1; }
  .cashbook-edit-footer .btn { flex: 1; min-width: 0; }
}

/* Modal details */
.detail-item-row {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px dashed var(--border-color);
  font-size: 0.85rem;
}

.detail-item-row:last-child {
  border-bottom: none;
}

.detail-item-label {
  color: var(--text-muted);
}

.detail-item-value {
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
}

/* KiotViet Pill Group and Buttons */
.kiot-pill-group {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.kiot-pill-btn {
  padding: 0.35rem 0.85rem !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  border: 1px solid var(--border-color) !important;
  background-color: var(--bg-secondary) !important;
  color: var(--text-secondary) !important;
  border-radius: 9999px !important;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.kiot-pill-btn:hover {
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
}

.kiot-pill-btn.active {
  background-color: #22c55e !important;
  color: #ffffff !important;
  border-color: #22c55e !important;
  font-weight: 600 !important;
}

/* Responsive Top Navbar Override (Desktop) */
@media (min-width: 769px) {
  .sidebar {
    width: 100% !important;
    height: 60px !important;
    bottom: auto !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border-color) !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 1rem !important;
    padding: 0 1rem !important;
    z-index: 1000 !important;
    overflow: visible !important;
  }
  
  .brand {
    margin-bottom: 0 !important;
    margin-right: 0.5rem !important;
  }
  
  .nav-menu {
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.15rem !important;
    flex: 1 !important;
    margin: 0 !important;
    overflow-x: visible !important;
    white-space: nowrap !important;
  }
  
  .nav-item {
    margin-bottom: 0 !important;
    flex-shrink: 0 !important;
  }
  
  .nav-link {
    padding: 0.35rem 0.6rem !important;
    border-radius: 6px !important;
    font-size: 0.825rem !important;
    white-space: nowrap !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
  }
  
  .sidebar-actions {
    margin-left: auto !important;
    display: flex !important;
    align-items: center !important;
    position: relative !important;
    z-index: 1005 !important;
    overflow: visible !important;
  }

  .sidebar-footer {
    display: none !important;
  }
  
  .main-content {
    margin-left: 0 !important;
    padding-top: 0.75rem !important;
  }

  .top-header {
    margin-bottom: 0.5rem !important;
  }
}

/* Medium screen adjustments to prevent navbar cut-offs */
@media (min-width: 769px) and (max-width: 1050px) {
  .nav-link {
    padding: 0.35rem 0.45rem !important;
    font-size: 0.8rem !important;
  }
}

/* Global Settings Dropdown Item Hover Effect */
.dropdown-item {
  transition: background-color 0.2s ease, color 0.2s ease;
}

.dropdown-item:hover {
  background-color: var(--bg-primary) !important;
}

.sidebar > .nav-menu > .nav-item > .nav-link {
  color: var(--nav-foreground-color) !important;
}

.sidebar > .nav-menu > .nav-item > .nav-link:hover,
.sidebar > .nav-menu > .nav-item > .nav-link.active {
  color: var(--nav-foreground-color) !important;
  background-color: var(--nav-active-background) !important;
}

.sidebar > .nav-menu > .nav-item > .nav-link.active svg,
.sidebar .activity-header-button,
.sidebar .btn-settings-toggle,
.sidebar .btn-settings-toggle svg {
  color: var(--nav-foreground-color) !important;
  stroke: currentColor !important;
}

.sidebar .activity-header-button,
.sidebar .btn-settings-toggle {
  background: var(--nav-control-background) !important;
}

/* Exclusive brand select red color overrides */
select.form-control.default-red,
select.default-red ~ .searchable-select-trigger .searchable-select-label {
  color: #ff0000 !important;
  font-weight: bold !important;
}

/* Global Settings Dropdown Menu Active State */
.global-settings-menu.active {
  display: block !important;
}

/* Customer table column picker */
.customer-column-picker {
  position: relative;
}

.customer-column-picker-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1200;
  width: min(430px, calc(100vw - 32px));
  padding: 0.85rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
  color: var(--text-primary);
}

.customer-column-picker-popover[hidden] {
  display: none;
}

.customer-column-picker-header,
.customer-column-picker-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.customer-column-picker-header {
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border-color);
}

.customer-column-picker-header > div {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.customer-column-picker-header strong {
  font-size: 0.9rem;
}

.customer-column-picker-header span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.customer-column-picker-header .btn-circle {
  width: 30px;
  height: 30px;
  min-width: 30px;
}

.customer-column-picker-header .btn-circle svg {
  width: 15px;
  height: 15px;
}

.customer-column-picker-all,
.customer-column-option-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 34px;
  cursor: pointer;
  font-size: 0.82rem;
}

.customer-column-picker-all {
  padding: 0.45rem 0.35rem;
  font-weight: 600;
}

.customer-column-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.2rem 0.6rem;
  max-height: 310px;
  overflow-y: auto;
  padding: 0.25rem 0;
}

.customer-column-option-label {
  padding: 0.25rem 0.35rem;
  border-radius: 6px;
}

.customer-column-option-label:hover {
  background: var(--bg-surface-hover);
}

.customer-column-picker-all input,
.customer-column-option-label input {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  accent-color: var(--color-primary);
}

.customer-column-picker-footer {
  justify-content: flex-end;
  padding-top: 0.7rem;
  margin-top: 0.35rem;
  border-top: 1px solid var(--border-color);
}

@media (max-width: 640px) {
  .customer-column-picker-popover {
    position: fixed;
    top: 72px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100vh - 84px);
    overflow-y: auto;
  }

  .customer-column-picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
    gap: 0.15rem 0.35rem;
  }

  .customer-column-option-label {
    align-items: flex-start;
    font-size: 0.76rem;
    line-height: 1.25;
  }
}
.customer-query-toolbar {
  display: flex;
  gap: .65rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: .65rem;
}
.customer-header-actions { display: flex; flex: 1 1 auto; align-items: center; justify-content: flex-end; gap: .45rem; flex-wrap: nowrap; min-width: 0; }
.customer-header-actions .btn { padding-left: .7rem; padding-right: .7rem; white-space: nowrap; }
#customers-panel .panel-header { gap: 1rem; }
#customers-panel .panel-title { flex: 0 0 auto; white-space: nowrap; }
.customer-query-toolbar .search-wrapper { flex: 1 1 280px; }
.customer-sort-select { width: 190px; min-width: 170px; height: 42px; }
.customer-null-sort { width: 130px; min-width: 120px; height: 42px; }
.customer-legacy-manager-filter { flex: 0 1 260px; width: 260px; }
.customer-legacy-manager-filter select { width: 100%; height: 42px; padding: .5rem 2.2rem .5rem .8rem; border-radius: 8px; cursor: pointer; }
.customer-sort-toolbar { display: flex; align-items: center; gap: .6rem; flex-wrap: nowrap; margin-bottom: .7rem; padding: .55rem .65rem; border: 1px solid var(--border-color); border-radius: 10px; background: var(--bg-surface-hover); }
.customer-sort-toolbar select.customer-sort-select { flex: 0 1 260px; width: 260px; max-width: 260px; }
.customer-sort-toolbar select.customer-null-sort { flex: 0 1 180px; width: 180px; max-width: 180px; }
.customer-sort-toolbar #btn-customer-sort-direction { flex: 0 0 42px; width: 42px; height: 42px; }
.customer-sort-label { display: inline-flex; align-items: center; gap: .4rem; color: var(--text-secondary); font-size: .8rem; font-weight: 700; white-space: nowrap; }
.customer-sort-label svg { width: 16px; height: 16px; }
.customer-filter-count { min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #ef4444; color: #fff; font-size: .72rem; align-items: center; justify-content: center; }
.customer-filter-count:not([hidden]) { display: inline-flex; }
.customer-query-status-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .85rem; color: var(--text-secondary); font-size: .84rem; }
.customer-query-status-row label { display: inline-flex; align-items: center; gap: .4rem; margin-left: auto; }
.customer-query-status-row select { width: 78px; height: 34px; padding: .25rem .5rem; }
.customer-filter-drawer-backdrop { position: fixed; inset: 0; z-index: 1198; background: rgba(15, 23, 42, .52); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s ease, visibility .2s ease; }
.customer-filter-drawer-backdrop.active { opacity: 1; visibility: visible; pointer-events: auto; }
body.customer-filter-drawer-open { overflow: hidden; }
.customer-advanced-filter-panel { position: fixed; top: 50%; left: 50%; z-index: 1199; display: flex; flex-direction: column; width: min(1040px, calc(100vw - 40px)); max-height: calc(100dvh - 40px); padding: 0; margin: 0; overflow: hidden; border: 1px solid rgba(148, 163, 184, .35); border-radius: 18px; background: var(--bg-surface); box-shadow: 0 28px 80px rgba(15, 23, 42, .32); opacity: 0; transform: translate(-50%, -47%) scale(.975); visibility: hidden; transition: transform .22s ease, opacity .2s ease, visibility .2s ease; }
.customer-advanced-filter-panel.active { opacity: 1; transform: translate(-50%, -50%) scale(1); visibility: visible; }
.customer-filter-drawer-header { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.15rem 1.35rem; border-bottom: 1px solid var(--border-color); background: linear-gradient(135deg, rgba(34, 197, 94, .1), transparent 55%), var(--bg-surface); }
.customer-filter-drawer-header h3 { display: flex; align-items: center; gap: .6rem; margin: 0; font-size: 1.08rem; }
.customer-filter-drawer-header h3 svg { width: 20px; height: 20px; color: var(--color-primary); }
.customer-filter-drawer-header p { margin: .28rem 0 0; color: var(--text-secondary); font-size: .78rem; }
.customer-filter-drawer-header .btn-circle { flex: 0 0 38px; width: 38px; height: 38px; }
.customer-filter-modal-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; min-height: 0; padding: 1.1rem 1.25rem 1.25rem; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; background: var(--bg-primary); }
.customer-filter-modal-body::-webkit-scrollbar { width: 9px; }
.customer-filter-modal-body::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 999px; background: rgba(100, 116, 139, .45); background-clip: padding-box; }
.customer-filter-modal-footer { flex: 0 0 auto; display: flex; align-items: center; justify-content: flex-end; gap: .65rem; padding: .9rem 1.25rem; border-top: 1px solid var(--border-color); background: var(--bg-surface); }
.customer-filter-modal-footer .btn { min-width: 155px; justify-content: center; }
.customer-advanced-filter-panel .customer-filter-span-2 { grid-column: span 2; }
.customer-filter-section { display: flex; flex-direction: column; gap: .5rem; min-width: 0; padding: .9rem; border: 1px solid rgba(148, 163, 184, .3); border-radius: 12px; background: var(--bg-surface); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.customer-filter-section strong { display: flex; align-items: center; min-height: 20px; font-size: .84rem; color: var(--text-primary); }
.customer-filter-range { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.customer-filter-span-2 { grid-column: span 2; }
.customer-filter-multi-grid, .customer-presence-grid { display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: .5rem; }
.customer-filter-multi-grid label, .customer-presence-grid label { display: flex; flex-direction: column; gap: .25rem; font-size: .75rem; color: var(--text-secondary); }
.customer-filter-multi-grid select[multiple] { display: none; }
.customer-multi-select { position: relative; min-width: 0; }
.customer-multi-select-trigger { display: flex; width: 100%; min-height: 42px; align-items: center; justify-content: space-between; gap: .5rem; padding: .55rem .75rem; border: 1px solid var(--border-color); border-radius: 8px; background: #fff; color: #64748b; font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.customer-multi-select-trigger:hover, .customer-multi-select.open .customer-multi-select-trigger { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(34, 197, 94, .1); }
.customer-multi-select.has-value .customer-multi-select-trigger { color: var(--text-primary); }
.customer-multi-select-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-multi-select-chevron { flex: 0 0 auto; color: #64748b; transition: transform .18s ease; }
.customer-multi-select.open .customer-multi-select-chevron { transform: rotate(180deg); }
.customer-multi-select-dropdown { margin-top: .4rem; padding: .55rem; border: 1px solid var(--border-color); border-radius: 10px; background: #fff; box-shadow: 0 12px 28px rgba(15, 23, 42, .12); }
.customer-multi-select-tools { display: flex; align-items: center; gap: .45rem; margin-bottom: .45rem; }
.customer-multi-select-search { width: 100%; min-width: 0; height: 36px; padding: .4rem .65rem; border: 1px solid var(--border-color); border-radius: 7px; font: inherit; }
.customer-multi-select-search:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(34, 197, 94, .1); }
.customer-multi-select-clear { flex: 0 0 auto; height: 36px; padding: 0 .65rem; border: 0; border-radius: 7px; background: #f1f5f9; color: #475569; font-size: .72rem; font-weight: 700; cursor: pointer; }
.customer-multi-select-options { display: grid; gap: .18rem; max-height: 210px; overflow-y: auto; overscroll-behavior: contain; }
.customer-multi-select-option { display: flex !important; flex-direction: row !important; align-items: center; gap: .55rem !important; min-width: 0; padding: .48rem .5rem; border-radius: 7px; color: var(--text-primary) !important; cursor: pointer; }
.customer-multi-select-option:hover { background: #f0fdf4; }
.customer-multi-select-option input { flex: 0 0 16px; width: 16px; height: 16px; accent-color: var(--color-primary); }
.customer-multi-select-option span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; }
.customer-multi-select-empty { padding: .8rem; color: var(--text-secondary); font-size: .78rem; text-align: center; }
.customer-export-column-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.customer-export-column-grid { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)); gap: .5rem; max-height: 330px; overflow: auto; padding: .5rem; border: 1px solid var(--border-color); border-radius: 8px; }
.customer-export-column-grid label { display: flex; align-items: center; gap: .45rem; font-size: .82rem; }
@media (max-width: 1050px) {
  .customer-advanced-filter-panel { width: min(820px, calc(100vw - 32px)); }
}
@media (max-width: 650px) {
  .customer-header-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  #customers-panel .panel-title { white-space: normal; }
  .customer-query-toolbar > * { flex: 1 1 100%; width: 100%; }
  .customer-query-toolbar .btn-circle { flex: 0 0 42px; width: 42px; }
  .customer-sort-toolbar .customer-sort-label { flex: 1 1 100%; }
  .customer-sort-toolbar { flex-wrap: wrap; }
  .customer-sort-toolbar select.customer-sort-select { flex: 1 1 calc(60% - .3rem); width: auto; max-width: none; }
  .customer-sort-toolbar select.customer-null-sort { flex: 1 1 calc(40% - .3rem); width: auto; max-width: none; }
  .customer-advanced-filter-panel { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); border-radius: 14px; }
  .customer-filter-drawer-header { padding: .9rem 1rem; }
  .customer-filter-modal-body { grid-template-columns: 1fr; padding: .8rem; }
  .customer-filter-modal-body .customer-filter-span-2 { grid-column: span 1; }
  .customer-filter-modal-footer { padding: .75rem .8rem; }
  .customer-filter-modal-footer .btn { min-width: 0; flex: 1; }
  .customer-filter-multi-grid, .customer-presence-grid, .customer-export-column-grid { grid-template-columns: 1fr; }
  .customer-query-status-row label { margin-left: 0; }
}
.history-status-multi-filter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border-color);
  border-radius: 9px;
  background: var(--bg-secondary);
}

.history-status-multi-filter label {
  cursor: pointer;
}

.history-status-multi-filter input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.history-status-multi-filter span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  transition: 0.16s ease;
}

.history-status-multi-filter input:focus-visible + span {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.history-status-multi-filter input:checked + span {
  color: #fff;
  background: var(--color-primary);
  box-shadow: 0 2px 7px rgba(79, 70, 229, 0.22);
}

/* Customer debt history: compact source links without column overlap. */
#customer-detail-modal .customer-detail-modal-content {
  max-width: 980px !important;
}

.customer-debt-history-scroll {
  max-height: 350px;
  overflow: auto;
  scrollbar-gutter: stable;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: #fff;
}

.customer-debt-history-table {
  width: 100%;
  min-width: 760px;
  margin-bottom: 0;
  table-layout: fixed;
  font-size: 0.82rem;
}

.customer-debt-history-table col:nth-child(1) { width: 12% !important; }
.customer-debt-history-table col:nth-child(2) { width: 15% !important; }
.customer-debt-history-table col:nth-child(3) { width: 11% !important; }
.customer-debt-history-table col:nth-child(4),
.customer-debt-history-table col:nth-child(5),
.customer-debt-history-table col:nth-child(6) { width: 13% !important; }
.customer-debt-history-table col:nth-child(7) { width: 23% !important; }

.customer-debt-history-table th {
  padding: 0.8rem 0.65rem;
  vertical-align: middle;
}

.customer-debt-history-table td {
  padding: 0.68rem 0.65rem;
  vertical-align: middle;
}

.customer-debt-time-cell {
  white-space: nowrap;
  line-height: 1.25;
}

.customer-debt-time-cell strong,
.customer-debt-time-cell span {
  display: block;
}

.customer-debt-time-cell span {
  margin-top: 0.15rem;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 500;
}

.customer-debt-source-cell {
  overflow: hidden;
}

.customer-debt-source-link {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: 999px;
  padding: 0.32rem 0.55rem;
  background: rgba(16, 185, 129, 0.08);
  color: #059669;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.customer-debt-source-link svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.customer-debt-source-link span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-debt-source-link:hover {
  border-color: rgba(16, 185, 129, 0.55);
  background: rgba(16, 185, 129, 0.15);
  transform: translateY(-1px);
}

.customer-debt-source-link:focus-visible {
  outline: 2px solid rgba(16, 185, 129, 0.4);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .customer-debt-history-table {
    min-width: 720px;
  }
}
.maintenance-status {
  color: var(--color-primary);
  font-size: 0.85rem;
  font-weight: 700;
}

.maintenance-status.is-enabled {
  color: #f87171;
}

.customer-field-invalid,
.searchable-select-trigger.customer-field-invalid {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14) !important;
}

/* SoVie public landing page */
.landing-page {
  --landing-ink: #09263e;
  --landing-muted: #5d7182;
  --landing-blue: #075ff7;
  --landing-green: #18c85b;
  background: #f8fbff;
  color: var(--landing-ink);
  min-height: 100vh;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
}

.landing-page *, .landing-page *::before, .landing-page *::after { box-sizing: border-box; }
.landing-page button, .landing-page a { font: inherit; }
.landing-page a { color: inherit; text-decoration: none; }
.landing-header { height: 84px; max-width: 1240px; margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; position: relative; z-index: 20; }
.landing-brand { width: 126px; display: flex; align-items: center; }
.landing-brand img, .landing-footer img { width: 100%; height: auto; display: block; }
.landing-nav { display: flex; align-items: center; gap: 36px; color: #385267; font-size: 14px; font-weight: 600; }
.landing-nav a { position: relative; padding: 10px 0; }
.landing-nav a::after { content: ''; position: absolute; left: 0; right: 100%; bottom: 3px; height: 2px; background: var(--landing-blue); transition: .25s ease; }
.landing-nav a:hover::after { right: 0; }
.landing-login-button { justify-self: end; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px; color: #fff; background: var(--landing-blue); border: 0; border-radius: 12px; font-weight: 700; cursor: pointer; box-shadow: 0 10px 24px rgba(7,95,247,.22); transition: transform .2s ease, box-shadow .2s ease; }
.landing-login-button:hover, .landing-primary-button:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(7,95,247,.28); }
.landing-login-button svg { width: 17px; }

.landing-hero { min-height: 710px; max-width: 1240px; margin: 0 auto; padding: 72px 24px 90px; display: grid; grid-template-columns: .92fr 1.08fr; align-items: center; gap: 56px; position: relative; }
.landing-hero::before { content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: rgba(19,204,92,.09); filter: blur(4px); left: -390px; top: 40px; }
.landing-hero-copy { position: relative; z-index: 3; }
.landing-eyebrow, .section-kicker { color: var(--landing-blue); text-transform: uppercase; letter-spacing: .13em; font-size: 12px; font-weight: 800; }
.landing-eyebrow { display: flex; align-items: center; gap: 9px; margin-bottom: 22px; }
.landing-eyebrow span { width: 22px; height: 2px; background: var(--landing-green); }
.landing-hero h1 { margin: 0; color: var(--landing-ink); font-family: 'Lexend', sans-serif; font-size: clamp(49px, 5vw, 72px); line-height: 1.04; letter-spacing: -.05em; font-weight: 750; }
.landing-hero h1 em { color: var(--landing-blue); font-style: normal; }
.landing-hero-copy > p { max-width: 555px; margin: 26px 0 0; color: var(--landing-muted); font-size: 17px; line-height: 1.75; }
.landing-hero-actions { margin-top: 34px; display: flex; align-items: center; gap: 28px; }
.landing-primary-button { border: 0; border-radius: 13px; padding: 0 23px; height: 52px; background: var(--landing-blue); color: #fff; font-weight: 750; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; box-shadow: 0 11px 25px rgba(7,95,247,.2); transition: .2s ease; }
.landing-primary-button svg { width: 18px; }
.landing-text-link { color: #314e65; font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; gap: 7px; }
.landing-text-link svg { width: 16px; }
.landing-trust-row { display: flex; gap: 28px; margin-top: 48px; padding-top: 26px; border-top: 1px solid #dce7f0; }
.landing-trust-row > div { display: flex; align-items: center; gap: 9px; }
.landing-trust-row strong { font-family: 'Lexend'; font-size: 19px; color: var(--landing-ink); }
.landing-trust-row span { font-size: 10px; line-height: 1.35; color: #7b8f9f; text-transform: uppercase; letter-spacing: .05em; }

.landing-hero-visual { position: relative; min-height: 520px; display: flex; align-items: center; justify-content: center; }
.landing-hero-visual::before { content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle at 45% 45%, #ecf7ff 0 38%, #d9eeff 39% 54%, transparent 55%); }
.hero-orbit { position: absolute; border: 1px solid rgba(7,95,247,.15); border-radius: 50%; }
.orbit-one { width: 610px; height: 350px; transform: rotate(-20deg); }
.orbit-two { width: 500px; height: 480px; transform: rotate(23deg); border-color: rgba(24,200,91,.13); }
.product-preview { width: 550px; height: 360px; position: relative; z-index: 3; background: #fff; border: 1px solid rgba(11,77,126,.12); border-radius: 19px; overflow: hidden; box-shadow: 0 30px 80px rgba(15,69,111,.18); transform: perspective(1000px) rotateY(-5deg) rotateX(2deg); }
.preview-topbar { height: 48px; padding: 0 15px; border-bottom: 1px solid #edf2f6; display: flex; align-items: center; gap: 10px; color: #24435a; font-size: 11px; font-weight: 700; }
.preview-brandmark { width: 25px; height: 25px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-weight: 800; background: linear-gradient(135deg, var(--landing-blue), #14ca5b); }
.preview-avatar { margin-left: auto; width: 24px; height: 24px; background: #e4eef7; border-radius: 50%; }
.preview-body { height: calc(100% - 48px); display: flex; }
.preview-sidebar { width: 56px; padding-top: 22px; background: #0758e3; display: flex; align-items: center; flex-direction: column; gap: 20px; }
.preview-sidebar span { width: 17px; height: 17px; border-radius: 5px; background: rgba(255,255,255,.28); }
.preview-sidebar span.active { background: #fff; box-shadow: 0 0 0 7px rgba(255,255,255,.13); }
.preview-content { flex: 1; padding: 22px; background: #f7fafe; }
.preview-heading { display: flex; justify-content: space-between; align-items: center; color: #214058; font-size: 13px; }
.preview-heading span { background: #fff; border: 1px solid #e4edf5; border-radius: 6px; padding: 6px 9px; color: #708698; font-size: 9px; }
.preview-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 15px; }
.preview-stats > div { min-height: 72px; background: #fff; border: 1px solid #ebf0f5; border-radius: 9px; padding: 12px; position: relative; }
.preview-stats small { color: #8394a1; display: block; font-size: 8px; }
.preview-stats strong { display: block; margin-top: 7px; font-size: 14px; color: #163850; }
.preview-stats svg { position: absolute; right: 10px; top: 11px; width: 15px; color: var(--landing-blue); }
.preview-chart-card { margin-top: 12px; background: #fff; border: 1px solid #ebf0f5; border-radius: 9px; padding: 13px 14px 10px; }
.chart-card-head { display: flex; justify-content: space-between; color: #29495f; font-size: 9px; font-weight: 700; }.chart-card-head small { color: #8aa0b0; font-weight: 500; }
.preview-chart { height: 112px; position: relative; margin-top: 10px; overflow: hidden; }
.chart-grid { position: absolute; inset: 0; background: repeating-linear-gradient(to bottom, transparent 0 27px, #edf2f6 28px); }
.chart-bars { position: absolute; inset: 0 8px 0; display: flex; align-items: flex-end; justify-content: space-around; }
.chart-bars i { width: 22px; height: var(--h); border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, #0866f7, #63a5ff); }
.hero-float-card { position: absolute; z-index: 5; border: 1px solid rgba(10,75,120,.1); background: rgba(255,255,255,.93); backdrop-filter: blur(12px); padding: 12px 15px; border-radius: 13px; box-shadow: 0 14px 35px rgba(23,72,109,.15); display: flex; gap: 10px; align-items: center; color: #27475e; font-size: 10px; font-weight: 700; }
.hero-float-card small { display: block; color: var(--landing-green); margin-top: 3px; font-size: 10px; }.hero-float-stock small { color: #7790a0; }
.float-icon { width: 31px; height: 31px; border-radius: 9px; background: #eaf2ff; color: var(--landing-blue); display: grid; place-items: center; }.float-icon.green { color: var(--landing-green); background: #e9fbf0; }.float-icon svg { width: 16px; }
.hero-float-sales { top: 44px; right: 12px; }.hero-float-stock { bottom: 38px; left: -15px; }

.landing-feature-section { padding: 110px max(24px, calc((100vw - 1192px)/2)); background: #fff; }
.section-heading-row { display: flex; justify-content: space-between; align-items: end; gap: 40px; margin-top: 15px; margin-bottom: 50px; }
.section-heading-row h2, .solution-copy h2, .landing-benefits h2 { margin: 0; font-family: 'Lexend'; font-size: clamp(38px, 4vw, 54px); letter-spacing: -.045em; line-height: 1.12; }
.section-heading-row p { max-width: 460px; color: var(--landing-muted); line-height: 1.75; margin: 0 0 4px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature-card { min-height: 310px; padding: 28px; border: 1px solid #dfe9f1; border-radius: 18px; position: relative; overflow: hidden; background: #fbfdff; transition: transform .25s, box-shadow .25s; }.feature-card:hover { transform: translateY(-5px); box-shadow: 0 18px 50px rgba(25,68,101,.1); }
.feature-number { position: absolute; right: 23px; top: 22px; color: #a6b7c4; font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.feature-icon { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; color: var(--landing-blue); background: #eaf2ff; }.feature-icon svg { width: 23px; }
.feature-card h3 { font-family: 'Lexend'; font-size: 20px; margin: 31px 0 10px; letter-spacing: -.025em; }.feature-card p { color: var(--landing-muted); line-height: 1.65; font-size: 14px; margin: 0; }
.feature-card-highlight { background: #075ff7; color: #fff; border-color: #075ff7; }.feature-card-highlight .feature-number { color: rgba(255,255,255,.5); }.feature-card-highlight .feature-icon { color: #fff; background: rgba(255,255,255,.16); }.feature-card-highlight p { color: rgba(255,255,255,.74); }
.mini-order { margin-top: 22px; background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.16); border-radius: 11px; padding: 12px; display: grid; grid-template-columns: 1fr auto; gap: 7px; font-size: 10px; }.mini-order strong { font-size: 11px; }.mini-order small { grid-column: 1/-1; color: #a4ffc7; }.mini-order i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #55eb8e; margin-right: 4px; }
.feature-card-wide { grid-column: span 3; min-height: 245px; display: grid; grid-template-columns: .8fr 1.2fr; align-items: center; gap: 80px; }.feature-card-wide h3 { margin-top: 22px; }.mini-report { height: 155px; padding: 25px 22px 0; display: flex; gap: 16px; align-items: end; border-radius: 15px; background: linear-gradient(180deg,#f0f6ff,#e7f0ff); }.mini-report span { flex: 1; height: var(--v); background: linear-gradient(180deg,#0b69ff,#75adff); border-radius: 8px 8px 2px 2px; }

.landing-solutions { padding: 100px max(24px, calc((100vw - 1192px)/2)); background: #071f34; color: #fff; }
.solution-panel { min-height: 510px; display: grid; grid-template-columns: .8fr 1.2fr; align-items: center; gap: 70px; }.solution-copy .section-kicker { color: #54e48a; }.solution-copy h2 { margin: 18px 0 22px; }.solution-copy > p { color: #9bb0c0; line-height: 1.75; }.solution-copy ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }.solution-copy li { display: flex; gap: 10px; color: #d4e2eb; font-size: 14px; }.solution-copy li svg { width: 17px; color: #53e488; }
.solution-rings { min-height: 420px; position: relative; display: grid; place-items: center; }.ring { position: absolute; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(95,166,255,.3); }.ring span { display: flex; align-items: center; gap: 8px; border-radius: 12px; padding: 11px 14px; background: rgba(15,53,82,.86); border: 1px solid rgba(255,255,255,.12); font-size: 11px; font-weight: 700; box-shadow: 0 12px 30px rgba(0,0,0,.2); }.ring svg { width: 16px; color: #6aa9ff; }.ring-a { width: 390px; height: 390px; }.ring-a span { transform: translate(180px,-25px); }.ring-b { width: 240px; height: 240px; border-color: rgba(55,224,121,.4); }.ring-b::before { content: ''; position: absolute; inset: 32px; border-radius: 50%; background: radial-gradient(circle,rgba(7,95,247,.55),rgba(7,95,247,.06)); }.ring-b span { z-index: 2; font-size: 14px; background: #0861ef; }.ring-b svg { color: #fff; }.ring-c { width: 510px; height: 290px; transform: rotate(25deg); }.ring-c span { transform: translate(-235px,30px) rotate(-25deg); }
.landing-benefits { padding: 90px max(24px, calc((100vw - 1192px)/2)); display: flex; justify-content: space-between; align-items: end; gap: 40px; background: #fff; }.landing-benefits .section-kicker { display: block; margin-bottom: 14px; }
.landing-footer { max-width: 1192px; margin: 0 auto; padding: 34px 0 44px; border-top: 1px solid #e2eaf0; display: grid; grid-template-columns: 120px 1fr auto; align-items: center; gap: 30px; color: #718596; font-size: 12px; }.landing-footer p { margin: 0; }

.login-card { position: relative; }
.login-close-button { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.15); border-radius: 10px; color: #c9d5df; background: rgba(255,255,255,.06); cursor: pointer; z-index: 2; }.login-close-button:hover { color: #fff; background: rgba(255,255,255,.12); }.login-close-button svg { width: 18px; }

@media (max-width: 960px) {
  .landing-header { grid-template-columns: 1fr auto; }.landing-nav { display: none; }
  .landing-hero { grid-template-columns: 1fr; padding-top: 50px; text-align: center; }.landing-eyebrow, .landing-hero-actions, .landing-trust-row { justify-content: center; }.landing-hero-copy > p { margin-left: auto; margin-right: auto; }.landing-hero-visual { min-height: 470px; }
  .section-heading-row { align-items: start; flex-direction: column; }.feature-grid { grid-template-columns: 1fr 1fr; }.feature-card-wide { grid-column: span 2; }
  .solution-panel { grid-template-columns: 1fr; }.solution-copy { text-align: center; }.solution-copy ul { width: fit-content; margin-left: auto; margin-right: auto; }.solution-rings { min-height: 470px; }
  .landing-footer { margin: 0 24px; }
}
@media (max-width: 640px) {
  .landing-header { height: 72px; padding: 0 18px; }.landing-brand { width: 108px; }.landing-login-button { height: 40px; padding: 0 14px; font-size: 13px; }
  .landing-hero { padding: 40px 18px 70px; gap: 22px; min-height: auto; }.landing-hero h1 { font-size: 44px; }.landing-hero-copy > p { font-size: 15px; }.landing-hero-actions { flex-direction: column; gap: 18px; }.landing-trust-row { gap: 15px; flex-wrap: wrap; }.landing-trust-row > div { min-width: 90px; }
  .landing-hero-visual { min-height: 360px; width: 100%; }.product-preview { width: 520px; transform: scale(.62); position: absolute; }.hero-orbit { transform: scale(.7); }.hero-float-card { transform: scale(.84); }.hero-float-sales { right: -18px; top: 25px; }.hero-float-stock { left: -17px; bottom: 20px; }
  .landing-feature-section { padding-top: 75px; padding-bottom: 75px; }.section-heading-row h2, .solution-copy h2, .landing-benefits h2 { font-size: 37px; }.feature-grid { grid-template-columns: 1fr; }.feature-card-wide { grid-column: auto; grid-template-columns: 1fr; gap: 25px; }
  .landing-solutions { padding-top: 75px; padding-bottom: 75px; }.solution-rings { transform: scale(.65); margin: -70px 0; }
  .landing-benefits { padding-top: 70px; padding-bottom: 70px; flex-direction: column; align-items: flex-start; }
  .landing-footer { grid-template-columns: 100px 1fr; }.landing-footer span { grid-column: 1/-1; }.landing-footer p { text-align: right; }
}

/* Final contrast lock: keep the public landing section independent from the app theme. */
#landing-page .landing-solutions {
  color: #173f59;
  background:
    radial-gradient(circle at 76% 48%, rgba(47, 143, 255, .17), transparent 31%),
    radial-gradient(circle at 93% 12%, rgba(38, 213, 129, .14), transparent 25%),
    linear-gradient(135deg, #f8fcff 0%, #eaf6ff 52%, #f4fff9 100%);
}

#landing-page .solution-panel {
  min-height: 540px;
  grid-template-columns: .88fr 1.12fr;
  gap: 76px;
}

#landing-page .solution-copy .section-kicker {
  color: #087d4d;
  background: #e7f9f0;
  border-color: #bdebd4;
}

#landing-page .solution-copy h2 {
  margin: 22px 0 23px;
  color: #082b45 !important;
  font-size: clamp(42px, 4.25vw, 60px);
  line-height: 1.09;
  text-shadow: none;
}

#landing-page .solution-copy > p {
  color: #496b82;
  font-size: 16px;
  line-height: 1.8;
}

#landing-page .solution-copy ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: auto;
  margin-top: 30px;
}

#landing-page .solution-copy li {
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  color: #173f59;
  background: rgba(255, 255, 255, .94);
  border: 1px solid #d0e2ee;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(35, 89, 128, .09);
}

#landing-page .solution-copy li svg {
  width: 17px;
  color: #fff;
}

#landing-page .solution-rings { min-height: 510px; }
#landing-page .solution-grid-glow {
  background: rgba(255,255,255,.62);
  border-color: rgba(45, 126, 185, .17);
  box-shadow: inset 0 0 70px rgba(40, 143, 255, .075), 0 30px 70px rgba(35, 91, 132, .09);
}

#landing-page .ring { border-color: rgba(22, 111, 193, .27); }
#landing-page .ring span {
  color: #16435f;
  background: rgba(255, 255, 255, .96);
  border-color: #cfe1ed;
  box-shadow: 0 12px 28px rgba(24, 81, 123, .14);
}

#landing-page .ring svg { color: #086ee8; }
#landing-page .ring-b { width: 222px; height: 222px; border-color: rgba(28, 200, 116, .46); }
#landing-page .ring-b::before {
  inset: 25px;
  background: radial-gradient(circle at 36% 28%, #3a95ff, #0964ec 56%, #0648b7);
}
#landing-page .ring-b span {
  color: #fff;
  background: #0863ed;
  border-color: rgba(255,255,255,.34);
}
#landing-page .ring-b svg { color: #fff; }

#landing-page .solution-data-node {
  color: #17445f;
  background: rgba(255,255,255,.97);
  border-color: #cee1ed;
}
#landing-page .solution-data-node small { color: #607f94; }

@media (max-width: 960px) {
  #landing-page .solution-panel { grid-template-columns: 1fr; gap: 30px; }
  #landing-page .solution-copy ul { justify-content: center; }
}

@media (max-width: 640px) {
  #landing-page .solution-copy h2 { font-size: 39px; }
  #landing-page .solution-copy ul { display: grid; grid-template-columns: 1fr; width: 100%; }
  #landing-page .solution-copy li { justify-content: center; }
  #landing-page .solution-rings { min-height: 390px; margin: 0; transform: scale(.72); }
}

/* Hero headline: keep complete phrases together instead of orphaning one word. */
#landing-page .landing-hero {
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

#landing-page .landing-hero-copy { min-width: 0; }

#landing-page .landing-hero h1 {
  font-size: clamp(44px, 4.45vw, 64px);
  line-height: 1.08;
  letter-spacing: -.055em;
}

#landing-page .landing-hero h1 em {
  display: inline-block;
  white-space: nowrap;
}

#landing-page .landing-hero h1 br:first-of-type {
  display: block;
}

#landing-page .landing-hero h1 {
  white-space: nowrap;
}

#landing-page .landing-hero-visual { min-width: 0; }
#landing-page .product-preview { width: min(550px, 100%); }

@media (max-width: 960px) {
  #landing-page .landing-hero { grid-template-columns: 1fr; gap: 30px; }
  #landing-page .landing-hero h1 { font-size: clamp(42px, 7vw, 62px); }
}

@media (max-width: 640px) {
  #landing-page .landing-hero h1 { font-size: clamp(34px, 9.5vw, 40px); }
}

@media (max-width: 360px) {
  #landing-page .landing-hero h1 { font-size: 32px; }
}

/* SỔ VIỆT brand meaning at the center of the data system. */
#landing-page .solution-copy > p strong {
  color: #123d59;
  font-weight: 750;
}

#landing-page .ring-b span {
  width: 158px;
  padding: 15px 12px 13px;
  gap: 7px;
  border-radius: 16px;
}

#landing-page .ring-b span b {
  font-family: 'Lexend', sans-serif;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: .055em;
}

#landing-page .ring-b span small {
  display: block;
  flex-basis: 100%;
  color: rgba(255,255,255,.8);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .025em;
  text-align: center;
}

/* =========================================================
   SoVie reusable motion system
   CSS entry states are enabled only after landing-motion.js loads.
   ========================================================= */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

#landing-page {
  --motion-fast: 220ms;
  --motion-normal: 560ms;
  --motion-slow: 720ms;
  --motion-ease: cubic-bezier(.22, 1, .36, 1);
  overflow: clip;
}

#landing-page [id] { scroll-margin-top: 96px; }

.landing-scroll-sentinel {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

#landing-page .landing-header {
  position: sticky;
  top: 0;
  transition:
    opacity var(--motion-normal) var(--motion-ease),
    transform var(--motion-normal) var(--motion-ease),
    background-color 250ms ease,
    border-color 250ms ease,
    box-shadow 250ms ease;
}

#landing-page.motion-ready .landing-header {
  opacity: 0;
  transform: translateY(-14px);
  animation: none;
}

#landing-page.motion-ready.motion-enter .landing-header {
  opacity: 1;
  transform: translateY(0);
}

#landing-page .landing-header.is-scrolled {
  background: rgba(248, 252, 255, .88);
  border-bottom: 1px solid rgba(28, 86, 127, .1);
  box-shadow: 0 10px 30px rgba(22, 69, 102, .07);
  backdrop-filter: blur(16px) saturate(135%);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
}

.hero-title-line { display: block; }

#landing-page.motion-ready [data-hero-item],
#landing-page.motion-ready [data-hero-line] {
  opacity: 0;
  transform: translateY(24px);
  filter: blur(5px);
  transition:
    opacity var(--motion-slow) var(--motion-ease),
    transform var(--motion-slow) var(--motion-ease),
    filter var(--motion-slow) var(--motion-ease);
}

#landing-page.motion-ready [data-hero-item="badge"] {
  transform: translateY(14px);
  transition-duration: 520ms;
  transition-delay: 90ms;
}

#landing-page.motion-ready [data-hero-line]:nth-child(1) { transition-delay: 170ms; }
#landing-page.motion-ready [data-hero-line]:nth-child(2) { transition-delay: 270ms; }
#landing-page.motion-ready [data-hero-item="description"] { transition-delay: 420ms; }
#landing-page.motion-ready [data-hero-item="actions"] {
  transform: translateY(16px) scale(.985);
  transition-delay: 520ms;
}
#landing-page.motion-ready [data-hero-item="stats"] { transition-delay: 610ms; }

#landing-page.motion-ready.motion-enter [data-hero-item],
#landing-page.motion-ready.motion-enter [data-hero-line] {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

#landing-page.motion-ready .landing-hero-copy { animation: none; }

#landing-page.motion-ready [data-hero-dashboard] {
  opacity: 0;
  animation: none;
  will-change: transform, opacity;
}

#landing-page.motion-ready.motion-enter [data-hero-dashboard] {
  animation:
    sovieDashboardEnter 850ms 330ms var(--motion-ease) both,
    sovieDashboardFloat 6.2s 1.25s ease-in-out infinite;
}

#landing-page.motion-ready .hero-float-card {
  opacity: 0;
  animation: none;
  will-change: transform, opacity;
}

#landing-page.motion-ready.motion-enter .hero-float-sales {
  animation:
    sovieCardEnter 600ms 610ms var(--motion-ease) both,
    sovieCardFloatA 5.8s 1.3s ease-in-out infinite;
}

#landing-page.motion-ready.motion-enter .hero-float-stock {
  animation:
    sovieCardEnter 600ms 710ms var(--motion-ease) both,
    sovieCardFloatB 6.4s 1.45s ease-in-out infinite;
}

#landing-page .landing-hero::before {
  will-change: transform, opacity;
  animation: sovieBlobDrift 15s ease-in-out infinite;
}

#landing-page .orbit-one { animation: sovieOrbitDriftOne 16s ease-in-out infinite; }
#landing-page .orbit-two { animation: sovieOrbitDriftTwo 19s ease-in-out infinite; }

#landing-page.motion-ready [data-reveal] {
  --reveal-x: 0px;
  --reveal-y: 30px;
  --reveal-scale: 1;
  opacity: 0;
  transform: translate3d(var(--reveal-x), var(--reveal-y), 0) scale(var(--reveal-scale));
  filter: blur(3px);
  animation: none !important;
  transition:
    opacity var(--motion-normal) var(--motion-ease) var(--reveal-delay, 0ms),
    transform var(--motion-normal) var(--motion-ease) var(--reveal-delay, 0ms),
    filter var(--motion-normal) var(--motion-ease) var(--reveal-delay, 0ms),
    border-color var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease;
  will-change: transform, opacity;
}

#landing-page.motion-ready [data-reveal="left"] { --reveal-x: -34px; --reveal-y: 0px; }
#landing-page.motion-ready [data-reveal="right"] { --reveal-x: 34px; --reveal-y: 0px; }
#landing-page.motion-ready [data-reveal="scale"] { --reveal-y: 25px; --reveal-scale: .98; }

#landing-page.motion-ready [data-reveal].is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0);
  will-change: auto;
}

#landing-page .feature-card {
  transition:
    transform var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease;
}

#landing-page .feature-card.is-visible:hover {
  transform: translateY(-3px);
  border-color: #b9d2fa;
  box-shadow: 0 14px 34px rgba(37, 99, 235, .11);
}

#landing-page .feature-card .feature-icon {
  transition: transform var(--motion-fast) var(--motion-ease);
}

#landing-page .feature-card:hover .feature-icon {
  transform: scale(1.05);
  animation: none;
}

#landing-page .landing-primary-button,
#landing-page .landing-login-button {
  transition:
    transform var(--motion-fast) var(--motion-ease),
    box-shadow var(--motion-fast) ease,
    background-color var(--motion-fast) ease;
}

#landing-page .landing-primary-button:hover,
#landing-page .landing-login-button:hover {
  transform: translateY(-2px) scale(1.02);
}

#landing-page .landing-primary-button::after,
#landing-page .landing-login-button::after {
  left: -45%;
  opacity: 0;
  animation: none;
  transition: left 520ms var(--motion-ease), opacity 160ms ease;
}

#landing-page .landing-primary-button:hover::after,
#landing-page .landing-login-button:hover::after {
  left: 125%;
  opacity: .8;
}

#landing-page .landing-benefits {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

#landing-page .landing-benefits::before {
  content: '';
  position: absolute;
  z-index: -1;
  width: 360px;
  height: 220px;
  right: 8%;
  top: 50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 105, 255, .12), transparent 67%);
  opacity: .65;
  transform: translateY(-50%) scale(.9);
  animation: sovieCtaGlow 8s ease-in-out infinite;
  pointer-events: none;
}

#landing-page .landing-footer img,
#landing-page .landing-footer p,
#landing-page .landing-footer > span {
  transition: opacity var(--motion-normal) var(--motion-ease), transform var(--motion-normal) var(--motion-ease);
}

#landing-page.motion-ready .landing-footer:not(.is-visible) img,
#landing-page.motion-ready .landing-footer:not(.is-visible) p,
#landing-page.motion-ready .landing-footer:not(.is-visible) > span {
  opacity: 0;
  transform: translateY(12px);
}

#landing-page .landing-footer.is-visible p { transition-delay: 70ms; }
#landing-page .landing-footer.is-visible > span { transition-delay: 140ms; }

@keyframes sovieDashboardEnter {
  from { opacity: 0; transform: perspective(1000px) rotateY(-7deg) rotateX(3deg) translateY(30px) scale(.97); }
  to { opacity: 1; transform: perspective(1000px) rotateY(-5deg) rotateX(2deg) translateY(0) scale(1); }
}

@keyframes sovieDashboardFloat {
  0%, 100% { transform: perspective(1000px) rotateY(-5deg) rotateX(2deg) translateY(0); }
  50% { transform: perspective(1000px) rotateY(-5deg) rotateX(2deg) translateY(-5px); }
}

@keyframes sovieCardEnter {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes sovieCardFloatA { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes sovieCardFloatB { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
@keyframes sovieBlobDrift { 0%, 100% { transform: translate3d(0,0,0) scale(1); opacity: .9; } 50% { transform: translate3d(18px,-10px,0) scale(1.04); opacity: .72; } }
@keyframes sovieOrbitDriftOne { 0%, 100% { transform: rotate(-20deg) translate3d(0,0,0); } 50% { transform: rotate(-18deg) translate3d(4px,-3px,0); } }
@keyframes sovieOrbitDriftTwo { 0%, 100% { transform: rotate(23deg) translate3d(0,0,0); } 50% { transform: rotate(21deg) translate3d(-4px,3px,0); } }
@keyframes sovieCtaGlow { 0%, 100% { opacity: .5; transform: translateY(-50%) scale(.9); } 50% { opacity: .78; transform: translateY(-50%) scale(1.05); } }

@media (max-width: 768px) {
  #landing-page.motion-ready [data-reveal] {
    --reveal-x: 0px;
    --reveal-y: 18px;
    filter: blur(1.5px);
  }

  #landing-page.motion-ready [data-hero-item],
  #landing-page.motion-ready [data-hero-line] {
    transform: translateY(16px);
    filter: blur(2px);
  }

  #landing-page.motion-ready.motion-enter [data-hero-item],
  #landing-page.motion-ready.motion-enter [data-hero-line] {
    transform: translateY(0);
    filter: blur(0);
  }

  #landing-page.motion-ready [data-hero-dashboard] {
    transform: translateY(18px) scale(.98);
  }

  #landing-page.motion-ready.motion-enter [data-hero-dashboard] {
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: none;
    transition: opacity 650ms 280ms var(--motion-ease), transform 650ms 280ms var(--motion-ease);
  }

  #landing-page.motion-ready .hero-float-card {
    opacity: 1;
    animation: none;
  }

  #landing-page .landing-benefits::before { animation-duration: 12s; }
  #landing-page .orbit-one,
  #landing-page .orbit-two { animation: none; }
}

@media (max-width: 640px) {
  #landing-page.motion-ready [data-reveal="right"],
  #landing-page.motion-ready [data-reveal="left"] { --reveal-x: 0px; }

  #landing-page.motion-ready .solution-rings[data-reveal] {
    transform: scale(.72) translateY(18px);
  }

  #landing-page.motion-ready .solution-rings[data-reveal].is-visible {
    transform: scale(.72) translateY(0);
  }

  #landing-page .solution-data-node { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  #landing-page *,
  #landing-page *::before,
  #landing-page *::after {
    animation: none !important;
    transition-duration: .01ms !important;
    transition-delay: 0ms !important;
  }

  #landing-page.motion-ready .landing-header,
  #landing-page.motion-ready [data-hero-item],
  #landing-page.motion-ready [data-hero-line],
  #landing-page.motion-ready [data-hero-dashboard],
  #landing-page.motion-ready .hero-float-card,
  #landing-page.motion-ready [data-reveal] {
    opacity: 1 !important;
    filter: none !important;
  }

  #landing-page.motion-ready .landing-header,
  #landing-page.motion-ready [data-hero-item],
  #landing-page.motion-ready [data-hero-line],
  #landing-page.motion-ready [data-reveal] {
    transform: none !important;
  }
}

/* ================================================================
   SOVIE 2026 SYSTEM REFRESH
   Inter typography, white-first surfaces and confident blue accents.
   Kept at the end of the stylesheet to normalize legacy modules.
   ================================================================ */

html,
body,
button,
input,
select,
textarea {
  font-family: var(--font-sans);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

h1, h2, h3, h4, h5, h6,
.page-title,
.panel-title,
.modal-title,
.widget-value,
.summary-heading,
.invoice-card-id,
.empty-state-title {
  font-family: var(--font-sans) !important;
  letter-spacing: -0.025em;
}

/* White navigation lets the transparent full-color logo remain legible. */
.sidebar {
  min-height: 72px;
  background-color: var(--nav-background-color);
  border-bottom: 1px solid #e3eaf3;
  box-shadow: 0 8px 30px rgba(16, 35, 63, 0.08);
}

.brand-project-logo {
  width: 158px;
  height: 56px;
  padding: 0;
  overflow: visible;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.brand-project-logo img,
.login-brand-lockup img,
.landing-brand img,
.landing-footer img {
  object-fit: contain;
  background: transparent;
}

.nav-link,
.purchase-menu-trigger,
.staff-menu-trigger {
  color: var(--nav-foreground-color) !important;
  font-weight: 600;
}

.purchase-menu-trigger svg,
.staff-menu-trigger svg {
  color: currentColor !important;
  stroke: currentColor !important;
}

.sidebar > .nav-menu > .nav-item > .nav-link:hover,
.sidebar > .nav-menu > .nav-item > .nav-link.active {
  color: var(--color-primary) !important;
  background: var(--nav-active-background) !important;
}

.sidebar > .nav-menu > .nav-item > .nav-link.active svg {
  color: var(--color-primary) !important;
  stroke: currentColor !important;
}

.sidebar .activity-header-button,
.sidebar .btn-settings-toggle {
  border-color: #d8e3f2 !important;
  background: var(--nav-control-background) !important;
  color: var(--color-primary) !important;
  box-shadow: none;
}

.sidebar .activity-header-button svg,
.sidebar .btn-settings-toggle svg {
  color: currentColor !important;
  stroke: currentColor !important;
}

.main-content {
  margin-top: 72px;
  min-height: calc(100vh - 72px);
  padding: 1.25rem 1.5rem 2rem;
}

.top-header {
  padding: 0.35rem 0 1rem;
  border-bottom-color: #e3eaf3;
}

.page-title,
.panel-title,
.widget-value {
  color: var(--text-primary) !important;
}

.glass-panel,
.widget-card,
.summary-card,
.table-container,
.invoice-card,
.report-card,
.modal-content,
.global-settings-menu,
.purchase-menu,
.staff-menu,
.customer-column-picker-popover {
  background: #ffffff;
  border-color: var(--border-color);
  box-shadow: var(--shadow-sm);
}

.glass-panel,
.widget-card,
.summary-card,
.report-card {
  border-radius: 14px;
}

.widget-card:hover,
.glass-panel:hover {
  border-color: #c8d8ee;
  box-shadow: var(--shadow-md);
}

.widget-card:hover {
  transform: translateY(-2px);
}

.form-control,
.form-control-search,
.searchable-select-trigger,
.price-list-picker summary {
  min-height: 42px;
  background-color: #ffffff;
  border-color: #ccd8e7;
  border-radius: 10px;
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(16, 35, 63, 0.03);
}

.form-control:hover,
.form-control-search:hover,
.searchable-select-trigger:hover {
  border-color: #9db4d2;
}

.form-control:focus,
.form-control-search:focus,
.searchable-select-trigger:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--border-focus);
}

select option {
  background: #ffffff;
  color: var(--text-primary);
}

.btn {
  min-height: 40px;
  border-radius: 10px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.btn-primary {
  background: linear-gradient(135deg, #2f6feb 0%, #1d4ed8 100%);
  color: #ffffff !important;
  box-shadow: 0 7px 18px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-secondary);
  border: 1px solid #ccd8e7;
}

.btn-secondary:hover {
  background: #f4f7fb;
  border-color: #9db4d2;
}

.btn-success {
  background-color: #e9f9f0;
  color: #15803d !important;
  border-color: #a7e4bf;
  box-shadow: 0 5px 14px rgba(21, 128, 61, 0.08);
}

.btn-success:hover:not(:disabled) {
  background-color: #d9f4e5;
  border-color: #75cf99;
  color: #11652f !important;
}

.widget-icon-emerald {
  background-color: #e9f9f0;
  color: #15803d;
}

table thead th,
.data-table thead th,
.price-matrix-table thead th,
.price-matrix-table thead .sticky-col {
  background: #f4f7fb !important;
  color: #42566f;
  font-weight: 700;
  border-bottom-color: #d9e3ef;
}

table tbody tr:hover td {
  background-color: #f7faff;
}

.badge,
.status-badge,
.db-status-badge,
.price-type-badge {
  border-radius: 999px;
}

.modal-overlay {
  background: rgba(16, 35, 63, 0.48);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.modal-content {
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  background: #ffffff;
  border-bottom-color: var(--border-color);
}

.modal-close:hover {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

/* Login workspace: visual overview on the left, authentication form on the right. */
.login-overlay {
  overflow: auto;
  padding: clamp(12px, 1.4vw, 22px);
  background: #071827;
}

.login-card {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(500px, .92fr);
  width: min(1200px, calc(100vw - 96px));
  max-width: 1200px;
  height: clamp(760px, calc(100vh - 96px), 800px);
  min-height: 760px;
  padding: 0;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(132, 180, 221, .35);
  border-radius: 24px;
  box-shadow: 0 32px 90px rgba(0, 12, 30, .34);
}

.login-showcase {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #ffffff;
  background:
    radial-gradient(circle at 100% 47%, rgba(0, 234, 220, .82) 0, rgba(0, 176, 217, .34) 15%, transparent 38%),
    radial-gradient(circle at 77% 28%, rgba(0, 105, 213, .35), transparent 34%),
    linear-gradient(145deg, #041427 0%, #05294e 56%, #064172 100%);
}

.login-showcase::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: .22;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to right, #000, transparent 92%);
}

.login-showcase-orbits,
.login-showcase-orbits i {
  position: absolute;
  pointer-events: none;
}

.login-showcase-orbits {
  inset: 0;
  z-index: -1;
}

.login-showcase-orbits i {
  right: -24%;
  top: 50%;
  width: 54%;
  aspect-ratio: 1;
  border: 1px solid rgba(88, 195, 255, .2);
  border-radius: 50%;
  transform: translateY(-50%) scale(var(--orbit-scale, 1));
  box-shadow: 0 -115px 0 -113px #49efff, 0 115px 0 -113px #7bc8ff;
}

.login-showcase-orbits i:nth-child(2) { --orbit-scale: .76; }
.login-showcase-orbits i:nth-child(3) { --orbit-scale: .53; }
.login-showcase-orbits i:nth-child(4) { --orbit-scale: .3; }

.login-showcase-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: clamp(38px, 3.6vw, 48px);
}

.login-showcase-logo {
  display: block;
  width: clamp(126px, 10vw, 148px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 26px rgba(0, 0, 0, .18));
}

.login-showcase-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 24px;
  color: rgba(255, 255, 255, .9);
  font-size: 13px;
}

.login-showcase-kicker svg,
.login-showcase-footer svg {
  width: 20px;
  color: #32e799;
}

.login-showcase h2 {
  max-width: 590px;
  margin: 0;
  color: #ffffff !important;
  font-size: clamp(42px, 3.9vw, 52px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.055em;
}

.login-showcase h2 span {
  color: #39e294;
}

.login-showcase-description {
  max-width: 610px;
  margin: 17px 0 22px;
  color: rgba(232, 243, 255, .84);
  font-size: 13px;
  line-height: 1.65;
}

.login-benefit-list {
  display: grid;
  max-width: 590px;
  gap: 8px;
}

.login-benefit-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 13px;
  min-height: 70px;
  padding: 10px 14px;
  border: 1px solid rgba(99, 190, 255, .27);
  border-radius: 16px;
  background: rgba(2, 37, 69, .46);
  backdrop-filter: blur(10px);
}

.login-benefit-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #31e59a;
  border-radius: 50%;
  background: rgba(35, 225, 181, .1);
}

.login-benefit-icon svg { width: 23px; height: 23px; }
.login-benefit-item strong { display: block; margin-bottom: 3px; color: #fff; font-size: 13px; }
.login-benefit-item small { display: block; color: #acc2d8; font-size: 11px; line-height: 1.4; }

.login-showcase-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: auto 0 0;
  padding-top: 20px;
  color: #9fb5ca;
  font-size: 11px;
}

.login-form-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 52px clamp(46px, 4.6vw, 64px) 40px;
  background:
    radial-gradient(circle at 88% 12%, rgba(37, 99, 235, .035), transparent 25%),
    #ffffff;
}

.login-form-shell {
  width: min(100%, 430px);
}

.login-brand-lockup {
  justify-content: flex-start;
  width: min(320px, 92%);
  min-height: 60px;
  margin: 0 0 24px;
  padding: 0;
  overflow: visible;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.login-brand-lockup img {
  width: min(155px, 100%);
  max-height: 60px;
  object-position: left center;
}

.login-welcome {
  margin: 0 0 12px;
  color: #1261eb;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}

.login-header h2 {
  margin: 0;
  color: #0f172a !important;
  font-size: clamp(27px, 2.5vw, 32px) !important;
  font-weight: 800 !important;
  line-height: 1.15;
  letter-spacing: -.04em;
  text-align: left !important;
}

.login-subtitle {
  margin: 11px 0 25px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#login-maintenance-notice {
  display: none;
  padding: 12px 14px;
  color: #92400e;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  border: 1px solid #f6d58b;
  border-radius: 10px;
  background: #fff8e6;
}

#login-maintenance-notice[data-tone="help"] {
  color: #1e4f91;
  border-color: #bed5f5;
  background: #eef6ff;
}

.login-field-group { margin: 0; }
.login-field-group .form-label { margin-bottom: 8px; color: #162033; font-size: 12px; font-weight: 700; }

.login-input-wrap {
  position: relative;
}

.login-input-wrap > svg {
  position: absolute;
  top: 50%;
  left: 17px;
  z-index: 2;
  width: 19px;
  height: 19px;
  color: #7890ac;
  transform: translateY(-50%);
  pointer-events: none;
}

.login-input-wrap .form-control {
  width: 100% !important;
  height: 52px !important;
  padding: 0 16px 0 50px !important;
  color: #101b2e !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  border: 1px solid #cad8e8 !important;
  border-radius: 11px !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

.login-input-wrap .form-control:focus {
  border-color: #4a89f5 !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .1) !important;
}

.login-form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: -4px;
}

.login-remember {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #334155;
  font-size: 12px;
  cursor: pointer;
}

.login-remember input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #1764ee;
}

.login-forgot-button {
  padding: 3px 0;
  color: #1261eb;
  font: inherit;
  font-size: 12px;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  cursor: pointer;
}

.login-submit-button {
  display: grid !important;
  grid-template-columns: 30px 1fr 30px;
  align-items: center;
  width: 100%;
  min-height: 56px;
  margin-top: 3px;
  padding: 0 25px !important;
  color: #fff !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  border: 0 !important;
  border-radius: 11px !important;
  background: linear-gradient(135deg, #1466f4, #0757ea) !important;
  box-shadow: 0 16px 32px rgba(21, 93, 235, .23) !important;
}

.login-submit-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 19px 38px rgba(21, 93, 235, .28) !important;
}

.login-submit-button svg { width: 22px; height: 22px; }
.login-submit-button svg:last-child { justify-self: end; }
.login-submit-loading { grid-column: 1 / -1; display: inline-flex; align-items: center; justify-content: center; }

.login-security-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 24px 0 0;
  color: #657a93;
  font-size: 11px;
}

.login-security-note svg { width: 20px; color: #0ca76c; }

.login-close-button {
  top: 20px;
  right: 20px;
  width: 42px;
  height: 42px;
  color: #526a85;
  border: 1px solid #d7e2ee;
  border-radius: 14px;
  background: #ffffff;
}

.login-close-button:hover {
  color: #1261eb;
  border-color: #bfd2ec;
  background: #f2f7ff;
}

.login-close-button svg { width: 20px; height: 20px; }

@media (min-width: 1280px) {
  .login-card {
    width: clamp(1180px, calc(100vw - 128px), 1200px);
  }
}

@media (max-width: 1100px) {
  .login-card { grid-template-columns: minmax(0, .82fr) minmax(470px, 1.18fr); }
  .login-showcase-content { padding: 42px; }
  .login-showcase h2 { font-size: 48px; }
  .login-benefit-item:nth-child(3) { display: none; }
}

@media (max-width: 820px) {
  .login-overlay { padding: 0; background: #fff; }
  .login-card { display: block; width: 100%; max-width: 100%; min-height: 100vh; border: 0; border-radius: 0; box-shadow: none; }
  .login-showcase { display: none; }
  .login-form-panel { align-items: flex-start; width: 100%; max-width: 100%; min-height: 100vh; padding: 88px 24px 38px; overflow-x: hidden; }
  .login-form-shell { width: min(100%, 520px); min-width: 0; }
  .login-input-wrap, .login-input-wrap .form-control { max-width: 100%; box-sizing: border-box; }
  .login-form-options { flex-wrap: wrap; gap: 10px 18px; }
  .login-close-button { top: 18px; right: 18px; width: 44px; height: 44px; }
}

/* Public experience follows the same type and white/blue product language. */
.landing-page {
  --landing-ink: #10233f;
  --landing-muted: #607188;
  --landing-blue: #2563eb;
  --landing-green: #0ea5a4;
  background: #ffffff;
  font-family: var(--font-sans);
}

#landing-page .landing-hero h1,
#landing-page .section-heading-row h2,
#landing-page .solution-copy h2,
#landing-page .landing-benefits h2,
#landing-page .feature-card h3,
#landing-page .landing-trust-row strong,
#landing-page .landing-footer-company > strong,
#landing-page .landing-footer-meta strong {
  font-family: var(--font-sans) !important;
}

.landing-header {
  height: 92px;
}

.landing-brand {
  width: 164px;
}

.landing-brand,
.landing-footer-brand {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.landing-login-button,
.landing-primary-button {
  background: linear-gradient(135deg, #2f6feb 0%, #1d4ed8 100%);
  box-shadow: 0 11px 26px rgba(37, 99, 235, 0.22);
}

@media (min-width: 769px) {
  .sidebar {
    height: 72px !important;
    min-height: 72px !important;
    padding: 0 1.25rem !important;
  }

  .main-content {
    margin-top: 72px !important;
    padding-top: 1.25rem !important;
  }
}

@media (max-width: 768px) {
  .brand-project-logo {
    width: 138px !important;
    height: 48px !important;
    padding: 0 !important;
  }

  .login-card {
    padding: 0;
    border-radius: 0;
  }

  .login-brand-lockup {
    width: min(260px, 92%);
    min-height: 72px;
    padding: 0;
  }

  .landing-brand {
    width: 132px;
  }

  #landing-page .landing-topbar-inner {
    gap: 12px;
    padding-inline: 18px;
  }

  #landing-page .landing-topbar-brand {
    display: none;
  }

  #landing-page .landing-topbar-company {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #landing-page .landing-topbar-phone {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

/* ================================================================
   VISUAL DEPTH PASS
   Adds hierarchy and brand color so the light UI never feels washed out.
   ================================================================ */
:root {
  --bg-primary: #edf3fb;
  --bg-surface-hover: #eef5ff;
  --border-color: #d4e0ef;
  --nav-background-color: #edf4ff;
  --nav-foreground-color: #1f3048;
  --nav-control-background: #dfeaff;
  --nav-active-background: #dce9ff;
  --shadow-sm: 0 2px 5px rgba(20, 47, 84, 0.06), 0 8px 24px rgba(37, 99, 235, 0.055);
  --shadow-md: 0 14px 38px rgba(25, 58, 105, 0.12);
}

body {
  background:
    radial-gradient(circle at 4% 4%, rgba(37, 99, 235, 0.11), transparent 28rem),
    radial-gradient(circle at 96% 86%, rgba(14, 165, 164, 0.075), transparent 32rem),
    #edf3fb;
}

.sidebar {
  background: linear-gradient(105deg, #f9fbff 0%, #edf4ff 48%, #e5efff 100%) !important;
  border-bottom: 1px solid #cbd9ec !important;
  box-shadow: 0 8px 28px rgba(24, 58, 105, 0.12);
}

.sidebar > .nav-menu > .nav-item > .nav-link:hover {
  color: #1d4ed8 !important;
  background: rgba(37, 99, 235, 0.1) !important;
}

.sidebar > .nav-menu > .nav-item > .nav-link.active {
  color: #ffffff !important;
  background: linear-gradient(135deg, #3677ee 0%, #2459d6 100%) !important;
  box-shadow: 0 7px 18px rgba(37, 99, 235, 0.24);
}

.sidebar > .nav-menu > .nav-item > .nav-link.active svg {
  color: #ffffff !important;
  stroke: currentColor !important;
}

.sidebar .activity-header-button,
.sidebar .btn-settings-toggle {
  background: rgba(255, 255, 255, 0.68) !important;
  border-color: #c8d8ee !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

.main-content {
  background:
    linear-gradient(180deg, rgba(226, 237, 252, 0.72) 0, rgba(237, 243, 251, 0) 280px),
    radial-gradient(circle at 86% 12%, rgba(37, 99, 235, 0.055), transparent 25rem);
}

.top-header {
  position: relative;
  border-bottom-color: #ccdaec;
}

.top-header::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 72px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #0ea5a4);
}

.page-title {
  color: #0d2a52 !important;
}

.glass-panel,
.summary-card,
.table-container,
.invoice-card,
.report-card {
  background: linear-gradient(145deg, #ffffff 0%, #fbfdff 68%, #f5f9ff 100%);
  border-color: #cfdded;
  box-shadow: var(--shadow-sm);
}

.dashboard-toolbar {
  border-left: 4px solid #2563eb;
  background:
    linear-gradient(110deg, rgba(37, 99, 235, 0.055), transparent 24%),
    linear-gradient(145deg, #ffffff, #f7faff) !important;
  box-shadow: 0 12px 34px rgba(31, 70, 124, 0.1);
}

.dashboard-toolbar .filter-label svg {
  color: #2563eb;
}

.form-control,
.form-control-search,
.searchable-select-trigger,
.price-list-picker summary {
  background: #fbfdff;
  border-color: #c4d3e6;
}

.widgets-grid {
  gap: 1.15rem;
}

.widgets-grid .widget-card {
  position: relative;
  overflow: hidden;
  min-height: 100px;
  border: 1px solid #cedced;
  border-top-width: 3px;
  box-shadow: 0 10px 28px rgba(26, 61, 108, 0.09);
}

.widgets-grid .widget-card::after {
  content: "";
  position: absolute;
  width: 110px;
  height: 110px;
  right: -52px;
  bottom: -64px;
  border-radius: 50%;
  opacity: 0.55;
  pointer-events: none;
}

.widgets-grid .widget-card:nth-child(1) {
  border-top-color: #16a56a;
  background: linear-gradient(135deg, #ffffff 48%, #edfdf5 100%);
}
.widgets-grid .widget-card:nth-child(1)::after { background: #baf2d6; }

.widgets-grid .widget-card:nth-child(2) {
  border-top-color: #2563eb;
  background: linear-gradient(135deg, #ffffff 48%, #edf4ff 100%);
}
.widgets-grid .widget-card:nth-child(2)::after { background: #c7dafe; }

.widgets-grid .widget-card:nth-child(3) {
  border-top-color: #ef5b67;
  background: linear-gradient(135deg, #ffffff 48%, #fff1f3 100%);
}
.widgets-grid .widget-card:nth-child(3)::after { background: #ffd1d6; }

.widgets-grid .widget-card:nth-child(4) {
  border-top-color: #0ea5a4;
  background: linear-gradient(135deg, #ffffff 48%, #eafbfa 100%);
}
.widgets-grid .widget-card:nth-child(4)::after { background: #bcecea; }

.widget-label {
  color: #526780;
  font-weight: 600;
}

.widget-value {
  color: #102b52 !important;
}

.widget-icon-wrapper {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.74);
  box-shadow: 0 7px 18px rgba(24, 58, 105, 0.1);
}

.chart-panel {
  border-top: 3px solid #2563eb;
}

.top-products-panel {
  border-top: 3px solid #0ea5a4;
}

.chart-controls {
  background: #eef3fa !important;
  border: 1px solid #dce5f0;
}

.top-product-item {
  background: linear-gradient(105deg, #f9fbff, #f2f7ff);
  border-color: #d2dfef;
}

.top-product-item:hover {
  background: #edf4ff;
  border-color: #9ebae1;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.09);
}

.top-product-progress-bg {
  background: #dfe8f3;
}

.dashboard-insight-card {
  border-top: 3px solid #9fb9dc;
}

.dashboard-insight-company { border-top-color: #2563eb; }
.dashboard-insight-brand { border-top-color: #0ea5a4; }
.dashboard-insight-salesperson { border-top-color: #7c3aed; }
.dashboard-insight-customer { border-top-color: #f59e0b; }

table thead th,
.data-table thead th,
.price-matrix-table thead th,
.price-matrix-table thead .sticky-col {
  background: linear-gradient(180deg, #edf4fc, #e6eef9) !important;
  color: #294565;
}

@media (max-width: 768px) {
  .main-content {
    background: linear-gradient(180deg, rgba(225, 237, 253, 0.78), rgba(237, 243, 251, 0) 240px);
  }

  .dashboard-toolbar {
    border-left-width: 3px;
  }
}

/* Asymmetric navigation wash: quiet behind the logo, richer on the right. */
.sidebar {
  background:
    radial-gradient(ellipse 34% 145% at 100% 50%, rgba(19, 65, 177, 0.72) 0%, rgba(32, 88, 207, 0.38) 48%, transparent 100%),
    linear-gradient(102deg, #fbfdff 0%, #f5f9ff 16%, #eaf2ff 38%, #d5e5ff 62%, #8db2f5 82%, #356bd7 100%) !important;
  border-bottom-color: #b9ccec !important;
  box-shadow: 0 9px 30px rgba(24, 67, 145, 0.18);
}

.brand {
  position: relative;
  z-index: 2;
}

.brand::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -8px -30px -8px -18px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.sidebar-actions {
  padding: 0.3rem 0.15rem 0.3rem 0.55rem;
}

.sidebar .activity-header-button,
.sidebar .btn-settings-toggle {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.16) !important;
  border-color: rgba(255, 255, 255, 0.44) !important;
  box-shadow: 0 6px 16px rgba(12, 45, 119, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.sidebar .activity-header-button:hover,
.sidebar .btn-settings-toggle:hover {
  background: rgba(255, 255, 255, 0.27) !important;
  border-color: rgba(255, 255, 255, 0.72) !important;
}

@media (max-width: 1100px) {
  .sidebar {
    background:
      radial-gradient(ellipse 38% 145% at 100% 50%, rgba(19, 65, 177, 0.68), transparent 100%),
      linear-gradient(102deg, #fbfdff 0%, #eef5ff 34%, #c9ddff 66%, #356bd7 100%) !important;
  }
}

/* ================================================================
   MODERN ORDER BUILDER
   Color-coded work areas for faster product entry and checkout.
   ================================================================ */
#invoice-panel {
  --invoice-blue: #2563eb;
  --invoice-cyan: #0891b2;
  --invoice-teal: #0f9f88;
  --invoice-indigo: #4f46e5;
  --invoice-amber: #d97706;
}

#invoice-panel .invoice-grid {
  gap: 1.25rem;
}

#invoice-panel .invoice-products-card,
#invoice-panel .summary-card {
  position: relative;
  overflow: visible;
  border: 1px solid #cbdced;
  box-shadow: 0 16px 42px rgba(25, 61, 112, 0.11);
}

#invoice-panel .invoice-products-card {
  padding: 1.4rem;
  border-top: 4px solid var(--invoice-blue);
  background:
    radial-gradient(circle at 96% 0%, rgba(37, 99, 235, 0.1), transparent 18rem),
    linear-gradient(145deg, #ffffff 0%, #f8fbff 100%);
}

#invoice-panel .invoice-products-card > .panel-title,
#invoice-panel .summary-heading {
  color: #12335d !important;
  font-size: 1.08rem;
}

#invoice-panel .invoice-products-card > .panel-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

#invoice-panel .invoice-products-card > .panel-title svg,
#invoice-panel .summary-heading svg {
  width: 34px;
  height: 34px;
  padding: 8px;
  color: #ffffff;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #2457d6);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.23);
}

#invoice-panel .invoice-products-card > .panel-title::after,
#invoice-panel .summary-heading::after {
  margin-left: auto;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

#invoice-panel .invoice-products-card > .panel-title::after {
  content: "BƯỚC 1";
  color: #1d4ed8;
  background: #e6efff;
  border: 1px solid #bfd3fb;
}

#invoice-panel .product-select-row {
  width: 100%;
  max-width: none !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem !important;
  margin-bottom: 1.15rem !important;
  padding: 0.8rem;
  border: 1px solid #cfe0f5;
  border-radius: 13px;
  background: linear-gradient(105deg, #edf5ff, #f7fbff);
}

#invoice-panel .product-select-row .custom-input-group,
#invoice-panel .summary-card .custom-input-group {
  min-height: 46px;
  border: 1px solid #b9cee7;
  border-radius: 11px;
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(32, 68, 116, 0.05);
}

#invoice-panel .product-select-row .custom-input-group:focus-within,
#invoice-panel .summary-card .custom-input-group:focus-within {
  border-color: var(--invoice-blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.13);
}

#invoice-panel #btn-add-to-invoice-table {
  min-width: 108px;
  min-height: 46px;
  background: linear-gradient(135deg, #3478f2, #2457d6);
  box-shadow: 0 9px 20px rgba(37, 99, 235, 0.24);
}

#invoice-panel .table-responsive {
  border: 1px solid #cbd9ea;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 7px 20px rgba(26, 61, 108, 0.055);
}

#invoice-panel .invoice-items-table {
  margin: 0;
}

#invoice-panel .invoice-items-table thead th {
  padding-top: 0.85rem !important;
  padding-bottom: 0.85rem !important;
  color: #284664 !important;
  background: linear-gradient(180deg, #eaf3ff, #dfeaf8) !important;
  border-bottom: 1px solid #bfd0e5;
  font-size: 0.78rem !important;
  letter-spacing: 0.015em;
}

#invoice-panel .invoice-items-table tbody tr {
  transition: background-color 0.16s ease, box-shadow 0.16s ease;
}

#invoice-panel .invoice-items-table tbody tr:nth-child(even):not(#invoice-empty-row) td {
  background: #f8fbff;
}

#invoice-panel .invoice-items-table tbody tr:hover td {
  background: #edf5ff;
}

#invoice-panel #invoice-empty-row td {
  min-height: 150px;
  color: #60758e !important;
  background:
    radial-gradient(circle at 50% 45%, rgba(37, 99, 235, 0.08), transparent 9rem),
    #fbfdff;
}

#invoice-panel .form-control-inline {
  border-color: #b9cce3 !important;
  border-radius: 8px !important;
  background: #ffffff !important;
}

#invoice-panel .invoice-item-drag-handle:hover {
  color: var(--invoice-blue);
  background: #e7f0ff;
}

#invoice-panel .summary-card {
  top: 84px;
  padding: 1.35rem;
  border-top: 4px solid var(--invoice-teal);
  background:
    radial-gradient(circle at 100% 0%, rgba(15, 159, 136, 0.09), transparent 18rem),
    linear-gradient(145deg, #ffffff, #f8fcfb);
}

#invoice-panel .invoice-summary-header {
  margin: -0.15rem -0.15rem 1.1rem !important;
  padding: 0 0 0.9rem !important;
  border-bottom-color: #cbdced !important;
}

#invoice-panel .summary-heading {
  flex: 1;
}

#invoice-panel .summary-heading::after {
  content: "BƯỚC 2";
  color: #087a69;
  background: #def7f0;
  border: 1px solid #a9e5d6;
}

#invoice-panel .summary-heading svg {
  background: linear-gradient(135deg, #14b8a6, #0f8b7a);
  box-shadow: 0 8px 18px rgba(15, 159, 136, 0.22);
}

#invoice-panel #btn-reset-order {
  color: #526780;
  background: #f3f6fa;
  border-color: #cbd8e7;
}

#invoice-panel .summary-card-grid {
  gap: 1.1rem;
}

#invoice-panel .invoice-totals-column {
  min-width: 0;
  padding: 1rem;
  border-radius: 14px;
}

#invoice-panel .invoice-totals-column {
  border: 1px solid #c9e4dc;
  background: linear-gradient(145deg, #f8fffc, #edf9f5);
}

#invoice-panel .invoice-totals-column .label {
  color: #294866 !important;
}

#invoice-panel #invoice-customer-info-card {
  border-left: 4px solid var(--invoice-blue) !important;
  border-color: #aac8ef !important;
  background: linear-gradient(135deg, #edf5ff, #f8fbff) !important;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.08);
}

#invoice-panel #invoice-business-date-group {
  border-left: 4px solid var(--invoice-teal) !important;
  background: #edfbf6 !important;
}

#invoice-panel .invoice-totals-column > .summary-row:not(.total-row) {
  min-height: 36px;
  margin-bottom: 0.35rem;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
}

#invoice-panel .invoice-totals-column > .summary-row:nth-child(odd):not(.total-row) {
  background: rgba(255, 255, 255, 0.66);
}

#invoice-panel .summary-input-row {
  border: 1px solid #d5e1eb;
  background: #ffffff !important;
}

#invoice-panel .summary-input-row .form-control {
  min-height: 34px;
  border-radius: 8px;
}

#invoice-panel .summary-row.total-row {
  margin: 0.65rem 0 0.9rem !important;
  padding: 0.9rem 0.85rem !important;
  border: 0 !important;
  border-radius: 12px;
  background: linear-gradient(135deg, #174ea6, #2563eb 62%, #168da0);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.22);
}

#invoice-panel .summary-row.total-row .label,
#invoice-panel .summary-row.total-row .value-final {
  color: #ffffff !important;
}

#invoice-panel .summary-row.total-row .value-final {
  display: block;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}

#invoice-panel .summary-row.total-row .value-market {
  color: rgba(255, 255, 255, 0.7);
}

#invoice-panel .invoice-checkout-actions {
  padding-top: 0.15rem;
}

#invoice-panel .invoice-checkout-actions .btn {
  min-height: 45px;
  border-radius: 11px;
  font-weight: 750;
}

#invoice-panel #btn-save-order {
  background: linear-gradient(135deg, #16a56a, #087f5b);
  box-shadow: 0 10px 22px rgba(13, 148, 94, 0.23);
}

#invoice-panel #btn-draft-order {
  color: #9a5a08;
  border: 1px solid #e8bd71;
  background: linear-gradient(135deg, #fffaf0, #fff2d7);
}

#invoice-panel #btn-print-order {
  color: #ffffff;
  border: 0;
  background: linear-gradient(135deg, #6760e9, #4338ca);
  box-shadow: 0 9px 20px rgba(79, 70, 229, 0.2);
}

@media (max-width: 992px) {
  #invoice-panel .summary-card {
    position: relative;
    top: auto;
  }
}

@media (max-width: 640px) {
  #invoice-panel .invoice-products-card,
  #invoice-panel .summary-card {
    padding: 1rem;
    border-radius: 13px;
  }

  #invoice-panel .product-select-row {
    grid-template-columns: 1fr;
  }

  #invoice-panel #btn-add-to-invoice-table {
    width: 100%;
  }

  #invoice-panel .invoice-summary-header {
    align-items: flex-start !important;
    gap: 0.75rem;
  }

  #invoice-panel .invoice-products-card > .panel-title::after,
  #invoice-panel .summary-heading::after {
    display: none;
  }

  #invoice-panel .invoice-totals-column {
    padding: 0.75rem;
  }
}

/* Order builder layout only: split on wide screens, summary-first when stacked. */
@media (min-width: 1180px) {
  #invoice-panel .invoice-grid {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(380px, 0.9fr);
    align-items: start;
    gap: 1.15rem;
  }

  #invoice-panel .invoice-builder {
    grid-column: 1;
    min-width: 0;
  }

  #invoice-panel .summary-card {
    grid-column: 2;
    min-width: 0;
    position: sticky;
    top: 84px;
  }

  #invoice-panel .summary-card-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.9rem;
  }

  #invoice-panel .invoice-products-card {
    min-height: 560px;
  }
}

@media (max-width: 1179px) {
  #invoice-panel .invoice-grid {
    display: flex;
    flex-direction: column;
  }

  #invoice-panel .summary-card {
    order: 1;
    position: relative;
    top: auto;
  }

  #invoice-panel .invoice-builder {
    order: 2;
  }

  #invoice-panel .summary-heading::after {
    content: "BƯỚC 1";
  }

  #invoice-panel .invoice-products-card > .panel-title::after {
    content: "BƯỚC 2";
  }
}

/* Order context cards follow the three-panel order-entry layout. */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

#invoice-panel .invoice-order-context {
  display: grid;
  grid-template-columns: minmax(280px, 1.15fr) minmax(220px, 0.85fr) minmax(280px, 1.15fr);
  align-items: stretch;
  gap: 0.8rem;
  margin-bottom: 1.1rem;
}

#invoice-panel .invoice-order-context:has(> #invoice-business-date-group[style*="display: none"]) {
  grid-template-columns: minmax(300px, 1fr) minmax(300px, 1fr);
}

#invoice-panel .invoice-context-card {
  min-width: 0;
  margin: 0 !important;
  padding: 0.9rem;
  border: 1px solid #d6e3f1;
  border-radius: 14px;
  background: linear-gradient(145deg, #ffffff, #f8fbff);
  box-shadow: 0 8px 22px rgba(32, 73, 118, 0.06);
}

#invoice-panel .invoice-context-card-header {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

#invoice-panel .invoice-context-title {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 0.5rem;
  color: #244565 !important;
  font-size: 0.86rem !important;
  font-weight: 800 !important;
}

#invoice-panel .invoice-context-icon {
  width: 28px;
  height: 28px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: #2563eb;
  background: #eaf2ff;
}

#invoice-panel .invoice-context-icon svg {
  width: 15px;
  height: 15px;
}

#invoice-panel .invoice-context-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

#invoice-panel #btn-clear-invoice-customer {
  min-height: 30px;
  padding: 0 0.55rem;
  border-radius: 8px;
  font-size: 0.7rem;
  white-space: nowrap;
}

#invoice-panel #btn-clear-invoice-customer svg {
  width: 13px;
  height: 13px;
}

#invoice-panel .invoice-context-add-button {
  width: 30px;
  height: 30px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  color: #1f5ed2;
  background: #e8f0ff;
  cursor: pointer;
  transition: transform 160ms ease, color 160ms ease, background 160ms ease;
}

#invoice-panel .invoice-context-add-button:hover {
  color: #ffffff;
  background: #2563eb;
  transform: translateY(-1px);
}

#invoice-panel .invoice-context-add-button svg {
  width: 17px;
  height: 17px;
}

#invoice-panel #invoice-customer-search-group {
  position: relative;
  display: block;
  margin: 0 0 0.55rem !important;
  padding: 0;
  border: 0;
  background: transparent;
}

#invoice-panel .invoice-order-context .custom-input-group {
  min-height: 42px;
  border-color: #c7d7e8;
  border-radius: 9px;
  background: #ffffff;
}

#invoice-panel .invoice-order-context .custom-input-group > svg {
  width: 16px;
  margin-left: 0.7rem;
  color: #7890a8;
}

#invoice-panel #invoice-customer-suggestions {
  position: absolute;
  z-index: 1000;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
}

#invoice-panel #invoice-pricelist-placeholder {
  min-width: 0;
}

#invoice-panel #invoice-pricelist-group {
  margin: 0 !important;
  padding: 0.65rem;
  border: 1px solid #e0e8f1;
  border-radius: 10px;
  background: #f6f9fc;
}

#invoice-panel .invoice-pricelist-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

#invoice-panel .invoice-pricelist-label-row .form-label {
  margin: 0;
  color: #465f78 !important;
  font-size: 0.75rem !important;
}

#invoice-panel #invoice-pricelist-source-lbl {
  padding: 0.18rem 0.45rem;
  border-radius: 6px;
  color: #b7791f;
  background: #fff3dc;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

#invoice-panel .invoice-pricelist-control {
  border: 0;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px #d2deeb;
}

#invoice-panel #invoice-customer-info-card[style*="display: block"] {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem 0.7rem;
  margin: 0.6rem 0 0 !important;
  padding: 0.7rem !important;
  border: 1px solid #bfd4ed !important;
  border-left: 3px solid #2563eb !important;
  border-radius: 10px;
  color: #536d86;
  background: #f4f8ff !important;
  box-shadow: none;
  font-size: 0.73rem;
  line-height: 1.4;
}

#invoice-panel #invoice-customer-info-card > div {
  min-width: 0;
}

#invoice-panel #invoice-customer-info-card > div:first-child {
  grid-column: 1 / -1;
  color: #173a60 !important;
  font-size: 0.82rem;
  font-weight: 800;
}

#invoice-panel #selected-customer-brand-lbl,
#invoice-panel #selected-customer-pricelist-lbl {
  color: #2563eb;
  font-weight: 800;
}

#invoice-panel #selected-customer-debt-lbl {
  color: #dc2626;
  font-weight: 800;
}

#invoice-panel .invoice-date-card {
  background: linear-gradient(145deg, #ffffff, #f7fcfa);
}

#invoice-panel .invoice-date-card .form-control {
  width: 100%;
  min-height: 44px;
  font-weight: 800;
}

#invoice-panel .invoice-date-card small {
  display: block;
  margin-top: 0.7rem;
  color: #6c8298;
  font-size: 0.73rem;
  font-weight: 500;
  line-height: 1.45;
}

#invoice-panel .invoice-notes-card {
  display: flex;
  flex-direction: column;
}

#invoice-panel .invoice-notes-card textarea {
  width: 100%;
  min-height: 104px;
  flex: 1;
  resize: vertical;
  line-height: 1.45;
}

#invoice-panel .summary-card-grid {
  grid-template-columns: minmax(0, 1fr) !important;
}

@media (max-width: 960px) {
  #invoice-panel .invoice-order-context,
  #invoice-panel .invoice-order-context:has(> #invoice-business-date-group[style*="display: none"]) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #invoice-panel .invoice-customer-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  #invoice-panel .invoice-order-context,
  #invoice-panel .invoice-order-context:has(> #invoice-business-date-group[style*="display: none"]) {
    grid-template-columns: minmax(0, 1fr);
  }

  #invoice-panel .invoice-customer-card {
    grid-column: auto;
  }

  #invoice-panel #invoice-customer-info-card[style*="display: block"] {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Quick customer opens as a focused dialog instead of expanding the invoice. */
body.quick-customer-modal-open {
  overflow: hidden;
}

#invoice-quick-customer-fields[style*="display: flex"] {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 1rem !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: rgba(15, 32, 52, 0.52) !important;
  box-shadow: none;
  backdrop-filter: blur(5px);
}

#invoice-quick-customer-fields .quick-customer-modal-card {
  width: min(720px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 26px 80px rgba(12, 38, 68, 0.3);
  animation: quick-customer-dialog-in 180ms ease-out;
}

@keyframes quick-customer-dialog-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

#invoice-quick-customer-fields .quick-customer-modal-card .quick-customer-header {
  flex: 0 0 auto;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid #dce7f2;
  background: linear-gradient(135deg, #ffffff, #f4f8ff);
}

#invoice-quick-customer-fields .quick-customer-close {
  width: 36px;
  height: 36px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #4b6480;
  background: transparent;
  cursor: pointer;
}

#invoice-quick-customer-fields .quick-customer-close:hover {
  color: #b42318;
  border-color: #f2c5c0;
  background: #fff4f2;
}

#invoice-quick-customer-fields .quick-customer-close svg {
  width: 18px;
  height: 18px;
}

#invoice-quick-customer-fields .quick-customer-modal-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.8rem;
  padding: 1rem 1.15rem;
  overflow: auto;
  background:
    radial-gradient(circle at 100% 0, rgba(37, 99, 235, 0.07), transparent 34%),
    #f8fbff;
}

#invoice-quick-customer-fields .quick-customer-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.15rem;
  border-top: 1px solid #dce7f2;
  background: #ffffff;
}

#invoice-quick-customer-fields .quick-customer-footer-note {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #607993;
  font-size: 0.75rem;
  font-weight: 600;
}

#invoice-quick-customer-fields .quick-customer-footer-note svg {
  width: 15px;
  height: 15px;
  color: #1f9d70;
}

#invoice-quick-customer-fields .quick-customer-footer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

#invoice-quick-customer-fields .quick-customer-footer-actions .btn {
  min-height: 40px;
  padding-inline: 1rem;
  border-radius: 10px;
}

@media (max-width: 760px) {
  #invoice-quick-customer-fields[style*="display: flex"] {
    align-items: flex-end;
    padding: 0 !important;
  }

  #invoice-quick-customer-fields .quick-customer-modal-card {
    width: 100%;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
  }

  #invoice-quick-customer-fields .quick-customer-modal-grid {
    grid-template-columns: minmax(0, 1fr);
    padding: 0.85rem;
  }

  #invoice-quick-customer-fields .quick-customer-footer {
    align-items: stretch;
    flex-direction: column;
  }

  #invoice-quick-customer-fields .quick-customer-footer-actions,
  #invoice-quick-customer-fields .quick-customer-footer-actions .btn {
    width: 100%;
  }

  #invoice-quick-customer-fields .quick-customer-footer-actions .btn {
    justify-content: center;
  }
}

/* Dashboard report controls: compact premium filter surface. */
.dashboard-toolbar.glass-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  margin-bottom: 1.35rem;
  padding: 0;
  overflow: visible;
  border: 1px solid #c7d9ec;
  border-top: 3px solid #2563eb;
  border-left-width: 1px;
  border-radius: 17px;
  background:
    radial-gradient(circle at 96% 0%, rgba(37, 99, 235, 0.1), transparent 27%),
    linear-gradient(145deg, #ffffff 0%, #f8fbff 100%) !important;
  box-shadow: 0 14px 36px rgba(28, 72, 130, 0.11);
}

.dashboard-toolbar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #dce7f3;
}

.dashboard-toolbar-title,
.dashboard-toolbar-title > span:last-child {
  display: flex;
  align-items: center;
  min-width: 0;
}

.dashboard-toolbar-title { gap: 0.7rem; }
.dashboard-toolbar-title > span:last-child {
  align-items: flex-start;
  flex-direction: column;
  gap: 0.15rem;
}

.dashboard-toolbar-title strong {
  color: #102a4c;
  font-size: 0.92rem;
  line-height: 1.2;
}

.dashboard-toolbar-title small {
  color: #71849b;
  font-size: 0.72rem;
}

.dashboard-toolbar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  flex: 0 0 35px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #1555c5);
  color: #ffffff;
  box-shadow: 0 7px 17px rgba(37, 99, 235, 0.24);
}

.dashboard-toolbar-icon svg { width: 17px; height: 17px; }

.dashboard-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.dashboard-toolbar-actions .btn {
  min-height: 36px;
  padding: 0 0.8rem;
  border-radius: 9px;
  gap: 0.35rem;
  font-size: 0.78rem;
}

.dashboard-toolbar-actions .btn svg { width: 14px; height: 14px; }

.dashboard-filter-grid {
  display: grid;
  grid-template-columns: minmax(165px, 0.8fr) minmax(245px, 1.45fr) minmax(180px, 0.9fr) minmax(225px, 1.15fr);
  gap: 0.85rem;
  padding: 1rem;
}

.dashboard-toolbar .dashboard-filter-field {
  display: flex;
  align-items: stretch;
  flex-direction: column;
  gap: 0.42rem;
  min-width: 0;
}

.dashboard-toolbar .dashboard-filter-field .filter-label {
  color: #405a76;
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.dashboard-toolbar .dashboard-filter-field .filter-label svg {
  width: 15px;
  height: 15px;
}

.dashboard-toolbar .dashboard-filter-field .form-control {
  width: 100%;
  min-width: 0;
  min-height: 43px;
  height: 43px;
  padding: 0 0.75rem;
  border-color: #bfd0e4 !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.94) !important;
  color: #172b47 !important;
  font-weight: 600;
  cursor: pointer;
}

.dashboard-toolbar .dashboard-filter-field .form-control:focus {
  border-color: #4f83eb !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.11) !important;
}

.dashboard-people-filters {
  display: grid;
  grid-column: span 3;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  min-width: 0;
}

.dashboard-autocomplete-wrap {
  position: relative;
  min-width: 0;
}

.dashboard-autocomplete-wrap .form-control {
  padding-right: 2.2rem;
  cursor: text;
}

.dashboard-autocomplete-clear {
  position: absolute;
  top: 50%;
  right: 0.65rem;
  display: none;
  z-index: 2;
  width: 25px;
  height: 25px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: #edf3fa;
  color: #61758e;
  cursor: pointer;
}

.dashboard-autocomplete-list {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  left: 0;
  display: none;
  z-index: 1050;
  max-height: 240px;
  overflow-y: auto;
  margin: 0;
  padding: 0.35rem;
  border: 1px solid #c5d5e8;
  border-radius: 11px;
  background: #ffffff;
  box-shadow: 0 17px 38px rgba(24, 53, 91, 0.18);
}

.dashboard-date-range {
  grid-column: span 2;
  align-items: flex-end;
  gap: 0.55rem;
  padding: 0.55rem;
  border: 1px solid #d5e2ef;
  border-radius: 11px;
  background: #f4f8fd;
}

.dashboard-date-range label {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.3rem;
  color: #60758e;
  font-size: 0.7rem;
  font-weight: 700;
}

.dashboard-date-range .form-control { min-height: 40px; height: 40px; }
.dashboard-date-separator { padding-bottom: 0.65rem; color: #7b91aa; }

.dashboard-festival-toggle {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  min-height: 65px;
  padding: 0.65rem 0.75rem;
  border: 1px solid #bfe3d5;
  border-radius: 12px;
  background: linear-gradient(135deg, #f3fcf8, #edf9f7);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.dashboard-festival-toggle:hover {
  border-color: #7bcab0;
  box-shadow: 0 8px 20px rgba(13, 148, 136, 0.09);
  transform: translateY(-1px);
}

.dashboard-festival-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #d9f5eb;
  color: #07866f;
}

.dashboard-festival-toggle-icon svg { width: 16px; height: 16px; }
.dashboard-festival-toggle-copy { display: flex; min-width: 0; flex-direction: column; gap: 0.12rem; }
.dashboard-festival-toggle-copy strong { color: #17473f; font-size: 0.76rem; }
.dashboard-festival-toggle-copy small { overflow: hidden; color: #66827b; font-size: 0.65rem; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-festival-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.dashboard-toggle-track {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #a9b8c8;
  transition: background 0.18s ease;
}

.dashboard-toggle-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.2);
  transition: transform 0.18s ease;
}

.dashboard-festival-toggle input:checked + .dashboard-toggle-track { background: #0ea985; }
.dashboard-festival-toggle input:checked + .dashboard-toggle-track::after { transform: translateX(16px); }
.dashboard-festival-toggle:focus-within { outline: 3px solid rgba(37, 99, 235, 0.15); outline-offset: 2px; }

.dashboard-breakdown-chart-columns { height: 315px; }
.dashboard-breakdown-chart-trend { height: 320px; }
.dashboard-breakdown-chart-ranking { height: 310px; }

@media (max-width: 1180px) {
  .dashboard-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-people-filters { grid-column: 1 / -1; }
  .dashboard-date-range { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .dashboard-toolbar-head { align-items: flex-start; flex-direction: column; }
  .dashboard-toolbar-actions { width: 100%; }
  .dashboard-toolbar-actions .btn { flex: 1; justify-content: center; }
  .dashboard-toolbar-title small { display: none; }
  .dashboard-filter-grid { grid-template-columns: minmax(0, 1fr); padding: 0.85rem; }
  .dashboard-people-filters,
  .dashboard-date-range { grid-column: 1; }
  .dashboard-people-filters { grid-template-columns: minmax(0, 1fr); }
  .dashboard-date-range { align-items: stretch; flex-direction: column; }
  .dashboard-date-separator { display: none; }
  .dashboard-festival-toggle { min-height: 62px; }
  .dashboard-breakdown-chart-columns,
  .dashboard-breakdown-chart-trend,
  .dashboard-breakdown-chart-ranking { height: 285px; }
}

/* Shared field styling for quick customer creation. */

#invoice-quick-customer-fields .quick-customer-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid #cfe0ef;
}

#invoice-quick-customer-fields .quick-customer-title-lockup {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: #173a60;
}

#invoice-quick-customer-fields .quick-customer-title-lockup > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

#invoice-quick-customer-fields .quick-customer-title-lockup strong {
  font-size: 0.95rem;
  font-weight: 800;
}

#invoice-quick-customer-fields .quick-customer-title-lockup small {
  color: #65809c;
  font-size: 0.75rem;
  font-weight: 500;
}

#invoice-quick-customer-fields .quick-customer-icon {
  width: 38px;
  height: 38px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  color: #ffffff;
  background: linear-gradient(145deg, #2f74eb, #0e59c7);
  box-shadow: 0 7px 16px rgba(37, 99, 235, 0.24);
}

#invoice-quick-customer-fields .quick-customer-icon svg {
  width: 18px;
  height: 18px;
}

#invoice-quick-customer-fields .quick-customer-cancel {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.7rem;
  border: 1px solid #cbd9e8;
  border-radius: 9px;
  color: #506983;
  background: rgba(255, 255, 255, 0.85);
  font: 700 0.78rem/1 Inter, sans-serif;
  cursor: pointer;
}

#invoice-quick-customer-fields .quick-customer-cancel:hover {
  color: #b42318;
  border-color: #f1b4ae;
  background: #fff5f4;
}

#invoice-quick-customer-fields .quick-customer-cancel svg {
  width: 14px;
  height: 14px;
}

#invoice-quick-customer-fields .quick-customer-primary-field,
#invoice-quick-customer-fields .quick-customer-pair,
#invoice-quick-customer-fields .quick-customer-manager {
  margin-bottom: 0 !important;
  padding: 0.75rem;
  border: 1px solid #d6e3ef;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.88);
}

#invoice-quick-customer-fields .quick-customer-primary-field,
#invoice-quick-customer-fields .quick-customer-manager {
  grid-column: span 4;
}

#invoice-quick-customer-fields .quick-customer-pair {
  grid-column: span 8;
  gap: 0.75rem !important;
}

#invoice-quick-customer-fields .form-label {
  color: #294866 !important;
  font-size: 0.8rem !important;
}

#invoice-quick-customer-fields .form-control,
#invoice-quick-customer-fields .searchable-select-trigger {
  min-height: 42px;
  border-color: #bfd1e3 !important;
  border-radius: 9px !important;
  background-color: #ffffff !important;
}

#invoice-quick-customer-fields #invoice-pricelist-group {
  grid-column: 1 / -1;
  margin: 0 !important;
  padding: 0.8rem;
  border: 1px solid #c7dbef;
  border-radius: 11px;
  background: rgba(237, 246, 255, 0.9);
}

#invoice-panel #invoice-pricelist-placeholder:empty {
  display: none;
}

@media (max-width: 760px) {
  #invoice-quick-customer-fields .quick-customer-primary-field,
  #invoice-quick-customer-fields .quick-customer-pair,
  #invoice-quick-customer-fields .quick-customer-manager,
  #invoice-quick-customer-fields #invoice-pricelist-group {
    grid-column: 1;
  }

  #invoice-quick-customer-fields .quick-customer-pair {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #invoice-quick-customer-fields .quick-customer-title-lockup small {
    display: none;
  }
}
