// =============================================================================
// Contacts App Styles
// =============================================================================

// -----------------------------------------------------------------------------
// Container
// -----------------------------------------------------------------------------

.contacts-container {
  display: flex;
  min-height: calc(100vh - 200px);
  background: var(--surface-color);
  border-radius: var(--bs-border-radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

// -----------------------------------------------------------------------------
// Sidebar
// -----------------------------------------------------------------------------

.contacts-sidebar {
  width: 260px;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.contacts-sidebar-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

// -----------------------------------------------------------------------------
// Navigation
// -----------------------------------------------------------------------------

.contacts-nav {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.contacts-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.25rem;
  color: var(--default-color);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.2s;

  i {
    font-size: 1.125rem;
    color: var(--muted-color);
    width: 20px;
    text-align: center;
  }

  span:first-of-type {
    flex: 1;
  }

  .badge {
    background: var(--background-color);
    color: var(--muted-color);
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }

  &:hover {
    background: var(--background-color);
    color: var(--heading-color);

    i {
      color: var(--accent-color);
    }
  }

  &.active {
    background: color-mix(in srgb, var(--accent-color), transparent 90%);
    color: var(--accent-color);

    i {
      color: var(--accent-color);
    }

    .badge {
      background: color-mix(in srgb, var(--accent-color), transparent 80%);
      color: var(--accent-color);
    }
  }
}

// -----------------------------------------------------------------------------
// Groups
// -----------------------------------------------------------------------------

.contacts-groups {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}

.contacts-groups-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-color);
}

.contacts-groups-add {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: none;
  background: none;
  color: var(--muted-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;

  &:hover {
    background: var(--background-color);
    color: var(--accent-color);
  }
}

.contacts-groups-list {
  display: flex;
  flex-direction: column;
}

.contacts-group-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 1.25rem;
  color: var(--default-color);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.2s;

  .badge {
    background: var(--background-color);
    color: var(--muted-color);
    font-weight: 500;
    font-size: 0.6875rem;
    padding: 0.125rem 0.375rem;
    margin-left: auto;
  }

  &:hover {
    background: var(--background-color);
  }

  &.active {
    background: color-mix(in srgb, var(--accent-color), transparent 90%);
    color: var(--accent-color);
  }
}

.contacts-group-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

// -----------------------------------------------------------------------------
// Tags
// -----------------------------------------------------------------------------

.contacts-tags {
  padding: 1rem 1.25rem;
}

.contacts-tags-header {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-color);
  margin-bottom: 0.75rem;
}

.contacts-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.contacts-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  background: var(--background-color);
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--muted-color);
  cursor: pointer;
  transition: all 0.2s;

  &:hover {
    background: color-mix(in srgb, var(--accent-color), transparent 90%);
    color: var(--accent-color);
  }
}

// -----------------------------------------------------------------------------
// Main Area
// -----------------------------------------------------------------------------

.contacts-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

// -----------------------------------------------------------------------------
// Header
// -----------------------------------------------------------------------------

.contacts-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.contacts-search {
  flex: 1;
  position: relative;
  max-width: 400px;

  i {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-color);
  }

  .form-control {
    padding-left: 2.5rem;
    background: var(--background-color);
    border-color: transparent;

    &:focus {
      background: var(--surface-color);
      border-color: var(--accent-color);
    }
  }
}

.contacts-view-toggle {
  display: flex;
  background: var(--background-color);
  border-radius: var(--bs-border-radius);
  padding: 2px;
}

.contacts-view-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  color: var(--muted-color);
  border-radius: var(--bs-border-radius);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;

  &:hover {
    color: var(--default-color);
  }

  &.active {
    background: var(--surface-color);
    color: var(--accent-color);
    box-shadow: var(--shadow-sm);
  }
}

// -----------------------------------------------------------------------------
// Grid View
// -----------------------------------------------------------------------------

.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;

  &::-webkit-scrollbar {
    width: 6px;
  }

  &::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
  }
}

// -----------------------------------------------------------------------------
// Contact Card
// -----------------------------------------------------------------------------

.contact-card {
  position: relative;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--bs-border-radius-lg);
  text-align: center;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;

  &:hover {
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--accent-color), transparent 90%);

    .contact-card-actions {
      opacity: 1;
    }
  }
}

.contact-card-body {
  padding: 1.5rem 1.5rem 0;
  cursor: pointer;
  flex: 1;
}

.contact-card-actions {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  left: 0.75rem;
  display: flex;
  justify-content: space-between;
  opacity: 0;
  transition: opacity 0.2s;
}

.contact-favorite {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--background-color);
  color: var(--muted-color);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;

  &:hover {
    background: var(--warning-color-light);
    color: var(--warning-color);
  }

  &.active {
    background: var(--warning-color-light);
    color: var(--warning-color);
    opacity: 1;
  }
}

.contact-menu {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--background-color);
  color: var(--muted-color);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;

  &:hover {
    background: var(--border-color);
    color: var(--default-color);
  }
}

.contact-card-avatar {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 1rem;

  img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
  }
}

.contact-avatar-initial {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
}

.contact-status {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--surface-color);

  &.online {
    background: var(--success-color);
  }

  &.away {
    background: var(--warning-color);
  }

  &.offline {
    background: var(--muted-color);
  }

  &.busy {
    background: var(--danger-color);
  }
}

.contact-card-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--heading-color);
  margin: 0 0 0.25rem;
}

.contact-card-role {
  font-size: 0.8125rem;
  color: var(--muted-color);
  margin: 0 0 0.125rem;
}

.contact-card-company {
  font-size: 0.75rem;
  color: var(--light-color);
  margin: 0 0 0.75rem;
}

.contact-card-tags {
  display: flex;
  justify-content: center;
  gap: 0.375rem;
  margin-bottom: 1rem;
}

.contact-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.1875rem 0.5rem;
  background: var(--background-color);
  border-radius: 20px;
  font-size: 0.6875rem;
  color: var(--muted-color);
}

.contact-card-info {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  margin-top: auto;
  border-top: 1px solid var(--border-color);
}

.contact-info-item {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--background-color);
  color: var(--muted-color);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  text-decoration: none;

  &:hover {
    background: var(--accent-color);
    color: var(--contrast-color);
  }
}

// -----------------------------------------------------------------------------
// List View
// -----------------------------------------------------------------------------

.contacts-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 1.25rem;

  &::-webkit-scrollbar {
    width: 6px;
  }

  &::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
  }
}

.contacts-table {
  margin: 0;

  th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted-color);
    background: var(--background-color);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
  }

  td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    font-size: 0.875rem;
    color: var(--default-color);
    border-bottom: 1px solid var(--border-color);
  }

  tr:hover td {
    background: var(--background-color);
  }
}

.contact-list-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;

  img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
  }
}

.contact-list-name {
  font-weight: 600;
  color: var(--heading-color);
}

.contact-list-role {
  font-size: 0.75rem;
  color: var(--muted-color);
}

.contact-list-actions {
  display: flex;
  gap: 0.25rem;

  .btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--muted-color);
    border-radius: var(--bs-border-radius);
    cursor: pointer;

    &:hover {
      background: var(--background-color);
      color: var(--accent-color);
    }

    &.text-danger:hover {
      background: var(--danger-color-light);
      color: var(--danger-color);
    }
  }
}

// -----------------------------------------------------------------------------
// Pagination
// -----------------------------------------------------------------------------

.contacts-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
}

.contacts-pagination-info {
  font-size: 0.8125rem;
  color: var(--muted-color);
}

// -----------------------------------------------------------------------------
// Add Contact Modal
// -----------------------------------------------------------------------------

.contact-avatar-upload {
  position: relative;
  display: inline-block;
}

.contact-avatar-preview {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--background-color);
  border: 2px dashed var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;

  i {
    font-size: 2.5rem;
    color: var(--muted-color);
  }

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

.contact-avatar-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-color);
  color: var(--contrast-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;

  &:hover {
    background: color-mix(in srgb, var(--accent-color), black 15%);
  }
}

// -----------------------------------------------------------------------------
// Contact Detail Modal
// -----------------------------------------------------------------------------

.contact-detail {
  padding: 0;
}

.contact-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.contact-detail-avatar {
  position: relative;
  flex-shrink: 0;

  img,
  .contact-avatar-initial {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
  }

  .contact-avatar-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 600;
  }

  .contact-status {
    width: 18px;
    height: 18px;
    bottom: 6px;
    right: 6px;
    border-width: 3px;
  }
}

.contact-detail-info {
  flex: 1;
  min-width: 0;
}

.contact-detail-name {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--heading-color);
  margin: 0 0 0.25rem;
}

.contact-detail-role {
  font-size: 0.9375rem;
  color: var(--muted-color);
  margin: 0 0 0.75rem;
}

.contact-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;

  .contact-tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
  }
}

.contact-detail-actions {
  display: flex;
  gap: 0.5rem;

  .btn {
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;

    i {
      font-size: 1.125rem;
    }
  }
}

.contact-detail-body {
  padding: 1.5rem 0 0;
}

.contact-detail-section {
  margin-bottom: 1.5rem;
}

.contact-detail-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-color);
  margin-bottom: 1rem;
}

.contact-detail-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.625rem 0;

  &:not(:last-child) {
    border-bottom: 1px solid var(--border-color-light);
  }
}

.contact-detail-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--background-color);
  color: var(--muted-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.contact-detail-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted-color);
  margin-bottom: 0.125rem;
}

.contact-detail-value {
  display: block;
  font-size: 0.875rem;
  color: var(--default-color);
  text-decoration: none;
  word-break: break-word;

  &:hover {
    color: var(--accent-color);
  }
}

// Quick Actions
.contact-detail-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.contact-quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--background-color);
  border-radius: var(--bs-border-radius-lg);
  color: var(--default-color);
  text-decoration: none;
  transition: all 0.2s;

  i {
    font-size: 1.25rem;
    color: var(--accent-color);
  }

  span {
    font-size: 0.8125rem;
  }

  &:hover {
    background: color-mix(in srgb, var(--accent-color), transparent 90%);
    color: var(--accent-color);
  }
}

// Notes
.contact-detail-notes {
  background: var(--background-color);
  border-radius: var(--bs-border-radius-lg);
  padding: 1rem;

  p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--default-color);
    line-height: 1.6;
  }
}

// Activity Timeline
.contact-activity-timeline {
  position: relative;
}

.contact-activity-item {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 0;
  position: relative;

  &:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 36px;
    bottom: -0.75rem;
    width: 2px;
    background: var(--border-color);
  }

  &:first-child {
    padding-top: 0;

    &::before {
      top: 36px;
    }
  }

  &:last-child {
    padding-bottom: 0;
  }
}

.contact-activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;

  i {
    font-size: 0.875rem;
  }
}

.contact-activity-content {
  flex: 1;
  min-width: 0;
  padding-top: 0.375rem;
}

.contact-activity-text {
  margin: 0 0 0.25rem;
  font-size: 0.875rem;
  color: var(--default-color);
}

.contact-activity-time {
  font-size: 0.75rem;
  color: var(--muted-color);
}

// -----------------------------------------------------------------------------
// Sidebar Toggle Button (hidden by default, shown under 1280px)
// -----------------------------------------------------------------------------

.contacts-sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--background-color);
  border: none;
  border-radius: 50%;
  color: var(--muted-color);
  font-size: 1.125rem;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;

  &:hover {
    background: var(--border-color);
    color: var(--default-color);
  }
}

// -----------------------------------------------------------------------------
// Sidebar Close Button (hidden by default)
// -----------------------------------------------------------------------------

.contacts-sidebar-close {
  display: none;
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 44px;
  height: 44px;
  padding: 0;
  background: color-mix(in srgb, var(--default-color), transparent 95%);
  border: none;
  border-radius: var(--bs-border-radius);
  color: var(--muted-color);
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10;

  &:hover {
    background: color-mix(in srgb, var(--danger-color), transparent 85%);
    color: var(--danger-color);
  }
}

// -----------------------------------------------------------------------------
// Sidebar Overlay (hidden by default)
// -----------------------------------------------------------------------------

.contacts-sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: color-mix(in srgb, var(--default-color), transparent 50%);
  z-index: 1040;
  opacity: 0;
  transition: opacity 0.3s ease;

  &.show {
    opacity: 1;
  }

  [data-theme="dark"] & {
    background: color-mix(in srgb, var(--default-color), transparent 30%);
  }
}

// -----------------------------------------------------------------------------
// Responsive - Under 1280px: Show toggle button, sidebar becomes slide-in panel
// -----------------------------------------------------------------------------

@media (max-width: 1279.98px) {
  // Show the toggle button in header
  .contacts-sidebar-toggle {
    display: flex;
  }

  // Show the overlay when sidebar is open
  .contacts-sidebar-overlay {
    display: block;
    pointer-events: none;

    &.show {
      pointer-events: auto;
    }
  }

  // Show the close button inside sidebar
  .contacts-sidebar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 10;
  }

  // Sidebar becomes slide-in panel
  .contacts-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 320px;
    height: 100vh;
    height: 100dvh;
    background: var(--surface-color);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    padding-top: 3.5rem;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform 0.3s ease;

    &.show {
      transform: translateX(0);
    }
  }

  // Prevent body scroll when sidebar is open
  body.contacts-sidebar-open {
    overflow: hidden;
  }
}

// -----------------------------------------------------------------------------
// Responsive
// -----------------------------------------------------------------------------

@media (max-width: 991.98px) {
  .contacts-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
  }
}

@media (max-width: 767.98px) {
  .contacts-container {
    min-height: calc(100vh - 180px);
  }

  .contacts-header {
    flex-wrap: wrap;
    gap: 0.5rem;

    .contacts-search {
      order: 3;
      width: 100%;
      max-width: none;
      margin-top: 0.5rem;
    }
  }

  .contacts-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    padding: 1rem;
    gap: 0.75rem;
  }

  .contact-card {
    padding: 0;
  }

  .contact-card-body {
    padding: 1rem 1rem 0;
  }

  .contact-card-avatar {
    width: 60px;
    height: 60px;
  }

  .contact-avatar-initial {
    width: 60px;
    height: 60px;
    font-size: 1.25rem;
  }

  .contact-card-info {
    padding: 0.75rem 1rem;
  }

  // Touch-friendly action buttons
  .contact-info-item {
    width: 44px;
    height: 44px;
  }

  .contacts-pagination {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }

  .contacts-table {
    th:nth-child(n+4),
    td:nth-child(n+4) {
      display: none;
    }
  }

  // Contact detail modal - full screen friendly
  .contact-detail-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .contact-detail-tags {
    justify-content: center;
  }

  .contact-detail-actions {
    margin-top: 1rem;

    .btn {
      width: 44px;
      height: 44px;
    }
  }

  .contact-detail-quick-actions {
    grid-template-columns: repeat(4, 1fr);
  }

  .contact-quick-action {
    padding: 0.75rem 0.5rem;
    min-height: 44px;

    span {
      font-size: 0.6875rem;
    }
  }
}

// Small phone breakpoint
@media (max-width: 575.98px) {
  .contacts-container {
    border-radius: 0;
    border-left: none;
    border-right: none;
    min-height: calc(100vh - 160px);
  }

  // Header
  .contacts-header {
    padding: 0.75rem;
    gap: 0.5rem;
  }

  .contacts-view-toggle {
    order: 2;
    margin-left: auto;
  }

  .contacts-view-btn {
    width: 44px;
    height: 44px;
  }

  // Grid view
  .contacts-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 0.75rem;
    gap: 0.5rem;
  }

  .contact-card-body {
    padding: 0.75rem 0.75rem 0;
  }

  .contact-card-avatar {
    width: 50px;
    height: 50px;
    margin-bottom: 0.75rem;
  }

  .contact-avatar-initial {
    width: 50px;
    height: 50px;
    font-size: 1rem;
  }

  .contact-card-name {
    font-size: 0.875rem;
  }

  .contact-card-role {
    font-size: 0.75rem;
  }

  .contact-card-company {
    display: none;
  }

  .contact-card-tags {
    display: none;
  }

  .contact-card-info {
    padding: 0.625rem 0.75rem;
    gap: 0.25rem;
  }

  .contact-info-item {
    width: 40px;
    height: 40px;
    font-size: 0.875rem;
  }

  // Always show card actions on mobile
  .contact-card-actions {
    opacity: 1;
  }

  .contact-favorite,
  .contact-menu {
    width: 36px;
    height: 36px;
  }

  // List view
  .contacts-list {
    padding: 0 0.75rem;
  }

  .contacts-table {
    th {
      padding: 0.625rem 0.75rem;
      font-size: 0.6875rem;
    }

    td {
      padding: 0.75rem;
      font-size: 0.8125rem;
    }

    // Hide more columns on very small screens
    th:nth-child(n+3),
    td:nth-child(n+3) {
      display: none;
    }
  }

  .contact-list-user {
    gap: 0.5rem;

    img {
      width: 36px;
      height: 36px;
    }
  }

  .contact-list-name {
    font-size: 0.8125rem;
  }

  .contact-list-role {
    font-size: 0.6875rem;
  }

  .contact-list-actions .btn-icon {
    width: 44px;
    height: 44px;
  }

  // Pagination
  .contacts-pagination {
    padding: 0.75rem;
  }

  .contacts-pagination-info {
    font-size: 0.75rem;
  }

  // Detail modal - optimized for full screen
  .contact-detail-header {
    padding: 1rem 0;
  }

  .contact-detail-avatar {
    img,
    .contact-avatar-initial {
      width: 80px;
      height: 80px;
    }

    .contact-avatar-initial {
      font-size: 1.5rem;
    }
  }

  .contact-detail-name {
    font-size: 1.25rem;
  }

  .contact-detail-role {
    font-size: 0.875rem;
  }

  .contact-detail-body {
    padding: 1rem 0 0;
  }

  .contact-detail-section {
    margin-bottom: 1rem;
  }

  .contact-detail-item {
    padding: 0.5rem 0;
    gap: 0.75rem;
  }

  .contact-detail-icon {
    width: 40px;
    height: 40px;
  }

  .contact-detail-label {
    font-size: 0.6875rem;
  }

  .contact-detail-value {
    font-size: 0.8125rem;
  }

  .contact-detail-quick-actions {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .contact-quick-action {
    padding: 1rem 0.75rem;
    min-height: 70px;

    i {
      font-size: 1.125rem;
    }

    span {
      font-size: 0.75rem;
    }
  }

  .contact-detail-notes {
    padding: 0.75rem;

    p {
      font-size: 0.8125rem;
    }
  }

  // Activity timeline
  .contact-activity-item {
    gap: 0.75rem;

    &:not(:last-child)::before {
      left: 16px;
    }
  }

  .contact-activity-icon {
    width: 32px;
    height: 32px;

    i {
      font-size: 0.75rem;
    }
  }

  .contact-activity-text {
    font-size: 0.8125rem;
  }

  .contact-activity-time {
    font-size: 0.6875rem;
  }

  // Add contact modal
  .contact-avatar-preview {
    width: 80px;
    height: 80px;

    i {
      font-size: 2rem;
    }
  }

  .contact-avatar-btn {
    width: 28px;
    height: 28px;
  }
}
