.profile-page {
    max-width: 520px;
    margin: 0 auto;
}

/* ── Card ── */
.profile-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
    overflow: hidden;
    margin-bottom: var(--space-md);
}

/* ── Header ── */
.profile-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 24px 20px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.profile-avatar-img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.profile-avatar-initials {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-card-header-info h2 {
    margin: 0 0 2px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-text-color);
}

.profile-card-header-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--secondary-text-color);
}

/* ── Rows ── */
.profile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
    cursor: default;
    transition: background 0.15s;
}

.profile-row:last-child {
    border-bottom: none;
}

.profile-row:hover {
    background: var(--first-layer-color);
}

.profile-row-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-text-color);
    flex-shrink: 0;
    min-width: 120px;
}

.profile-row-value {
    font-size: 0.9rem;
    color: var(--secondary-text-color);
    text-align: right;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-row-value.editable {
    cursor: text;
}

.profile-row-value input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.9rem;
    color: var(--primary-text-color);
    text-align: right;
    width: 100%;
    font-family: inherit;
}

.profile-row-value input::placeholder {
    color: #bbb;
}

.profile-row-value input:focus {
    color: var(--primary-color);
}

/* ── Section title ── */
.profile-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--secondary-text-color);
    padding: 0 24px;
    height: 40px;
    display: flex;
    align-items: center;
    background: var(--first-layer-color);
    border-bottom: 1px solid var(--border-color);
}

/* ── Save button ── */
.profile-save-btn {
    display: block;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    margin: 0;
    transition: background 0.2s, transform 0.15s;
}

.profile-save-btn:hover {
    background: var(--primary-color-hover);
    transform: translateY(-1px);
}

.profile-msg {
    font-size: var(--font-size-sm);
    min-height: 0;
    padding: 0;
}

.profile-msg.success {
    color: #27ae60;
}

.profile-msg.error {
    color: #e74c3c;
}

/* ── Danger row ── */
.profile-row-danger .profile-row-label {
    color: #e74c3c;
}

.profile-btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-align: right;
}

.profile-btn-link.danger {
    color: #e74c3c;
}

.profile-btn-link:hover {
    text-decoration: underline;
}

/* ── Stat rows ── */
.profile-stat-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-color);
}

@media (max-width: 576px) {
    .profile-row {
        padding: 14px 16px;
    }

    .profile-card-header {
        padding: 20px 16px;
    }

    .profile-section-title {
        padding: 12px 16px 4px;
    }

    .profile-save-btn {
        margin: 16px;
    }

    .profile-msg {
        padding: 0 16px 10px;
    }

    .profile-row-label {
        min-width: 90px;
        font-size: 0.88rem;
    }
}

.profile-row-icon {
    font-size: 1rem;
    color: var(--primary-color);
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.75;
}

.profile-row-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-text-color);
    flex-shrink: 0;
    min-width: 120px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-save-row {
    justify-content: flex-end;
    gap: 12px;
}

.profile-save-row .profile-msg {
    font-size: var(--font-size-sm);
    flex: 1;
    text-align: right;
}