﻿/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --system-bg-start: #667eea;
    --system-bg-end: #764ba2;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, var(--system-bg-start) 0%, var(--system-bg-end) 100%);
    min-height: 100vh;
}

body.header-stats-hidden .header-stats-left .header-stat,
body.header-stats-hidden .header-stats-right .header-stat {
    visibility: hidden;
    pointer-events: none;
}

.dev-environment-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0 0 12px;
    padding: 7px 14px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: 1px solid rgba(255, 237, 160, 0.7);
    color: #fffbeb;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.container {
    max-width: min(100%, 1680px);
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.double-y-wordmark {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    color: white;
    transform-origin: center center;
    animation:
        doubleYEntrance 1.2s ease-out both,
        doubleYFloat 5s ease-in-out 1.2s infinite;
}

.double-y-wordmark::before {
    content: '';
    position: absolute;
    inset: -14px -22px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.35) 0%, rgba(102, 126, 234, 0.2) 45%, transparent 72%);
    opacity: 0.55;
    z-index: 0;
    pointer-events: none;
    animation: doubleYGlow 3.5s ease-in-out infinite;
}

.double-y-wordmark::after {
    content: '';
    position: absolute;
    inset: -6px -10px;
    border-radius: 16px;
    background: linear-gradient(
        120deg,
        transparent 30%,
        rgba(255, 255, 255, 0.45) 50%,
        transparent 70%
    );
    background-size: 220% 100%;
    opacity: 0;
    z-index: 2;
    pointer-events: none;
    animation: doubleYSweep 4.5s ease-in-out 1.5s infinite;
}

.double-y-wordmark .double-y-name,
.double-y-wordmark .double-y-glyph {
    position: relative;
    z-index: 1;
}

.double-y-wordmark .double-y-name {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.06em;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(
        90deg,
        #ffffff 0%,
        #eef1ff 20%,
        #ffffff 40%,
        #ddd6fe 60%,
        #ffffff 80%,
        #eef1ff 100%
    );
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: doubleYShimmer 3.2s linear infinite;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.28));
}

.double-y-wordmark .double-y-glyph {
    width: 1rem;
    height: auto;
    filter: brightness(0) invert(1) drop-shadow(0 0 6px rgba(255, 255, 255, 0.55));
    animation: doubleYGlyphPulse 2.8s ease-in-out infinite;
}

.double-y-wordmark .double-y-glyph-bottom {
    animation-delay: 0.35s;
}

.double-y-wordmark--login {
    color: #222;
    background: #ffffff;
    padding: 12px 18px;
    border-radius: 14px;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(102, 126, 234, 0.12);
}

.double-y-wordmark--login::before {
    background: radial-gradient(circle, rgba(102, 126, 234, 0.18) 0%, rgba(118, 75, 162, 0.1) 50%, transparent 72%);
    opacity: 0.85;
}

.double-y-wordmark--login::after {
    background: linear-gradient(
        120deg,
        transparent 28%,
        rgba(102, 126, 234, 0.22) 50%,
        transparent 72%
    );
}

.double-y-wordmark--login .double-y-name {
    background: linear-gradient(
        90deg,
        #667eea 0%,
        #764ba2 25%,
        #667eea 50%,
        #764ba2 75%,
        #667eea 100%
    );
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 1px 2px rgba(102, 126, 234, 0.2));
}

.double-y-wordmark--login .double-y-glyph {
    filter: drop-shadow(0 0 4px rgba(102, 126, 234, 0.35));
}

@keyframes doubleYEntrance {
    0% {
        opacity: 0;
        transform: scale(0.82) translateY(12px);
    }
    70% {
        opacity: 1;
        transform: scale(1.04) translateY(-2px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes doubleYFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes doubleYGlow {
    0%, 100% {
        opacity: 0.45;
        transform: scale(0.96);
    }
    50% {
        opacity: 0.85;
        transform: scale(1.08);
    }
}

@keyframes doubleYShimmer {
    0% {
        background-position: 0% center;
    }
    100% {
        background-position: 220% center;
    }
}

@keyframes doubleYSweep {
    0%, 100% {
        opacity: 0;
        background-position: 180% center;
    }
    45% {
        opacity: 0.55;
        background-position: -20% center;
    }
}

@keyframes doubleYGlyphPulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        filter: brightness(0) invert(1) drop-shadow(0 0 4px rgba(255, 255, 255, 0.35));
    }
    50% {
        transform: scale(1.15) rotate(-3deg);
        filter: brightness(0) invert(1) drop-shadow(0 0 10px rgba(255, 255, 255, 0.85));
    }
}

.double-y-wordmark--settled {
    animation: none !important;
    transform: none;
}

.double-y-wordmark--settled::before,
.double-y-wordmark--settled::after {
    animation: none !important;
    opacity: 0;
}

.double-y-wordmark--settled .double-y-name {
    animation: none !important;
    background: none;
    -webkit-text-fill-color: currentColor;
    color: inherit;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

.double-y-wordmark--settled .double-y-glyph {
    animation: none !important;
    transform: none;
    filter: brightness(0) invert(1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.double-y-wordmark--login.double-y-wordmark--settled .double-y-name {
    background: linear-gradient(90deg, #667eea, #764ba2);
    background-size: 100% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: drop-shadow(0 1px 2px rgba(102, 126, 234, 0.2));
}

.double-y-wordmark--login.double-y-wordmark--settled .double-y-glyph {
    filter: drop-shadow(0 0 3px rgba(102, 126, 234, 0.25));
}

@media (prefers-reduced-motion: reduce) {
    .double-y-wordmark,
    .double-y-wordmark::before,
    .double-y-wordmark::after,
    .double-y-wordmark .double-y-name,
    .double-y-wordmark .double-y-glyph {
        animation: none !important;
    }

    .double-y-wordmark .double-y-name {
        -webkit-text-fill-color: currentColor;
        background: none;
        color: inherit;
    }
}

/* Legacy img logo (if used elsewhere) */
.double-y-logo {
    max-height: 80px;
    margin-bottom: 10px;
    filter: drop-shadow(0 8px 20px rgba(0,0,0,0.45));
    animation: doubleYLogoPulse 2s ease-in-out forwards;
    transform-origin: center center;
}

@keyframes doubleYLogoPulse {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 8px 20px rgba(0,0,0,0.45)) brightness(1);
    }
    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 16px 32px rgba(0,0,0,0.6)) brightness(1.3);
    }
    100% {
        transform: scale(1);
        filter: drop-shadow(0 8px 20px rgba(0,0,0,0.45)) brightness(1);
    }
}

.header-content > h1 {
    display: none;
}

.header .double-y-wordmark:not(.double-y-wordmark--login) {
    display: none !important;
}

.header-content > p.header-page-title,
.header-content > p.header-search-users-label,
.header-content > p:not(.logged-session-info):first-of-type {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 6px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    opacity: 1;
}

.header-content p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.logged-session-info {
    font-size: 0.98rem;
    font-weight: 600;
    opacity: 0.95;
    margin: 0 0 10px;
    position: relative;
    overflow: visible;
}

.logged-session-info i {
    margin-right: 4px;
    opacity: 0.88;
}

.logged-session-separator {
    margin: 0 8px;
    opacity: 0.75;
}

.logged-session-name {
    position: relative;
    display: inline-block;
}

.logged-session-name.has-photo {
    cursor: pointer;
}

.logged-session-photo-preview {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1200;
}

.logged-session-name.has-photo:hover .logged-session-photo-preview,
.logged-session-name.has-photo:focus-within .logged-session-photo-preview {
    opacity: 1;
    visibility: visible;
}

.logged-session-photo-preview img {
    display: block;
    width: 112px;
    height: 112px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
    background: #f4f6f8;
}

.header-actions {
    margin-top: 15px;
}

.header-actions .btn {
    margin: 0 5px;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.form-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    padding: 40px;
    width: 100%;
    max-width: 800px;
    margin: 20px 0;
}

.form-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.form-header h2 {
    color: #333;
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.form-header p {
    color: #666;
    font-size: 1rem;
}

.users-page .user-form-header {
    text-align: left;
}

.user-form-header-main {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-form-header-text {
    min-width: 0;
}

.user-header-photo-wrap {
    flex: 0 0 auto;
}

.user-header-photo-wrap[hidden],
.user-profile-photo-wrap[hidden],
.user-header-photo[hidden],
.user-field-photo[hidden],
.user-header-photo-initials[hidden],
.user-field-photo-initials[hidden] {
    display: none !important;
}

.user-header-photo,
.user-field-photo {
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #e1e5e9;
    background: #f4f6f8;
}

.user-header-photo-img,
.user-field-photo-img {
    display: block;
}

.user-header-photo,
.user-header-photo-initials {
    width: 72px;
    height: 72px;
}

.user-header-photo-initials,
.user-field-photo-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #667eea;
    background: linear-gradient(135deg, #eef1ff 0%, #f7f8ff 100%);
}

.user-header-photo-initials {
    font-size: 1.35rem;
}

.user-profile-photo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 4px;
}

.user-profile-photo-wrap[hidden] {
    display: none !important;
}

.user-profile-photo-wrap .user-field-photo,
.user-profile-photo-wrap .user-field-photo-initials {
    width: 96px;
    height: 96px;
}

.user-profile-photo-wrap .user-field-photo-initials {
    font-size: 1.5rem;
}

.user-field-photo,
.user-field-photo-initials {
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #e1e5e9;
    background: #f4f6f8;
}

.user-field-photo-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #667eea;
    background: linear-gradient(135deg, #eef1ff 0%, #f7f8ff 100%);
}

@media (max-width: 600px) {
    .user-form-header-main {
        align-items: flex-start;
    }

    .user-header-photo,
    .user-header-photo-initials {
        width: 60px;
        height: 60px;
    }
}

.brand-image-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.brand-image-wrap[hidden] {
    display: none !important;
}

.brand-image-img,
.brand-image-initials {
    border-radius: 12px;
    border: 2px solid #e1e5e9;
    background: #fff;
}

.brand-image-img {
    display: block;
    object-fit: contain;
    background: #fff;
}

.brand-image-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #667eea;
    background: linear-gradient(135deg, #eef1ff 0%, #f7f8ff 100%);
}

.brand-image-initials[hidden],
.brand-image-img[hidden] {
    display: none !important;
}

.brand-image--header .brand-image-img,
.brand-image--header .brand-image-initials {
    width: 72px;
    height: 72px;
}

.brand-image--header .brand-image-initials {
    font-size: 1.35rem;
}

.brand-image--table .brand-image-img,
.brand-image--table .brand-image-initials {
    width: 48px;
    height: 48px;
}

.brand-image--table .brand-image-initials {
    font-size: 0.95rem;
}

.brand-image--user .brand-image-img,
.brand-image--user .brand-image-initials {
    border-radius: 50%;
    object-fit: cover;
}

.search-users-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.search-users-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    background: #eef1ff;
    color: #4c5fd7;
}

.search-users-chip.is-active {
    background: #d4edda;
    color: #155724;
}

.search-users-chip.is-inactive {
    background: #f8d7da;
    color: #721c24;
}

.search-users-name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 180px;
}

.search-users-name-cell strong {
    color: #333;
    font-weight: 600;
}

.search-users-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.search-users-delete-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #f8f9fa;
    padding: 14px 16px;
    border-radius: 10px;
    margin-top: 14px;
}

.search-users-delete-card strong {
    display: block;
    color: #333;
}

.search-users-delete-card small {
    color: #666;
}

.company-form-header-main {
    display: flex;
    align-items: center;
    gap: 16px;
}

.company-form-header-text {
    min-width: 0;
}

.company-form-header-text p {
    margin: 8px 0 0;
    color: #666;
}

.company-logo-file-preview {
    margin-top: 12px;
    display: none;
}

.company-logo-file-preview img {
    width: 96px;
    height: 96px;
    object-fit: contain;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    padding: 8px;
    background: #fff;
}

.form-section-title {
    margin: 24px 0 12px;
    font-size: 1.05rem;
    color: #667eea;
    font-weight: 700;
}

.form-section-title:first-of-type {
    margin-top: 0;
}

.field-readonly {
    background: #f4f6f8 !important;
    color: #555;
    cursor: default;
}

.field-readonly:focus {
    outline: none;
    border-color: #e1e5e9;
    box-shadow: none;
}

.business-partner-page .filters-content .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 0;
}

.business-partner-page .filters-content .form-group.full-width {
    grid-column: 1 / -1;
}

@media (max-width: 700px) {
    .business-partner-page .filters-content .form-row {
        grid-template-columns: 1fr;
    }
}

.bp-session-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    margin-bottom: 20px;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8f9ff 0%, #f4f6f8 100%);
}

.bp-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: none;
    align-self: stretch;
    justify-content: flex-start;
}

.business-partner-page .main-content {
    width: 100%;
    max-width: none;
}

.business-partner-page .header-content--bp,
.header-content--bp {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.business-partner-page .bp-header-session,
.header-content--bp .bp-header-session {
    width: 100%;
    max-width: 760px;
    margin: 0 auto 4px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: none;
}

.business-partner-page .bp-header-session .bp-hero-label,
.header-content--bp .bp-header-session .bp-hero-label {
    color: rgba(255, 255, 255, 0.78);
}

.business-partner-page .bp-header-session .bp-hero-user-text strong,
.business-partner-page .bp-header-session .bp-hero-company-text strong,
.header-content--bp .bp-header-session .bp-hero-user-text strong,
.header-content--bp .bp-header-session .bp-hero-company-text strong {
    color: #fff;
}

.business-partner-page .bp-header-session .bp-hero-user-text span,
.header-content--bp .bp-header-session .bp-hero-user-text span {
    color: rgba(255, 255, 255, 0.88);
}

.business-partner-page .bp-header-session .bp-hero-divider,
.header-content--bp .bp-header-session .bp-hero-divider {
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.45), transparent);
}

.business-partner-page .bp-header-session[hidden],
.header-content--bp .bp-header-session[hidden] {
    display: none !important;
}

.bp-page-wide {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bp-hero-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid #dfe3f0;
    background: linear-gradient(135deg, #ffffff 0%, #f5f7ff 55%, #eef2ff 100%);
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.07);
    text-align: left;
}

.bp-hero-user,
.bp-hero-company {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    min-width: 0;
    width: auto;
    flex: 0 1 auto;
}

.bp-hero-user-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 2px;
    min-width: 0;
    width: auto;
}

.bp-hero-company-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
}

.bp-hero-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #7b86a8;
}

.bp-hero-user-text strong,
.bp-hero-user-text .session-user-role {
    font-size: 1.12rem;
    font-weight: 700;
    color: #2d3142;
    line-height: 1.2;
    text-align: center;
    display: block;
    width: 100%;
}

.bp-hero-user-text .session-user-role {
    display: block;
}

.bp-hero-company-text strong {
    font-size: 1rem;
    color: #2d3142;
    line-height: 1.2;
}

.bp-hero-user-text .bp-hero-label {
    display: none !important;
}

.bp-hero-user-text span {
    color: #667085;
    word-break: break-word;
}

.bp-hero-divider {
    width: 1px;
    height: 44px;
    background: linear-gradient(180deg, transparent, #d5dbef, transparent);
    flex-shrink: 0;
}

.brand-image--hero-user .brand-image-img,
.brand-image--hero-user .brand-image-initials {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.brand-image--hero-company .brand-image-img,
.brand-image--hero-company .brand-image-initials {
    width: 44px;
    height: 44px;
    border-radius: 10px;
}

.bp-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    align-items: stretch;
}

.bp-form-card,
.bp-list-card {
    margin: 0;
    width: 100%;
}

.bp-form-body {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.bp-fields-panel .form-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 1100px) {
    .bp-fields-panel .form-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.bp-form-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.bp-form-header p {
    margin: 6px 0 0;
    color: #667085;
    font-size: 0.95rem;
}

.bp-mode-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fff3cd;
    color: #856404;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.bp-section-help {
    margin: 0 0 12px;
    color: #667085;
    font-size: 0.92rem;
}

.bp-fields-panel--full {
    width: 100%;
}

.bp-form-section {
    border: 1px solid #e4e7ec;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 18px;
    background: #fff;
}

.bp-form-section h3 {
    margin: 0 0 14px;
    font-size: 1rem;
    color: #344054;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bp-readonly-field {
    padding: 10px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #f9fafb;
    color: #344054;
    font-weight: 600;
    min-height: 42px;
    display: flex;
    align-items: center;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.82rem;
    color: #667085;
}

.customer-save-dialog {
    z-index: 5000;
}

.customer-save-dialog.modal.show,
.customer-save-dialog.modal[aria-hidden="false"] {
    display: block !important;
}

.customer-save-dialog .modal-content .modal-header.success {
    background: linear-gradient(135deg, #27ae60, #2ecc71) !important;
    color: #fff !important;
}

.customer-save-dialog .modal-content .modal-header.error {
    background: linear-gradient(135deg, #e74c3c, #c0392b) !important;
    color: #fff !important;
}

.customer-details-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px 16px;
    align-items: end;
}

.customer-details-grid .form-group {
    min-width: 0;
    margin: 0;
}

.customer-details-grid .form-group label {
    display: block;
    margin-bottom: 6px;
}

.customer-details-grid input,
.customer-details-grid select {
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 1100px) {
    .customer-details-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .customer-details-grid {
        grid-template-columns: 1fr;
    }
}

.customer-address-section .customer-address-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 14px;
}

.customer-address-section .customer-address-pair-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.customer-address-section .customer-address-pair-row .form-group {
    min-width: 0;
    margin: 0;
}

.customer-address-section .customer-address-pair-row .form-group label {
    display: block;
    margin-bottom: 6px;
}

.customer-address-section .customer-address-pair-row input,
.customer-address-section .customer-address-pair-row select {
    width: 100%;
    box-sizing: border-box;
}

.customer-city-state-post-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
    align-items: end;
    width: 100%;
}

.customer-city-state-post-row .form-group {
    min-width: 0;
    margin: 0;
}

.customer-city-state-post-row .form-group label {
    display: block;
    margin-bottom: 6px;
}

.customer-city-state-post-row input,
.customer-city-state-post-row select {
    width: 100%;
    box-sizing: border-box;
}

.customer-post-country-map {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

.customer-post-country-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
    align-items: end;
    max-width: 28rem;
}

.customer-field-compact {
    width: 100%;
    max-width: none;
    margin: 0;
}

.customer-field-compact label {
    display: block;
    margin-bottom: 6px;
}

.customer-field-compact input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.customer-address-map-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: 100%;
}

.customer-address-map-panel--full {
    width: 100%;
}

.customer-address-map-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.customer-address-map-toolbar .form-hint {
    margin: 0;
    text-align: left;
}

.customer-address-map,
.customer-address-map.leaflet-container {
    width: 100% !important;
    max-width: none;
    height: 340px !important;
    min-height: 340px;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    overflow: hidden;
    background: #dbe4ee;
    position: relative;
    z-index: 1;
}

.customer-address-map .leaflet-container,
.customer-address-map .leaflet-pane,
.customer-address-map .leaflet-map-pane {
    width: 100%;
    height: 100%;
    font: inherit;
}

.customer-address-map img.leaflet-tile,
.customer-address-map .leaflet-tile-pane img,
.customer-address-map .leaflet-marker-pane img,
.customer-address-map .leaflet-shadow-pane img {
    max-width: none !important;
    max-height: none !important;
    width: auto !important;
    height: auto !important;
}

.customer-address-map .leaflet-control-zoom {
    border: 0;
    box-shadow: 0 1px 4px rgba(16, 24, 40, 0.18);
}

.customer-address-map .leaflet-control-zoom a {
    width: 28px;
    height: 28px;
    line-height: 28px;
    font-size: 16px;
    color: #344054;
    background: #fff;
}

.customer-map-marker {
    background: transparent;
    border: 0;
}

.customer-map-pin {
    display: block;
    width: 20px;
    height: 20px;
    margin: 0 auto;
    background: #2563eb;
    border: 2px solid #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 1px 4px rgba(16, 24, 40, 0.35);
}

@media (max-width: 900px) {
    .customer-address-section .customer-address-pair-row {
        grid-template-columns: 1fr;
    }

    .customer-city-state-post-row {
        grid-template-columns: 1fr;
    }

    .customer-post-country-map {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .customer-post-country-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: none;
    }

    .customer-field-compact {
        max-width: none;
    }

    .customer-address-map,
    .customer-address-map.leaflet-container {
        max-width: 100%;
        height: 300px !important;
        min-height: 300px;
    }
}

@media (max-width: 560px) {
    .customer-city-state-post-row,
    .customer-post-country-fields {
        grid-template-columns: 1fr;
    }
}

.bp-availability-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.9fr);
    gap: 16px;
    align-items: start;
}

.bp-weekday-checks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
    min-height: 148px;
}

.bp-weekday-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    line-height: 1.35;
    color: #344054;
    font-size: 0.92rem;
    font-weight: 400;
    cursor: pointer;
    user-select: none;
}

.bp-weekday-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    margin: 3px 0 0;
    padding: 0;
    border: 1px solid #d0d5dd;
    border-radius: 4px;
    background: #fff;
    box-shadow: none;
    transition: none;
    flex: 0 0 16px;
    appearance: auto;
    -webkit-appearance: checkbox;
}

.bp-weekday-item input[type="checkbox"]:focus {
    outline: 2px solid rgba(102, 126, 234, 0.35);
    outline-offset: 1px;
    border-color: #667eea;
    box-shadow: none;
    background: #fff;
}

.bp-weekday-item span {
    display: block;
    flex: 1;
}

.bp-availability-note label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.88rem;
    color: #344054;
    font-weight: 600;
}

#contactAvailability-error {
    display: block;
    min-height: 1.2rem;
    margin-top: 5px;
}

@media (max-width: 768px) {
    .bp-availability-layout {
        grid-template-columns: 1fr;
    }

    .bp-weekday-checks {
        grid-template-columns: 1fr;
    }
}

.bp-photo-center {
    display: flex;
    justify-content: flex-start;
    margin: 0 0 18px;
    width: 100%;
}

.bp-photo-center .bp-photo-panel--inline {
    width: 3cm;
    max-width: 3cm;
}

.bp-photo-center .bp-photo-dropzone {
    width: 3cm;
    height: 4cm;
    min-height: 4cm;
    max-height: 4cm;
    box-sizing: border-box;
    border-radius: 8px;
    padding: 0;
}

.bp-photo-center .bp-photo-preview-wrap {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    margin: 0;
}

.bp-photo-center .bp-photo-preview-wrap img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    border: 0;
    border-radius: 0;
    display: block;
}

.bp-photo-center .bp-photo-placeholder {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    justify-content: center;
    padding: 6px;
    gap: 4px;
    font-size: 0.72rem;
}

.bp-photo-center .bp-photo-placeholder i {
    font-size: 1rem;
}

.bp-photo-center .bp-photo-placeholder small {
    font-size: 0.62rem;
    line-height: 1.2;
}

.bp-form-section h4 {
    margin: 0 0 12px;
    font-size: 0.95rem;
    color: #475467;
}

.bp-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px 14px;
}

.bp-checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.92rem;
    color: #344054;
}

.bp-checkbox-item input[type="checkbox"] {
    margin-top: 3px;
    padding: 0;
    border: 1px solid #d0d5dd;
    border-radius: 4px;
    background: #fff;
    box-shadow: none;
    transition: none;
    width: 16px;
    height: 16px;
    min-width: 16px;
    flex: 0 0 16px;
}

.bp-checkbox-item input[type="checkbox"]:focus {
    outline: 2px solid rgba(102, 126, 234, 0.35);
    outline-offset: 1px;
    box-shadow: none;
    background: #fff;
}

.bp-upload-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bp-upload-preview {
    font-size: 0.85rem;
    color: #027a48;
}

.bp-photo-panel--inline {
    max-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@media (max-width: 768px) {
    .bp-checkbox-grid {
        grid-template-columns: 1fr;
    }
}

.bp-exchange-section {
    background: #f8fafc;
}

.bp-exchange-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.bp-form-body--application {
    grid-template-columns: 1fr;
}

.bp-form-card.is-editing {
    border-color: #f0d78c;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.12);
}

.bp-photo-dropzone {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    border: 2px dashed #c9d2ef;
    border-radius: 14px;
    background: #f8f9ff;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
    position: relative;
    overflow: hidden;
}

.bp-photo-dropzone:hover,
.bp-photo-dropzone:focus-within {
    border-color: #667eea;
    background: #f1f4ff;
}

.bp-photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    text-align: center;
    color: #667085;
}

.bp-photo-placeholder i {
    font-size: 1.6rem;
    color: #667eea;
}

.bp-photo-placeholder small {
    font-size: 0.78rem;
    color: #98a2b3;
}

.bp-photo-preview-wrap {
    width: 100%;
    height: 100%;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.bp-photo-preview-wrap img {
    width: 100%;
    max-width: 160px;
    max-height: 180px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid #e1e5e9;
}

.bp-form-actions {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #edf0f5;
    flex-wrap: wrap;
}

.bp-list-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #667085;
    font-weight: 600;
}

.bp-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    color: #667eea;
    font-weight: 600;
}

.search-users-cell-user {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.search-users-cell-user span {
    font-weight: 600;
    color: #333;
}

.bp-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1200;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 12px;
    background: #1f7a43;
    color: #fff;
    box-shadow: 0 12px 30px rgba(31, 122, 67, 0.28);
    font-weight: 600;
    animation: bp-toast-in 0.25s ease;
}

.bp-toast i {
    font-size: 1.1rem;
}

@keyframes bp-toast-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bp-session-user {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.bp-session-user-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.bp-session-user-text strong {
    font-size: 1.05rem;
    color: #333;
}

.bp-session-user-text span {
    color: #666;
    font-size: 0.95rem;
    word-break: break-word;
}

.bp-session-company {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: #667eea;
    text-align: right;
    flex-shrink: 0;
}

.bp-photo-preview {
    margin-top: 10px;
}

.bp-photo-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    border: 2px solid #e1e5e9;
}

@media (max-width: 700px) {
    .bp-session-banner {
        flex-direction: column;
        align-items: flex-start;
    }

    .bp-session-company {
        text-align: left;
    }

    .bp-hero-card {
        flex-wrap: wrap;
        max-width: 100%;
        padding: 12px 14px;
        gap: 12px;
    }

    .bp-hero-divider {
        display: none;
    }

    .bp-hero-user,
    .bp-hero-company {
        flex: 1 1 100%;
    }

    .bp-form-body {
        grid-template-columns: 1fr;
    }
}

#rootCompanyMount:empty {
    display: none;
}

#adminCompanySection[hidden],
#sessionContextBanner.bp-session-hidden,
#bpToast[hidden],
#contactsLoading[hidden],
#searchLoading[hidden],
#contactPhotoPreview[hidden],
#formModeBadge[hidden] {
    display: none !important;
}

.bp-root-company-card {
    padding: 16px 18px;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    background: #fff;
    width: 100%;
}

.bp-search-header {
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.bp-search-header-title p {
    margin: 6px 0 0;
    opacity: 0.92;
    font-size: 0.92rem;
}

.bp-search-session {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    margin-left: auto;
}

.bp-search-session-user,
.bp-search-session-company {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.bp-search-session-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.bp-search-session-text strong,
.bp-search-session-company strong {
    font-size: 0.95rem;
    line-height: 1.2;
    color: #fff;
}

.bp-search-session-text span {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.88);
    word-break: break-word;
}

.bp-search-session-divider {
    width: 1px;
    height: 36px;
    background: rgba(255, 255, 255, 0.35);
    flex-shrink: 0;
}

.brand-image--search-session .brand-image-img,
.brand-image--search-session .brand-image-initials {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.brand-image--search-session-company .brand-image-img,
.brand-image--search-session-company .brand-image-initials {
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.user-companies-role-table-wrap {
    margin-top: 20px;
}

.user-companies-role-table-wrap h4 {
    margin: 0 0 12px;
    color: #2d3142;
    font-size: 1rem;
}

.user-companies-role-table .user-company-role-input {
    width: 100%;
    min-width: 180px;
    padding: 8px 10px;
    border: 1px solid #d7dce5;
    border-radius: 8px;
    font-size: 0.95rem;
}

.user-company-active-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    color: #4b5563;
}

@media (max-width: 900px) {
    .bp-search-session {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
    }

    .bp-search-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Form Styles */
.funcionario-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-group label i {
    margin-right: 8px;
    color: #667eea;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group input,
.form-group select {
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fafafa;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input:invalid {
    border-color: #e74c3c;
}

.form-group input:valid {
    border-color: #27ae60;
}

.form-group input[type="file"] {
    padding: 10px;
    border: 2px dashed #e1e5e9;
    border-radius: 10px;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-group input[type="file"]:hover {
    border-color: #667eea;
    background: #f0f0f0;
}

.form-group input[type="file"]:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#photoPreview {
    margin-top: 15px;
    text-align: center;
}

#photoPreviewImg {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    border: 2px solid #e1e5e9;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-container input[type="checkbox"] {
    display: none;
}

.toggle-label {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
    background: #ccc;
    border-radius: 15px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.toggle-label::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.toggle-container input[type="checkbox"]:checked + .toggle-label {
    background: #27ae60;
}

.toggle-container input[type="checkbox"]:checked + .toggle-label::after {
    transform: translateX(30px);
}

.toggle-text {
    font-weight: 600;
    color: #333;
}

/* Error Messages */
.error-message {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
}

.error-message.show {
    display: block;
}

.form-group.error input,
.form-group.error select {
    border-color: #e74c3c;
    background: #fdf2f2;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    min-width: 150px;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px 30px;
    border-radius: 15px 15px 0 0;
    text-align: center;
}

.modal-header.success {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.modal-header.error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.modal-header i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.modal-body {
    padding: 30px;
    text-align: center;
}

.modal-body p {
    margin-bottom: 20px;
    color: #666;
    font-size: 1.1rem;
}

.funcionario-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: left;
}

.funcionario-info h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.funcionario-info p {
    margin: 5px 0;
    color: #666;
    font-size: 0.95rem;
}

.modal-footer {
    padding: 20px 30px;
    text-align: center;
    border-top: 1px solid #eee;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px 0;
    color: white;
    opacity: 0.8;
    margin-top: 30px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header-content > p.header-page-title,
    .header-content > p.header-search-users-label,
    .header-content > p:not(.logged-session-info):first-of-type {
        font-size: 1.4rem;
    }
    
    .form-container {
        padding: 20px;
        margin: 10px 0;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }

    .header-actions {
        justify-content: stretch;
    }

    .header-actions .btn {
        width: 100%;
        min-width: 0;
    }

    .logged-session-info {
        font-size: 0.88rem;
        line-height: 1.5;
        white-space: normal;
        text-align: center;
        padding: 0 6px;
    }
    
    .modal-content {
        margin: 20% auto;
        width: 95%;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .header-content > p.header-page-title,
    .header-content > p.header-search-users-label,
    .header-content > p:not(.logged-session-info):first-of-type {
        font-size: 1.25rem;
    }

    .logged-session-info {
        font-size: 0.82rem;
    }
    
    .form-container {
        padding: 15px;
    }
    
    .form-header h2 {
        font-size: 1.5rem;
    }
}

/* Loading Animation */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success Animation */
.success-animation {
    animation: successPulse 0.6s ease;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
