html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0.01em;
  transition: background var(--transition-default) ease, color var(--transition-default) ease;
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition-fast) ease; }
a:hover { color: var(--accent-hover); }

.ab-shell {
  display: flex;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg-subtle) 0%, var(--bg) 60%);
}

.ab-sidebar {
  width: 240px;
  background: var(--sidebar-bg);
  font-size: 13px;
  letter-spacing: 0.04em;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: 28px 20px 24px;
  border-right: 1px solid var(--sidebar-border);
  color: var(--sidebar-text);
  gap: 28px;
}

.ab-sidebar__brand {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sidebar-text-muted);
}

.ab-nav {
  display: flex;
  flex-direction: column;
}

.ab-sidebar nav ul,
.ab-sidebar ul.nav,
.ab-sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ab-sidebar nav li {
  margin: 0;
}

.ab-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ab-nav__item {
  margin: 0;
}

.ab-nav__link {
  display: inline-flex;
  align-items: center;
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  color: inherit;
  transition: background var(--transition-fast) ease, color var(--transition-fast) ease;
  position: relative;
}

.ab-nav__label {
  flex: 1 1 auto;
}

.nav-icon {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  flex: 0 0 auto;
  opacity: 0.95;
}

.ab-theme-toggle__icon .nav-icon,
.ab-icon-button__icon .nav-icon {
  margin-right: 0;
  width: 16px;
  height: 16px;
}

html[data-theme="dark"] .nav-icon { filter: brightness(0) invert(1); }
html[data-theme="light"] .nav-icon { filter: brightness(0); }

.ab-sidebar__footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ab-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--panel-bg);
  color: var(--text-soft);
  cursor: pointer;
  transition: border-color var(--transition-fast) ease, color var(--transition-fast) ease, background var(--transition-fast) ease;
}

.ab-theme-toggle:hover,
.ab-theme-toggle:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.ab-theme-toggle__icon {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--transition-fast) ease;
}

.ab-theme-toggle__icon::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.35;
  transition: opacity var(--transition-fast) ease;
}

.ab-theme-toggle__label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ab-help-link {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.ab-help-link:hover {
  color: var(--text);
}

.ab-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  box-sizing: border-box;
  padding-bottom: 96px;
}

.ab-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 16px 32px 0;
}

.ab-topbar__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ab-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--panel-bg);
}

.ab-search__icon {
  position: relative;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
}

.ab-search__icon::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right: 0;
  border-bottom: 0;
  transform: rotate(-45deg);
}

.ab-search input {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  outline: none;
  min-width: 160px;
}

.ab-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--panel-bg);
  color: var(--text-soft);
  cursor: pointer;
  transition: border-color var(--transition-fast) ease, color var(--transition-fast) ease, background var(--transition-fast) ease;
}

.ab-icon-button:hover,
.ab-icon-button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.ab-icon-button__icon {
  position: relative;
  width: 16px;
  height: 16px;
  display: inline-block;
}

.ab-icon-button__icon::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.35;
  transition: opacity var(--transition-fast) ease;
}

.js-theme-toggle[data-mode="light"] .ab-theme-toggle__icon::after,
.js-theme-toggle[data-mode="light"] .ab-icon-button__icon::after { opacity: 0.05; }

.js-theme-toggle[data-mode="dark"] .ab-theme-toggle__icon::after,
.js-theme-toggle[data-mode="dark"] .ab-icon-button__icon::after { opacity: 0.35; }

.user-drawer__section-caption {
  margin: 0;
  font-size: 13px;
  color: var(--text-soft);
}

.user-drawer__access-list,
.user-drawer__credential-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.user-drawer__empty {
  margin: 0;
  font-size: 13px;
  color: var(--text-soft);
}

.user-access-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(24,36,46,0.55), rgba(12,18,26,0.35));
  transition: border-color var(--transition-fast) ease, transform var(--transition-fast) ease;
  min-width: 0;
}

.user-access-item__header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.user-access-item__details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.user-access-item__title {
  font-weight: 500;
  color: var(--text);
}

.user-access-item__meta {
  font-size: 12px;
  color: var(--text-soft);
}

.user-access-item__controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.user-access-item__schedule-label {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.user-access-item__schedule-select {
  flex: 1 1 auto;
  min-width: 160px;
}

.user-drawer__credential-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  min-width: 0;
}

.user-drawer__credential-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
  min-width: 0;
}

.user-drawer__credential-actions {
  display: flex;
  justify-content: flex-end;
}

.user-credential {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(24,36,46,0.55), rgba(12,18,26,0.32));
  min-width: 0;
}

html[data-theme="light"] .user-access-item,
html[data-theme="light"] .user-credential {
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(236,244,243,0.78));
}

.user-credential__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-credential__title {
  font-weight: 500;
  color: var(--text);
}

.user-credential__value {
  font-size: 12px;
  color: var(--text-soft);
}

.user-credential__controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}

.user-credential__controls .ab-field__label {
  color: var(--text-muted);
}

.user-credential__delete {
  display: flex;
  justify-content: flex-end;
}

.ab-content {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1280px;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 32px 36px 40px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.ab-content--full {
  max-width: none;
  margin: 0;
}

.board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
}
.board--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
  margin-bottom: 32px;
}

.kpi-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--panel-shadow);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.kpi-label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.kpi-value {
  font-size: 34px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text);
}

.kpi-subtext {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.dashboard-columns {
  display: grid;
  grid-template-columns: 2.2fr 1.2fr;
  gap: var(--gap);
  align-items: start;
}

.dashboard-panel {
  min-height: 320px;
}

.panel-hint {
  font-size: 12px;
  color: var(--text-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-activity {
  padding: 0;
}

.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--panel-bg);
  box-shadow: var(--panel-shadow);
  cursor: default;
  transition: border var(--transition-fast) ease, transform var(--transition-fast) ease;
}

.activity-item:hover {
  border-color: var(--accent-muted);
  transform: translateY(-2px);
}

.activity-item.is-interactive {
  cursor: pointer;
}

.activity-item.is-static:hover {
  border-color: var(--border-subtle);
  transform: none;
}

.activity-time {
  font-size: 12px;
  color: var(--text-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.activity-message {
  font-size: 14px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.activity-message span {
  font-size: 12px;
  color: var(--text-soft);
}

.activity-status {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.activity-status.is-success { color: var(--accent); }

.alert-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.alert-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--panel-bg);
  box-shadow: var(--panel-shadow);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alert-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.alert-description {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.alert-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.alert-cta:hover {
  color: var(--accent-hover);
}

.panel {
  position: relative;
  padding: var(--pad);
  border-radius: var(--radius-lg);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow);
  overflow: hidden;
}
.panel::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: calc(var(--radius-lg) - 1px);
  border: 1px solid transparent;
  background: var(--panel-glow);
  pointer-events: none;
}
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: opacity 0.3s ease;
}

.badge.badge--inactive {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  border-color: var(--border-subtle);
}

.btn,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn:hover,
.btn-primary:hover {
  border-color: var(--accent-muted);
  color: var(--text);
  transform: translateY(-1px);
}
.btn-primary {
  background: linear-gradient(180deg, rgba(63,191,178,0.2), rgba(63,191,178,0.05));
  border-color: var(--accent-muted);
  color: var(--accent);
}
.btn-primary:hover {
  background: linear-gradient(180deg, rgba(63,191,178,0.28), rgba(63,191,178,0.08));
}

.btn-danger,
.btn[data-variant="danger"] {
  background: rgba(220, 53, 69, 0.16);
  border-color: rgba(220, 53, 69, 0.36);
  color: #ff9ea8;
}

.btn-danger:hover,
.btn[data-variant="danger"]:hover {
  background: rgba(220, 53, 69, 0.24);
  color: #ffb7be;
}

.ab-card {
  display: flex;
  flex-direction: column;
}

.ab-card__header,
.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.panel-header__left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.panel-header__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ab-card__title,
.panel-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--heading-strong);
}

.ab-card__subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.ab-card__actions,
.panel-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.panel > .panel-actions {
  margin: -4px 0 16px;
}
.panel-body { display: flex; flex-direction: column; gap: 18px; }
.panel-body > * { min-width: 0; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-inline { flex-direction: row; align-items: center; justify-content: space-between; }
.field-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--label-strong);
}
.field input,
.field textarea,
.panel-actions input[type="search"] {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 14px;
  transition: border-color var(--transition-fast) ease, box-shadow var(--transition-fast) ease, background var(--transition-fast) ease;
}

.panel-actions input[type="search"],
.ab-card__actions input[type="search"] {
  width: clamp(220px, 36vw, 360px);
}
.field textarea {
  resize: vertical;
}
.field input:focus,
.field textarea:focus,
.panel-actions input[type="search"]:focus {
  border-color: var(--accent-muted);
  box-shadow: 0 0 0 1px rgba(63,191,178,0.25);
  outline: none;
}

.doors-panel .panel-actions {
  flex-wrap: wrap;
  align-items: flex-end;
}

.doors-panel .panel-actions .field {
  flex: 1 1 220px;
  min-width: 200px;
}

.doors-panel .panel-actions .assignment-controls {
  justify-content: flex-start;
  flex: 1 1 220px;
  min-width: 200px;
}

.doors-panel .panel-actions .assignment-controls .btn {
  min-height: 38px;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.card-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.card-header-actions__label {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.card-header-actions .assignment-controls {
  flex: 1 1 auto;
  justify-content: flex-start;
  min-width: clamp(220px, 35vw, 340px);
  gap: 10px;
  max-width: 340px;
}

.card-header-actions .assignment-controls .btn {
  min-height: 38px;
}

.card-header-actions .ab-select-wrap {
  flex: 1 1 auto;
  min-width: clamp(220px, 35vw, 300px);
}

.card-tools-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.card-tools-hint {
  margin: 0;
  font-size: 13px;
  color: var(--text-soft);
  flex: 1 1 50%;
}

.card-tools-row .field {
  margin: 0;
}

.card-tools-search {
  flex: 0 0 auto;
  min-width: clamp(220px, 35vw, 340px);
  max-width: 340px;
  margin-left: auto;
}

.card-tools-search .ab-input {
  width: 100%;
}

@media (max-width: 900px) {
  .card-header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .card-header-actions .assignment-controls {
    width: 100%;
    max-width: none;
  }

  .card-header-actions .ab-select-wrap {
    min-width: 0;
  }

  .card-tools-row {
    align-items: stretch;
  }

  .card-tools-hint {
    flex-basis: 100%;
  }

  .card-tools-search {
    margin-left: 0;
    width: 100%;
    max-width: none;
  }
}

.ab-input,
select.ab-input,
textarea.ab-textarea {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 14px;
  transition: border-color var(--transition-fast) ease, box-shadow var(--transition-fast) ease, background var(--transition-fast) ease;
}

.ab-input:focus,
select.ab-input:focus,
textarea.ab-textarea:focus {
  border-color: var(--accent-muted);
  box-shadow: 0 0 0 1px rgba(63,191,178,0.25);
  outline: none;
}

.ab-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ab-field--inline {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.ab-field__label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--label-strong);
}

.ab-required {
  color: var(--accent);
  font-weight: 500;
}

.ab-field__error {
  min-height: 16px;
  font-size: 12px;
  color: var(--danger);
  letter-spacing: 0.02em;
}

.ab-field--error .ab-input,
.ab-field--error select.ab-input,
.ab-field--error textarea.ab-textarea {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px var(--danger-soft);
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.page-header__primary {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.page-actions__toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.page-actions__toggle-text {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--label-strong);
  cursor: pointer;
}

.page-actions__toggle .toggle-switch {
  position: relative;
  top: -1px;
}

.identity-panel__body {
  padding-bottom: 4px;
}

.identity-panel__body .identity-fields {
  display: grid;
  gap: 18px 20px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
}

.identity-field {
  min-width: 0;
}

.identity-field--name,
.identity-field--email {
  max-width: clamp(320px, 48vw, 520px);
}

.identity-field--phone {
  max-width: clamp(220px, 32vw, 280px);
}

.identity-field--date,
.identity-field--end-date {
  max-width: clamp(200px, 28vw, 240px);
}

.identity-field--notes,
.identity-field--schedule,
.identity-field--end {
  grid-column: 1 / -1;
  max-width: none;
}

.identity-field--end {
  display: grid;
  gap: 12px 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: center;
}

.identity-field--end .field-inline--space {
  justify-content: flex-start;
}

.identity-field--end-date {
  width: 100%;
}

.identity-field--end-date input[type="date"] {
  max-width: clamp(200px, 28vw, 240px);
}

.identity-field--notes textarea {
  min-height: 116px;
}

.identity-field--schedule .ab-select-wrap {
  max-width: clamp(320px, 48vw, 520px);
}

.identity-field--schedule .field-note {
  margin-top: 6px;
}

@media (max-width: 720px) {
  .identity-panel__body .identity-fields {
    grid-template-columns: 1fr;
  }

  .identity-field--name,
  .identity-field--email,
  .identity-field--phone,
  .identity-field--date,
  .identity-field--end-date {
    max-width: none;
  }

  .identity-field--end {
    grid-template-columns: 1fr;
  }

  .identity-field--schedule .ab-select-wrap {
    max-width: none;
  }
}

.ab-select-wrap {
  position: relative;
  display: inline-flex;
  width: 100%;
}

[data-ab-dropdown-wrap="true"] {
  position: relative;
}

.ab-select-wrap .ab-dd,
[data-ab-dropdown-wrap="true"] .ab-dd {
  width: 100%;
}

.ab-dd {
  position: relative;
  width: 100%;
}

.ab-dd__native {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.ab-dd__button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 36px 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color var(--transition-fast) ease, box-shadow var(--transition-fast) ease, background var(--transition-fast) ease;
}

.ab-dd__button::after {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid var(--text-soft);
  border-bottom: 2px solid var(--text-soft);
  transform: rotate(-45deg);
  flex: 0 0 auto;
}

.ab-dd__button:focus-visible {
  outline: none;
  border-color: var(--accent-muted);
  box-shadow: 0 0 0 1px rgba(63,191,178,0.25);
}

.ab-dd--open .ab-dd__button {
  border-color: var(--accent-muted);
  box-shadow: 0 0 0 1px rgba(63,191,178,0.25);
}

.ab-dd--disabled .ab-dd__button {
  background: var(--input-bg);
  color: var(--text-soft);
  cursor: not-allowed;
  border-color: var(--border-subtle);
}

.ab-dd__button-text {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ab-dd__menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--panel-bg);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24);
  max-height: 280px;
  overflow-y: auto;
  padding: 6px 0;
  display: flex;
  flex-direction: column;
}

.ab-dd__menu[hidden] {
  display: none !important;
}

.ab-dd__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 9px 14px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  cursor: pointer;
  transition: background var(--transition-fast) ease, color var(--transition-fast) ease;
}

.ab-dd__item--selected {
  color: var(--accent);
}

.ab-dd__item--active {
  background: rgba(63, 191, 178, 0.12);
}

.ab-dd__item--disabled {
  color: var(--text-soft);
  cursor: not-allowed;
}

.ab-dd__item-meta {
  font-size: 12px;
  color: var(--text-soft);
}

.ab-dd__empty {
  padding: 10px 14px;
  color: var(--text-soft);
  font-size: 13px;
}

.ab-dd__menu::-webkit-scrollbar {
  width: 6px;
}

.ab-dd__menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 200px;
  min-width: 180px;
}

.filter-field input,
.filter-field [data-ab-dropdown-wrap="true"] {
  width: 100%;
}

.filter-quick {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-soft);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color var(--transition-fast) ease, color var(--transition-fast) ease, background var(--transition-fast) ease;
}

.filter-chip:hover,
.filter-chip.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); }
.toggle-switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track { display: inline-flex; align-items: center; width: 40px; height: 22px; border-radius: 999px; background: rgba(230, 242, 241, 0.22); padding: 2px; transition: background 0.2s ease, box-shadow 0.2s ease; }
.toggle-thumb { width: 18px; height: 18px; border-radius: 50%; background: rgba(230, 242, 241, 0.9); box-shadow: 0 1px 2px rgba(4, 7, 12, 0.4); transform: translateX(0); transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease; }
.toggle-switch input:checked + .toggle-track { background: var(--accent); box-shadow: 0 0 0 1px var(--accent-muted); }
.toggle-switch input:checked + .toggle-track .toggle-thumb {
  transform: translateX(18px);
  background: var(--content-bg);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.toggle-switch input:focus-visible + .toggle-track { box-shadow: 0 0 0 2px rgba(63,191,178,0.28); }
.field-inline--space { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.inline-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
}
.inline-form .form-actions { display: flex; gap: 10px; }

.credential-list { display: flex; flex-direction: column; gap: 12px; }
.credential-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--chip-bg);
  box-shadow: var(--chip-shadow);
  border: 1px solid var(--chip-border);
}
.credential-meta { display: flex; flex-direction: column; gap: 6px; }
.credential-type { font-weight: 600; font-size: 13px; color: var(--text); letter-spacing: 0.04em; text-transform: uppercase; }
.credential-label-input {
  min-width: 200px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--panel-bg);
  color: var(--text);
  font-size: 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.credential-label-input::placeholder { color: var(--text-muted); }
.credential-label-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.credential-actions { display: flex; gap: 8px; }
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.schedule-weekly { display: flex; flex-direction: column; gap: 12px; }
.schedule-weekly__header { align-items: center; }
.schedule-weekly__inactive {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed var(--border-subtle);
  background: var(--panel-bg);
  box-shadow: var(--panel-shadow);
  color: var(--text-muted);
  font-size: 13px;
}
.schedule-weekly__inactive p {
  margin: 0;
}
.schedule-weekly__body { display: flex; flex-direction: column; gap: 12px; }
.schedule-weekly__blocks { display: flex; flex-direction: column; gap: 12px; }
.schedule-weekly__empty { margin: 0; font-size: 13px; color: var(--text-soft); }
.schedule-weekly__block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--panel-bg);
  box-shadow: var(--panel-shadow);
}
.schedule-weekly__block-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 500; color: var(--text); }
.schedule-weekly__remove {
  border: none;
  background: none;
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.02em;
  cursor: pointer;
  padding: 0;
}
.schedule-weekly__remove:hover { text-decoration: underline; }
.schedule-weekly__days { display: flex; flex-wrap: wrap; gap: 8px; }
.schedule-weekly__day {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color var(--transition-fast) ease, background var(--transition-fast) ease, color var(--transition-fast) ease;
}
.schedule-weekly__day.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.schedule-weekly__day:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.schedule-weekly__times { display: flex; flex-wrap: wrap; gap: 12px; }
.schedule-weekly__time { display: flex; flex-direction: column; gap: 6px; flex: 1 1 140px; min-width: 140px; }
.schedule-weekly__time label { font-size: 12px; color: var(--text-soft); letter-spacing: 0.08em; text-transform: uppercase; }
.schedule-weekly__time input {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 14px;
}
.schedule-weekly__time input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(63,191,178,0.25);
  outline: none;
}
.status-pill.disabled { background: rgba(255, 193, 7, 0.18); color: #ffdda0; }
.status-pill.revoked { background: rgba(220, 53, 69, 0.18); color: #f39ba5; }
.status-pill.status-online { background: var(--accent-soft); color: var(--accent); }
.status-pill.status-offline { background: rgba(255, 255, 255, 0.08); color: var(--text-soft); }
.status-pill.status-unknown { background: rgba(255, 255, 255, 0.04); color: var(--text-muted); }
.status-pill.status-inactive { background: rgba(255, 255, 255, 0.04); color: var(--text-soft); border: 1px dashed var(--border-subtle); }
.status-pill.status-success { background: rgba(63,191,178,0.14); color: var(--accent); }
.status-pill.status-failed { background: rgba(220, 53, 69, 0.18); color: #f39ba5; }

.event-row.is-failed td .table-cell__title { color: var(--text); }
.event-row.is-failed td .table-cell__subtitle { color: var(--accent); }
.event-row.is-failed td:last-child { color: var(--accent); }

.empty-state { margin: 0; color: var(--text-soft); }

.table-wrap {
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--panel-border);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel-bg);
  color: var(--text);
}
.data-table thead th {
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-soft);
}
.data-table tbody td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr {
  cursor: pointer;
  transition: background 0.18s ease;
}
.data-table tbody tr:hover {
  background: rgba(63,191,178,0.08);
}
.table-row:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(63,191,178,0.35);
}
.table-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}
.table-link:hover,
.table-link:focus {
  color: var(--accent-hover);
  text-decoration: underline;
}
.table-link:focus-visible {
  outline: none;
  box-shadow: 0 2px 0 0 var(--accent);
}
.table-cell__stack { display: flex; flex-direction: column; gap: 4px; }
.table-cell__title { font-weight: 500; }
.table-cell__subtitle { color: var(--text-soft); font-size: 13px; }
.data-table .status-pill { justify-content: center; }
.table-footer {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}
.table-footer.hidden { display: none; }

.door-row { cursor: pointer; transition: background 0.18s ease, opacity 0.18s ease; }
.door-row.is-expanded { background: rgba(63,191,178,0.08); }
.door-row.is-inactive { opacity: 0.65; }
.door-row.is-inactive .table-cell__title { color: var(--text-muted); }
.door-row.is-inactive .table-cell__subtitle { color: var(--text-soft); }

.door-accordion-row { display: none; background: var(--panel-bg); }
.door-accordion-row.is-expanded { display: table-row; }
.door-accordion__container { padding: 0 18px 18px; }
.door-accordion__container.is-active { padding-top: 0; }
.door-accordion {
  display: flex;
  gap: 24px;
  padding: 20px 24px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--content-bg);
  box-shadow: var(--panel-shadow);
}
.door-accordion.is-inactive { opacity: 0.8; }
.door-accordion__info {
  flex: 2 1 60%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.door-accordion__controls {
  flex: 1 1 40%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.door-accordion__info-row { display: flex; align-items: center; gap: 12px; }
.door-accordion__info-label {
  min-width: 130px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.door-accordion__info-value {
  font-size: 14px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.door-accordion__access { display: flex; flex-direction: column; gap: 8px; }
.door-accordion__access-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.door-accordion__access-list { display: flex; flex-wrap: wrap; gap: 8px; }
.door-accordion__access-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  color: var(--text);
}
.door-accordion__access-chip.is-muted { opacity: 0.6; }
.door-accordion__access-empty { font-size: 13px; color: var(--text-soft); }

.door-accordion__access-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.door-accordion__access-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}

.door-accordion__access-row.is-derived {
  border-style: dashed;
}

.door-accordion__access-row.is-muted {
  opacity: 0.65;
}

.door-accordion__access-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.door-accordion__access-name {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.door-accordion__access-note {
  font-size: 12px;
  color: var(--text-soft);
}

.door-accordion__access-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.door-accordion__access-badge {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  color: var(--text-soft);
}

.door-accordion__access-badge.is-direct {
  border-color: var(--accent-muted);
  background: var(--accent-soft);
  color: var(--accent);
}

.door-accordion__access-badge.is-derived {
  border-style: dashed;
}

.door-accordion__access-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--panel-bg);
  color: var(--text-soft);
  font-size: 12px;
  cursor: pointer;
  transition: border-color var(--transition-fast) ease, color var(--transition-fast) ease;
}

.door-accordion__access-action:hover,
.door-accordion__access-action:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.door-accordion__access-action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.door-accordion__control {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}
.door-accordion__control-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.door-accordion__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border 0.18s ease;
}
.door-accordion__action:hover:not(:disabled) { background: var(--accent); color: var(--content-bg); }
.door-accordion__action:disabled { opacity: 0.6; cursor: wait; }
.door-accordion__select { min-width: 180px; }
.door-accordion__select.is-loading { cursor: wait; opacity: 0.7; }
.door-accordion__loading,
.door-accordion__error {
  padding: 18px 0;
  font-size: 14px;
  color: var(--text-soft);
}
.door-accordion__error { color: #f39ba5; }

@media (max-width: 960px) {
  .door-accordion {
    flex-direction: column;
  }
  .door-accordion__info,
  .door-accordion__controls {
    width: 100%;
  }
}

.board-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.board-bucket { display: flex; flex-direction: column; gap: 10px; position: relative; }
.board-bucket[data-zone="allowed"] .bucket-body {
  background: var(--bucket-allowed-bg);
  border: 1px solid var(--bucket-allowed-border);
  box-shadow: var(--bucket-allowed-shadow);
}
.board-bucket[data-zone="allowed"]::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -2px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), rgba(63,191,178,0.4));
}
.board-bucket[data-zone="allowed"] .bucket-header { color: var(--accent); }
.board-bucket[data-zone="not_allowed"] .bucket-body {
  background: var(--bucket-not-bg);
  border: 1px dashed var(--bucket-not-border);
}

.bucket-header {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.bucket-body {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.bucket-body.pulse {
  animation: bucketPulse 0.8s ease;
}

.al-chip {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  box-shadow: var(--chip-shadow);
  cursor: grab;
  user-select: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.field-note {
  font-size: 12px;
  color: var(--text-muted);
}

.field-note.is-error {
  color: var(--danger);
}

.field.is-error input,
.field.is-error textarea,
.field.is-error select {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px var(--danger-soft);
}

.field textarea.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px var(--danger-soft);
}

.advanced-section {
  border-top: 1px solid var(--border-subtle);
  margin-top: 12px;
  padding-top: 12px;
}
.advanced-section summary {
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;

  color: var(--text-soft);
  margin-bottom: 10px;
}
.advanced-section[open] summary {
  color: var(--accent);
}
.al-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(4, 8, 14, 0.35);
}
.al-chip.dragging {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 18px 32px rgba(5, 10, 16, 0.45);
  border-color: var(--accent-muted);
}
.board-bucket[data-zone="allowed"] .al-chip {
  border-color: var(--accent-muted);
  box-shadow: inset 0 1px rgba(63,191,178,0.2);
  background: var(--chip-bg);
}

.board-bucket[data-zone="allowed"] .bucket-body { color: var(--text); }

.board-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-subtle);
}
.board-stats .stat-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.board-stats .stat-value {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text);
}

.doors-board {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.door-buckets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}
.door-bucket {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
}
.door-bucket .bucket-header {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.door-groups {
  min-height: 280px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--bucket-not-border);
  background: var(--bucket-not-bg);
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1 1 auto;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.door-groups.is-dragover {
  border-color: var(--accent-muted);
  background: rgba(63,191,178,0.1);
}
.door-bucket[data-zone="included"] .door-groups {
  border: 1px solid var(--bucket-allowed-border);
  background: var(--bucket-allowed-bg);
  box-shadow: var(--bucket-allowed-shadow);
}
.door-bucket[data-zone="included"] .bucket-header {
  color: var(--accent);
}
.door-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.door-group__header {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.door-group__body {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.door-group__empty {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
  padding: 6px 0;
}
.door-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  box-shadow: var(--chip-shadow);
  cursor: grab;
  user-select: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  min-width: 220px;
}
.door-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(4, 8, 14, 0.35);
}
.door-chip.dragging {
  transform: translateY(-3px) scale(1.02);
  border-color: var(--accent-muted);
  box-shadow: 0 20px 32px rgba(5, 10, 16, 0.45);
}
.door-chip__main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.door-chip__name { font-weight: 500; }
.door-chip__group { font-size: 12px; color: var(--text-soft); }

.door-chip__meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.door-chip__count {
  font-size: 12px;
  color: var(--text-soft);
}

.door-chip__badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--accent-muted);
  background: var(--accent-soft);
  color: var(--accent);
}

.door-chip__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--panel-bg);
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: border-color var(--transition-fast) ease, color var(--transition-fast) ease, background var(--transition-fast) ease;
}

.door-chip__action:hover,
.door-chip__action:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.door-chip.is-disabled {
  opacity: 0.55;
  cursor: progress;
}

.door-chip.is-disabled .door-chip__action {
  pointer-events: none;
}

.door-chip--derived {
  border-style: dashed;
  cursor: default;
}

.door-chip--derived .door-chip__action {
  opacity: 0.6;
  cursor: not-allowed;
}

.door-chip--derived:hover {
  transform: none;
  box-shadow: var(--chip-shadow);
}
.door-status {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.door-status--online {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-muted);
}
.door-status--offline {
  background: rgba(220, 53, 69, 0.18);
  color: #f39ba5;
  border-color: rgba(220, 53, 69, 0.28);
}
.door-status--unknown {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-soft);
  border-color: var(--border-subtle);
}

.assignment-row {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text);
}
.assignment-row .al-chip {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text);
  font-weight: 500;
}
.assignment-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  min-width: 170px;
  flex-wrap: nowrap;
}
.assignment-controls .schedule-pill { flex: 0 0 auto; }
.assignment-controls .schedule-dropdown[data-ab-dropdown-wrap="true"] {
  flex: 0 0 auto;
  min-width: 160px;
  width: auto;
}

.schedule-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.schedule-pill::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--accent-muted);
  background: rgba(63,191,178,0.22);
}

.hover-preview {
  position: fixed;
  pointer-events: none;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 14px 16px;
  max-width: 260px;
  color: var(--text);
  font-size: 13px;
  box-shadow: var(--panel-shadow);
  z-index: 1000;
}
.hover-title { font-weight: 500; margin-bottom: 6px; letter-spacing: 0.04em; }
.hover-content { display: flex; flex-direction: column; gap: 4px; color: var(--text-muted); }
.hover-line { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.hover-line span:last-child { color: var(--text); font-weight: 500; }
.hover-content .group { font-weight: 500; margin-top: 8px; color: var(--accent); }

.toast {
  position: fixed;
  bottom: 18px;
  right: 18px;
  background: var(--toast-bg);
  border: 1px solid var(--toast-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--panel-shadow);
  color: var(--text);
}

@keyframes bucketPulse {
  0% { box-shadow: 0 0 0 0 rgba(63,191,178,0.18); }
  100% { box-shadow: 0 0 0 20px rgba(63,191,178,0); }
}

html[data-theme="light"] .ab-nav__link:hover { background: rgba(16, 35, 51, 0.08); }
html[data-theme="light"] .ab-nav__link.is-active { color: var(--accent); }
html[data-theme="light"] .ab-theme-toggle { background: rgba(16, 35, 51, 0.04); }
html[data-theme="light"] .inline-form { background: rgba(16, 35, 51, 0.05); }
html[data-theme="light"] .toggle-track { background: rgba(16, 35, 51, 0.2); }
html[data-theme="light"] .toggle-thumb { background: #ffffff; box-shadow: 0 1px 2px rgba(16, 35, 51, 0.2); }
html[data-theme="light"] .toggle-switch input:checked + .toggle-track .toggle-thumb { box-shadow: 0 0 0 1px rgba(16, 35, 51, 0.08); }
html[data-theme="light"] .hover-preview { background: #ffffff; }
html[data-theme="light"] .toast { background: #ffffff; }

@media (max-width: 1080px) {
  .ab-shell { flex-direction: column; }
  .ab-sidebar { width: 100%; flex-direction: row; align-items: center; gap: 18px; }
  .ab-nav__list { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .ab-main { width: 100%; }
  .board { grid-template-columns: 1fr; }
  .board--two { grid-template-columns: 1fr; }
  .board-columns { grid-template-columns: 1fr; }
  .door-buckets { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; gap: 12px; }
  .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-columns { grid-template-columns: 1fr; }
}

.hidden { display: none; }

body.ab-drawer-open { overflow: hidden; }

.ab-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 14, 0.58);
  backdrop-filter: blur(2px);
  z-index: 90;
}


.ab-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: clamp(560px, 70vw, 980px);
  max-width: 92vw;
  background: var(--drawer-bg);
  border-left: 1px solid var(--drawer-border);
  box-shadow: var(--panel-shadow);
  display: flex;
  flex-direction: column;
  padding: 28px 28px 32px;
  gap: 18px;
  z-index: 100;
  transform: translateX(28px);
  opacity: 0;
  pointer-events: none;
  transition: transform var(--transition-default) ease, opacity var(--transition-default) ease;
}

.ab-drawer.is-open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.ab-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ab-drawer__header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ab-drawer__header-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.ab-drawer__header-actions.hidden {
  display: none;
}

.ab-drawer__active {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.ab-drawer__active input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ab-drawer__active .toggle-switch {
  transform: scale(0.86);
}

.ab-drawer__active input ~ .toggle-switch .toggle-track {
  background: var(--danger);
  box-shadow: 0 0 0 1px var(--danger-soft);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.ab-drawer__active input ~ .toggle-switch .toggle-thumb {
  transform: translateX(0);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.ab-drawer__active input:checked ~ .toggle-switch .toggle-track {
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-muted);
}

.ab-drawer__active input:checked ~ .toggle-switch .toggle-thumb {
  transform: translateX(18px);
  background: var(--content-bg);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

html[data-theme="light"] .ab-drawer__active input:checked ~ .toggle-switch .toggle-thumb {
  box-shadow: 0 0 0 1px rgba(16, 35, 51, 0.08);
}

.ab-drawer__active input:focus-visible ~ .toggle-switch .toggle-track {
  box-shadow: 0 0 0 2px rgba(63, 191, 178, 0.28);
}

.ab-drawer__icon-button,
.ab-drawer__danger-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition-fast) ease, color var(--transition-fast) ease, border var(--transition-fast) ease;
}

.ab-drawer__icon-button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.ab-drawer__danger-button {
  border-color: var(--danger-soft, rgba(219,68,55,0.2));
  color: var(--danger, #ff5a5f);
}

.ab-drawer__danger-button:hover {
  background: rgba(219,68,55,0.12);
}

.ab-drawer__icon-button.hidden,
.ab-drawer__danger-button.hidden,
.ab-drawer__active.hidden {
  display: none;
}

.ab-drawer__icon-label {
  font-weight: 600;
}

.ab-drawer__header-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ab-drawer__entity {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  color: var(--text-soft);
}

.ab-drawer__title {
  font-size: 20px;
  margin: 0;
  letter-spacing: 0.02em;
}


.ab-drawer__tabs {
  display: inline-flex;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.ab-drawer__tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition-fast) ease, color var(--transition-fast) ease;
}

.ab-drawer__tab:hover { color: var(--accent); }

.ab-drawer__tab.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.ab-drawer__tab.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.ab-drawer__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-right: 6px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ab-drawer__body.hidden { display: none; }

.ab-drawer__loading {
  font-size: 13px;
  color: var(--text-soft);
}

.ab-drawer__content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 80px;
}

.user-drawer {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-right: 4px;
}

.user-drawer__form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.user-drawer__fieldset {
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(63,191,178,0.08), rgba(63,191,178,0.03));
}

html[data-theme="light"] .user-drawer__fieldset {
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(236,244,243,0.72));
}

.user-drawer__section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.user-drawer__section-actions {
  display: inline-flex;
  gap: 8px;
}

.user-drawer__section-actions .btn {
  padding: 4px 10px;
  font-size: 13px;
}

.user-drawer__legend {
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.user-drawer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.user-drawer__dates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  align-items: end;
}

.user-drawer__dates-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.user-drawer__dates-column--end {
  align-items: flex-start;
}

.user-drawer__autosave {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-soft);
  min-height: 18px;
}

.user-drawer__autosave[data-state="saving"] { color: var(--accent); }
.user-drawer__autosave[data-state="error"] { color: var(--danger, #ff5a5f); }
.user-drawer__autosave[data-state="pending"] { color: var(--text-muted); }

.user-drawer__section {
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(6,12,20,0.45), rgba(6,12,20,0.25));
}

html[data-theme="light"] .user-drawer__section {
  background: linear-gradient(180deg, rgba(255,255,255,0.82), rgba(236,244,243,0.72));
}

.user-drawer__section-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.user-drawer__section-header h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ab-drawer__meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 0;
}

.ab-drawer__meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

.ab-drawer__meta-row:last-child { border-bottom: none; padding-bottom: 0; }

.ab-drawer__meta-row dt {
  margin: 0;
  font-size: 13px;
  color: var(--text-soft);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ab-drawer__meta-row dd {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  text-align: right;
}

.ab-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 14, 0.68);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 200;
  opacity: 1;
  transition: opacity var(--transition-default) ease;
}

.ab-modal-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
}

.ab-modal {
  background: var(--panel-bg);
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--panel-shadow);
  padding: 24px;
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ab-modal__title {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.02em;
}

.ab-modal__body {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.5;
}

.ab-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.ab-modal__actions .btn {
  min-width: 96px;
}

.ab-drawer__section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ab-drawer__section-title {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.ab-drawer__summary {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.ab-drawer__summary-block {
  font-size: 13px;
  color: var(--text-soft);
  padding: 6px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: rgba(63, 191, 178, 0.06);
  margin-bottom: 6px;
}

.ab-drawer__summary-block:last-child {
  margin-bottom: 0;
}

.ab-drawer__empty,
.ab-drawer__error {
  font-size: 14px;
  color: var(--text-soft);
}

.ab-drawer__error {
  border-left: 3px solid var(--border-strong);
  padding-left: 10px;
}

/* Schlage debug console */
.ab-debug-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.ab-debug-panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ab-debug-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ab-debug-panel__header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--heading-strong);
}

.ab-debug-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ab-debug-actions .btn {
  width: 100%;
  justify-content: center;
}

.ab-debug-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.ab-debug-logs {
  max-height: 640px;
}

.ab-debug-log-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-right: 6px;
}

.ab-debug-log {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--panel-2, rgba(255, 255, 255, 0.02));
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ab-debug-log.is-failed {
  border-color: rgba(220, 53, 69, 0.35);
}

.ab-debug-log__title {
  font-size: 13px;
  font-weight: 600;
}

.ab-debug-log__meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  align-items: center;
  flex-wrap: wrap;
}

.ab-debug-log__pill {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent);
}

.ab-debug-log.is-failed .ab-debug-log__pill {
  background: rgba(220, 53, 69, 0.18);
  color: #ff9ea8;
}

.ab-debug-log__error {
  font-size: 12px;
  color: var(--text-soft);
}

@media (max-width: 1200px) {
  .ab-debug-grid {
    grid-template-columns: 1fr;
  }
  .ab-debug-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .ab-debug-actions .btn {
    width: auto;
  }
  .ab-debug-logs {
    max-height: none;
  }
}

.ab-drawer__activity {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ab-drawer__activity-item {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: var(--panel-bg);
  box-shadow: var(--panel-shadow);
}

.ab-drawer__activity-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.ab-drawer__activity-time {
  font-size: 13px;
  color: var(--text-muted);
}

.ab-drawer__activity-message {
  font-size: 14px;
  font-weight: 500;
  flex: 1 1 auto;
}

.ab-drawer__activity-status {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}

.ab-drawer__activity-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
}

.ab-drawer__activity-status.is-success { color: var(--accent); }

.ab-drawer__activity-status.is-success::before { background: var(--accent); }

.ab-drawer__activity-status.is-failure::before { background: var(--border-strong); }

.ab-drawer__activity-meta {
  font-size: 13px;
  color: var(--text-soft);
}