@import url("./tokens.css");

:root {
  --dashboard-bg: #0b1020;
  --dashboard-surface: #151b2e;
  --dashboard-surface-elevated: #1a2238;
  --dashboard-text: #ffffff;
  --dashboard-muted: #8b95b2;
  --dashboard-border: #2a3555;
  --dashboard-accent: #2f7df6;
  --dashboard-accent-soft: rgba(47, 125, 246, 0.18);
  --dashboard-media-bg: #11182b;
  --sidebar-width: 220px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.dashboard-page {
  height: 100dvh;
  overflow: hidden;
  font-family: var(--font-family-base);
  background: var(--dashboard-bg);
  color: var(--dashboard-text);
}

button,
a {
  font: inherit;
  color: inherit;
}

.dashboard {
  height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  transition: grid-template-columns 0.25s ease;
}

.dashboard--sidebar-collapsed,
html.sidebar-collapsed-boot .dashboard {
  --sidebar-width: 0px;
}

html.sidebar-collapsed-boot .dashboard {
  transition: none;
}

.sidebar {
  background: var(--dashboard-surface);
  border-right: 1px solid var(--dashboard-border);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  transition: opacity 0.2s ease, padding 0.25s ease, border-color 0.25s ease;
}

.dashboard--sidebar-collapsed .sidebar,
html.sidebar-collapsed-boot .dashboard .sidebar {
  opacity: 0;
  pointer-events: none;
  padding: 0;
  border-right-color: transparent;
}

html.sidebar-collapsed-boot .dashboard .sidebar {
  transition: none;
}

html.sidebar-collapsed-boot .sidebar-reopen-btn {
  display: grid !important;
}

.sidebar__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 28px;
}

.sidebar__logo {
  margin-bottom: 0;
  min-width: 0;
}

.sidebar__collapse-btn,
.sidebar-reopen-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--dashboard-border);
  background: var(--dashboard-surface-elevated);
  color: var(--dashboard-text);
  cursor: pointer;
}

.sidebar__collapse-btn:hover,
.sidebar-reopen-btn:hover {
  border-color: var(--dashboard-accent);
  color: var(--dashboard-accent);
}

.sidebar-reopen-btn[hidden] {
  display: none !important;
}

.sidebar__logo img {
  display: block;
  height: 32px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.sidebar__nav,
.sidebar__footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar__footer {
  margin-top: auto;
  padding-top: 24px;
}

.sidebar__link,
.sidebar__button {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--dashboard-text);
  text-decoration: none;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.sidebar__link:hover,
.sidebar__button:hover {
  background: var(--dashboard-surface-elevated);
}

.sidebar__link--active {
  color: var(--dashboard-accent);
  background: var(--dashboard-accent-soft);
  font-weight: 600;
}

.dashboard--camera-list-view .group-filters-wrap {
  display: none !important;
}

.dashboard--camera-list-view .dashboard__tools,
.dashboard--camera-list-view #camera-stage,
.dashboard--camera-list-view .pagination-wrap {
  display: none !important;
}

.dashboard--camera-list-view .dashboard__header:not(:has(.sidebar-reopen-btn:not([hidden]))),
.dashboard--users-view .dashboard__header:not(:has(.sidebar-reopen-btn:not([hidden]))) {
  display: none;
}

.dashboard--camera-list-view .dashboard__main,
.dashboard--users-view .dashboard__main {
  gap: 10px;
}

.dashboard--camera-list-view .dashboard__meta,
.dashboard--users-view .dashboard__meta {
  color: #fff;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
}

.dashboard--account-view .group-filters-wrap,
.dashboard--account-view .dashboard__tools,
.dashboard--account-view #camera-stage,
.dashboard--account-view .pagination-wrap,
.dashboard--account-view .camera-list,
.dashboard--history-view .group-filters-wrap,
.dashboard--history-view .dashboard__tools,
.dashboard--history-view #camera-stage,
.dashboard--history-view .pagination-wrap,
.dashboard--history-view .camera-list,
.dashboard--integrations-view .group-filters-wrap,
.dashboard--integrations-view .dashboard__tools,
.dashboard--integrations-view #camera-stage,
.dashboard--integrations-view .pagination-wrap,
.dashboard--integrations-view .camera-list {
  display: none !important;
}

.dashboard--users-view .group-filters-wrap,
.dashboard--users-view .dashboard__tools,
.dashboard--users-view #camera-stage,
.dashboard--users-view .pagination-wrap,
.dashboard--users-view .camera-list,
.dashboard--users-view .account-panel,
.dashboard--users-view .history-panel,
.dashboard--history-view .group-filters-wrap,
.dashboard--history-view .dashboard__tools,
.dashboard--history-view #camera-stage,
.dashboard--history-view .pagination-wrap,
.dashboard--history-view .camera-list,
.dashboard--history-view .account-panel,
.dashboard--history-view .users-list,
.dashboard--integrations-view .account-panel,
.dashboard--integrations-view .users-list,
.dashboard--integrations-view .history-panel {
  display: none !important;
}

.users-list {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--dashboard-border);
  border-radius: 16px;
  background: var(--dashboard-surface-elevated);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.users-list[hidden] {
  display: none !important;
}

.dashboard__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
  flex-shrink: 0;
  color: var(--dashboard-muted);
}

.dashboard__meta-text {
  min-width: 0;
}

.users-list__meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
  color: #fff;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
}

.users-list__meta-bar[hidden] {
  display: none !important;
}

.users-list__meta-text {
  min-width: 0;
}

.users-list__table {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.users-list__add-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(47, 125, 246, 0.45);
  border-radius: 10px;
  background: rgba(47, 125, 246, 0.12);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.users-list__add-btn:hover,
.users-list__add-btn:focus-visible {
  background: rgba(47, 125, 246, 0.24);
  border-color: var(--dashboard-accent);
  outline: none;
}

.users-list__add-icon {
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
}

.users-list__head {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(160px, 22%) minmax(200px, 26%);
  align-items: center;
  gap: 24px;
  padding: 12px 24px 16px;
  border-bottom: 1px solid var(--dashboard-border);
  color: var(--dashboard-muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.users-list__head-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  text-align: left;
}

.users-list__head-sort:hover,
.users-list__head-sort:focus-visible {
  color: var(--dashboard-accent);
}

.users-list__sort-icon {
  font-size: 12px;
  line-height: 1;
  transition: transform 0.15s ease;
}

.users-list__head-sort--desc .users-list__sort-icon {
  transform: rotate(180deg);
}

.users-list__head-email {
  text-align: right;
  padding-right: 4px;
}

.users-list__head-groups,
.users-list__head-cameras {
  min-width: 0;
}

.users-drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  justify-content: flex-end;
}

.users-drawer[hidden] {
  display: none !important;
}

.users-drawer__backdrop {
  flex: 1;
  border: 0;
  background: rgba(4, 8, 18, 0.55);
  cursor: pointer;
}

.users-drawer__panel {
  position: relative;
  width: min(540px, 100vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--dashboard-border);
  background: var(--dashboard-surface-elevated);
  box-shadow: -16px 0 40px rgba(0, 0, 0, 0.35);
}

.users-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--dashboard-border);
}

.users-drawer__title {
  margin: 0;
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}

.users-drawer__close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.users-drawer__close:hover,
.users-drawer__close:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  outline: none;
}

.users-drawer__form {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  overflow-y: auto;
}

.users-drawer__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.users-drawer__label {
  color: var(--dashboard-muted);
  font-size: 13px;
  font-weight: 500;
}

.users-drawer__input {
  width: 100%;
  border: 1px solid var(--dashboard-border);
  border-radius: 10px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
  font-size: 16px;
  line-height: 1.35;
}

.users-drawer__input:focus {
  outline: none;
  border-color: var(--dashboard-accent);
  box-shadow: 0 0 0 2px rgba(47, 125, 246, 0.18);
}

.users-drawer__input:invalid {
  box-shadow: none;
}

.users-drawer__groups {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--dashboard-border);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.22);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.users-drawer__groups::-webkit-scrollbar {
  width: 8px;
}

.users-drawer__groups::-webkit-scrollbar-track {
  background: transparent;
}

.users-drawer__groups::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.users-drawer__search {
  margin-bottom: 4px;
}

.users-drawer__tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
}

.users-drawer__tab {
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
}

.users-drawer__tab:hover,
.users-drawer__tab:focus-visible {
  color: #fff;
  outline: none;
}

.users-drawer__tab--active {
  background: var(--dashboard-accent);
  color: #fff;
}

.users-drawer__cameras {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--dashboard-border);
  border-radius: 10px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.22);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.users-drawer__cameras::-webkit-scrollbar {
  width: 8px;
}

.users-drawer__cameras::-webkit-scrollbar-track {
  background: transparent;
}

.users-drawer__cameras::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.users-drawer__cameras[hidden] {
  display: none !important;
}

.users-drawer__camera-option {
  margin: 0;
  align-items: stretch;
  gap: 10px;
}

.users-drawer__camera-option:has(input[data-camera-id]:checked) {
  border-color: var(--dashboard-accent);
  background: rgba(91, 140, 255, 0.14);
}

.users-drawer__camera-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  cursor: pointer;
}

.users-drawer__camera-access {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: min(168px, 38%);
  flex-shrink: 0;
  margin-left: auto;
  padding: 2px 0;
}

.users-drawer__camera-access-label {
  color: var(--dashboard-muted);
  font-size: 11px;
  line-height: 1.2;
}

.users-drawer__camera-role-select {
  width: 100%;
}

.ui-select {
  position: relative;
  width: 100%;
}

.ui-select__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--dashboard-border);
  border-radius: 8px;
  padding: 7px 10px;
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
  font: inherit;
  font-size: 12px;
  line-height: 1.3;
  cursor: pointer;
  text-align: left;
}

.ui-select__trigger:hover {
  border-color: rgba(47, 125, 246, 0.45);
}

.ui-select--open .ui-select__trigger,
.ui-select__trigger:focus-visible {
  outline: none;
  border-color: var(--dashboard-accent);
  box-shadow: 0 0 0 2px rgba(47, 125, 246, 0.18);
}

.ui-select__value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-select__chevron {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%23ffffff' stroke-opacity='0.72' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.15s ease;
}

.ui-select--open .ui-select__chevron {
  transform: rotate(180deg);
}

.ui-select__menu {
  margin: 0;
  padding: 4px;
  list-style: none;
  border: 1px solid var(--dashboard-border);
  border-radius: 8px;
  background: var(--dashboard-surface);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  max-height: 180px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.ui-select__menu[hidden] {
  display: none !important;
}

.ui-select__menu::-webkit-scrollbar {
  width: 8px;
}

.ui-select__menu::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.ui-select__option {
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--dashboard-text);
  font-size: 12px;
  line-height: 1.35;
  cursor: pointer;
}

.ui-select__option:hover {
  background: rgba(255, 255, 255, 0.06);
}

.ui-select__option--selected {
  color: var(--dashboard-accent);
  background: rgba(47, 125, 246, 0.14);
  font-weight: 600;
}

.users-drawer__cameras--groups {
  gap: 14px;
}

.users-drawer__group-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.users-drawer__group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 4px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
}

.users-drawer__group-header input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--dashboard-accent);
  cursor: pointer;
  flex-shrink: 0;
}

.users-drawer__group-header-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.users-drawer__group-header-meta {
  flex-shrink: 0;
  color: var(--dashboard-muted);
  font-size: 12px;
  font-weight: 500;
}

.users-drawer__group-cameras {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 8px;
}

.users-drawer__roles-field {
  margin: 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}

.users-drawer__roles-field[hidden] {
  display: none !important;
}

.users-drawer__roles {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.users-drawer__role-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #fff;
  font-size: 15px;
  line-height: 1.35;
  cursor: pointer;
}

.users-drawer__role-option input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--dashboard-accent);
  cursor: pointer;
  flex-shrink: 0;
}

.users-drawer__role-option-label {
  min-width: 0;
}

.users-drawer__groups-empty {
  color: var(--dashboard-muted);
  font-size: 14px;
  line-height: 1.4;
}

.users-drawer__group-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 4px 2px;
  color: #fff;
  font-size: 15px;
  line-height: 1.35;
  cursor: pointer;
}

.users-drawer__group-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--dashboard-accent);
  cursor: pointer;
  flex-shrink: 0;
}

.users-drawer__group-option-body {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.users-drawer__group-option-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.users-drawer__group-option-meta {
  flex-shrink: 0;
  color: var(--dashboard-muted);
  font-size: 13px;
  line-height: 1.35;
}

.users-drawer__groups-summary {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
  line-height: 1.4;
}

.users-drawer__groups-summary[hidden] {
  display: none !important;
}

.users-drawer__field-hint {
  color: var(--dashboard-muted);
  font-size: 12px;
  line-height: 1.4;
}

.users-drawer__hint {
  margin: 0;
  color: var(--dashboard-muted);
  font-size: 13px;
  line-height: 1.4;
}

.users-drawer__error {
  margin: 0;
  color: #ffb4b4;
  font-size: 14px;
  line-height: 1.4;
}

.users-drawer__error[hidden] {
  display: none !important;
}

.users-drawer__submit {
  margin-top: auto;
  border: 0;
  border-radius: 12px;
  padding: 14px 18px;
  background: var(--dashboard-accent);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.users-drawer__submit:hover:not(:disabled),
.users-drawer__submit:focus-visible:not(:disabled) {
  filter: brightness(1.08);
  outline: none;
}

.users-drawer__submit:disabled {
  opacity: 0.7;
  cursor: default;
}

.users-drawer__preview-zoom {
  position: fixed;
  z-index: 60;
  width: min(420px, calc(100vw - 32px));
  border: 3px solid var(--dashboard-accent);
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.users-drawer__preview-zoom[hidden] {
  display: none !important;
}

.users-drawer__preview-zoom-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #11182b;
}

.users-drawer__preview-zoom-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.users-drawer__preview-zoom-image[hidden],
.users-drawer__preview-zoom-offline[hidden] {
  display: none !important;
}

.users-drawer__preview-zoom-offline {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--dashboard-muted);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  padding: 16px;
}

.users-drawer__preview-zoom-label {
  padding: 10px 12px;
  background: rgba(11, 16, 32, 0.92);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.users-list__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.users-list__body::-webkit-scrollbar {
  width: 8px;
}

.users-list__body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.users-list__row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(160px, 22%) minmax(200px, 26%);
  align-items: center;
  gap: 24px;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background 0.15s ease;
}

.users-list__row:hover,
.users-list__row:focus-visible {
  background: rgba(47, 125, 246, 0.08);
  outline: none;
}

.users-list__row:last-child {
  border-bottom: 0;
}

.users-list__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
}

.users-list__email {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.88);
  font-size: 16px;
  line-height: 1.4;
  text-align: right;
  padding-right: 4px;
}

.users-list__groups {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
  line-height: 1.35;
}

.users-list__access-count {
  color: rgba(255, 255, 255, 0.88);
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.users-list__access-roles {
  color: var(--dashboard-muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.users-list__empty,
.users-list__error {
  padding: 36px 24px;
  color: var(--dashboard-muted);
  font-size: 16px;
  text-align: center;
}

.users-list__error {
  color: #ffb4b4;
}

.account-panel {
  --account-muted: #c5cee6;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: stretch;
  padding: 8px 0 16px;
}

.account-panel[hidden] {
  display: none !important;
}

.placeholder-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8px 0 16px;
}

.placeholder-panel[hidden] {
  display: none !important;
}

.placeholder-panel__card {
  width: min(100%, 420px);
  padding: 24px;
  border: 1px solid var(--dashboard-border);
  border-radius: 16px;
  background: var(--dashboard-surface-elevated);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.placeholder-panel__title {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
}

.placeholder-panel__text {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--dashboard-muted);
}

.account-panel__card {
  width: 100%;
  max-width: none;
  padding: 28px 32px;
  border: 1px solid var(--dashboard-border);
  border-radius: 16px;
  background: var(--dashboard-surface-elevated);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.account-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 24px;
}

.account-panel__header-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.account-panel__title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: #fff;
}

.account-panel__user-name {
  margin: 0;
  color: #f2f5ff;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
}

.account-panel__entity {
  flex-shrink: 0;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #e8eefc;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.account-panel__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 20px 28px;
  align-items: start;
}

.account-panel__balance-wrap,
.account-panel__password {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.account-panel__section-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.account-panel__label {
  color: var(--account-muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.account-panel__balance {
  margin: 0;
  color: #fff;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.2;
}

.account-panel__balance--loading {
  color: var(--account-muted);
  font-size: 24px;
  font-weight: 500;
}

.account-panel__hint {
  margin: 0;
  color: #ffb4b4;
  font-size: 13px;
  line-height: 1.4;
}

.account-panel__hint[hidden] {
  display: none !important;
}

.account-panel__password-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.account-panel__input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--dashboard-border);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font: inherit;
}

.account-panel__input::placeholder {
  color: rgba(197, 206, 230, 0.72);
}

.account-panel__input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.34);
}

.account-panel__password-submit {
  align-self: flex-start;
  margin-top: 2px;
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  background: var(--dashboard-accent);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.account-panel__password-submit:hover:not(:disabled),
.account-panel__password-submit:focus-visible:not(:disabled) {
  background: #3b7cff;
}

.account-panel__password-submit:disabled {
  opacity: 0.7;
  cursor: default;
}

.account-panel__sessions {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.account-panel__sessions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.account-panel__sessions-refresh {
  border: 1px solid var(--dashboard-border);
  border-radius: 10px;
  background: transparent;
  color: var(--account-muted);
  font: inherit;
  font-size: 13px;
  padding: 6px 12px;
  cursor: pointer;
}

.account-panel__sessions-refresh:hover:not(:disabled) {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}

.account-panel__sessions-refresh:disabled {
  opacity: 0.55;
  cursor: default;
}

.account-panel__sessions-status {
  margin: 0;
  color: var(--account-muted);
  font-size: 14px;
  line-height: 1.4;
}

.account-panel__sessions-status[hidden] {
  display: none !important;
}

.account-panel__sessions-table[hidden] {
  display: none !important;
}

.account-panel__sessions-cols,
.account-panel__sessions-item {
  display: grid;
  grid-template-columns: minmax(140px, 0.8fr) minmax(0, 1.8fr) minmax(140px, 0.8fr) auto;
  gap: 16px;
  align-items: center;
}

.account-panel__sessions-cols {
  padding: 0 0 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--account-muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.account-panel__sessions-list {
  max-height: min(48vh, 420px);
  overflow: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.account-panel__sessions-list::-webkit-scrollbar {
  width: 8px;
}

.account-panel__sessions-list::-webkit-scrollbar-track {
  background: transparent;
}

.account-panel__sessions-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.account-panel__sessions-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.34);
}

.account-panel__sessions-item {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #f5f7ff;
  font-size: 14px;
  line-height: 1.4;
}

.account-panel__sessions-item:last-child {
  border-bottom: none;
}

.account-panel__sessions-ip {
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.account-panel__sessions-ua {
  color: var(--account-muted);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.account-panel__sessions-when {
  color: var(--account-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.account-panel__sessions-actions {
  display: flex;
  justify-content: flex-end;
}

.account-panel__sessions-delete {
  border: 1px solid rgba(255, 143, 143, 0.35);
  border-radius: 10px;
  background: rgba(255, 90, 90, 0.12);
  color: #ffc4c4;
  font: inherit;
  font-size: 13px;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
}

.account-panel__sessions-delete:hover:not(:disabled) {
  color: #ffe0e0;
  border-color: rgba(255, 143, 143, 0.55);
  background: rgba(255, 90, 90, 0.2);
}

.account-panel__sessions-delete:disabled {
  opacity: 0.55;
  cursor: default;
}

@media (max-width: 900px) {
  .account-panel__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .account-panel__card {
    padding: 20px;
  }

  .account-panel__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .account-panel__sessions-cols {
    display: none;
  }

  .account-panel__sessions-item {
    grid-template-columns: 1fr;
    gap: 6px;
    align-items: stretch;
  }

  .account-panel__sessions-when {
    white-space: normal;
  }

  .account-panel__sessions-actions {
    justify-content: flex-start;
    margin-top: 4px;
  }
}

.history-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--dashboard-border);
  border-radius: 16px;
  background: var(--dashboard-surface-elevated);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.history-panel[hidden] {
  display: none !important;
}

.history-panel__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
  padding: 16px 24px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.history-panel__title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
}

.history-panel__table {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.history-panel__cols,
.history-panel__item {
  display: grid;
  grid-template-columns:
    minmax(140px, 0.85fr)
    minmax(0, 1.8fr)
    minmax(140px, 0.75fr);
  align-items: center;
  gap: 20px;
  padding: 12px 24px;
}

.history-panel__cols {
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.history-panel__col-when,
.history-panel__item-meta {
  text-align: right;
}

.history-panel__status {
  margin: 0;
  padding: 24px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
}

.history-panel__status[hidden] {
  display: none !important;
}

.history-panel__list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.history-panel__list::-webkit-scrollbar {
  width: 8px;
}

.history-panel__list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.history-panel__item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  min-height: 56px;
}

.history-panel__item:last-child {
  border-bottom: 0;
}

.history-panel__item:hover {
  background: rgba(47, 125, 246, 0.06);
}

.history-panel__item-type {
  min-width: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.history-panel__item-target {
  min-width: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.history-panel__item-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  line-height: 1.35;
}

.history-panel__item-time {
  color: rgba(255, 255, 255, 0.78);
  font-variant-numeric: tabular-nums;
}

.history-panel__footer {
  flex-shrink: 0;
  padding: 12px 24px 16px;
  display: flex;
  justify-content: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.history-panel__footer[hidden] {
  display: none !important;
}

.history-panel__more {
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--dashboard-border);
  border-radius: 10px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.history-panel__more:disabled {
  opacity: 0.6;
  cursor: default;
}

@media (max-width: 1100px) {
  .history-panel__cols,
  .history-panel__item {
    grid-template-columns: minmax(120px, 0.9fr) minmax(0, 1.5fr) minmax(120px, 0.8fr);
    gap: 14px;
    padding: 12px 16px;
  }

  .history-panel__toolbar {
    padding: 14px 16px 10px;
  }
}

@media (max-width: 760px) {
  .history-panel__cols {
    display: none;
  }

  .history-panel__item {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 14px 16px;
    align-items: start;
  }

  .history-panel__item-meta {
    align-items: flex-start;
    text-align: left;
  }
}

.camera-list {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--dashboard-border);
  border-radius: 16px;
  background: var(--dashboard-surface-elevated);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.camera-list[hidden] {
  display: none !important;
}

.camera-list__table {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.camera-list__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 28%);
  align-items: center;
  gap: 24px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--dashboard-border);
  color: var(--dashboard-muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.camera-list__head-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  text-align: left;
}

.camera-list__head-sort:hover,
.camera-list__head-sort:focus-visible {
  color: var(--dashboard-accent);
}

.camera-list__sort-icon {
  font-size: 12px;
  line-height: 1;
  transition: transform 0.15s ease;
}

.camera-list__head-sort--desc .camera-list__sort-icon {
  transform: rotate(180deg);
}

.camera-list__head-tariff {
  text-align: right;
  padding-right: 4px;
}

.camera-list__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.camera-list__body::-webkit-scrollbar {
  width: 8px;
}

.camera-list__body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.camera-list__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 28%);
  align-items: center;
  gap: 24px;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background 0.15s ease;
}

.camera-list__row:hover,
.camera-list__row:focus-visible {
  background: rgba(47, 125, 246, 0.08);
  outline: none;
}

.camera-list__row:last-child {
  border-bottom: 0;
}

.camera-list__camera {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.camera-list__thumb {
  position: relative;
  flex-shrink: 0;
  width: 96px;
  height: 54px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.camera-list__thumb .camera-card__add-thumb-image,
.camera-list__thumb .camera-card__add-thumb-placeholder {
  border-radius: inherit;
}

.camera-list__info {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
}

.camera-list__name {
  min-width: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.camera-list__tariff {
  color: rgba(255, 255, 255, 0.88);
  font-size: 16px;
  line-height: 1.4;
  text-align: right;
  padding-right: 4px;
  overflow: visible;
  white-space: normal;
  word-break: break-word;
}

.camera-list__preview-zoom {
  position: fixed;
  z-index: 40;
  width: min(420px, calc(100vw - 32px));
  border: 3px solid var(--dashboard-accent);
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.camera-list__preview-zoom[hidden] {
  display: none !important;
}

.camera-list__preview-zoom-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #11182b;
}

.camera-list__preview-zoom-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.camera-list__preview-zoom-image[hidden],
.camera-list__preview-zoom-offline[hidden] {
  display: none !important;
}

.camera-list__preview-zoom-offline {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--dashboard-muted);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  padding: 16px;
}

.camera-list__preview-zoom-label {
  padding: 10px 12px;
  background: rgba(11, 16, 32, 0.92);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.camera-list__empty {
  padding: 36px 24px;
  color: var(--dashboard-muted);
  font-size: 16px;
  text-align: center;
}

.dashboard__main {
  min-height: 0;
  min-width: 0;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.dashboard__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.dashboard__header-main {
  flex: 1;
  min-width: 0;
}

.group-filters-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.group-filters-wrap[hidden],
.camera-search[hidden] {
  display: none !important;
}

.group-filters {
  display: flex;
  flex: 1;
  flex-wrap: nowrap;
  gap: 10px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.group-filters::-webkit-scrollbar {
  display: none;
}

.group-filters__nav {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--dashboard-border);
  background: var(--dashboard-surface);
  color: var(--dashboard-text);
  cursor: pointer;
}

.group-filters__nav:hover {
  border-color: var(--dashboard-accent);
}

.group-filters__nav[hidden] {
  display: none;
}

.camera-search {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 420px;
}

.camera-search__input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--dashboard-border);
  background: var(--dashboard-surface);
  color: var(--dashboard-text);
  font-size: 14px;
}

.camera-search__input:focus {
  outline: none;
  border-color: var(--dashboard-accent);
}

.camera-search__input::placeholder {
  color: var(--dashboard-muted);
}

.camera-search__close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--dashboard-border);
  background: var(--dashboard-surface);
  color: var(--dashboard-text);
  cursor: pointer;
}

.camera-search__close:hover {
  border-color: var(--dashboard-accent);
}

.filter-pill {
  flex-shrink: 0;
  border: 1px solid var(--dashboard-border);
  background: var(--dashboard-surface);
  color: var(--dashboard-text);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.filter-pill--removing {
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
}

.filter-pill:hover {
  border-color: var(--dashboard-accent);
}

.filter-pill--active {
  background: var(--dashboard-accent);
  border-color: var(--dashboard-accent);
  color: #fff;
}

.filter-pill--add {
  border-style: dashed;
  color: var(--dashboard-accent);
}

.filter-pill--add:hover {
  background: rgba(91, 140, 255, 0.08);
}

.filter-pill--creating,
.filter-pill--editing {
  padding: 0;
  cursor: text;
  border-color: var(--dashboard-accent);
  box-shadow: 0 0 0 2px rgba(91, 140, 255, 0.18);
}

.filter-pill--active.filter-pill--editing .filter-pill__input {
  color: #fff;
}

.filter-pill--saving {
  opacity: 0.75;
  pointer-events: none;
}

.filter-pill__input {
  border: 0;
  background: transparent;
  color: var(--dashboard-text);
  font: inherit;
  padding: 8px 16px;
  outline: none;
  box-sizing: content-box;
}

.filter-pill--creating .filter-pill__input {
  min-width: 160px;
  max-width: 240px;
}

.filter-pill--editing .filter-pill__input {
  min-width: 0;
  max-width: 240px;
  width: auto;
  field-sizing: content;
}

.filter-pill__input::placeholder {
  color: var(--dashboard-muted);
}

.dashboard__tools {
  position: relative;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.settings-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1000;
  min-width: 210px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--dashboard-border);
  background: var(--dashboard-surface);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.settings-menu__title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.settings-menu__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  user-select: none;
}

.settings-menu__label {
  font-size: 14px;
  color: var(--dashboard-text);
}

.settings-menu__switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.settings-menu__toggle {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}

.settings-menu__switch-track {
  position: absolute;
  inset: 0;
  background: var(--dashboard-border);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.settings-menu__switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.settings-menu__toggle:checked + .settings-menu__switch-track {
  background: var(--dashboard-accent);
}

.settings-menu__toggle:focus-visible + .settings-menu__switch-track {
  outline: 2px solid var(--dashboard-accent);
  outline-offset: 2px;
}

.settings-menu__toggle:checked + .settings-menu__switch-track::after {
  transform: translateX(20px);
}

.tool-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--dashboard-border);
  background: var(--dashboard-surface);
  color: var(--dashboard-text);
  cursor: pointer;
}

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

.tool-btn:hover {
  border-color: var(--dashboard-accent);
}

.tool-btn--active {
  border-color: var(--dashboard-accent);
  color: var(--dashboard-accent);
}

.tool-btn--danger:hover {
  border-color: #ff7b7b;
  color: #ffb4b4;
}

.tool-btn[hidden] {
  display: none !important;
}

.tool-btn--saving {
  opacity: 0.55;
  pointer-events: none;
}

.dashboard__loader {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background: rgba(11, 16, 32, 0.45);
  backdrop-filter: blur(2px);
}

.dashboard__loader[hidden] {
  display: none !important;
}

.dashboard__loader-spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--dashboard-accent);
  animation: dashboard-loader-spin 0.85s linear infinite;
}

.dashboard__loader-text {
  font-size: 14px;
  color: var(--dashboard-muted);
}

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

.snackbar-stack {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  pointer-events: none;
}

.snackbar {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(14, 20, 36, 0.96);
  border: 1px solid var(--dashboard-border);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.38);
  animation: snackbar-in 0.24s ease;
}

.snackbar--error {
  border-color: rgba(255, 123, 123, 0.45);
}

.snackbar--success {
  border-color: rgba(91, 199, 132, 0.55);
}

.snackbar--leaving {
  opacity: 0;
  transform: translateX(12px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.snackbar__message {
  flex: 1;
  margin: 0;
  color: #fff;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

.snackbar--error .snackbar__message {
  color: #ffb4b4;
}

.snackbar__close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--dashboard-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.snackbar__close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

@keyframes snackbar-in {
  from {
    opacity: 0;
    transform: translateX(16px);
  }

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

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 8, 18, 0.62);
  backdrop-filter: blur(3px);
}

.confirm-dialog {
  width: min(420px, 100%);
  padding: 22px;
  border-radius: 16px;
  border: 1px solid var(--dashboard-border);
  background: var(--dashboard-surface);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
}

.confirm-dialog__title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}

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

.confirm-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.confirm-dialog__btn {
  border: 1px solid var(--dashboard-border);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  border-radius: 10px;
  padding: 9px 16px;
  font: inherit;
  cursor: pointer;
}

.confirm-dialog__btn:hover {
  border-color: var(--dashboard-accent);
}

.confirm-dialog__btn--primary {
  background: var(--dashboard-accent);
  border-color: var(--dashboard-accent);
}

.confirm-dialog__btn--danger {
  background: #d64545;
  border-color: #d64545;
}

.confirm-dialog__btn--danger:hover {
  background: #e25555;
  border-color: #e25555;
}

.icon {
  width: 20px;
  height: 20px;
  display: block;
  flex-shrink: 0;
}

.icon--sm {
  width: 18px;
  height: 18px;
}

.icon--lg {
  width: 24px;
  height: 24px;
}

.icon--overlay {
  width: 22px;
  height: 22px;
  color: #fff;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.55));
}

.camera-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.camera-stage:fullscreen {
  width: 100%;
  height: 100%;
  padding: 16px;
  background: var(--dashboard-bg);
}

.camera-stage:fullscreen .camera-grid {
  flex: 1;
  min-height: 0;
}

.camera-stage__exit {
  display: none;
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 40px;
  height: 40px;
  border: 1px solid var(--dashboard-border);
  border-radius: 10px;
  background: rgba(11, 16, 32, 0.82);
  color: #fff;
  cursor: pointer;
  place-items: center;
  backdrop-filter: blur(6px);
}

.camera-stage__exit[hidden] {
  display: none !important;
}

.camera-stage:fullscreen .camera-stage__exit:not([hidden]) {
  display: grid;
}

.camera-stage__exit:hover {
  border-color: var(--dashboard-accent);
}

body.dashboard-page--grid-fullscreen .fab {
  display: none;
}

.camera-grid {
  --camera-grid-cols: 2;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(var(--camera-grid-cols), minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (min-aspect-ratio: 1601/900) {
  .camera-grid {
    --camera-grid-cols: 3;
  }
}

.camera-grid__empty {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: var(--dashboard-muted);
  background: var(--dashboard-surface);
  border: 1px solid var(--dashboard-border);
  border-radius: 16px;
}

.camera-card {
  container-type: size;
  min-height: 0;
  height: 100%;
  display: grid;
  place-items: center;
  background: var(--dashboard-surface);
  border: 1px solid var(--dashboard-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.camera-card--sortable {
  cursor: grab;
  touch-action: none;
}

.camera-grid--sorting {
  cursor: grabbing;
}

.camera-grid--sorting .camera-card--sortable {
  cursor: grabbing;
}

.camera-grid--sorting .camera-card[data-camera-id] {
  transition: none;
}

.camera-card--sort-placeholder {
  background: var(--dashboard-accent-soft);
  border: 2px dashed color-mix(in srgb, var(--dashboard-accent) 50%, var(--dashboard-border));
  box-shadow: none;
  pointer-events: none;
  opacity: 1;
}

.camera-card--dragging {
  opacity: 0.96;
  cursor: grabbing;
  box-shadow: 0 28px 56px rgba(0, 0, 0, 0.45);
  border-color: var(--dashboard-accent);
  will-change: left, top, transform;
}

body.camera-sort-dragging {
  cursor: grabbing;
  user-select: none;
}

body.camera-sort-dragging .camera-card__video-el,
body.camera-sort-dragging .camera-card__image,
body.camera-sort-dragging iframe {
  pointer-events: none;
}

.camera-card--removing {
  opacity: 0;
  transform: scale(0.98);
  pointer-events: none;
}

.camera-card--entering {
  opacity: 0;
}

.camera-card--entered {
  opacity: 1;
}

.camera-card--add {
  border-style: dashed;
  box-shadow: none;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

.camera-card--add .camera-card__media {
  flex: 1;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
  background: var(--dashboard-media-bg);
}

.camera-card__add-trigger {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  box-sizing: border-box;
  background: transparent;
  color: var(--dashboard-accent);
  cursor: pointer;
  text-align: center;
}

.camera-card__add-trigger:hover {
  background: rgba(91, 140, 255, 0.06);
}

.camera-card__add-icon {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px dashed var(--dashboard-accent);
}

.camera-card__add-icon::before,
.camera-card__add-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  background: currentColor;
  border-radius: 1px;
  transform: translate(-50%, -50%);
}

.camera-card__add-icon::before {
  width: 22px;
  height: 2px;
}

.camera-card__add-icon::after {
  width: 2px;
  height: 22px;
}

.camera-card__add-text {
  font-size: clamp(14px, 1.1vw, 16px);
  font-weight: 600;
}

.camera-card--add-picker {
  min-height: 100%;
}

.camera-card--add-picker .camera-card__add-body {
  justify-content: flex-start;
  gap: 10px;
  padding: 14px 16px;
  overflow: hidden;
}

.camera-card__add-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 20px;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

.camera-card__add-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.camera-card__add-label {
  margin: 0;
  color: #fff;
  font-size: clamp(13px, 1vw, 15px);
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
}

.camera-card__add-count {
  margin: 0;
  color: var(--dashboard-muted);
  font-size: 12px;
}

.camera-card__add-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 4px 2px 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.camera-card__add-list::-webkit-scrollbar {
  width: 6px;
}

.camera-card__add-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.camera-card__add-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.camera-card__add-option:hover {
  border-color: rgba(91, 140, 255, 0.45);
  background: rgba(91, 140, 255, 0.08);
}

.camera-card__add-option:has(.camera-card__add-checkbox:checked) {
  border-color: var(--dashboard-accent);
  background: rgba(91, 140, 255, 0.14);
}

.camera-card__add-option--blocked {
  opacity: 0.82;
}

.camera-card__add-checkbox {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin: 0;
  accent-color: var(--dashboard-accent);
  cursor: pointer;
}

.camera-card__add-thumb {
  position: relative;
  flex-shrink: 0;
  width: 76px;
  height: 44px;
  overflow: hidden;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.camera-card__add-thumb-image {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-card__add-thumb-image--failed {
  display: none;
}

.camera-card__add-thumb-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.42);
}

.users-drawer__camera-option .camera-card__add-thumb-placeholder {
  display: none !important;
}

.users-drawer__camera-thumb-offline {
  position: static;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.35);
}

.camera-card__add-thumb-offline {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  color: var(--dashboard-muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  z-index: 2;
}

.camera-card__add-option-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.camera-card__add-option-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}

.camera-card__add-option-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--dashboard-muted);
  font-size: 11px;
  line-height: 1.25;
}

.camera-card__add-option-meta--warn {
  color: #ffb4b4;
}

.camera-card__add-actions {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
  justify-content: stretch;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.camera-card--add-picker .camera-card__add-btn {
  flex: 1;
}

.camera-card__add-btn {
  border: 1px solid var(--dashboard-border);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  border-radius: 10px;
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
}

.camera-card__add-btn:hover {
  border-color: var(--dashboard-accent);
}

.camera-card__add-btn--primary {
  background: var(--dashboard-accent);
  border-color: var(--dashboard-accent);
}

.camera-card__add-empty {
  margin: 0;
  text-align: center;
  color: var(--dashboard-muted);
  font-size: 14px;
}

.camera-card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  width: min(100cqw, calc(100cqh * 16 / 9));
  height: min(100cqh, calc(100cqw * 9 / 16));
  max-width: 100%;
  max-height: 100%;
  background: var(--dashboard-media-bg);
}

.camera-card__preview,
.camera-card__video {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.camera-card__video {
  background: #000;
}

.camera-card__video-el {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.camera-card__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  opacity: 0;
  transition: opacity 0.45s ease;
  z-index: 1;
}

.camera-card__image--visible {
  opacity: 1;
  z-index: 2;
}

.camera-card__image--incoming:not(.camera-card__image--visible) {
  opacity: 0;
  z-index: 1;
  pointer-events: none;
}

.camera-card__image--failed {
  display: none;
}

.camera-card__placeholder {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--dashboard-muted);
  pointer-events: none;
}

.camera-card__placeholder-icon {
  display: block;
  opacity: 0.55;
}

.camera-card__overlay {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  pointer-events: none;
}

.camera-card__overlay-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  pointer-events: auto;
}

.camera-card__icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 10px;
  background: rgba(11, 16, 32, 0.58);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
  backdrop-filter: blur(6px);
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.camera-card__icon-btn .icon--overlay {
  width: 18px;
  height: 18px;
}

.camera-card__icon-btn:hover {
  background: rgba(47, 125, 246, 0.42);
  border-color: rgba(120, 168, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(47, 125, 246, 0.25);
  transform: translateY(-1px);
}

.camera-card__icon-btn:focus-visible {
  outline: 2px solid var(--dashboard-accent);
  outline-offset: 2px;
}

.camera-card__icon-btn--active {
  background: rgba(47, 125, 246, 0.5);
  border-color: var(--dashboard-accent);
  color: #fff;
}

.camera-card__icon-btn--active:hover {
  background: rgba(47, 125, 246, 0.62);
}

.camera-card__icon-btn--saving {
  opacity: 0.55;
  cursor: wait;
  pointer-events: none;
}

.camera-card__title {
  color: #fff;
  font-size: clamp(14px, 1.1vw, 18px);
  font-weight: 600;
  margin: 0;
  min-width: 0;
  flex: 0 1 auto;
  width: fit-content;
  max-width: calc(100% - 88px);
  padding: 4px 0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
}

.camera-card__title:hover {
  opacity: 0.92;
}

.camera-card__title:focus-visible {
  outline: 2px solid var(--dashboard-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.camera-card__title--editing {
  cursor: text;
  padding: 0;
  opacity: 1;
  flex: 1;
  width: auto;
  max-width: calc(100% - 88px);
}

.camera-card__title--saving {
  opacity: 0.75;
}

.camera-card__rename-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  font: inherit;
  outline: none;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  pointer-events: auto;
  user-select: text;
  -webkit-user-select: text;
}

.camera-card__rename-input:focus {
  border-color: var(--dashboard-accent);
  box-shadow: 0 0 0 2px rgba(91, 140, 255, 0.28);
}

.camera-card__rename-input::selection {
  background: rgba(91, 140, 255, 0.35);
  color: #fff;
}

.camera-card__favorite .icon path {
  fill: none;
}

.camera-card__favorite .icon--overlay {
  width: 24px;
  height: 24px;
}

.camera-card__favorite--active .icon path,
.camera-card__icon-btn--active.camera-card__favorite .icon path {
  fill: #fff;
  stroke: #fff;
}

.camera-card__status {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
  color: #fff;
  font-size: clamp(13px, 1vw, 15px);
  pointer-events: none;
}

.camera-card__status:not(.camera-card__status--preview) {
  background: rgba(11, 16, 32, 0.72);
}

.camera-card__status[hidden] {
  display: none !important;
}

.camera-card__remove {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 3;
}

.camera-card__tech {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-width: min(58%, calc(100% - 96px));
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(11, 16, 32, 0.72);
  color: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  line-height: 1.25;
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  pointer-events: none;
  letter-spacing: 0.01em;
}

.camera-card__tech-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.camera-card__media:has(.camera-card__tech) .camera-card__remove {
  bottom: 56px;
}

.camera-card__actions {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
}

.camera-card--disabled .camera-card__image {
  filter: grayscale(1);
  opacity: 0.35;
}

.pagination-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.pagination-wrap[hidden],
.dashboard__meta[hidden] {
  display: none !important;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pagination__item {
  min-width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--dashboard-border);
  background: var(--dashboard-surface);
  color: var(--dashboard-text);
  cursor: pointer;
}

.pagination__item:hover:not(:disabled) {
  border-color: var(--dashboard-accent);
}

.pagination__item--active {
  background: var(--dashboard-accent);
  border-color: var(--dashboard-accent);
  color: #fff;
}

.pagination__item:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.camera-sort-edge {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 64px;
  z-index: 35;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.camera-sort-edge--left {
  left: 0;
  background: linear-gradient(
    to right,
    color-mix(in srgb, var(--dashboard-accent) 42%, transparent),
    transparent 85%
  );
}

.camera-sort-edge--right {
  right: 0;
  background: linear-gradient(
    to left,
    color-mix(in srgb, var(--dashboard-accent) 42%, transparent),
    transparent 85%
  );
}

.camera-sort-edge--active {
  opacity: 1;
}

.camera-sort-edge__label {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--dashboard-accent) 88%, #000);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

.pagination__ellipsis {
  min-width: 24px;
  text-align: center;
  color: var(--dashboard-muted);
}

.fab {
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--dashboard-accent);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(47, 125, 246, 0.35);
}

@media (max-width: 1280px), (max-height: 820px) {
  body.dashboard-page {
    height: auto;
    overflow: auto;
  }

  .dashboard {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .dashboard__main {
    overflow: visible;
  }

  .camera-stage {
    flex: none;
  }

  .camera-grid {
    flex: none;
    grid-template-rows: none;
    grid-auto-rows: auto;
    align-content: start;
  }

  .camera-card {
    height: auto;
    container-type: normal;
    display: block;
  }

  .camera-card__media {
    width: 100%;
    height: auto;
    max-height: none;
    aspect-ratio: 16 / 9;
  }

  .camera-card--add {
    display: flex;
    min-height: min(56vw, 280px);
  }

  .camera-card--add-picker {
    min-height: min(64vw, 320px);
  }

  .camera-card--add .camera-card__media {
    height: 100%;
    aspect-ratio: auto;
  }

  .camera-card__add-thumb {
    width: 64px;
    height: 38px;
  }
}

@media (max-width: 1100px) {
  .camera-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .dashboard__main {
    padding: 12px 16px;
  }

  .dashboard__header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .dashboard__header-main {
    flex: 1 1 100%;
    min-width: 0;
  }

  .users-list__head,
  .users-list__row {
    padding-left: 16px;
    padding-right: 16px;
  }

  .users-drawer__panel {
    width: 100vw;
  }
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--dashboard-border);
  }

  .dashboard--sidebar-collapsed .sidebar,
  html.sidebar-collapsed-boot .dashboard .sidebar {
    display: none;
  }
}

.archive-page__back {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--dashboard-muted);
  font-size: 14px;
  text-decoration: none;
}

.archive-page__back:hover {
  color: var(--dashboard-accent);
}

.archive-page__title {
  margin: 0;
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 600;
}

.archive-page {
  flex: 1;
  min-height: 0;
  padding: 8px 0 24px;
}

.archive-page__placeholder {
  margin: 0;
  color: var(--dashboard-muted);
  font-size: 15px;
}
