:root {
    color-scheme: light;
    --ink: #382d2a;
    --muted: #55787e;
    --line: #e8ddd5;
    --page: #f7f3ee;
    --accent: #a6332e;
    font: 15px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif
}

* {
    box-sizing: border-box
}

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

button,
input {
    font: inherit
}

button {
    cursor: pointer;
    min-height: 44px
}

button:focus-visible,
input:focus-visible {
    outline: 3px solid #bd7165;
    outline-offset: 3px
}

[hidden] {
    display: none !important
}

.masthead {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: linear-gradient(115deg, #942d29, #a6332e 55%, #ac3e33);
    color: white;
    padding: 28px max(20px, calc((100vw - 1160px)/2)) 64px;
    border-radius: 0 0 36px 36px
}

.masthead::before,
.masthead::after {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;
    transform: rotate(-20deg)
}

.masthead::before {
    width: 440px;
    height: 440px;
    right: -190px;
    top: -240px;
    border: 50px solid #f1e1d912;
    border-radius: 45% 55% 65% 35%
}

.masthead::after {
    width: 400px;
    height: 230px;
    right: -100px;
    bottom: -175px;
    border: 32px solid #f1e1d926;
    border-radius: 55% 45% 35% 65%
}

.brand-row {
    margin-bottom: 26px
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px
}

.cta-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    background: #fffdf9;
    border: 1px solid #fff5e9;
    border-radius: 15px;
    box-shadow: 0 5px 18px #63211b18;
    flex-shrink: 0
}

.cta-logo img {
    display: block;
    width: 100px;
    height: auto
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 3px
}

.brand-copy strong {
    font-size: 1.25rem;
    letter-spacing: .08em;
    line-height: 1.2
}

.brand-copy>span {
    font-size: .7rem;
    letter-spacing: .08em;
    color: #f3dcd5;
    font-weight: 500
}

.header-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px
}

.eyebrow {
    font-size: .74rem;
    letter-spacing: .08em;
    color: #f2d2c8;
    margin: 0 0 8px
}

.identity {
    color: #fae9df;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0
}

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

.profile form {
    margin: 0
}

.scope {
    font-size: 1rem;
    font-weight: 600;
    overflow-wrap: anywhere
}

.logout {
    color: #fff0e3;
    border: 1px solid #f5d6c650;
    background: #ffffff0d;
    border-radius: 10px;
    padding: 7px 14px
}

.logout:hover {
    background: #ffffff22
}








main {
    max-width: 1200px;
    margin: -28px auto 0;
    padding: 0 20px 32px;
    position: relative
}

.overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    background: #fffdf9;
    border: 1px solid #eaded2;
    box-shadow: 0 9px 28px #6d38200a;
    border-radius: 18px;
    padding: 20px 12px;
    margin-bottom: 24px
}

.metric {
    padding: 0 20px;
    border-right: 1px solid var(--line)
}

.metric:last-child {
    border: 0
}

.metric span {
    display: block;
    color: var(--muted);
    font-size: .77rem
}

.metric strong {
    font-size: 1.65rem;
    line-height: 1.4;
    font-weight: 650;
    color: #95362e
}

.metric.current strong {
    color: #187348
}

.metric.done strong {
    color: #5a5a5a
}

.metric small {
    font-size: .75rem;
    margin-left: 7px;
    color: var(--muted)
}

.legend {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: .72rem;
    color: var(--muted);
    margin: 16px 0 20px
}

.legend span {
    display: flex;
    align-items: center;
    gap: 6px
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9da6b3
}

.dot.green {
    background: #218358
}

.dot.red {
    background: #b7564b
}

.dot.purple {
    background: #784894
}

.dot.sand {
    background: #ba9a75
}

.list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: start
}

.activity {
    --card: #fffaf4;
    --border: #e7d9c9;
    --state: #96724f;
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--state);
    border-radius: 17px;
    padding: 12px 16px;
    box-shadow: 0 5px 20px #67432905;
    min-width: 0
}

.time-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 10px
}

.time {
    font-size: 1.4rem;
    font-weight: 650;
    line-height: 1.25;
    letter-spacing: -.04em;
    font-variant-numeric: tabular-nums
}

.time-arrow {
    font-size: 1rem;
    color: #a18478;
    margin: 0 10px;
    font-weight: 400
}

.status {
    font-size: .76rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--state)
}

.status i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor
}

.relative {
    font-size: .76rem;
    color: var(--state);
    font-weight: 600;
    display: block;
    margin-bottom: 8px
}

.activity h2 {
    font-size: 1rem;
    line-height: 1.55;
    margin: 0 0 9px;
    font-weight: 650;
    overflow-wrap: anywhere
}

.details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px 18px;
    margin: 0;
    padding-top: 10px;
    border-top: 1px solid #73472e16
}

.details dt,
.notes h3 {
    font-size: .7rem;
    letter-spacing: .045em;
    text-transform: uppercase;
    font-weight: 650;
    color: #3f2f29;
    margin: 0 0 4px
}

.details dd {
    font-size: 1.1rem;
    font-weight: 650;
    margin: 0;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.detail-wide {
    grid-column: 1/-1
}

.notes {
    margin-top: 18px;
    background: #fffdfb9e;
    border: 1px solid #fffdfbb3;
    padding: 12px 14px;
    border-radius: 11px
}

.notes p {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: .88rem;
    line-height: 1.65;
    margin: 0
}

.state-current {
    --card: #e2f4e8;
    --border: #a7ceb5;
    --state: #24754a
}

.state-current .details dt,
.state-current .notes h3 {
    color: #496b58
}

.state-past {
    --card: #e9ecef;
    --border: #d2d8df;
    --state: #75808e;
    color: #596370;
    box-shadow: none
}

.state-past .details dt,
.state-past .notes h3 {
    color: #747d88
}

.state-past .notes {
    background: #ffffff55;
    border-color: transparent
}


.empty {
    border: 1px dashed #ddc9bb;
    border-radius: 18px;
    padding: 45px 20px;
    text-align: center;
    background: #fffdf9;
    color: var(--muted)
}

.empty h2 {
    color: var(--ink);
    font-size: 1.1rem;
    margin: 0 0 8px
}

.empty p {
    margin: 0;
    font-size: .9rem
}

.footer {
    padding: 0 20px 24px;
    text-align: center;
    font-size: .72rem;
    color: #90796c
}

/* Acesso */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column
}

.login-page .masthead {
    padding-bottom: 90px
}

.login-main {
    width: 100%;
    max-width: 510px;
    margin: -54px auto 0;
    flex: 1
}

.login-card {
    background: #fffdf9;
    border: 1px solid #eaded2;
    border-radius: 22px;
    padding: 32px;
    box-shadow: 0 12px 40px #6d38200b
}

.login-eyebrow {
    font-size: .7rem;
    letter-spacing: .1em;
    color: #a6332e;
    font-weight: 700
}

.login-card h1 {
    font-size: 1.9rem;
    letter-spacing: -.03em;
    line-height: 1.25;
    margin: 12px 0
}

.login-intro {
    font-size: .94rem;
    color: var(--muted);
    margin: 0 0 25px
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px
}

.field label {
    font-size: .83rem;
    font-weight: 600
}

.field input {
    width: 100%;
    min-height: 48px;
    border: 1px solid #e3d6cc;
    border-radius: 11px;
    padding: 11px 13px;
    background: white;
    color: var(--ink)
}

.remember {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .8rem;
    color: var(--muted);
    margin: 5px 0 22px;
    cursor: pointer
}

.remember input {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: #a6332e
}

.login-submit {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    border: 0;
    border-radius: 12px;
    background: #a6332e;
    color: white;
    padding: 13px 18px;
    font-weight: 650
}

.login-submit:hover {
    background: #8f2a26
}

.login-help {
    border-top: 1px solid var(--line);
    padding-top: 20px;
    margin: 24px 0 0;
    font-size: .78rem;
    color: var(--muted);
    line-height: 1.8
}

.login-error {
    background: #fce9e5;
    border: 1px solid #ebc3bb;
    border-radius: 11px;
    padding: 12px;
    font-size: .86rem;
    color: #8f3029;
    margin-bottom: 20px
}

@media(max-width:600px) {
    .masthead {
        padding: 20px 18px 54px;
        border-radius: 0 0 25px 25px
    }

    .brand-row {
        margin-bottom: 24px
    }

    .brand {
        gap: 11px
    }

    .cta-logo {
        padding: 8px 11px;
        border-radius: 12px
    }

    .cta-logo img {
        width: 76px
    }

    .brand-copy strong {
        font-size: 1.1rem
    }

    .brand-copy>span {
        font-size: .65rem
    }

    .header-bottom {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px
    }

    .profile {
        width: 100%;
        justify-content: space-between
    }

    .identity {
        font-size: 1.08rem
    }

    main {
        padding: 0 12px 28px
    }

    .overview {
        padding: 16px 0;
        margin-bottom: 20px;
        border-radius: 15px
    }

    .metric {
        padding: 0 13px
    }

    .metric span {
        font-size: .68rem
    }

    .metric strong {
        font-size: 1.45rem
    }

    .metric small {
        display: none
    }

    .list {
        gap: 14px
    }

    .activity {
        padding: 18px 17px 22px;
        border-radius: 15px
    }

    .activity h2 {
        font-size: 1rem
    }

    .legend {
        gap: 10px 14px
    }

    .login-main {
        padding: 0 12px 25px
    }

    .login-card {
        padding: 26px 22px
    }

    .login-card h1 {
        font-size: 1.75rem
    }
}

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

    .metric {
        padding: 0 9px
    }

    .time-arrow {
        margin: 0 6px
    }

    .brand-copy>span {
        font-size: .59rem
    }
}

@media print {
    body {
        background: white
    }

    .masthead {
        background: white;
        color: #382d2a;
        padding: 0 0 20px;
        border-radius: 0
    }

    .masthead::before,
    .masthead::after,
    .profile form,
    .brand-row,
    .legend,
    .footer {
        display: none
    }

    .eyebrow,
    .identity {
        color: #5e4239
    }

    main {
        margin: 0;
        padding: 0
    }

    .overview {
        box-shadow: none
    }

    .list {
        display: block
    }

    .activity {
        break-inside: avoid;
        margin-bottom: 14px;
        box-shadow: none
    }
}

/* O nome usa as cores do cadastro; o restante do card comunica a execução. */
.activity {
    background: linear-gradient(125deg, var(--card), #fffdfb 85%);
    border-left-width: 5px
}

.activity-name {
    display: inline-block;
    max-width: 100%;
    padding: 9px 14px;
    border-radius: 12px;
    color: var(--name-fg);
    background: linear-gradient(120deg, #ffffff20, transparent 65%), var(--name-bg);
    border: 1px solid #00000012;
    box-shadow: 0 3px 9px #382d2a08;
    overflow-wrap: anywhere
}

.state-pending {
    --card: #faf7e8;
    --border: #e3dcb6;
    --state: #896f32
}

.state-deferred {
    --card: #f2eaf8;
    --border: #d7c4e5;
    --state: #80549a
}

.state-deferred .status {
    color: #80549a
}

.execution-help {
    font-size: .8rem;
    color: var(--muted);
    margin: 0 0 18px
}

.execution-details {
    font-size: .84rem;
    color: var(--muted);
    margin-top: 16px;
    overflow-wrap: anywhere
}

.execution-details p {
    margin: 5px 0
}

.defer-reason {
    white-space: pre-wrap
}

.defer-form {
    margin-top: 16px;
    padding: 16px;
    background: #ffffff99;
    border: 1px solid var(--line);
    border-radius: 12px
}

.defer-form label {
    display: block;
    font-size: .87rem;
    font-weight: 600;
    margin-bottom: 7px
}

.defer-form textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 12px;
    border: 1px solid #cfbdaf;
    border-radius: 10px;
    font: inherit;
    resize: vertical;
    background: white;
    color: var(--ink)
}

.defer-form textarea:focus-visible {
    outline: 3px solid #bd7165;
    outline-offset: 2px
}

.btn-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.btn-bar button {
    border-radius: 10px;
    padding: 10px 18px;
    min-height: 44px;
    min-width: 128px;
    font-weight: 600;
    border: 1px solid transparent
}

.btn-bar .btn-green {
    background: #237348;
    color: white
}

.btn-bar .btn-red {
    background: #a6332e;
    color: white
}

.btn-bar .btn-blue {
    background: #3a668f;
    border-color: #2a5277;
    color: white
}

.btn-bar .btn-cancel {
    background: white;
    border-color: var(--line);
    color: var(--muted)
}

.btn-bar button:disabled {
    opacity: .55;
    cursor: wait
}

.action-feedback {
    font-size: .85rem;
    color: #90352e;
    overflow-wrap: anywhere;
    margin: 10px 0 0
}

.action-feedback:empty {
    display: none
}

@media(max-width:600px) {
    .btn-bar button {
        flex: 1
    }

    .activity-name {
        padding: 8px 11px
    }
}

@media print {

    .btn-bar,
    .defer-form,
    .action-feedback {
        display: none !important
    }
}

.state-pending.is-soon {
    --card: #f8ecd1;
    --border: #d6b77a;
    --state: #82611f
}