.profile {
  min-height: 100vh;
  background: var(--bg-primary);
  padding: 0;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.profile-header h1 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.profile-header h1 a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 800;
}

.profile-header__spacer {
  flex: 1;
}

.profile-content {
  padding: 24px;
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Cards */
.profile-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.profile-card h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
}

/* User info rows */
.profile-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.profile-row__label {
  color: var(--text-muted);
  min-width: 120px;
  font-size: 13px;
}

.profile-row__value {
  color: var(--text-primary);
  font-weight: 500;
}

/* Badge */
.profile-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.profile-badge--freelance { background: var(--bg-tertiary); color: var(--text-secondary); }
.profile-badge--teams { background: rgba(79, 140, 255, 0.15); color: var(--accent); }
.profile-badge--admin { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

/* Verified / not verified */
.profile-verified {
  color: var(--success);
  font-size: 13px;
  font-weight: 500;
}

.profile-unverified {
  color: var(--warning);
  font-size: 13px;
  font-weight: 500;
}

/* Inline edit */
.profile-edit-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-edit-row .input {
  flex: 1;
  padding: 6px 10px;
  font-size: 14px;
}

.profile-edit-row .btn {
  padding: 6px 14px;
  font-size: 13px;
}

/* Change password form */
.profile-pw-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-pw-form .form-group {
  margin-bottom: 0;
}

.profile-pw-form .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.profile-pw-form .btn {
  align-self: flex-start;
  margin-top: 4px;
}

/* Sessions table */
.profile-sessions-wrap {
  overflow-x: auto;
}

.profile-sessions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.profile-sessions-table th {
  text-align: left;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
}

.profile-sessions-table td {
  padding: 8px 12px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}

.profile-sessions-table tr:last-child td {
  border-bottom: none;
}

.profile-sessions-table tr:hover td {
  background: var(--bg-hover);
}

.profile-sessions-table .muted {
  color: var(--text-muted);
  font-size: 12px;
}

.profile-sessions-table .btn-revoke {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 4px;
  transition: all var(--transition);
}

.profile-sessions-table .btn-revoke:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.profile-current-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  background: rgba(79, 140, 255, 0.15);
  color: var(--accent);
  margin-left: 6px;
}

/* Messages */
.profile-msg {
  font-size: 13px;
  margin-top: 8px;
}

.profile-msg--success { color: var(--success); }
.profile-msg--error { color: var(--danger); }

/* Loading / denied states */
.profile-loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 14px;
}

.profile-denied {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 12px;
  color: var(--text-muted);
}

.profile-denied h2 {
  color: var(--text-primary);
  font-size: 24px;
}

.profile-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  margin: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: modal-in 0.2s ease-out;
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.modal__header h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.modal__close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
  transition: all var(--transition);
}

.modal__close:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.modal__body {
  padding: 20px 24px;
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 24px 20px;
}

@media (max-width: 640px) {
  .profile-content { padding: 16px; }
  .profile-row { flex-direction: column; align-items: flex-start; gap: 2px; }
  .profile-row__label { min-width: 0; }
  .profile-sessions-table { font-size: 12px; }
  .profile-sessions-table th, .profile-sessions-table td { padding: 6px 8px; }
}
