.ofc-body {
  min-height: 100vh;
  color: #f9fafb;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #020617;
  background-image:
    radial-gradient(circle at 0 0, rgba(59, 130, 246, 0.45), transparent 60%),
    radial-gradient(circle at 100% 0, rgba(16, 185, 129, 0.3), transparent 60%),
    radial-gradient(circle at 50% 110%, rgba(129, 140, 248, 0.4), transparent 70%),
    linear-gradient(#020617, #020617),
    linear-gradient(rgba(31, 41, 55, 0.4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 41, 55, 0.4) 1px, transparent 1px);
  background-size:
    auto,
    auto,
    auto,
    auto,
    40px 40px,
    40px 40px;
  background-position:
    0 0,
    100% 0,
    50% 120%,
    0 0,
    0 0,
    0 0;
}

.ofc-navbar {
  background: linear-gradient(90deg, #111827, #1f2937);
  border-bottom: 1px solid rgba(249, 250, 251, 0.06);
}

.ofc-username-display {
  color: #e5e7eb !important;
  font-weight: 500;
  font-size: 13px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
}

.ofc-main {
  padding: 20px 24px 24px;
}

/* Auth pages */
.ofc-auth-wrapper {
  max-width: 420px;
  margin: 48px auto;
}

.ofc-auth-card {
  background: rgba(17, 24, 39, 0.94);
  border-radius: 18px;
  padding: 28px 26px 26px;
  box-shadow: 0 22px 45px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(249, 250, 251, 0.06);
}

.ofc-auth-header {
  margin-bottom: 18px;
}

.ofc-auth-title {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 4px;
}

.ofc-auth-subtitle {
  margin: 0;
  font-size: 13px;
  color: #9ca3af;
}

.text-muted {
  color: #ffffff !important;
}

.ofc-user-status-text {
  color: #ffffff !important;
}

.ofc-label {
  font-size: 13px;
  color: #e5e7eb;
}

.ofc-input {
  background-color: #020617;
  border-radius: 999px;
  border: 1px solid #1f2937;
  color: #f9fafb;
  font-size: 14px;
  padding: 8px 14px;
}

.ofc-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.7);
  background-color: #020617;
  color: #f9fafb;
}

.ofc-btn-primary {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  border-radius: 999px;
  border: none;
  font-weight: 500;
  font-size: 14px;
  padding: 8px 16px;
}

.ofc-btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #4338ca);
}

.ofc-auth-hint {
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
}

/* Chat layout */
.ofc-chat-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  height: calc(100vh - 88px);
}

.ofc-sidebar {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 18px;
  padding: 16px 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.ofc-sidebar-header {
  margin-bottom: 10px;
}

.ofc-sidebar-title {
  font-size: 14px;
  font-weight: 600;
}

.ofc-sidebar-subtitle {
  font-size: 11px;
  color: #9ca3af;
}

.ofc-create-user-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #ffffff;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: none;
}

.ofc-create-user-btn:hover {
  background: linear-gradient(135deg, #1d4ed8, #4338ca);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
  color: #ffffff;
  text-decoration: none;
}

.ofc-team-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
  max-height: 300px;
  overflow-y: auto;
}

.ofc-team-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 4px;
}

.ofc-team-item:hover {
  background: rgba(31, 41, 55, 0.95);
  transform: translateY(-1px);
}

.ofc-team-item:active {
  transform: translateY(0);
  background: rgba(37, 99, 235, 0.15);
}

.ofc-team-selected {
  background: rgba(37, 99, 235, 0.2) !important;
  border-left: 3px solid #2563eb;
  padding-left: 5px;
}

.ofc-team-icon {
  font-size: 20px;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.1);
  border-radius: 8px;
}

.ofc-team-info {
  flex: 1;
  min-width: 0;
}

.ofc-team-name {
  font-size: 13px;
  font-weight: 600;
  color: #e5e7eb;
}

.ofc-team-desc {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 2px;
}

.ofc-user-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: calc(100% - 40px);
  overflow-y: auto;
}

.ofc-user-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  gap: 8px;
  user-select: none;
}

.ofc-user-list-item:hover {
  background: rgba(31, 41, 55, 0.95);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.ofc-user-list-item:active {
  transform: translateY(0);
  background: rgba(37, 99, 235, 0.15);
}

.ofc-user-selected {
  background: rgba(37, 99, 235, 0.2) !important;
  border-left: 3px solid #2563eb;
  padding-left: 5px;
}

.ofc-user-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.ofc-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #60a5fa, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #e5e7eb;
}

.ofc-user-meta {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 13px;
  cursor: pointer;
}

.ofc-user-status-text {
  font-size: 11px;
  color: #6b7280;
  transition: color 0.2s ease;
}

.ofc-status-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  transition: all 0.3s ease;
  border: 2px solid rgba(15, 23, 42, 0.8);
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.5);
}

.ofc-status-online {
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.5), 0 0 8px rgba(16, 185, 129, 0.6);
  animation: pulse-online 2s ease-in-out infinite;
}

.ofc-status-offline {
  background: #6b7280;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.5);
}

@keyframes pulse-online {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

.status-badge {
  text-transform: none;
}

.ofc-unread-badge {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  margin-right: 6px;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5);
  animation: pulse-badge 2s ease-in-out infinite;
  display: inline-block;
  line-height: 1.2;
}

@keyframes pulse-badge {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.08);
  }
}

.ofc-chat-panel {
  background: rgba(15, 23, 42, 0.96);
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ofc-chat-header {
  padding: 14px 18px 10px;
  border-bottom: 1px solid rgba(55, 65, 81, 0.9);
  background: radial-gradient(130% 130% at 0% 0%, rgba(37, 99, 235, 0.35), transparent);
}

.ofc-chat-header-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ofc-chat-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ofc-chat-title {
  font-size: 15px;
  font-weight: 600;
}

.ofc-chat-pill {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: transparent;
  color: #e5e7eb;
  font-size: 11px;
  padding: 3px 10px;
}

.ofc-chat-header-sub {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 4px;
}

.ofc-typing-indicator {
  font-size: 11px;
  color: #e5e7eb;
  margin-top: 2px;
  font-style: italic;
  min-height: 14px;
}

.ofc-chat-body {
  flex: 1;
  padding: 12px 16px 10px;
  overflow-y: auto;
}

.chat-message {
  margin-bottom: 6px;
}

.chat-message .meta {
  font-size: 11px;
  color: #9ca3af;
}

.chat-message .text {
  font-size: 13px;
  margin-top: 1px;
}

.msg-status {
  font-size: 11px;
  margin-left: 4px;
  color: #60a5fa;
}

.msg-delete-btn {
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 12px;
  margin-left: 6px;
  padding: 2px 4px;
  opacity: 0;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.chat-message:hover .msg-delete-btn {
  opacity: 1;
}

.msg-delete-btn:hover {
  color: #ef4444;
  transform: scale(1.1);
}

.msg-edit-btn {
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 12px;
  margin-left: 6px;
  padding: 2px 4px;
  opacity: 0;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.chat-message:hover .msg-edit-btn {
  opacity: 1;
}

.msg-edit-btn:hover {
  color: #fbbf24;
  transform: scale(1.1);
}

.msg-edited-label {
  font-size: 10px;
  color: #9ca3af;
  margin-left: 4px;
}

.ofc-clear-btn {
  border-radius: 999px;
  border: 1px solid rgba(239, 68, 68, 0.6);
  background: transparent;
  color: #ef4444;
  font-size: 11px;
  padding: 3px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ofc-clear-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
}

.ofc-chat-input {
  padding: 8px 12px 10px;
  border-top: 1px solid rgba(55, 65, 81, 0.9);
  background: radial-gradient(120% 120% at 100% 0%, rgba(79, 70, 229, 0.35), transparent);
}

.ofc-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ofc-input-message {
  border-radius: 999px;
  background-color: #020617;
  border: 1px solid rgba(55, 65, 81, 0.95);
  color: #f9fafb;
  font-size: 14px;
}

.ofc-send-btn {
  white-space: nowrap;
}

.ofc-emoji-btn {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(17, 24, 39, 0.9);
  color: #e5e7eb;
  font-size: 16px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ofc-emoji-btn:hover {
  background: rgba(31, 41, 55, 0.9);
}

.ofc-attach-btn {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(17, 24, 39, 0.9);
  color: #e5e7eb;
  font-size: 16px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ofc-attach-icon {
  display: block;
  color: currentColor;
}

.ofc-attach-btn:hover {
  background: rgba(31, 41, 55, 0.9);
}

.ofc-attachment-image {
  max-width: 220px;
  max-height: 160px;
  display: block;
  border-radius: 10px;
  margin-bottom: 4px;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.ofc-attachment-link {
  color: #93c5fd;
  font-size: 13px;
  text-decoration: underline;
}

.ofc-attachment-link:hover {
  color: #bfdbfe;
}

.ofc-attachment-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 6px 10px;
  background: rgba(31, 41, 55, 0.8);
  border-radius: 8px;
  font-size: 12px;
  color: #e5e7eb;
}

.ofc-attachment-preview #attachment-filename {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ofc-attachment-remove {
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 2px 6px;
  font-size: 14px;
  line-height: 1;
  border-radius: 4px;
}

.ofc-attachment-remove:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

.ofc-emoji-picker {
  position: absolute;
  bottom: 52px;
  left: 20px;
  background: rgba(15, 23, 42, 0.98);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  padding: 6px 6px 4px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  z-index: 40;
}

.ofc-emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}

.ofc-emoji-item {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.ofc-emoji-item:hover {
  background: rgba(31, 41, 55, 0.9);
  transform: translateY(-1px);
}

.user-delete-btn {
  border-radius: 999px;
  border: 1px solid rgba(248, 113, 113, 0.5);
  background: transparent;
  color: #fca5a5;
  padding: 2px 10px;
  font-size: 11px;
  line-height: 1.2;
}

.user-delete-btn:hover {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.9);
  color: #fecaca;
}

.ofc-chat-hints {
  margin-top: 4px;
  font-size: 11px;
  color: #9ca3af;
  display: flex;
  gap: 10px;
}

@media (max-width: 991px) {
  .ofc-chat-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 220px minmax(0, 1fr);
    height: auto;
  }

  .ofc-sidebar {
    order: 1;
  }

  .ofc-chat-panel {
    order: 2;
    min-height: 55vh;
  }
}

