/* =====================================================================
   Client contact profile — iOS 26
   ---------------------------------------------------------------------
   The page a client's user sees as "My Profile" (and a team member sees
   as a contact's card): app/Views/clients/contacts/view.php.

   Two surfaces:

     .nz-cc-hero    a sober light material (no brand-blue block): the
                    avatar + identity on the left, and on the right an
                    iOS "inset grouped list" (.nz-cc-group) of the company
                    the person belongs to — every row a tappable action.
     .nz-cc-card    ONE card whose frosted top is the tab bar (the
                    platform's `nav-tabs bg-white title` strip, painted
                    by assets/scss/_tabs.scss) and whose body is the
                    selected tab. The tab views each bring their own
                    `.card border-top-0 rounded-top-0`, so that inner card
                    is flattened here into a section: a large plain title,
                    one line of help, the fields, the action row.

   Everything is scoped to `.nz-cc26` (set on #page-content in the view)
   because users/profile_image_section.php, users/account_settings.php
   and users/social_links.php are SHARED with team members and leads.

   Colours come from the shared --ios26-* tokens (assets/scss/_ios26.scss),
   which body.color-1E202D re-declares, so most of the dark theme costs
   nothing here. The exceptions carry `body.color-1E202D` + !important:
   assets/css/color/1E202D.css is injected at RUNTIME, after this file,
   and forces `.card*`, `.badge` and `.form-control` backgrounds.
   ===================================================================== */

.nz-cc26 {
    --cc-hero-1: #ffffff;
    --cc-hero-2: #eef1f6;
    --cc-avatar-ring: #f5f5f7;
    --cc-avatar-border: #ffffff;
    --cc-row-hover: rgba(17, 24, 39, 0.04);
    --cc-amber: #b45309;
    --cc-amber-soft: rgba(245, 158, 11, 0.14);
    --cc-amber-edge: rgba(245, 158, 11, 0.35);
    /* the row icon: deeper than --ios26-accent-strong so it clears 4.5:1 on the glass row */
    --cc-row-icon: #2f5fd6;
}

/* ================================================================ HERO */

.nz-cc26 .nz-cc-hero {
    position: relative;
    isolation: isolate;
    margin-bottom: 18px;
    border-radius: var(--ios26-radius-xl);
    overflow: hidden;
    background: linear-gradient(180deg, var(--cc-hero-1) 0%, var(--cc-hero-2) 100%);
    border: 1px solid var(--ios26-hairline);
    box-shadow: var(--ios26-inset), var(--ios26-shadow-1);
}

/* a whisper of the accent in the top-right corner, nothing more */
.nz-cc26 .nz-cc-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(58% 78% at 92% -14%, var(--ios26-accent-soft), transparent 62%),
        radial-gradient(50% 70% at 2% 112%, rgba(17, 24, 39, 0.03), transparent 60%);
}

.nz-cc26 .nz-cc-hero-inner {
    position: relative;
    z-index: 1;
    padding: 22px 22px 20px;
}

.nz-cc26 .nz-cc-hero .row {
    align-items: stretch;
}

/* ------------------------------------------------ identity (left column)
   users/profile_image_section.php — shared markup, restyled only here. */

.nz-cc26 .nz-cc-identity {
    display: flex;
    align-items: center;
}

.nz-cc26 .nz-cc-identity #profile-image-section {
    display: flex;
    align-items: center;
    gap: 22px;
    width: 100%;
    margin: 0;
    padding: 0;
}

.nz-cc26 #profile-image-section .box-content {
    display: block;
    padding: 0;
    border: 0;
}

/* `.box-content` is overflow:hidden; the camera badge sits past the avatar's
   right edge (and the ring casts a shadow), so this box must not clip */
.nz-cc26 #profile-image-section .profile-image {
    position: relative;
    flex: 0 0 auto;
    width: auto;
    overflow: visible !important;
    text-align: center;
}

.nz-cc26 #profile-image-section .box-content.pl15 {
    flex: 1 1 auto;
    min-width: 0;
    padding-left: 0 !important;
}

.nz-cc26 #profile-image-section .avatar-lg {
    display: inline-block;
    width: 132px;
    height: 132px;
    padding: 4px;
    border-radius: 50%;
    background: var(--cc-avatar-ring);
    border: 1px solid var(--ios26-hairline);
    box-shadow: 0 12px 26px -14px rgba(30, 40, 70, 0.35), inset 0 1px 0 #fff;
}

.nz-cc26 #profile-image-section .avatar-lg img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--cc-avatar-border);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.nz-cc26 #profile-image-section h4 {
    margin: 14px 0 0;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.2;
    color: var(--ios26-text);
}

/* the camera: one round glass badge on the avatar's shoulder. The
   direct 200x200 upload is the same action without the crop, so it is
   dropped here (markup untouched — leads keep both). */
.nz-cc26 .profile-image-direct-upload {
    display: none !important;
}

.nz-cc26 .profile-image-upload {
    position: absolute;
    top: 96px;
    left: calc(50% + 34px);
    z-index: 3;
    margin: 0 !important;
    padding: 0 !important;
}

.nz-cc26 .profile-image-upload .btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ios26-surface-strong) !important;
    border: 1px solid var(--ios26-edge);
    -webkit-backdrop-filter: var(--ios26-blur-sm);
    backdrop-filter: var(--ios26-blur-sm);
    box-shadow: var(--ios26-inset), 0 6px 16px -6px rgba(30, 40, 70, 0.35);
    transition: transform 0.15s var(--ios26-ease), box-shadow 0.15s var(--ios26-ease);
}

.nz-cc26 .profile-image-upload .btn:hover {
    transform: translateY(-1px);
}

.nz-cc26 .profile-image-upload .btn i {
    color: var(--ios26-accent-strong);
    font-size: 15px;
}

/* job title: a quiet neutral chip, never a blue badge */
.nz-cc26 #profile-image-section .badge.bg-info {
    display: inline-block;
    margin: 0 0 10px;
    padding: 5px 12px;
    border-radius: var(--ios26-pill);
    background: var(--ios26-fill) !important;
    border: 1px solid var(--ios26-hairline);
    color: var(--ios26-text) !important;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.nz-cc26 #profile-image-section .badge.bg-info strong {
    font-weight: 600;
}

.nz-cc26 #profile-image-section .p10.m0:not(.tm-contact) {
    padding: 0 !important;
}

/* email / phone: frosted pills that can wrap on a phone */
.nz-cc26 #profile-image-section p.tm-contact.p10 {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    max-width: 100%;
    margin: 0 8px 8px 0 !important;
    padding: 8px 14px !important;
    border-radius: var(--ios26-pill);
    background: var(--ios26-surface);
    border: 1px solid var(--ios26-edge);
    -webkit-backdrop-filter: var(--ios26-blur-sm);
    backdrop-filter: var(--ios26-blur-sm);
    box-shadow: var(--ios26-inset), 0 4px 10px -8px rgba(30, 40, 70, 0.3);
    color: var(--ios26-text);
    font-size: 13.5px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.nz-cc26 #profile-image-section .tm-contact i {
    flex: 0 0 auto;
    color: var(--ios26-muted);
}

.nz-cc26 #profile-image-section .tm-contact .mr15 {
    display: none;
}

/* social tiles */
.nz-cc26 #profile-image-section .clearfix.p10 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 6px !important;
}

.nz-cc26 #profile-image-section .clearfix.p10 .float-start {
    float: none;
}

.nz-cc26 #profile-image-section .social-icons-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nz-cc26 #profile-image-section .tm-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--ios26-surface);
    border: 1px solid var(--ios26-edge);
    color: var(--ios26-text);
    font-size: 16px;
    line-height: 1;
    text-decoration: none;
    -webkit-backdrop-filter: var(--ios26-blur-sm);
    backdrop-filter: var(--ios26-blur-sm);
    box-shadow: var(--ios26-inset), 0 4px 10px -7px rgba(30, 40, 70, 0.3);
    transition: transform 0.16s var(--ios26-ease), color 0.16s, border-color 0.16s, box-shadow 0.16s;
}

.nz-cc26 #profile-image-section .tm-social-link:hover,
.nz-cc26 #profile-image-section .tm-social-link:focus-visible {
    transform: translateY(-2px);
    color: var(--ios26-accent-strong);
    border-color: var(--ios26-accent-ring);
    outline: none;
}

.nz-cc26 #profile-image-section .tm-social-link:focus-visible {
    box-shadow: 0 0 0 3px var(--ios26-accent-ring);
}

.nz-cc26 #profile-image-section .tm-social-link svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
}

/* "Send message": the one filled accent action of the hero */
.nz-cc26 #profile-image-section .tm-btn-primary,
.nz-cc26 #profile-image-section .tm-btn-primary.btn-transparent {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 9px 18px;
    border-radius: var(--ios26-pill);
    background: var(--ios26-accent) !important;
    border: 0 !important;
    color: #fff !important;
    font-weight: 600;
    box-shadow: 0 8px 18px -8px var(--ios26-accent-strong);
    transition: transform 0.15s var(--ios26-ease), background 0.15s;
}

.nz-cc26 #profile-image-section .tm-btn-primary:hover {
    background: var(--ios26-accent-strong) !important;
    transform: translateY(-1px);
}

/* --------------------------------------------- the company (right column)
   An iOS inset grouped list: a small uppercase title above, then rows
   of icon tile + label/value + chevron, separated by hairlines. */

.nz-cc26 .nz-cc-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    min-width: 0;
}

.nz-cc26 .nz-cc-group-title {
    margin: 0 0 6px 14px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ios26-muted);
}

.nz-cc26 .nz-cc-group-list {
    border-radius: var(--ios26-radius-lg);
    background: var(--ios26-surface);
    border: 1px solid var(--ios26-edge);
    -webkit-backdrop-filter: var(--ios26-blur-sm);
    backdrop-filter: var(--ios26-blur-sm);
    box-shadow: var(--ios26-inset), 0 10px 26px -20px rgba(30, 40, 70, 0.4);
    overflow: hidden;
}

.nz-cc26 .nz-cc-row {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 56px;
    padding: 9px 14px 9px 12px;
    color: var(--ios26-text);
    text-decoration: none;
    border-top: 1px solid var(--ios26-hairline);
    transition: background 0.15s;
}

.nz-cc26 .nz-cc-row:first-child {
    border-top: 0;
}

.nz-cc26 a.nz-cc-row:hover,
.nz-cc26 a.nz-cc-row:focus-visible {
    background: var(--cc-row-hover);
    color: var(--ios26-text);
    text-decoration: none;
    outline: none;
}

.nz-cc26 a.nz-cc-row:focus-visible {
    box-shadow: inset 0 0 0 2px var(--ios26-accent-ring);
}

.nz-cc26 .nz-cc-row-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--ios26-accent-soft);
    color: var(--cc-row-icon);
    font-size: 15px;
}

.nz-cc26 .nz-cc-row-text {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
    gap: 1px;
}

.nz-cc26 .nz-cc-row-label {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--ios26-muted);
}

.nz-cc26 .nz-cc-row-value {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--ios26-text);
    overflow-wrap: anywhere;
}

.nz-cc26 .nz-cc-row-chevron {
    flex: 0 0 auto;
    font-size: 13px;
    color: var(--ios26-muted);
    opacity: 0.8;
}

.nz-cc26 a.nz-cc-row:hover .nz-cc-row-chevron {
    color: var(--ios26-accent-strong);
    opacity: 1;
}

/* staff-only: impersonate, an amber-tinted glass pill + one line of why */
.nz-cc26 .nz-cc-staff-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 14px;
    padding: 0 4px;
}

.nz-cc26 .nz-cc-btn-impersonate {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 8px 16px;
    border-radius: var(--ios26-pill);
    background: var(--cc-amber-soft) !important;
    border: 1px solid var(--cc-amber-edge) !important;
    color: var(--cc-amber) !important;
    font-weight: 600;
    box-shadow: var(--ios26-inset);
    transition: transform 0.15s var(--ios26-ease), background 0.15s;
}

.nz-cc26 .nz-cc-btn-impersonate:hover {
    background: rgba(245, 158, 11, 0.24) !important;
    transform: translateY(-1px);
}

.nz-cc26 .nz-cc-btn-impersonate i {
    font-size: 15px;
}

.nz-cc26 .nz-cc-staff-tools-hint {
    flex: 1 1 200px;
    min-width: 0;
    font-size: 12.5px;
    line-height: 1.35;
    color: var(--ios26-muted);
}

/* =============================================================== TABS
   One card. The bar is the platform's `nav-tabs bg-white title` strip,
   which _tabs.scss already paints as the frosted top of the card; here
   it only gets its icons sized and the card its outer shape. */

.nz-cc26 .nz-cc-card {
    border-radius: var(--ios26-radius-lg);
    border: 1px solid var(--ios26-hairline);
    box-shadow: var(--ios26-shadow-1);
    overflow: hidden;
}

.nz-cc26 .nz-cc-card > .nav-tabs {
    border: 0 !important;
    border-bottom: 1px solid var(--ios26-hairline) !important;
    border-radius: 0;
    box-shadow: none;
}

.nz-cc26 .nz-cc-card > .nav-tabs li a i[class*="fa-"] {
    margin-right: 6px;
    font-size: 14px;
    line-height: 1;
    vertical-align: -1px;
    color: var(--ios26-muted);
    transition: color 0.25s var(--ios26-ease);
}

.nz-cc26 .nz-cc-card > .nav-tabs li a.active i[class*="fa-"],
.nz-cc26 .nz-cc-card > .nav-tabs li a:hover i[class*="fa-"] {
    color: var(--ios26-accent-strong);
}

/* the tab views' own `.card border-top-0 rounded-top-0` becomes a plain
   section of the one card: no second border, no second shadow */
.nz-cc26 .nz-cc-card .tab-content .tab-content > form > .card,
.nz-cc26 .nz-cc-card .tab-content .tab-content > .card,
.nz-cc26 .nz-cc-card .tab-content > .tab-pane > form > .card,
.nz-cc26 .nz-cc-card .tab-content > .tab-pane > .card {
    margin: 0;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* section title: large and plain, with one line of help under it */
.nz-cc26 .nz-cc-card .tab-content .card-header {
    padding: 22px 26px 14px;
    background: transparent !important;
    border: 0 !important;
}

.nz-cc26 .nz-cc-card .tab-content .card-header h4 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--ios26-text);
}

.nz-cc26 .nz-cc-card .tab-content .card-header .nz-cc-help {
    margin: 6px 0 0;
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--ios26-muted);
}

.nz-cc26 .nz-cc-card .tab-content .card-body {
    padding: 6px 26px 16px;
    background: transparent !important;
}

/* the action row */
.nz-cc26 .nz-cc-card .tab-content .card-footer {
    padding: 14px 26px 20px;
    background: transparent !important;
    border: 0 !important;
    border-top: 1px solid var(--ios26-hairline) !important;
}

.nz-cc26 .nz-cc-card .tab-content .card-footer .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    border-radius: var(--ios26-pill);
    font-weight: 600;
}

/* the help / warning glyphs inside the sections: FA <i>, so a real size */
.nz-cc26 .nz-cc-card .tab-content i[class*="fa-"].icon-16,
.nz-cc26 .nz-cc-card .tab-content .btn i[class*="fa-"],
.nz-cc26 .nz-cc-card .tab-content .help i[class*="fa-"] {
    width: auto;
    height: auto;
    font-size: 15px;
    line-height: 1;
    vertical-align: -1px;
}

.nz-cc26 .nz-cc-card .tab-content .help i[class*="fa-"] {
    color: var(--ios26-muted);
}

/* the "pending confirmation" chip of a requested email change. GLOBAL on
   purpose: users/account_settings.php is shared with the team member
   profile, and the chip it replaced was white text on a yellow pill. */
.badge.nz-chip-warning {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #b45309;
    font-size: 12px;
    font-weight: 600;
}

body.color-1E202D .badge.nz-chip-warning {
    background: rgba(251, 191, 36, 0.14);
    border-color: rgba(251, 191, 36, 0.32);
    color: #fbbf24;
}

/* ============================================================ DARK MODE
   The runtime theme (assets/css/color/1E202D.css) wins every tie with
   !important, so the few surfaces it repaints are restated here. */

body.color-1E202D .nz-cc26 {
    --cc-hero-1: #2c2e39;
    --cc-hero-2: #23242e;
    --cc-avatar-ring: #33343f;
    --cc-avatar-border: rgba(255, 255, 255, 0.14);
    --cc-row-hover: rgba(255, 255, 255, 0.06);
    --cc-amber: #fbbf24;
    --cc-amber-soft: rgba(251, 191, 36, 0.14);
    --cc-amber-edge: rgba(251, 191, 36, 0.32);
}

body.color-1E202D .nz-cc26 .nz-cc-hero {
    border-color: rgba(255, 255, 255, 0.09);
    box-shadow: 0 22px 46px -28px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.color-1E202D .nz-cc26 #profile-image-section .avatar-lg {
    box-shadow: 0 12px 26px -14px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.color-1E202D .nz-cc26 {
    --cc-row-icon: #9db3ff;
}

/* 1E202D.css paints .text-off #898fa9 with !important — 4.13:1 on the card */
body.color-1E202D .nz-cc26 .nz-cc-card .tab-content .card-header .nz-cc-help {
    color: var(--ios26-muted) !important;
}

body.color-1E202D .nz-cc26 .nz-cc-card {
    border-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 18px 38px -30px rgba(0, 0, 0, 0.75);
}

body.color-1E202D .nz-cc26 .nz-cc-card .tab-content .card-header,
body.color-1E202D .nz-cc26 .nz-cc-card .tab-content .card-body,
body.color-1E202D .nz-cc26 .nz-cc-card .tab-content .card-footer {
    background: transparent !important;
}

body.color-1E202D .nz-cc26 .nz-cc-card .tab-content .card-header h4 {
    color: var(--ios26-text);
}

/* =========================================================== RESPONSIVE */

@media (max-width: 991.98px) {
    .nz-cc26 .nz-cc-hero-inner {
        padding: 18px 16px;
    }

    .nz-cc26 .nz-cc-side {
        margin-top: 18px;
    }
}

@media (max-width: 767.98px) {
    .nz-cc26 .nz-cc-hero {
        border-radius: var(--ios26-radius-lg);
    }

    /* the avatar goes on top, everything under it centred — the contact
       card layout every phone user already knows */
    .nz-cc26 .nz-cc-identity #profile-image-section {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        text-align: center;
    }

    /* profile_image_section.php strips .box-content on mobile; the
       identity column must still fill the width for the pills to centre */
    .nz-cc26 #profile-image-section > div {
        width: 100%;
        padding: 0 !important;
    }

    .nz-cc26 #profile-image-section .avatar-lg {
        width: 116px;
        height: 116px;
    }

    .nz-cc26 .profile-image-upload {
        top: 82px;
        left: calc(50% + 30px);
    }

    .nz-cc26 #profile-image-section .tm-contact {
        margin: 0 4px 8px !important;
    }

    .nz-cc26 #profile-image-section .clearfix.p10 {
        justify-content: center;
    }

    .nz-cc26 .nz-cc-card .tab-content .card-header {
        padding: 18px 18px 10px;
    }

    .nz-cc26 .nz-cc-card .tab-content .card-header h4 {
        font-size: 20px;
    }

    .nz-cc26 .nz-cc-card .tab-content .card-body {
        padding: 4px 18px 12px;
    }

    .nz-cc26 .nz-cc-card .tab-content .card-footer {
        padding: 12px 18px 18px;
    }
}
