html {
  font-size: 14px;
}

.page-context-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.page-context-back {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 2.5rem;
  padding: .45rem .75rem;
  border: 1px solid #ced7df;
  border-radius: .45rem;
  background: #fff;
  color: #1e3a5f;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .2s ease, background-color .2s ease;
}

.page-context-back:hover {
  border-color: #1e3a5f;
  background: #f5f8fb;
  color: #142b46;
}

.page-context-back:focus-visible {
  outline: 3px solid rgba(30, 58, 95, .25);
  outline-offset: 2px;
}

.page-context-title h1 {
  margin: 0;
  color: #1f2d3a;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
}

.page-context-title p {
  margin: .2rem 0 0;
  color: #596979;
}

@media (max-width: 575.98px) {
  .page-context-header {
    grid-template-columns: 1fr;
    gap: .65rem;
  }

  .page-context-back {
    width: fit-content;
  }
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

/* Central da Obra */
.obra-central .card { border-radius: .85rem; }
.obra-info-grid span, .obra-info-grid strong { display: block; }
.obra-info-grid span { color: #64748b; font-size: .78rem; margin-bottom: .2rem; }
.obra-info-grid strong { color: #1e293b; font-size: .92rem; }
.obra-status-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1rem; border: 1px solid #dbe4ee; border-radius: .75rem; background: #f8fafc; }
.obra-status-actions__label { display: inline-flex; align-items: center; gap: .45rem; color: #475569; font-weight: 600; white-space: nowrap; }
@media (max-width: 767.98px) {
    .obra-status-actions { align-items: stretch; flex-direction: column; }
    .obra-status-actions form, .obra-status-actions button { width: 100%; }
}
.obra-kpi {
  min-height: 7.25rem; height: 100%; padding: 1rem; border: 1px solid #e2e8f0;
  border-radius: .85rem; background: #fff; color: #334155;
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: 1fr auto;
  gap: .25rem .7rem; text-decoration: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
a.obra-kpi:hover { color: #0f4c81; border-color: #93c5fd; box-shadow: 0 .35rem 1rem rgba(15,76,129,.1); }
.obra-kpi:focus-visible, .obra-related-link:focus-visible { outline: 3px solid rgba(13,110,253,.28); outline-offset: 2px; }
.obra-kpi i { color: #0f6cbd; font-size: 1.25rem; }
.obra-kpi span { align-self: center; font-size: .78rem; line-height: 1.2; }
.obra-kpi strong { grid-column: 1 / -1; color: #0f172a; font-size: 1.65rem; }
.obra-date {
  width: 3rem; min-width: 3rem; padding: .35rem; border-radius: .6rem;
  background: #eff6ff; color: #0f4c81; text-align: center;
}
.obra-date strong, .obra-date span { display: block; line-height: 1.05; }
.obra-date strong { font-size: 1.1rem; }
.obra-date span { margin-top: .2rem; font-size: .65rem; }
.obra-empty-state {
  min-height: 13rem; padding: 2rem; color: #64748b; display: flex;
  flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
.obra-empty-state i { margin-bottom: .6rem; color: #94a3b8; font-size: 2rem; }
.obra-empty-state strong { color: #334155; }
.obra-related-link {
  color: #334155; display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; text-decoration: none;
}
.obra-related-link:hover strong { color: #0f6cbd; text-decoration: underline; }
.obra-related-link strong, .obra-related-link small { display: block; }
.obra-related-link small { margin-top: .1rem; color: #64748b; }
@media (max-width: 767.98px) {
  .obra-central-actions { width: 100%; }
  .obra-central-actions .btn { flex: 1 1 auto; }
  .obra-kpi { min-height: 6.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .obra-kpi { transition: none; }
}
/* RDO workspace: leitura e preenchimento orientados por assunto. */
.rdo-command-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border: 1px solid #dfe5ec;
    border-radius: .85rem;
    box-shadow: 0 .2rem .75rem rgba(30, 58, 95, .07);
}

.rdo-command-status,
.rdo-command-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.rdo-command-status .badge {
    font-size: .8rem;
    padding: .55rem .7rem;
}

.rdo-command-status div {
    display: flex;
    flex-direction: column;
}

.rdo-command-status small {
    color: #586779;
}

.rdo-command-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.rdo-command-actions form {
    margin: 0;
}

.rdo-workspace-tabs {
    gap: .35rem;
    padding: .4rem;
    overflow-x: auto;
    flex-wrap: nowrap;
    background: #eaf0f6;
    border: 1px solid #dce4ed;
    border-radius: .85rem .85rem 0 0;
    scrollbar-width: thin;
}

.rdo-workspace-tabs .nav-link {
    display: flex;
    align-items: center;
    gap: .2rem;
    white-space: nowrap;
    color: #405269;
    font-weight: 600;
    border: 0;
    border-radius: .6rem;
    padding: .65rem .85rem;
    transition: color .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.rdo-workspace-tabs .nav-link:hover {
    color: #1e3a5f;
    background: rgba(255, 255, 255, .65);
}

.rdo-workspace-tabs .nav-link.active {
    color: #1e3a5f;
    background: #fff;
    box-shadow: 0 .15rem .45rem rgba(30, 58, 95, .12);
}

.rdo-workspace-tabs .nav-link span {
    min-width: 1.35rem;
    padding: .08rem .35rem;
    border-radius: 2rem;
    background: #dfe7f0;
    color: #405269;
    font-size: .72rem;
    text-align: center;
}

.rdo-workspace-content {
    min-height: 20rem;
    padding: 1.25rem;
    background: #fff;
    border: 1px solid #dce4ed;
    border-top: 0;
    border-radius: 0 0 .85rem .85rem;
}

.rdo-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .85rem;
    margin-bottom: 1rem;
}

.rdo-summary-grid article {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .1rem .65rem;
    align-items: center;
    padding: 1rem;
    background: #f7f9fc;
    border: 1px solid #e1e7ee;
    border-radius: .7rem;
}

.rdo-summary-grid article > i {
    grid-row: 1 / 3;
    color: #f47920;
    font-size: 1.35rem;
}

.rdo-summary-grid span,
.rdo-summary-note > span {
    color: #586779;
    font-size: .78rem;
}

.rdo-summary-grid strong {
    color: #1e3a5f;
}

.rdo-summary-note {
    margin-bottom: 1rem;
    padding: 1rem;
    border-left: .25rem solid #f47920;
    background: #fffaf6;
    border-radius: .35rem;
}

.rdo-summary-note p {
    margin: .25rem 0 0;
    color: #26384c;
}

.rdo-form-intro {
    margin-bottom: 1rem;
    padding: .8rem 1rem;
    color: #405269;
    background: #edf5ff;
    border: 1px solid #cfdef0;
    border-radius: .65rem;
}

.rdo-form-intro div {
    display: flex;
    gap: .6rem;
    align-items: center;
}

.rdo-fill-overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .65rem;
    margin: 1rem 0;
}

.rdo-fill-step {
    display: flex;
    align-items: center;
    min-height: 4.25rem;
    gap: .7rem;
    padding: .75rem;
    color: #334155;
    text-decoration: none;
    background: #fff;
    border: 1px solid #dbe3ec;
    border-radius: .7rem;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.rdo-fill-step:hover,
.rdo-fill-step:focus-visible {
    color: #1e3a5f;
    border-color: #7da6d8;
    box-shadow: 0 .25rem .8rem rgba(30, 58, 95, .1);
}

.rdo-fill-step > i {
    display: grid;
    flex: 0 0 2.25rem;
    width: 2.25rem;
    height: 2.25rem;
    color: #52677f;
    background: #eef2f7;
    border-radius: 50%;
    place-items: center;
}

.rdo-fill-step span {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.rdo-fill-step strong {
    font-size: .9rem;
}

.rdo-fill-step small {
    overflow: hidden;
    color: #64748b;
    font-size: .76rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rdo-fill-step.is-ready > i {
    color: #146c43;
    background: #dff3e8;
}

.rdo-fill-step.is-pending {
    border-color: #f4c97a;
    background: #fffaf0;
}

.rdo-fill-step.is-pending > i {
    color: #9a6700;
    background: #fff0c2;
}

.rdo-fill-step.is-attention > i {
    color: #a61e2b;
    background: #fde7e9;
}

.rdo-fill-flow {
    display: grid;
    gap: 1rem;
}

.rdo-fill-card {
    padding: 1rem;
    scroll-margin-top: 5.5rem;
    background: #fff;
    border: 1px solid #dbe3ec;
    border-radius: .8rem;
    box-shadow: 0 .15rem .45rem rgba(30, 58, 95, .05);
}

.rdo-fill-card:target {
    border-color: #7da6d8;
    box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .1);
}

.rdo-reuse-team {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: .9rem 1rem;
    background: #eef6ff;
    border: 1px solid #bfd6ef;
    border-radius: .75rem;
}

.rdo-reuse-team > div {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.rdo-reuse-team > div > i {
    color: #2563eb;
    font-size: 1.35rem;
}

.rdo-reuse-team span {
    display: flex;
    flex-direction: column;
}

.rdo-reuse-team small {
    color: #52677f;
}

.rdo-reuse-team.is-applied {
    background: #f0faf4;
    border-color: #b9dfc9;
}

.rdo-reuse-team.is-applied > div > i {
    color: #198754;
}

.rdo-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.rdo-section-heading > div {
    display: flex;
    flex-direction: column;
}

.rdo-section-heading span {
    color: #1e3a5f;
    font-size: 1.05rem;
    font-weight: 700;
}

.rdo-section-heading small {
    color: #586779;
}

.rdo-entry-table {
    min-width: 850px;
    vertical-align: middle;
}

.rdo-entry-table thead th {
    color: #586779;
    background: #f6f8fb;
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}

.rdo-entry-table tbody tr:hover {
    background: #fbfcfe;
}

.rdo-sticky-save {
    position: sticky;
    z-index: 20;
    bottom: .75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1rem;
    color: #405269;
    background: rgba(255, 255, 255, .96);
    border: 1px solid #d6dee8;
    border-radius: .75rem;
    box-shadow: 0 .45rem 1.2rem rgba(30, 58, 95, .14);
    backdrop-filter: blur(8px);
}

.rdo-checklist-photo-requirement {
    padding: .75rem;
    border: 1px solid #fecaca;
    border-left: .25rem solid #dc3545;
    border-radius: .5rem;
    background: #fff7f7;
}

.rdo-checklist-photo-requirement:has(.text-success) {
    border-color: #bbf7d0;
    border-left-color: #198754;
    background: #f4fbf7;
}

@media (max-width: 991.98px) {
    .rdo-command-bar,
    .rdo-sticky-save {
        align-items: stretch;
        flex-direction: column;
    }

    .rdo-command-actions {
        justify-content: flex-start;
    }

    .rdo-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rdo-fill-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .rdo-command-actions > .btn,
    .rdo-command-actions > form,
    .rdo-command-actions > form .btn,
    .rdo-command-actions > .dropdown {
        width: 100%;
    }

    .rdo-command-actions .dropdown > .btn {
        width: 100%;
    }

    .rdo-summary-grid {
        grid-template-columns: 1fr;
    }

    .rdo-workspace-content {
        padding: 1rem;
    }

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

    .rdo-sticky-save > div,
    .rdo-sticky-save .btn {
        width: 100%;
    }

    .rdo-sticky-save > div {
        flex-direction: column;
    }

    .rdo-fill-overview {
        grid-template-columns: 1fr;
    }

    .rdo-fill-step {
        min-height: 3.75rem;
    }

    .rdo-fill-card {
        padding: .85rem;
    }

    .rdo-reuse-team {
        align-items: stretch;
        flex-direction: column;
    }

    .rdo-reuse-team .btn {
        min-height: 44px;
        width: 100%;
    }

    .rdo-fill-card .table-responsive {
        overflow: visible;
    }

    .rdo-entry-table {
        display: block;
        min-width: 0;
    }

    .rdo-entry-table thead {
        display: none;
    }

    .rdo-entry-table tbody,
    .rdo-entry-table tr,
    .rdo-entry-table td {
        display: block;
        width: 100%;
    }

    .rdo-entry-table tr {
        margin-bottom: .75rem;
        padding: .75rem;
        background: #f8fafc;
        border: 1px solid #dbe3ec;
        border-radius: .65rem;
    }

    .rdo-entry-table td {
        padding: .3rem 0;
        border: 0;
    }

    .rdo-entry-table td::before {
        display: block;
        margin-bottom: .2rem;
        color: #52677f;
        content: attr(data-label);
        font-size: .72rem;
        font-weight: 700;
    }

    .rdo-entry-table td[data-label="Ação"] {
        text-align: right;
    }

    .rdo-entry-table td[data-label="Ação"]::before {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rdo-fill-step {
        transition: none;
    }
}
