/* === APP STYLES: Sidebar, Cards, Dashboard, Stats === */

/* Sidebar */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 290px;
  background: var(--bg);
  border-right: 1px solid var(--line);
  overflow: hidden;
}

@media (min-width: 1024px) {
  .sidebar {
    position: static;
  }
}

.sidebar-close {
  display: none;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 49;
}

/* Sidebar Stats */
.sidebar-stats {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 10px;
}

.stat-box {
  text-align: center;
  padding: 6px 2px;
  background: var(--card2);
  border-radius: 8px;
}

.stat-num {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.stat-num.good {
  color: var(--good);
}

.stat-num.warn {
  color: var(--warn);
}

.stat-num.danger {
  color: var(--danger);
}

.stat-lbl {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.stat-finance {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.finance-item {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 12px;
}

.fin-lbl {
  color: var(--muted);
}

.fin-val {
  font-weight: 700;
  color: var(--text);
}

.fin-val.good {
  color: var(--good);
}

.fin-val.accent {
  color: var(--accent);
}

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.sidebar-brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 14px;
  color: var(--bg);
  flex-shrink: 0;
}

.sidebar-brand-name {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .5px;
  color: var(--text);
}

.sidebar-brand-version {
  font-size: 10px;
  color: var(--muted);
}

/* Footer */
.sidebar-footer {
  text-align: center;
  padding: 20px 16px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .5px;
  opacity: .6;
  border-top: 1px solid var(--line);
  text-transform: uppercase;
  font-weight: 600;
}

/* Scrollable Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

.sidebar-nav.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.sidebar-nav.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Section Title */
.nav-section {
  margin-bottom: 24px;
}

.nav-section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
  opacity: .6;
  margin-bottom: 12px;
  padding: 0 12px;
  font-weight: 600;
}

/* NavGroup */
.nav-group {
  margin-bottom: 4px;
}

.nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all 150ms;
  line-height: 1.5;
}

.nav-group-toggle:hover {
  background: rgba(255, 255, 255, .05);
  color: var(--text);
}

.nav-group-toggle .nav-icon {
  font-size: 16px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

.nav-group-toggle .nav-label {
  flex: 1;
}

.nav-group-toggle .nav-arrow {
  font-size: 10px;
  transition: transform .2s;
  display: inline-flex;
  align-items: center;
}

.nav-group-toggle .nav-badge {
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .06);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
}

.nav-group-toggle .settings-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px;
  opacity: .4;
  transition: opacity .15s, transform .1s;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
}

.nav-group-toggle:hover .settings-btn {
  opacity: .9;
}

.nav-group-toggle .settings-btn+.settings-btn {
  margin-left: 2px;
}

/* NavGroup Menu (sub-items container) */
.nav-group-menu {
  padding: 2px 0;
  overflow: hidden;
  transition: max-height .22s ease, opacity .22s ease;
}

.nav-group-menu.collapsed {
  max-height: 0 !important;
  opacity: 0;
  padding: 0;
}

.nav-sub-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 20px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
  border-radius: 8px;
  margin: 1px 8px;
  font-weight: 500;
}

.nav-sub-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-sub-item.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line);
  flex-shrink: 0;
  transition: background .15s;
}

.nav-sub-item.active .nav-dot {
  background: var(--accent);
  box-shadow: none;
}

.nav-arrow {
  transition: transform .22s ease;
  margin-left: auto;
}

.nav-arrow.rotated {
  transform: rotate(180deg);
}

.nav-group-toggle.parent-active {
  color: var(--accent);
  background: var(--accent-soft);
}

/* Side Item (sub-items) — TailAdmin style */
.side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 36px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 150ms;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.side-item:hover {
  background: var(--sidebar-surface-hover);
  color: var(--text);
}

.side-item.active {
  background: var(--accent-hover);
  color: var(--sidebar-active-text);
}

.side-item .icon {
  font-size: 15px;
}

.side-item .name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-item .count {
  font-size: 12px;
  padding: 1px 8px;
  background: rgba(255, 255, 255, .06);
  border-radius: 20px;
  color: var(--muted);
}

.side-item .count.count-red,
.cat-group-header .count.count-red {
  background: var(--danger);
  color: white;
  font-weight: 700;
}

.side-item .count.count-yellow,
.cat-group-header .count.count-yellow {
  background: var(--warn);
  color: #000;
  font-weight: 700;
}

.side-item .count.count-green,
.cat-group-header .count.count-green {
  background: var(--good);
  color: white;
  font-weight: 700;
}

.side-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.side-item .settings-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  padding: 2px;
  opacity: .4;
  transition: opacity .15s, transform .1s;
  color: var(--accent);
}

.side-item:hover .settings-btn {
  opacity: .9;
}

/* Add button inside group */
.nav-add-btn {
  display: block;
  background: none;
  border: none;
  font-size: 12px;
  padding: 6px 12px 6px 36px;
  color: var(--accent);
  opacity: .6;
  cursor: pointer;
  transition: opacity .15s;
  text-align: left;
  width: 100%;
}

.nav-add-btn:hover {
  opacity: 1;
}

.nav-add-btn.purple {
  color: var(--accent);
}

/* Drag & Drop */
.side-item.dragging {
  position: absolute !important;
  z-index: 1000;
  opacity: 0.8;
  transform: scale(1.02);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  cursor: grabbing !important;
  pointer-events: none;
  transition: none !important;
  background: var(--card) !important;
  margin: 0 !important;
}

.side-item-placeholder {
  border: 2px dashed var(--accent);
  background: rgba(229, 231, 235, 0.05);
  border-radius: 6px;
  margin-bottom: 4px;
  box-sizing: border-box;
  pointer-events: none;
  transition: height 0.15s ease-out;
}

.cat-group.dragging {
  position: absolute !important;
  z-index: 1000;
  opacity: 0.8;
  transform: scale(1.02);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  cursor: grabbing !important;
  pointer-events: none;
  transition: none !important;
  background: var(--card) !important;
  margin: 0 !important;
}

/* Category Group - TailAdmin inspired */
.cat-group {
  margin: 4px 0;
  border-radius: 8px;
  overflow: hidden;
  transition: background .15s;
}

.cat-group:hover {
  background: rgba(255, 255, 255, .02);
}

.cat-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 16px;
  cursor: pointer;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  position: relative;
  transition: all .15s;
}

.cat-group-header::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 2px;
  background: var(--cg-color, var(--accent));
}

.cat-group-header:hover {
  background: rgba(255, 255, 255, .05);
}

.cat-group-header .arrow {
  font-size: 10px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  transition: transform .2s;
  color: var(--muted);
}

.cat-group-header.collapsed .arrow {
  transform: rotate(-90deg);
}

.cat-group-header .cg-name {
  flex: 1;
  color: var(--cg-color, var(--text));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-group-header .count {
  font-size: 11px;
  padding: 2px 8px;
  background: color-mix(in srgb, var(--cg-color, var(--accent)) 15%, transparent);
  color: var(--cg-color, var(--accent));
  border-radius: 999px;
  font-weight: 700;
}

.cat-group-header .settings-btn {
  opacity: .35;
  transition: opacity .15s, transform .1s;
}

.cat-group-header:hover .settings-btn {
  opacity: .9;
}

.cat-group-list {
  padding: 4px 0 6px 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.cat-group.collapsed .cat-group-list {
  display: none;
}

/* Sub item inside cat-group */
.cat-group-list .side-item {
  padding: 7px 12px 7px 32px;
  font-size: 12.5px;
}

.cat-group-list .side-item .dot {
  width: 6px;
  height: 6px;
}

/* Filter badge - cụ thể hơn */
.filter-badge {
  font-size: 11px;
  padding: 6px 12px;
  background: rgba(245, 158, 11, .08);
  border: 1px solid rgba(245, 158, 11, .25);
  color: var(--warn);
  border-radius: 6px;
  margin: 4px 0 8px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-badge .clear {
  margin-left: auto;
  cursor: pointer;
  opacity: .7;
}

.filter-badge .clear:hover {
  opacity: 1;
}

/* Add button bên trong cat-group */
.cat-group-list .nav-add-btn {
  padding: 6px 12px 6px 32px;
  font-size: 11.5px;
}

/* Settings btn click feedback */
.settings-btn:active {
  transform: scale(.9);
}

/* Settings btn (touch) - luôn hiện trên mobile */
@media (hover: none) {

  .nav-group-toggle .settings-btn,
  .cat-group-header .settings-btn,
  .side-item .settings-btn {
    opacity: 1;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: 1px solid var(--line);
  background: var(--card2);
  color: var(--text);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s ease;
}

.btn:hover {
  border-color: var(--accent);
  background: rgba(70, 95, 255, .1);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(70, 95, 255, .15);
}

.btn.sm {
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.btn.xs {
  padding: 6px 10px;
  font-size: 11px;
  border-radius: 6px;
}

.btn.good {
  border-color: rgba(34, 197, 94, .4);
  background: rgba(34, 197, 94, .1);
}

.btn.good:hover {
  background: rgba(34, 197, 94, .2);
  box-shadow: 0 4px 12px rgba(34, 197, 94, .15);
}

.btn.warn {
  border-color: rgba(245, 158, 11, .4);
  background: rgba(245, 158, 11, .1);
}

.btn.danger {
  border-color: rgba(239, 68, 68, .4);
  background: rgba(239, 68, 68, .1);
}

.btn.danger:hover {
  background: rgba(239, 68, 68, .2);
}

.btn.purple {
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  overflow: hidden;
  min-width: 0;
}

.stat-card .stat-icon-box {
  height: 48px;
  width: 48px;
  border-radius: 12px;
  background: var(--card);
  display: grid;
  place-items: center;
  margin-bottom: 12px;
}

.stat-card .label {
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-card .value {
  font-size: 24px;
  font-weight: 700;
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

/* Selection Bar */
.selection-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.selection-bar.show {
  display: flex;
}

.selection-bar .info {
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.selection-bar .info input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
}

.selection-bar .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}


/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .7);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal.show {
  display: flex;
}

.modal-box {
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-header span {
  font-size: 12px;
  color: var(--muted);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Form */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(70, 95, 255, 0.15);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
  font-family: inherit;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group {
  flex: 1;
  position: relative;
}

.form-group:has(.ms-dropdown) {
  overflow: visible;
}

.form-row:has(.ms-dropdown.open) {
  overflow: visible;
  z-index: 100;
}

/* Color Palette */
.color-palette {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-opt {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .15s;
}

.color-opt:hover {
  transform: scale(1.1);
}

.color-opt.active {
  border-color: white;
  box-shadow: 0 0 10px rgba(255, 255, 255, .3);
}

/* Manage List */
.manage-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.manage-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.manage-item .name {
  flex: 1;
  font-size: 14px;
}

.manage-item .actions {
  display: flex;
  gap: 6px;
}

/* Field List */
.field-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.field-item input {
  flex: 1;
  padding: 8px 10px;
  background: rgba(0, 0, 0, .2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  outline: none;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
  opacity: 0;
  transform: translateY(10px);
  transition: all .25s;
  z-index: 2000;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.hint {
  padding: 14px;
  background: var(--bg);
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
}

.empty .icon {
  font-size: 48px;
  margin-bottom: 16px;
}

/* MultiSelect Dropdown */
.ms-dropdown {
  position: relative;
  width: 100%;
}

.ms-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
  min-height: 42px;
}

.ms-trigger:hover {
  border-color: var(--accent);
}

.ms-trigger.open {
  border-color: var(--accent);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.ms-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  flex: 1;
  overflow: hidden;
}

.ms-placeholder {
  color: var(--muted);
}

.ms-tag {
  background: rgba(70, 95, 255, 0.15);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.ms-tag-overflow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  background: var(--line);
  padding: 2px 8px;
  border-radius: 6px;
}

.ms-arrow {
  margin-left: 8px;
  font-size: 10px;
  color: var(--muted);
  transition: transform 0.2s;
}

.ms-trigger.open .ms-arrow {
  transform: rotate(180deg);
}

.ms-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card2);
  border: 1px solid var(--line);
  border-top: none;
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.ms-panel-portal {
  position: fixed;
  background: var(--card2);
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ms-dropdown.open .ms-panel {
  display: flex;
}

.ms-search-box {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.ms-search-input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  outline: none;
}

.ms-search-input:focus {
  border-color: var(--accent);
}

.ms-options {
  max-height: 240px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ms-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}

.ms-option:hover {
  background: rgba(255, 255, 255, 0.05);
}

.ms-option[data-hidden="true"] {
  display: none;
}

.ms-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--muted);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.ms-checkbox.checked {
  background: var(--accent);
  border-color: var(--accent);
}

.ms-checkbox::after {
  content: '';
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 0;
}

.ms-checkbox.checked::after {
  opacity: 1;
}

.ms-option-label {
  flex: 1;
  font-size: 13.5px;
  color: var(--text);
}

/* Sticky Notes */
.notes-panel {
  position: fixed;
  top: 60px;
  right: -440px;
  width: 400px;
  max-width: 92vw;
  height: calc(100vh - 80px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notes-panel.open {
  right: 20px;
}

.notes-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card2);
}

.notes-search-wrap {
  padding: 8px 12px;
  background: var(--card2);
  border-bottom: 1px solid var(--line);
}

.notes-search {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  outline: none;
}

.notes-search:focus {
  border-color: var(--accent);
}

.notes-filter-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: var(--card2);
  padding: 0 8px;
}

.notes-tab {
  padding: 8px 12px;
  font-size: 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}

.notes-tab:hover {
  color: var(--text);
}

.notes-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.notes-header h3 {
  margin: 0;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.notes-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg);
}

.notes-panel .note-card {
  border-radius: 10px;
  padding: 12px 12px 12px 16px;
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  cursor: pointer;
  transition: box-shadow .15s, transform .15s;
}

.notes-panel .note-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
  transform: translateY(-1px);
}

.notes-panel .note-card.pinned {
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.notes-panel .note-card.done {
  opacity: 0.55;
}

.notes-panel .note-card.done .note-card-title,
.notes-panel .note-card.done .note-card-content {
  text-decoration: line-through;
}

.notes-panel .note-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.notes-panel .note-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notes-panel .note-card-content {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
  white-space: pre-wrap;
  word-break: break-word;
}

.notes-panel .note-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notes-panel .note-pin-icon {
  font-size: 12px;
}

.notes-panel .note-type-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--line);
  color: var(--muted);
}

.notes-panel .note-type-badge.type-todo {
  background: #dbeafe;
  color: #2563eb;
}

.notes-panel .note-type-badge.type-warning {
  background: #fef3c7;
  color: #d97706;
}

.notes-panel .note-type-badge.type-reminder {
  background: rgba(214, 217, 223, 0.12);
  color: var(--accent);
}

.notes-panel .note-type-badge.type-idea {
  background: #fef9c3;
  color: #a16207;
}

.notes-panel .note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.notes-panel .note-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--line);
  color: var(--muted);
}

.notes-panel .note-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: none;
  gap: 2px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px 4px;
  z-index: 2;
}

.notes-panel .note-card:hover .note-actions {
  display: flex;
}

.notes-panel .note-actions button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
  border-radius: 4px;
}

.notes-panel .note-actions button:hover {
  background: var(--line);
}

.note-inline-edit {
  width: 100%;
  min-height: 60px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  resize: vertical;
}

.note-editor {
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--card);
}

.note-editor textarea {
  width: 100%;
  min-height: 60px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  resize: vertical;
  margin-bottom: 8px;
  font-size: 13px;
}

.note-type-select {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}

.note-colors {
  display: flex;
  gap: 6px;
}

.note-color-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform .1s;
}

.note-color-btn.active {
  border-color: var(--accent);
  border-width: 3px;
  transform: scale(1.15);
}

/* Dashboard toggle icon */
.toggle-icon {
  transition: transform .2s;
}

.toggle-icon.up {
  transform: rotate(180deg);
}

/* ==================== INDEPENDENT DASHBOARD VIEW ==================== */
.dashboard-view {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
}

.dash-v-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.dash-v-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
  margin: 0;
}

.dash-v-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 0;
}

.dash-v-filter {
  display: flex;
  gap: 8px;
}

.dash-v-select {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.dash-v-select:focus {
  border-color: var(--accent);
}

.dash-v-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 1280px) {
  .dash-v-grid {
    grid-template-columns: 7fr 5fr;
  }

  .dash-v-full {
    grid-column: 1 / -1;
  }
}

.dash-v-left {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dash-v-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dash-v-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
}

.dash-v-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.dash-v-card-head h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.dash-v-muted {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 0;
}

/* Metric cards (TailAdmin-style) */
.dash-v-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .dash-v-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .dash-v-metrics {
    grid-template-columns: repeat(3, 1fr);
  }
}

.dash-v-metric {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  transition: box-shadow .15s, border-color .15s;
}

.dash-v-metric:hover {
  box-shadow: 0 0 20px rgba(70, 95, 255, 0.08);
  border-color: rgba(70, 95, 255, 0.3);
}

.dash-v-metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--card2);
  display: grid;
  place-items: center;
  color: var(--text);
  margin-bottom: 20px;
}

.dash-v-metric-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.dash-v-metric-label {
  font-size: 13px;
  color: var(--muted);
}

.dash-v-metric-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-top: 6px;
  letter-spacing: -0.3px;
}

.dash-v-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.dash-v-change.up {
  background: rgba(34, 197, 94, 0.12);
  color: var(--good);
}

.dash-v-change.down {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.dash-v-change.flat {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

/* Target info */
.dash-v-target-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 16px 0 4px;
  border-top: 1px solid var(--line);
  margin-top: 16px;
  flex-wrap: wrap;
}

.dash-v-target-info>div {
  text-align: center;
}

.dash-v-target-info .tgt-lbl {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dash-v-target-info .tgt-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.dash-v-target-info .divider {
  width: 1px;
  height: 28px;
  background: var(--line);
}

/* Tabs (Statistics) */
.dash-v-tabs {
  display: inline-flex;
  background: var(--card2);
  padding: 4px;
  border-radius: 10px;
  gap: 2px;
}

.dash-v-tabs button {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all .15s;
}

.dash-v-tabs button.active {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Recent Table */
.dash-v-btn-outline {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.dash-v-btn-outline:hover {
  background: var(--card2);
}

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

.dash-v-table {
  width: 100%;
  border-collapse: collapse;
}

.dash-v-table thead tr {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.dash-v-table th {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-align: left;
  padding: 12px 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.dash-v-table td {
  font-size: 13px;
  color: var(--text);
  padding: 14px 8px;
  border-bottom: 1px solid var(--line);
}

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

.dash-v-table .status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.dash-v-table .status-sold {
  background: rgba(34, 197, 94, 0.15);
  color: var(--good);
}

.dash-v-table .status-die {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.dash-v-table .status-banned {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
}

.dash-v-table .status-faceid {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

/* Dashboard transactions history */
.tx-history-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tx-history-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.tx-history-header h3 {
  margin: 0;
  color: #f8fafc;
  font-size: 22px;
  font-weight: 850;
}

.tx-history-header p {
  max-width: 760px;
  margin: 6px 0 0;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.55;
}

.tx-history-meta {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  color: #c4b5fd;
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.18);
  font-size: 12px;
  font-weight: 750;
}

.tx-summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.tx-summary-card {
  --tx-tone: #a78bfa;
  display: flex;
  gap: 12px;
  min-height: 104px;
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(20, 25, 35, 0.96), rgba(12, 17, 26, 0.98));
  border: 1px solid rgba(148, 163, 184, 0.13);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.16);
}

.tx-summary-card.is-purple {
  --tx-tone: #a78bfa;
}

.tx-summary-card.is-blue {
  --tx-tone: #60a5fa;
}

.tx-summary-card.is-green {
  --tx-tone: #34d399;
}

.tx-summary-card.is-red {
  --tx-tone: #fb7185;
}

.tx-summary-card.is-orange {
  --tx-tone: #fb923c;
}

.tx-summary-card.is-cyan {
  --tx-tone: #22d3ee;
}

.tx-summary-icon {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  color: var(--tx-tone);
  background: color-mix(in srgb, var(--tx-tone) 13%, rgba(255, 255, 255, 0.04));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tx-tone) 24%, transparent);
  font-size: 12px;
  font-weight: 850;
}

.tx-summary-label {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.tx-summary-value {
  margin-top: 7px;
  color: #f8fafc;
  font-size: 20px;
  font-weight: 850;
  line-height: 1.1;
}

.tx-summary-sub {
  margin-top: 6px;
  color: #64748b;
  font-size: 11px;
}

.tx-filter-card,
.tx-table-card {
  border-radius: 18px;
  background: rgba(15, 20, 30, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.13);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.14);
}

.tx-filter-card {
  padding: 16px;
}

.tx-filter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: end;
}

.tx-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.tx-field span {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.tx-field input,
.tx-field select {
  min-height: 38px;
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px;
  background: rgba(8, 12, 19, 0.88);
  color: #e2e8f0;
  padding: 8px 11px;
  font-size: 13px;
  outline: none;
}

.tx-field input:focus,
.tx-field select:focus {
  border-color: rgba(167, 139, 250, 0.54);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.09);
}

.tx-filter-actions {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
}

.tx-table-card {
  overflow: hidden;
}

.tx-table-scroll {
  overflow-x: auto;
  max-width: 100%;
}

.tx-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: separate;
  border-spacing: 0;
}

.tx-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(10, 15, 24, 0.98);
  color: #94a3b8;
  padding: 13px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.13);
  font-size: 11px;
  font-weight: 850;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.tx-table tbody td {
  min-height: 72px;
  padding: 13px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  color: #e2e8f0;
  font-size: 13px;
  vertical-align: middle;
}

.tx-row {
  background: rgba(15, 20, 30, 0.34);
  transition: background-color 0.16s ease;
}

.tx-row:hover {
  background: rgba(30, 41, 59, 0.44);
}

.tx-row td:first-child {
  border-left: 3px solid rgba(148, 163, 184, 0.24);
}

.tx-row.is-green td:first-child {
  border-left-color: #34d399;
}

.tx-row.is-red td:first-child {
  border-left-color: #fb7185;
}

.tx-row.is-orange td:first-child {
  border-left-color: #fb923c;
}

.tx-row.is-purple td:first-child {
  border-left-color: #a78bfa;
}

.tx-date-cell,
.tx-account-cell,
.tx-category-cell,
.tx-source-cell,
.tx-profit-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.tx-date-cell span,
.tx-account-cell strong,
.tx-source-cell span,
.tx-profit-cell strong {
  color: #f8fafc;
  font-weight: 780;
  line-height: 1.15;
}

.tx-date-cell small,
.tx-account-cell span,
.tx-source-cell small,
.tx-profit-cell small,
.tx-muted {
  color: #64748b;
  font-size: 11px;
  line-height: 1.25;
}

.tx-category-badge {
  display: inline-flex;
  width: fit-content;
  max-width: 150px;
  padding: 4px 8px;
  border-radius: 999px;
  color: color-mix(in srgb, var(--tx-cat) 84%, #ffffff 16%);
  background: color-mix(in srgb, var(--tx-cat) 16%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tx-cat) 28%, transparent);
  font-size: 11px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tx-money {
  white-space: nowrap;
  font-weight: 750;
}

.tx-money.is-sale,
.tx-profit-cell.is-good strong,
.tx-profit-cell.is-good small {
  color: #34d399;
}

.tx-money.is-muted {
  color: #64748b;
}

.tx-profit-cell.is-bad strong,
.tx-profit-cell.is-bad small {
  color: #fb7185;
}

.tx-status-badge {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.tx-status-badge.is-sold {
  color: #86efac;
  background: rgba(34, 197, 94, 0.13);
}

.tx-status-badge.is-die {
  color: #fda4af;
  background: rgba(244, 63, 94, 0.13);
}

.tx-status-badge.is-banned {
  color: #fdba74;
  background: rgba(249, 115, 22, 0.13);
}

.tx-status-badge.is-faceid {
  color: #c4b5fd;
  background: rgba(167, 139, 250, 0.13);
}

.tx-note-cell {
  max-width: 170px;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tx-action-btn {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  cursor: pointer;
  font-weight: 850;
}

.tx-action-btn:hover {
  color: #ffffff;
  border-color: rgba(167, 139, 250, 0.42);
}

.tx-empty-state {
  padding: 54px 18px;
  color: #94a3b8;
  text-align: center;
  font-size: 13px;
}

.tx-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: #94a3b8;
  font-size: 12px;
}

.tx-page-size,
.tx-page-controls,
.tx-page-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tx-page-size select {
  min-height: 32px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 10px;
  background: rgba(8, 12, 19, 0.88);
  color: #e2e8f0;
  padding: 5px 8px;
}

.tx-page-btn,
.tx-page-num {
  min-width: 32px;
  height: 32px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  cursor: pointer;
}

.tx-page-btn {
  padding: 0 10px;
}

.tx-page-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.tx-page-num.active {
  color: #ffffff;
  background: rgba(167, 139, 250, 0.17);
  border-color: rgba(167, 139, 250, 0.35);
}

@media (min-width: 640px) {
  .tx-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (min-width: 980px) {
  .tx-summary-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .tx-filter-grid {
    grid-template-columns: 1.6fr repeat(5, minmax(130px, 1fr)) auto;
  }

  .tx-search-field {
    grid-column: span 2;
  }
}

@media (max-width: 720px) {
  .tx-history-header {
    flex-direction: column;
  }

  .tx-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .tx-page-controls {
    overflow-x: auto;
  }
}

/* Top Games widget */
.dash-v-top-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dash-v-top-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dash-v-top-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.dash-v-top-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
}

.dash-v-top-name .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dash-v-top-val {
  color: var(--good);
  font-weight: 700;
  font-size: 13px;
}

.dash-v-top-bar {
  width: 100%;
  height: 6px;
  background: var(--card2);
  border-radius: 999px;
  overflow: hidden;
}

.dash-v-top-bar>span {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width .3s ease;
}

.dash-v-top-sub {
  font-size: 11px;
  color: var(--muted);
}

/* Empty state cho mọi widget */
.dash-v-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
  font-size: 13px;
  border: 1px dashed var(--line);
  border-radius: 12px;
}

/* Sidebar active state for Dashboard nav */
.nav-group-toggle.active {
  background: rgba(70, 95, 255, 0.12);
  color: var(--accent);
}

/* ==================== PAGE VIEW (shared for Sales, Transactions, Analytics) ==================== */
.page-view {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.page-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
  margin: 0;
}

.page-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 0;
}

.page-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* Warnings */
.warning-item {
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
}

.warning-warn {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--warn);
}

.warning-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

/* Transactions pagination */
.tx-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0;
}

/* ==================== DETAIL VIEW ==================== */
.detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.detail-title {
  flex: 1;
}

.detail-type {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 1px;
}

.detail-title h2 {
  font-size: 24px;
  font-weight: 800;
  margin: 4px 0 0;
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.detail-metric-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}

.dm-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dm-value {
  font-size: 22px;
  font-weight: 800;
  margin-top: 4px;
}

.detail-chart-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
}

.detail-chart-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}

.detail-accounts {
  margin-bottom: 24px;
}

.detail-accounts h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

/* ============ NOTES ============ */
.notes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 640px) {
  .notes-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .notes-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.note-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  position: relative;
  transition: box-shadow .15s, transform .15s;
}

.note-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
  transform: translateY(-1px);
}

.note-card.pinned {
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.note-card.done {
  opacity: .6;
}

.note-card.done .note-card-title {
  text-decoration: line-through;
}

.note-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.note-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-card-content {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.note-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.note-type-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}

.note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.note-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--line);
  color: var(--muted);
}

.note-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: none;
  gap: 2px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px 4px;
  z-index: 2;
}

.note-card:hover .note-actions {
  display: flex;
}

.note-actions button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 4px;
}

.note-actions button:hover {
  background: var(--line);
}

/* ============ AI ASSISTANT FULL PAGE ============ */
.aa-page-chat {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 160px);
  min-height: 400px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 16px;
}

.aa-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.aa-msg {
  display: flex;
  max-width: 80%;
  animation: aaFadeIn 0.3s ease;
}

.aa-msg.user {
  align-self: flex-end;
}

.aa-msg.bot {
  align-self: flex-start;
}

.aa-msg-content {
  padding: 12px 18px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.6;
  word-wrap: break-word;
}

.aa-msg.user .aa-msg-content {
  background: linear-gradient(135deg, #4285f4, #7c5cfc);
  color: white;
  border-bottom-right-radius: 4px;
}

.aa-msg.bot .aa-msg-content {
  background: var(--card2);
  color: var(--text);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}

.aa-suggestions {
  display: flex;
  gap: 8px;
  padding: 12px 24px;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  scrollbar-width: none;
}

.aa-suggestions::-webkit-scrollbar {
  display: none;
}

.aa-pill {
  background: var(--card2);
  border: 1px solid var(--line);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

.aa-pill:hover {
  background: linear-gradient(135deg, #4285f420, #7c5cfc20);
  border-color: #7c5cfc60;
}

.aa-input-bar {
  display: flex;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: var(--card);
}

.aa-input {
  flex: 1;
  background: var(--card2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 24px;
  padding: 12px 20px;
  outline: none;
  font-size: 14px;
  transition: border 0.2s;
}

.aa-input:focus {
  border-color: #7c5cfc;
}

.aa-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4285f4, #7c5cfc);
  color: white;
  border: none;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s;
}

.aa-send-btn:hover {
  transform: scale(1.05);
}

.aa-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@keyframes aaFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============ AI ASSISTANT LAYOUT ============ */
.aa-layout {
  display: flex;
  gap: 16px;
  height: calc(100vh - 140px);
  min-height: 500px;
}

.aa-menu {
  width: 320px;
  min-width: 280px;
  flex-shrink: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow-y: auto;
  padding: 12px;
  scrollbar-width: thin;
}

.aa-menu-group {
  margin-bottom: 8px;
}

.aa-menu-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  background: transparent;
  transition: background 0.2s;
  user-select: none;
  border: none;
  width: 100%;
  text-align: left;
}

.aa-menu-toggle:hover {
  background: var(--card2);
}

.aa-menu-toggle .aa-menu-icon {
  font-size: 16px;
}

.aa-menu-toggle .aa-menu-arrow {
  margin-left: auto;
  font-size: 10px;
  transition: transform 0.2s;
  color: var(--text-muted, #888);
}

.aa-menu-toggle.open .aa-menu-arrow {
  transform: rotate(90deg);
}

.aa-menu-items {
  display: none;
  padding: 2px 0 6px 0;
}

.aa-menu-toggle.open+.aa-menu-items {
  display: block;
}

.aa-menu-item {
  display: block;
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: none;
  background: none;
  text-align: left;
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
  line-height: 1.4;
}

.aa-menu-item:hover {
  background: linear-gradient(135deg, #4285f410, #7c5cfc15);
  color: #7c5cfc;
  padding-left: 40px;
}

.aa-menu-count {
  font-size: 11px;
  color: var(--text-muted, #888);
  margin-left: 4px;
}

@media (max-width: 768px) {
  .aa-layout {
    flex-direction: column;
  }

  .aa-menu {
    width: 100%;
    min-width: 0;
    max-height: 200px;
  }
}

/* ==================== VIEW MODE TOGGLE & TOOLBAR ==================== */
#btnToggleView {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

#btnToggleView:hover {
  background: var(--line);
  border-color: var(--muted);
}

/* ==================== SIDEBAR STYLES REDESIGN ==================== */
.sidebar-brand {
  padding: 24px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(168, 85, 247, 0.05));
  border-bottom: 1px solid var(--line);
}

.sidebar-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0;
}

.sidebar-stats-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin: 12px 16px;
}

.sidebar-stats-card.financial {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.04), rgba(124, 58, 237, 0.04));
  border-color: rgba(124, 58, 237, 0.15);
}

.sidebar-stats-card .card-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.stat-grid-6 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 4px;
  text-align: center;
}

.stat-box .stat-num {
  font-size: 14px;
  font-weight: 700;
}

.stat-box .stat-num.good {
  color: var(--good);
}

.stat-box .stat-num.orange {
  color: var(--warn);
}

.stat-box .stat-num.danger {
  color: var(--danger);
}

.stat-box .stat-num.yellow {
  color: var(--yellow);
}

.stat-box .stat-num.blue {
  color: var(--blue);
}

.stat-box .stat-lbl {
  font-size: 9px;
  color: var(--muted);
  margin-top: 2px;
}

.stat-finance {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.finance-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.finance-item .fin-lbl {
  color: var(--muted);
}

.finance-item .fin-val {
  font-weight: 700;
  color: var(--text);
}

.finance-item .fin-val.good {
  color: var(--good);
}

.finance-item .fin-val.danger {
  color: var(--danger);
}

/* ==================== ACCOUNT TABLE LAYOUT ==================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  margin-top: 15px;
}

.acc-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.acc-table th {
  background: var(--card2);
  color: var(--muted);
  font-weight: 600;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
}

.acc-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  transition: background 0.2s ease;
}

.acc-row {
  height: 76px;
}

.acc-row:hover td {
  background: rgba(255, 255, 255, 0.015);
}

.acc-row.selected td {
  background: rgba(124, 58, 237, 0.05);
}

.acc-row.sold {
  border-left: 3.5px solid var(--warn);
}

.acc-row.die {
  border-left: 3.5px solid var(--danger);
}

.acc-row.banned {
  border-left: 3.5px solid var(--yellow);
}

.acc-row.faceid {
  border-left: 3.5px solid var(--blue);
}

.acc-row.available {
  border-left: 3.5px solid var(--good);
}

.td-check {
  text-align: center;
  padding-right: 0 !important;
}

.acc-check-row {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  accent-color: var(--purple);
  cursor: pointer;
}

/* Account Column */
.acc-cell-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.acc-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.acc-credentials {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.acc-user-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.acc-user-row .username {
  font-weight: 600;
  color: var(--text);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acc-cookie-icon {
  font-size: 12px;
  cursor: pointer;
  transition: transform 0.2s;
}

.acc-cookie-icon:hover {
  transform: scale(1.2);
}

/* Row Badges */
.row-badges-wrapper {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 3px;
}

.row-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid;
}

.row-badge.dup {
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
  animation: pulse-dup 2s infinite;
}

/* Info Column & Fields */
.info-fields-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 250px;
}

.acc-field-pill {
  font-size: 11px;
  background: var(--card2);
  border: 1.5px solid var(--line);
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-flex;
  gap: 3px;
}

.acc-field-pill .key {
  color: var(--muted);
  font-weight: 500;
}

.acc-field-pill .val {
  color: var(--text);
  font-weight: 600;
}

/* Quick Status Pills */
.quick-status-pills {
  display: inline-flex;
  gap: 4px;
  background: var(--card2);
  padding: 3px;
  border-radius: 8px;
  border: 1.5px solid var(--line);
}

.status-pill {
  border: none;
  background: none;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s ease;
}

.status-pill:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.status-pill.active.available {
  background: var(--good);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.status-pill.active.sold {
  background: var(--warn);
  color: #fff;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.4);
}

.status-pill.active.die {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.status-pill.active.banned {
  background: var(--yellow);
  color: #000;
  box-shadow: 0 2px 8px rgba(234, 179, 8, 0.4);
}

.status-pill.active.faceid {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

/* Action Button Group */
.action-btn-group {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.row-act-btn {
  background: var(--card2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.row-act-btn:hover {
  background: var(--line);
  border-color: var(--muted);
}

.row-act-btn.danger:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.note-cell-wrap {
  max-width: 54px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  color: var(--muted);
}

/* ==================== SAAS DASHBOARD REDESIGN STYLES ==================== */
body {
  background-color: var(--bg);
  background-image: radial-gradient(at 0% 0%, rgba(124, 58, 237, 0.05) 0px, transparent 50%), radial-gradient(at 50% 0%, rgba(59, 130, 246, 0.03) 0px, transparent 50%);
  background-attachment: fixed;
}

/* Sidebar Custom Shell Overrides */
.sidebar {
  width: 280px !important;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
  background:
    linear-gradient(180deg, rgba(124, 58, 237, 0.07), transparent 190px),
    var(--sidebar-bg) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.sidebar-header,
.sidebar-summary,
.sidebar-footer,
#mobileSettingsSection {
  flex: 0 0 auto;
}

.sidebar-brand {
  min-height: 76px;
  padding: 12px 16px;
  gap: 12px;
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(70, 95, 255, 0.2);
}

.sidebar-brand-name {
  font-size: 13px;
  line-height: 1.15;
  letter-spacing: 0.6px;
}

.sidebar-brand-version {
  display: inline-block;
  margin-top: 3px;
  font-size: 9.5px;
}

.sidebar-stats-container {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sidebar-overview-card {
  padding: 15px 17px;
  max-height: 238px;
  overflow: hidden;
}

.sidebar-card-title {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.9px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.sidebar-overview-main {
  display: block;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 9px;
}

.sidebar-overview-num {
  font-size: clamp(36px, 4.1vh, 40px);
  font-weight: 900;
  color: var(--text);
  line-height: 0.95;
  letter-spacing: 0;
}

.sidebar-overview-lbl {
  margin-top: 5px;
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.sidebar-overview-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-overview-list li {
  min-height: 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  line-height: 1.2;
}

.sidebar-overview-list .lbl {
  color: rgba(255, 255, 255, 0.68);
}

.sidebar-overview-list .val {
  font-size: 12px;
  font-weight: 800;
}

.list-lbl-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.dot-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.sidebar-finance-mini {
  min-height: 88px;
  max-height: 98px;
  padding: 10px 14px;
  background: rgba(16, 185, 129, 0.045);
  overflow: hidden;
}

.sidebar-finance-mini .sidebar-card-title {
  margin-bottom: 4px;
}

.sidebar-finance-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-finance-mini .finance-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  min-height: 14px;
  padding: 0;
  border-bottom: none;
  font-size: 11.5px;
  line-height: 1.1;
}

.sidebar-finance-mini .finance-item:first-child {
  display: none;
}

.sidebar-finance-mini .finance-item:last-child {
  margin-top: 1px;
  padding-top: 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.sidebar-finance-list .fin-lbl {
  color: var(--muted);
}

.sidebar-finance-list .fin-val {
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}

.sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 9px 10px 10px;
}

.sidebar-scroll.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.sidebar-scroll.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.sidebar-nav {
  flex: initial;
  overflow: visible;
  padding: 0;
}

.sidebar-nav.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.sidebar-nav.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.nav-section {
  margin-bottom: 14px;
}

.nav-section-title {
  margin-bottom: 7px;
  padding: 0 8px;
  font-size: 10px;
  letter-spacing: 1px;
  opacity: 0.72;
}

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

.nav-group-toggle,
.sidebar-nav .nav-section>.side-item {
  min-height: 38px;
  padding: 6px 10px;
  gap: 10px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.2;
}

.nav-group-toggle.parent-active,
.nav-group-toggle.active,
.side-item.active,
.nav-sub-item.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(70, 95, 255, 0.95), rgba(124, 58, 237, 0.9));
  box-shadow: 0 6px 18px rgba(70, 95, 255, 0.15);
}

.nav-sub-item,
.nav-group-menu .side-item {
  min-height: 30px;
  padding: 4px 10px 4px 28px;
  margin: 1px 4px;
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.2;
}

.nav-sub-item.active .nav-dot {
  background: #fff;
  box-shadow: none;
}

.side-item {
  min-height: 30px;
  padding: 4px 10px 4px 28px;
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.2;
}

.side-item .count {
  min-width: 24px;
  text-align: center;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 999px;
}

.side-item.active .count {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

.side-item .dot {
  width: 6px;
  height: 6px;
}

.cat-group {
  margin: 2px 0;
  border-radius: 8px;
}

.cat-group-header {
  min-height: 34px;
  padding: 5px 10px 5px 12px;
  border-radius: 8px;
  font-size: 12.5px;
}

.cat-group-header::before {
  top: 7px;
  bottom: 7px;
}

.cat-group-header .count {
  min-width: 24px;
  text-align: center;
  font-size: 10px;
  padding: 1px 5px;
}

.cat-group-list {
  padding: 1px 0 4px;
  gap: 1px;
}

.cat-group-list .side-item {
  min-height: 30px;
  padding: 4px 10px 4px 28px;
  font-size: 12px;
}

.nav-add-btn,
.cat-group-list .nav-add-btn {
  min-height: 28px;
  padding: 4px 10px 4px 28px;
}

.sidebar-footer {
  flex: 0 0 auto;
  padding: 6px 12px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
  opacity: 1;
}

.sidebar-theme-toggle {
  width: 100%;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 10px;
}

.theme-switch {
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: rgba(70, 95, 255, 0.35);
  position: relative;
}

.theme-switch::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  top: 2px;
  right: 2px;
  border-radius: 50%;
  background: #fff;
}

/* [data-theme="light"] .theme-switch::after {
  right: 18px;
} */

.sidebar-copyright {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.45px;
  opacity: 0.55;
  font-weight: 700;
}

@media (max-height: 820px) {
  .sidebar-brand {
    min-height: 82px;
    padding: 12px 16px;
  }

  .sidebar-brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .sidebar-stats-container {
    padding: 8px 12px;
    gap: 6px;
  }

  .sidebar-overview-card {
    padding: 11px 14px;
    max-height: 214px;
  }

  .sidebar-overview-num {
    font-size: 32px;
  }

  .sidebar-overview-main {
    margin-bottom: 6px;
    padding-bottom: 7px;
  }

  .sidebar-overview-list {
    gap: 2px;
  }

  .sidebar-overview-list li {
    min-height: 17px;
    font-size: 11.5px;
  }

  .sidebar-finance-mini {
    min-height: 88px;
    max-height: 90px;
    padding: 8px 12px;
  }

  .sidebar-footer {
    padding: 8px 12px;
  }

  .sidebar-copyright {
    display: none;
  }
}

/* Topbar overrides */
.topbar-search-box focus-within {
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

/* KPI Cards Layout */
#statsGrid.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

#statsGrid>.stat-card {
  height: 108px;
  background: var(--card) !important;
  border: 1px solid var(--line) !important;
  border-radius: 16px !important;
  padding: 16px 20px !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 58, 237, 0.3) !important;
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.08);
}

.stat-card-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-card-info .label {
  font-size: 10px !important;
  font-weight: 800 !important;
  color: var(--muted) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.8px !important;
  margin-bottom: 6px !important;
}

.stat-card-info .value {
  font-size: 32px !important;
  font-weight: 900 !important;
  color: var(--text) !important;
  line-height: 1 !important;
  margin-top: 0 !important;
}

.stat-card-icon {
  font-size: 36px;
  opacity: 0.06;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.stat-card:hover .stat-card-icon {
  opacity: 0.12;
  transform: translateY(-50%) scale(1.05);
}

/* Finance Summary Horizontal Bar */
.finance-summary-bar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  background: rgba(17, 22, 34, 0.45);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-top: 4px;
}

.finance-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-right: 1px solid var(--line);
}

.finance-block:last-child {
  border-right: none;
}

.finance-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.finance-block .label {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 2px;
}

.finance-block .value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

/* Modern Data Table styles */
.acc-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

.acc-table th {
  background: var(--card2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.acc-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--text);
}

.acc-row {
  height: 64px;
  transition: background-color 0.15s;
}

.acc-row:hover {
  background-color: var(--card2) !important;
}

.acc-row.selected {
  background-color: rgba(124, 58, 237, 0.04) !important;
}

.acc-row.selected td {
  border-bottom-color: rgba(124, 58, 237, 0.2);
}

/* Segemented Control status Quick Change Pills */
.quick-status-pills {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}

.status-pill {
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.status-pill:hover {
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.status-pill.active[data-status="available"] {
  background: rgba(34, 197, 94, 0.15);
  color: #22C55E;
}

.status-pill.active[data-status="sold"] {
  background: rgba(245, 158, 11, 0.15);
  color: #F59E0B;
}

.status-pill.active[data-status="die"] {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
}

.status-pill.active[data-status="banned"] {
  background: rgba(234, 179, 8, 0.15);
  color: #EAB308;
}

.status-pill.active[data-status="faceid"] {
  background: rgba(59, 130, 246, 0.15);
  color: #3B82F6;
}

/* Special Badges inside table cells */
.cell-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--text);
}

/* Modern Data Table Columns Fit and Badges */
.source-cell {
  display: inline-flex;
  align-items: center;
  max-width: 100px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-cell {
  display: inline-flex;
  align-items: center;
  max-width: 140px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acc-credentials {
  min-width: 0;
  flex: 1;
}

.acc-user-row {
  min-width: 0;
  width: 100%;
}

.acc-user-row .username {
  max-width: 120px !important;
  display: inline-block;
  vertical-align: middle;
}

.td-account,
.td-source,
.td-category,
.td-cost,
.td-price,
.td-status-quick,
.td-date,
.td-note,
.td-actions {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Compact status segmented pills */
.quick-status-pills {
  display: inline-flex !important;
  white-space: nowrap !important;
  flex-wrap: nowrap !important;
  width: 250px !important;
  justify-content: space-between;
}

.status-pill {
  flex: 1 1 auto;
  text-align: center;
  font-size: 10px !important;
  padding: 4px 5px !important;
  margin: 0 !important;
}

/* Prevent body horizontal scroll */
body {
  overflow-x: hidden !important;
}

.main-content {
  flex: 1;
  min-width: 0;
  overflow-x: hidden;
}

.dashboard-page {
  width: 100%;
  max-width: 100%;
}

.account-table-card {
  width: 100%;
  overflow: hidden;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* =========================================================
   UI REDESIGN V2 - STABILIZED DASHBOARD
   ========================================================= */
:root,
[data-theme="dark"] {
  --bg-root: var(--bg);
  --bg-sidebar: var(--sidebar-bg);
  --bg-card: var(--card);
  --bg-card-hover: var(--surface-2);
  --border-soft: var(--border);
  --text-primary: var(--text-primary);
  --text-secondary: var(--text-secondary);
  --accent-purple: var(--accent);
  --accent-green: var(--good);
  --accent-orange: var(--warn);
  --accent-red: var(--danger);
  --accent-blue: var(--blue);
  --accent-yellow: var(--yellow);
}

/* [data-theme="light"] light rules removed */

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
  background: var(--bg-root);
}

body {
  color: var(--text-primary);
}

.app-shell {
  width: 100%;
  min-width: 0;
  background: var(--bg-root);
}

.content-shell {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  background: transparent;
}

.sidebar {
  width: 272px !important;
  flex: 0 0 272px;
  height: 100vh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
  background: var(--bg-sidebar) !important;
  border-right: 1px solid var(--border-soft) !important;
}

.sidebar-stats,
.sidebar-stats-container,
.sidebar-summary,
.sidebar-card,
.sidebar-overview-card,
.sidebar-finance-mini {
  display: none !important;
}

.sidebar-header {
  flex: 0 0 auto;
  border-bottom: 1px solid var(--border-soft);
}

.sidebar-brand {
  min-height: 82px !important;
  padding: 16px 18px !important;
  border-bottom: 0 !important;
}

.sidebar-brand-logo {
  width: 44px !important;
  height: 44px !important;
  border-radius: 10px !important;
  box-shadow: 0 10px 28px rgba(124, 58, 237, 0.32);
}

.sidebar-brand-name {
  font-size: 12px !important;
  letter-spacing: 0.9px !important;
}

.sidebar-brand-version {
  color: var(--text-secondary);
}

.sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 10px;
}

.sidebar-scroll::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.sidebar-scroll::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.18);
  border-radius: 999px;
}

.sidebar-nav {
  padding: 0 !important;
  overflow: visible !important;
}

.nav-section {
  margin-bottom: 16px;
}

.nav-section-title {
  margin: 8px 8px 7px;
  padding: 0;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
}

.nav-group-toggle,
.nav-sub-item,
.side-item,
.cat-group-header {
  border-radius: 8px !important;
}

.nav-group-toggle {
  min-height: 38px !important;
  padding: 8px 10px !important;
  color: var(--text-secondary);
}

.nav-group-toggle:hover,
.nav-sub-item:hover,
.side-item:hover,
.cat-group-header:hover {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-primary);
}

.nav-group-toggle.parent-active,
.nav-group-toggle.active {
  color: var(--sidebar-active-text) !important;
  background: var(--sidebar-active) !important;
  box-shadow: inset 0 0 0 1px var(--sidebar-active-border) !important;
}

.nav-sub-item.active,
.side-item.active {
  color: var(--sidebar-active-text) !important;
  background: var(--accent-hover) !important;
  box-shadow: inset 0 0 0 1px var(--accent-border) !important;
}

.side-item {
  min-height: 34px !important;
  padding: 7px 9px 7px 24px !important;
  font-size: 12px !important;
}

.side-item .name,
.nav-label,
.cg-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-item .count,
.cat-group-header .count,
.nav-badge {
  min-width: 26px;
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
}

.side-item.active .count,
.nav-sub-item.active .nav-dot {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
}

.cat-group {
  margin: 2px 0 !important;
}

.cat-group-header {
  min-height: 36px !important;
  padding: 7px 9px 7px 12px !important;
  color: var(--text-secondary);
}

.cat-group-list .side-item {
  padding-left: 28px !important;
}

.nav-add-btn {
  min-height: 30px !important;
  border-radius: 8px !important;
}

.sidebar-footer {
  flex: 0 0 auto;
  padding: 10px 12px 12px !important;
  border-top: 1px solid var(--border-soft) !important;
}

.sidebar-theme-toggle {
  border-radius: 8px !important;
  background: rgba(148, 163, 184, 0.08) !important;
  border-color: var(--border-soft) !important;
}

.app-topbar {
  height: 68px !important;
  flex: 0 0 auto;
  padding: 0 20px !important;
  background: rgba(16, 21, 34, 0.86) !important;
  border-bottom: 1px solid var(--border-soft) !important;
  backdrop-filter: blur(18px);
}

/* [data-theme="light"] .app-topbar {
  background: rgba(255, 255, 255, 0.9) !important;
} */

.app-topbar-inner {
  max-width: none !important;
  min-width: 0;
  gap: 12px !important;
}

.topbar-left {
  min-width: 220px;
  max-width: 390px !important;
  flex: 1 1 360px;
}

.topbar-search-box {
  height: 38px;
  max-width: 360px !important;
  min-width: 0;
  border-radius: 8px !important;
  background: rgba(148, 163, 184, 0.08) !important;
  border-color: var(--border-soft) !important;
}

.topbar-search-box:focus-within,
.table-search-box:focus-within {
  border-color: rgba(124, 58, 237, 0.62) !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.16);
}

.header-actions {
  min-width: 0;
  flex: 0 1 auto;
  gap: 8px !important;
  white-space: nowrap;
}

.header-actions .btn,
.avatar-btn,
.settings-group {
  height: 36px;
  border-radius: 8px !important;
  border-color: var(--border-soft) !important;
  background: rgba(148, 163, 184, 0.08);
  flex-shrink: 0;
}

#syncStatus {
  height: 36px;
  max-width: 230px;
  min-width: 156px;
  overflow: hidden;
  border-radius: 8px !important;
  border-color: var(--border-soft) !important;
  background: rgba(148, 163, 184, 0.08) !important;
}

#syncTime,
#dataSizeLabel {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#btnAddAcc {
  height: 38px;
  min-width: 72px;
  border-radius: 8px !important;
  box-shadow: 0 12px 26px rgba(124, 58, 237, 0.24) !important;
}

#btnTheme {
  width: 38px;
  min-width: 38px;
}

.main-content {
  flex: 1 1 auto !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: hidden !important;
  padding: 24px !important;
}

.content-header {
  align-items: flex-end !important;
  border-bottom: 0 !important;
  padding-bottom: 4px !important;
  margin-bottom: 18px !important;
}

.breadcrumb {
  letter-spacing: 0.08em !important;
}

#viewTitle {
  max-width: min(760px, 72vw);
  overflow-wrap: anywhere;
  line-height: 1.1;
}

#viewSubtitle {
  border-radius: 999px !important;
  background: rgba(124, 58, 237, 0.13) !important;
  white-space: nowrap;
}

.content-actions {
  justify-content: flex-end;
}

.content-actions .btn {
  height: 34px;
  border-radius: 8px !important;
  padding: 7px 10px;
  font-size: 12px;
}

.stats-grid {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 14px !important;
  margin-bottom: 18px !important;
  min-width: 0;
}

.stat-card {
  height: 104px !important;
  min-width: 0 !important;
  border-radius: 8px !important;
  padding: 15px 16px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.018)), var(--bg-card) !important;
  border: 1px solid var(--border-soft) !important;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.16) !important;
}

#statsGrid .stat-card-info .label,
#statsGrid>.stat-card .label {
  font-size: 10px !important;
  color: var(--text-secondary) !important;
  letter-spacing: 0.08em !important;
}

#statsGrid .stat-card-info .value,
#statsGrid>.stat-card .value {
  font-size: clamp(24px, 2.1vw, 32px) !important;
  color: var(--text-primary);
}

#statsGrid .stat-card-icon {
  right: 13px !important;
  font-size: 34px !important;
  opacity: 0.08 !important;
}

.finance-summary-bar {
  grid-column: 1 / -1;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 0 !important;
  width: 100%;
  border-radius: 8px !important;
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.07), rgba(59, 130, 246, 0.035)), var(--bg-card) !important;
  border: 1px solid var(--border-soft) !important;
  padding: 12px 14px !important;
  margin-top: 2px !important;
  overflow: hidden;
}

.finance-block {
  min-width: 0;
  padding: 7px 14px !important;
  gap: 10px !important;
}

.finance-icon-box {
  width: 36px !important;
  height: 36px !important;
  border-radius: 8px !important;
  flex: 0 0 36px;
}

.finance-block .value {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-table-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border-radius: 8px !important;
  border-color: var(--border-soft) !important;
  background: var(--bg-card) !important;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22) !important;
}

.account-toolbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 12px !important;
  background: rgba(148, 163, 184, 0.055) !important;
  border-bottom: 1px solid var(--border-soft) !important;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.toolbar-left {
  flex: 1 1 520px;
}

.toolbar-right {
  flex: 0 0 auto;
  justify-content: flex-end;
}

.table-search-box {
  height: 36px;
  flex: 1 1 260px;
  min-width: 180px;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(7, 10, 18, 0.34);
  color: var(--text-secondary);
}

/* [data-theme="light"] .table-search-box {
  background: rgba(15, 23, 42, 0.04);
} */

.table-search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
}

#filterStatus {
  height: 36px;
  min-width: 164px;
  border-radius: 8px !important;
}

.toolbar-right .btn {
  height: 34px;
  border-radius: 8px !important;
}

.selection-bar {
  margin: 0 !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(124, 58, 237, 0.22) !important;
  border-radius: 0 !important;
  background: rgba(124, 58, 237, 0.075) !important;
}

.selection-bar.show {
  display: flex !important;
}

.selection-bar .actions {
  gap: 6px !important;
}

.selection-bar .btn {
  height: 30px;
  border-radius: 8px !important;
  padding: 5px 8px;
  font-size: 11px;
}

.bulk-secondary {
  background: rgba(148, 163, 184, 0.09) !important;
}

.acc-list {
  padding: 12px !important;
  min-width: 0;
}

.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  margin-top: 0 !important;
  border-radius: 8px !important;
  border: 1px solid var(--border-soft) !important;
  background: rgba(7, 10, 18, 0.18) !important;
}

.acc-table {
  width: 100%;
  min-width: 1078px;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  table-layout: fixed;
  font-size: 12px;
}

.acc-table th {
  height: 38px;
  padding: 9px 8px !important;
  background: rgba(148, 163, 184, 0.055) !important;
  border-bottom: 1px solid var(--border-soft) !important;
  color: var(--text-secondary) !important;
  font-size: 10px !important;
  letter-spacing: 0.06em !important;
}

.acc-table td {
  height: 76px;
  padding: 9px 8px !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1) !important;
  vertical-align: middle;
}

.acc-row {
  height: 76px !important;
}

.acc-row:hover td {
  background: rgba(148, 163, 184, 0.055) !important;
}

.td-check {
  text-align: center;
  padding-left: 6px !important;
  padding-right: 4px !important;
}

.acc-check-row {
  width: 15px !important;
  height: 15px !important;
}

.td-account,
.td-source,
.td-category,
.td-cost,
.td-price,
.td-status-quick,
.td-date,
.td-note,
.td-actions {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acc-cell-wrapper {
  min-width: 0;
  gap: 10px !important;
}

.acc-avatar {
  width: 38px !important;
  height: 38px !important;
  border-radius: 8px !important;
  flex: 0 0 38px;
}

.acc-credentials {
  min-width: 0;
  overflow: hidden;
}

.acc-user-row {
  max-width: 100%;
}

.acc-user-row .username {
  max-width: 136px !important;
  display: block;
  color: var(--text-primary);
}

.acc-pass-row span {
  display: block;
  max-width: 138px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-badges-wrapper {
  display: flex;
  flex-wrap: nowrap !important;
  gap: 4px;
  max-width: 152px;
  overflow: hidden;
}

.row-badge {
  flex: 0 1 auto;
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 6px !important;
}

.source-cell,
.category-cell {
  max-width: 100%;
  width: 100%;
  min-width: 0;
  justify-content: flex-start;
  border-radius: 7px !important;
  padding: 4px 7px !important;
}

.td-cost,
.td-price {
  font-size: 12px !important;
}

.quick-status-pills {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 3px !important;
  padding: 3px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.035) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  width: 220px !important;
  max-width: 240px !important;
}

.status-pill {
  height: 24px !important;
  min-width: 36px !important;
  flex: 1 1 auto !important;
  padding: 0 4px !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 22px !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
  transition: all 0.2s ease !important;
}

.status-pill:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--text-primary) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

.status-pill.active[data-status="available"],
.status-pill.active.available {
  background: rgba(34, 197, 94, 0.12) !important;
  border: 1px solid var(--accent-green) !important;
  color: #22C55E !important;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.2) !important;
}

.status-pill.active[data-status="sold"],
.status-pill.active.sold {
  background: rgba(245, 158, 11, 0.12) !important;
  border: 1px solid var(--accent-orange) !important;
  color: #F59E0B !important;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.2) !important;
}

.status-pill.active[data-status="die"],
.status-pill.active.die {
  background: rgba(239, 68, 68, 0.12) !important;
  border: 1px solid var(--accent-red) !important;
  color: #EF4444 !important;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.2) !important;
}

.status-pill.active[data-status="banned"],
.status-pill.active.banned {
  background: rgba(234, 179, 8, 0.12) !important;
  border: 1px solid var(--accent-yellow) !important;
  color: #EAB308 !important;
  box-shadow: 0 0 6px rgba(234, 179, 8, 0.2) !important;
}

.status-pill.active[data-status="faceid"],
.status-pill.active.faceid {
  background: rgba(59, 130, 246, 0.12) !important;
  border: 1px solid var(--accent-blue) !important;
  color: #3B82F6 !important;
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.2) !important;
}

.note-cell-wrap {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-btn-group {
  gap: 4px !important;
  justify-content: flex-end !important;
}

.row-act-btn {
  width: 25px !important;
  height: 25px !important;
  border-radius: 7px !important;
  background: rgba(148, 163, 184, 0.08) !important;
  border-color: var(--border-soft) !important;
}

.row-act-btn:hover {
  transform: translateY(-1px);
  background: rgba(124, 58, 237, 0.16) !important;
  color: #fff;
}

.empty {
  border: 1px dashed var(--border-soft);
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.04);
}



@media (max-width: 1500px) {

  #dataSizeBar {
    display: none;
  }
}

@media (max-width: 1320px) {
  #dataSizeLabel {
    display: none;
  }

  #syncStatus {
    min-width: 132px;
    max-width: 156px;
  }

}

@media (max-width: 1180px) {
  #statsGrid.stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .finance-summary-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .finance-block:nth-child(2) {
    border-right: none;
  }

  .account-toolbar {
    align-items: stretch !important;
  }

  .toolbar-left,
  .toolbar-right {
    width: 100%;
    flex: 1 1 100%;
  }

  .toolbar-right {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .main-content {
    padding: 16px !important;
  }

  #statsGrid.stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  #statsGrid>.stat-card {
    height: 96px !important;
    padding: 12px !important;
  }

  .finance-summary-bar {
    grid-template-columns: 1fr !important;
  }

  .finance-block,
  .finance-block:nth-child(2) {
    border-right: none !important;
    border-bottom: 1px solid var(--border-soft);
  }

  .finance-block:last-child {
    border-bottom: none !important;
  }

  .content-header {
    align-items: flex-start !important;
  }

  .content-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .content-actions .btn {
    flex: 1 1 auto;
  }

  .toolbar-left,
  .toolbar-right {
    flex-wrap: wrap;
  }

  .table-search-box,
  #filterStatus {
    flex: 1 1 100%;
    max-width: none;
    width: 100%;
  }
}

/* =========================================================
   QUICK STATUS BUTTONS - REFERENCE STYLE FIX
   ========================================================= */
.quick-status-pills {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  width: auto !important;
  max-width: 270px !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  white-space: nowrap !important;
}

.status-pill {
  height: 30px !important;
  min-width: 48px !important;
  padding: 0 10px !important;
  border-radius: 9px !important;
  background: rgba(15, 23, 42, 0.72) !important;
  border: 1px solid rgba(148, 163, 184, 0.18) !important;
  color: #94A3B8 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease !important;
}

.status-pill:hover {
  transform: translateY(-1px) !important;
}

/* Base style overrides per status when inactive */
.status-pill.status-available {
  border-color: rgba(34, 197, 94, 0.45) !important;
  color: #22C55E !important;
  background: rgba(34, 197, 94, 0.05) !important;
}

.status-pill.status-sold {
  border-color: rgba(245, 158, 11, 0.45) !important;
  color: #F59E0B !important;
  background: rgba(245, 158, 11, 0.05) !important;
}

.status-pill.status-die {
  border-color: rgba(239, 68, 68, 0.45) !important;
  color: #EF4444 !important;
  background: rgba(239, 68, 68, 0.05) !important;
}

.status-pill.status-banned {
  border-color: rgba(234, 179, 8, 0.45) !important;
  color: #EAB308 !important;
  background: rgba(234, 179, 8, 0.05) !important;
}

.status-pill.status-faceid {
  border-color: rgba(59, 130, 246, 0.45) !important;
  color: #3B82F6 !important;
  background: rgba(59, 130, 246, 0.05) !important;
}

/* Active State styling with backgrounds and glows */
.status-pill.status-available.active {
  background: linear-gradient(135deg, #10B981, #16A34A) !important;
  border-color: #22C55E !important;
  color: #FFFFFF !important;
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.28) !important;
}

.status-pill.status-sold.active {
  background: linear-gradient(135deg, #F59E0B, #D97706) !important;
  border-color: #F59E0B !important;
  color: #111827 !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.25) !important;
}

.status-pill.status-die.active {
  background: linear-gradient(135deg, #EF4444, #DC2626) !important;
  border-color: #EF4444 !important;
  color: #FFFFFF !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.25) !important;
}

.status-pill.status-banned.active {
  background: linear-gradient(135deg, #EAB308, #F59E0B) !important;
  border-color: #F59E0B !important;
  color: #111827 !important;
  box-shadow: 0 0 16px rgba(234, 179, 8, 0.25) !important;
}

.status-pill.status-faceid.active {
  background: linear-gradient(135deg, #3B82F6, #2563EB) !important;
  border-color: #3B82F6 !important;
  color: #FFFFFF !important;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.25) !important;
}

/* =========================================================
   SaaS MODERN DATA TABLE UI/UX OPTIMIZATIONS
   ========================================================= */
.acc-table th {
  height: 48px !important;
  padding: 0 12px !important;
  font-size: 11px !important;
  letter-spacing: .05em !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  background: var(--bg-sidebar) !important;
  border-bottom: 1px solid var(--border-soft) !important;
}

.acc-table td {
  height: 68px !important;
  padding: 10px 12px !important;
  vertical-align: middle !important;
  border-bottom: 1px solid var(--border-soft) !important;
}

.acc-row {
  height: 68px !important;
  transition: background .16s ease, border-color .16s ease !important;
}

.acc-row:hover {
  background: var(--accent-soft) !important;
}

.acc-row.selected {
  background: var(--accent-hover) !important;
  box-shadow: inset 3px 0 0 var(--accent) !important;
}

/* Account credentials fonts */
.acc-credentials .username {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  max-width: 170px !important;
}

.acc-pass-row {
  font-size: 12px !important;
  color: var(--text-secondary) !important;
}

/* Source badge custom styling */
.source-cell {
  display: inline-flex !important;
  align-items: center !important;
  max-width: 110px !important;
  height: 24px !important;
  padding: 0 8px !important;
  border-radius: 7px !important;
  background: rgba(148, 163, 184, 0.08) !important;
  border: 1px solid rgba(148, 163, 184, 0.12) !important;
  color: #CBD5E1 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Category badge custom styling */
.category-cell {
  display: inline-flex !important;
  align-items: center !important;
  max-width: 130px !important;
  height: 24px !important;
  padding: 0 8px !important;
  border-radius: 7px !important;
  background: rgba(239, 68, 68, 0.08) !important;
  border: 1px solid rgba(239, 68, 68, 0.12) !important;
  color: #EF4444 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Compact status buttons */
.quick-status-pills {
  gap: 5px !important;
}

.status-pill {
  height: 28px !important;
  min-width: 44px !important;
  padding: 0 8px !important;
  border-radius: 8px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 26px !important;
  box-shadow: none !important;
}

.status-pill.status-available {
  min-width: 48px !important;
}

.status-pill.status-faceid {
  min-width: 48px !important;
}

/* SVG Action Buttons */
.action-btn-group {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.row-act-btn {
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
  background: rgba(148, 163, 184, 0.06) !important;
  border: 1px solid rgba(148, 163, 184, 0.1) !important;
  color: var(--text-secondary) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  cursor: pointer !important;
  transition: all 0.16s ease !important;
}

.row-act-btn svg {
  stroke: currentColor;
  transition: stroke 0.16s ease !important;
}

.row-act-btn:hover {
  background: rgba(148, 163, 184, 0.12) !important;
  color: var(--text-primary) !important;
  transform: translateY(-1px) !important;
}

.row-act-btn[data-action="edit"]:hover {
  background: rgba(124, 58, 237, 0.12) !important;
  border-color: rgba(124, 58, 237, 0.3) !important;
  color: #a78bfa !important;
}

.row-act-btn.danger:hover {
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: #f87171 !important;
}

/* SVG Icon Styling Classes */
.ui-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  stroke: currentColor;
  vertical-align: middle;
}

.ui-icon-sm {
  width: 14px;
  height: 14px;
}

.ui-icon-md {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   SIDEBAR REDESIGN (V3 PREMIUM DARK THEME OVERRIDES)
   ========================================================================== */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 270px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

@media (min-width: 1024px) {
  .sidebar {
    position: static;
  }
}

.sidebar-header {
  padding: 24px 20px 16px 20px;
  border-bottom: 1px solid var(--line);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  display: grid;
  place-items: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(109, 93, 246, 0.25);
}

.sidebar-brand-name {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text);
}

.sidebar-brand-version {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

/* Nav sections gap */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-title {
  font-size: 9.5px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 1.5px;
  padding: 0 12px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

/* Side Item & Group Toggles */
.sidebar .side-item,
.nav-group-toggle {
  min-height: 38px !important;
  height: 38px !important;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  text-decoration: none;
}

.sidebar .side-item:hover,
.nav-group-toggle:hover {
  background: rgba(255, 255, 255, 0.04) !important;
  color: var(--text) !important;
  border-color: rgba(255, 255, 255, 0.02);
}

/* Active State Styles */
.sidebar .side-item.active,
.nav-group-toggle.active {
  background: linear-gradient(135deg, rgba(109, 93, 246, 0.12) 0%, rgba(124, 58, 237, 0.12) 100%) !important;
  border: 1px solid rgba(109, 93, 246, 0.25) !important;
  color: #c4b5fd !important;
  font-weight: 600 !important;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.03);
}

.sidebar .side-item.active .nav-icon svg,
.nav-group-toggle.active .nav-icon svg {
  color: #a78bfa !important;
  filter: drop-shadow(0 0 4px rgba(167, 139, 250, 0.2));
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: inherit;
}

.nav-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
  color: inherit;
  transition: color 0.2s;
}

.nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Arrows and badges */
.nav-arrow {
  font-size: 8px;
  color: var(--muted);
  transition: transform 0.2s;
}

.nav-group-toggle.active .nav-arrow {
  color: #a78bfa;
}

.nav-badge {
  background: rgba(109, 93, 246, 0.15);
  color: #c4b5fd;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(109, 93, 246, 0.2);
}

/* Nested lists styling */
.nav-group-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}

.nav-sub-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-sub-list .side-item {
  min-height: 34px !important;
  height: 34px !important;
  padding-left: 36px !important;
  font-size: 12px;
}

.nav-sub-list .side-item.active {
  background: rgba(109, 93, 246, 0.08) !important;
  border-color: rgba(109, 93, 246, 0.15) !important;
}

/* DOT elements styling */
.side-item .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 2px;
  box-shadow: 0 0 6px var(--cg-color, currentColor);
}

/* Counts badge inside items */
.side-item .count,
.cat-group-header .count {
  font-size: 10px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  padding: 1px 6px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
}

.side-item.active .count,
.cat-group-header.active .count {
  background: rgba(109, 93, 246, 0.18);
  color: #c4b5fd;
}

/* Action button inside items */
.settings-btn,
.nav-add-btn {
  opacity: 0;
  transition: opacity 0.2s, background-color 0.2s;
}

.side-item:hover .settings-btn,
.nav-group-toggle:hover .settings-btn,
.cat-group-header:hover .settings-btn {
  opacity: 1;
}

.settings-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

/* Category groups overrides */
.cat-group {
  border: 1px solid transparent;
  border-radius: 8px;
  transition: background-color 0.2s;
  overflow: hidden;
}

.cat-group-header {
  min-height: 38px !important;
  height: 38px !important;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.cat-group-header:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.cat-group-header .arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--muted);
  width: 12px;
}

.cat-group-header .cg-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-group-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.02);
}

.cat-group-list .side-item {
  padding-left: 24px !important;
}

/* Add buttons in sub-lists */
.nav-add-btn {
  width: calc(100% - 24px);
  margin: 4px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 0;
  cursor: pointer;
  transition: all 0.2s;
  display: block;
  text-align: center;
  opacity: 0.8;
}

.nav-group-menu:hover .nav-add-btn {
  opacity: 1;
}

.nav-add-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-secondary);
}

.nav-add-btn.purple {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--text-secondary);
}

.nav-add-btn.purple:hover {
  background: var(--accent-hover);
  border-color: var(--accent-border);
  color: var(--text-primary);
}

/* Footer & storage indicators */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--line);
  background: rgba(8, 15, 20, 0.3);
}

.sidebar-storage-container {
  padding: 4px 4px 12px 4px;
}

.storage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.storage-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.storage-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}

.storage-bar-fill {
  height: 100%;
  width: 0;
  background: var(--good);
  border-radius: 3px;
  transition: all 0.4s ease;
}

/* User Card component in Footer */
.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sidebar-user-card .user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(109, 93, 246, 0.1);
  border: 1px solid rgba(109, 93, 246, 0.3);
  display: grid;
  place-items: center;
  color: #a78bfa;
  flex-shrink: 0;
}

.sidebar-user-card .user-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.sidebar-user-card .user-email {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-card .user-role {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--muted);
}

.sidebar-user-card .user-logout-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.sidebar-user-card .user-logout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* Sidebar Close and Overlay */
.sidebar-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--text-secondary);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  display: none;
  place-items: center;
  cursor: pointer;
  font-size: 12px;
  z-index: 100;
}

.sidebar-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 49;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

/* Mobile Sidebar Drawer behavior */
@media (max-width: 1023px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .sidebar-close {
    display: grid;
  }
}

/* Sidebar Theme Switch Styling */
.sidebar-theme-toggle-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 6px;
}

.sidebar-theme-toggle-container .theme-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.sidebar-theme-toggle-container .theme-switch {
  position: relative;
  width: 34px;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  cursor: not-allowed;
  transition: background-color 0.2s;
}

.sidebar-theme-toggle-container .theme-switch.active {
  background: var(--accent);
}

.sidebar-theme-toggle-container .theme-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.sidebar-theme-toggle-container .theme-switch.active::after {
  transform: translateX(14px);
}

/* === PREMIUM DARK SAAS SIDEBAR COLOR SCHEME OVERRIDES === */
.sidebar {
  background: var(--sidebar-bg) !important;
  border-right: 1px solid var(--border) !important;
}

/* Brand logo styling */
.sidebar-brand-logo {
  background: var(--accent) !important;
  box-shadow: 0 4px 12px rgba(229, 231, 235, 0.08) !important;
  color: var(--bg) !important;
}

/* Inactive Sidebar Navigation Items */
.sidebar .nav-group-toggle,
.sidebar .side-item,
.sidebar .nav-sub-item,
.sidebar .cat-group-header {
  color: var(--text-secondary) !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Inactive Sidebar Navigation Items Hover State */
.sidebar .nav-group-toggle:hover,
.sidebar .side-item:hover,
.sidebar .nav-sub-item:hover,
.sidebar .cat-group-header:hover {
  background: var(--sidebar-surface-hover) !important;
  color: var(--text) !important;
}

/* Parent/Top-level Active Navigation Items */
.sidebar .nav-group-toggle.active,
.sidebar .nav-group-toggle.parent-active,
.sidebar .nav-section>.side-item.active {
  background: var(--sidebar-active) !important;
  box-shadow: inset 0 0 0 1px var(--sidebar-active-border) !important;
  color: var(--sidebar-active-text) !important;
}

.sidebar .nav-group-toggle.active .nav-icon svg,
.sidebar .nav-group-toggle.parent-active .nav-icon svg,
.sidebar .nav-section>.side-item.active .nav-icon svg {
  color: var(--sidebar-active-text) !important;
  filter: none !important;
}

/* Child/Nested Active Sub-menu Navigation Items */
.sidebar .nav-sub-item.active,
.sidebar .nav-group-menu .side-item.active,
.sidebar .cat-group-list .side-item.active {
  background: var(--accent-hover) !important;
  box-shadow: inset 0 0 0 1px var(--accent-border) !important;
  color: var(--sidebar-active-text) !important;
}

/* Bullet Dot Submenu styling without glow */
.nav-dot {
  background: var(--muted) !important;
  box-shadow: none !important;
  opacity: 0.6;
}

.nav-sub-item.active .nav-dot,
.side-item.active .dot {
  background: var(--accent) !important;
  box-shadow: none !important;
  opacity: 1;
}

/* Arrow indicator styling */
.nav-arrow {
  color: var(--muted) !important;
}

.nav-group-toggle.active .nav-arrow,
.nav-group-toggle.parent-active .nav-arrow {
  color: var(--text-secondary) !important;
}

/* Count badges inside navigation items */
.side-item .count,
.cat-group-header .count {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--text-secondary) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.side-item.active .count,
.cat-group-header.active .count {
  background: var(--accent-soft) !important;
  color: var(--sidebar-active-text) !important;
  border: 1px solid var(--accent-border) !important;
}

/* Collapse/Add actions opacity overrides */
.settings-btn,
.nav-add-btn {
  color: var(--text-secondary) !important;
}

.settings-btn:hover,
.nav-add-btn:hover {
  color: var(--text) !important;
}

/* Sidebar Footer border */
.sidebar-footer {
  border-top: 1px solid var(--border) !important;
}

/* =========================================================
   ACCOUNT TABLE LAYOUT HOTFIX V5
   11 columns, source under account, status 2 rows
   ========================================================= */

.table-responsive,
.account-table-wrap,
.accounts-table-wrap {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  position: relative !important;
}

.acc-table {
  table-layout: auto !important;
  width: max-content !important;
  min-width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  margin: 0 !important;
}

.acc-table th,
.acc-table td {
  box-sizing: border-box !important;
  min-width: 0 !important;
  overflow: hidden !important;
  vertical-align: middle !important;
}

.acc-table th {
  height: 48px !important;
  padding: 0 10px !important;
  white-space: nowrap !important;
}

.acc-table td {
  height: 82px !important;
  padding: 10px !important;
}

.acc-table thead th {
  border-bottom: 1px solid rgba(229, 231, 235, 0.12) !important;
  border-right: 1px solid rgba(229, 231, 235, 0.055) !important;
}

.acc-table tbody td {
  border-bottom: 1px solid rgba(229, 231, 235, 0.075) !important;
  border-right: 1px solid rgba(229, 231, 235, 0.045) !important;
}

.acc-table thead th:last-child,
.acc-table tbody td:last-child {
  border-right: none !important;
}

/* Account cell + source style */
.acc-table .td-account {
  overflow: hidden !important;
}

.acc-table .account-cell {
  min-width: 0 !important;
  max-width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
  overflow: hidden !important;
}

.acc-table .account-main {
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.acc-table .account-name {
  min-width: 0 !important;
  color: #F3F4F6 !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1.15 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.acc-table .account-sub {
  color: #A7AFBA !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1.15 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.acc-table .account-source {
  max-width: 130px !important;
  height: 20px !important;
  padding: 0 7px !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  align-self: flex-start !important;
  background: rgba(229, 231, 235, 0.055) !important;
  border: 1px solid rgba(229, 231, 235, 0.10) !important;
  color: #CBD5E1 !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* =========================================================
   ACCOUNT TABLE CATEGORY TAGS - SINGLE COLUMN
   ========================================================= */

.acc-table .td-category {
  min-width: 0 !important;
  overflow: hidden !important;
  vertical-align: middle !important;
}

.acc-table .category-tags {
  width: max-content !important;
  max-width: 100% !important;
  min-width: 0 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 5px 6px !important;
  overflow: hidden !important;
}

.acc-table .category-tag {
  --tag-color: #CBD5E1;
  --tag-bg: rgba(203, 213, 225, 0.12);
  --tag-border: rgba(203, 213, 225, 0.32);

  max-width: 240px !important;
  height: 24px !important;
  padding: 0 9px !important;
  border-radius: 7px !important;
  display: inline-flex !important;
  align-items: center !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  box-sizing: border-box !important;

  background: var(--tag-bg) !important;
  border: 1px solid var(--tag-border) !important;
  color: var(--tag-color) !important;
}

.acc-table .table-empty {
  color: #747D89 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

/* =========================================================
   QUICK STATUS BUTTON CLIP FIX
   ========================================================= */

.acc-table .td-status-quick {
  width: 180px !important;
  max-width: 180px !important;
  min-width: 180px !important;
  overflow: visible !important;
  white-space: normal !important;
  vertical-align: middle !important;
  padding-left: 10px !important;
  padding-right: 10px !important;
}

.acc-table .quick-status-pills {
  width: 164px !important;
  max-width: 164px !important;
  min-width: 164px !important;
  display: grid !important;
  grid-template-columns: repeat(3, 50px) !important;
  grid-auto-rows: 30px !important;
  gap: 6px !important;
  align-items: center !important;
  justify-content: start !important;
  overflow: visible !important;
  white-space: normal !important;
  text-overflow: initial !important;
}

.acc-table .status-pill {
  width: 50px !important;
  min-width: 50px !important;
  max-width: 50px !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 !important;
  border-radius: 9px !important;
  box-sizing: border-box !important;
  position: relative !important;
  overflow: visible !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 50px !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  text-align: center !important;
}

/* Reduce glow for active state to prevent clipping */
.acc-table .status-pill.active {
  box-shadow: 0 0 0 1px currentColor inset !important;
}

/* Date cell styles */
.acc-table .td-date {
  overflow: hidden !important;
  padding-left: 12px !important;
}

.acc-table .date-cell {
  width: 100% !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
  line-height: 1.1 !important;
}

.acc-table .date-main,
.acc-table .date-time {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.acc-table .date-main {
  color: #E7EAF0 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

.acc-table .date-time {
  color: #8B95A3 !important;
  font-size: 11px !important;
  font-weight: 600 !important;
}

/* Note cell styles */
.acc-table .td-note {
  overflow: hidden !important;
}

.acc-table .note-cell {
  width: 100% !important;
  max-width: 150px !important;
  color: #A7AFBA !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

.acc-table .note-cell.is-empty {
  color: #747D89 !important;
  display: block !important;
}

/* Actions cell styles */
.acc-table .td-actions {
  overflow: hidden !important;
}

.acc-table .row-actions,
.acc-table .action-buttons {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 5px !important;
  width: 100% !important;
}

.acc-table .row-action-btn {
  width: 28px !important;
  height: 28px !important;
  flex: 0 0 28px !important;
}

/* Row hover and selected brightness */
.acc-table tbody tr:hover {
  background: rgba(229, 231, 235, 0.035) !important;
}

.acc-table tbody tr.selected,
.acc-table tbody tr.is-selected,
.acc-table tbody tr.row-selected,
.acc-table tbody tr:has(.acc-check-row:checked) {
  background: rgba(229, 231, 235, 0.055) !important;
  box-shadow: inset 3px 0 0 rgba(229, 231, 235, 0.25) !important;
}

/* Profit cell styles */
.acc-table .td-profit {
  overflow: hidden !important;
  white-space: nowrap !important;
}

.acc-table .profit-value {
  font-size: 12.5px !important;
  font-weight: 800 !important;
  white-space: nowrap !important;
}

.acc-table .profit-value.is-positive {
  color: #22C55E !important;
}

.acc-table .profit-value.is-negative {
  color: #EF4444 !important;
}

.acc-table .profit-value.is-zero,
.acc-table .profit-empty {
  color: #747D89 !important;
}

/* =========================================================
   ACCOUNT CELL PASSWORD TOGGLE
   ========================================================= */

.account-cell {
  min-width: 0 !important;
  max-width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  overflow: hidden !important;
}

.account-main,
.account-pass-row {
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 7px !important;
}

.account-name,
.account-password {
  min-width: 0 !important;
  max-width: 100% !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1.15 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.account-name {
  color: #F3F4F6 !important;
}

.account-password {
  color: #A7AFBA !important;
  letter-spacing: 0.01em !important;
  flex: 1 1 auto !important;
}

.account-password.is-visible {
  color: #D1D5DB !important;
}

.account-password.is-masked {
  color: #8B95A3 !important;
  letter-spacing: 0.08em !important;
}

.password-eye-btn {
  width: 24px !important;
  height: 24px !important;
  flex: 0 0 24px !important;
  border-radius: 7px !important;
  border: 1px solid rgba(229, 231, 235, 0.10) !important;
  background: rgba(229, 231, 235, 0.045) !important;
  color: #A7AFBA !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  padding: 0 !important;
  pointer-events: auto !important;
}

.password-eye-btn:hover {
  color: #F3F4F6 !important;
  background: rgba(229, 231, 235, 0.08) !important;
  border-color: rgba(229, 231, 235, 0.16) !important;
}

.password-eye-btn svg {
  width: 15px !important;
  height: 15px !important;
  pointer-events: none !important;
}

.account-source {
  max-width: 130px !important;
  height: 20px !important;
  padding: 0 7px !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  align-self: flex-start !important;
  background: rgba(229, 231, 235, 0.055) !important;
  border: 1px solid rgba(229, 231, 235, 0.10) !important;
  color: #CBD5E1 !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* ==================== LEGACY / DEPRECATED STYLES ==================== */
.acc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.acc-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: all .2s ease;
}

.acc-card:hover {
  border-color: rgba(70, 95, 255, .4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}

.acc-card.sold {
  border-color: rgba(245, 158, 11, .4);
  background: rgba(245, 158, 11, .03);
}

.acc-card.die {
  border-color: rgba(239, 68, 68, .4);
  background: rgba(239, 68, 68, .03);
}

.acc-card.banned {
  border-color: rgba(249, 115, 22, .4);
  background: rgba(249, 115, 22, .03);
}

.acc-card.selected {
  border-color: var(--accent);
  background: rgba(70, 95, 255, .08);
}

.acc-check {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  margin-top: 4px;
}

.acc-status-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  flex-shrink: 0;
  width: 60px;
}

.acc-status-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, .05);
  opacity: 0.4;
}

.acc-status-btn:hover {
  opacity: 0.8;
  transform: scale(1.1);
}

.acc-status-btn.active {
  opacity: 1;
  transform: scale(1.05);
}

.acc-status-btn.active[data-status="available"] {
  background: rgba(34, 197, 94, .2);
  border-color: rgba(34, 197, 94, .5);
  box-shadow: 0 0 8px rgba(34, 197, 94, .3);
}

.acc-status-btn.active[data-status="sold"] {
  background: rgba(245, 158, 11, .2);
  border-color: rgba(245, 158, 11, .5);
  box-shadow: 0 0 8px rgba(245, 158, 11, .3);
}

.acc-status-btn.active[data-status="die"] {
  background: rgba(239, 68, 68, .2);
  border-color: rgba(239, 68, 68, .5);
  box-shadow: 0 0 8px rgba(239, 68, 68, .3);
}

.acc-status-btn.active[data-status="banned"] {
  background: rgba(249, 115, 22, .2);
  border-color: rgba(249, 115, 22, .5);
  box-shadow: 0 0 8px rgba(249, 115, 22, .3);
}

.acc-info {
  flex: 1;
  min-width: 0;
}

.acc-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.acc-cred {
  font-family: 'Consolas', monospace;
  font-size: 13px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, .3);
  border-radius: 8px;
  word-break: break-all;
}

.acc-cookie {
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: background .15s;
}

.acc-cookie:hover {
  background: rgba(245, 158, 11, .2);
}

.acc-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 6px 0;
}

.acc-badge {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 20px;
  font-weight: 600;
}

.acc-badge.source {
  background: var(--accent-soft);
  color: var(--accent);
}

.acc-badge.catgroup {
  background: var(--accent-hover);
  color: var(--text-primary);
  border: 1px solid var(--accent-border);
  font-weight: 700;
}

.acc-badge.category {
  background: var(--accent-soft);
  color: var(--text-secondary);
}

.acc-badge.template {
  background: rgba(245, 158, 11, .15);
  color: var(--warn);
}

.acc-prices {
  display: flex;
  gap: 14px;
  font-size: 12px;
  margin-bottom: 6px;
}

.acc-prices .cost {
  color: var(--muted);
}

.acc-prices .price {
  color: var(--warn);
}

.acc-prices .profit {
  color: var(--good);
}

.acc-prices .loss {
  color: var(--danger);
}

.acc-fields {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.acc-field {
  font-size: 10px;
  padding: 3px 8px;
  background: rgba(138, 155, 181, .1);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.acc-field .key {
  color: var(--muted);
}

.acc-field .val {
  color: var(--text);
  font-weight: 600;
}

.acc-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.acc-card {
  border-radius: 8px !important;
  border-color: var(--border-soft) !important;
  background: var(--bg-card) !important;
}

.acc-status-btn {
  border-radius: 7px !important;
}

/* =========================================================
   APP SHELL LAYOUT RECOVERY
   ========================================================= */

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #0B0D10;
}

#app,
.app-shell {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  background: #0B0D10;
}

#sidebar,
.sidebar {
  width: 272px;
  min-width: 272px;
  max-width: 272px;
  height: 100vh;
  flex: 0 0 272px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid rgba(229, 231, 235, 0.08);
  background: #0E1116;
}

.sidebar-header {
  flex: 0 0 auto;
}

.sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-footer {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  position: relative !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  transform: none !important;
  box-sizing: border-box;
  overflow: hidden;
}

.content-shell,
.app-main,
#appMain {
  flex: 1 1 auto;
  min-width: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #0B0D10;
}

.app-topbar,
#topbar {
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  border-bottom: 1px solid rgba(229, 231, 235, 0.08);
  background: #101318;
}

.main-content,
#mainContent,
#content {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 16px;
  box-sizing: border-box;
}

.sidebar .sidebar-footer,
#sidebar .sidebar-footer {
  width: auto;
  margin: 0;
  padding: 10px 12px;
  border-top: 1px solid rgba(229, 231, 235, 0.08);
}

/* =========================================================
   SIDEBAR CATEGORY BLOCK RESTORE
   ========================================================= */

.sidebar-categories-section {
  padding: 10px 14px;
}

.sidebar-category-header {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #E5E7EB;
  font-size: 14px;
  font-weight: 800;
}

.sidebar-category-icon {
  width: 20px;
  color: #CBD5E1;
}

.sidebar-category-title {
  flex: 1;
  min-width: 0;
}

.sidebar-category-total,
.cat-count {
  min-width: 30px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(148, 163, 184, 0.13);
  color: #CBD5E1;
  font-size: 12px;
  font-weight: 900;
}

.sidebar-category-add {
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: #7C6DFF;
  font-size: 18px;
  cursor: pointer;
}

.sidebar-category-all,
.sidebar-category-row {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #AEB6C2;
  cursor: pointer;
  font: inherit;
}

.sidebar-category-all {
  height: 40px;
  margin: 6px 0 8px;
  padding: 0 10px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(99, 102, 241, 0.10);
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: #E5E7EB;
  font-size: 13px;
  font-weight: 800;
}

.sidebar-category-all.active {
  background: rgba(148, 163, 184, 0.15);
  border-color: rgba(148, 163, 184, 0.30);
}

.sidebar-category-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-category-row {
  --cat-color: #64748B;
  height: 34px;
  padding: 0 6px 0 0;
  border-radius: 9px;
  display: grid;
  grid-template-columns: 4px 18px minmax(0, 1fr) auto 24px;
  align-items: center;
  gap: 8px;
  position: relative;
}

.sidebar-category-row:hover {
  background: rgba(148, 163, 184, 0.07);
}

.sidebar-category-row.active {
  background: rgba(148, 163, 184, 0.10);
}

.cat-color-bar {
  width: 4px;
  height: 24px;
  border-radius: 999px;
  background: var(--cat-color);
  box-shadow: 0 0 10px var(--cat-color);
}

.cat-caret {
  color: #7F8896;
  font-size: 11px;
  text-align: center;
  cursor: pointer;
}

.cat-caret:hover {
  color: #CBD5E1;
}

.cat-name {
  min-width: 0;
  color: var(--cat-color);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.cat-gear {
  width: 24px;
  height: 24px;
  color: #667080;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cat-gear:hover {
  color: #CBD5E1;
}

.sidebar-empty-small {
  padding: 8px 10px;
  color: #697282;
  font-size: 12px;
  font-weight: 700;
}

/* Sidebar scroll area fixes to prevent footer breakage */
.sidebar {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-footer {
  flex: 0 0 auto;
}

/* =========================================================
   ACCOUNT TABLE ALWAYS-ON CHECKBOX SELECTION
   ========================================================= */

.acc-table .th-check,
.acc-table .td-check {
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  text-align: center;
  vertical-align: middle;
  padding-left: 12px;
  padding-right: 6px;
}

.table-checkbox {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.table-checkbox input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.table-checkbox .checkbox-box {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  box-sizing: border-box;
  position: relative;
  display: inline-block;
  background: #10141A;
  border: 1.5px solid rgba(148, 163, 184, 0.46);
  transition:
    background-color .10s ease,
    border-color .10s ease,
    box-shadow .10s ease;
}

.table-checkbox:hover .checkbox-box {
  border-color: rgba(203, 213, 225, 0.72);
  background: #141922;
}

.table-checkbox input:focus-visible+.checkbox-box {
  outline: 2px solid rgba(96, 165, 250, 0.55);
  outline-offset: 2px;
}

.table-checkbox input:checked+.checkbox-box {
  background: #6D5DF6;
  border-color: #8B7CFF;
  box-shadow: none;
}

.table-checkbox input:checked+.checkbox-box::after {
  content: "";
  position: absolute;
  left: 4.5px;
  top: 1.5px;
  width: 5px;
  height: 9px;
  border: solid #FFFFFF;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  transform-origin: center;
}

.table-checkbox input:indeterminate+.checkbox-box {
  background: #3B82F6;
  border-color: #60A5FA;
}

.table-checkbox input:indeterminate+.checkbox-box::after {
  content: "";
  position: absolute;
  left: 3.5px;
  top: 6.5px;
  width: 7px;
  height: 2px;
  border-radius: 999px;
  background: #FFFFFF;
}

/* =========================================================
   ACCOUNT TABLE SELECTED ROW - LIGHT TINT
   ========================================================= */

.acc-table tbody tr.is-selected {
  background: rgba(109, 93, 246, 0.055) !important;
  box-shadow: inset 2px 0 0 rgba(109, 93, 246, 0.68) !important;
}

.acc-table tbody tr.is-selected:hover {
  background: rgba(109, 93, 246, 0.075) !important;
}

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

/* =========================================================
   ACCOUNT BULK ACTION BAR
   ========================================================= */

.bulk-actions-bar {
  min-height: 52px;
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background:
    linear-gradient(90deg, rgba(109, 93, 246, 0.08), rgba(16, 20, 27, 0.96));
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
}

.bulk-actions-bar[hidden] {
  display: none !important;
}

.bulk-selected-info {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #E5E7EB;
  font-size: 13px;
  font-weight: 800;
}

.bulk-selected-info strong,
[data-selected-count] {
  color: #FCA5A5;
  font-weight: 900;
}

.bulk-actions-spacer {
  flex: 1 1 auto;
}

.bulk-btn {
  height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(148, 163, 184, 0.07);
  color: #CBD5E1;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.1s ease;
}

.bulk-btn:hover {
  background: rgba(148, 163, 184, 0.12);
  color: #F3F4F6;
}

.bulk-btn.is-green {
  border-color: rgba(34, 197, 94, 0.38);
  background: rgba(34, 197, 94, 0.16);
  color: #86EFAC;
}

.bulk-btn.is-green:hover {
  background: rgba(34, 197, 94, 0.24);
}

.bulk-btn.is-yellow {
  border-color: rgba(245, 158, 11, 0.40);
  background: rgba(245, 158, 11, 0.14);
  color: #FBBF24;
}

.bulk-btn.is-yellow:hover {
  background: rgba(245, 158, 11, 0.22);
}

.bulk-btn.is-red,
.bulk-btn.is-danger {
  border-color: rgba(239, 68, 68, 0.40);
  background: rgba(239, 68, 68, 0.14);
  color: #FCA5A5;
}

.bulk-btn.is-red:hover,
.bulk-btn.is-danger:hover {
  background: rgba(239, 68, 68, 0.22);
}

.bulk-btn.is-orange {
  border-color: rgba(249, 115, 22, 0.42);
  background: rgba(249, 115, 22, 0.16);
  color: #FDBA74;
}

.bulk-btn.is-orange:hover {
  background: rgba(249, 115, 22, 0.24);
}

.bulk-btn.is-blue {
  border-color: rgba(59, 130, 246, 0.42);
  background: rgba(59, 130, 246, 0.16);
  color: #93C5FD;
}

.bulk-btn.is-blue:hover {
  background: rgba(59, 130, 246, 0.24);
}

@media (max-width: 1100px) {
  .bulk-actions-bar {
    flex-wrap: wrap;
  }

  .bulk-actions-spacer {
    display: none;
  }
}

/* =========================================================
   ACCOUNTS FILTER PANEL - DRAFT / APPLIED FLOW
   ========================================================= */

.accounts-filter-panel {
  margin-top: 20px;
  padding: 16px 18px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 18, 25, 0.75);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.filter-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(148, 163, 184, 0.72);
}

.filter-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.filter-search-icon {
  position: absolute;
  left: 10px;
  width: 15px;
  height: 15px;
  color: rgba(148, 163, 184, 0.55);
  pointer-events: none;
}

.filter-input,
.filter-select {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(10, 13, 18, 0.8);
  color: #E2E8F0;
  font-size: 13px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
  box-sizing: border-box;
}

.filter-input-search {
  padding-left: 34px;
}

.filter-input:focus,
.filter-select:focus {
  border-color: rgba(109, 93, 246, 0.6);
  box-shadow: 0 0 0 2px rgba(109, 93, 246, 0.12);
}

.filter-input::placeholder {
  color: rgba(148, 163, 184, 0.42);
}

.filter-select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.filter-select option {
  background: #0F1219;
  color: #E2E8F0;
}

.filter-select optgroup {
  color: rgba(148, 163, 184, 0.8);
  font-weight: 700;
  font-style: normal;
  font-size: 12px;
  background: #0F1219;
}

.filter-select optgroup option {
  font-weight: 500;
  color: #E2E8F0;
  padding-left: 8px;
}

/* Actions Row */
.filter-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.08);
  flex-wrap: wrap;
}

.filter-summary {
  font-size: 12px;
  color: rgba(148, 163, 184, 0.7);
  flex: 1 1 auto;
  min-width: 0;
}

.filter-summary .filter-tag {
  color: #A78BFA;
  font-weight: 700;
}

.filter-pending-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: #FBBF24;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 8px;
  padding: 4px 10px;
  white-space: nowrap;
}

.filter-actions-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s ease;
  white-space: nowrap;
}

.filter-btn-apply {
  background: rgba(109, 93, 246, 0.18);
  border-color: rgba(109, 93, 246, 0.35);
  color: #C4B5FD;
}

.filter-btn-apply:hover {
  background: rgba(109, 93, 246, 0.28);
  color: #DDD6FE;
}

.filter-btn-reset {
  background: rgba(148, 163, 184, 0.06);
  color: rgba(148, 163, 184, 0.75);
}

.filter-btn-reset:hover {
  background: rgba(148, 163, 184, 0.12);
  color: #E2E8F0;
}

/* Filter panel pending state visual indicator */
.accounts-filter-panel.has-pending-changes {
  border-color: rgba(251, 191, 36, 0.25);
}

/* Empty State */
.filter-empty-state {
  text-align: center;
  padding: 48px 24px;
  color: rgba(148, 163, 184, 0.6);
}

.filter-empty-state .empty-icon {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.filter-empty-state .empty-title {
  font-size: 15px;
  font-weight: 700;
  color: rgba(148, 163, 184, 0.8);
  margin-bottom: 6px;
}

.filter-empty-state .empty-desc {
  font-size: 13px;
  color: rgba(148, 163, 184, 0.55);
  max-width: 380px;
  margin: 0 auto;
  line-height: 1.5;
}

.filter-empty-state .empty-reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 14px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(109, 93, 246, 0.3);
  background: rgba(109, 93, 246, 0.12);
  color: #C4B5FD;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s ease;
}

.filter-empty-state .empty-reset-btn:hover {
  background: rgba(109, 93, 246, 0.22);
}

/* Responsive */
@media (max-width: 1200px) {
  .filter-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .filter-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .filter-actions-row {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-actions-buttons {
    justify-content: flex-end;
  }
}

@media (max-width: 480px) {
  .filter-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   PAGINATION BAR
   ========================================================= */

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.08);
  background: rgba(15, 18, 25, 0.45);
  flex-wrap: wrap;
  gap: 10px;
}

.pg-summary {
  font-size: 12.5px;
  color: rgba(148, 163, 184, 0.68);
  white-space: nowrap;
}

.pg-summary strong {
  color: #E2E8F0;
  font-weight: 700;
}

.pg-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.pg-size-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pg-size-label {
  font-size: 12px;
  color: rgba(148, 163, 184, 0.55);
  white-space: nowrap;
}

.pg-size-select {
  height: 30px;
  padding: 0 24px 0 8px;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(10, 13, 18, 0.7);
  color: #E2E8F0;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  transition: border-color 0.1s ease;
}

.pg-size-select:focus {
  border-color: rgba(109, 93, 246, 0.5);
}

.pg-size-select option {
  background: #0F1219;
  color: #E2E8F0;
}

.pg-nav {
  display: flex;
  align-items: center;
  gap: 3px;
}

.pg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  background: transparent;
  color: rgba(148, 163, 184, 0.72);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.1s ease;
  white-space: nowrap;
}

.pg-btn:hover:not(:disabled):not(.pg-active) {
  background: rgba(148, 163, 184, 0.08);
  color: #E2E8F0;
  border-color: rgba(148, 163, 184, 0.18);
}

.pg-btn.pg-active {
  background: rgba(109, 93, 246, 0.16);
  border-color: rgba(109, 93, 246, 0.35);
  color: #C4B5FD;
  font-weight: 700;
  cursor: default;
}

.pg-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pg-btn.pg-prev,
.pg-btn.pg-next {
  padding: 0 4px;
}

.pg-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 30px;
  color: rgba(148, 163, 184, 0.4);
  font-size: 14px;
  user-select: none;
}

@media (max-width: 768px) {
  .pagination-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .pg-controls {
    justify-content: space-between;
  }
}

@media (max-width: 480px) {
  .pg-nav {
    flex-wrap: wrap;
    gap: 2px;
  }

  .pg-btn {
    min-width: 26px;
    height: 26px;
    font-size: 11px;
  }
}

/* ==================== DOUBLE DATE & NO DATA STYLES ==================== */
.date-double-cell {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  font-size: 11px !important;
  line-height: 1.25 !important;
}

.date-row {
  display: flex !important;
  align-items: flex-start !important;
  gap: 6px !important;
}

.date-label {
  color: #64748B !important;
  /* Muted label slate-500 */
  font-weight: 700 !important;
  width: 38px !important;
  flex-shrink: 0 !important;
}

.date-value {
  display: inline-flex !important;
  flex-direction: column !important;
}

.date-value .date-time {
  font-size: 9.5px !important;
  opacity: 0.6 !important;
}

.date-import-val {
  color: #34D399 !important;
  /* Soft Emerald/Green for dark mode */
}

.date-sold-val {
  color: #FBBF24 !important;
  /* Soft Amber/Yellow for dark mode */
}

.no-data {
  color: #F87171 !important;
  /* Soft Red for dark mode */
  font-weight: 700 !important;
}

.note-cell.is-empty.no-data,
.account-source.is-empty.no-data {
  color: #F87171 !important;
  font-weight: 700 !important;
  border-color: rgba(248, 113, 113, 0.2) !important;
  background: rgba(248, 113, 113, 0.05) !important;
}

/* ==================== HIERARCHICAL SIDEBAR TREE STYLES ==================== */
.game-item-wrapper {
  margin-top: 10px;
  margin-bottom: 6px;
  border-left: 2px solid rgba(255, 255, 255, 0.04);
  padding-left: 8px;
  margin-left: 2px;
}

.game-header-row {
  display: flex !important;
  align-items: center !important;
  padding: 6px 8px !important;
  cursor: pointer !important;
  border-radius: 6px !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  color: var(--text-bright, #fff) !important;
  gap: 8px !important;
  transition: background 0.2s;
  user-select: none;
}

.game-header-row:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}

.game-header-row.active {
  background: var(--accent-hover) !important;
  color: var(--sidebar-active-text) !important;
}

.game-header-row .arrow {
  display: inline-flex !important;
  align-items: center !important;
  transition: transform 0.2s;
  opacity: 0.6;
  width: 14px;
}

.game-item-wrapper.collapsed .game-header-row .arrow {
  transform: rotate(-90deg);
}

.game-item-wrapper.collapsed .game-content-list {
  display: none !important;
}

.game-header-row .game-name {
  flex: 1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.game-header-row .count {
  font-size: 10px !important;
  font-weight: 700 !important;
  padding: 2px 6px !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--text-muted, #94a3b8) !important;
}

.game-content-list {
  padding-left: 10px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  margin-top: 6px !important;
}

.game-all-item {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--text-muted, #94a3b8) !important;
  padding-left: 22px !important;
}

/* Category Groups (Level 2) inside game */
.cat-group {
  border-left: 1px dashed rgba(255, 255, 255, 0.06) !important;
  margin-left: 6px !important;
  padding-left: 6px !important;
}

.cat-group-header {
  display: flex !important;
  align-items: center !important;
  padding: 5px 8px !important;
  cursor: pointer !important;
  border-radius: 6px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  gap: 6px !important;
}

.cat-group-header .cg-name {
  flex: 1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  color: var(--cg-color, var(--text)) !important;
}

.cat-group-header.active {
  background: var(--accent-hover) !important;
}

.cat-group-header.active .cg-name {
  color: var(--sidebar-active-text) !important;
}

.cat-group-header .count {
  font-size: 10px !important;
  padding: 1px 5px !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

/* Level 3: Child items */
.child-item {
  padding-left: 22px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  color: rgba(255, 255, 255, 0.65) !important;
}

.child-item .dot {
  width: 6px !important;
  height: 6px !important;
  border-radius: 50% !important;
  flex-shrink: 0 !important;
}

.child-item.active {
  color: var(--sidebar-active-text) !important;
}

/* ============ Quick Search & Data Management Page ============ */
.topbar-search-box {
  position: relative;
}

.quick-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 150;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .38);
  overflow: hidden;
}

.quick-search-result-list {
  max-height: 360px;
  overflow-y: auto;
  padding: 4px;
}

.quick-search-result {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
}

.quick-search-result:hover {
  background: rgba(148, 163, 184, .09);
}

.quick-search-result-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.quick-search-result-main b,
.quick-search-result-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-search-result-main b {
  font-size: 13px;
}

.quick-search-result-main small,
.quick-search-result-meta {
  color: var(--muted);
  font-size: 11px;
}

.quick-search-result-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.quick-focus-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(96, 165, 250, .24);
  background: rgba(59, 130, 246, .07);
  border-radius: 8px;
  color: var(--text);
}

.quick-focus-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quick-focus-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}

.quick-focus-title .ui-icon,
.quick-focus-warning .ui-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

.quick-focus-sub,
.quick-focus-warning {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.quick-focus-warning {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #fbbf24;
}

.quick-focus-clear {
  height: 32px;
  flex: 0 0 auto;
  border: 1px solid rgba(96, 165, 250, .3);
  background: rgba(96, 165, 250, .1);
  color: #bfdbfe;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.quick-focus-clear:hover {
  background: rgba(96, 165, 250, .16);
  border-color: rgba(147, 197, 253, .46);
}

@media (max-width: 760px) {
  .quick-focus-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .quick-focus-clear {
    width: 100%;
  }
}

.acc-row.is-quick-focus td {
  background: rgba(245, 158, 11, .14) !important;
  box-shadow: inset 0 1px 0 rgba(245, 158, 11, .22), inset 0 -1px 0 rgba(245, 158, 11, .22);
}

.acc-row.is-quick-focus td:first-child {
  box-shadow: inset 3px 0 0 rgba(245, 158, 11, .85), inset 0 1px 0 rgba(245, 158, 11, .22), inset 0 -1px 0 rgba(245, 158, 11, .22);
}

.dm-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dm-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.dm-breadcrumb {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.dm-header h2 {
  font-size: 28px;
  line-height: 1.15;
  font-weight: 800;
  margin: 0;
  color: var(--text);
}

.dm-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.dm-kpi {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 8px;
  padding: 14px;
  min-height: 84px;
}

.dm-kpi span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}

.dm-kpi b {
  font-size: 28px;
  line-height: 1;
  color: var(--text);
}

.dm-kpi.is-game {
  border-color: rgba(59, 130, 246, .3);
}

.dm-kpi.is-source {
  border-color: rgba(20, 184, 166, .3);
}

.dm-kpi.is-seller {
  border-color: rgba(245, 158, 11, .3);
}

.dm-kpi.is-category {
  border-color: rgba(168, 85, 247, .3);
}

.dm-kpi.is-link {
  border-color: rgba(148, 163, 184, .28);
}

.dm-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.dm-tab {
  appearance: none;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  padding: 10px 12px;
  cursor: pointer;
  white-space: nowrap;
}

.dm-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.dm-panel {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 8px;
  overflow: hidden;
}

.dm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--card2);
}

.dm-search {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 8px;
  padding: 0 10px;
}

.dm-search input,
.dm-select {
  height: 38px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.dm-search input {
  width: 100%;
}

.dm-select {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 8px;
  padding: 0 10px;
}

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

.dm-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.dm-table th,
.dm-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
  vertical-align: middle;
}

.dm-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: rgba(255, 255, 255, .02);
}

.dm-table td {
  color: var(--text);
}

.dm-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

.dm-muted {
  color: var(--muted);
}

.dm-status,
.dm-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid transparent;
}

.dm-status.is-active {
  color: #22c55e;
  background: rgba(34, 197, 94, .1);
  border-color: rgba(34, 197, 94, .24);
}

.dm-status.is-muted {
  color: var(--muted);
  background: rgba(148, 163, 184, .1);
  border-color: rgba(148, 163, 184, .18);
}

.source-shop {
  color: #60a5fa;
  background: rgba(59, 130, 246, .12);
  border-color: rgba(59, 130, 246, .25);
}

.source-social {
  color: #22d3ee;
  background: rgba(6, 182, 212, .12);
  border-color: rgba(6, 182, 212, .25);
}

.source-ads {
  color: #f59e0b;
  background: rgba(245, 158, 11, .12);
  border-color: rgba(245, 158, 11, .25);
}

.source-manual {
  color: #a78bfa;
  background: rgba(139, 92, 246, .12);
  border-color: rgba(139, 92, 246, .25);
}

.source-partner {
  color: #34d399;
  background: rgba(16, 185, 129, .12);
  border-color: rgba(16, 185, 129, .25);
}

.source-unknown {
  color: #94a3b8;
  background: rgba(148, 163, 184, .1);
  border-color: rgba(148, 163, 184, .2);
}

.dm-empty {
  color: var(--muted);
  padding: 32px;
  text-align: center;
  font-size: 13px;
}

.dm-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
}

.dm-pagination>div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dm-page-btn {
  height: 30px;
  border: 1px solid var(--line);
  background: var(--card2);
  color: var(--text);
  border-radius: 6px;
  padding: 0 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.dm-page-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.dm-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
}

.dm-relation-card {
  border: 1px solid var(--line);
  background: var(--card2);
  border-radius: 8px;
  padding: 14px;
}

.dm-relation-card.is-warning {
  border-color: rgba(245, 158, 11, .24);
}

.dm-relation-card h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.dm-relation-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.dm-relation-row b {
  color: var(--text);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .dm-header {
    flex-direction: column;
  }

  .dm-header-actions {
    justify-content: flex-start;
  }

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

  .dm-toolbar,
  .dm-pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .dm-link-grid {
    grid-template-columns: 1fr;
  }
}

/* Accounts KPI period dashboard */
.accounts-page-header {
  align-items: flex-start !important;
}

.accounts-header-main {
  min-width: min(100%, 340px);
}

.accounts-header-subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  max-width: 620px;
}

.accounts-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  min-width: min(100%, 420px);
  flex: 1 1 520px;
}

.accounts-period-control {
  width: min(100%, 760px);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.accounts-period-month,
.accounts-custom-range input {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card2);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  padding: 0 10px;
  outline: none;
}

.accounts-period-month:focus,
.accounts-custom-range input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.18);
}

.accounts-period-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.period-btn {
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 0 10px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}

.period-btn:hover,
.period-btn.active {
  background: rgba(124, 58, 237, 0.13);
  border-color: rgba(167, 139, 250, 0.42);
  color: #d8b4fe;
}

.accounts-custom-range {
  display: none;
  align-items: center;
  gap: 6px;
}

.accounts-custom-range.is-active {
  display: flex;
}

#statsGrid.stats-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 12px !important;
  margin-bottom: 18px !important;
}

#statsGrid>.accounts-kpi-card {
  min-height: 124px !important;
  height: auto !important;
  border-radius: 8px !important;
  padding: 14px !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.036), rgba(255, 255, 255, 0.014)), #11161d !important;
  border: 1px solid rgba(148, 163, 184, 0.16) !important;
  box-shadow: none !important;
}

#statsGrid>.accounts-kpi-card:hover {
  transform: translateY(-1px);
  border-color: rgba(148, 163, 184, 0.28) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14) !important;
}

.accounts-kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--kpi-color);
  opacity: 0.9;
}

.accounts-kpi-card.kpi-imported {
  --kpi-color: #a78bfa;
  --kpi-soft: rgba(167, 139, 250, 0.14);
}

.accounts-kpi-card.kpi-available {
  --kpi-color: #22c55e;
  --kpi-soft: rgba(34, 197, 94, 0.13);
}

.accounts-kpi-card.kpi-sold {
  --kpi-color: #f59e0b;
  --kpi-soft: rgba(245, 158, 11, 0.14);
}

.accounts-kpi-card.kpi-die {
  --kpi-color: #ef4444;
  --kpi-soft: rgba(239, 68, 68, 0.14);
}

.accounts-kpi-card.kpi-banned {
  --kpi-color: #fb923c;
  --kpi-soft: rgba(251, 146, 60, 0.14);
}

.accounts-kpi-card.kpi-faceid {
  --kpi-color: #60a5fa;
  --kpi-soft: rgba(96, 165, 250, 0.14);
}

.kpi-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--kpi-color);
  background: var(--kpi-soft);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.kpi-icon .ui-icon,
.finance-icon-box .ui-icon,
.daily-title .ui-icon {
  width: 16px;
  height: 16px;
}

.kpi-copy,
.finance-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.kpi-label,
.finance-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0;
  text-transform: uppercase;
}

.kpi-value {
  margin-top: 8px;
  color: var(--text);
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}

.kpi-sub,
.finance-sub {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.kpi-trend {
  margin-top: 7px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.trend-up {
  color: #22c55e;
}

.trend-down {
  color: #ef4444;
}

.trend-flat {
  color: var(--muted);
}

.accounts-finance-panel {
  grid-column: 1 / -1;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.032), rgba(255, 255, 255, 0.014)), #11161d;
  overflow: hidden;
}

.finance-panel-head {
  min-height: 42px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.13);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.finance-panel-head small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: none;
}

.finance-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.finance-metric {
  min-width: 0;
  min-height: 104px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-right: 1px solid rgba(148, 163, 184, 0.12);
}

.finance-metric:last-child {
  border-right: none;
}

.finance-metric .finance-icon-box {
  width: 36px !important;
  height: 36px !important;
  flex: 0 0 36px;
  border-radius: 8px !important;
  color: var(--finance-color);
  background: var(--finance-soft);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.finance-imported {
  --finance-color: #a78bfa;
  --finance-soft: rgba(167, 139, 250, 0.13);
}

.finance-revenue {
  --finance-color: #60a5fa;
  --finance-soft: rgba(96, 165, 250, 0.13);
}

.finance-profit {
  --finance-color: #22c55e;
  --finance-soft: rgba(34, 197, 94, 0.13);
}

.finance-margin {
  --finance-color: #34d399;
  --finance-soft: rgba(52, 211, 153, 0.13);
}

.finance-loss {
  --finance-color: #ef4444;
  --finance-soft: rgba(239, 68, 68, 0.13);
}

.finance-value {
  margin-top: 7px;
  color: var(--finance-color, var(--text));
  font-size: 18px;
  font-weight: 900;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.daily-summary-bar {
  grid-column: 1 / -1;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: var(--muted);
  font-size: 12px;
  background: rgba(148, 163, 184, 0.045);
}

.daily-summary-bar.is-active {
  border-color: rgba(34, 197, 94, 0.24);
  background: rgba(34, 197, 94, 0.07);
}

.daily-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #86efac;
  font-weight: 900;
  letter-spacing: 0;
}

.daily-summary-bar b {
  color: var(--text);
}

.daily-summary-bar .daily-good {
  color: #22c55e;
}

.daily-summary-bar .daily-bad {
  color: #ef4444;
}

@media (max-width: 1280px) {
  .accounts-header-right {
    align-items: stretch;
  }

  .accounts-period-control,
  .accounts-period-buttons {
    justify-content: flex-start;
  }

  #statsGrid.stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 900px) {
  .finance-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-metric:nth-child(2) {
    border-right: none;
  }

  .finance-metric:nth-child(-n + 2) {
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  }
}

@media (max-width: 760px) {

  .accounts-header-right,
  .accounts-period-control,
  .content-actions {
    width: 100%;
    align-items: stretch;
  }

  .accounts-period-month,
  .accounts-custom-range,
  .accounts-custom-range input {
    width: 100%;
  }

  .accounts-period-buttons {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .period-btn {
    width: 100%;
    padding: 0 8px;
  }

  #statsGrid.stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  #statsGrid>.accounts-kpi-card {
    min-height: 118px !important;
    padding: 12px !important;
  }

  .kpi-value {
    font-size: 26px;
  }

  .finance-metric-grid {
    grid-template-columns: 1fr;
  }

  .finance-metric,
  .finance-metric:nth-child(2) {
    border-right: none;
  }

  .finance-metric:not(:last-child),
  .finance-metric:nth-child(-n + 2) {
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  }

  .daily-summary-bar {
    justify-content: flex-start;
    gap: 10px 14px;
  }
}

/* Accounts dashboard v2: finance cards first, compact status strip second */
#statsGrid.stats-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 14px !important;
  margin-bottom: 18px !important;
  align-items: stretch;
}

.accounts-finance-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.accounts-finance-card {
  --finance-accent: #a78bfa;
  --finance-bg: rgba(167, 139, 250, 0.11);
  min-width: 0;
  min-height: 158px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  border-radius: 14px;
  padding: 20px;
  background: linear-gradient(135deg, var(--finance-bg), rgba(255, 255, 255, 0.025) 44%, rgba(255, 255, 255, 0.012)), #11161d;
  border: 1px solid color-mix(in srgb, var(--finance-accent) 28%, rgba(148, 163, 184, 0.14));
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.15);
}

.accounts-finance-card::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -28px;
  width: 116px;
  height: 116px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--finance-accent) 24%, transparent);
  background: radial-gradient(circle, color-mix(in srgb, var(--finance-accent) 18%, transparent), transparent 66%);
  opacity: 0.58;
  pointer-events: none;
}

.finance-card-capital {
  --finance-accent: #a78bfa;
  --finance-bg: rgba(124, 58, 237, 0.13);
}

.finance-card-revenue {
  --finance-accent: #22c55e;
  --finance-bg: rgba(34, 197, 94, 0.12);
}

.finance-card-profit {
  --finance-accent: #60a5fa;
  --finance-bg: rgba(96, 165, 250, 0.12);
}

.finance-card-margin {
  --finance-accent: #f59e0b;
  --finance-bg: rgba(245, 158, 11, 0.13);
}

.finance-card-loss {
  --finance-accent: #ef4444;
  --finance-bg: rgba(239, 68, 68, 0.12);
}

.accounts-finance-icon {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--finance-accent);
  background: color-mix(in srgb, var(--finance-accent) 16%, rgba(255, 255, 255, 0.035));
  border: 1px solid color-mix(in srgb, var(--finance-accent) 28%, rgba(148, 163, 184, 0.12));
}

.accounts-finance-icon .ui-icon,
.accounts-status-icon .ui-icon {
  width: 20px;
  height: 20px;
}

.accounts-finance-copy,
.accounts-status-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.accounts-finance-label,
.accounts-status-label {
  color: var(--finance-accent, var(--status-accent, var(--muted)));
  font-size: 10px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0;
  text-transform: uppercase;
}

.accounts-finance-value {
  margin-top: 12px;
  color: var(--text);
  font-size: clamp(23px, 2.2vw, 34px);
  font-weight: 950;
  line-height: 1.04;
  overflow-wrap: anywhere;
}

.finance-card-profit .accounts-finance-value,
.finance-card-revenue .accounts-finance-value {
  color: #bbf7d0;
}

.finance-card-loss .accounts-finance-value {
  color: #fecaca;
}

.finance-card-margin .accounts-finance-value {
  color: #fed7aa;
}

.accounts-finance-sub {
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.metric-trend {
  margin-top: 10px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.accounts-status-strip {
  grid-column: 1 / -1;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.032), rgba(255, 255, 255, 0.014)), #11161d;
  overflow: hidden;
}

.accounts-status-head {
  min-height: 42px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.accounts-status-head small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: none;
}

.accounts-status-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.accounts-status-item {
  --status-accent: #a78bfa;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 16px;
  border-right: 1px solid rgba(148, 163, 184, 0.11);
}

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

.status-total {
  --status-accent: #a78bfa;
}

.status-available {
  --status-accent: #22c55e;
}

.status-sold {
  --status-accent: #f59e0b;
}

.status-die {
  --status-accent: #ef4444;
}

.status-banned {
  --status-accent: #fb923c;
}

.status-faceid {
  --status-accent: #60a5fa;
}

.accounts-status-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--status-accent);
  background: color-mix(in srgb, var(--status-accent) 13%, rgba(255, 255, 255, 0.025));
  border: 1px solid color-mix(in srgb, var(--status-accent) 24%, rgba(148, 163, 184, 0.11));
}

.accounts-status-value {
  margin-top: 5px;
  color: var(--text);
  font-size: 22px;
  font-weight: 950;
  line-height: 1;
}

.accounts-status-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.accounts-stats-note {
  grid-column: 1 / -1;
  margin: -3px 2px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

@media (max-width: 1180px) {
  #statsGrid.stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

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

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

  .accounts-status-item {
    border-right: 1px solid rgba(148, 163, 184, 0.11);
    border-bottom: 1px solid rgba(148, 163, 184, 0.10);
  }

  .accounts-status-item:nth-child(3n) {
    border-right: none;
  }

  .accounts-status-item:nth-last-child(-n + 3) {
    border-bottom: none;
  }
}

@media (max-width: 760px) {

  #statsGrid.stats-grid,
  .accounts-finance-grid,
  .accounts-status-grid {
    grid-template-columns: 1fr !important;
  }

  .accounts-finance-card {
    min-height: 138px;
    padding: 16px;
  }

  .accounts-finance-value {
    font-size: 25px;
  }

  .accounts-status-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .accounts-status-item,
  .accounts-status-item:nth-child(3n),
  .accounts-status-item:nth-last-child(-n + 3) {
    border-right: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.10);
  }

  .accounts-status-item:last-child {
    border-bottom: none;
  }
}

/* Sidebar collapse / mobile overlay layout */
.app-shell,
.sidebar,
.content-shell,
.app-topbar,
.main-content {
  transition: width 0.22s ease, min-width 0.22s ease, max-width 0.22s ease, flex-basis 0.22s ease, transform 0.22s ease, padding 0.22s ease;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-brand {
  min-width: 0;
  flex: 1 1 auto;
}

.sidebar-brand-text {
  min-width: 0;
}

.sidebar-toggle-btn {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.sidebar-toggle-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(148, 163, 184, 0.28);
}

.sidebar-toggle-icon {
  grid-area: 1 / 1;
}

.sidebar-toggle-expand {
  display: none;
}

.sidebar-collapsed-actions {
  display: none;
}

body.sidebar-mobile-open {
  overflow: hidden;
}

@media (min-width: 1024px) {

  body.sidebar-collapsed #sidebar,
  body.sidebar-collapsed .sidebar,
  .app-shell.sidebar-collapsed #sidebar,
  .app-shell.sidebar-collapsed .sidebar {
    width: 76px !important;
    min-width: 76px !important;
    max-width: 76px !important;
    flex-basis: 76px !important;
  }

  body.sidebar-collapsed .sidebar-header,
  .app-shell.sidebar-collapsed .sidebar-header {
    padding: 14px 10px !important;
    flex-direction: column;
    justify-content: flex-start;
  }

  body.sidebar-collapsed .sidebar-brand,
  .app-shell.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    flex: 0 0 auto;
  }

  body.sidebar-collapsed .sidebar-brand-logo,
  .app-shell.sidebar-collapsed .sidebar-brand-logo {
    width: 38px;
    height: 38px;
  }

  body.sidebar-collapsed .sidebar-brand-text,
  body.sidebar-collapsed .nav-label,
  body.sidebar-collapsed .nav-section-title,
  body.sidebar-collapsed .nav-arrow,
  body.sidebar-collapsed .nav-badge,
  body.sidebar-collapsed .count,
  body.sidebar-collapsed .cat-count,
  body.sidebar-collapsed .cat-name,
  body.sidebar-collapsed .cg-name,
  body.sidebar-collapsed .cat-caret,
  body.sidebar-collapsed .cat-gear,
  body.sidebar-collapsed .settings-btn,
  body.sidebar-collapsed .nav-add-btn,
  body.sidebar-collapsed .storage-header,
  body.sidebar-collapsed .sidebar-user-card .user-info,
  body.sidebar-collapsed .sidebar-user-card .user-logout-btn,
  body.sidebar-collapsed .sidebar-theme-toggle-container .theme-label,
  .app-shell.sidebar-collapsed .sidebar-brand-text,
  .app-shell.sidebar-collapsed .nav-label,
  .app-shell.sidebar-collapsed .nav-section-title,
  .app-shell.sidebar-collapsed .nav-arrow,
  .app-shell.sidebar-collapsed .nav-badge,
  .app-shell.sidebar-collapsed .count,
  .app-shell.sidebar-collapsed .cat-count,
  .app-shell.sidebar-collapsed .cat-name,
  .app-shell.sidebar-collapsed .cg-name,
  .app-shell.sidebar-collapsed .cat-caret,
  .app-shell.sidebar-collapsed .cat-gear,
  .app-shell.sidebar-collapsed .settings-btn,
  .app-shell.sidebar-collapsed .nav-add-btn,
  .app-shell.sidebar-collapsed .storage-header,
  .app-shell.sidebar-collapsed .sidebar-user-card .user-info,
  .app-shell.sidebar-collapsed .sidebar-user-card .user-logout-btn,
  .app-shell.sidebar-collapsed .sidebar-theme-toggle-container .theme-label {
    display: none !important;
  }

  body.sidebar-collapsed .sidebar-toggle-collapse,
  .app-shell.sidebar-collapsed .sidebar-toggle-collapse {
    display: none;
  }

  body.sidebar-collapsed .sidebar-toggle-expand,
  .app-shell.sidebar-collapsed .sidebar-toggle-expand {
    display: block;
  }

  body.sidebar-collapsed .sidebar-scroll,
  .app-shell.sidebar-collapsed .sidebar-scroll {
    padding: 12px 8px !important;
  }

  body.sidebar-collapsed .sidebar-nav,
  .app-shell.sidebar-collapsed .sidebar-nav {
    gap: 10px;
    align-items: center;
  }

  body.sidebar-collapsed .nav-section,
  body.sidebar-collapsed .nav-group,
  .app-shell.sidebar-collapsed .nav-section,
  .app-shell.sidebar-collapsed .nav-group {
    width: 100%;
    align-items: center;
  }

  body.sidebar-collapsed .sidebar .side-item,
  body.sidebar-collapsed .nav-group-toggle,
  .app-shell.sidebar-collapsed .sidebar .side-item,
  .app-shell.sidebar-collapsed .nav-group-toggle {
    width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    justify-content: center;
    gap: 0;
  }

  body.sidebar-collapsed .nav-group-menu,
  body.sidebar-collapsed #sidebarCategoryBlockContainer,
  body.sidebar-collapsed #sidebarTemplateBlockContainer,
  .app-shell.sidebar-collapsed .nav-group-menu,
  .app-shell.sidebar-collapsed #sidebarCategoryBlockContainer,
  .app-shell.sidebar-collapsed #sidebarTemplateBlockContainer {
    display: none !important;
  }

  body.sidebar-collapsed .sidebar-collapsed-actions,
  .app-shell.sidebar-collapsed .sidebar-collapsed-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .sidebar-collapsed-action {
    width: 44px;
    height: 44px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    display: grid;
    place-items: center;
    cursor: pointer;
  }

  .sidebar-collapsed-action:hover,
  .sidebar-collapsed-action.active {
    color: var(--sidebar-active-text);
    background: var(--sidebar-active);
    border-color: var(--sidebar-active-border);
  }

  body.sidebar-collapsed .sidebar-footer,
  .app-shell.sidebar-collapsed .sidebar-footer {
    padding: 10px 8px !important;
  }

  body.sidebar-collapsed .sidebar-storage-container,
  .app-shell.sidebar-collapsed .sidebar-storage-container {
    padding: 4px 6px 10px;
  }

  body.sidebar-collapsed .storage-bar,
  .app-shell.sidebar-collapsed .storage-bar {
    height: 5px;
    margin-top: 0;
  }

  body.sidebar-collapsed .sidebar-user-card,
  .app-shell.sidebar-collapsed .sidebar-user-card {
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
    margin: 0 auto;
  }

  body.sidebar-collapsed .sidebar-theme-toggle-container,
  .app-shell.sidebar-collapsed .sidebar-theme-toggle-container {
    justify-content: center;
    padding: 8px 0 0;
  }

  body.sidebar-collapsed .content-shell,
  .app-shell.sidebar-collapsed .content-shell {
    min-width: 0;
    flex: 1 1 calc(100vw - 76px);
  }
}

@media (max-width: 1023px) {
  .sidebar-toggle-btn {
    display: none;
  }

  .sidebar-collapsed-actions {
    display: none !important;
  }

  body.sidebar-collapsed #sidebar,
  body.sidebar-collapsed .sidebar,
  .app-shell.sidebar-collapsed #sidebar,
  .app-shell.sidebar-collapsed .sidebar {
    width: 270px !important;
    min-width: 0 !important;
    max-width: 88vw !important;
    flex-basis: auto !important;
  }
}

/* ==================== MẪU 4 HEADER CUSTOM STYLES ==================== */
.app-topbar {
  background-color: #0F141C !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.btn-primary-gradient {
  background: linear-gradient(135deg, #a855f7, #ec4899) !important;
  color: #ffffff !important;
  border: none !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary-gradient:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.4);
}

.btn-primary-gradient:active {
  transform: scale(0.97);
}

/* Sync Status Pill */
.sync-status-pill {
  transition: all 0.2s ease;
  user-select: none;
}

.sync-status-pill:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

/* Tools and Sync Menus */
.tools-menu,
.sync-status-menu {
  animation: dropdownFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dropdown styling */
.tools-dropdown,
.avatar-dropdown,
.sync-status-container {
  position: relative;
}

.tools-menu .menu-item,
.avatar-menu .menu-item {
  border-radius: 8px;
  margin: 2px 4px;
  padding: 8px 12px;
  font-weight: 500;
  transition: all 0.15s ease;
  background: transparent;
  border: none;
  width: calc(100% - 8px);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  cursor: pointer;
}

.tools-menu .menu-item:hover,
.avatar-menu .menu-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent) !important;
}

.tools-menu .menu-item.danger:hover,
.avatar-menu .menu-item.danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger) !important;
}

kbd {
  font-family: inherit;
}

/* Responsive Hide/Show classes for Sync Pill */
@media (max-width: 768px) {
  .sync-status-pill {
    padding: 6px !important;
  }

  .sync-status-pill .flex-col,
  .sync-status-pill span[class*="line"],
  .sync-status-pill #topbarDataSizeLabel {
    display: none !important;
  }
}

/* ==================== TOPBAR MODEL 4 FIXES & OVERRIDES ==================== */
.topbar-left {
  min-width: 180px !important;
  max-width: 640px !important;
  /* Grow on desktop */
  flex: 1 1 auto !important;
}

.topbar-search-box {
  height: 38px !important;
  max-width: 460px !important;
  min-width: 320px !important;
  flex: 0 1 420px !important;
  border-radius: 8px !important;
  background: rgba(148, 163, 184, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  padding-right: 12px !important;
  /* Space for items */
}

/* Sync Status Pill Redesign */
.sync-status-pill {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 6px 14px !important;
  background: var(--card2) !important;
  border: 1px solid var(--line) !important;
  border-radius: 9999px !important;
  color: var(--text) !important;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  max-width: 380px;
  min-width: 280px;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.sync-status-pill:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

@media (min-width: 1024px) {
  .sync-status-pill {
    min-width: 320px;
  }
}

@media (max-width: 1200px) {
  .sync-status-pill {
    min-width: 200px;
    padding: 6px 10px !important;
  }

  .sync-status-label {
    display: none !important;
    /* Hide long "Đồng bộ thành công" text, keep time */
  }

  .topbar-chunk-text {
    font-size: 0;
  }

  .topbar-chunk-text::before {
    content: attr(data-short);
    font-size: 10px;
  }
}

@media (max-width: 768px) {
  .topbar-search-box {
    min-width: 180px !important;
  }

  .topbar-search-box kbd {
    display: none !important;
  }

  .sync-status-pill {
    min-width: 0 !important;
    max-width: 140px;
    padding: 6px 8px !important;
    gap: 4px;
  }

  .sync-status-pill .flex-col,
  .sync-status-pill span[class*="line"],
  .sync-status-pill #topbarDataSizeLabel,
  .sync-status-pill .topbar-chunk-divider,
  .sync-status-pill .topbar-chunk-text {
    display: none !important;
  }
}

@media (max-width: 640px) {
  .topbar-search-box {
    min-width: 100px !important;
    max-width: 180px !important;
  }
}

/* ==================== HEADER + ACCOUNTS HERO CLEANUP ==================== */
.app-topbar {
  height: 68px !important;
  padding: 0 28px !important;
  background: #0F141C !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
  box-shadow: none !important;
}

.app-topbar-inner {
  max-width: none !important;
  min-width: 0;
  gap: 14px !important;
}

.header-left-brand {
  flex: 0 0 auto;
}

.topbar-left {
  flex: 1 1 760px !important;
  max-width: 820px !important;
  min-width: 0 !important;
  gap: 14px !important;
}

.topbar-search-box {
  height: 42px !important;
  flex: 1 1 520px !important;
  min-width: 360px !important;
  max-width: 560px !important;
  border-radius: 12px !important;
  background: rgba(148, 163, 184, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.11) !important;
  padding: 0 12px 0 14px !important;
}

.topbar-search-box input {
  min-width: 0;
  height: 100%;
}

.header-actions {
  flex: 0 0 auto;
  min-width: 0;
  gap: 10px !important;
}

.header-actions .btn,
.avatar-btn,
#topbarSidebarToggleBtn {
  height: 38px !important;
  border-radius: 12px !important;
  border-color: rgba(255, 255, 255, 0.10) !important;
  background: rgba(148, 163, 184, 0.08);
}

#btnManualSave,
#btnUndoHistory {
  min-width: 82px;
}

#btnAddAcc {
  min-width: 148px;
  height: 40px !important;
  border-radius: 12px !important;
}

.btn-primary-gradient {
  background: linear-gradient(135deg, #8b5cf6, #ec4899) !important;
  color: #ffffff !important;
  box-shadow: 0 12px 26px rgba(139, 92, 246, 0.18) !important;
}

.btn-primary-gradient:hover {
  filter: brightness(1.08);
  box-shadow: 0 14px 30px rgba(236, 72, 153, 0.20) !important;
}

.sync-status-container,
.tools-dropdown,
.avatar-dropdown {
  position: relative;
}

.sync-status-pill {
  width: 360px;
  max-width: 360px;
  min-width: 320px;
  height: 42px;
  padding: 6px 12px !important;
  border-radius: 13px !important;
  background: rgba(148, 163, 184, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.11) !important;
  color: var(--text) !important;
  white-space: nowrap;
}

.sync-status-pill .flex-col {
  min-width: 118px;
}

#syncTime {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}

#topbarDataSizeLabel {
  min-width: 112px;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.tools-menu,
.sync-status-menu,
.avatar-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 140;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  background: #111821;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
}

.tools-menu.is-open,
.sync-status-menu.is-open,
.avatar-menu.is-open {
  display: block !important;
}

.tools-menu {
  width: 238px;
  max-width: min(238px, calc(100vw - 24px));
  padding: 8px;
}

.sync-status-menu {
  width: 320px;
  max-width: min(320px, calc(100vw - 24px));
  padding: 14px;
}

.avatar-menu {
  width: 300px;
  max-width: min(300px, calc(100vw - 24px));
  max-height: calc(100vh - 92px);
  overflow-y: auto;
  padding: 8px;
}

.tools-menu .menu-item,
.avatar-menu .menu-item {
  min-height: 36px;
  border-radius: 10px;
  margin: 2px 0;
  padding: 8px 10px;
}

.accounts-hero {
  display: grid !important;
  grid-template-columns: minmax(320px, 45%) minmax(520px, 55%);
  align-items: start !important;
  gap: 28px !important;
  padding: 30px 0 26px !important;
  margin-bottom: 20px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.accounts-header-main {
  min-width: 0;
  max-width: 680px;
}

.accounts-hero-breadcrumb {
  margin-bottom: 8px !important;
  color: var(--muted) !important;
  letter-spacing: 0.08em !important;
}

.accounts-hero-title-row {
  min-width: 0;
  flex-wrap: wrap;
  row-gap: 8px;
}

#viewTitle {
  max-width: 100%;
  font-size: 30px !important;
  line-height: 1.08 !important;
  letter-spacing: 0 !important;
}

#viewSubtitle {
  border-radius: 999px !important;
  background: rgba(124, 58, 237, 0.16) !important;
  border-color: rgba(168, 85, 247, 0.32) !important;
  color: #d8b4fe !important;
}

.accounts-header-subtitle {
  margin-top: 10px;
  max-width: 620px;
  color: #9CA3AF;
  font-size: 14px;
}

.accounts-header-right {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.accounts-period-control,
.accounts-hero-action-row {
  width: 100%;
  justify-content: flex-end;
}

.accounts-period-control {
  gap: 8px;
}

.accounts-period-month,
.period-btn {
  height: 38px;
  border-radius: 12px;
}

.period-btn.active {
  background: rgba(124, 58, 237, 0.18);
  border-color: rgba(168, 85, 247, 0.45);
  color: #e9d5ff;
}

.accounts-hero-action-row {
  gap: 10px !important;
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.accounts-hero-action-row .btn {
  height: 38px;
  border-radius: 12px !important;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--text);
  flex: 0 0 auto;
  cursor: pointer;
  pointer-events: auto;
}

#btnBulkUpdate {
  background: rgba(124, 58, 237, 0.14) !important;
  color: #ddd6fe !important;
  border-color: rgba(168, 85, 247, 0.35) !important;
}

#btnBulkSearch {
  background: rgba(59, 130, 246, 0.12) !important;
  color: #bfdbfe !important;
  border-color: rgba(96, 165, 250, 0.28) !important;
}

@media (max-width: 1320px) {
  .topbar-search-box {
    min-width: 280px !important;
    max-width: 460px !important;
  }

  .sync-status-pill {
    width: 300px;
    min-width: 280px;
  }

  .sync-status-label {
    display: none !important;
  }
}

@media (max-width: 1120px) {
  .app-topbar {
    padding: 0 18px !important;
  }

  .header-left-brand a span {
    display: none !important;
  }

  .topbar-search-box {
    min-width: 240px !important;
  }

  #btnUndoHistory,
  #btnManualSave {
    min-width: 38px;
    width: 38px;
    padding: 0 !important;
  }

  #btnUndoHistory {
    font-size: 0;
  }

  #btnManualSave>span:not(#saveBadgeCount):not(#saveStatusDot) {
    display: none;
  }
}

@media (max-width: 980px) {
  .accounts-hero {
    grid-template-columns: 1fr;
    gap: 18px !important;
  }

  .accounts-header-right,
  .accounts-period-control,
  .accounts-hero-action-row {
    align-items: flex-start;
    justify-content: flex-start;
  }
}

@media (min-width: 761px) and (max-width: 768px) {
  .sync-status-pill .flex-col {
    display: flex !important;
  }

  .sync-status-pill #topbarDataSizeLabel {
    display: inline-flex !important;
  }
}

/* ==================== UNIFIED DASHBOARD STYLES ==================== */
#dashboardKpiStrip {
  display: block;
}

.dashboard-tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 24px;
  overflow-x: auto;
}

.dashboard-tabs-nav::-webkit-scrollbar {
  display: none;
}

.dash-tab-btn {
  background: transparent;
  border: none;
  padding: 12px 20px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted, #94a3b8);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  outline: none;
}

.dash-tab-btn:hover {
  color: var(--text, #ffffff);
}

.dash-tab-btn.active {
  color: #A855F7 !important;
  border-bottom-color: #A855F7 !important;
}

.dash-period-filter .period-btn {
  background: transparent;
  border: none;
  cursor: pointer;
}

.dash-period-filter .period-btn.active {
  background: #1e293b;
  color: #ffffff;
}

/* Dashboard KPI summary block */
.dash-v-filter-area {
  align-items: center;
}

.dash-period-filter {
  min-height: 40px;
  align-items: center;
  border-radius: 14px !important;
  background: rgba(9, 13, 20, 0.88) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dash-period-filter .period-btn {
  min-height: 30px;
  border-radius: 10px !important;
  white-space: nowrap;
}

.dash-period-filter .period-btn.active,
.dash-period-filter .period-btn.bg-\[\#1e293b\] {
  background: rgba(168, 85, 247, 0.17) !important;
  color: #f5f3ff !important;
  box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.28);
}

.dash-kpi-main-grid,
.dash-kpi-mini-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.dash-kpi-main-grid {
  grid-template-columns: 1fr;
}

.dash-kpi-mini-grid {
  grid-template-columns: 1fr;
}

.dash-kpi-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.13);
  background: linear-gradient(145deg, rgba(20, 25, 35, 0.96), rgba(13, 18, 27, 0.98));
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.18);
}

.dash-kpi-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, color-mix(in srgb, var(--kpi-tone) 13%, transparent), transparent 42%);
  opacity: 0.85;
}

.dash-kpi-main {
  min-height: 150px;
  border-radius: 20px;
  padding: 18px;
}

.dash-kpi-mini {
  min-height: 112px;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  gap: 12px;
}

.dash-kpi-card>* {
  position: relative;
  z-index: 1;
}

.dash-kpi-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.dash-kpi-icon {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  color: var(--kpi-tone);
  background: color-mix(in srgb, var(--kpi-tone) 13%, rgba(255, 255, 255, 0.04));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--kpi-tone) 24%, transparent);
}

.dash-kpi-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dash-kpi-info {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: rgba(226, 232, 240, 0.72);
  background: rgba(255, 255, 255, 0.07);
  cursor: help;
}

.dash-kpi-label {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.25;
  text-transform: uppercase;
}

.dash-kpi-value {
  margin-top: 8px;
  color: #f8fafc;
  font-size: 26px;
  font-weight: 850;
  line-height: 1.1;
}

.dash-kpi-value.is-negative {
  color: #fb7185;
}

.dash-kpi-mini-body {
  min-width: 0;
  flex: 1;
}

.dash-kpi-mini-value {
  margin-top: 6px;
  color: #f8fafc;
  font-size: 18px;
  font-weight: 850;
  line-height: 1.15;
}

.dash-kpi-sub {
  margin-top: 5px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.25;
}

.dash-kpi-compare {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
}

.dash-kpi-compare.is-good {
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
}

.dash-kpi-compare.is-bad {
  color: #fda4af;
  background: rgba(244, 63, 94, 0.12);
}

.dash-kpi-compare.is-muted {
  color: #64748b;
  background: rgba(148, 163, 184, 0.08);
}

.dash-kpi-spark {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 104px;
  height: 42px;
  color: color-mix(in srgb, var(--kpi-tone) 82%, #ffffff 8%);
  opacity: 0.78;
}

.dash-kpi-strip {
  display: grid;
  grid-template-columns: 1fr;
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(20, 25, 35, 0.96), rgba(12, 17, 26, 0.98));
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.16);
}

.dash-kpi-strip-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-height: 104px;
  padding: 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.11);
}

.dash-kpi-strip-item:last-child {
  border-bottom: none;
}

.dash-kpi-strip-value {
  margin-top: 5px;
  color: #f8fafc;
  font-size: 17px;
  font-weight: 850;
  line-height: 1.15;
}

.dash-kpi-card.is-purple,
.dash-kpi-strip-item.is-purple {
  --kpi-tone: #a78bfa;
}

.dash-kpi-card.is-green,
.dash-kpi-strip-item.is-green {
  --kpi-tone: #34d399;
}

.dash-kpi-card.is-orange,
.dash-kpi-strip-item.is-orange {
  --kpi-tone: #fb923c;
}

.dash-kpi-card.is-blue,
.dash-kpi-strip-item.is-blue {
  --kpi-tone: #60a5fa;
}

.dash-kpi-card.is-red,
.dash-kpi-strip-item.is-red {
  --kpi-tone: #fb7185;
}

.dash-kpi-card.is-cyan,
.dash-kpi-strip-item.is-cyan {
  --kpi-tone: #22d3ee;
}

.dash-kpi-card.is-yellow,
.dash-kpi-strip-item.is-yellow {
  --kpi-tone: #fbbf24;
}

@media (min-width: 640px) {
  .dash-kpi-main-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-kpi-mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-kpi-strip-item {
    border-right: 1px solid rgba(148, 163, 184, 0.11);
  }
}

@media (min-width: 900px) {
  .dash-kpi-mini-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dash-kpi-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .dash-kpi-main-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .dash-kpi-mini-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .dash-kpi-strip {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .dash-kpi-strip-item {
    border-bottom: none;
  }
}

@media (max-width: 520px) {
  .dash-v-header {
    align-items: stretch;
  }

  .dash-period-filter {
    width: 100%;
    overflow-x: auto;
  }

  .dash-kpi-main,
  .dash-kpi-mini {
    border-radius: 14px;
  }

  .dash-kpi-value {
    font-size: 23px;
  }

  .dash-kpi-spark {
    opacity: 0.45;
  }
}

/* --- Overhauled Card and Metric Styling --- */
:root {
  --kpi-purple-rgb: 167, 139, 250;
  --kpi-green-rgb: 52, 211, 153;
  --kpi-blue-rgb: 96, 165, 250;
  --kpi-orange-rgb: 251, 146, 60;
  --kpi-red-rgb: 251, 113, 133;
  --kpi-cyan-rgb: 34, 211, 238;
  --kpi-yellow-rgb: 251, 191, 36;
}

/* Base card rules to clean up decorations/background noise */
.dash-kpi-card::before {
  display: none !important; /* Hide old gradient masks */
}
.accounts-finance-card::after {
  display: none !important; /* Hide old circular outlines */
}

/* Card Styling: overrides for all card types */
.dash-kpi-card.is-purple,
.tx-summary-card.is-purple,
.dash-v-metric.is-purple,
.stat-card.is-purple,
.detail-metric-card.is-purple {
  background: linear-gradient(135deg, rgba(var(--kpi-purple-rgb), 0.08) 0%, rgba(var(--kpi-purple-rgb), 0.02) 100%), var(--card) !important;
  border: 1px solid rgba(var(--kpi-purple-rgb), 0.3) !important;
  box-shadow: 0 8px 20px rgba(var(--kpi-purple-rgb), 0.04), 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}
.dash-kpi-card.is-purple:hover,
.tx-summary-card.is-purple:hover,
.dash-v-metric.is-purple:hover,
.stat-card.is-purple:hover,
.detail-metric-card.is-purple:hover {
  border-color: rgba(var(--kpi-purple-rgb), 0.55) !important;
  box-shadow: 0 10px 24px rgba(var(--kpi-purple-rgb), 0.08), 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

.dash-kpi-card.is-green,
.tx-summary-card.is-green,
.dash-v-metric.is-green,
.stat-card.is-green,
.detail-metric-card.is-green {
  background: linear-gradient(135deg, rgba(var(--kpi-green-rgb), 0.08) 0%, rgba(var(--kpi-green-rgb), 0.02) 100%), var(--card) !important;
  border: 1px solid rgba(var(--kpi-green-rgb), 0.3) !important;
  box-shadow: 0 8px 20px rgba(var(--kpi-green-rgb), 0.04), 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}
.dash-kpi-card.is-green:hover,
.tx-summary-card.is-green:hover,
.dash-v-metric.is-green:hover,
.stat-card.is-green:hover,
.detail-metric-card.is-green:hover {
  border-color: rgba(var(--kpi-green-rgb), 0.55) !important;
  box-shadow: 0 10px 24px rgba(var(--kpi-green-rgb), 0.08), 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

.dash-kpi-card.is-blue,
.tx-summary-card.is-blue,
.dash-v-metric.is-blue,
.stat-card.is-blue,
.detail-metric-card.is-blue {
  background: linear-gradient(135deg, rgba(var(--kpi-blue-rgb), 0.08) 0%, rgba(var(--kpi-blue-rgb), 0.02) 100%), var(--card) !important;
  border: 1px solid rgba(var(--kpi-blue-rgb), 0.3) !important;
  box-shadow: 0 8px 20px rgba(var(--kpi-blue-rgb), 0.04), 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}
.dash-kpi-card.is-blue:hover,
.tx-summary-card.is-blue:hover,
.dash-v-metric.is-blue:hover,
.stat-card.is-blue:hover,
.detail-metric-card.is-blue:hover {
  border-color: rgba(var(--kpi-blue-rgb), 0.55) !important;
  box-shadow: 0 10px 24px rgba(var(--kpi-blue-rgb), 0.08), 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

.dash-kpi-card.is-orange,
.tx-summary-card.is-orange,
.dash-v-metric.is-orange,
.stat-card.is-orange,
.detail-metric-card.is-orange {
  background: linear-gradient(135deg, rgba(var(--kpi-orange-rgb), 0.08) 0%, rgba(var(--kpi-orange-rgb), 0.02) 100%), var(--card) !important;
  border: 1px solid rgba(var(--kpi-orange-rgb), 0.3) !important;
  box-shadow: 0 8px 20px rgba(var(--kpi-orange-rgb), 0.04), 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}
.dash-kpi-card.is-orange:hover,
.tx-summary-card.is-orange:hover,
.dash-v-metric.is-orange:hover,
.stat-card.is-orange:hover,
.detail-metric-card.is-orange:hover {
  border-color: rgba(var(--kpi-orange-rgb), 0.55) !important;
  box-shadow: 0 10px 24px rgba(var(--kpi-orange-rgb), 0.08), 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

.dash-kpi-card.is-red,
.tx-summary-card.is-red,
.dash-v-metric.is-red,
.stat-card.is-red,
.detail-metric-card.is-red {
  background: linear-gradient(135deg, rgba(var(--kpi-red-rgb), 0.08) 0%, rgba(var(--kpi-red-rgb), 0.02) 100%), var(--card) !important;
  border: 1px solid rgba(var(--kpi-red-rgb), 0.3) !important;
  box-shadow: 0 8px 20px rgba(var(--kpi-red-rgb), 0.04), 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}
.dash-kpi-card.is-red:hover,
.tx-summary-card.is-red:hover,
.dash-v-metric.is-red:hover,
.stat-card.is-red:hover,
.detail-metric-card.is-red:hover {
  border-color: rgba(var(--kpi-red-rgb), 0.55) !important;
  box-shadow: 0 10px 24px rgba(var(--kpi-red-rgb), 0.08), 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

.dash-kpi-card.is-cyan,
.tx-summary-card.is-cyan,
.dash-v-metric.is-cyan,
.stat-card.is-cyan,
.detail-metric-card.is-cyan {
  background: linear-gradient(135deg, rgba(var(--kpi-cyan-rgb), 0.08) 0%, rgba(var(--kpi-cyan-rgb), 0.02) 100%), var(--card) !important;
  border: 1px solid rgba(var(--kpi-cyan-rgb), 0.3) !important;
  box-shadow: 0 8px 20px rgba(var(--kpi-cyan-rgb), 0.04), 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}
.dash-kpi-card.is-cyan:hover,
.tx-summary-card.is-cyan:hover,
.dash-v-metric.is-cyan:hover,
.stat-card.is-cyan:hover,
.detail-metric-card.is-cyan:hover {
  border-color: rgba(var(--kpi-cyan-rgb), 0.55) !important;
  box-shadow: 0 10px 24px rgba(var(--kpi-cyan-rgb), 0.08), 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

.dash-kpi-card.is-yellow,
.tx-summary-card.is-yellow,
.dash-v-metric.is-yellow,
.stat-card.is-yellow,
.detail-metric-card.is-yellow {
  background: linear-gradient(135deg, rgba(var(--kpi-yellow-rgb), 0.08) 0%, rgba(var(--kpi-yellow-rgb), 0.02) 100%), var(--card) !important;
  border: 1px solid rgba(var(--kpi-yellow-rgb), 0.3) !important;
  box-shadow: 0 8px 20px rgba(var(--kpi-yellow-rgb), 0.04), 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}
.dash-kpi-card.is-yellow:hover,
.tx-summary-card.is-yellow:hover,
.dash-v-metric.is-yellow:hover,
.stat-card.is-yellow:hover,
.detail-metric-card.is-yellow:hover {
  border-color: rgba(var(--kpi-yellow-rgb), 0.55) !important;
  box-shadow: 0 10px 24px rgba(var(--kpi-yellow-rgb), 0.08), 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

/* Horizontal Strip Items (e.g. bottom inventory strip items) - Left Accent Border instead of 4-sided borders */
.dash-kpi-strip-item {
  border-left: 3px solid transparent !important;
  background: rgba(255, 255, 255, 0.01) !important;
  transition: border-left-color 0.2s, background-color 0.2s;
}
.dash-kpi-strip-item.is-purple { border-left-color: rgba(var(--kpi-purple-rgb), 0.75) !important; }
.dash-kpi-strip-item.is-green { border-left-color: rgba(var(--kpi-green-rgb), 0.75) !important; }
.dash-kpi-strip-item.is-blue { border-left-color: rgba(var(--kpi-blue-rgb), 0.75) !important; }
.dash-kpi-strip-item.is-orange { border-left-color: rgba(var(--kpi-orange-rgb), 0.75) !important; }
.dash-kpi-strip-item.is-red { border-left-color: rgba(var(--kpi-red-rgb), 0.75) !important; }
.dash-kpi-strip-item.is-cyan { border-left-color: rgba(var(--kpi-cyan-rgb), 0.75) !important; }
.dash-kpi-strip-item.is-yellow { border-left-color: rgba(var(--kpi-yellow-rgb), 0.75) !important; }

.dash-kpi-strip-item:hover {
  background: rgba(255, 255, 255, 0.03) !important;
}

/* Horizontal Accounts Status Grid Items - Left Accent Border */
.accounts-status-item {
  border-left: 3px solid var(--status-accent) !important;
  background: rgba(255, 255, 255, 0.01) !important;
  transition: background-color 0.2s;
}
.accounts-status-item:hover {
  background: rgba(255, 255, 255, 0.03) !important;
}

/* Sidebar stock alert count badges */
.side-item .count.stock-empty,
.side-item .count.stock-danger,
.cat-group-header .count.stock-empty,
.cat-group-header .count.stock-danger,
.game-header-row .count.stock-empty,
.game-header-row .count.stock-danger,
.nav-badge.stock-empty,
.nav-badge.stock-danger,
.side-item.active .count.stock-empty,
.side-item.active .count.stock-danger,
.cat-group-header.active .count.stock-empty,
.cat-group-header.active .count.stock-danger {
  color: #ff7a7a !important;
  background: rgba(239, 68, 68, 0.14) !important;
  border: 1px solid rgba(239, 68, 68, 0.48) !important;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.06) inset !important;
}

.side-item .count.stock-warning,
.cat-group-header .count.stock-warning,
.game-header-row .count.stock-warning,
.nav-badge.stock-warning,
.side-item.active .count.stock-warning,
.cat-group-header.active .count.stock-warning {
  color: #fbbf24 !important;
  background: rgba(245, 158, 11, 0.14) !important;
  border: 1px solid rgba(245, 158, 11, 0.48) !important;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.06) inset !important;
}

.side-item .count.stock-success,
.cat-group-header .count.stock-success,
.game-header-row .count.stock-success,
.nav-badge.stock-success,
.side-item.active .count.stock-success,
.cat-group-header.active .count.stock-success {
  color: #34d399 !important;
  background: rgba(34, 197, 94, 0.14) !important;
  border: 1px solid rgba(34, 197, 94, 0.46) !important;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.06) inset !important;
}

/* === SIDEBAR GAME CARD + GAME SWITCHER OPTIMIZATIONS === */

/* Game Switcher Horizontal Scroll */
.game-switcher-wrap {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 10px 0;
  margin-bottom: 8px;
  scrollbar-width: none; /* Hide scrollbar for Firefox */
  -webkit-overflow-scrolling: touch;
}

.game-switcher-wrap::-webkit-scrollbar {
  display: none; /* Hide scrollbar for Chrome/Safari */
}

/* Switcher Card */
.game-switcher-card {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card2, #1b2030);
  border: 1.5px solid var(--line, #2d3748);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  min-width: 100px;
}

.game-switcher-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.game-switcher-card.active {
  border-color: var(--game-color, var(--accent)) !important;
  background: color-mix(in srgb, var(--game-color, var(--accent)) 6%, var(--card2, #1b2030)) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.game-switcher-card .g-icon {
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
}

.game-switcher-card .g-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.game-switcher-card .g-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text, #fff);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 90px;
}

.game-switcher-card .g-sub {
  font-size: 9px;
  color: var(--muted, #718096);
  white-space: nowrap;
}

.game-switcher-card .g-count {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  background: var(--line, #2d3748);
  color: var(--text-secondary, #cbd5e0);
}

.game-switcher-card.active .g-count {
  background: var(--game-color, var(--accent));
  color: #fff;
}

/* Quick Add Switcher Card */
.game-switcher-card.add-card {
  border-style: dashed;
  background: transparent;
  justify-content: center;
  opacity: 0.65;
}

.game-switcher-card.add-card:hover {
  opacity: 1;
  border-style: solid;
  border-color: var(--accent);
}

.game-switcher-card.add-card .g-icon {
  background: transparent;
  font-size: 18px;
  color: var(--accent);
}

/* Active Game block panel */
.game-detail-block {
  border: 1px solid var(--line, #2d3748);
  border-radius: 12px;
  background: var(--card, #111524);
  padding: 12px;
  margin-bottom: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  border-left: 4px solid var(--game-color, var(--accent)) !important;
}

.game-detail-header {
  border-bottom: 1px solid var(--line, #2d3748);
  padding-bottom: 8px;
  margin-bottom: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.game-detail-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #fff);
}

.game-detail-subtitle {
  font-size: 10px;
  color: var(--muted, #718096);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.game-detail-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Collapsed Game Card Row */
.game-collapsed-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--card2, #1b2030);
  border: 1px solid var(--line, #2d3748);
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  border-left: 3.5px solid var(--game-color, var(--accent)) !important;
}

.game-collapsed-card:hover {
  background: var(--line, #2d3748);
  transform: translateX(2px);
}

.game-collapsed-card .c-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #cbd5e0);
}

.game-collapsed-card:hover .c-name {
  color: var(--text, #fff);
}

.game-collapsed-card .c-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.game-collapsed-card .c-count {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.game-collapsed-card .c-arrow {
  font-size: 10px;
  color: var(--muted, #718096);
}

/* Drag & Drop Reordering Mode Styling */
.sort-mode-banner {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  font-size: 11px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 8px;
  text-align: center;
}

.sort-actions-row {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.sort-tree-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sort-game-item,
.sort-group-item,
.sort-child-item {
  background: var(--card2, #1b2030);
  border: 1px solid var(--line, #2d3748);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 4px;
  transition: all 0.2s ease;
  user-select: none;
}

.sort-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drag-handle {
  cursor: grab;
  color: var(--muted, #718096);
  font-size: 13px;
  font-weight: bold;
}

.sort-item-name {
  font-size: 12px;
  color: var(--text-secondary, #cbd5e0);
}

.sort-groups-list {
  margin-left: 14px;
  margin-top: 6px;
  border-left: 1px dashed rgba(255, 255, 255, 0.08);
  padding-left: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sort-children-list {
  margin-left: 14px;
  margin-top: 4px;
  border-left: 1px dashed rgba(255, 255, 255, 0.08);
  padding-left: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sort-child-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Drag State Visuals */
[draggable="true"].dragging {
  opacity: 0.4;
  border-style: dashed !important;
}

[draggable="true"].drag-over {
  border-color: var(--accent, #a855f7) !important;
  background: rgba(168, 85, 247, 0.05) !important;
}
