/* ============================================================
   TALKBACK — APPLICATION STYLES
   ============================================================
   File: css/app.css
   Purpose: App-specific styles, view transitions, screen
            compositions, and app-level overrides.
   
   Load order:
   1. variables.css
   2. reset.css
   3. components.css
   4. layout.css
   5. app.css          ← THIS FILE (last)
   
   APP STYLES INDEX:
   1.  View System
   2.  Home Screen
   3.  Channel List Screen
   4.  Channel Detail / PTT Screen
   5.  People Screen
   6.  Map Screen
   7.  Profile Screen
   8.  Settings Screen
   9.  Organization Switcher
   10. Invitation Screen
   11. Emergency Screen
   12. Admin Screens
   13. Superadmin Screens
   14. Notification List
   15. Onboarding Flow
   16. Connection Status Bar
   17. Update Banner
   18. App Transitions
   ============================================================ */


/* ============================================================
   1. VIEW SYSTEM
   ============================================================
   Only one view is visible at a time.
   Views are stacked and toggled via JavaScript.
   ============================================================ */

.view {
  display: none;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  flex: 1;
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-default);
}

.view--active {
  display: flex;
  opacity: 1;
}

/* Prevent content shift during view transitions */
.view--entering {
  display: flex;
  opacity: 0;
}

.view--leaving {
  display: flex;
  opacity: 0;
  pointer-events: none;
}


/* ============================================================
   2. HOME SCREEN
   ============================================================
   The main dashboard after login. Shows quick access
   to channels, recent activity, and team overview.
   ============================================================ */

.home-screen {
  padding: var(--space-4);
}

/* Welcome Header */
.home-welcome {
  padding: var(--space-4) 0;
  margin-bottom: var(--space-4);
}

.home-welcome__greeting {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-bottom: var(--space-1);
}

.home-welcome__name {
  font-size: var(--text-2xl);
  font-weight: var(--weight-extrabold);
  color: var(--text-primary);
  letter-spacing: var(--tracking-snug);
}

.home-welcome__org {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-1);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.home-welcome__org-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--success);
}

/* Quick Action Cards */
.home-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.home-quick-action {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-default),
              box-shadow var(--duration-fast) var(--ease-default),
              transform var(--duration-fast) var(--ease-default);
  text-decoration: none;
  min-height: 100px;
}

.home-quick-action:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.home-quick-action:active {
  transform: translateY(0);
}

.home-quick-action__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-quick-action__icon--channels {
  background: var(--accent-soft);
  color: var(--accent);
}

.home-quick-action__icon--people {
  background: var(--success-soft);
  color: var(--success);
}

.home-quick-action__icon--map {
  background: var(--info-soft);
  color: var(--info);
}

.home-quick-action__icon--emergency {
  background: var(--danger-soft);
  color: var(--danger);
}

.home-quick-action__label {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.home-quick-action__count {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* Recent Channels */
.home-recent {
  margin-bottom: var(--space-6);
}

.home-recent__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.home-recent__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-tertiary);
}

.home-recent__see-all {
  font-size: var(--text-sm);
  color: var(--accent);
  font-weight: var(--weight-medium);
}

/* Active Now Strip */
.home-active-now {
  margin-bottom: var(--space-6);
}

.home-active-now__scroll {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-1);
}

.home-active-now__scroll::-webkit-scrollbar {
  display: none;
}

.home-active-now__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  min-width: 64px;
  cursor: pointer;
}

.home-active-now__name {
  font-size: 10px;
  color: var(--text-tertiary);
  text-align: center;
  max-width: 64px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ============================================================
   3. CHANNEL LIST SCREEN
   ============================================================ */

.channel-list-screen {
  padding: var(--space-2) 0;
}

.channel-list-screen__search {
  padding: var(--space-2) var(--space-4);
  margin-bottom: var(--space-2);
}

.channel-list-screen__section {
  padding: var(--space-2) var(--space-4);
}

.channel-list-screen__section-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-tertiary);
  padding: var(--space-2) 0;
}

.channel-list-screen__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

/* Create Channel FAB */
.channel-fab {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + var(--space-4));
  right: var(--space-4);
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-accent);
  z-index: var(--z-sticky);
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-default),
              box-shadow var(--duration-fast) var(--ease-default);
}

.channel-fab:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.channel-fab:active {
  transform: scale(0.95);
}


/* ============================================================
   4. CHANNEL DETAIL / PTT SCREEN
   ============================================================ */

/* Channel header bar */
.channel-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}

.channel-header__back {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  flex-shrink: 0;
  cursor: pointer;
  transition: var(--transition-colors);
}

.channel-header__back:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.channel-header__info {
  flex: 1;
  min-width: 0;
}

.channel-header__name {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-header__status {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.channel-header__status-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
}

.channel-header__status-dot--connected {
  background: var(--success);
}

.channel-header__status-dot--connecting {
  background: var(--warning);
  animation: dotPulse 1.5s ease infinite;
}

.channel-header__status-dot--disconnected {
  background: var(--danger);
}

.channel-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
}

/* Speaker area in channel view */
.channel-speaker-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  text-align: center;
}

.channel-speaker-area__idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.channel-speaker-area__idle-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
}

.channel-speaker-area__idle-text {
  font-size: var(--text-base);
  color: var(--text-tertiary);
}

/* Active speaker display in channel */
.channel-active-speaker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.channel-active-speaker__avatar-ring {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-full);
  border: 3px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: speakerRingPulse 2s ease infinite;
}

@keyframes speakerRingPulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50% { box-shadow: 0 0 0 12px transparent; }
}

.channel-active-speaker__name {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
}

.channel-active-speaker__label {
  font-size: var(--text-sm);
  color: var(--accent);
  font-weight: var(--weight-medium);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Channel members strip at bottom */
.channel-members-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
}

.channel-members-strip__label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}


/* ============================================================
   5. PEOPLE SCREEN
   ============================================================ */

.people-screen {
  padding: var(--space-2) 0;
}

.people-screen__search {
  padding: var(--space-2) var(--space-4);
  margin-bottom: var(--space-2);
}

.people-screen__tabs {
  padding: 0 var(--space-4);
  margin-bottom: var(--space-2);
}

.people-screen__list {
  padding: 0 var(--space-2);
}


/* ============================================================
   6. MAP SCREEN
   ============================================================ */

.map-screen {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.map-screen__container {
  flex: 1;
  position: relative;
  background: var(--bg-tertiary);
}

/* Map controls overlay */
.map-controls {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: var(--z-sticky);
}

.map-control-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: var(--transition-colors);
}

.map-control-btn:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

/* Map member panel (bottom sheet on mobile) */
.map-member-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface-elevated);
  border-top: 1px solid var(--border);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  padding: var(--space-4);
  max-height: 40vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(calc(100% - 64px));
  transition: transform var(--duration-normal) var(--ease-out);
  z-index: var(--z-sticky);
}

.map-member-panel--expanded {
  transform: translateY(0);
}

.map-member-panel__handle {
  width: 32px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--border-strong);
  margin: 0 auto var(--space-3);
  cursor: pointer;
}

.map-member-panel__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}


/* ============================================================
   7. PROFILE SCREEN
   ============================================================ */

.profile-screen {
  padding: var(--space-4);
}

.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-6) 0;
  margin-bottom: var(--space-6);
}

.profile-header__avatar-wrapper {
  position: relative;
}

.profile-header__edit-avatar {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-primary);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-default);
}

.profile-header__edit-avatar:hover {
  background: var(--accent-hover);
}

.profile-header__name {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  text-align: center;
}

.profile-header__role {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* Profile menu items */
.profile-menu {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.profile-menu__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-default);
  min-height: var(--touch-target-min);
  text-decoration: none;
  color: var(--text-primary);
}

.profile-menu__item:hover {
  background: var(--surface-hover);
}

.profile-menu__item:active {
  background: var(--surface-active);
}

.profile-menu__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.profile-menu__text {
  flex: 1;
  min-width: 0;
}

.profile-menu__label {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
}

.profile-menu__sublabel {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.profile-menu__arrow {
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.profile-menu__item--danger .profile-menu__icon {
  background: var(--danger-soft);
  color: var(--danger);
}

.profile-menu__item--danger .profile-menu__label {
  color: var(--danger);
}

/* Profile menu divider */
.profile-menu__divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-3) 0;
}


/* ============================================================
   8. SETTINGS SCREEN
   ============================================================ */

.settings-screen {
  padding: var(--space-4);
}

.settings-group {
  margin-bottom: var(--space-6);
}

.settings-group__title {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-tertiary);
  padding: var(--space-2) 0;
  margin-bottom: var(--space-2);
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  min-height: var(--touch-target-min);
}

.settings-item + .settings-item {
  border-top: 1px solid var(--border-subtle);
}

.settings-item__info {
  flex: 1;
  min-width: 0;
}

.settings-item__label {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
}

.settings-item__desc {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  line-height: var(--leading-relaxed);
  margin-top: 2px;
}

.settings-item__control {
  flex-shrink: 0;
}


/* ============================================================
   9. ORGANIZATION SWITCHER
   ============================================================ */

.org-switcher {
  padding: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.org-switcher__current {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-default);
  min-height: var(--touch-target-min);
}

.org-switcher__current:hover {
  background: var(--surface-hover);
}

.org-switcher__logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  flex-shrink: 0;
}

.org-switcher__info {
  flex: 1;
  min-width: 0;
}

.org-switcher__name {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.org-switcher__plan {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.org-switcher__chevron {
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* Org list in dropdown */
.org-list {
  padding: var(--space-2);
}

.org-list__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-default);
  min-height: var(--touch-target-min);
}

.org-list__item:hover {
  background: var(--surface-hover);
}

.org-list__item--active {
  background: var(--accent-soft);
}

.org-list__item--add {
  color: var(--accent);
  font-weight: var(--weight-medium);
  font-size: var(--text-sm);
}


/* ============================================================
   10. INVITATION SCREEN
   ============================================================ */

.invitation-screen {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: calc(100vh - var(--nav-height));
  min-height: calc(100dvh - var(--nav-height));
}

.invitation-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.invitation-card__org-logo {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xl);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
}

.invitation-card__title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.invitation-card__message {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-6);
}

.invitation-card__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}


/* ============================================================
   11. EMERGENCY SCREEN
   ============================================================ */

.emergency-screen {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-height) - var(--bottom-nav-height));
  min-height: calc(100dvh - var(--nav-height) - var(--bottom-nav-height));
}

/* Emergency Trigger Button */
.emergency-trigger {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  user-select: none;
  -webkit-user-select: none;
}

.emergency-trigger__ring {
  width: 160px;
  height: 160px;
  border-radius: var(--radius-full);
  border: 3px solid var(--danger-border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--duration-fast) var(--ease-default),
              box-shadow var(--duration-fast) var(--ease-default);
}

.emergency-trigger__button {
  width: 130px;
  height: 130px;
  border-radius: var(--radius-full);
  background: var(--danger);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  cursor: pointer;
  box-shadow: var(--shadow-danger);
  transition: transform var(--duration-fast) var(--ease-default),
              box-shadow var(--duration-fast) var(--ease-default);
  touch-action: none;
}

.emergency-trigger__button:hover {
  transform: scale(1.03);
}

.emergency-trigger__button:active {
  transform: scale(0.96);
}

.emergency-trigger__icon {
  pointer-events: none;
}

.emergency-trigger__text {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  pointer-events: none;
}

.emergency-trigger__instruction {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  text-align: center;
  max-width: 240px;
  line-height: var(--leading-relaxed);
}

/* Emergency Active State */
.emergency-trigger--active .emergency-trigger__ring {
  border-color: var(--danger);
  animation: emergencyRingPulse 1s ease infinite;
}

@keyframes emergencyRingPulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--emergency-glow); }
  50% { box-shadow: 0 0 0 20px transparent; }
}

.emergency-trigger--active .emergency-trigger__button {
  animation: emergencyButtonPulse 0.8s ease infinite;
}

@keyframes emergencyButtonPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

/* Emergency Incident Card */
.emergency-incident-card {
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-5);
  width: 100%;
  max-width: 400px;
}

.emergency-incident-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.emergency-incident-card__status {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

.emergency-incident-card__time {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-left: auto;
}

.emergency-incident-card__details {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.emergency-incident-card__detail {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.emergency-incident-card__detail-icon {
  flex-shrink: 0;
  color: var(--danger);
  margin-top: 2px;
}


/* ============================================================
   12. ADMIN SCREENS
   ============================================================ */

/* Admin data table */
.admin-table {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--surface);
}

.admin-table thead {
  background: var(--bg-tertiary);
}

.admin-table th {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-tertiary);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: var(--surface-hover);
}

/* Responsive table wrapper */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-xl);
}

@media (max-width: 768px) {
  .admin-table th,
  .admin-table td {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
  }
}


/* ============================================================
   13. SUPERADMIN SCREENS
   ============================================================ */

/* Analytics chart container */
.analytics-chart {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}

.analytics-chart__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.analytics-chart__title {
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
}

.analytics-chart__body {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Export button */
.export-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}


/* ============================================================
   14. NOTIFICATION LIST
   ============================================================ */

.notification-list {
  display: flex;
  flex-direction: column;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  transition: background var(--duration-fast) var(--ease-default);
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
}

.notification-item:hover {
  background: var(--surface-hover);
}

.notification-item--unread {
  background: var(--accent-softer);
}

.notification-item--unread:hover {
  background: var(--accent-soft);
}

.notification-item__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notification-item__icon--invitation {
  background: var(--accent-soft);
  color: var(--accent);
}

.notification-item__icon--emergency {
  background: var(--danger-soft);
  color: var(--danger);
}

.notification-item__icon--channel {
  background: var(--success-soft);
  color: var(--success);
}

.notification-item__icon--system {
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
}

.notification-item__content {
  flex: 1;
  min-width: 0;
}

.notification-item__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  margin-bottom: 2px;
}

.notification-item__body {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: var(--leading-snug);
}

.notification-item__time {
  font-size: 10px;
  color: var(--text-tertiary);
  flex-shrink: 0;
  margin-top: 2px;
}

.notification-item__unread-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 6px;
}


/* ============================================================
   15. ONBOARDING FLOW
   ============================================================ */

.onboarding {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--space-6);
  text-align: center;
}

.onboarding__step {
  max-width: 400px;
  width: 100%;
}

.onboarding__illustration {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-6);
  color: var(--accent);
}

.onboarding__title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-extrabold);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.onboarding__desc {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-8);
}

/* Onboarding progress dots */
.onboarding__progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-8);
}

.onboarding__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--border-strong);
  transition: background var(--duration-fast) var(--ease-default),
              width var(--duration-fast) var(--ease-default);
}

.onboarding__dot--active {
  background: var(--accent);
  width: 24px;
}


/* ============================================================
   16. CONNECTION STATUS BAR
   ============================================================ */

.connection-bar {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  padding: var(--space-2) var(--space-4);
  text-align: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  transform: translateY(-100%);
  transition: transform var(--duration-normal) var(--ease-out);
}

.connection-bar--visible {
  transform: translateY(0);
}

.connection-bar--offline {
  background: var(--danger);
  color: white;
}

.connection-bar--reconnecting {
  background: var(--warning);
  color: var(--text-inverse);
}

.connection-bar--connected {
  background: var(--success);
  color: white;
}

@media (max-width: 768px) {
  .connection-bar {
    top: var(--nav-height-mobile);
  }
}


/* ============================================================
   17. UPDATE BANNER
   ============================================================ */

.update-banner {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + var(--space-4));
  left: var(--space-4);
  right: var(--space-4);
  background: var(--surface-elevated);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-xl);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-toast);
  transform: translateY(calc(100% + var(--space-16)));
  transition: transform var(--duration-slow) var(--ease-out);
}

.update-banner--visible {
  transform: translateY(0);
}

.update-banner__text {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.update-banner__action {
  flex-shrink: 0;
}


/* ============================================================
   18. APP TRANSITIONS
   ============================================================ */

/* Fade transition */
.fade-enter {
  opacity: 0;
}

.fade-enter-active {
  opacity: 1;
  transition: opacity var(--duration-normal) var(--ease-default);
}

.fade-leave {
  opacity: 1;
}

.fade-leave-active {
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-default);
}

/* Slide up transition */
.slide-up-enter {
  opacity: 0;
  transform: translateY(16px);
}

.slide-up-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-out);
}

/* Slide right transition (for navigation) */
.slide-right-enter {
  opacity: 0;
  transform: translateX(16px);
}

.slide-right-enter-active {
  opacity: 1;
  transform: translateX(0);
  transition: opacity var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-out);
}

/* Scale transition (for modals) */
.scale-enter {
  opacity: 0;
  transform: scale(0.95);
}

.scale-enter-active {
  opacity: 1;
  transform: scale(1);
  transition: opacity var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-out);
}