/* Extracted from chat.html */

    .main-with-sidebar .chat-page-container {
      flex: 1;
      display: flex;
      min-height: 0;
      height: calc(100vh - var(--sidebar-header-height, 0px));
    }
    .chat-page-container {
      display: flex;
      flex: 1;
      height: 100vh;
      overflow: hidden;
    }
    .chat-sidebar {
      width: 320px;
      background: var(--surface);
      border-right: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      flex-shrink: 0;
    }
    .chat-sidebar-header {
      padding: 1.5rem;
      border-bottom: 1px solid var(--border);
    }
    .chat-sidebar-header h1 {
      font-size: 1.5rem;
      font-weight: 700;
      margin-bottom: 1rem;
    }
    .chat-search {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.75rem 1rem;
      background: var(--surface-2);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
    }
    .chat-search input {
      flex: 1;
      border: none;
      background: none;
      color: var(--text-main);
      font-size: 0.875rem;
    }
    .chat-search input:focus { outline: none; }
    .chat-list {
      flex: 1;
      overflow-y: auto;
      padding: 0.5rem;
    }
    .chat-list-item {
      display: flex;
      gap: 0.75rem;
      padding: 0.875rem;
      border-radius: var(--radius-lg);
      cursor: pointer;
      transition: background 0.2s;
      margin-bottom: 0.25rem;
    }
    .chat-list-item:hover { background: var(--surface-2); }
    .chat-list-item.active { background: var(--accent-light); }
    .chat-list-avatar {
      width: 48px;
      height: 48px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--accent), var(--accent-2));
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-weight: 600;
      flex-shrink: 0;
      position: relative;
    }
    .chat-list-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
    .chat-list-avatar .status-dot {
      position: absolute;
      bottom: 2px;
      right: 2px;
      width: 12px;
      height: 12px;
      border-radius: 50%;
      border: 2px solid var(--surface);
    }
    .chat-list-avatar .status-dot.online { background: var(--success); }
    .chat-list-avatar .status-dot.offline { background: var(--text-muted); }
    .chat-list-content { flex: 1; min-width: 0; }
    .chat-list-name-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 0.25rem;
    }
    .chat-list-name {
      font-weight: 600;
      font-size: 0.9rem;
      color: var(--text-main);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .chat-list-time {
      font-size: 0.75rem;
      color: var(--text-muted);
    }
    .chat-list-preview {
      font-size: 0.8rem;
      color: var(--text-secondary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .chat-list-badge {
      font-size: 0.7rem;
      padding: 0.125rem 0.5rem;
      border-radius: 10px;
      font-weight: 600;
    }
    .chat-list-badge.pending { background: var(--warning-light); color: var(--warning); }
    .chat-list-badge.accepted { background: var(--success-light); color: var(--success); }
    .chat-main {
      flex: 1;
      display: flex;
      flex-direction: column;
      min-width: 0;
    }
    .chat-header {
      display: flex;
      align-items: center;
      gap: 1rem;
      padding: 1rem 1.5rem;
      background: var(--surface);
      border-bottom: 1px solid var(--border);
    }
    .chat-header-avatar {
      width: 44px;
      height: 44px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--accent), var(--accent-2));
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-weight: 600;
    }
    .chat-header-info { flex: 1; }
    .chat-header-name { font-weight: 600; font-size: 1rem; }
    .chat-header-status { font-size: 0.8rem; color: var(--text-secondary); display: flex; align-items: center; gap: 0.25rem; }
    .chat-header-actions { display: flex; gap: 0.5rem; }
    .chat-messages {
      flex: 1;
      overflow-y: auto;
      padding: 1.5rem;
      display: flex;
      flex-direction: column;
      gap: 0.75rem;
    }
    .chat-empty {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      color: var(--text-muted);
    }
    .message-bubble {
      max-width: 70%;
      padding: 0.85rem 1.15rem;
      border-radius: 18px;
      position: relative;
      font-weight: 500;
      transition: all 0.3s var(--spring-easing);
    }
    .message-sent {
      align-self: flex-end;
      background: linear-gradient(135deg, #5c62fc 0%, #8b5cf6 100%);
      color: white;
      border-bottom-right-radius: 4px;
      box-shadow: 0 8px 24px rgba(92, 98, 252, 0.25), 0 2px 8px rgba(92, 98, 252, 0.15);
    }
    .message-received {
      align-self: flex-start;
      background: rgba(255, 255, 255, 0.04);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      border: 1px solid rgba(255, 255, 255, 0.08);
      color: var(--text-main);
      border-bottom-left-radius: 4px;
      box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }
    .message-text { font-size: 0.9rem; line-height: 1.4; }
    .message-meta { font-size: 0.7rem; margin-top: 0.25rem; opacity: 0.7; display: flex; justify-content: flex-end; gap: 0.5rem; align-items: center; }
    .message-date-divider {
      text-align: center;
      font-size: 0.75rem;
      color: var(--text-muted);
      padding: 0.5rem 0;
      margin: 0.5rem 0;
    }
    .chat-input-area {
      padding: 1rem 1.5rem;
      background: var(--surface);
      border-top: 1px solid var(--border);
      display: flex;
      gap: 0.75rem;
      align-items: flex-end;
    }
    .chat-input-area input {
      flex: 1;
      padding: 0.875rem 1rem;
      border-radius: var(--radius-lg);
      background: var(--surface-2);
      border: 1px solid var(--border);
      color: var(--text-main);
      font-size: 0.9rem;
    }
    .chat-input-area input:focus { outline: none; border-color: var(--accent); }
    .chat-btn {
      width: 44px;
      height: 44px;
      border-radius: 50%;
      border: none;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s;
    }
    .chat-btn-primary { background: var(--accent); color: white; }
    .chat-btn-primary:hover { transform: scale(1.05); }
    .chat-btn-ghost { background: var(--surface-2); color: var(--text-main); }
    .request-modal {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 2rem;
      text-align: center;
    }
    .request-modal-icon {
      width: 100px;
      height: 100px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--accent), var(--accent-2));
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 1.5rem;
    }
    .request-modal h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
    .request-modal p { color: var(--text-secondary); margin-bottom: 1.5rem; max-width: 400px; }
    .request-modal textarea {
      width: 100%;
      max-width: 400px;
      padding: 1rem;
      border-radius: var(--radius-lg);
      background: var(--surface-2);
      border: 1px solid var(--border);
      color: var(--text-main);
      font-size: 0.9rem;
      resize: none;
      margin-bottom: 1rem;
    }
    .request-modal textarea:focus { outline: none; border-color: var(--accent); }
    .request-sent-status {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 1rem;
    }
    .request-sent-status .icon { font-size: 4rem; color: var(--warning); animation: pulse 2s infinite; }
    .request-actions { display: flex; gap: 0.75rem; margin-top: 1rem; }
    .request-actions .btn { flex: 1; max-width: 180px; }
    .action-btn {
      width: 44px;
      height: 44px;
      border-radius: var(--radius-md);
      border: none;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s;
    }
    @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
    @media (max-width: 768px) {
      .chat-sidebar { 
        width: 100%;
        max-width: 100%;
        border-right: none;
      }
      .chat-main { 
        width: 100%; 
      }
      .chat-header {
         padding: 0.75rem 1rem;
      }
      .chat-messages {
         padding: 1rem;
      }
      .message-bubble {
         max-width: 85%;
      }
      .chat-input-area {
         padding: 0.75rem 1rem;
      }
    }
  