:root {
    font-family:Arial,Helvetica,sans-serif;
    color:#182737;
    background:#ffffff;
    font-size:16px
}

* {
    box-sizing:border-box
}

body {
    margin:0
}

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

button,a,input,select,textarea {
    outline-offset:4px
}

button {
    cursor:pointer;
    border:0;
    background:transparent;
    color:inherit
}

button:disabled {
    opacity:.6;
    cursor:wait
}

a {
    color:#1764aa
}

.shell {
    display:flex;
    min-height:100vh
}

.rail {
    width:238px;
    position:fixed;
    inset:0 auto 0 0;
    background:#123b78;
    color:#e6edf3;
    padding:36px 24px;
    display:flex;
    flex-direction:column
}

.brand {
    display:flex;
    gap:12px;
    align-items:center;
    font-size:30px;
    font-weight:800
}

.brand span:not(.mark) {
    display:block;
    font-size:10px;
    letter-spacing:2px;
    margin-top:4px;
    color:#9eafba
}

.mark {
    display:grid;
    place-items:center;
    background:#a3cd4a;
    color:#123b78;
    width:40px;
    height:40px;
    border-radius:11px;
    font-size:32px
}

.rail-label {
    font-size:12px;
    letter-spacing:1px;
    color:#8da5b5;
    margin:55px 0 18px
}

.rail nav button {
    display:flex;
    align-items:center;
    gap:13px;
    width:100%;
    text-align:left;
    padding:14px;
    border-radius:8px;
    color:#b9c9d6;
    margin-bottom:8px
}

.rail nav button.active {
    color:white;
    background:#1b4f96;
    border-left:3px solid #a3cd4a
}

.rail-note {
    border-top:1px solid #324753;
    margin-top:40px;
    padding-top:22px;
    font-size:14px
}

.rail-note b {
    color:#9eb1bf;
    font-weight:400
}

.rail-note p {
    font-size:18px;
    margin:9px 0
}

.rail-note small {
    line-height:1.9;
    color:#b1c0cb
}

.rail-footer {
    margin-top:auto;
    padding-top:50px;
    font-size:12px;
    letter-spacing:1.5px
}

.rail-footer span {
    display:block;
    letter-spacing:0;
    color:#8da5b5;
    margin-top:10px
}

main {
    margin-left:238px;
    padding:0 42px 30px;
    width:calc(100% - 238px);
    max-width:1800px
}

header {
    height:76px;
    border-bottom:1px solid #dce3e9;
    display:flex;
    align-items:center;
    justify-content:space-between
}

.breadcrumb {
    font-size:12px;
    letter-spacing:1.2px;
    color:#617586
}

.breadcrumb span {
    margin:0 12px;
    color:#b8c2ca
}

.access {
    font-size:13px;
    background:white;
    border:1px solid #dce3e9;
    padding:8px 12px;
    border-radius:30px
}

.heading {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:20px;
    margin:35px 0 27px
}

.eyebrow {
    font-size:12px!important;
    font-weight:700;
    letter-spacing:1.5px;
    color:#697e8e
}

h1 {
    font-size:32px;
    letter-spacing:-1px;
    margin:10px 0
}

p {
    line-height:1.55
}

.heading p:last-child {
    color:#637585;
    margin:8px 0
}

h2 {
    font-size:21px;
    line-height:1.3;
    margin:12px 0
}

h3 {
    font-size:16px;
    margin-top:25px
}

.primary {
    background:#1451a4;
    color:white;
    padding:12px 19px;
    border-radius:8px;
    white-space:nowrap
}

.stats {
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:16px
}

.stats>div {
    background:white;
    padding:20px 24px;
    border:1px solid #dfe6ec;
    border-radius:10px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px
}

.stats > div:nth-child(1) {
    background: #eaf3ff;
    border-color: #bfd5f3;
}

.stats > div:nth-child(2) {
    background: #edf8ff;
    border-color: #c5dfef;
}

.stats > div:nth-child(3) {
    background: #f3f9e5;
    border-color: #d7e9ad;
}

.stats > div:nth-child(4) {
    background: #e8f5e8;
    border-color: #bedfbe;
}

.stats span {
    color:#687b89;
    font-size:14px
}

.stats strong {
    font-size:32px;
    font-weight:500
}

.focus {
    display:grid;
    grid-template-columns:1.1fr 1fr;
    gap:35px;
    margin:25px 0 30px;
    background:#1451a4;
    color:white;
    border-radius:12px;
    padding:25px 30px;
    border-left:5px solid #a3cd4a
}

.focus h2 {
    font-size:28px
}

.focus p {
    margin:8px 0;
    color:#d7e3e9
}

.focus .eyebrow {
    color:#c6e58a
}

.focus>div:last-child {
    border-left:1px solid #4f78ad;
    padding-left:30px
}

.focus span {
    font-size:12px;
    letter-spacing:1.2px;
    color:#a8bfce
}

.focus button {
    font-weight:700;
    color:#c6e58a;
    padding:8px 0
}

.toolbar {
    display:flex;
    justify-content:space-between;
    gap:15px;
    align-items:center
}

.tabs {
    display:flex;
    gap:8px
}

.tabs button {
    padding:11px 15px;
    border-bottom:2px solid transparent;
    color:#627687
}

.tabs .chosen {
    border-color:#1451a4;
    color:#1451a4;
    font-weight:700
}

.filters {
    display:flex;
    gap:9px
}

.filters input {
    max-width:200px
}

input,select,textarea {
    background:white;
    border:1px solid #cdd7df;
    border-radius:7px;
    padding:10px 12px;
    color:#263e4f;
    min-width:0
}

select {
    font-size:14px
}

.list-note {
    font-size:13px;
    color:#6a7d8a;
    margin:18px 0
}

.grid {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:20px
}

.card {
    background:#eef5ff;
    border:1px solid #c8daf6;
    border-radius:12px;
    padding:24px;
    display:flex;
    flex-direction:column;
    box-shadow:0 2px 8px #123b7810
}

.card-top {
    display:flex;
    justify-content:space-between;
    gap:8px;
    align-items:center
}

.area {
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:1px;
    color:#4f6f96
}

.badge {
    font-size:12px;
    padding:6px 9px;
    border-radius:5px;
    background:#dceafe;
    color:#365c8d
}

.badge.green {
    background:#e2f1e9;
    color:#236449
}

.badge.amber {
    background:#eef8d8;
    color:#51751b
}

.goal {
    color:#3f5f86;
    font-size:15px;
    margin:0 0 12px
}

.priority {
    font-size:13px;
    font-weight:700;
    color:#2f5f96;
    margin-bottom:21px
}

.step-heading {
    display:flex;
    justify-content:space-between;
    font-size:14px;
    border-top:1px solid #cbdcf2;
    padding-top:16px
}

.step-heading span {
    font-size:13px;
    color:#55769f
}

.steps {
    list-style:none;
    padding:0;
    margin:14px 0 20px
}

.steps li {
    display:flex;
    gap:10px;
    margin:10px 0;
    color:#355272;
    font-size:14px;
    align-items:flex-start
}

.step-icon {
    width:20px;
    font-size:17px;
    color:#6f8fb8;
    flex-shrink:0
}

.steps .done .step-icon {
    color:#27855f
}

.steps small {
    display:block;
    font-size:12px;
    color:#67809f;
    margin-top:3px
}

.next {
    margin-top:auto;
    background:#dfeeff;
    border:1px solid #c2d9fb;
    border-radius:7px;
    padding:14px
}

.next span {
    font-size:11px;
    letter-spacing:1px;
    color:#4f6f96;
    font-weight:700
}

.next p {
    font-size:14px;
    margin:7px 0 0
}

.card-bottom {
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-top:17px;
    font-size:13px;
    gap:9px
}

.card-bottom button {
    color:#1451a4;
    font-weight:700;
    font-size:14px
}

.updated {
    color:#5a7798;
    font-size:12px;
    margin-top:12px
}

footer {
    font-size:13px;
    color:#718391;
    line-height:1.6;
    padding-top:28px
}

.overlay {
    position:fixed;
    inset:0;
    background:#081721a8;
    z-index:10;
    display:flex;
    justify-content:flex-end
}

.modal {
    background:white;
    max-width:690px;
    width:100%;
    height:100%;
    overflow:auto;
    padding:40px;
    position:relative;
    box-shadow:-20px 0 60px #0002
}

.modal h2 {
    font-size:28px;
    padding-right:25px
}

.close {
    position:absolute;
    right:20px;
    top:18px;
    font-size:28px
}

.history {
    border-left:2px solid #d6e2eb;
    padding-left:18px;
    margin:20px 0;
    font-size:14px
}

.history b {
    font-size:12px;
    color:#738694
}

.history p {
    white-space:pre-wrap
}

label {
    display:flex;
    flex-direction:column;
    gap:8px;
    font-size:14px;
    margin:16px 0;
    color:#425969
}

.form-grid {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:0 18px
}

textarea {
    min-height:80px;
    resize:vertical
}

.stage-edit {
    display:flex;
    gap:7px;
    margin:10px 0
}

.stage-edit input {
    flex:1;
    width:50%
}

.stage-edit select {
    width:145px
}

.notice {
    position:fixed;
    bottom:20px;
    right:25px;
    background:#1451a4;
    color:white;
    padding:15px 20px;
    max-width:400px;
    z-index:15;
    border-radius:8px
}

.alert {
    padding:25px;
    background:#eef8d8;
    border-radius:10px
}

.alert a,.alert button {
    margin-left:15px
}

@media(min-width:1600px) {
    .grid {
        grid-template-columns:repeat(3,minmax(0,1fr))
    }
}

@media(max-width:1150px) {
    .rail {
        width:190px;
        padding:25px 18px
    }
    main {
        margin-left:190px;
        width:calc(100% - 190px);
        padding:0 24px 25px
    }
    .stats>div {
        padding:17px 13px
    }
    .toolbar {
        flex-wrap:wrap
    }
}

@media(max-width:800px) {
    .rail {
        display:none
    }
    main {
        margin:0;
        width:100%;
        padding:0 18px 25px
    }
    .heading {
        align-items:flex-start;
        flex-direction:column
    }
    h1 {
        font-size:28px
    }
    .stats {
        grid-template-columns:repeat(2,1fr)
    }
    .focus {
        grid-template-columns:1fr;
        gap:16px;
        padding:22px
    }
    .focus>div:last-child {
        border-left:0;
        border-top:1px solid #4f78ad;
        padding:16px 0 0
    }
    .grid {
        grid-template-columns:1fr
    }
    .filters {
        width:100%
    }
    .filters input {
        max-width:none;
        width:50%
    }
    .filters select {
        width:50%
    }
    .breadcrumb {
        font-size:10px
    }
    .modal {
        padding:32px 20px
    }
    .form-grid {
        grid-template-columns:1fr
    }
    .stage-edit {
        flex-wrap:wrap
    }
    .stage-edit input {
        width:100%;
        flex:auto
    }
    .card {
        padding:20px
    }
}

[hidden] {
    display:none!important
}

.auth {
    max-width:460px;
    margin:8vh auto;
    padding:32px;
    background:white;
    border:1px solid #dfe5eb;
    border-radius:12px
}

.auth h1 {
    font-size:27px
}

.error {
    color:#9e251e;
    white-space:pre-wrap
}

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

.field-note {
    font-size:13px;
    color:#627687
}

.modal form>button {
    margin-top:15px
}

.health {
    color:#51751b
}

.stage-edit {
    align-items:center
}

.user-row {
    border-bottom:1px solid #ddd;
    padding:12px 0;
    display:flex;
    justify-content:space-between;
    gap:10px
}

.list-note button {
    text-decoration:underline
}

.priority {
    min-height:18px
}

input[type=checkbox] {
    width:auto
}

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

.notice {
    white-space:pre-wrap
}

/* =========================================================
   VISÃO EXECUTIVA DO LEITOR
   As regras abaixo só são aplicadas quando o JavaScript
   adiciona a classe .viewer-mode ao <body>.
   ========================================================= */

body.viewer-mode .rail {
    display: none;
}

body.viewer-mode main {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 32px 32px;
}

body.viewer-mode header {
    height: 64px;
}

body.viewer-mode .heading {
    margin: 24px 0 22px;
}

body.viewer-mode .heading .eyebrow,
body.viewer-mode .heading p:last-child {
    display: none;
}

body.viewer-mode .heading h1 {
    margin: 0;
}

body.viewer-mode .stats,
body.viewer-mode .focus,
body.viewer-mode footer,
body.viewer-mode #filter {
    display: none !important;
}

body.viewer-mode .toolbar {
    background: #ffffff;
    border-bottom: 1px solid #dbe5f2;
    padding: 8px 0 12px;
    margin-bottom: 0;
}

body.viewer-mode .tabs {
    gap: 4px;
}

body.viewer-mode .tabs button {
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #45627f;
}

body.viewer-mode .tabs .chosen {
    background: #eaf3ff;
    border-color: #bfd5f3;
    color: #1451a4;
}

body.viewer-mode .filters {
    margin-left: auto;
}

body.viewer-mode .filters input {
    width: 260px;
    max-width: 100%;
}

body.viewer-mode .list-note {
    margin: 14px 0 18px;
    color: #5b728c;
}

body.viewer-mode .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.viewer-card {
    min-width: 0;
}

.viewer-card-current {
    border: 2px solid #1451a4;
    box-shadow: 0 5px 18px #1451a41a;
}

.execution-marker,
.queue-marker {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    min-height: 28px;
    margin-bottom: 12px;
    padding: 5px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .6px;
}

.execution-marker {
    background: #1451a4;
    color: #ffffff;
}

.queue-marker {
    gap: 5px;
    background: #e8f5e8;
    color: #315f31;
}

.viewer-card-meta {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(120px, .6fr);
    gap: 10px;
    margin: 6px 0 18px;
}

.viewer-card-meta > div,
.viewer-detail-summary > div {
    min-width: 0;
    padding: 12px;
    background: #ffffffa8;
    border: 1px solid #cbdcf2;
    border-radius: 8px;
}

.viewer-card-meta span,
.viewer-detail-summary span {
    display: block;
    margin-bottom: 5px;
    color: #597696;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .9px;
}

.viewer-card-meta strong,
.viewer-detail-summary strong {
    display: block;
    color: #183d69;
    font-size: 14px;
    line-height: 1.35;
}

.viewer-card-bottom {
    margin-top: 14px;
}

.viewer-card-bottom button {
    min-height: 40px;
    padding: 8px 4px 8px 12px;
}

.viewer-empty {
    grid-column: 1 / -1;
    padding: 28px;
    border: 1px dashed #c8d7e8;
    border-radius: 10px;
    text-align: center;
    color: #627b95;
}

.viewer-queue {
    margin: 18px 0;
    padding: 20px;
    background: #f5f9ff;
    border: 1px solid #c8daf6;
    border-radius: 12px;
}

.viewer-queue-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.viewer-queue-heading h2 {
    margin: 4px 0 0;
}

.viewer-queue-heading small {
    color: #627b95;
}

.viewer-queue-current {
    display: grid;
    gap: 4px;
    margin-bottom: 16px;
    padding: 14px 16px;
    background: #1451a4;
    border-radius: 9px;
    color: #ffffff;
}

.viewer-queue-current > span {
    color: #d7e8ff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .8px;
}

.viewer-queue-current strong {
    font-size: 18px;
}

.viewer-queue-current small {
    color: #e8f2ff;
}

.viewer-queue-next > span {
    display: block;
    margin-bottom: 9px;
    color: #4f6f96;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .9px;
}

.viewer-queue-next ol {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.viewer-queue-next li {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid #d5e2f2;
    border-radius: 8px;
}

.viewer-queue-next li b {
    flex: 0 0 auto;
    color: #1451a4;
}

.viewer-queue-next li span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.viewer-detail-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 18px 0;
}

.viewer-detail-steps {
    margin-bottom: 24px;
}

@media (max-width: 1180px) {
    body.viewer-mode .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    body.viewer-mode main {
        width: 100%;
        margin: 0;
        padding: 0 12px 24px;
    }

    body.viewer-mode header {
        height: auto;
        min-height: 58px;
        gap: 8px;
        padding: 10px 0;
    }

    body.viewer-mode .breadcrumb {
        max-width: 52%;
        font-size: 9px;
        line-height: 1.35;
    }

    body.viewer-mode .access {
        max-width: 48%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 11px;
    }

    body.viewer-mode .heading {
        display: block;
        margin: 18px 0 12px;
    }

    body.viewer-mode .heading h1 {
        font-size: 25px;
    }

    body.viewer-mode .admin-actions {
        display: flex;
        gap: 4px;
        margin-top: 10px;
    }

    body.viewer-mode .admin-actions button:not(#password):not(#logout) {
        display: none !important;
    }

    body.viewer-mode #password,
    body.viewer-mode #logout {
        min-height: 40px;
        padding: 7px 9px;
        border: 1px solid #d7e2ee;
        border-radius: 7px;
        font-size: 12px;
    }

    body.viewer-mode .toolbar {
        position: sticky;
        top: 0;
        z-index: 6;
        display: block;
        padding: 8px 0 10px;
    }

    body.viewer-mode .tabs {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
        width: 100%;
    }

    body.viewer-mode .tabs button {
        width: 100%;
        padding: 9px 6px;
        font-size: 13px;
    }

    body.viewer-mode .filters {
        width: 100%;
        margin-top: 8px;
    }

    body.viewer-mode .filters input {
        width: 100%;
        max-width: none;
        min-height: 44px;
    }

    body.viewer-mode .grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    body.viewer-mode .card {
        padding: 18px;
    }

    .viewer-card-meta,
    .viewer-detail-summary {
        grid-template-columns: 1fr;
    }

    .viewer-card-bottom {
        align-items: flex-start;
    }

    .viewer-card-bottom button {
        flex: 0 0 auto;
    }

    .viewer-queue {
        margin: 12px 0;
        padding: 15px;
    }

    .viewer-queue-heading {
        display: block;
    }

    .viewer-queue-heading small {
        display: block;
        margin-top: 5px;
    }

    .viewer-queue-next ol {
        grid-template-columns: 1fr;
    }

    .modal {
        max-width: none;
        width: 100%;
    }
}
/* =========================================================
   DETALHES DO PROJETO — LEITURA E HISTÓRICO
   ========================================================= */

.formatted-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.7;
    color: #263e4f;
}

.formatted-text strong {
    color: #173f78;
    font-weight: 700;
}

.detail-section {
    margin-top: 24px;
}

.detail-section > h3 {
    margin-bottom: 10px;
    color: #182737;
}

.history {
    border-left: 2px solid #c8daf6;
    padding: 12px 0 12px 16px;
    margin: 18px 0;
}

.history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.history-head > b {
    font-size: 12px;
    color: #607995;
}

.history-text {
    font-size: 14px;
}

.history-delete {
    flex: 0 0 auto;
    padding: 6px 10px;
    border: 1px solid #d7a4a1;
    border-radius: 6px;
    color: #9e251e;
    background: #fff;
    font-size: 12px;
    font-weight: 700;
}

.history-delete:hover,
.history-delete:focus-visible {
    background: #fff1f0;
}

.history-change {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    padding: 10px 12px;
    background: #f7faff;
    border-radius: 6px;
}

@media (max-width: 800px) {
    .detail-section {
        margin-top: 20px;
    }

    .formatted-text {
        line-height: 1.6;
    }

    .history {
        padding-left: 12px;
    }

    .history-head {
        align-items: flex-start;
    }

    .history-delete {
        min-height: 36px;
    }
}
