@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;500;600;700&display=swap');

:root {
  --primary-color: #1e293b;
  --sidebar-width: 50px;
}

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

html, body {
  height: 100%;
  margin: 0;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
}

html.aidesk-app-shell,
html.aidesk-app-shell body {
  overflow: hidden;
}

.aidesk-shell-root {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: visible;
}

.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 50px;
  min-width: 50px;
  background-color: var(--primary-color);
  height: 100vh;
  padding: 10px 0;
  flex-shrink: 0;
  z-index: 1100;
  overflow: visible;
}

.sidebar-top,
.sidebar-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: visible;
}

.sidebar-btn {
  background: transparent;
  border: none;
  padding: 8px;
  margin: 8px 0;
  cursor: pointer;
  border-radius: 8px;
}

.sidebar-btn:hover,
.sidebar-btn.active {
  background-color: rgba(255, 255, 255, 0.2);
}

html.aidesk-billing-locked .sidebar-btn.sidebar-btn--billing-locked {
  display: none !important;
}

html.aidesk-billing-locked .sidebar-btn.sidebar-btn--billing-only {
  background-color: rgba(255, 255, 255, 0.16);
}

.sidebar-btn .material-icons {
  color: #fff;
  font-size: 20px;
}

.sidebar-notifications-btn {
  position: relative;
}

.sidebar-notifications-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}

.sidebar-notifications-badge.hidden {
  display: none;
}

.notifications-panel-backdrop {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  bottom: 0;
  z-index: 1098;
  background: rgba(15, 23, 42, 0.18);
  border: none;
  padding: 0;
  margin: 0;
  cursor: default;
}

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

.notifications-panel {
  position: fixed;
  left: var(--sidebar-width);
  top: 0;
  bottom: 0;
  width: 380px;
  max-width: calc(100vw - 70px);
  background: #fff;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
  border-radius: 0 12px 12px 0;
  z-index: 1099;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: notificationsPanelIn 0.2s ease-out;
}

.notifications-panel.open {
  display: flex;
}

@keyframes notificationsPanelIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.notifications-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
  background: #fff;
}

.notifications-panel-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
}

.notifications-panel-header .btn-archive {
  background: transparent;
  border: none;
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
}

.notifications-panel-header .btn-archive:hover {
  background: rgba(37, 99, 235, 0.08);
}

.notifications-panel-header .btn-archive.hidden {
  visibility: hidden;
  pointer-events: none;
}

.notifications-panel-filters {
  padding: 10px 20px 12px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
  background: #fff;
  position: relative;
  z-index: 5;
}

.notifications-org-filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  position: relative;
}

.notifications-org-filter-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #64748b;
}

.notifications-org-picker {
  position: relative;
}

.notifications-org-picker-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #1e293b;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.notifications-org-picker-btn:hover {
  border-color: #cbd5e1;
}

.notifications-org-picker-btn:focus,
.notifications-org-picker-btn[aria-expanded='true'] {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.notifications-org-picker-avatar {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #e2e8f0;
  color: #475569;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.notifications-org-picker-avatar .material-icons {
  font-size: 16px;
}

.notifications-org-picker-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.notifications-org-picker-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notifications-org-picker-caret {
  font-size: 18px;
  color: #64748b;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.notifications-org-picker-btn[aria-expanded='true'] .notifications-org-picker-caret {
  transform: rotate(180deg);
}

.notifications-org-picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.notifications-org-picker-menu[hidden] {
  display: none !important;
}

.notifications-org-picker-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 6px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #1e293b;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.notifications-org-picker-option:hover,
.notifications-org-picker-option:focus {
  outline: none;
  background: #f8fafc;
}

.notifications-org-picker-option.is-active {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}

.notifications-org-picker-option-avatar {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.notifications-org-picker-option-avatar .material-icons {
  font-size: 16px;
  color: #475569;
}

.notifications-org-picker-option-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.notifications-org-picker-option-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notifications-org-picker-option-check {
  font-size: 18px;
  color: #2563eb;
  flex-shrink: 0;
  opacity: 0;
}

.notifications-org-picker-option.is-active .notifications-org-picker-option-check {
  opacity: 1;
}

.notifications-panel-item-org {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 3px 8px 3px 3px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
}

.notifications-panel-item-org-avatar {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
}

.notifications-panel-item-org-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.notifications-panel-item-org-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell-invite-modal-meta {
  margin-top: 12px;
}

.shell-invite-modal-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  background: #f1f5f9;
  color: #1e293b;
  font-size: 13px;
  font-weight: 600;
}

.shell-invite-modal-chip .material-icons {
  font-size: 18px;
  color: #64748b;
}

.shell-invite-modal-chip span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notifications-panel-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
  background: #fff;
}

.notifications-panel-tab {
  flex: 1;
  min-width: 0;
  padding: 12px 8px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
  text-align: center;
  font-family: inherit;
}

.notifications-panel-tab:hover {
  color: #1e293b;
}

.notifications-panel-tab.active {
  color: #2563eb;
}

.notifications-panel-tab.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: #2563eb;
  border-radius: 2px 2px 0 0;
}

.notifications-panel-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 8px 0;
}

.notifications-panel-list:empty {
  flex: 0 0 0;
  padding: 0;
  overflow: hidden;
}

.notifications-panel-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px 12px 20px;
  transition: background 0.15s;
  width: 100%;
  text-align: left;
  background: none;
  font-family: inherit;
}

.notifications-panel-item:hover {
  background: #f1f5f9;
}

.notifications-panel-item-body {
  flex: 1;
  min-width: 0;
}

.notifications-panel-item-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  margin-top: 2px;
}

.notifications-panel-item-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}

.notifications-panel-item-action:hover {
  background: #e2e8f0;
  color: #2563eb;
}

.notifications-panel-item-action .material-icons {
  font-size: 18px;
}

.notifications-panel-item-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notifications-panel-item-icon .material-icons {
  font-size: 20px;
}

.notifications-panel-item-icon--info {
  background: #dbeafe;
  color: #2563eb;
}

.notifications-panel-item-icon--warning {
  background: #fef3c7;
  color: #d97706;
}

.notifications-panel-item-icon--critical {
  background: #fee2e2;
  color: #dc2626;
}

.notifications-panel-item-title {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 4px;
  line-height: 1.3;
}

.notifications-panel-item-date {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 2px;
}

.notifications-panel-item-subtitle {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

.notifications-panel-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 32px 20px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
}

.notifications-panel-empty.hidden {
  display: none;
}

#remindersBtn {
  display: none;
}

.sidebar-status-container {
  position: relative;
  overflow: visible;
}

.sidebar-status-btn {
  background: transparent;
  border: none;
  margin: 8px 0;
  cursor: pointer;
  border-radius: 6px;
}

.sidebar-status-avatar-wrap {
  position: relative;
  display: block;
  width: 32px;
  height: 32px;
}

.sidebar-avatar-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.02em;
  line-height: 1;
  user-select: none;
}

.sidebar-avatar-icon.is-hidden {
  display: none;
}

.sidebar-avatar-icon.is-initials {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
}

.sidebar-status-avatar {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  background: #e2e8f0;
}

.sidebar-status-avatar.is-visible {
  display: block;
}

/* Modal Meu perfil */
.shell-profile-avatar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 4px;
}

.shell-profile-avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  color: #94a3b8;
}

.shell-profile-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shell-profile-avatar-preview .material-icons {
  font-size: 32px;
}

.shell-profile-avatar-initials {
  font-family: 'Inter', 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 22px;
  color: #1e293b;
  letter-spacing: -0.02em;
}

.shell-profile-avatar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.shell-profile-avatar-upload {
  cursor: pointer;
  margin: 0;
}

.shell-profile-avatar-remove[hidden] {
  display: none !important;
}

.shell-profile-logout-btn {
  margin-right: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #b91c1c;
}

.shell-profile-logout-btn .material-icons {
  font-size: 18px;
}

.shell-profile-logout-btn:hover {
  background: #fef2f2;
}

.sidebar-status-avatar-wrap > .status-circle,
.sidebar-status-avatar-wrap #statusCircle {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--primary-color);
  display: block;
  box-shadow: none;
}

.status-menu-option .status-circle {
  position: static;
  width: 12px;
  height: 12px;
  min-width: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.status-circle.online { background: #22c55e; }
.status-circle.busy { background: #f59e42; }
.status-circle.offline { background: #64748b; }

.status-menu {
  position: absolute;
  bottom: 46px;
  left: 0;
  background: #fff;
  color: #1e293b;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  min-width: 210px;
  max-width: 270px;
  z-index: 1300;
  padding: 8px 0;
  display: none;
  flex-direction: column;
}

.status-menu.is-open {
  display: flex;
}

.status-menu-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
  transition: background 0.18s;
}

.status-menu-option:hover { background: #f1f5f9; }

.status-menu-option .material-icons {
  font-size: 20px;
  color: #64748b;
}

.status-menu-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 6px 0;
}

.aidesk-module-host {
  flex: 1;
  min-width: 0;
  position: relative;
  height: 100vh;
  /* Mesmo branco do splash — evita flash cinza/branco entre trocas de módulo. */
  background: #ffffff;
}

.aidesk-module-frame.loading {
  background: #ffffff;
}

/* Splash na troca de workspace — tipografia igual ao .initial-loading-splash */
.aidesk-workspace-splash {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: var(--sidebar-width);
  z-index: 100050;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  text-align: center;
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.aidesk-workspace-splash.is-visible {
  display: flex;
}

/* Sem org: splash fica atrás do menu/modal do workspace (não bloquear o seletor). */
.aidesk-workspace-splash.is-no-org {
  z-index: 400;
  pointer-events: none;
}

.aidesk-workspace-splash.is-no-org .aidesk-workspace-splash-spinner {
  display: none;
}

.aidesk-workspace-splash .aidesk-workspace-splash-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top-color: #3498db;
  border-radius: 50%;
  animation: aideskWorkspaceSplashSpin 1s linear infinite;
  margin-bottom: 16px;
}

.aidesk-workspace-splash .aidesk-workspace-splash-title {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
  color: #374151;
}

.aidesk-workspace-splash .aidesk-workspace-splash-subtitle {
  margin: 0 0 32px 0;
  max-width: 400px;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  color: #6b7280;
}

@keyframes aideskWorkspaceSplashSpin {
  to {
    transform: rotate(360deg);
  }
}

.aidesk-module-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
}

.aidesk-module-frame.active {
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
}
