/* Shared spacing for company pages and notices, including full-width theme layouts. */
.ina-company-content,
.ina-company-reader-wrap {
    box-sizing: border-box;
    width: calc(100% - 32px);
    max-width: 1380px;
    min-width: 0;
    margin-right: auto;
    margin-left: auto;
}

.ina-company-content .card,
.ina-company-reader-wrap .alert {
    border-radius: 12px;
    margin-bottom: 20px;
}

.ina-company-content .card-body {
    padding: 24px;
    overflow-wrap: anywhere;
}

.ina-company-content .card-body > :last-child {
    margin-bottom: 0;
}

.ina-company-content .table-responsive {
    max-width: 100%;
    overflow-x: auto;
}

.ina-company-reader-wrap .alert {
    padding: 14px 18px;
    overflow-wrap: anywhere;
}

@media (max-width: 767px) {
    .ina-company-content .card-body {
        padding: 18px;
    }

    .ina-company-reader-wrap .alert {
        padding: 12px 16px;
    }
}

/* Use the theme's account icons and keep the organization label together. */
.ina-company-account-link,
.ina-company-account-link > .link-item {
    white-space: nowrap;
}

.ina-company-account-link > .link-item {
    display: inline-flex;
    align-items: center;
}

.ina-organization-title {
    white-space: nowrap;
    font-size: clamp(24px, 6vw, 48px);
}

/* Compact company context keeps the section navigation close to the page title. */
.ina-company-heading { margin: 24px 0 16px; overflow-wrap: anywhere; }
.ina-company-content .ina-company-heading h1 { margin: 0 0 8px; color: #0a4373; font-size: 30px; line-height: 1.2; }
.ina-company-heading .ina-company-identity,
.ina-company-heading .ina-company-identity strong,
.ina-company-heading .ina-company-document,
.ina-company-heading .ina-company-document strong {
    color: #526576;
    -webkit-text-fill-color: #526576;
}
.ina-company-heading .ina-company-identity { margin: 0 0 6px; font-size: 16px; line-height: 1.5; }
.ina-company-heading .ina-company-document { margin: 0; font-size: 14px; line-height: 1.5; }
.ina-company-heading .ina-company-heading-help { margin: 10px 0 0; }
@media (max-width: 767px) {
    .ina-company-heading { margin-top: 18px; }
    .ina-company-content .ina-company-heading h1 { font-size: 26px; }
}

/* Organization members: one control row on desktop, readable user cards on small screens. */
.ina-team-tabs { display: flex; gap: 4px; width: fit-content; max-width: 100%; padding: 3px; margin: 24px 0; border: 1px solid #cbdde8; border-radius: 999px; background: #f4f8fb; }
.ina-company-content .ina-team-tabs .ina-team-tab { display: flex; align-items: center; justify-content: center; min-height: 36px; padding: 6px 18px; border-radius: 999px; color: #0b5278; font-size: 14px; font-weight: 600; text-align: center; text-decoration: none; line-height: 1.3; }
.ina-company-content .ina-team-tabs .ina-team-tab:hover { background: #e4eff6; color: #083e5b; }
.ina-company-content .ina-team-tabs .ina-team-tab[aria-selected="true"] { background: #0b69a3; color: #fff; }
.ina-team-tabs .ina-team-tab:focus-visible { outline: 2px solid #0b69a3; outline-offset: 2px; }
[data-ina-team-tabs-root] [data-ina-team-panel] { scroll-margin-top: 160px; }
[data-ina-team-tabs-root] [data-ina-team-panel][hidden] { display: none !important; }
@media (max-width: 767px) {
    .ina-team-tabs { width: 100%; flex-wrap: wrap; border-radius: 24px; }
    .ina-company-content .ina-team-tabs .ina-team-tab { flex: 1 1 calc(50% - 4px); min-width: 0; padding: 10px 12px; border-radius: 20px; overflow-wrap: anywhere; }
}

.ina-team-users .ina-team-table {
    width: 100%;
    margin-bottom: 0;
}

.ina-team-users .ina-team-table td {
    vertical-align: middle;
    padding-top: 16px;
    padding-bottom: 16px;
}

/* Gris exacto del número RUC (#526576): encabezados y nombres en negrita; permiso normal. */
.ina-team-users .ina-team-table thead th,
.ina-team-users .ina-team-table th,
.ina-team-users .ina-team-table .ina-team-user-name {
    color: #526576 !important;
    -webkit-text-fill-color: #526576 !important;
    font-weight: 700;
}

.ina-team-users .ina-team-table .ina-team-permission {
    color: #526576 !important;
    -webkit-text-fill-color: #526576 !important;
    font-weight: 400;
}

.ina-team-user-name,
.ina-team-user-email {
    display: block;
}

.ina-team-user-email {
    margin-top: 4px;
    color: #878C8F;
}

.ina-team-users .ina-team-table .ina-access-form > .ina-status {
    flex: 0 0 auto;
}

/* Separador entre la última fila y el mensaje final */
.ina-team-users .card-body > p {
    margin: 0;
    padding-top: 16px;
    border-top: 1px solid #e5e9ed;
    color: #878C8F;
}

.ina-team-users .ina-team-member-form {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.ina-team-users .ina-team-member-form .form-control {
    flex: 0 0 auto;
    width: auto;
    padding-right: 36px;
    margin: 0;
}

.ina-team-users .ina-team-member-form .btn {
    flex: 0 0 auto;
    width: auto;
    margin: 0;
    white-space: nowrap;
}

.ina-team-users .ina-team-member-form .btn-secondary {
    color: #0a4373;
    background: #fff;
    border: 1px solid #d6e0e8;
}

.ina-team-users .ina-team-member-form .btn-secondary:hover {
    border-color: #0a4373;
    background: #f8fafc;
}

.ina-team-users .ina-team-member-form .btn:focus-visible {
    outline: 2px solid #009fe3;
    outline-offset: 2px;
}

.ina-team-mobile-label {
    display: none;
}

@media (max-width: 1100px) {
    .ina-team-users .ina-team-table,
    .ina-team-users .ina-team-table tbody {
        display: block;
    }

    /* Keep column headings available to assistive technology in the card layout. */
    .ina-team-users .ina-team-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .ina-team-users .ina-team-table tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "user" "status" "permission";
        gap: 12px;
        padding: 18px 0;
        border-top: 1px solid #e5e9ed;
    }

    .ina-team-users .ina-team-table td {
        display: block;
        min-width: 0;
        padding: 0;
        border: 0;
    }

    .ina-team-user { grid-area: user; }
    .ina-team-status { grid-area: status; }
    .ina-team-permission { grid-area: permission; }

    .ina-team-mobile-label {
        display: inline;
        color: #0a4373;
        font-weight: 600;
    }

    .ina-team-permission > .ina-team-mobile-label {
        display: block;
        margin-bottom: 8px;
    }

    .ina-team-users .ina-team-member-form {
        flex-direction: column;
        align-items: stretch;
    }

    .ina-team-users .ina-team-member-form .form-control,
    .ina-team-users .ina-team-member-form .btn {
        width: 100%;
        min-width: 0;
        white-space: normal;
    }
}

/* Reuse the shared form card inside the already inset organization container. */
.ina-company-content > .ina-form-card {
    width: 100%;
    max-width: none;
}

.ina-company-content .ina-invite-result {
    border-radius: 16px;
    overflow-wrap: anywhere;
}

.ina-company-content .ina-invite-result > label {
    display: block;
    margin-bottom: 8px;
    color: #0a4373;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-align: left;
}

.ina-company-content .ina-invite-copy {
    display: flex;
    gap: 8px;
    min-width: 0;
}

.ina-company-content #ina-invite-link {
    flex: 0 1 auto;
    min-width: 0;
    max-width: calc(100% - 56px);
    min-height: 48px;
    padding: 12px;
    font-size: 16px;
    line-height: 1.4;
    border-radius: 10px;
}

.ina-company-content #ina-invite-copy {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 10px;
}

.ina-company-content #ina-invite-link:focus-visible,
.ina-company-content #ina-invite-copy:focus-visible {
    outline: 2px solid #009fe3;
    outline-offset: 2px;
}

/* Keep the invitation action centered and sized to its label. */
.ina-invite-form .form-footer {
    text-align: center;
}

.ina-company-content .ina-invite-form .form-footer .btn {
    width: auto;
    max-width: 100%;
}

/* Let email use the remaining row width while permission fits its options. */
.ina-invite-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content max-content;
    align-items: end;
    gap: 16px;
    margin-bottom: 0;
}

.ina-invite-form .ina-invite-fields .form-group {
    min-width: 0;
    margin-bottom: 0;
}

.ina-invite-fields .form-control-label {
    display: block;
}

.ina-invite-fields .ina-invite-role .form-control {
    width: auto;
    max-width: 100%;
}

@media (max-width: 575px) {
    .ina-invite-fields {
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
        gap: 18px;
    }

    .ina-invite-fields .ina-invite-role .form-control {
        width: 100%;
    }
}

.ina-invite-form .ina-invite-fields .form-footer {
    padding-top: 0;
}

/* Round the open native picker where customizable selects are supported. */
@supports (appearance: base-select) {
    .ina-company-content :is(.ina-team-member-form, .ina-invite-form) select,
    .ina-company-content :is(.ina-team-member-form, .ina-invite-form) select::picker(select) {
        appearance: base-select;
    }

    .ina-company-content :is(.ina-team-member-form, .ina-invite-form) select {
        display: inline-flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        background-image: none;
    }

    .ina-company-content :is(.ina-team-member-form, .ina-invite-form) select::picker(select) {
        margin-block: 6px;
        padding: 4px;
        border: 1px solid #d6e0e8;
        border-radius: 10px;
        background: #f8fafc;
        color: #0a4373;
        box-shadow: 0 6px 24px rgba(10, 67, 115, 0.12);
    }

    .ina-company-content :is(.ina-team-member-form, .ina-invite-form) select option {
        min-height: 44px;
        padding: 10px 12px;
        border-radius: 6px;
        font-size: 16px;
        line-height: 1.4;
    }

    .ina-company-content :is(.ina-team-member-form, .ina-invite-form) select option:checked {
        background: #e5f4fb;
    }

    .ina-company-content :is(.ina-team-member-form, .ina-invite-form) select option:is(:hover, :focus) {
        background: #d9eef8;
        outline: none;
    }
}

/* Keep company identity and section headings consistent with shared forms. */
.ina-company-content > .card > .card-body > h2,
.ina-company-content > .card > .card-body > h3 {
    color: #0a4373;
}

/* Native notifications follow the same content margins on company pages. */
body:is(#module-inacompany-team, #module-inacompany-activate) #notifications .notifications-container {
    box-sizing: border-box;
    width: calc(100% - 32px);
    max-width: 1380px;
    padding: 0;
    margin-right: auto;
    margin-left: auto;
}

body#module-inacompany-activate #notifications .notifications-container { max-width: 560px; }

body:is(#module-inacompany-team, #module-inacompany-activate) #notifications .alert {
    border-radius: 12px;
    padding: 14px 18px;
    overflow-wrap: anywhere;
}

body:is(#module-inacompany-team, #module-inacompany-activate) #notifications .alert ul { margin-bottom: 0; }

.ina-status {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.ina-status-approved, .ina-status-used { color: #17603c; background: #e8f5ed; }
.ina-status-pending { color: #775000; background: #fff3d6; }
.ina-status-suspended, .ina-status-expired { color: #923b32; background: #fbece9; }
.ina-status-revoked { color: #465767; background: #edf1f5; }

.ina-state-help { display: block; max-width: 240px; margin-top: 8px; line-height: 1.5; }
.ina-team-users .ina-team-member-form .btn:disabled { opacity: 0.55; cursor: default; }

.ina-team-points .ina-points-people { list-style: none; margin: 0; padding: 0; }
.ina-team-points .ina-points-person { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; border-bottom: 1px solid #e5e7eb; }
.ina-team-points .ina-points-person:last-child { border-bottom: 0; }
.ina-team-points .ina-points-person-info { display: grid; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.ina-team-points .ina-points-person form { margin: 0; flex-shrink: 0; }
.ina-company-content .ina-team-points .btn { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.ina-company-content .ina-team-points .ina-points-revoke { background: #fff; border: 1px solid #b42318; color: #b42318; }
.ina-company-content .ina-team-points .ina-points-revoke:hover { background: #fff1f0; border-color: #912018; color: #912018; }
.ina-company-content .ina-team-points .ina-points-enable { background: #0b69a3; border: 1px solid #0b69a3; color: #fff; }
.ina-company-content .ina-team-points .ina-points-enable:hover { background: #085780; border-color: #085780; color: #fff; }
.ina-team-points .btn:focus-visible { outline: 2px solid #0b69a3; outline-offset: 3px; }
@media (max-width: 575px) {
    .ina-team-points .ina-points-person { align-items: stretch; flex-direction: column; }
    .ina-team-points .ina-points-person form, .ina-team-points .ina-points-person .btn { width: 100%; }
}
.ina-invitation-count { margin-top: 16px; }

.ina-confirm-dialog {
    width: calc(100% - 32px);
    max-width: 520px;
    max-height: calc(100% - 32px);
    padding: 24px;
    border: 1px solid #d6e0e8;
    border-radius: 16px;
    overflow: auto;
    overflow-wrap: anywhere;
    color: #0a4373;
    background: #fff;
    box-shadow: 0 12px 40px rgba(10, 67, 115, 0.2);
}

.ina-confirm-dialog:not([open]) { display: none; }
.ina-confirm-dialog::backdrop { background: rgba(10, 40, 65, 0.45); }
.ina-confirm-dialog h3 { color: #0a4373; font-size: 22px; }
.ina-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.ina-confirm-dialog .ina-dialog-actions .btn { width: auto; }

.ina-password-field { position: relative; }
.ina-company-activation .ina-password-field .form-control { padding-right: 56px; }
.ina-password-toggle {
    position: absolute;
    right: 1px;
    top: 1px;
    bottom: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    padding: 0 8px;
    border: 0;
    border-radius: 0 10px 10px 0;
    background: transparent;
    color: #0a4373;
    font-size: 0;
    cursor: pointer;
}
.ina-password-toggle::before {
    content: '\f06e';
    font-family: 'FontAwesome';
    font-size: 20px;
    font-weight: normal;
    line-height: 1;
}
.ina-password-toggle[aria-pressed="true"]::before { content: '\f070'; }
/* Match the login: retain one custom control and suppress Edge's native reveal. */
.ina-company-activation .ina-password-field input::-ms-reveal { display: none; }
.ina-company-activation .ina-password-field input::-ms-clear { display: none; }
.ina-password-toggle[hidden] { display: none; }
.ina-password-toggle:focus-visible { outline: 2px solid #009fe3; outline-offset: -4px; }

@media (max-width: 767px) {
    .ina-invitation-history table, .ina-invitation-history tbody { display: block; }
    .ina-invitation-history thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    .ina-invitation-history tbody tr { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 18px 0; border-top: 1px solid #e5e9ed; }
    .ina-invitation-history td { display: block; min-width: 0; padding: 0; border: 0; }
    .ina-invitation-history td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 6px; color: #0a4373; font-weight: 600; }
}

@media (max-width: 575px) {
    .ina-dialog-actions { flex-direction: column; align-items: stretch; }
    .ina-confirm-dialog .ina-dialog-actions .btn { width: 100%; }
}

.ina-invitation-history .ina-invitation-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 0;
    margin: 16px 0 0;
    list-style: none;
    font-size: 14px;
}
.ina-invitation-history .ina-invitation-pagination li { display: inline-flex; }
.ina-invitation-history .ina-invitation-pagination li > :is(a, span) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    font-size: 14px;
    font-weight: 500;
    text-indent: 0;
    white-space: nowrap;
    padding: 8px 12px;
    border: 1px solid #d6e0e8;
    border-radius: 10px;
    color: #0a4373;
    background: #fff;
    line-height: 1.4;
}
.ina-invitation-history .ina-invitation-pagination li.active > span { background: #0a4373; border-color: #0a4373; color: #fff; }
.ina-invitation-history .ina-invitation-pagination li.disabled > span { color: #657381; background: #f8fafc; }
.ina-invitation-history .ina-invitation-pagination a:focus-visible { outline: 2px solid #009fe3; outline-offset: 2px; }

/* Keep the footer at the viewport edge on short invitation pages. */
body#authentication #notifications .alert-warning:has(.ina-pending-access-notice) { background: #fff4e5; border-color: #eab676; color: #784500; }
body:is(#module-inacompany-activate, #module-inacompany-confirmtransfer) > main { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body:is(#module-inacompany-activate, #module-inacompany-confirmtransfer) > main > #header,
body:is(#module-inacompany-activate, #module-inacompany-confirmtransfer) > main > #footer { flex-shrink: 0; }
body:is(#module-inacompany-activate, #module-inacompany-confirmtransfer) > main > #wrapper { flex: 1 0 auto; }

/* One immediate, server-validated access control for Tienda and Puntos. */
.ina-team-search { max-width: 480px; margin: 20px 0 18px; }
.ina-company-content .ina-team-search label { display: block; float: none; width: 100%; margin-bottom: 7px; text-align: left; color: #0a4373; font-size: 14px; font-weight: 600; }
.ina-team-search-field { display: flex; align-items: center; min-height: 44px; border: 1px solid #cbdbe8; border-radius: 10px; background: #f7fafc; }
.ina-team-search-field:focus-within { border-color: #009fe3; box-shadow: 0 0 0 2px #009fe326; }
.ina-team-search-icon { padding-left: 12px; color: #0a4373; font-size: 24px; line-height: 1; }
.ina-team-search-field input { flex: 1 1 auto; min-width: 0; width: 100%; padding: 10px; border: 0; border-radius: 10px; outline: none; background: transparent; color: #0a4373; font: inherit; font-size: 14px; box-shadow: none; }
.ina-team-search-field input::-webkit-search-cancel-button { -webkit-appearance: none; }
.ina-team-search-clear { flex: 0 0 36px; min-height: 36px; margin-right: 3px; border: 0; border-radius: 8px; background: transparent; color: #0a4373; font-size: 24px; cursor: pointer; }
.ina-team-search-clear:focus-visible { outline: 2px solid #009fe3; }
.ina-team-search-result { margin: 5px 0 0; color: #657381; font-size: 13px; }
.ina-team-search-result:empty { display: none; }
.ina-team-search[hidden], .ina-team-search-clear[hidden], .ina-team-table tr[hidden] { display: none !important; }
.ina-team-table [data-ina-team-no-results] td { padding: 24px 12px; color: #657381; }
@media (max-width: 600px) { .ina-team-search { max-width: none; } .ina-team-search-field input { font-size: 16px; } }
.ina-access-form { display:flex; align-items:center; gap:10px; margin:0; }
/* Admin sin interruptor: alinear badge con Habilitado/Suspendido (52px switch + 10px gap). */
@media (min-width: 1101px) {
    .ina-team-status > .ina-status,
    .ina-team-status > .ina-state-help {
        margin-left: 62px;
    }
}
.ina-access-switch { position:relative; flex:0 0 52px; width:52px; height:30px; padding:3px; border:1px solid #8293a2; border-radius:20px; background:#d7e1e8; cursor:pointer; }
.ina-access-switch > span { display:block; width:22px; height:22px; border-radius:50%; background:#fff; box-shadow:0 1px 3px #0003; transform:translateX(0); transition:transform .15s ease; }
.ina-access-switch[aria-checked="true"] { background:#087fa8; border-color:#087fa8; }
.ina-access-switch[aria-checked="true"] > span { transform:translateX(22px); }
.ina-access-switch:focus-visible { outline:3px solid #e8a52f; outline-offset:3px; }
.ina-access-switch:disabled { opacity:.6; cursor:wait; }
@media(prefers-reduced-motion:reduce) { .ina-access-switch > span { transition:none; } }

/* Collaborator directory: aligned heading and search, with policy outside the card. */
.ina-team-users-header { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:24px; }
.ina-team-users-header h3 { margin:0; flex:0 0 auto; }
.ina-team-users-header .ina-team-search { flex:0 1 400px; min-width:0; margin:0; }
.ina-company-content .ina-team-users-header .ina-team-search label { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.ina-team-users-header .ina-team-search-icon { flex:0 0 20px; padding:0; margin-left:12px; color:#829ab1; }
.ina-team-users .ina-team-access-help { margin:24px 0 0; padding:0; color:#878c8f; line-height:1.6; }
.ina-team-users.card { background:transparent; border:0; box-shadow:none; }
.ina-team-users > .card-body { border:1px solid #dce5ee; border-radius:16px; background:#fff; }
.ina-team-empty td { padding:24px 12px; color:#657381; }
@media(max-width:767px) {
 .ina-team-users-header { flex-direction:column; align-items:stretch; gap:16px; }
 .ina-team-users-header .ina-team-search { flex:0 1 auto; width:100%; }
}

.ina-company-content .ina-team-users-header h3 { font-size:20px; line-height:1.3; color:#0a4373; }
.ina-company-content .ina-team-tabs { width:100%; }
.ina-company-content .ina-team-tabs .ina-team-tab { flex:1 1 0; }
