.team-portal main { max-width: 1000px; }
.team-portal .page-heading { flex-wrap: wrap; row-gap: 12px; margin-bottom: 24px; }
.team-portal #login { max-width: 420px; }
.team-portal #login-form, .team-portal #management form {
    display: grid;
    gap: 12px;
    justify-items: start;
    margin: 18px 0;
}
.team-portal #management label, .team-portal #login label { display: grid; gap: 5px; }
.team-portal #home-modules { display: flex; flex-wrap: wrap; gap: 12px; }
.team-portal #projects { margin-top: 16px; }
.team-portal #projects section + section { margin-top: 24px; }
.team-portal #projects h3 { margin-bottom: 10px; }
.team-portal #notice { margin-bottom: 16px; }
.team-portal.native-space-open main { max-width: none; }
#native-frame { display: block; width: 100%; height: calc(100vh - 245px); min-height: 540px; border: 0; border-radius: 12px; background: white; }
.workspace-validation { font-size: 13px; color: var(--os-color-muted, #9ca6b6); margin: 0 0 12px; }

.team-portal {
    --account-space: clamp(20px, 4vw, 48px);
    --account-radius: 16px;
}
.team-portal h1 { font-size: clamp(30px, 4.5vw, 46px); }
.team-portal h2 { font-size: 23px; }
.team-portal label, .team-portal .muted { font-size: 0.86rem; }
.team-portal #login {
    max-width: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: min(620px, 68vh);
    align-items: stretch;
    gap: var(--account-space);
}
.login-content { align-self: center; padding: 20px 0; }
.team-portal #login-form, .account-form { display: grid; gap: 14px; }
.team-portal #login-form { justify-items: stretch; }
.team-portal #login input, .account-form input { width: 100%; min-width: 0; }
.login-brand {
    display: grid;
    place-content: center;
    justify-items: center;
    text-align: center;
    gap: 10px;
    padding: var(--account-space);
    border: 1px solid var(--line);
    border-radius: var(--account-radius);
    background: linear-gradient(135deg, #172338, #244370);
    color: #e7efff;
}
.login-brand p { font-size: clamp(24px, 4vw, 36px); font-weight: 700; }
.login-brand > span:last-child { font-size: 0.8rem; }
.login-monogram {
    display: grid;
    place-items: center;
    width: 84px;
    aspect-ratio: 1;
    border: 1px solid currentColor;
    border-radius: 12px;
    font-size: 38px;
    font-weight: 800;
}
.team-portal #account-menu { margin-left: auto; position: relative; }
.team-portal summary { cursor: pointer; }
.team-portal summary.avatar { overflow: hidden; }
.team-portal summary.avatar::-webkit-details-marker { display: none; }
.team-portal .avatar img { width: 100%; height: 100%; object-fit: cover; }
.team-portal .profile-avatar { margin: 0; width: 72px; height: 72px; overflow: hidden; }
.account-dropdown {
    position: absolute;
    z-index: 2;
    top: calc(100% + 12px);
    right: 0;
    width: min(290px, 82vw);
    display: grid;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
}
.account-dropdown p, .account-dropdown a, .account-dropdown button { padding: 8px 12px; overflow-wrap: anywhere; }
.account-dropdown p { color: var(--muted); border-bottom: 1px solid var(--line); font-size: 0.8rem; }
.account-dropdown a:hover, .account-dropdown button:hover { background: #303439; }
.account-dropdown button { justify-content: start; border: 0; min-height: 44px; background: none; font-weight: 400; }
#account-menu > summary.avatar, #account-menu .account-identity .avatar {
    background: #182d45; color: #3286ff; border: 0; flex: none; overflow: hidden;
}
#account-menu > summary.avatar { width: 42px; height: 42px; list-style: none; }
#account-menu > summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
#account-menu .account-dropdown {
    width: min(360px, calc(100vw - 36px)); padding: 0; top: calc(100% + 14px);
    background: #161c24; border-color: #343b45; border-radius: 11px;
    box-shadow: 0 12px 32px #0005; z-index: 30; overflow: hidden;
}
.account-identity { display: flex; align-items: center; gap: 16px; padding: 22px 20px; border-bottom: 1px solid #343b45; }
#account-menu .account-identity .avatar { width: 48px; height: 48px; font-size: 20px; margin: 0; }
.account-identity strong { min-width: 0; overflow-wrap: anywhere; font-size: 16px; line-height: 1.4; color: #e7ebf2; }
.account-actions { display: grid; padding: 8px; gap: 2px; }
#account-menu .account-actions a, #account-menu .account-actions button {
    display: flex; align-items: center; gap: 13px; min-height: 48px; width: 100%;
    margin: 0; padding: 11px 12px; border-radius: 6px; text-align: left;
    font-size: 17px; line-height: 1.4; color: #e7ebf2; text-decoration: none;
}
.account-actions svg { width: 21px; height: 21px; color: #9ca6b6; flex: none; }
#account-menu .account-actions a:hover, #account-menu .account-actions button:hover { background: #232c39; }
#account-menu .account-actions :focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.account-stack { max-width: 680px; display: grid; gap: 16px; }
.account-card { padding: clamp(16px, 4vw, 28px); background: var(--panel); border: 1px solid var(--line); border-radius: var(--account-radius); }
.account-form label { display: grid; gap: 6px; }
.account-form button { justify-self: start; max-width: 100%; white-space: normal; }
.account-card p + .account-form, .account-card h2 + p { margin-top: 10px; }
.profile-screen #viewer, .settings-screen #viewer { font-size: 16px; margin-top: 10px; }
.team-portal:is(.profile-screen, .settings-screen) .page-heading { margin-bottom: 28px; }
#profile, #settings { max-width: 880px; gap: 24px; }
.account-stack .account-reference-card { padding: 28px; border-radius: 18px; background: #161c24; border-color: #343b45; }
.team-portal .account-reference-card h2 { margin: 0; font-size: 22px; font-weight: 600; }
.account-reference-card .muted, .profile-settings-note { font-size: 16px; line-height: 1.5; color: #9ca6b6; }
.profile-photo-row { display: flex; align-items: center; flex-wrap: wrap; gap: 24px; margin-top: 26px; }
#profile .profile-avatar { width: 88px; height: 88px; flex: none; margin: 0; background: #182d45; color: #3286ff; font-size: 28px; }
#choose-photo { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; min-height: 46px; border: 1px solid #454c56; border-radius: 11px; background: #20262e; font-size: 16px; }
#choose-photo svg { width: 21px; height: 21px; }
#name-form > label { display: block; margin: 24px 0 10px; font-size: 16px; font-weight: 600; }
.profile-name-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; }
.profile-name-row input { min-width: 0; width: 100%; min-height: 50px; padding: 12px 16px; border: 1px solid #454c56; border-radius: 11px; background: #20262e; font-size: 16px; }
.profile-name-row .primary { min-height: 50px; padding: 12px 23px; border-radius: 11px; background: #285a94; color: #f1f5ff; border: 1px solid #285a94; font-size: 16px; }
.profile-settings-note { margin: 2px 4px 0; }
.profile-settings-note a { color: #3286ff; text-decoration: none; }
.profile-settings-note a:hover { text-decoration: underline; }
#settings label { display: grid; gap: 10px; margin-top: 24px; font-size: 16px; font-weight: 600; }
#settings input { width: 100%; min-width: 0; min-height: 50px; padding: 12px 16px; border: 1px solid #454c56; border-radius: 11px; background: #20262e; font-size: 16px; }
#settings input[readonly] { color: #c8d0db; }
#current-login-label { margin-bottom: 10px; }
.password-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
#password-help { margin-top: 12px; }
#password-form > .primary { margin-top: 24px; min-height: 48px; padding: 12px 22px; border: 1px solid #285a94; border-radius: 11px; background: #285a94; color: #f1f5ff; font-size: 16px; }
@media(max-width: 480px) {
    .account-stack .account-reference-card { padding: 22px; }
    .profile-name-row { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .profile-name-row button { justify-self: start; }
    .password-fields { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
#home-next { margin-bottom: 28px; }
#home-next h2, #home-panel > h2 { margin-bottom: 12px; }
#confirm a, #recovery summary { color: var(--blue); }
#confirm form, #recovery form { margin: 16px 0; }
#notice[data-error="true"], #photo-status[data-error="true"] { color: #ffb7af; }
#photo-status:empty { display: none; }
#notice:not([hidden]) { padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; }
@media (max-width: 700px) {
    .team-portal main { padding-top: 28px; }
    .team-portal #login { grid-template-columns: 1fr; min-height: auto; }
    .team-portal .login-brand { display: none; }
}


.people-toolbar, .dialog-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 16px; }
.people-toolbar label { flex: 1 1 260px; }
.people-toolbar input { width: 100%; }
.team-portal dialog {
    width: min(520px, calc(100% - 32px));
    padding: 24px;
    color: inherit;
    border: 1px solid var(--line);
    border-radius: var(--account-radius);
    background: var(--panel);
}
.team-portal dialog::backdrop { background: #0009; }
.team-portal dialog .muted { margin-top: 8px; }
.dialog-actions { justify-content: end; margin: 0; }
#space-members { display: grid; gap: 8px; margin: 18px 0; }
#space-members label { display: flex; align-items: center; gap: 12px; }
#space-members input { min-height: 0; }
.space-card { display: flex; align-items: center; gap: 6px; }
.space-card details { position: relative; }
.space-card summary { list-style: none; min-width: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; }
.space-card summary::-webkit-details-marker { display: none; }
.space-card details button { z-index: 1; position: absolute; top: calc(100% + 4px); right: 0; }

/* Entrada geral, seguindo a referência Doctor One aprovada. */
.team-portal.login-screen { background: #0d1219; color: #e9edf4; font: 16px/1.5 Arial, Helvetica, sans-serif; }
.login-screen > .masthead { display: none; }
.team-portal.login-screen main { width: 100%; max-width: none; margin: 0; padding: 14px; }
.team-portal.login-screen #login {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    min-height: calc(100svh - 28px);
}
.login-screen #notice:not([hidden]) { margin: 0 0 12px; }
.login-screen .login-content { width: min(100% - 64px, 380px); padding: 36px 0; justify-self: center; }
.login-logo { display: flex; align-items: center; gap: 10px; width: max-content; max-width: 100%; color: #fff; }
.login-logo-mark {
    display: grid; place-items: center; width: 45px; height: 45px; flex: none;
    color: #071a32; background: #f8fafc; font: bold 30px/1 Georgia, serif; letter-spacing: -5px; padding-right: 4px;
}
.login-logo strong { display: block; font-size: 25px; line-height: 1.15; letter-spacing: -1px; font-weight: 600; }
.login-logo small { display: block; color: #a3a8b2; font-size: 8px; font-weight: 300; text-align: right; }
.login-product { margin-top: 15px; color: #9ca5b3; font-size: 13px; }
.team-portal.login-screen h1 { margin-top: 60px; font-size: 30px; letter-spacing: -1px; line-height: 1.2; }
.login-description { color: #9ca5b3; margin-top: 15px; font-size: 15px; }
.team-portal.login-screen #login-form { margin: 30px 0 0; gap: 18px; }
.team-portal.login-screen #login label { font-size: 14px; font-weight: 600; gap: 6px; }
.team-portal.login-screen #login input {
    min-height: 49px; border: 1px solid #363c46; border-radius: 10px;
    background: #171d25; padding: 12px 16px; font-size: 15px; font-weight: 400; color: #e9edf4;
}
.login-options { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.team-portal.login-screen #login .remember-login { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; color: #9ca5b3; }
.team-portal.login-screen #login input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; padding: 0; margin: 0; accent-color: #3286ff; }
.team-portal.login-screen #login .login-recovery-link {
    padding: 4px 0; min-height: 32px; border: 0; border-radius: 0; background: none;
    color: #3286ff; font-size: 14px; font-weight: 400;
}
.team-portal.login-screen #login .primary {
    background: #295dd5; border-color: #295dd5; border-radius: 40px; min-height: 49px; margin-top: 2px;
    color: #fff; font-size: 15px; box-shadow: 0 8px 24px #17377926;
}
.login-invite { margin-top: 24px; color: #9ca5b3; font-size: 14px; text-align: center; line-height: 1.65; }
.team-portal.login-screen #recovery { margin-top: 18px; padding: 14px; border: 1px solid #363c46; border-radius: 10px; }
.login-screen #recovery summary { color: #a0bff9; font-size: 14px; }
.login-screen .login-brand {
    min-width: 0; display: flex; flex-direction: column; align-items: stretch; justify-content: space-between;
    padding: 36px 40px 30px; border: 0; border-radius: 26px; overflow: hidden; position: relative;
    background: radial-gradient(ellipse at 100% 45%, #09478d80, transparent 70%), linear-gradient(110deg, #03182e, #063675);
    text-align: left;
}
.login-screen .login-brand::before {
    content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .16;
    background: repeating-linear-gradient(60deg, transparent 0 110px, #123e66 111px 113px, transparent 114px 220px),
                repeating-linear-gradient(-60deg, transparent 0 110px, #123e66 111px 113px, transparent 114px 220px);
    mask-image: linear-gradient(90deg,#000,transparent 80%);
}
.login-brand > * { position: relative; }
.login-screen .login-brand .login-logo-mark { width: 40px; height: 40px; font-size: 27px; }
.login-screen .login-brand .login-logo strong { font-size: 23px; }
.login-art { flex: 1; display: grid; align-items: center; justify-items: center; padding: 48px 20px 40px; min-height: 265px; }
.art-window {
    width: 100%; max-width: 470px; padding: 22px 22px 28px; aspect-ratio: 1.25;
    background: #ffffff17; border: 1px solid #ffffff42; border-radius: 24px; transform: rotate(-5deg);
    box-shadow: inset 0 0 0 1px #ffffff04;
}
.art-toolbar { display: flex; align-items: center; gap: 7px; margin-bottom: 23px; color: #fff; }
.art-toolbar > span { font-size: 32px; line-height: 1; margin-right: auto; }
.art-toolbar > i { display: block; border-radius: 50%; width: 5px; height: 5px; background: #ffffff70; }
.art-columns { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px; }
.art-columns b, .art-columns article > i { display: block; height: 4px; background: #c5d3e87a; border-radius: 3px; }
.art-columns b { width: 60%; margin: 0 0 15px; }
.art-columns article { padding: 10px; min-height: 78px; border: 1px solid #ffffff35; background: #c1d3f01a; border-radius: 8px; margin-bottom: 11px; position: relative; }
.art-columns article > i { margin-bottom: 6px; height: 3px; }
.art-columns article > i + i { width: 65%; opacity: .5; }
.art-columns em { display: block; width: 16px; height: 16px; margin-top: 12px; background: #b5c9e64d; border-radius: 50%; }
.art-columns article > span { position: absolute; right: 12px; bottom: 9px; font-size: 15px; color: #e9f2ff; }
.login-screen .login-brand-caption { text-align: center; }
.login-screen .login-brand-caption > p { font-size: 10px; font-weight: 600; letter-spacing: 3px; color: #b4c5de; }
.login-screen .login-brand-caption h2 { font-size: clamp(28px, 3vw, 43px); font-weight: 600; letter-spacing: -1.6px; margin-top: 18px; }
.login-brand-caption > span { display: block; font-size: 14px; margin-top: 20px; color: #c1cde0; }
.login-brand-caption > i { display: block; width: 32px; height: 3px; border-radius: 3px; background: #b6c9e1; margin: 28px auto 0; }
@media (min-width: 1600px) {
    .login-screen .login-content { width: 430px; }
    .login-screen .login-brand { padding: 40px 48px 38px; }
    .login-screen .art-window { max-width: 490px; }
}
@media (max-width: 800px) {
    .team-portal.login-screen #login { grid-template-columns: 1fr; }
    .login-screen .login-brand { display: none; }
    .login-screen .login-content { width: min(100% - 32px, 420px); padding: 32px 0; }
    .team-portal.login-screen h1 { margin-top: 48px; }
}
@media (prefers-reduced-motion: no-preference) {
    .login-screen .primary { transition: background-color .15s ease; }
}

.team-portal.portal-authenticated { --line: #2d3540; --panel: #161c25; --muted: #9da6b5; --blue: #3286ff; font: 15px/1.5 Arial, Helvetica, sans-serif; background: #0d1219; color: #e9edf4; }
.portal-authenticated #portal-sidebar { position: fixed; inset: 0 auto 0 0; width: 240px; z-index: 5; background: #080d15; border-right: 1px solid var(--line); padding: 28px 14px 65px; overflow-y: auto; }
.sidebar-logo { display: flex; align-items: center; gap: 8px; padding: 0 10px; color: #f8fafc; }
.sidebar-logo .login-logo-mark { width: 36px; height: 36px; font-size: 25px; }
.sidebar-logo strong { font-size: 19px; letter-spacing: -.6px; }
.sidebar-logo small { display: block; text-align: right; color: var(--muted); font-size: 7px; }
#portal-sidebar nav { margin-top: 34px; }
.portal-nav-item { display: flex; gap: 12px; align-items: center; width: 100%; padding: 13px 14px; border-radius: 9px; border: 0; min-height: 0; background: none; color: inherit; font-size: 14px; font-weight: 400; text-align: left; white-space: normal; }
.portal-nav-item > span:first-child { width: 20px; flex: none; font-size: 20px; text-align: center; line-height: 1; }
.portal-nav-item:hover { background: #18212e; }
.portal-nav-item[aria-current="page"] { background: #222a37; }
.portal-nav-item[aria-current="page"] > span { color: var(--blue); }
.portal-nav-caption { color: var(--muted); font-size: 11px; font-weight: 600; margin: 31px 14px 6px; }
.production-navigation > summary { list-style: none; cursor: pointer; }
.production-navigation > summary::-webkit-details-marker { display: none; }
.production-navigation > summary::after { content: '⌄'; margin-left: auto; color: var(--muted); }
.portal-nav-children { border-left: 1px solid var(--line); margin-left: 23px; padding-left: 13px; }
.portal-nav-children .portal-nav-item { font-size: 13px; padding: 10px 8px; }
.portal-nav-children .portal-nav-item > span:first-child { display: none; }
.sidebar-footer { color: var(--muted); font-size: 12px; margin: 40px 10px 0; }
.portal-authenticated .masthead { margin-left: 240px; height: 76px; padding: 0 32px; gap: 18px; border-color: var(--line); }
.portal-header-brand { color: #9da6b5; font-size: 13px; }
#admin-menu { position: relative; }
#admin-menu summary { list-style: none; display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #2d3540; border-radius: 9px; color: #aab5c5; font-size: 21px; cursor: pointer; }
#admin-menu summary::-webkit-details-marker { display: none; }
#admin-menu .account-dropdown { left: 0; right: auto; }
.portal-authenticated main { width: auto; max-width: 1700px; margin-left: 240px; margin-right: 0; padding: 32px; }
.portal-authenticated h1 { font-size: 30px; letter-spacing: -1px; }
.portal-authenticated h2 { font-size: 17px; }
.portal-authenticated .page-heading { margin-bottom: 5px; }
.panel-welcome { color: var(--muted); font-size: 14px; }
.portal-authenticated #home-modules { display: grid; margin-top: 28px; gap: 16px; }
.home-space-card { display: flex; align-items: center; gap: 20px; padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; max-width: 900px; }
.home-space-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 12px; background: #173051; color: #8dbdff; font-size: 22px; font-weight: 700; flex: none; }
.home-space-card p { font-size: 13px; color: var(--muted); margin-top: 6px; }
.home-space-card .primary { margin-left: auto; background: #3286ff; color: #08182f; border-color: #3286ff; border-radius: 9px; font-size: 13px; padding: 11px 17px; min-height: 44px; }
.portal-nav-children .space-card { gap: 0; }
.portal-nav-children .space-card > a { flex: 1; }
.portal-nav-children .space-card summary { border: 0; min-width: 26px; padding: 4px; font-size: 18px; }
#toggle-sidebar { background: none; color: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; min-height: 38px; font-size: 18px; }
.portal-authenticated #toggle-sidebar { display: none; }
@media (min-width: 801px) { .sidebar-footer { position: absolute; bottom: 24px; left: 14px; } }
@media (max-width: 800px) {
    .portal-authenticated .masthead { margin-left: 0; padding: 0 18px; gap: 12px; }
    .portal-authenticated main { margin-left: 0; padding: 24px 18px; }
    .portal-authenticated #portal-sidebar { display: none; top: 76px; width: min(280px, calc(100% - 48px)); }
    .portal-authenticated.sidebar-open #portal-sidebar { display: block; box-shadow: 20px 0 50px #0008; }
    .portal-authenticated #toggle-sidebar { display: inline-flex; }
    .home-space-card { flex-wrap: wrap; padding: 20px; gap: 14px; }
    .home-space-card > div { flex: 1; min-width: 170px; }
    .home-space-card .primary { margin-left: 0; }
    .portal-authenticated .account-dropdown { max-width: calc(100vw - 36px); }
}

#portal-sidebar .portal-nav-item { justify-content: flex-start; }
#header-account-info { margin-left: auto; text-align: right; font-size: 12px; }
#header-account-info small { display: block; color: var(--muted); font-size: 11px; }
#header-account-info:not([hidden]) + #account-menu { margin-left: 0; }
@media(max-width: 480px) {
    #header-account-info { display: none; }
    .portal-authenticated #account-menu, #header-account-info:not([hidden]) + #account-menu { margin-left: auto; }
}

.portal-menu-icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; }
.portal-nav-children .portal-menu-icon { width: 17px; height: 17px; }
