/* Trade Union SaaS - Companies & Company Profile Stylesheet */

.view-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
}

.view-title {
  font-size: clamp(20px, 2.2vw, 26px);
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.view-subtitle {
  font-size: clamp(12.5px, 1.1vw, 14px);
  color: var(--text-secondary);
}

.view-header-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Companies Grid */
.companies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: clamp(16px, 1.8vw, 22px);
  width: 100%;
  min-width: 0;
}

.company-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.company-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3B82F6, #8B5CF6);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.company-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-400);
}
.company-card:hover::before {
  opacity: 1;
}

.company-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.company-brand-badge {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.company-card:hover .company-brand-badge {
  transform: scale(1.08) rotate(3deg);
}

.company-card-title-wrap {
  flex: 1;
  min-width: 0;
}

.company-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.company-industry {
  font-size: 11.5px;
  color: var(--text-secondary);
  display: block;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.company-status-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

.company-status-tag.active {
  background: var(--emerald-subtle);
  color: #059669;
}
.company-status-tag.under-review {
  background: var(--amber-subtle);
  color: #d97706;
}
.company-status-tag.pending {
  background: var(--blue-subtle);
  color: var(--primary-600);
}

/* Company Stats Pill in Card */
.company-stats-pill {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  background: var(--bg-surface-hover);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 16px;
  border: 1px solid var(--border-subtle);
}

.comp-stat-item {
  text-align: center;
  min-width: 0;
}

.comp-stat-val {
  display: block;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
}

.comp-stat-lbl {
  font-size: 9.5px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.comp-stat-sep {
  width: 1px;
  height: 24px;
  background: var(--border-color);
  margin: 0 4px;
}

/* Details list */
.company-details-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.comp-detail-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.comp-detail-row svg {
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.comp-detail-row span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.text-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.company-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
  margin-top: auto;
  gap: 8px;
}

.card-footer-menu {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ==========================================
   COMPANY PROFILE VIEW
   ========================================== */
.profile-page-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  min-width: 0;
}

.profile-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.btn-back {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--primary-600);
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  transition: transform var(--transition-fast);
}
.btn-back:hover {
  text-decoration: underline;
  transform: translateX(-2px);
}

.breadcrumb-sep {
  color: var(--text-tertiary);
}

.breadcrumb-current {
  color: var(--text-primary);
  font-weight: 600;
}

.profile-hero-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: clamp(20px, 3vw, 28px) clamp(20px, 3.5vw, 32px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.profile-hero-left {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  flex: 1;
}

.profile-brand-box {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
}

.profile-hero-titles {
  min-width: 0;
  flex: 1;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.profile-title {
  font-size: clamp(20px, 2.2vw, 26px);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.profile-sub-details {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.profile-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* 3-Column Info Cards */
.profile-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: clamp(14px, 1.8vw, 20px);
  width: 100%;
}

.dossier-list {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13px;
}

.dossier-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.dossier-label {
  color: var(--text-secondary);
  font-weight: 500;
  flex-shrink: 0;
}

.dossier-value {
  color: var(--text-primary);
  text-align: right;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-actions-inline {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-input-sm .search-input {
  padding: 6px 12px 6px 32px;
  font-size: 12px;
}
.search-input-sm .search-icon {
  left: 8px;
}

@media (max-width: 768px) {
  .profile-hero-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .profile-hero-actions {
    width: 100%;
  }
  .profile-hero-actions .btn {
    flex: 1;
  }
}
