/* Admin space management UI styles */

.edit-space-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 100vw;
  background: var(--bs-body-bg, #fff);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.18);
  transform: translateX(100%);
  transition: transform 0.25s ease-out;
  z-index: 1100; /* above Sneat .layout-navbar (1080) */
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.edit-space-panel.open {
  transform: translateX(0);
}

.edit-space-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1095; /* between navbar and panel */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.edit-space-panel-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.edit-space-panel-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Icon picker grid */
.icon-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.icon-grid .icon-cell {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  padding: 0;
  border: 1px solid transparent;
}

.icon-grid .icon-cell.active {
  border-color: var(--bs-primary);
  background-color: var(--bs-primary-bg-subtle, #eff6ff);
}

/* Plan pills */
.plan-pill {
  user-select: none;
  font-size: 0.85rem;
}

/* Drag handle hover */
.drag-handle:hover {
  color: var(--bs-primary);
}

/* Type-option cards */
.type-option {
  border: 2px solid #e5e7eb;
  transition: border-color 0.15s;
}
.type-option:has(.type-radio:checked):not(:has(.type-radio:disabled)) {
  border-color: var(--bs-primary);
  background-color: var(--bs-primary-bg-subtle, #eff6ff);
}

/* Sticky bottom on edit panel form */
.edit-space-panel-inner .sticky-bottom {
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin: 0 -1rem -1rem -1rem;
  padding: 0.75rem 1rem;
}

/* Admin action buttons in sidebar — visible by default with subtle color */
.admin-action-btn {
  color: var(--bs-secondary-color, #6c757d);
  border: 0;
  background: transparent;
  line-height: 1;
}
.admin-action-btn:hover,
.admin-action-btn:focus {
  color: var(--bs-primary);
}

/* Logo edit pencil — sits next to the brand */
.app-brand .admin-action-btn {
  opacity: 0;
  transition: opacity 0.15s;
}
.app-brand:hover .admin-action-btn,
.app-brand .admin-action-btn:focus {
  opacity: 1;
}

/* ─────────────────────────────────────────────────────────────
   Sidebar space rows — single horizontal row layout
   [drag-handle] [icon] [name·······] [badges] [ellipsis]
   ───────────────────────────────────────────────────────────── */

.space-group-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.space-row {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  margin: 0 0.5rem;
  border-radius: 6px;
  min-height: 36px;
  list-style: none;
  position: relative;
}
.space-row:hover {
  background: var(--bs-secondary-bg, #f3f4f6);
}

/* Drag handle — invisible by default, fades in on row hover */
.space-row .drag-handle {
  flex: 0 0 auto;
  cursor: grab;
  opacity: 0;
  transition: opacity 0.15s;
  color: var(--bs-secondary-color, #6c757d);
  font-size: 14px;
  line-height: 1;
  width: 14px;
  text-align: center;
  user-select: none;
}
.space-row:hover .drag-handle { opacity: 0.6; }
.space-row .drag-handle:hover { opacity: 1; }
.space-row .drag-handle:active { cursor: grabbing; }

/* Icon */
.space-row .space-icon {
  flex: 0 0 auto;
  width: 20px;
  text-align: center;
  font-size: 1rem;
  line-height: 1;
}
.space-row .space-icon i { font-size: 1rem; }

/* Name takes remaining space, truncates */
.space-row .space-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  text-decoration: none;
  font-size: 0.9rem;
}
.space-row .space-name:hover { color: var(--bs-primary); }
.space-row .space-name.active { color: var(--bs-primary); font-weight: 600; }

/* Pinned/locked/archived badges sit inline before the ellipsis */
.space-row .space-badge {
  flex: 0 0 auto;
  font-size: 0.75rem;
}

/* Ellipsis menu button — invisible by default, fades in on row hover */
.space-row .space-menu-btn {
  flex: 0 0 auto;
  opacity: 0;
  transition: opacity 0.15s;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  color: var(--bs-secondary-color, #6c757d);
  line-height: 1;
}
.space-row:hover .space-menu-btn,
.space-row .space-menu-btn:focus {
  opacity: 1;
}
.space-row .space-menu-btn:hover {
  background: var(--bs-tertiary-bg, #e9ecef);
  color: var(--bs-primary);
}

/* Spaces section header (parent of "Spaces" label and + button) */
.space-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem 0.25rem;
  list-style: none;
}
.space-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bs-secondary-color, #6c757d);
}
.space-section-add {
  border: none;
  background: transparent;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--bs-secondary-color, #6c757d);
  line-height: 1;
}
.space-section-add:hover {
  background: var(--bs-tertiary-bg, #e9ecef);
  color: var(--bs-primary);
}

/* Group header — handle / label / ellipsis */
.space-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  margin: 8px 0.5rem 2px;
  list-style: none;
  position: relative;
  border-radius: 6px;
}
.space-group-header:hover {
  background: var(--bs-secondary-bg, #f3f4f6);
}
.space-group-header .group-drag-handle {
  flex: 0 0 auto;
  cursor: grab;
  opacity: 0;
  transition: opacity 0.15s;
  color: var(--bs-secondary-color, #6c757d);
  width: 14px;
  text-align: center;
}
.space-group-header:hover .group-drag-handle {
  opacity: 0.6;
}
.space-group-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bs-secondary-color, #6c757d);
}
.space-group-header .space-menu-btn {
  flex: 0 0 auto;
  opacity: 0;
  transition: opacity 0.15s;
  border: none;
  background: transparent;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--bs-secondary-color, #6c757d);
}
.space-group-header:hover .space-menu-btn {
  opacity: 1;
}

/* Toast container — set inline already but keep here */
#cs-toast-container .alert {
  border-left: 3px solid currentColor;
}
