:root {
    color-scheme: light;
    --navy: #12345b;
    --blue: #1d5da7;
    --blue-strong: #174d8b;
    --blue-soft: #eaf2fc;
    --ink: #172536;
    --muted: #627083;
    --line: #dce3eb;
    --surface: #fff;
    --canvas: #f4f7fa;
    --green: #16834b;
    --orange: #d17613;
    --red: #c43e43;
    --shadow: 0 12px 35px rgba(28, 48, 76, .1);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif
}

* {
    box-sizing: border-box
}

html {
    min-width: 320px;
    background: var(--canvas)
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas)
}

button,
input,
textarea,
select {
    font: inherit
}

button {
    cursor: pointer
}

button:disabled {
    cursor: not-allowed;
    opacity: .55
}

a {
    color: inherit
}

.hidden {
    display: none !important
}

.muted {
    color: var(--muted)
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--blue);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase
}

.login-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 1.05fr) minmax(360px, .95fr)
}

.login-brand {
    padding: clamp(40px, 8vw, 110px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
    background: linear-gradient(145deg, #102f53, #1d5da7)
}

.login-brand .eyebrow {
    color: #bfdbfe
}

.login-brand h1 {
    margin: 10px 0 14px;
    font-size: clamp(2.7rem, 6vw, 5rem);
    line-height: .95;
    letter-spacing: -.05em
}

#passwordView .login-brand h1 {
    max-width: 620px;
    font-size: clamp(2.4rem, 5vw, 4.4rem);
    line-height: 1.02
}

.login-brand>p:not(.eyebrow) {
    max-width: 600px;
    font-size: 1.15rem;
    line-height: 1.7;
    color: #e7f0fb
}

.login-logo-icon {
    width: 76px;
    height: 76px;
    object-fit: cover;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .2)
}

.login-benefits {
    margin: 30px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 12px;
    color: #edf5ff
}

.login-benefits li::before {
    content: "✓";
    margin-right: 10px;
    color: #8ce3b4;
    font-weight: 900
}

.login-panel {
    display: grid;
    place-items: center;
    padding: 32px;
    background: #f7f9fc
}

.login-card {
    width: min(100%, 430px);
    padding: clamp(28px, 5vw, 48px);
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #fff;
    box-shadow: var(--shadow)
}

.login-card h2 {
    margin: 0 0 8px;
    font-size: 2rem
}

.stack-form {
    display: grid;
    gap: 9px
}

.stack-form label,
legend {
    font-size: .88rem;
    font-weight: 750
}

.stack-form input,
.stack-form textarea,
.stack-form select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #c9d3df;
    border-radius: 9px;
    color: var(--ink);
    background: #fff;
    outline: none
}

.stack-form input:focus,
.stack-form textarea:focus,
.stack-form select:focus,
.search-field:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(29, 93, 167, .13)
}

.stack-form textarea {
    resize: vertical
}

.login-card .stack-form {
    margin-top: 28px
}

.form-status {
    min-height: 20px;
    margin: 4px 0 0;
    color: var(--red);
    font-size: .86rem
}

.form-status.info {
    color: var(--blue)
}

.forgot-password {
    justify-self: end;
    margin: 0 0 8px;
    padding: 3px 0;
    border: 0;
    color: var(--blue);
    background: transparent;
    font-size: .88rem;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px
}

.forgot-password:hover:not(:disabled) {
    color: var(--blue-strong)
}

.forgot-password:focus-visible {
    border-radius: 4px;
    outline: 3px solid rgba(29, 93, 167, .2);
    outline-offset: 3px
}

.button {
    min-height: 40px;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-weight: 750;
    transition: .15s
}

.button:hover:not(:disabled) {
    transform: translateY(-1px)
}

.button.primary {
    color: #fff;
    background: var(--blue)
}

.button.primary:hover:not(:disabled) {
    background: var(--blue-strong)
}

.button.secondary {
    color: var(--navy);
    background: #fff;
    border-color: #cbd6e2
}

.button.ghost {
    color: var(--navy);
    background: transparent;
    border-color: #d6dee7
}

.button.danger {
    color: #a72c31;
    background: #fff;
    border-color: #efc7c9
}

.button.wide {
    width: 100%;
    margin-top: 10px
}

.topbar {
    min-height: 70px;
    padding: 10px clamp(18px, 4vw, 58px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(12px)
}

.brand {
    display: flex;
    align-items: center;
    text-decoration: none
}

.header-logo {
    display: block;
    width: auto;
    height: 42px;
    object-fit: contain
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px
}

.topbar-users-button {
    min-height: 42px;
    white-space: nowrap
}

.topbar-users-short {
    display: none
}

.account-menu {
    position: relative
}

.account-trigger {
    min-height: 48px;
    padding: 5px 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--ink);
    background: transparent;
    text-align: left
}

.account-trigger:hover,
.account-trigger[aria-expanded="true"] {
    border-color: var(--line);
    background: #f5f7fa
}

.account-trigger:focus-visible,
.account-dropdown button:focus-visible {
    outline: 3px solid rgba(29, 93, 167, .18);
    outline-offset: 2px
}

.account-avatar,
.profile-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(145deg, var(--navy), var(--blue));
    font-weight: 850;
    letter-spacing: -.03em
}

.account-avatar {
    width: 36px;
    height: 36px;
    font-size: .78rem
}

.account-copy {
    display: grid;
    min-width: 0;
    max-width: 180px;
    text-align: right
}

.account-copy strong,
.account-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.account-copy small {
    color: var(--muted);
    font-size: .72rem
}

.account-chevron {
    color: var(--muted);
    font-size: 1rem;
    transition: transform .15s
}

.account-trigger[aria-expanded="true"] .account-chevron {
    transform: rotate(180deg)
}

.account-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 20;
    width: 210px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(20, 40, 66, .16)
}

.account-dropdown button {
    width: 100%;
    padding: 10px 11px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    border-radius: 8px;
    color: var(--ink);
    background: transparent;
    text-align: left;
    font-weight: 700
}

.account-dropdown button:hover {
    background: var(--blue-soft);
    color: var(--blue-strong)
}

.account-dropdown button+button {
    border-top: 1px solid #edf0f4;
    border-radius: 0 0 8px 8px
}

.content {
    width: min(1420px, 100%);
    margin: 0 auto;
    padding: 38px clamp(18px, 4vw, 58px) 80px
}

.page-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px
}

.page-heading h1 {
    margin: 0 0 6px;
    font-size: clamp(1.75rem, 3vw, 2.45rem);
    letter-spacing: -.035em
}

.page-heading p:last-child {
    margin: 0
}

.stats {
    margin: 28px 0 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px
}

.stat {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface)
}

.stat strong {
    display: block;
    font-size: 1.75rem;
    letter-spacing: -.04em
}

.stat span {
    color: var(--muted);
    font-size: .75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em
}

.stat.green strong {
    color: var(--green)
}

.stat.orange strong {
    color: var(--orange)
}

.stat.red strong {
    color: var(--red)
}

.controls {
    display: flex;
    gap: 10px
}

.filter-panel {
    margin-top: 12px;
    padding: 14px;
    display: grid;
    grid-template-columns: repeat(5, minmax(130px, 1fr)) auto;
    align-items: end;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff
}

.filter-panel label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 750
}

.filter-panel select {
    width: 100%;
    min-height: 40px;
    padding: 8px 30px 8px 10px;
    border: 1px solid #cbd6e2;
    border-radius: 9px;
    color: var(--ink);
    background: #fff
}

.search-field {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 13px;
    border: 1px solid #cbd6e2;
    border-radius: 10px;
    background: #fff
}

.search-field input {
    width: 100%;
    min-width: 0;
    padding: 11px 0;
    border: 0;
    outline: 0;
    background: transparent
}

.area-filters {
    margin: 16px 0 6px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin
}

.filter-chip {
    flex: 0 0 auto;
    padding: 7px 12px;
    border: 1px solid #ccd6e1;
    border-radius: 999px;
    background: #fff;
    color: #42536a;
    font-size: .84rem;
    font-weight: 700
}

.filter-chip.active {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff
}

.data-status {
    min-height: 22px;
    margin: 8px 0;
    color: var(--muted);
    font-size: .86rem
}

.list-summary {
    margin: 8px 0 12px;
    color: var(--ink);
    font-size: .88rem;
    font-weight: 700;
    scroll-margin-top: 90px
}

.actions-list {
    display: grid;
    gap: 14px
}

.pagination {
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px
}

.page-button {
    min-width: 40px;
    min-height: 40px;
    padding: 7px 11px;
    border: 1px solid #cbd6e2;
    border-radius: 9px;
    color: var(--navy);
    background: #fff;
    font-weight: 750
}

.page-button.active {
    border-color: var(--blue);
    color: #fff;
    background: var(--blue)
}

.page-direction {
    min-width: 112px
}

.page-gap {
    padding: 0 3px;
    color: var(--muted)
}

.action-card {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(30, 52, 80, .04)
}

.action-card.done {
    border-color: #b9dbc8;
    background: #fbfefc
}

.card-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 20px
}

.card-title {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.4
}

.tags {
    margin-top: 9px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px
}

.tag {
    padding: 4px 8px;
    border-radius: 6px;
    background: #eef2f6;
    color: #46586d;
    font-size: .74rem;
    font-weight: 700
}

.tag.priority-alta {
    background: #fff1dc;
    color: #9a5308
}

.tag.priority-urgente {
    background: #fdebec;
    color: #a32e33
}

.status-control {
    display: flex;
    gap: 6px;
    align-items: center;
    flex: 0 0 auto
}

.status-dot {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #c6d0dc;
    opacity: .32
}

.status-dot.green {
    background: var(--green)
}

.status-dot.orange {
    background: var(--orange)
}

.status-dot.red {
    background: var(--red)
}

.status-dot.active {
    opacity: 1;
    box-shadow: 0 0 0 2px currentColor
}

button.status-dot:hover:not(:disabled) {
    opacity: .75
}

.card-meta {
    margin: 16px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    color: var(--muted);
    font-size: .82rem
}

.card-toolbar {
    margin-top: 16px;
    padding-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px solid #edf0f4
}

.done-button.active {
    color: #fff;
    background: var(--green);
    border-color: var(--green)
}

.comments {
    margin-top: 15px;
    display: grid;
    gap: 8px
}

.comment {
    padding: 10px 12px;
    border-radius: 9px;
    background: #f5f7fa;
    font-size: .86rem;
    line-height: 1.45
}

.comment header {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    color: var(--muted);
    font-size: .74rem
}

.comment p {
    margin: 5px 0 0;
    white-space: pre-wrap
}

.comment-form {
    margin-top: 12px;
    display: flex;
    gap: 8px
}

.comment-form input {
    flex: 1;
    min-width: 0;
    padding: 9px 11px;
    border: 1px solid #ccd6e1;
    border-radius: 9px
}

.empty-state {
    padding: 50px 24px;
    text-align: center;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    color: var(--muted);
    background: rgba(255, 255, 255, .6)
}

.empty-state strong {
    display: block;
    margin-bottom: 5px;
    color: var(--ink);
    font-size: 1.05rem
}

.dialog {
    width: min(680px, calc(100% - 28px));
    padding: 0;
    border: 0;
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(17, 35, 60, .28)
}

.dialog::backdrop {
    background: rgba(12, 27, 46, .58);
    backdrop-filter: blur(2px)
}

.dialog-card>header,
.dialog-card>footer {
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px
}

.dialog-card>header {
    border-bottom: 1px solid var(--line)
}

.dialog-card>header h2 {
    margin: 0
}

.dialog-card>footer {
    justify-content: flex-end;
    border-top: 1px solid var(--line)
}

.dialog-body {
    max-height: 68vh;
    overflow-y: auto;
    padding: 22px
}

.profile-dialog {
    width: min(620px, calc(100% - 28px))
}

.assignment-dialog {
    width: min(680px, calc(100% - 28px))
}

.profile-body {
    display: grid;
    gap: 22px
}

.profile-summary {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid #d5e3f2;
    border-radius: 14px;
    background: var(--blue-soft)
}

.profile-avatar {
    width: 54px;
    height: 54px;
    font-size: 1.05rem
}

.profile-summary div {
    display: grid;
    gap: 3px
}

.profile-summary strong {
    font-size: 1.05rem
}

.profile-summary span:last-child {
    color: var(--muted);
    font-size: .84rem
}

.profile-form {
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line)
}

.profile-section-heading h3,
.security-panel h3,
.notification-panel h3 {
    margin: 0 0 4px;
    font-size: 1rem
}

.profile-section-heading p,
.security-panel p,
.notification-panel p {
    margin: 0;
    color: var(--muted);
    font-size: .84rem;
    line-height: 1.5
}

.profile-form input[readonly] {
    color: #526174;
    background: #f3f5f7;
    cursor: default
}

.field-help {
    margin: -2px 0 6px;
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.45
}

.profile-assigned-areas {
    display: grid;
    gap: 8px
}

.field-label {
    font-weight: 700;
    font-size: .88rem
}

.assigned-area-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px
}

.assigned-area-list .tag {
    margin: 0
}

.profile-form .button {
    justify-self: start;
    margin-top: 8px
}

.security-panel,
.notification-panel {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px 18px
}

.security-panel .form-status,
.notification-panel .form-status {
    grid-column: 1 / -1
}

.notification-panel {
    padding-top: 2px
}

.notification-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px
}

.notification-preferences {
    display: grid;
    gap: 9px;
    grid-column: 1 / -1
}

.notification-preferences label {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: .86rem;
    font-weight: 600
}

.notification-preferences input {
    width: auto;
    margin: 0
}

.notification-panel>.button {
    justify-self: end
}

.icon-button {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: #eef2f6;
    color: var(--ink);
    font-size: 1.6rem
}

fieldset {
    margin: 8px 0;
    padding: 0;
    border: 0
}

legend {
    margin-bottom: 9px
}

.area-choices {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 7px
}

.area-choice {
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: .82rem;
    font-weight: 600
}

.area-choice input {
    width: auto;
    margin: 0
}

.form-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr .8fr;
    gap: 12px
}

.form-grid>div {
    display: grid;
    gap: 9px
}

.optional {
    color: var(--muted);
    font-weight: 500
}

.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 100;
    max-width: 380px;
    padding: 12px 16px;
    border-radius: 10px;
    color: #fff;
    background: #183b64;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: .2s
}

.toast.visible {
    opacity: 1;
    transform: translateY(0)
}

@media(max-width:820px) {
    .login-layout {
        grid-template-columns: 1fr
    }

    .login-brand {
        min-height: 34vh;
        padding: 36px 28px
    }

    .login-benefits {
        display: none
    }

    .login-panel {
        padding: 22px 16px 36px
    }

    .stats {
        grid-template-columns: repeat(2, 1fr)
    }

    .form-grid {
        grid-template-columns: 1fr 1fr
    }

    .filter-panel {
        grid-template-columns: repeat(3, 1fr)
    }
}

@media(max-width:560px) {
    .topbar {
        padding: 10px 14px
    }

    .header-logo {
        height: 34px
    }

    .topbar-actions {
        gap: 4px
    }

    .topbar-users-button {
        min-height: 40px;
        padding: 8px 10px
    }

    .topbar-users-label {
        display: none
    }

    .topbar-users-short {
        display: inline
    }

    .account-trigger {
        gap: 5px
    }

    .account-copy {
        max-width: 108px
    }

    .account-copy strong {
        font-size: .86rem
    }

    .account-chevron {
        display: none
    }

    .content {
        padding: 26px 14px 60px
    }

    .page-heading {
        align-items: stretch;
        flex-direction: column
    }

    .page-heading .button {
        width: 100%
    }

    .controls {
        flex-direction: column
    }

    .filter-panel {
        grid-template-columns: 1fr 1fr;
        padding: 12px
    }

    .filter-panel .button {
        width: 100%
    }

    .page-direction {
        min-width: 96px;
        font-size: .82rem
    }

    .stats {
        gap: 8px
    }

    .stat {
        padding: 14px
    }

    .card-head {
        gap: 12px
    }

    .action-card {
        padding: 16px
    }

    .comment-form {
        flex-direction: column
    }

    .area-choices,
    .form-grid {
        grid-template-columns: 1fr
    }

    .security-panel,
    .notification-panel {
        grid-template-columns: 1fr
    }

    .security-panel .button,
    .notification-panel>.button {
        width: 100%
    }

    .dialog-card>header,
    .dialog-card>footer,
    .dialog-body {
        padding-left: 16px;
        padding-right: 16px
    }
}

@media(prefers-reduced-motion:reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important
    }
}
