/* ==========================================================
   Caderneta de Obras — Design System
   ========================================================== */

:root {
    --navy-900: #101d2c;
    --navy-800: #16283c;
    --navy-700: #1b3a57;   /* azul do logo */
    --navy-600: #24425f;
    --orange-500: #f29f05; /* âmbar do logo (capacete) */
    --orange-600: #9a6200; /* âmbar escuro: texto e ícones sobre fundo claro */
    --orange-50: #fef5e1;
    --marca-azul: #1b3a57;
    --marca-cinza: #5b6b7b;
    --gray-50: #f7f8fa;
    --gray-100: #eef1f4;
    --gray-200: #e2e6eb;
    --gray-300: #cdd4db;
    --gray-400: #9aa5b1;
    --gray-500: #74808d;
    --gray-600: #545f6b;
    --gray-700: #3a4451;
    --gray-800: #262e38;
    --green-600: #1a9c63;
    --green-50: #e8f7f0;
    --red-600: #d9463f;
    --red-50: #fbebea;
    --blue-600: #2f6fed;
    --blue-50: #eaf1fe;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(16, 29, 44, 0.06);
    --shadow-md: 0 4px 16px rgba(16, 29, 44, 0.08);
    --sidebar-w: 250px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--gray-50);
    color: var(--gray-800);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    margin: 0;
    font-weight: 600;
    color: var(--navy-900);
}

p {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ---------- App shell ---------- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--navy-900);
    color: #cdd8e3;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 30;
    transition: transform 0.2s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    padding: 20px 20px 19px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

    .sidebar-brand:focus-visible {
        outline: 2px solid var(--orange-500);
        outline-offset: -4px;
        border-radius: var(--radius);
    }

/* ---------- Logo (símbolo do capacete + "Caderneta / DE OBRAS") ---------- */
.marca {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    vertical-align: middle;
}

.marca-simbolo {
    display: block;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.marca-texto {
    display: flex;
    flex-direction: column;
    font-family: 'Barlow', 'Inter', -apple-system, 'Segoe UI', sans-serif;
    font-weight: 600;
    line-height: 1;
}

.marca-nome {
    font-size: 23px;
    letter-spacing: -0.005em;
    color: var(--marca-azul);
}

.marca-sub {
    margin-top: 3px;
    font-size: 9.5px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--marca-cinza);
}

.marca-negativa .marca-nome {
    color: #fff;
}

.marca-negativa .marca-sub {
    color: #c3d0dc;
}

.marca-lg {
    gap: 13px;
}

    .marca-lg .marca-simbolo {
        width: 56px;
        height: 56px;
    }

    .marca-lg .marca-nome {
        font-size: 32px;
    }

    .marca-lg .marca-sub {
        margin-top: 4px;
        font-size: 11.5px;
    }

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

.nav-section-label {
    margin: 18px 10px 6px;
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #647587;
    font-weight: 600;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: #b7c3d1;
    font-size: 13.5px;
    font-weight: 500;
    border-left: 3px solid transparent;
}

    .nav-link i {
        font-size: 16px;
        width: 18px;
        text-align: center;
        color: #7f8fa1;
    }

    .nav-link:hover {
        background: rgba(255,255,255,0.06);
        color: #fff;
    }

        .nav-link:hover i {
            color: #fff;
        }

    .nav-link.active {
        background: rgba(242,159,5,0.12);
        color: #fff;
        border-left-color: var(--orange-500);
    }

        .nav-link.active i {
            color: var(--orange-500);
        }

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.logout-link i {
    color: #b7c3d1;
}

/* ---------- Content area ---------- */
.content-area {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: 66px;
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar h1 {
    font-size: 19px;
}

.icon-btn {
    border: 1px solid var(--gray-200);
    background: #fff;
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray-600);
}

    .icon-btn:hover {
        background: var(--gray-50);
    }

.sidebar-toggle {
    display: none;
}

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

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--navy-800);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12.5px;
}

.user-chip-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

    .user-chip-text strong {
        font-size: 13px;
        color: var(--gray-800);
    }

    .user-chip-text small {
        font-size: 11.5px;
        color: var(--gray-500);
    }

.page-content {
    padding: 26px 28px 60px;
    max-width: 1280px;
}

/* ---------- Page header (title + actions inside content) ---------- */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}

    .page-header h2 {
        font-size: 17px;
    }

.page-subtitle {
    color: var(--gray-500);
    font-size: 13px;
    margin-top: 4px;
}

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

/* ---------- Cards ---------- */
.card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.card-body {
    padding: 22px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--gray-100);
    gap: 12px;
    flex-wrap: wrap;
}

    .card-header h2 {
        font-size: 15px;
    }

.card-header-tools {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--gray-500);
    margin: 0 0 14px;
}

/* ---------- Stat cards ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    flex-shrink: 0;
}

.stat-icon-blue {
    background: var(--blue-50);
    color: var(--blue-600);
}

.stat-icon-orange {
    background: var(--orange-50);
    color: var(--orange-600);
}

.stat-icon-green {
    background: var(--green-50);
    color: var(--green-600);
}

.stat-icon-red {
    background: var(--red-50);
    color: var(--red-600);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--navy-900);
    line-height: 1.2;
}

.stat-label {
    font-size: 12.5px;
    color: var(--gray-500);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: var(--radius);
    font-size: 13.5px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
}

.btn-primary {
    background: var(--navy-800);
    color: #fff;
}

    .btn-primary:hover {
        background: var(--navy-700);
    }

/* Âmbar do logo com texto azul-escuro (texto branco sobre âmbar não tem contraste) */
.btn-accent {
    background: var(--orange-500);
    color: var(--navy-900);
}

    .btn-accent:hover {
        background: #e59400;
    }

.btn-secondary {
    background: #fff;
    color: var(--gray-700);
    border-color: var(--gray-300);
}

    .btn-secondary:hover {
        background: var(--gray-50);
    }

.btn-danger-ghost {
    background: #fff;
    color: var(--red-600);
    border-color: var(--red-50);
}

    .btn-danger-ghost:hover {
        background: var(--red-50);
    }

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12.5px;
}

/* ---------- Forms ---------- */
.form-field {
    margin-bottom: 16px;
}

    .form-field label {
        display: block;
        font-size: 12.5px;
        font-weight: 600;
        color: var(--gray-700);
        margin-bottom: 6px;
    }

.hint {
    display: block;
    font-weight: 400;
    color: var(--gray-400);
    font-size: 11.5px;
    margin-top: 4px;
}

.input, select.input, textarea.input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 13.5px;
    color: var(--gray-800);
    background: #fff;
}

    .input:focus, select.input:focus, textarea.input:focus {
        outline: none;
        border-color: var(--navy-600);
        box-shadow: 0 0 0 3px rgba(28,51,80,0.10);
    }

    .input[readonly] {
        background: var(--gray-50);
        color: var(--gray-500);
    }

textarea.input {
    resize: vertical;
    min-height: 90px;
}

.input-icon {
    position: relative;
}

    .input-icon i {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--gray-400);
        font-size: 14px;
    }

    .input-icon .input {
        padding-left: 36px;
    }

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

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0 18px;
}

.form-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0 18px;
}

.span-2 {
    grid-column: span 2;
}

.span-3 {
    grid-column: span 3;
}

.form-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray-600);
    cursor: pointer;
}

.link-muted {
    color: var(--gray-500);
    font-size: 13px;
    font-weight: 500;
}

    .link-muted:hover {
        color: var(--navy-700);
    }

.check-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 20px;
    margin-bottom: 6px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--gray-700);
}

.form-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px 22px;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

fieldset.form-section {
    border: none;
    padding: 0;
    margin: 0 0 26px;
}

    fieldset.form-section:last-child {
        margin-bottom: 0;
    }

/* ---------- Tri-state pill toggle (S / A / N) ---------- */
.tri-toggle {
    display: inline-flex;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    overflow: hidden;
}

    .tri-toggle button {
        border: none;
        background: #fff;
        padding: 6px 12px;
        font-size: 12px;
        font-weight: 600;
        color: var(--gray-500);
        cursor: pointer;
        border-right: 1px solid var(--gray-300);
    }

        .tri-toggle button:last-child {
            border-right: none;
        }

        .tri-toggle button.sel-s {
            background: var(--green-50);
            color: var(--green-600);
        }

        .tri-toggle button.sel-a {
            background: var(--orange-50);
            color: var(--orange-600);
        }

        .tri-toggle button.sel-n {
            background: var(--red-50);
            color: var(--red-600);
        }

.checklist-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
}

    .checklist-row:last-child {
        border-bottom: none;
    }

    .checklist-row span {
        font-size: 13.5px;
        color: var(--gray-700);
    }

/* ---------- Radio card group ---------- */
.radio-card-group {
    display: flex;
    gap: 10px;
    margin-bottom: 6px;
}

.radio-card {
    flex: 1;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--gray-600);
}

    .radio-card.selected {
        border-color: var(--navy-700);
        background: var(--gray-50);
        color: var(--navy-900);
        font-weight: 600;
    }

/* ---------- Tables ---------- */
.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

    .data-table th {
        text-align: left;
        font-size: 11.5px;
        text-transform: uppercase;
        letter-spacing: .04em;
        color: var(--gray-500);
        background: var(--gray-50);
        padding: 11px 22px;
        border-bottom: 1px solid var(--gray-200);
        white-space: nowrap;
    }

    .data-table td {
        padding: 13px 22px;
        border-bottom: 1px solid var(--gray-100);
        font-size: 13.5px;
        color: var(--gray-700);
        vertical-align: middle;
    }

    .data-table tr:last-child td {
        border-bottom: none;
    }

    .data-table tbody tr:hover {
        background: var(--gray-50);
    }

.cell-strong {
    color: var(--gray-800);
    font-weight: 600;
}

.cell-muted {
    color: var(--gray-400);
}

.table-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.table-link {
    color: var(--navy-700);
    font-weight: 600;
    font-size: 13px;
}

    .table-link:hover {
        text-decoration: underline;
    }

.row-icon-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--gray-200);
    background: #fff;
    color: var(--gray-500);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

    .row-icon-btn:hover {
        background: var(--gray-50);
        color: var(--navy-800);
    }

    .row-icon-btn.danger:hover {
        color: var(--red-600);
        background: var(--red-50);
        border-color: var(--red-50);
    }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 11.5px;
    font-weight: 600;
}

.badge-green {
    background: var(--green-50);
    color: var(--green-600);
}

.badge-orange {
    background: var(--orange-50);
    color: var(--orange-600);
}

.badge-blue {
    background: var(--blue-50);
    color: var(--blue-600);
}

.badge-red {
    background: var(--red-50);
    color: var(--red-600);
}

.badge-gray {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* ---------- Toolbar / filters ---------- */
.toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
}

    .search-box i {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--gray-400);
        font-size: 13px;
    }

    .search-box .input {
        padding-left: 34px;
        width: 240px;
    }

.select-filter, select.select-filter, input.select-filter {
    width: auto;
    min-width: 150px;
}

/* ---------- Tabs ---------- */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--gray-200);
    padding: 0 22px;
}

.tab-btn {
    padding: 13px 6px;
    margin-right: 22px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--gray-500);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

    .tab-btn:hover {
        color: var(--navy-800);
    }

    .tab-btn.active {
        color: var(--navy-900);
        border-bottom-color: var(--orange-500);
    }

.tab-panel {
    display: none;
    padding: 22px;
}

    .tab-panel.active {
        display: block;
    }

/* ---------- Detail summary ---------- */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .detail-item span.label {
        font-size: 11.5px;
        text-transform: uppercase;
        letter-spacing: .04em;
        color: var(--gray-400);
        font-weight: 600;
    }

    .detail-item span.value {
        font-size: 14px;
        color: var(--gray-800);
        font-weight: 500;
    }

.obra-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ---------- Empty state ---------- */
.empty-state {
    text-align: center;
    padding: 46px 20px;
    color: var(--gray-500);
}

    .empty-state i {
        font-size: 30px;
        color: var(--gray-300);
        margin-bottom: 10px;
        display: block;
    }

    .empty-state h3 {
        font-size: 14.5px;
        color: var(--gray-700);
        margin-bottom: 6px;
    }

    .empty-state p {
        font-size: 13px;
        margin-bottom: 16px;
    }

/* ---------- Signature box ---------- */
.signature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.signature-box {
    border: 1px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 18px;
    text-align: center;
    color: var(--gray-500);
}

    .signature-box > i {
        font-size: 22px;
        color: var(--gray-300);
        display: block;
        margin-bottom: 8px;
    }

    .signature-box strong {
        display: block;
        color: var(--gray-700);
        font-size: 13.5px;
        margin-bottom: 4px;
    }

/* ---------- Photo grid ---------- */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.photo-tile {
    aspect-ratio: 4/3;
    border-radius: var(--radius);
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    font-size: 22px;
}

/* ---------- Login page ---------- */
.auth-body {
    background: var(--navy-900);
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 34px 32px 28px;
    box-shadow: var(--shadow-md);
}

.auth-brand {
    text-align: center;
    margin-bottom: 24px;
}

    .auth-brand h1 {
        font-size: 19px;
        margin-top: 14px;
    }

    .auth-brand p {
        font-size: 12.5px;
        color: var(--gray-500);
        margin-top: 4px;
    }

.auth-footer-note {
    text-align: center;
    font-size: 11.5px;
    color: var(--gray-400);
    margin-top: 18px;
    line-height: 1.5;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .sidebar {
        transform: translateX(-100%);
    }

        .sidebar.open {
            transform: translateX(0);
        }

    .content-area {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: flex;
    }

    .stat-grid, .form-grid, .form-grid-3, .form-grid-4, .detail-grid, .photo-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .signature-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================
   Complementos da versão PHP
   ========================================================== */

button.nav-link {
    width: 100%;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
}

.sidebar-footer form {
    margin: 0;
}

.table-actions form {
    display: inline-flex;
    margin: 0;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13.5px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.alert-sucesso {
    background: var(--green-50);
    color: #12724a;
    border-color: #bfe7d5;
}

.alert-erro {
    background: var(--red-50);
    color: #a8332d;
    border-color: #f2c9c6;
}

.alert-info {
    background: var(--blue-50);
    color: #2457bd;
    border-color: #c9dafc;
}

.field-error {
    display: block;
    color: var(--red-600);
    font-size: 12px;
    margin-top: 5px;
    font-weight: 500;
}

/* Alerta que não impede salvar (ex.: possível erro de digitação no e-mail) */
.field-aviso {
    display: block;
    color: var(--orange-600);
    font-size: 12px;
    margin-top: 5px;
    font-weight: 500;
}

.input[aria-invalid="true"] {
    border-color: var(--red-600);
}

/* Aviso fixo no topo das páginas do administrador (ex.: e-mail não configurado) */
.alert-sistema {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: var(--orange-50);
    color: #7a4e00;
    border-color: #f3dba5;
}

    .alert-sistema .bi {
        font-size: 16px;
        line-height: 1.3;
    }

    .alert-sistema a {
        color: inherit;
        font-weight: 600;
    }

.historico-assinaturas {
    border-top: 1px solid var(--gray-200);
    padding: 14px 20px 6px;
}

    .historico-assinaturas summary {
        cursor: pointer;
        font-size: 13px;
        font-weight: 600;
        color: var(--gray-600);
    }

    .historico-assinaturas .page-subtitle {
        margin: 8px 0 12px;
    }

.signature-ip {
    display: block;
    font-size: 11.5px;
    color: var(--gray-500);
    margin-top: 4px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.is-disabled {
    opacity: .75;
    pointer-events: none;
}

.input:disabled, textarea.input:disabled {
    background: var(--gray-50);
    color: var(--gray-700);
}

.text-body {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--gray-700);
    margin-bottom: 14px;
}

.divider {
    border: none;
    border-top: 1px solid var(--gray-200);
    margin: 22px 0;
}

.detail-item.span-2 {
    grid-column: span 2;
}

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

.auth-card-wide {
    max-width: 640px;
}

/* ---------- Fotos ---------- */
.upload-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 18px;
}

    .upload-bar .input {
        width: auto;
        flex: 1 1 200px;
    }

.photo-card {
    margin: 0;
}

    .photo-card .photo-tile {
        overflow: hidden;
    }

    .photo-card img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .photo-card figcaption {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 2px 8px;
        align-items: center;
        margin-top: 6px;
        font-size: 12.5px;
        color: var(--gray-700);
    }

        .photo-card figcaption small {
            color: var(--gray-400);
            grid-column: 1;
        }

        .photo-card figcaption form {
            grid-column: 2;
            grid-row: 1 / span 2;
        }

@media (max-width: 960px) {
    .detail-item.span-2 {
        grid-column: span 2;
    }

    .data-table th, .data-table td {
        padding-left: 14px;
        padding-right: 14px;
    }
}

@media (max-width: 600px) {
    .stat-grid, .form-grid, .form-grid-3, .form-grid-4, .detail-grid, .photo-grid, .check-grid, .detail-grid-2 {
        grid-template-columns: 1fr;
    }

    .span-2, .span-3, .detail-item.span-2 {
        grid-column: auto;
    }

    .page-content {
        padding: 18px 16px 48px;
    }

    .topbar {
        padding: 0 16px;
    }

    .user-chip-text {
        display: none;
    }

    .radio-card-group {
        flex-direction: column;
    }

    .search-box .input {
        width: 100%;
    }

    .tabs {
        overflow-x: auto;
    }
}

.form-field label .hint {
    display: inline;
    margin-left: 4px;
}

/* mantém a faixa escura da barra lateral em páginas longas (impressão / captura) */
@media (min-width: 961px) {
    .app-shell {
        background: linear-gradient(to right, var(--navy-900) var(--sidebar-w), transparent var(--sidebar-w));
    }
}

html:has(body.auth-body), body.auth-body {
    background: var(--navy-900);
    min-height: 100%;
}

.auth-brand .marca {
    margin-bottom: 4px;
}

.auth-brand h1.auth-logo {
    margin-top: 0;
    font-size: inherit;
    font-weight: inherit;
}

.auth-brand h1.auth-logo + p {
    margin-top: 12px;
}

/* ---------- Assinaturas pendentes (painel) ---------- */
.card-alert {
    border-left: 4px solid var(--orange-500);
}

.card-alert-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-alert-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--orange-50);
    color: var(--orange-600);
    font-size: 18px;
}

.card-alert .page-subtitle strong {
    color: var(--navy-900);
}

.data-table tr.row-highlight td {
    background: var(--orange-50);
}

.acoes-assinatura {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.acoes-assinatura form {
    margin: 0;
}

.btn[disabled] {
    opacity: .6;
    cursor: not-allowed;
}

/* ---------- Caixas de assinatura ---------- */
.signature-box.is-signed {
    border-style: solid;
    border-color: #bfe7d5;
    background: #fbfefc;
}

.signature-box.is-signed > i {
    color: var(--green-600);
}

.signature-status {
    margin-top: 8px;
}

.signature-note {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--red-600);
}

.signature-actions {
    margin-top: 10px;
    display: flex;
    justify-content: center;
}

.signature-actions .acoes-assinatura {
    align-items: center;
}

.recusa-box {
    margin-top: 16px;
    border-top: 1px solid var(--gray-200);
    padding-top: 12px;
}

.recusa-box summary {
    cursor: pointer;
    font-size: 13px;
    color: var(--gray-500);
}

/* ---------- Requisitos do termo de conclusão ---------- */
.req-list {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: 640px;
}

.req-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13.5px;
    color: var(--gray-700);
}

.req-list li:last-child {
    border-bottom: none;
}

.req-list li i {
    font-size: 16px;
    margin-top: 1px;
}

.req-list li.ok i {
    color: var(--green-600);
}

.req-list li.pendente i {
    color: var(--red-600);
}

.req-list small {
    color: var(--gray-500);
}

/* Pendências no celular: cada assinatura vira um cartão, com o botão sempre visível */
@media (max-width: 600px) {
    .tabela-pendentes thead {
        display: none;
    }

    .tabela-pendentes, .tabela-pendentes tbody, .tabela-pendentes tr, .tabela-pendentes td {
        display: block;
        width: 100%;
    }

    .tabela-pendentes tr {
        padding: 12px 16px;
        border-bottom: 1px solid var(--gray-200);
    }

    .tabela-pendentes tr.row-highlight {
        background: var(--orange-50);
    }

    .tabela-pendentes td,
    .data-table.tabela-pendentes td {
        border: none;
        padding: 2px 0;
        background: transparent;
    }

    .tabela-pendentes td[data-rotulo]::before {
        content: attr(data-rotulo) ": ";
        color: var(--gray-500);
    }

    .tabela-pendentes td:last-child {
        padding-top: 10px;
    }

    .tabela-pendentes .table-actions {
        justify-content: flex-start;
    }
}
