/* ============================================
   CITACLICK — UI COMPONENTS
   Distinctive design system — never generic
   ============================================ */


/* ============================================
   SIDEBAR
   Editorial navigation with depth and presence
   ============================================ */

.app-sidebar {
  background:
    linear-gradient(180deg, var(--color-surface-raised) 0%, var(--color-surface) 100%);
  border-right: none;
  box-shadow: 1px 0 0 var(--color-border-light),
              4px 0 24px -4px rgba(0, 0, 0, 0.06);
}

[data-mode="dark"] .app-sidebar {
  box-shadow: 1px 0 0 var(--color-border-light),
              4px 0 32px -4px rgba(0, 0, 0, 0.3);
}

.sidebar-logo {
  padding: var(--space-6) var(--space-5) var(--space-5);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  letter-spacing: -0.03em;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
}

.sidebar-logo-accent {
  color: var(--color-highlight);
  font-weight: var(--weight-bold);
}

.sidebar-logo::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: var(--space-5);
  right: var(--space-5);
  height: 1px;
  background: linear-gradient(
    90deg,
    var(--color-highlight) 0%,
    var(--color-highlight) 30%,
    var(--color-border-light) 30%,
    var(--color-border-light) 100%
  );
  opacity: 0.7;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-4) var(--space-3) var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
}

.sidebar-section {
  padding-top: var(--space-4);
  margin-top: var(--space-3);
  position: relative;
}

.sidebar-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: var(--space-3);
  right: var(--space-3);
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-border-light) 20%,
    var(--color-border-light) 80%,
    transparent
  );
}

.sidebar-section-label {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: var(--weight-bold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0 var(--space-3) var(--space-2);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  transition: color var(--transition-fast),
              background-color var(--transition-fast),
              padding-left var(--transition-fast);
}

.sidebar-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--color-text-muted);
  transition: color var(--transition-fast),
              transform var(--transition-fast);
}

.sidebar-link:hover {
  background-color: var(--color-surface-sunken);
  color: var(--color-text);
  padding-left: calc(var(--space-3) + 4px);
}

.sidebar-link:hover svg {
  color: var(--color-highlight);
  transform: scale(1.08);
}

.sidebar-link.active {
  background-color: color-mix(in srgb, var(--color-highlight) 14%, transparent);
  color: var(--color-highlight);
  font-weight: var(--weight-semibold);
  box-shadow: inset 3px 0 0 var(--color-highlight);
}

.sidebar-link.active svg {
  color: var(--color-highlight);
}

.sidebar-link.active:hover {
  background-color: color-mix(in srgb, var(--color-highlight) 20%, transparent);
  padding-left: var(--space-3);
}

.sidebar-link.active:hover svg {
  color: var(--color-highlight);
  transform: none;
}

.sidebar-link:active:not(.active) {
  transform: scale(0.98);
}

.sidebar-user {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  position: relative;
  transition: background-color var(--transition-fast);
  cursor: pointer;
}

.sidebar-user::before {
  content: '';
  position: absolute;
  top: 0;
  left: var(--space-5);
  right: var(--space-5);
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-border-light) 20%,
    var(--color-border-light) 80%,
    transparent
  );
}

.sidebar-user:hover {
  background-color: var(--color-surface-sunken);
}

.sidebar-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.sidebar-logout-btn:hover {
  background-color: var(--color-error);
  color: var(--color-text-inverse);
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: var(--leading-tight);
}

.sidebar-user-role {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  text-transform: capitalize;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-sidebar) - 1);
  opacity: 0;
  transition: opacity var(--transition-slow);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--color-primary) 60%, transparent),
    color-mix(in srgb, var(--color-secondary) 40%, transparent)
  );
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}


/* ============================================
   HEADER
   Glass morphism bar with subtle depth
   ============================================ */

.app-header {
  background: color-mix(in srgb, var(--color-surface-raised) 85%, transparent);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid color-mix(in srgb, var(--color-border-light) 60%, transparent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

[data-mode="dark"] .app-header {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.header-hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  color: var(--color-text);
  position: relative;
  transition: background-color var(--transition-fast),
              transform var(--transition-fast);
}

.header-hamburger:hover {
  background-color: var(--color-surface-sunken);
  transform: scale(1.05);
}

.header-hamburger:active {
  transform: scale(0.95);
}

.header-hamburger svg {
  width: 22px;
  height: 22px;
  transition: transform var(--transition-base);
}

.header-hamburger.is-open svg {
  transform: rotate(90deg);
}

.header-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
}

.header-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  position: relative;
  transition: all var(--transition-fast);
}

.header-action-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-color: var(--color-surface-sunken);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.header-action-btn:hover {
  color: var(--color-text);
}

.header-action-btn:hover::before {
  opacity: 1;
}

.header-action-btn:active {
  transform: scale(0.92);
}

.header-action-btn svg {
  width: 20px;
  height: 20px;
  position: relative;
  z-index: 1;
  transition: transform var(--transition-fast);
}

.header-action-btn:hover svg {
  transform: scale(1.1);
}

.header-action-btn .notification-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background-color: var(--color-highlight);
  border: 2px solid var(--color-surface-raised);
  z-index: 2;
  animation: notification-pulse 2s ease-in-out infinite;
}

@keyframes notification-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.lang-selector {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 5px var(--space-2);
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: var(--weight-bold);
  color: var(--color-text-muted);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: all var(--transition-fast);
  line-height: 1;
}

.lang-selector:hover {
  border-color: var(--color-highlight);
  color: var(--color-highlight);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-highlight) 10%, transparent);
}

.dark-mode-toggle {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: background-color var(--transition-fast);
}

.dark-mode-toggle:hover {
  background-color: var(--color-surface-sunken);
}

.dark-mode-toggle svg {
  width: 20px;
  height: 20px;
  color: var(--color-text-secondary);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              color var(--transition-fast);
}

.dark-mode-toggle:hover svg {
  color: var(--color-highlight);
  transform: rotate(15deg);
}

@media (min-width: 1024px) {
  .header-hamburger {
    display: none;
  }
}


/* ============================================
   MODAL
   Dramatic entrance with accent line signature
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base),
              visibility var(--transition-base);
  background: radial-gradient(
    ellipse at center,
    color-mix(in srgb, var(--color-primary) 50%, transparent),
    color-mix(in srgb, var(--color-primary) 70%, transparent)
  );
  backdrop-filter: blur(8px) saturate(0.8);
  -webkit-backdrop-filter: blur(8px) saturate(0.8);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background-color: var(--color-surface-raised);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  max-height: 85dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transform: scale(0.92) translateY(12px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow:
    0 24px 48px -12px rgba(0, 0, 0, 0.18),
    0 0 0 1px color-mix(in srgb, var(--color-border-light) 50%, transparent);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--color-highlight),
    color-mix(in srgb, var(--color-highlight) 60%, var(--color-accent))
  );
  z-index: 1;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-5) var(--space-3);
  padding-top: calc(var(--space-5) + 3px);
  flex-shrink: 0;
}

.modal-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background-color: var(--color-surface-sunken);
  color: var(--color-text);
  transform: rotate(90deg);
}

.modal-close:active {
  transform: rotate(90deg) scale(0.9);
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

.modal-body {
  flex: 1;
  padding: var(--space-3) var(--space-5) var(--space-4);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5) var(--space-5);
  flex-shrink: 0;
  position: relative;
}

.modal-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: var(--space-5);
  right: var(--space-5);
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-border-light),
    transparent
  );
}

.modal-lg {
  max-width: 640px;
}

.modal-sm {
  max-width: 360px;
}


/* ============================================
   TOAST / ALERTS
   Bold status indicators with progress bar
   ============================================ */

.toast-container {
  position: fixed;
  bottom: var(--space-5);
  right: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-3);
  pointer-events: none;
  max-width: 380px;
  width: 100%;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background-color: var(--color-surface-raised);
  border-radius: var(--radius-lg);
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  animation: toast-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  box-shadow:
    0 8px 24px -4px rgba(0, 0, 0, 0.12),
    0 0 0 1px color-mix(in srgb, var(--color-border-light) 50%, transparent);
}

.toast.removing {
  animation: toast-out 0.25s ease-in forwards;
}

.toast::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--color-border);
  animation: toast-progress 4s linear forwards;
  border-radius: 0 1px 0 0;
}

.toast-icon-wrap {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: currentColor;
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  line-height: var(--leading-tight);
}

.toast-message {
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: var(--leading-normal);
}

.toast-close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: -2px;
  margin-right: -4px;
}

.toast-close:hover {
  background-color: var(--color-surface-sunken);
  color: var(--color-text);
}

.toast-close svg {
  width: 14px;
  height: 14px;
}

.toast-success .toast-icon-wrap {
  background-color: var(--status-confirmed-bg);
  color: var(--color-success);
}

.toast-success::after {
  background: var(--color-success);
}

.toast-error .toast-icon-wrap {
  background-color: var(--status-cancelled-bg);
  color: var(--color-error);
}

.toast-error::after {
  background: var(--color-error);
}

.toast-warning .toast-icon-wrap {
  background-color: var(--status-pending-bg);
  color: var(--color-warning);
}

.toast-warning::after {
  background: var(--color-warning);
}

.toast-info .toast-icon-wrap {
  background-color: var(--status-completed-bg);
  color: var(--color-info);
}

.toast-info::after {
  background: var(--color-info);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(16px) scale(0.96);
  }
}

@keyframes toast-progress {
  from { width: 100%; }
  to { width: 0%; }
}

@media (max-width: 639px) {
  .toast-container {
    left: var(--space-3);
    right: var(--space-3);
    bottom: var(--space-3);
    max-width: none;
  }

  @keyframes toast-in {
    from {
      opacity: 0;
      transform: translateY(16px) scale(0.96);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  @keyframes toast-out {
    from {
      opacity: 1;
      transform: translateY(0);
    }
    to {
      opacity: 0;
      transform: translateY(12px);
    }
  }
}


/* ============================================
   DROPDOWN
   Floating menu with directional entrance
   ============================================ */

.dropdown {
  position: relative;
  display: inline-flex;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 192px;
  background-color: var(--color-surface-raised);
  border-radius: var(--radius-lg);
  z-index: var(--z-dropdown);
  padding: var(--space-1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.97);
  transform-origin: top right;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow:
    0 12px 32px -4px rgba(0, 0, 0, 0.14),
    0 0 0 1px color-mix(in srgb, var(--color-border-light) 50%, transparent);
}

.dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.dropdown-menu.align-left {
  right: auto;
  left: 0;
  transform-origin: top left;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  transition: all var(--transition-fast);
}

.dropdown-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 2px;
  height: 16px;
  border-radius: var(--radius-full);
  background-color: var(--color-highlight);
  transition: transform var(--transition-fast);
}

.dropdown-item:hover {
  background-color: var(--color-surface-sunken);
  color: var(--color-text);
  padding-left: calc(var(--space-3) + 4px);
}

.dropdown-item:hover::before {
  transform: translateY(-50%) scaleY(1);
}

.dropdown-item:active {
  transform: scale(0.98);
}

.dropdown-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.dropdown-item:hover svg {
  opacity: 1;
}

.dropdown-divider {
  height: 1px;
  margin: var(--space-1) var(--space-2);
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-border-light),
    transparent
  );
}

.dropdown-item.danger {
  color: var(--color-error);
}

.dropdown-item.danger::before {
  background-color: var(--color-error);
}

.dropdown-item.danger:hover {
  background-color: color-mix(in srgb, var(--color-error) 8%, transparent);
  color: var(--color-error);
}

.dropdown-header {
  padding: var(--space-2) var(--space-3) var(--space-1);
  font-size: 0.6875rem;
  font-weight: var(--weight-bold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}


/* ============================================
   AVATAR
   Gradient ring with display font initials
   ============================================ */

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: linear-gradient(
    135deg,
    var(--color-surface-sunken),
    var(--color-surface)
  );
  overflow: hidden;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  position: relative;
  border: 2px solid var(--color-border-light);
  transition: transform var(--transition-fast),
              box-shadow var(--transition-fast);
}

.avatar:hover {
  transform: scale(1.06);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 0.6875rem;
  border-width: 1.5px;
}

.avatar-md {
  width: 36px;
  height: 36px;
  font-size: var(--text-xs);
}

.avatar-lg {
  width: 48px;
  height: 48px;
  font-size: var(--text-sm);
}

.avatar-xl {
  width: 64px;
  height: 64px;
  font-size: var(--text-base);
}

.avatar-2xl {
  width: 88px;
  height: 88px;
  font-size: var(--text-xl);
  border-width: 3px;
}

.avatar-online {
  border-color: var(--color-success);
  box-shadow: 0 0 0 2px var(--color-surface-raised),
              0 0 0 4px var(--color-success);
}

.avatar-highlight {
  border-color: var(--color-highlight);
  box-shadow: 0 0 0 2px var(--color-surface-raised),
              0 0 0 4px var(--color-highlight);
}

.avatar-group {
  display: flex;
}

.avatar-group .avatar {
  margin-left: -8px;
  box-shadow: 0 0 0 2px var(--color-surface-raised);
}

.avatar-group .avatar:first-child {
  margin-left: 0;
}

.avatar-group .avatar:hover {
  z-index: 1;
}


/* ============================================
   LOADER
   Branded loader with calendar checkmark motif
   ============================================ */

.loader-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base),
              visibility var(--transition-base);
  background: radial-gradient(
    ellipse at center,
    color-mix(in srgb, var(--color-surface) 95%, transparent),
    var(--color-surface)
  );
}

[data-mode="dark"] .loader-overlay {
  background: radial-gradient(
    ellipse at center,
    color-mix(in srgb, var(--color-surface) 92%, transparent),
    var(--color-surface)
  );
}

.loader-overlay.active {
  opacity: 1;
  visibility: visible;
}

.loader {
  width: 44px;
  height: 44px;
  position: relative;
}

.loader-ring {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  border: 2.5px solid var(--color-border-light);
  border-top-color: var(--color-highlight);
  animation: loader-spin 0.9s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.loader-check {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  color: var(--color-highlight);
  opacity: 0;
  animation: loader-check-appear 0.9s ease infinite;
}

.loader-text {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

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

.loader-sm .loader-ring {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

.loader-sm .loader-check {
  display: none;
}

.btn .loader-sm {
  margin: -1px 0;
}

.loader-inline {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

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

@keyframes loader-check-appear {
  0%, 40% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  60% { opacity: 0.4; transform: translate(-50%, -50%) scale(1); }
  80%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
}


/* ============================================
   FOOTER
   Subtle signature with accent gradient line
   ============================================ */

.site-footer {
  max-height: var(--footer-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-5);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  flex-shrink: 0;
  position: relative;
  letter-spacing: 0.01em;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: var(--space-4);
  right: var(--space-4);
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-border-light) 15%,
    var(--color-highlight) 50%,
    var(--color-border-light) 85%,
    transparent
  );
  opacity: 0.4;
}

.site-footer a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: var(--weight-medium);
  position: relative;
  transition: color var(--transition-fast);
}

.site-footer a::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--color-highlight);
  transition: width var(--transition-base);
}

.site-footer a:hover {
  color: var(--color-highlight);
}

.site-footer a:hover::after {
  width: 100%;
}

@media (min-width: 1024px) {
  .site-footer {
    justify-content: flex-end;
  }

  .site-footer::before {
    left: var(--space-8);
    right: var(--space-8);
  }
}


/* ============================================
   EMPTY STATE
   For pages with no data yet
   ============================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-16) var(--space-6);
  min-height: 300px;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  color: var(--color-border);
  margin-bottom: var(--space-5);
  opacity: 0.6;
}

.empty-state-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.empty-state-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 320px;
  margin-bottom: var(--space-6);
  line-height: var(--leading-relaxed);
}


/* ============================================
   DIVIDER
   Decorative section separator
   ============================================ */

.divider {
  height: 1px;
  margin: var(--space-6) 0;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-border-light) 20%,
    var(--color-border-light) 80%,
    transparent
  );
}

.divider-accent {
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-highlight) 50%,
    transparent
  );
  opacity: 0.3;
}


/* ============================================
   SKELETON LOADING
   Placeholder shimmer for loading states
   ============================================ */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-surface-sunken) 25%,
    var(--color-surface) 50%,
    var(--color-surface-sunken) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 14px;
  margin-bottom: var(--space-2);
}

.skeleton-text.short {
  width: 60%;
}

.skeleton-circle {
  border-radius: var(--radius-full);
}

.skeleton-card {
  height: 120px;
  border-radius: var(--radius-lg);
}

@keyframes skeleton-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}


/* ============================================
   SCROLL TO TOP (FAB)
   Floating action button pattern
   ============================================ */

.fab {
  position: fixed;
  bottom: calc(var(--footer-height) + var(--space-4));
  right: var(--space-4);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-sticky);
  cursor: pointer;
  transition: all var(--transition-fast);
  background-color: var(--color-highlight);
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-md);
}

.fab:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.fab:active {
  transform: translateY(0) scale(0.95);
}

.fab svg {
  width: 20px;
  height: 20px;
}

.fab-lg {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-xl);
}

.fab-lg svg {
  width: 22px;
  height: 22px;
}

@media (max-width: 639px) {
  .fab {
    bottom: calc(var(--footer-height) + var(--space-3));
    right: var(--space-3);
  }
}

/* --- SMALL PHONE FIXES (320-375px) --- */

@media (max-width: 375px) {
  .dropdown-menu {
    min-width: 160px;
    right: -8px;
  }

  .modal {
    margin: var(--space-2);
    max-height: 90dvh;
  }

  .modal-overlay {
    padding: var(--space-2);
  }

  .modal-header {
    padding: var(--space-3) var(--space-4);
  }

  .modal-body {
    padding: var(--space-3) var(--space-4);
  }

  .modal-footer {
    padding: var(--space-3) var(--space-4);
  }

  .avatar-sm {
    width: 30px;
    height: 30px;
    font-size: var(--text-xs);
  }
}
