/* Professional account profile */

.sidebar__profile {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 11px;
    min-height: 68px;
}

.sidebar-profile-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.sidebar-profile-copy strong,
.sidebar-profile-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-profile-copy strong {
    font-size: 11px;
}

.sidebar-profile-copy span {
    color: var(--muted);
    font-size: 8px;
}

.avatar {
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    flex: 0 0 auto;
}

.avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.profile-menu {
    padding: 0;
    overflow: hidden;
    border-radius: 18px;
    box-shadow: 0 22px 55px #071a1252;
}

.profile-menu__identity {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    padding: 16px;
    background: linear-gradient(135deg, #f2f7f3, #fbfcf8);
    border-bottom: 1px solid var(--line);
}

.profile-menu__identity .avatar {
    width: 48px;
    height: 48px;
}

.profile-menu__identity > div:last-child {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.profile-menu__identity strong {
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-menu__identity span {
    color: var(--muted);
    font-size: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-menu__actions {
    padding: 7px;
}

.profile-menu .profile-link,
.profile-menu .language-switch,
.profile-menu .profile-menu-action,
.profile-menu .logout-button {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) 16px;
    align-items: center;
    gap: 9px;
    width: 100%;
    min-height: 42px;
    margin: 0;
    padding: 9px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    text-align: start;
    font-size: 10px;
}

.profile-menu .profile-link:hover,
.profile-menu .language-switch:hover,
.profile-menu .profile-menu-action:hover {
    background: var(--surface-soft);
}

.profile-menu .profile-menu-action {
    color: var(--text);
    cursor: pointer;
}

.profile-notification-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #d69b28;
    justify-self: center;
    box-shadow: 0 0 0 3px #d69b2820;
}

.profile-menu .logout-button {
    margin-top: 4px;
    border-top: 1px solid var(--line);
    border-radius: 0 0 10px 10px;
}

.profile-action-arrow {
    color: var(--muted);
    font-size: 10px;
}

.profile-page {
    display: grid;
    gap: 18px;
}

.profile-hero {
    position: relative;
    min-height: 108px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    overflow: hidden;
    padding: 20px 24px;
    border-radius: 14px;
    color: var(--action-primary-text);
    background: var(--action-primary);
    box-shadow: none;
}

.profile-hero__pattern {
    position: absolute;
    width: 420px;
    height: 420px;
    inset-inline-end: -100px;
    top: -250px;
    border: 70px solid #ffffff0b;
    border-radius: 50%;
    pointer-events: none;
}

.profile-identity {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.profile-identity h2 {
    margin: 3px 0 4px;
    font-size: var(--ui-title-size, clamp(20px, 2vw, 29px));
    line-height: 1.3;
}

.profile-identity p {
    margin: 0;
    color: inherit;
    direction: ltr;
    text-align: start;
}

.profile-eyebrow {
    color: #c2da75;
    font-size: 10px;
    font-weight: 800;
}

.profile-avatar {
    width: 88px;
    height: 88px;
    margin: 0;
    border: 4px solid #ffffffd9;
    background: #b8d269;
    color: #102117;
    box-shadow: 0 12px 32px #07150d55;
    font-size: 27px;
}

.new-request-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.new-request-button .bi {
    font-size: 15px;
    line-height: 1;
}

.profile-photo-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 17px;
    border: 1px solid #ffffff4d;
    border-radius: 12px;
    background: #ffffff14;
    color: inherit;
    backdrop-filter: blur(10px);
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
}

.profile-photo-button:hover {
    background: #ffffff24;
}

.profile-photo-button input {
    display: none;
}

.profile-upload-message {
    display: none;
    min-height: 42px;
    align-items: center;
    padding: 10px 14px;
    border-radius: 11px;
    font-size: 10px;
}

.profile-upload-message.is-loading,
.profile-upload-message.is-success,
.profile-upload-message.is-error {
    display: flex;
}

.profile-upload-message.is-loading {
    background: #eef3f0;
    color: #456154;
}

.profile-upload-message.is-success {
    background: #e7f5eb;
    color: #17643d;
}

.profile-upload-message.is-error {
    background: #fff0ee;
    color: #b34135;
}

.profile-content-grid {
    display: grid;
    align-items: start;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 12px;
}

.profile-panel {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: none;
}

.profile-panel__title {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.profile-panel__title > i {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: #edf5ef;
    color: var(--green);
    font-size: 18px;
}

.profile-panel__title h3 {
    margin: 0 0 4px;
    font-size: 15px;
}

.profile-panel__title p {
    margin: 0;
    color: var(--muted);
    font-size: 10px;
    font-weight: bold;
}

.profile-details {
    display: grid;
    margin: 0;
}

.profile-details > div {
    display: grid;
    grid-template-columns: minmax(120px, 0.4fr) minmax(0, 1fr);
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #edf1ee;
}

.profile-details > div:last-child {
    border-bottom: 0;
}

.profile-details dt {
    color: var(--muted);
    font-size: 12px;
}

.profile-details dd {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.profile-stat {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    margin: 12px 0;
    padding: 12px;
    border-radius: 14px;
    background: var(--surface-soft);
}

.profile-stat span {
    color: var(--muted);
    font-size: 12px;
}

.profile-stat strong {
    grid-row: span 2;
    font-size: 24px;
    color: var(--green);
}

.profile-stat small {
    font-size: 11px;
    color: var(--text);
}

.profile-role-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-role-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid #ccdccf;
    border-radius: 999px;
    color: #225a3c;
    background: #fbfdfb;
    font-size: 12px;
    font-weight: 700;
}

.profile-empty {
    color: var(--muted);
    font-size: 10px;
}

.signature-panel {
    grid-column: 1 / -1;
}

.signature-panel .profile-panel__title {
    align-items: center;
}

.signature-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-inline-start: auto;
    padding: 7px 10px;
    border-radius: 999px;
    background: #f3f4f2;
    color: #68736c;
    font-size: 15px;
    white-space: nowrap;
}

.signature-status.is-ready {
    background: #e6f4e9;
    color: #17643d;
}

.signature-workspace {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(260px, 0.75fr);
    gap: 14px;
    padding-top: 14px;
}

.signature-preview {
    min-height: 112px;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 12px;
    border: 1px dashed #bfcfc3;
    border-radius: 16px;
    background: linear-gradient(145deg, #fafcf9, #f1f5f1);
}

.signature-preview.has-signature {
    border-style: solid;
    background: var(--surface-soft);
}

.signature-preview img {
    display: block;
    max-width: min(100%, 360px);
    max-height: 120px;
    object-fit: contain;
    background: #f8faf8;
    padding: 8px;
    border-radius: 6px;
}

.signature-empty {
    display: grid;
    justify-items: center;
    gap: 7px;
    text-align: center;
    color: var(--muted);
}

.signature-empty i {
    font-size: 32px;
    color: #87a15b;
}

.signature-empty strong {
    color: var(--text);
    font-size: 11px;
}

.signature-empty span {
    font-size: 8px;
}

.signature-guidance {
    display: grid;
    align-content: center;
    gap: 13px;
}

.signature-guidance h4 {
    margin: 0;
    font-size: 12px;
}

.signature-guidance ul {
    display: grid;
    gap: 8px;
    margin: 0;
    padding-inline-start: 18px;
    color: var(--muted);
    font-size: 12px;
}

.signature-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.signature-actions label {
    cursor: pointer;
}

.signature-actions input {
    display: none;
}

.signature-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid #e1b9b4;
    border-radius: 10px;
    background: #fff;
    color: #ad4137;
    font: inherit;
    font-size: 11px;
    cursor: pointer;
}

.signature-delete:hover,
.signature-delete[data-armed='true'] {
    background: #fff0ee;
    border-color: #d57e73;
}

.signature-delete.hidden {
    display: none;
}

.signature-pad-panel {
    display: grid;
    gap: 14px;
    margin-top: 20px;
    padding: 18px;
    border: 1px solid #ccd8d0;
    border-radius: 16px;
    background: #f7faf7;
}

.signature-pad-panel.hidden {
    display: none;
}

.signature-pad-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.signature-pad-heading > div {
    display: grid;
    gap: 4px;
}

.signature-pad-heading strong {
    font-size: 11px;
}

.signature-pad-heading span {
    color: var(--text);
    font-size: 11px;
}

.signature-pad-heading > button {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: white;
    color: var(--text);
    cursor: pointer;
}

.signature-canvas-wrap {
    position: relative;
    height: 230px;
    overflow: hidden;
    border: 1px solid #b9c9bd;
    border-radius: 12px;
    background: white;
    box-shadow: inset 0 1px 4px #182b1e12;
}

.signature-canvas-wrap::after {
    content: '';
    position: absolute;
    inset-inline: 8%;
    bottom: 42px;
    border-bottom: 1px dashed #c6d1c8;
    pointer-events: none;
}

.signature-canvas-wrap canvas {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: crosshair;
}

.signature-canvas-wrap > span {
    position: absolute;
    inset-inline-start: 9%;
    bottom: 20px;
    color: #606a64;
    font-size: 11px;
    pointer-events: none;
}

.signature-pad-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 9px;
}

.signature-pad-actions button:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

html[data-theme='dark'] .profile-menu__identity,
html[data-theme='dark'] .profile-panel {
    background: var(--surface);
    border-color: var(--line);
}

html[data-theme='dark'] .profile-menu__identity {
    background: linear-gradient(135deg, #1b2a21, #20281d);
}

html[data-theme='dark'] .profile-menu .profile-link:hover,
html[data-theme='dark'] .profile-menu .language-switch:hover,
html[data-theme='dark'] .profile-menu .profile-menu-action:hover,
html[data-theme='dark'] .profile-stat,
html[data-theme='dark'] .profile-panel__title > i {
    background: var(--surface-soft);
}

html[data-theme='dark'] .profile-details > div {
    border-color: #ffffff12;
}

html[data-theme='dark'] .profile-role-chip {
    background: #1c2d23;
    border-color: #3b5947;
    color: #cae4d2;
}

html[data-theme='dark'] .signature-preview {
    background: var(--surface-soft);
    border-color: var(--line);
}

html[data-theme='dark'] .signature-preview.has-signature {
    background: var(--surface-soft);
}

html[data-theme='dark'] .signature-status {
    background: #26322b;
    color: #c6d0ca;
}

html[data-theme='dark'] .signature-status.is-ready {
    background: #153827;
    color: #9fe0b8;
}

html[data-theme='dark'] .signature-delete {
    background: transparent;
    border-color: #704a46;
    color: #efaaa2;
}

html[data-theme='dark'] .signature-pad-panel {
    background: var(--surface);
    border-color: var(--line);
}

html[data-theme='dark'] .signature-canvas-wrap {
    background: var(--control-bg);
    border-color: var(--line);
}

/* Improve on-screen ink contrast without changing the pixels saved as the signature. */
html[data-theme='dark'] .signature-canvas-wrap canvas {
    filter: brightness(2);
}

html[data-theme='dark'] .signature-canvas-wrap > span {
    color: var(--muted);
}

html[data-theme='dark'] .signature-pad-heading > button {
    background: #1d2a22;
    border-color: #425649;
}

@media (max-width: 900px) {
    .profile-content-grid {
        grid-template-columns: 1fr;
    }

    .signature-workspace {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .profile-hero {
        min-height: 218px;
        padding: 20px;
        align-items: stretch;
        flex-direction: column;
        justify-content: flex-end;
        gap: 15px;
    }

    .profile-identity {
        align-items: center;
        flex-direction: row;
        gap: 13px;
    }

    .profile-identity h2 {
        font-size: var(--ui-title-size, 20px);
    }

    .profile-avatar {
        width: 72px;
        height: 72px;
    }

    .profile-photo-button {
        width: 100%;
        box-sizing: border-box;
    }

    .profile-panel {
        padding: 18px;
    }

    .profile-details > div {
        grid-template-columns: 1fr;
        gap: 5px;
    }
}

@media (max-width: 760px) {
    .topbar__actions .new-request-button {
        order: 10;
        width: 100%;
        min-height: 42px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }
}

.ag-theme-quartz .ag-root-wrapper {
    border: 0;
}

@media (max-width: 760px) {
    .mvc-grid {
        height: 520px;
    }

    .settings-page .settings-grid {
        height: 510px;
    }

    .login-features {
        display: grid;
    }

    .app-shell.mobile-nav-open .sidebar {
        width: min(300px, 86vw) !important;
    }

    .app-shell[dir='rtl'].mobile-nav-open .sidebar {
        right: 0 !important;
        left: auto !important;
    }

    .app-shell[dir='ltr'].mobile-nav-open .sidebar {
        left: 0 !important;
        right: auto !important;
    }
}

@media print {
    .sidebar,
    .topbar,
    .page-title button,
    .settings-menu,
    .settings-toolbar .search,
    .settings-toolbar button {
        display: none !important;
    }

    .app-shell {
        display: block !important;
    }

    .app-shell > main {
        padding: 0 !important;
    }

    .settings-content,
    .workspace-card {
        border: 0 !important;
        box-shadow: none !important;
    }

    .mvc-grid,
    .settings-grid {
        height: auto !important;
    }

    .ag-root-wrapper {
        border: 0 !important;
    }
}

.profile-page {
    max-width: 1280px;
    margin-inline: auto;
}

.profile-content-grid .profile-details > div {
    grid-template-columns: 1fr;
    gap: 4px;
    padding-block: 10px;
}

@media (max-width: 1100px) {
    .profile-content-grid {
        grid-template-columns: 1fr 1fr;
    }

    .profile-security-panel {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .profile-content-grid {
        grid-template-columns: 1fr;
    }
}

@media screen {
    .profile-hero {
        min-height: 0;
        padding: 14px 20px;
        align-items: center;
        gap: 12px;
        border-radius: 14px;
    }

    .profile-avatar {
        width: 60px;
        height: 60px;
    }

    .profile-identity h2 {
        font-size: var(--ui-title-size, 20px);
    }

    .profile-eyebrow {
        display: none;
    }
}

/* Keep identity and photo actions readable at every width. */
.profile-page .profile-identity {
    flex: 1;
    min-width: 0;
}
.profile-page .profile-identity > div:last-child {
    min-width: 0;
}
.profile-page .profile-identity h2 {
    overflow-wrap: anywhere;
}
.profile-page .profile-identity p {
    overflow-wrap: anywhere;
    font-size: 12px;
}
.profile-photo-actions {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.profile-photo-actions input[hidden] {
    display: none !important;
}
.profile-photo-actions .profile-photo-button,
.profile-photo-actions #deleteProfileAvatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid currentColor;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}
.profile-photo-actions #deleteProfileAvatar[hidden] {
    display: none !important;
}
.profile-photo-actions .profile-photo-button:hover,
.profile-photo-actions #deleteProfileAvatar:hover {
    background: #ffffff18;
}
@media (max-width: 620px) {
    .profile-page .profile-hero {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px;
    }
    .profile-page .profile-identity {
        display: grid;
        grid-template-columns: 56px minmax(0, 1fr);
        gap: 12px;
    }
    .profile-page .profile-avatar {
        width: 56px;
        height: 56px;
        border-width: 2px;
        font-size: 22px;
    }
    .profile-page .profile-identity h2 {
        font-size: 17px;
        margin: 0 0 4px;
        line-height: 1.6;
    }
    .profile-photo-actions {
        width: 100%;
    }
    .profile-photo-actions > button {
        flex: 1;
        width: auto;
    }
    .profile-page .profile-panel {
        padding: 14px;
    }
    .profile-page .profile-details dd {
        overflow-wrap: anywhere;
    }
}

.profile-page .profile-photo-actions {
    align-items: stretch;
}
.profile-page .profile-upload-message {
    background: var(--surface-soft);
    color: var(--text);
}
@media (max-width: 620px) {
    .profile-page .profile-photo-actions .profile-photo-button,
    .profile-page .profile-photo-actions #deleteProfileAvatar {
        font-size: 11px;
        padding: 8px;
        min-width: 0;
        white-space: nowrap;
    }
}
