* {
    box-sizing: border-box;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
    margin: 0;
    background: #f0f2f5;
    color: #2c3e50;
}

:root {
    --surface-bg: #ffffff;
    --surface-border: #e5e7eb;
    --surface-header-bg: #f8fafc;
    --surface-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
    --surface-radius: 12px;
    --surface-title: #111827;
    --surface-muted: #6b7280;
    --badge-bg: #eef2ff;
    --badge-color: #1d4ed8;
}

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

.sidebar {
    width: 252px;
    background: #0f172a;
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 0;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
}

.sidebar-brand {
    padding: 22px 20px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo {
    max-width: 130px;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

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

.sidebar-nav-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.25);
    padding: 0 10px 10px;
}

.sidebar-link {
    color: #fff;
    text-decoration: none;
    padding: 9px 12px;
    border-radius: 8px;
    border-left: 3px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 0.88rem;
    font-weight: 500;
    position: relative;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.9);
}

.sidebar-link:hover .sidebar-icon { color: rgba(255, 255, 255, 0.7); }

.sidebar-link.active {
    background: rgba(34, 197, 94, 0.1);
    border-left-color: #22c55e;
    color: #fff;
    font-weight: 600;
}

.sidebar-link.active .sidebar-icon { color: #4ade80; }

.sidebar-icon {
    min-width: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.35);
    transition: color 0.15s ease;
    flex-shrink: 0;
}

.sidebar-notification-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #fb923c;
    box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.18);
    margin-left: auto;
    flex-shrink: 0;
}

.sidebar-footer {
    margin-top: auto;
    padding: 0 12px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 10px 10px;
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    text-transform: uppercase;
}

.sidebar-user-info strong {
    display: block;
    font-size: 0.86rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.sidebar-user-info small {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.38);
}

.logout-link {
    color: rgba(255, 255, 255, 0.45);
    background: transparent;
    border-left-color: transparent !important;
}

.logout-link:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #f87171;
}

.logout-link:hover .sidebar-icon { color: #f87171; }

.main-content {
    margin-left: 252px;
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.card {
    background: var(--surface-bg);
    padding: 20px;
    border: 1px solid var(--surface-border);
    border-radius: var(--surface-radius);
    box-shadow: var(--surface-shadow);
}

.page-card {
    min-height: calc(100vh - 60px);
}

.app-card,
.app-surface {
    background: var(--surface-bg);
    border: 1px solid var(--surface-border);
    border-radius: var(--surface-radius);
    box-shadow: var(--surface-shadow);
    overflow: hidden;
}

.app-card-header {
    background: var(--surface-header-bg);
    border-bottom: 1px solid var(--surface-border);
    padding: 14px 20px;
}

.app-card-header h4,
.app-card-title {
    margin: 0;
    color: var(--surface-title);
    font-size: 0.92rem;
    font-weight: 700;
}

.app-card-body {
    padding: 16px 20px;
}

.app-badge,
.counter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    min-height: 26px;
    border-radius: 999px;
    padding: 4px 10px;
    background: var(--badge-bg);
    color: var(--badge-color);
    font-size: 0.82rem;
    font-weight: 700;
}

.clean-card {
    background: var(--surface-bg);
    border: 1px solid var(--surface-border);
    border-radius: var(--surface-radius);
    box-shadow: var(--surface-shadow);
    overflow: hidden;
}

.clean-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--surface-border);
    background: var(--surface-header-bg);
    flex-wrap: wrap;
}

.clean-card-header h4 {
    margin: 0;
    color: var(--surface-title);
    font-size: 0.94rem;
    font-weight: 700;
}

.clean-card-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.clean-filter-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 16px;
    border-bottom: 1px solid var(--surface-border);
    background: #fff;
}

.clean-filter-row .f-input,
.clean-filter-row .f-select,
.clean-filter-row input,
.clean-filter-row select {
    width: auto;
    min-width: 180px;
}

.clean-list {
    display: flex;
    flex-direction: column;
}

.clean-list-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--surface-border);
    background: #fbfcfd;
    color: #6b7280;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.clean-list-header .clean-actions,
.clean-list-header-actions {
    color: #6b7280;
    font-size: 0.72rem;
    font-weight: 700;
}

.clean-list-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid #edf0f3;
    background: #fff;
    transition: background 0.15s ease;
}

.clean-list-item:last-child {
    border-bottom: none;
}

.clean-list-item:hover {
    background: #f8fafc;
}

.clean-list-main {
    min-width: 0;
    flex: 1;
}

.clean-list-title {
    color: var(--surface-title);
    font-size: 0.94rem;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
    word-break: break-word;
}

.clean-list-title:hover {
    color: #2563eb;
}

.clean-title-button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    text-align: left;
}

.clean-list-meta {
    margin-top: 5px;
    color: var(--surface-muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

.clean-list-note {
    margin-top: 4px;
    color: #4b5563;
    font-size: 0.84rem;
    line-height: 1.35;
    word-break: break-word;
}

.clean-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 4px 10px;
    background: var(--badge-bg);
    color: var(--badge-color);
    border: 1px solid #dbeafe;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
}

.clean-badge-muted {
    background: #f3f4f6;
    color: #4b5563;
    border-color: #e5e7eb;
}

.clean-badge-success {
    background: #ecfdf3;
    color: #166534;
    border-color: #bbf7d0;
}

.clean-badge-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

.clean-badge-danger {
    background: #fff1f2;
    color: #b91c1c;
    border-color: #fecdd3;
}

.clean-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.clean-action-link,
.clean-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.clean-action-link:hover,
.clean-action-button:hover {
    background: #f8fafc;
    color: #111827;
}

.clean-action-primary {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.clean-action-primary:hover {
    background: #1d4ed8;
    color: #fff;
}

.clean-empty {
    padding: 28px 16px;
    color: #9ca3af;
    font-size: 0.9rem;
    text-align: center;
}

.clean-meta-separator {
    color: #d1d5db;
    margin: 0 6px;
}

.employee-row {
    padding: 8px 12px;
    align-items: center;
}

.employee-grid {
    display: grid;
    grid-template-columns: minmax(180px, 1.25fr) minmax(110px, 0.75fr) minmax(74px, 0.5fr) minmax(220px, 1.6fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.employee-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.employee-field,
.employee-works {
    color: var(--surface-muted);
    font-size: 0.82rem;
    line-height: 1.25;
    min-width: 0;
}

.employee-field {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.employee-company {
    justify-self: start;
    padding: 3px 8px;
    font-size: 0.74rem;
}

.employee-works {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    overflow: hidden;
}

.employee-works-label {
    color: #9ca3af;
    flex-shrink: 0;
}

.employee-work-badge {
    padding: 2px 7px;
    font-size: 0.72rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
}

.compact-row {
    padding: 8px 12px;
    align-items: center;
}

.compact-grid {
    display: grid;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.builder-grid {
    grid-template-columns: minmax(170px, 1.2fr) minmax(120px, 0.9fr) minmax(90px, 0.7fr) minmax(120px, 0.8fr) minmax(90px, 0.65fr);
}

.epi-grid {
    grid-template-columns: minmax(170px, 1.15fr) minmax(170px, 1.1fr) minmax(110px, 0.7fr) minmax(220px, 1.35fr);
}

.epi-detail-grid {
    grid-template-columns: minmax(170px, 1.2fr) minmax(100px, 0.7fr) minmax(90px, 0.65fr) minmax(90px, 0.65fr) minmax(120px, 0.8fr);
}

.user-grid {
    grid-template-columns: minmax(150px, 1.2fr) minmax(180px, 1.4fr) minmax(90px, 0.7fr) minmax(80px, 0.6fr);
}

.compact-title,
.compact-field,
.compact-note {
    min-width: 0;
    line-height: 1.25;
}

.compact-title {
    color: var(--surface-title);
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-title:hover {
    color: #2563eb;
}

.compact-field,
.compact-note {
    color: var(--surface-muted);
    font-size: 0.8rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-note {
    color: #4b5563;
}

.clean-action-danger {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #b91c1c;
}

.clean-action-danger:hover {
    background: #ffe4e6;
    color: #991b1b;
}

.icon-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.icon-btn svg {
    width: 16px;
    height: 16px;
}

.icon-btn:hover {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #2563eb;
}

.icon-btn-success {
    color: #16a34a;
}

.icon-btn-success:hover {
    background: #ecfdf3;
    border-color: #bbf7d0;
    color: #15803d;
}

.icon-btn-danger {
    color: #dc2626;
}

.icon-btn-danger:hover {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #b91c1c;
}

.icon-btn-muted {
    color: #475569;
}

#listaConstrutoras .clean-list-header,
#listaConstrutoras .compact-row {
    gap: 12px;
}

#listaConstrutoras .clean-actions {
    width: 80px;
    justify-content: flex-end;
}

#listaConstrutoras .builder-grid .clean-badge {
    justify-self: start;
    min-width: auto;
    min-height: 22px;
    padding: 2px 9px;
    font-size: 0.72rem;
}

#listaUsuarios .clean-actions {
    width: 80px;
    justify-content: flex-end;
}

#listaUsuarios .user-grid .clean-badge {
    justify-self: start;
    min-width: auto;
    min-height: 22px;
    padding: 2px 9px;
    font-size: 0.72rem;
}

.page-title {
    margin-top: 0;
    color: #2c3e50;
}

.page-title-green {
    color: #2563eb;
}

.toolbar,
.form-row,
.actions-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.toolbar {
    align-items: end;
    margin-bottom: 20px;
}

.toolbar-panel {
    background: var(--surface-bg);
    padding: 16px 20px;
    border-radius: var(--surface-radius);
    border: 1px solid var(--surface-border);
    box-shadow: var(--surface-shadow);
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 130px;
}

.form-group label,
.stack-form label {
    font-weight: 600;
    font-size: 0.88rem;
    color: #374151;
}

.flex-1 {
    flex: 1;
}

.flex-2 {
    flex: 2;
    min-width: 200px;
}

input,
select,
textarea,
.btn {
    border-radius: 8px;
}

input,
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    font-size: 0.92rem;
    color: #111827;
}

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

.stack-form {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.82rem;
}

.btn-primary {
    background: #2563eb;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-success {
    background: #16a34a;
}

.btn-success:hover {
    background: #15803d;
}

.btn-danger {
    background: #dc2626;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-warning {
    background: #f59e0b;
    color: #111827;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-green {
    background: #2563eb;
}

.btn-green:hover {
    background: #1d4ed8;
}

.btn-dark-green {
    background: #1d4ed8;
}

.link-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.table-wrapper {
    overflow-x: auto;
}

.excel-table,
.default-table {
    border-collapse: collapse;
    width: 100%;
}

.excel-table {
    white-space: nowrap;
    font-size: 0.85rem;
}

.excel-table th,
.excel-table td,
.default-table th,
.default-table td {
    border: 1px solid #555;
    padding: 6px;
    text-align: center;
}

.default-table th,
.default-table td {
    border-color: #ccc;
    padding: 10px;
}

.excel-table th,
.col-nome {
    background: #3b82f6;
    color: #fff;
}

.default-table thead tr {
    background: #eee;
}

.col-nome {
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 2;
    border-right: 2px solid #555;
    min-width: 250px;
}

.col-fim-semana {
    background: #fcd5b4 !important;
    color: #000;
}

.input-excel {
    width: 100%;
    border: none;
    text-align: center;
    background: transparent;
    height: 25px;
    font-weight: bold;
    font-size: 14px;
    padding: 0;
}

.input-excel:focus {
    background: #fff;
    outline: 2px solid #3498db;
}

.extra-input {
    color: #c0392b;
}

.row-extra {
    font-size: 0.75rem;
    color: #666;
}

.label-extra {
    font-size: 0.75rem;
    font-style: italic;
    color: #999;
    text-align: right !important;
    padding-right: 10px !important;
    background: #fff;
}

.funcionario-cell {
    font-weight: bold;
    text-align: left;
    padding-left: 10px;
    background: #fff;
}

.total-header {
    background: #17375e !important;
    color: #fff !important;
}

.total-cell {
    font-weight: bold;
}

.total-cell-blue {
    background: #e6f2ff;
}

.total-cell-yellow,
.resumo-total-label,
.resumo-total-valor {
    background: #fff2cc !important;
    color: #000 !important;
}

.resumo-financeiro {
    margin-top: 30px;
    width: 350px;
    max-width: 100%;
}

.resumo-valor {
    font-weight: bold;
    font-size: 1.1rem;
}

.resumo-total-label {
    text-align: right !important;
}

.resumo-total-valor {
    font-size: 1.2rem;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
    margin-bottom: 0;
    cursor: pointer;
}

.split-layout {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.panel {
    flex: 1;
    min-width: 300px;
    background: var(--surface-bg);
    border: 1px solid var(--surface-border);
    border-radius: var(--surface-radius);
    padding: 20px 24px;
    box-shadow: var(--surface-shadow);
}

.panel-muted {
    background: var(--surface-header-bg);
    border: 1px solid var(--surface-border);
    border-radius: var(--surface-radius);
    padding: 20px 24px;
}

.section-title {
    margin-top: 0;
}

.section-blue {
    color: #2980b9;
}

.section-gray {
    color: #7f8c8d;
}

.section-orange {
    color: #d35400;
}

.section-green {
    color: #27ae60;
}

.top-gap {
    margin-top: 30px;
}

.note-card {
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--surface-border);
}

.note-card p {
    margin: 6px 0 0;
    font-size: 0.92rem;
    color: #374151;
}

.note-sent {
    background: #f8fafc;
    border-left: 4px solid #9ca3af;
}

.note-warning {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    padding: 14px 16px;
}

.note-success {
    background: #f0fdf4;
    border-left: 4px solid #22c55e;
}

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

.note-highlight {
    font-size: 0.96rem;
    color: #1f2937;
    font-weight: 500;
}

.note-done {
    color: #6b7280;
    text-decoration: line-through;
}

.note-status-pending {
    color: #d97706;
    font-weight: 600;
    font-size: 0.82rem;
}

.note-status-done {
    color: #16a34a;
    font-weight: 600;
    font-size: 0.82rem;
}

.summary-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
}

.summary-card {
    background: var(--surface-bg);
    padding: 20px;
    border-radius: var(--surface-radius);
    box-shadow: var(--surface-shadow);
    flex: 1 1 200px;
    border: 1px solid var(--surface-border);
    border-top: 3px solid #dbeafe;
}

.summary-card h4,
.summary-card h2 {
    margin: 0;
}

.summary-card h4 {
    color: var(--surface-muted);
    margin-bottom: 5px;
}

.summary-dark {
    border-top-color: #d1d5db;
}

.summary-green {
    border-top-color: #bbf7d0;
}

.summary-blue {
    border-top-color: #dbeafe;
}

.summary-green h2 {
    color: #16a34a;
}

.summary-blue h2 {
    color: #2563eb;
}

.chart-card {
    background: var(--surface-bg);
    padding: 24px;
    border-radius: var(--surface-radius);
    border: 1px solid var(--surface-border);
    box-shadow: var(--surface-shadow);
    margin-top: 20px;
}

.loading-text {
    display: none;
    font-weight: bold;
    color: #f39c12;
    margin-bottom: 20px;
}

.alerts-container {
    position: fixed;
    bottom: 20px;
    left: 270px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alert-box {
    background: #f1c40f;
    color: #2c3e50;
    padding: 15px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    font-size: 0.95rem;
    border-left: 5px solid #e67e22;
    animation: slideIn 0.5s ease-out;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.alert-link {
    text-decoration: none;
    color: inherit;
    flex: 1;
}

.alert-link small {
    opacity: 0.7;
}

.alert-close {
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2rem;
    color: #c0392b;
    background: transparent;
    border: none;
}

.align-center {
    text-align: center;
}

.inline-form {
    display: inline;
    margin: 0;
}

.action-link,
.action-button {
    font-weight: bold;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
}

.action-edit {
    color: #f39c12;
    margin-right: 10px;
}

.action-delete {
    color: #e74c3c;
}

.status-ok {
    color: #27ae60;
    font-weight: bold;
}

.muted-text {
    color: #999;
    font-size: 0.8rem;
}

.actions-col {
    width: 120px;
}

.small-text {
    font-size: 0.85rem;
}

.font-bold {
    font-weight: bold;
}

.empresa-vyk {
    color: #2980b9;
}

.empresa-goult {
    color: #27ae60;
}

.highlight-blue {
    color: #3498db;
}

.badge {
    color: #fff;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    text-transform: capitalize;
}

.badge-master {
    background: #9b59b6;
}

.badge-operador {
    background: #95a5a6;
}

.login-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #2c3e50;
}

.page-section-planilha {
    overflow-x: auto;
    overflow-y: hidden;
}

.page-section-planilha .table-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
}

.page-section-planilha .excel-table {
    width: auto;
    min-width: 100%;
    white-space: nowrap;
}

.page-section-planilha .celula-wrapper {
    min-width: 64px;
}

.page-section-planilha .input-excel {
    min-width: 40px;
}

.login-card h2 {
    margin: 0;
    text-align: center;
    color: #2c3e50;
}

.flash-message {
    padding: 10px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.flash-error {
    background: #fdecea;
    color: #c0392b;
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 900px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        inset: auto;
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
    }

    .app-shell {
        flex-direction: column;
    }

    .alerts-container {
        left: 20px;
        right: 20px;
        bottom: 20px;
    }

    .page-card {
        min-height: auto;
    }
}

.celula-com-obs {
    position: relative;
    padding: 0 !important;
}

.celula-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.obs-icone {
    position: absolute;
    top: 2px;
    right: 4px;
    cursor: pointer;
    font-size: 10px;
    line-height: 1;
    z-index: 5;
}

.obs-indicador {
    color: #f39c12;
    font-weight: bold;
}

.obs-indicador.obs-vazio {
    color: #d0d0d0;
}
.modal-observacao {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-observacao-content {
    background: #ffffff;
    width: 100%;
    max-width: 520px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.modal-observacao-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-observacao-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #2c3e50;
}

.modal-fechar {
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: #7f8c8d;
}

.modal-fechar:hover {
    color: #e74c3c;
}

.modal-observacao-body {
    padding: 20px;
}

.observacao-textarea {
    width: 100%;
    min-height: 140px;
    resize: vertical;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    padding: 12px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}

.observacao-textarea:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.15);
}

.modal-observacao-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px 20px 20px;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.observacao-texto-leitura {
    min-height: 80px;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #dfe6e9;
    border-radius: 8px;
    color: #2c3e50;
    line-height: 1.5;
    margin-bottom: 12px;
    white-space: pre-wrap;
}

.observacao-meta {
    font-size: 13px;
    color: #636e72;
    line-height: 1.6;
}
.login-page {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
    position: relative;

    background:
        linear-gradient(rgba(16, 36, 56, 0.72), rgba(16, 36, 56, 0.82)),
        url('/static/bg-login.png') no-repeat center center;

    background-size: cover;
}

.login-layout {
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    position: relative;
    z-index: 2;
}

.login-page::before {
    content: "";
    position: absolute;
    inset: 0;
    backdrop-filter: blur(2px);
}

.login-layout {
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    position: relative;
    z-index: 2;
}

.login-brand-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: #ffffff;
}

.login-brand-content {
    max-width: 520px;
}

.login-brand-badge {
    display: inline-block;
    margin-bottom: 22px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.login-brand-content h1 {
    margin: 0 0 18px;
    font-size: 2.6rem;
    line-height: 1.1;
    color: #ffffff;
}

.login-brand-content p {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.82);
    max-width: 460px;
}

.login-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: transparent;
    backdrop-filter: none;
}

.login-card {
    width: 100%;
    max-width: 430px;
    background: #ffffff;
    border-radius: 20px;
    padding: 38px 34px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    gap: 18px;
    border: 1px solid rgba(44, 62, 80, 0.08);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(6px);
}

.login-header h2 {
    margin: 0 0 8px;
    color: #1f3550;
    font-size: 2rem;
}

.login-header p {
    margin: 0;
    color: #6b7a8c;
    font-size: 0.98rem;
    line-height: 1.5;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-field label {
    font-size: 0.92rem;
    font-weight: 700;
    color: #2c3e50;
}

.login-field input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #d8dee6;
    border-radius: 12px;
    background: #f8fafc;
    font-size: 0.98rem;
    color: #2c3e50;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.login-field input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.login-submit {
    margin-top: 6px;
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 10px 24px rgba(59, 130, 246, 0.22);
}

.login-submit:hover {
    transform: translateY(-1px);
    opacity: 0.98;
}

.login-submit:active {
    transform: translateY(0);
}

.flash-message {
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 0.92rem;
    line-height: 1.4;
}

.flash-error {
    background: #fdecea;
    color: #b42318;
    border: 1px solid #f5c2c7;
}

.flash-success {
    background: #ecfdf3;
    color: #027a48;
    border: 1px solid #abefc6;
}

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

    .login-brand-panel {
        display: none;
    }

    .login-form-panel {
        padding: 24px;
    }

    .login-card {
        max-width: 460px;
        padding: 30px 24px;
        border-radius: 16px;
    }

    .login-header h2 {
        font-size: 1.7rem;
    }
}
.login-header-bar {
    position: absolute;
    top: 20px;
    left: 30px;
}

.login-header-bar img {
    height: 40px;
    object-fit: contain;
}
.login-main-logo {
    margin-bottom: 20px;
}

.login-main-logo img {
    height: 120px; /* aqui está o +100% (ajuste fino depois) */
    object-fit: contain;
}
.login-brand-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.funcionario-form-card {
    background: var(--surface-bg);
    border: 1px solid var(--surface-border);
    border-radius: var(--surface-radius);
    box-shadow: var(--surface-shadow);
    padding: 20px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.default-table tbody tr:hover {
    background: #f8fafc;
}

.default-table td,
.default-table th {
    vertical-align: middle;
}

@media (max-width: 900px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .clean-card-header {
        align-items: stretch;
    }

    .clean-card-tools,
    .clean-filter-row,
    .clean-list-item {
        flex-direction: column;
        align-items: stretch;
    }

    .clean-filter-row .f-input,
    .clean-filter-row .f-select,
    .clean-filter-row input,
    .clean-filter-row select,
    .clean-actions .clean-action-link,
    .clean-actions .clean-action-button,
    .clean-actions .btn,
    .clean-actions .btn-secondary {
        width: 100%;
    }

    .clean-actions {
        justify-content: flex-start;
    }

    .clean-list-header {
        display: none;
    }

    .employee-row {
        align-items: stretch;
        padding: 10px 12px;
    }

    .employee-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .employee-name,
    .employee-field {
        white-space: normal;
    }

    .employee-works {
        flex-wrap: wrap;
        overflow: visible;
    }

    #listaConstrutoras .clean-actions {
        width: auto;
        justify-content: flex-start;
    }

    #listaUsuarios .clean-actions {
        width: auto;
        justify-content: flex-start;
    }

    .compact-row {
        align-items: stretch;
        padding: 10px 12px;
    }

    .compact-grid,
    .builder-grid,
    .epi-grid,
    .epi-detail-grid,
    .user-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .compact-title,
    .compact-field,
    .compact-note {
        white-space: normal;
    }
}

/* ============================================================
   Cards minimalistas — usados em index.html e perfil.html
   ============================================================ */
.ui-card {
    background: var(--surface-bg);
    border: 1px solid var(--surface-border);
    border-radius: var(--surface-radius);
    box-shadow: var(--surface-shadow);
    overflow: hidden;
}

.ui-card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--surface-border);
    background: var(--surface-header-bg);
}

.ui-card-header h4 {
    margin: 0 0 2px;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--surface-title);
}

.ui-card-header p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--surface-muted);
}

.ui-card-body {
    padding: 16px 20px;
}

/* ============================================================
   Sidebar — user link clicável para /perfil
   ============================================================ */
.sidebar-user-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 10px 10px;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.sidebar-user-link:hover {
    background: rgba(255, 255, 255, 0.07);
}

.sidebar-user-link .sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    text-transform: uppercase;
}

.sidebar-user-link .sidebar-user-info strong {
    display: block;
    font-size: 0.86rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.sidebar-user-link .sidebar-user-info small {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.38);
}

/* ============================================================
   Utilitários globais
   ============================================================ */
.section-subtitle {
    color: #6b7280;
    font-size: 0.88rem;
    margin: 2px 0 0;
    line-height: 1.4;
}

.section-title-main {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 4px;
}

/* ============================================================
   Form cards — globais (usados em todos os formulários)
   ============================================================ */
.f-card {
    background: var(--surface-bg);
    border: 1px solid var(--surface-border);
    border-radius: var(--surface-radius);
    box-shadow: var(--surface-shadow);
    overflow: hidden;
}

.f-card-header {
    background: var(--surface-header-bg);
    border-bottom: 1px solid var(--surface-border);
    padding: 14px 24px;
}

.f-card-header h4 {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--surface-title);
}

.f-card-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ============================================================
   Form inputs — globais
   ============================================================ */
.f-input,
.f-select,
.f-textarea {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
    outline: none;
    background: #fff;
    color: #111827;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.f-input:focus,
.f-select:focus,
.f-textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.f-textarea {
    min-height: 96px;
    resize: vertical;
}

.f-label {
    font-weight: 600;
    font-size: 0.88rem;
    color: #374151;
    display: block;
    margin-bottom: 5px;
}

.f-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.f-col {
    flex: 1;
    min-width: 180px;
}

.f-col-2 {
    flex: 2;
    min-width: 240px;
}

.f-col-3 {
    flex: 3;
    min-width: 300px;
}

/* ============================================================
   Page grid — dois painéis lado a lado (index.html)
   ============================================================ */
.page-grid {
    display: grid;
    grid-template-columns: minmax(240px, 340px) 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 900px) {
    .page-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Table — wrapper e cabeçalho neutro (substituem estilos inline)
   ============================================================ */
.ui-table-wrapper {
    border-radius: var(--surface-radius);
    overflow: hidden;
    border: 1px solid var(--surface-border);
    box-shadow: var(--surface-shadow);
}

.ui-table-head {
    background: #1f2937;
    color: #fff;
}

/* ============================================================
   Tarefas
   ============================================================ */
.tasks-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    align-items: start;
}

.task-section {
    background: var(--surface-bg);
    border: 1px solid var(--surface-border);
    border-radius: var(--surface-radius);
    padding: 0;
    box-shadow: var(--surface-shadow);
    overflow: hidden;
}

.task-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--surface-border);
    background: var(--surface-header-bg);
}

.task-count {
    min-width: 30px;
    height: 26px;
    border-radius: 999px;
    padding: 4px 10px;
    background: var(--badge-bg);
    color: var(--badge-color);
    font-weight: 700;
    font-size: 0.82rem;
    text-align: center;
}

.task-list {
    display: flex;
    flex-direction: column;
}

.task-row {
    border-bottom: 1px solid #edf0f3;
    background: #fff;
    transition: background 0.15s ease;
}

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

.task-row:hover {
    background: #f8fafc;
}

.task-row-done {
    background: #fafafa;
    opacity: 0.72;
}

.task-row-content {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 12px 14px;
}

.task-row-main {
    min-width: 0;
    flex: 1;
}

.task-row-title {
    color: #111827;
    font-size: 0.94rem;
    font-weight: 700;
    line-height: 1.3;
    word-break: break-word;
}

.task-title-done {
    color: #6b7280;
    text-decoration: line-through;
}

.task-row-note {
    margin-top: 4px;
    color: #4b5563;
    font-size: 0.84rem;
    line-height: 1.35;
    white-space: pre-wrap;
    word-break: break-word;
}

.task-row-meta {
    margin-top: 5px;
    color: #6b7280;
    font-size: 0.78rem;
    line-height: 1.4;
}

.task-meta-separator {
    color: #d1d5db;
    margin: 0 6px;
}

.task-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.task-mini-btn {
    padding: 6px 10px;
    font-size: 0.78rem;
    min-height: 30px;
}

.task-inline-note-form {
    border-top: 1px solid #f1f5f9;
    padding: 0 14px 12px;
}

.task-inline-note-form[hidden],
.task-modal-backdrop[hidden] {
    display: none;
}

.task-inline-note-input {
    min-height: 68px;
    font-size: 0.86rem;
}

.task-inline-note-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 7px;
}

.task-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99990;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.48);
}

.task-modal {
    width: 100%;
    max-width: 560px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
    overflow: hidden;
}

.task-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

.task-modal-header h4 {
    margin: 0;
    color: #111827;
    font-size: 1rem;
}

.task-modal-close {
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    font-size: 1.6rem;
    line-height: 1;
    padding: 0 4px;
}

.task-modal-close:hover {
    color: #dc2626;
}

.task-modal-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 20px 20px;
}

.task-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}

body.modal-open {
    overflow: hidden;
}

@media (max-width: 980px) {
    .tasks-layout {
        grid-template-columns: 1fr;
    }

    .task-row-content {
        flex-direction: column;
        align-items: stretch;
    }

    .task-row-actions {
        justify-content: flex-start;
    }

    .task-row-actions .btn,
    .task-row-actions .btn-secondary {
        width: 100%;
    }

    .task-modal-actions {
        flex-direction: column-reverse;
    }

    .task-modal-actions .btn,
    .task-modal-actions .btn-secondary {
        width: 100%;
    }
}
