* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

html {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) transparent;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
}

.display-font {
  font-family: var(--font-display);
}

.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}

a {
  color: var(--brand-600);
}

button {
  font-family: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.icon {
  width: 22px;
  height: 22px;
  flex: none;
  display: inline-block;
  vertical-align: middle;
}

.icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: var(--fs-small);
  font-weight: 600;
  line-height: 1.3;
  background: var(--surface-2);
  color: var(--text);
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease, transform 0.15s ease, box-shadow 0.18s ease;
}

.btn:hover {
  background: var(--border);
  border-color: var(--border-strong);
}

.btn:active {
  transform: scale(0.99);
}

.btn-primary {
  background: var(--grad-emerald);
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  background: var(--grad-emerald);
  opacity: 0.96;
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.btn-gold {
  background: var(--grad-gold);
  color: #231806;
  box-shadow: var(--shadow-gold);
}

.btn-gold:hover {
  background: var(--grad-gold);
  opacity: 0.96;
  transform: translateY(-1px);
  box-shadow: 0 14px 30px -8px rgba(200, 150, 62, 0.48);
}

.btn-gold-soft {
  background: var(--gold-soft-bg);
  border-color: rgba(200, 150, 62, 0.4);
  color: var(--gold-600);
}

html[data-theme="dark"] .btn-gold-soft {
  color: var(--gold-300);
}

.btn-gold-soft:hover {
  background: var(--gold-100);
}

html[data-theme="dark"] .btn-gold-soft:hover {
  background: rgba(200, 150, 62, 0.2);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--surface-2);
}

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

html[data-theme="dark"] .btn-danger {
  color: #1a0b0a;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0;
  position: relative;
}

.icon-btn .n-badge {
  position: absolute;
  top: -4px;
  inset-inline-end: -4px;
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  background: var(--rose);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

.icon-btn:hover {
  background: var(--surface-2);
}

.icon-btn .icon {
  width: 20px;
  height: 20px;
}

.field {
  margin-bottom: 12px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.field .field-hint {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.45;
}

.input,
.select-btn {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  padding: 9px 12px;
  line-height: 1.35;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:hover,
.select-btn:hover {
  border-color: var(--brand-300);
}

.input:focus {
  border-color: var(--brand-600);
  box-shadow: var(--focus-ring);
  outline: none;
}

.input-icon-wrap {
  position: relative;
}

.input-icon-wrap .input {
  padding-inline-start: 42px;
}

.input-icon-wrap .lead-icon {
  position: absolute;
  inset-inline-start: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  display: inline-flex;
  pointer-events: none;
}

.input-icon-wrap .lead-icon .icon {
  width: 18px;
  height: 18px;
}

.input-icon-wrap .input-eye {
  inset-inline-end: 6px;
}

.input.invalid,
.select-btn.invalid {
  border-color: var(--danger);
}

.field-error {
  display: none;
  color: var(--danger);
  font-size: var(--fs-cap);
  margin-top: 5px;
  line-height: 1.4;
}

.field-error.show {
  display: block;
}

.input-wrap {
  position: relative;
}

.input-wrap .input {
  padding-inline-end: 46px;
}

.input-eye {
  position: absolute;
  inset-inline-end: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--muted);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0;
}

.input-eye:hover {
  background: var(--surface-2);
}

.type-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 6px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.type-card {
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  padding: 10px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.type-card .icon {
  width: 16px;
  height: 16px;
  color: inherit;
}

.type-card:hover {
  background: var(--surface);
  color: var(--text);
}

.type-card.active {
  background: var(--grad-emerald-soft);
  color: #ffffff;
  box-shadow: 0 4px 12px -2px rgba(11, 79, 62, 0.35);
}

.type-card.active .icon {
  color: #ffffff;
}

.alert {
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: var(--fs-small);
  line-height: 1.5;
  margin-bottom: 16px;
  display: none;
}

.alert.show {
  display: block;
}

.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

.skeleton-wrap {
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sk-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sk {
  display: block;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: sk-shimmer 1.2s ease-in-out infinite;
}

.sk-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex: none;
}

.sk-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.sk-line {
  height: 12px;
}

.sk-w60 {
  width: 60%;
}

.sk-w40 {
  width: 40%;
}

.sk-w20 {
  width: 56px;
  flex: none;
}

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

@media (prefers-reduced-motion: reduce) {
  .sk {
    animation: none;
  }
}

.page-enter {
  animation: pageEnter 0.22s ease both;
}

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

.anim-in {
  animation: animIn 0.3s ease both;
}

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

.data-table tbody tr {
  animation: rowIn 0.25s ease both;
}

.data-table tbody tr:nth-child(2) { animation-delay: 25ms; }
.data-table tbody tr:nth-child(3) { animation-delay: 50ms; }
.data-table tbody tr:nth-child(4) { animation-delay: 75ms; }
.data-table tbody tr:nth-child(5) { animation-delay: 100ms; }
.data-table tbody tr:nth-child(6) { animation-delay: 125ms; }
.data-table tbody tr:nth-child(7) { animation-delay: 150ms; }
.data-table tbody tr:nth-child(8) { animation-delay: 175ms; }
.data-table tbody tr:nth-child(9) { animation-delay: 200ms; }
.data-table tbody tr:nth-child(10) { animation-delay: 225ms; }
.data-table tbody tr:nth-child(11) { animation-delay: 250ms; }
.data-table tbody tr:nth-child(12) { animation-delay: 275ms; }

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

.btn:active,
.icon-btn:active,
.seg-btn:active,
.nav-item:active,
.mobile-nav button:active {
  transform: scale(0.96);
}

.btn,
.icon-btn,
.seg-btn,
.nav-item,
.mobile-nav button {
  transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.seg-toggle {
  position: relative;
}

.seg-pill {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: 0;
  border-radius: 999px;
  background: var(--brand-700);
  box-shadow: 0 4px 12px -4px rgba(11, 79, 62, 0.45);
  transition: transform 0.22s ease, width 0.22s ease, opacity 0.15s ease;
  z-index: 0;
  pointer-events: none;
}

.seg-toggle.has-pill .seg-btn {
  position: relative;
  z-index: 1;
}

.seg-toggle.has-pill .seg-btn.active {
  background: transparent;
  box-shadow: none;
}

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

.success-pop {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: var(--brand-700);
  box-shadow: var(--shadow-pop);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  pointer-events: none;
  opacity: 0;
  animation: successPopIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.success-pop.out {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.9);
}

.success-pop svg {
  width: 52px;
  height: 52px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.success-pop circle {
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  animation: successDraw 0.45s ease forwards;
}

.success-pop path {
  stroke-dasharray: 36;
  stroke-dashoffset: 36;
  animation: successDraw 0.3s ease 0.3s forwards;
}

@keyframes successPopIn {
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes successDraw {
  to {
    stroke-dashoffset: 0;
  }
}

.chart-bar {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: chartGrow 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes chartGrow {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

.chart-doughnut {
  animation: doughnutIn 0.5s ease both;
}

@keyframes doughnutIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-enter,
  .anim-in,
  .data-table tbody tr,
  .chart-bar,
  .chart-doughnut,
  .success-pop circle,
  .success-pop path {
    animation: none;
  }
  .seg-pill {
    transition: none;
  }
}

.dd {
  position: relative;
}

.select-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: start;
}

.select-btn .icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex-shrink: 0;
}

.dd-id-input {
  width: 100%;
  margin-bottom: 6px;
}

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

.dd-panel {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-start: 0;
  min-width: 100%;
  width: max-content;
  max-width: min(340px, 92vw);
  max-height: 300px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop);
  z-index: 120;
  display: none;
  padding: 6px;
}

.dd-panel.open {
  display: block;
  animation: ddIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.dd-search {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-small);
  padding: 8px 10px;
  margin-bottom: 6px;
}

.dd-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  text-align: start;
  padding: 9px 10px;
  border-radius: 7px;
  font-size: var(--fs-small);
  line-height: 1.4;
}

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

.dd-item:hover,
.dd-item.focused {
  background: var(--surface-2);
}

.dd-item.selected {
  background: var(--brand-50);
  color: var(--brand-800);
  font-weight: 600;
}

html[data-theme="dark"] .dd-item.selected {
  background: var(--brand-900);
  color: var(--brand-100);
}

.dd-empty {
  padding: 12px 10px;
  color: var(--muted);
  font-size: var(--fs-small);
  text-align: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 26, 20, 0.5);
  backdrop-filter: blur(2px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-pop);
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  scrollbar-width: none;
  padding: 18px;
  animation: fadeSlideUp 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal::-webkit-scrollbar {
  display: none;
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.modal-head h3 {
  flex: 1;
  margin: 0;
}

.modal-close {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.modal h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  line-height: var(--lh-head);
}

.modal p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: var(--fs-small);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

@media (min-width: 641px) and (min-height: 541px) {
  .modal.modal-wide,
  .modal.modal-content,
  .modal.help-note-modal {
    height: min(85dvh, 780px);
    display: flex;
    flex-direction: column;
  }

  .modal.modal-wide .modal-head,
  .modal.modal-content .modal-head,
  .modal.help-note-modal .modal-head {
    position: sticky;
    top: -18px;
    margin: -18px -18px 12px;
    padding: 18px 18px 12px;
    background: var(--surface);
    z-index: 5;
    flex: none;
  }

  .modal.modal-wide .modal-form {
    flex: 1;
  }

  .modal.modal-wide .modal-actions,
  .modal.modal-content .modal-actions,
  .modal.help-note-modal .modal-actions,
  .modal.modal-wide .wiz-nav {
    position: sticky;
    bottom: -18px;
    margin: auto -18px -18px;
    padding: 12px 18px 18px;
    background: var(--surface);
    z-index: 5;
  }
}

.toast-wrap {
  position: fixed;
  bottom: 20px;
  inset-inline-end: 20px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(92vw, 380px);
  pointer-events: none;
}

.toast {
  background: var(--brand-800);
  color: #eaf5f0;
  border: 1px solid rgba(200, 150, 62, 0.35);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: var(--fs-small);
  line-height: 1.5;
  box-shadow: var(--shadow-pop);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: fadeSlideUp 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-error {
  background: var(--danger);
  color: #ffffff;
}

html[data-theme="dark"] .toast-error {
  color: #1a0b0a;
}

.toast .icon {
  width: 19px;
  height: 19px;
  margin-top: 2px;
}

.install-popup {
  position: fixed;
  bottom: 18px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  z-index: 450;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(94vw, 460px);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-pop);
  padding: 12px 14px;
  animation: fadeSlideUp 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

html[dir="rtl"] .install-popup {
  transform: translateX(50%);
}

.install-popup[hidden] {
  display: none;
}

.install-popup-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
}

.install-popup-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.install-popup-text strong {
  font-family: var(--font-display);
  font-size: var(--fs-body);
  line-height: 1.55;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.install-popup-text span {
  color: var(--muted);
  font-size: var(--fs-small);
  line-height: 1.55;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.install-popup-btn {
  flex-shrink: 0;
  padding: 10px 18px;
}

.install-popup-close {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.install-popup-close:hover {
  background: var(--surface-2);
  color: var(--text);
}

.install-popup-close .icon {
  width: 18px;
  height: 18px;
}

@media (max-width: 480px) {
  .install-popup {
    bottom: 12px;
    padding: 10px 12px;
    gap: 10px;
  }

  .install-popup-icon {
    width: 42px;
    height: 42px;
  }

  .install-popup-btn {
    padding: 9px 14px;
  }
}

@media (max-width: 820px) {
  body:has(.mobile-nav) .install-popup {
    bottom: 84px;
  }
}

.accordion {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.acc-item + .acc-item {
  border-top: 1px solid var(--border);
}

.acc-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 15px 18px;
  font-size: var(--fs-body);
  font-weight: 600;
  text-align: start;
  line-height: 1.4;
}

.acc-head .icon-chev {
  margin-inline-start: auto;
  width: 19px;
  height: 19px;
  color: var(--muted);
  transition: transform 0.18s ease;
}

.acc-item.open .acc-head .icon-chev {
  transform: rotate(180deg);
}

.acc-body {
  display: none;
  padding: 2px 18px 16px;
  color: var(--muted);
  font-size: var(--fs-small);
}

.acc-item.open .acc-body {
  display: block;
}

.filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-card);
}

.filterbar .f-field {
  min-width: 150px;
  flex: 1 1 150px;
}

.filterbar .f-field label {
  display: block;
  font-size: var(--fs-cap);
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
}

.filterbar .f-search {
  flex: 2 1 220px;
}

.kbd-tip {
  position: fixed;
  z-index: 500;
  background: var(--brand-950);
  color: #eaf5f0;
  font-size: var(--fs-cap);
  line-height: 1.4;
  padding: 6px 10px;
  border-radius: 7px;
  box-shadow: var(--shadow-pop);
  pointer-events: none;
  display: none;
  align-items: center;
  gap: 8px;
}

.kbd-tip.show {
  display: flex;
}

@media (hover: none), (pointer: coarse) {
  .kbd-tip,
  .kbd-tip.show {
    display: none;
  }
}

.kbd {
  font-family: var(--font-num);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
  white-space: nowrap;
}

.shortcut-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-small);
}

.shortcut-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.shortcut-table .kbd {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

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

.animate-in {
  animation: fadeSlideUp 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.card-lift {
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.card-lift:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: 4px 11px;
  line-height: 1.5;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.chip .icon {
  width: 14px;
  height: 14px;
}

.chip-gold {
  background: var(--gold-soft-bg);
  border-color: rgba(200, 150, 62, 0.4);
  color: var(--gold-600);
}

html[data-theme="dark"] .chip-gold {
  color: var(--gold-300);
}

.chip-green {
  background: var(--success-bg);
  border-color: rgba(15, 104, 81, 0.25);
  color: var(--success);
}

.pill-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.pill-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 9px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  transition: background 0.15s ease, color 0.15s ease;
}

.pill-btn:hover {
  color: var(--text);
}

.pill-btn.active {
  background: var(--brand-700);
  border-color: var(--brand-700);
  color: #ffffff;
}

.period-toggle {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  gap: 2px;
}

.period-toggle button {
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 9px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  transition: background 0.15s ease, color 0.15s ease;
}

.period-toggle button.active {
  background: var(--surface);
  color: var(--brand-800);
  box-shadow: 0 1px 4px rgba(6, 43, 34, 0.12);
}

html[data-theme="dark"] .period-toggle button.active {
  background: var(--brand-800);
  color: var(--gold-300);
}

.progress {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-700), #2e9e7d);
}

.progress.gold > span {
  background: linear-gradient(90deg, var(--brand-700), #2e9e7d, var(--gold-400));
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 10px;
  line-height: 1.5;
  white-space: nowrap;
}

.status-pill.paid {
  background: var(--success-bg);
  color: var(--success);
}

.status-pill.due {
  background: var(--rose-bg);
  color: var(--rose-text);
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  line-height: 1.45;
  text-align: center;
}

.data-table th {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--th-bg);
  white-space: nowrap;
}

.data-table th.t-end {
  text-align: center;
}

.data-table .t-center {
  text-align: center;
}

.data-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

@media screen {
  .data-table tbody tr:nth-child(even) {
    background: var(--surface-2);
  }
}

.data-table tbody tr {
  transition: background 0.12s ease;
}

.data-table tbody tr:hover {
  background: var(--brand-50);
}

html[data-theme="dark"] .data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.data-table .t-main {
  font-weight: 700;
  color: var(--text);
  display: block;
  line-height: 1.4;
}

.data-table .t-sub {
  font-size: 12px;
  color: var(--muted);
  display: block;
  line-height: 1.4;
}

.data-table .t-sub-mobile {
  display: none;
}

@media (max-width: 820px) {
  .data-table .col-p3 {
    display: none;
  }

  .data-table .t-sub-mobile {
    display: block;
  }

  .data-table th {
    font-size: 12px;
  }

  .input,
  .select-btn {
    padding: 8px 11px;
  }
}

@media (max-width: 560px) {
  .data-table .col-p2 {
    display: none;
  }
}

.data-table .t-amount {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--brand-800);
  white-space: nowrap;
}

html[data-theme="dark"] .data-table .t-amount {
  color: var(--gold-300);
}

.table-empty {
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-small);
  padding: 22px 14px;
}

.chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

.chart-doughnut {
  max-width: 210px;
  margin: 0 auto;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 12px;
  color: var(--muted);
}

.chart-legend .lg-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend .lg-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}

.chart-legend.legend-depts {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

img[data-lightbox] {
  cursor: pointer;
}

.img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(6, 16, 14, 0.94);
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 16px;
  gap: 12px;
}

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

.img-lightbox-stage {
  display: grid;
  place-items: center;
  min-height: 0;
}

.img-lightbox-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--r-sm);
}

.img-lightbox-cap {
  color: #e6eeea;
  text-align: center;
  min-height: 1.6em;
  max-width: none;
  margin: 0;
}

.img-lightbox-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.img-lightbox-x .icon svg {
  width: 24px;
  height: 24px;
}

.img-lightbox-x:hover {
  background: rgba(255, 255, 255, 0.18);
}

@media print {
  .img-lightbox {
    display: none;
  }
}

.net-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.net-progress.show {
  opacity: 1;
}

.net-progress-fill {
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, #0f7a4d, #c9a227);
  border-radius: 0 3px 3px 0;
  animation: netProgressSlide 1.1s ease-in-out infinite;
}

@keyframes netProgressSlide {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(260%);
  }
}

@media print {
  .net-progress {
    display: none;
  }
}
