.cabinet-overlay {
  display: none; position: fixed; inset: 0; z-index: 10050;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.cabinet-overlay.open { display: block; }

/* Windows 11: wide sidebar with left nav + content area */
.cabinet-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 10051;
  width: 640px; max-width: 100vw;
  background: var(--card-bg);
  display: flex; flex-direction: row;
  transform: translateX(102%);
  transition: transform 0.36s cubic-bezier(0.4,0,0.2,1);
  border-left: 1px solid var(--card-border);
  border-radius: 12px 0 0 12px;
  overflow: hidden;
}
.cabinet-panel.open { transform: translateX(0); }

/* === LEFT NAV (Win11 NavigationView) === */
.cab-nav {
  width: 200px; min-width: 200px;
  background: var(--bg);
  border-right: 1px solid var(--card-border);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}
.cab-nav-header {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--card-border);
  flex-shrink: 0;
  display: flex; flex-direction: column; gap: 10px;
  min-height: var(--cab-header-h, 72px);
  justify-content: center;
}
.cab-nav-user {
  display: flex; align-items: center; gap: 11px;
}
.cabinet-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #0078D4, #0099BC);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,120,212,0.35);
}
.cab-nav-user-info { flex: 1; min-width: 0; }
.cabinet-profile-name { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.2; }
.cabinet-profile-email { font-size: 11px; color: var(--text-secondary); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cabinet-profile-row { display: flex; align-items: center; gap: 14px; }
.cabinet-profile-info { flex: 1; min-width: 0; }

.cab-nav-items {
  flex: 1; overflow-y: auto; padding: 8px 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.cabinet-tab {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 12px;
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary); background: none; border: none;
  cursor: pointer; border-radius: 8px; text-align: left;
  transition: background 0.15s, color 0.15s;
  font-family: inherit; white-space: nowrap;
  position: relative;
}
.cabinet-tab:hover:not(.active) {
  background: var(--row-hover); color: var(--text);
}
.cabinet-tab.active {
  background: rgba(0,120,212,0.12);
  color: #0078D4;
  font-weight: 600;
}
[data-theme="light"] .cabinet-tab.active { background: rgba(0,120,212,0.10); }
.cabinet-tab.active::before {
  content: '';
  position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; border-radius: 0 3px 3px 0;
  background: #0078D4;
}
.cab-tab-icon {
  width: 20px; height: 20px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border-radius: 0;
}
.cab-tab-icon svg { width: 16px; height: 16px; color: var(--text-secondary); }
.cabinet-tab.active .cab-tab-icon svg { color: #0078D4; }

.cab-nav-footer {
  padding: 10px 8px; border-top: 1px solid var(--card-border); flex-shrink: 0;
}

/* === RIGHT CONTENT === */
.cab-content-area {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
  min-width: 0;
}

.cabinet-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--card-border);
  flex-shrink: 0;
  min-height: var(--cab-header-h, 72px);
  box-sizing: border-box;
}
.cabinet-header__title { font-size: 18px; font-weight: 700; color: var(--text); flex: 1; letter-spacing: -0.3px; }
.cabinet-close {
  width: 32px; height: 32px; border-radius: 8px;
  background: transparent; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.cabinet-close:hover { background: rgba(255,59,48,0.12); color: #FF3B30; }
.cabinet-close svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; display: block; }

/* Legacy tabs hidden (replaced by left nav) */
.cabinet-tabs { display: none !important; }

/* Content */
.cabinet-content {
  flex: 1; overflow-y: auto; padding: 20px 24px;
  display: flex; flex-direction: column; gap: 18px;
}
.cabinet-section { display: flex; flex-direction: column; gap: 10px; }
.cabinet-section__title {
  font-size: 11px; font-weight: 600; color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: 0.6px;
}

/* Type toggle */
.cab-type-toggle {
  display: flex; gap: 0; border: 1px solid var(--filter-border);
  border-radius: 6px; overflow: hidden;
}
.cab-type-btn {
  flex: 1; padding: 9px 0; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); background: none; border: none;
  cursor: pointer; transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.cab-type-btn.active { background: #0078D4; color: #fff; }
.cab-type-btn:not(.active):hover { background: var(--row-hover); color: var(--text); }

/* Form fields */
.cab-field { display: flex; flex-direction: column; gap: 5px; }
.cab-field label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.cab-field input {
  width: 100%; background: var(--bg);
  border: 1px solid var(--filter-border); border-radius: 8px;
  padding: 9px 12px; font-size: 14px; color: var(--text);
  font-family: inherit; outline: none;
  transition: border-color 0.18s; box-sizing: border-box;
  -webkit-appearance: none;
}
.cab-field input:focus { border-color: #0078D4; }

/* Settings row */
.cab-setting-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--bg);
  border: 1px solid var(--filter-border); border-radius: 6px;
  gap: 12px;
}
.cab-setting-label { font-size: 13px; color: var(--text); }
.cab-setting-value { font-size: 13px; color: var(--text-secondary); }

/* Toggle switch */
.cab-toggle {
  width: 40px; height: 22px; border-radius: 11px;
  background: var(--card-border); border: none; cursor: pointer;
  position: relative; transition: background 0.2s; flex-shrink: 0; padding: 0;
}
.cab-toggle.on { background: #0078D4; }
.cab-toggle::after {
  content: ''; position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.cab-toggle.on::after { transform: translateX(18px); }

/* Save button — Win11 Accent style */
.cab-save-btn {
  width: 100%; height: 42px; border-radius: 8px;
  background: #0078D4; color: #fff; border: none;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background 0.15s, opacity 0.15s; font-family: inherit;
}
.cab-save-btn:hover { background: #006CBD; }
.cab-save-btn:active { background: #005EA6; }

/* Density radio pills */
.cab-density-group { display: flex; gap: 6px; }
.cab-density-pill {
  flex: 1; padding: 8px 0; font-size: 12px; font-weight: 500;
  color: var(--text-secondary); background: var(--bg);
  border: 1px solid var(--filter-border); border-radius: 8px;
  cursor: pointer; text-align: center; transition: all 0.15s;
  font-family: inherit;
}
.cab-density-pill.active { background: #0078D4; color: #fff; border-color: #0078D4; }

/* Theme pills */
.cab-theme-group { display: flex; gap: 6px; }
.cab-theme-pill {
  flex: 1; padding: 8px 0; font-size: 12px; font-weight: 500;
  color: var(--text-secondary); background: var(--bg);
  border: 1px solid var(--filter-border); border-radius: 8px;
  cursor: pointer; text-align: center; transition: all 0.15s;
  font-family: inherit;
}
.cab-theme-pill.active { background: #0078D4; color: #fff; border-color: #0078D4; }

@media (max-width: 700px) {
  .cabinet-panel { width: 100vw; border-radius: 0; }
  .cab-nav { width: 56px; min-width: 56px; }
  .cab-nav-user-info, .cabinet-tab span.cab-tab-label, .cab-nav-header .cabinet-profile-name,
  .cab-nav-header .cabinet-profile-email { display: none; }
  .cabinet-tab { padding: 10px 0; justify-content: center; }
  .cab-nav-header { align-items: center; padding: 16px 8px 10px; }
}
@media (max-width: 480px) {
  .cabinet-panel { width: 100vw; }
}


/* Supplier/vendor filter lists */
.cab-list { display: flex; flex-direction: column; gap: 2px; }
.cab-list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px;
  cursor: pointer; transition: background 0.1s;
  user-select: none;
}
.cab-list-item:hover { background: var(--row-hover); }
.cab-list-item input[type="checkbox"] {
  display: block; width: 16px; height: 16px; border-radius: 4px;
  border: 1.5px solid var(--text-secondary); background: transparent;
  appearance: none; -webkit-appearance: none;
  cursor: pointer; position: relative; flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.cab-list-item input[type="checkbox"]:checked { background: #0078D4; border-color: #0078D4; }
.cab-list-item input[type="checkbox"]:checked::after {
  content: ''; position: absolute; left: 50%; top: 50%;
  width: 9px; height: 5px;
  border-left: 1.5px solid #fff; border-bottom: 1.5px solid #fff;
  transform: translate(-50%, -60%) rotate(-45deg);
}
.cab-list-item span { font-size: 13px; color: var(--text); flex: 1; }
.cab-list-item .cab-list-badge {
  font-size: 11px; color: var(--text-tertiary);
  background: var(--bg); border: 1px solid var(--card-border);
  border-radius: 5px; padding: 1px 6px; flex-shrink: 0;
}
.cab-filter-hint {
  font-size: 12px; color: var(--text-secondary);
  padding: 8px 12px; background: rgba(0,120,212,0.07);
  border-radius: 9px; line-height: 1.5;
}
.cab-filter-hint.warn {
  background: rgba(255,149,0,0.08); color: #FF9500;
}
.cab-selectall {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 12px 8px;
}
.cab-selectall-btn {
  font-size: 12px; color: #0078D4; background: none; border: none;
  cursor: pointer; padding: 0; font-family: inherit;
}



/* ===== WATCHLIST (ИЗБРАННОЕ) ===== */
