/*
    EventFlow UI — padrão visual do sistema (protótipo "EventFlow — Protótipo").
    Componentes com prefixo ef-; ícones em Helpers/Icone.cs.
*/

:root {
    --ef-bg: #FAF7F2;
    --ef-surface: #FFFFFF;
    --ef-text: #2E1F26;
    --ef-muted: #7A5F68;
    --ef-border: #E8D5DB;
    --ef-border-soft: #F0E3E7;
    --ef-primary: #7D3348;
    --ef-primary-hover: #5E2536;
    --ef-rose: #C9748A;
    --ef-rose-lt: #F5E8ED;
    --ef-ok: #3C5A44;
    --ef-ok-bg: #EAF2EC;
    --ef-warn: #7A5410;
    --ef-warn-bg: #F8F1E4;
    --ef-radius: 16px;
    --ef-radius-sm: 10px;
    --ef-font-display: 'Cormorant Garamond', serif;
    --ef-font-body: 'Jost', sans-serif;
}

/* Cabeçalho de página */
.ef-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.ef-page-header-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ef-eyebrow {
    font-size: 13px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--ef-muted);
}

.ef-title {
    margin: 0;
    font-family: var(--ef-font-display);
    font-size: 40px;
    font-weight: 600;
    color: var(--ef-text);
    line-height: 1.1;
}

.ef-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--ef-primary);
    text-decoration: none;
}

.ef-back:hover { color: var(--ef-primary-hover); }

.ef-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* Cartões */
.ef-card {
    background: var(--ef-surface);
    border: 1px solid var(--ef-border);
    border-radius: var(--ef-radius);
    padding: 24px;
}

.ef-card + .ef-card { margin-top: 20px; }

.ef-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.ef-card-title {
    margin: 0;
    font-family: var(--ef-font-display);
    font-size: 26px;
    font-weight: 600;
    color: var(--ef-text);
}

.ef-card-flush { padding: 0; overflow: hidden; }
.ef-card-flush .ef-card-header { padding: 18px 20px 0; }

.ef-card-accent {
    background: var(--ef-primary);
    border-color: var(--ef-primary);
    color: #FFFFFF;
}

/* Botões */
.ef-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    border-radius: var(--ef-radius-sm);
    border: 1px solid transparent;
    font-family: var(--ef-font-body);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.ef-btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }

.ef-btn-primary { background: var(--ef-primary); color: #FFFFFF; }
.ef-btn-primary:hover { background: var(--ef-primary-hover); color: #FFFFFF; }

.ef-btn-secondary { background: var(--ef-surface); border-color: var(--ef-border); color: var(--ef-text); }
.ef-btn-secondary:hover { border-color: var(--ef-rose); color: var(--ef-text); }

.ef-btn-ghost { background: transparent; color: var(--ef-primary); }
.ef-btn-ghost:hover { background: var(--ef-rose-lt); color: var(--ef-primary-hover); }

.ef-btn-danger { background: transparent; color: #8F1D2C; border-color: #E9C3C9; }
.ef-btn-danger:hover { background: #FBEDEF; color: #8F1D2C; }

.ef-btn[disabled], .ef-btn.is-disabled { opacity: .5; pointer-events: none; }

.ef-icon-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ef-radius-sm);
    border: 1px solid var(--ef-border);
    background: var(--ef-surface);
    color: var(--ef-text);
    cursor: pointer;
}

/* Chips de status */
.ef-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--ef-border-soft);
    color: var(--ef-text);
}

.ef-chip-ok { background: var(--ef-ok-bg); color: var(--ef-ok); }
.ef-chip-warn { background: var(--ef-warn-bg); color: var(--ef-warn); }
.ef-chip-rose { background: var(--ef-rose-lt); color: var(--ef-primary); }
.ef-chip-dark { background: var(--ef-primary); color: #FFFFFF; }
.ef-chip-muted { background: #EFEAEC; color: #5B4A51; }

/* Tabelas */
.ef-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.ef-table thead th {
    background: var(--ef-bg);
    text-align: left;
    color: var(--ef-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 20px;
}

.ef-table tbody td {
    padding: 14px 20px;
    border-top: 1px solid var(--ef-border-soft);
    vertical-align: middle;
}

.ef-table .ef-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ef-table tfoot td { padding: 12px 20px; border-top: 1px solid var(--ef-border); font-weight: 600; }

/* Formulários */
.ef-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 18px;
}

.ef-col-2 { grid-column: span 2; }
.ef-col-3 { grid-column: span 3; }
.ef-col-4 { grid-column: span 4; }
.ef-col-5 { grid-column: span 5; }
.ef-col-6 { grid-column: span 6; }
.ef-col-8 { grid-column: span 8; }
.ef-col-12 { grid-column: span 12; }

.ef-field { display: flex; flex-direction: column; gap: 6px; }
.ef-field label, .ef-label { font-size: 13px; font-weight: 500; color: var(--ef-text); }

.ef-input,
.ef-field input:not([type=checkbox]):not([type=radio]),
.ef-field select,
.ef-field textarea {
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--ef-border);
    border-radius: var(--ef-radius-sm);
    background: var(--ef-surface);
    font-family: var(--ef-font-body);
    font-size: 14px;
    color: var(--ef-text);
    box-sizing: border-box;
    width: 100%;
}

.ef-field textarea { padding: 12px 14px; min-height: 96px; resize: vertical; }

.ef-input:focus,
.ef-field input:focus,
.ef-field select:focus,
.ef-field textarea:focus {
    outline: none;
    border-color: var(--ef-rose);
    box-shadow: 0 0 0 3px rgba(201, 116, 138, .18);
}

.ef-help { font-size: 12px; color: var(--ef-muted); }
.ef-error, .ef-field .field-validation-error { font-size: 12px; color: #8F1D2C; }

/* Segmentado (tipo de desconto, filtros) */
.ef-segmented {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: var(--ef-bg);
    border: 1px solid var(--ef-border);
    border-radius: 12px;
}

.ef-segmented input { position: absolute; opacity: 0; pointer-events: none; }

.ef-segmented label,
.ef-segmented a {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: var(--ef-text);
    text-decoration: none;
}

.ef-segmented input:checked + label,
.ef-segmented a.is-active {
    background: var(--ef-primary);
    color: #FFFFFF;
}

/* Indicadores */
.ef-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.ef-kpi { display: flex; flex-direction: column; gap: 6px; }
.ef-kpi-label { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--ef-muted); }
.ef-card-accent .ef-kpi-label { color: var(--ef-rose-lt); }
.ef-kpi-value { font-family: var(--ef-font-display); font-size: 32px; font-weight: 600; line-height: 1.1; }
.ef-kpi-value-sm { font-size: 18px; font-weight: 600; font-family: var(--ef-font-body); }

/* Andamento (etapas) */
.ef-stepper {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 8px;
}

.ef-step { display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: var(--ef-muted); }
.ef-step::before { content: ""; height: 8px; border-radius: 4px; background: var(--ef-border-soft); }
.ef-step.is-done { color: var(--ef-text); }
.ef-step.is-done::before { background: var(--ef-primary); }
.ef-step.is-current { color: var(--ef-primary); font-weight: 600; }
.ef-step.is-current::before { background: var(--ef-rose); }

/* Totais (subtotal / desconto / total) */
.ef-totals { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.ef-totals-row { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.ef-totals-total {
    padding-top: 12px;
    border-top: 1px solid var(--ef-border);
    font-family: var(--ef-font-display);
    font-size: 30px;
    font-weight: 600;
}

/* Lista de definições */
.ef-dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 0; font-size: 14px; }
.ef-dl dt { color: var(--ef-muted); font-weight: 400; }
.ef-dl dd { margin: 0; font-weight: 500; }

.ef-empty {
    padding: 28px;
    border: 1px dashed var(--ef-border);
    border-radius: 12px;
    text-align: center;
    color: var(--ef-muted);
    font-size: 14px;
}

.ef-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.ef-search {
    flex: 1 1 320px;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 14px;
    background: var(--ef-surface);
    border: 1px solid var(--ef-border);
    border-radius: var(--ef-radius-sm);
}

.ef-search input { flex: 1; border: 0; outline: none; background: transparent; font-family: var(--ef-font-body); font-size: 14px; }

.ef-layout-main-aside {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 20px;
    align-items: start;
}

.ef-stack { display: flex; flex-direction: column; gap: 20px; }
.ef-stack > .ef-card + .ef-card, .ef-grid > .ef-card + .ef-card { margin-top: 0; }
.ef-search svg { color: var(--ef-muted); flex-shrink: 0; }

.ef-muted { color: var(--ef-muted); }
.ef-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Documento (pré-visualização de contrato) */
.ef-document {
    background: #FFFFFF;
    border: 1px solid var(--ef-border);
    border-radius: 6px;
    padding: 56px 64px;
    max-width: 820px;
    margin: 0 auto;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 15px;
    line-height: 1.7;
    color: #1F1A1C;
}

.ef-document h1, .ef-document h2, .ef-document h3 { font-family: Georgia, 'Times New Roman', serif; color: #1F1A1C; font-weight: 700; line-height: 1.3; margin: 18px 0 8px; }
.ef-document h1 { font-size: 22px; }
.ef-document h2 { font-size: 17px; }
.ef-document h3 { font-size: 15px; }
.ef-document p { margin: 0 0 10px; }
.ef-document table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.ef-document th, .ef-document td { border: 1px solid #D8CDD1; padding: 6px 10px; text-align: left; }
.ef-document .ql-align-center { text-align: center; }
.ef-document .ql-align-right { text-align: right; }
.ef-document .ql-align-justify { text-align: justify; }

/* Tabelas com rolagem horizontal em telas estreitas */
.ef-table-wrap { width: 100%; overflow-x: auto; }

.ef-table a.ef-link { color: var(--ef-text); font-weight: 600; text-decoration: none; }
.ef-table a.ef-link:hover { color: var(--ef-primary); }
.ef-table .ef-sub { display: block; font-size: 12px; color: var(--ef-muted); font-weight: 400; }

/* Tabela editável (itens da proposta) */
.ef-table-edit thead th { padding: 10px 12px; }
.ef-table-edit tbody td { padding: 8px 12px; }
.ef-table-edit input, .ef-table-edit select {
    width: 100%;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--ef-border);
    border-radius: 8px;
    font-family: var(--ef-font-body);
    font-size: 14px;
    background: var(--ef-surface);
}
.ef-table-edit input:focus, .ef-table-edit select:focus { outline: none; border-color: var(--ef-rose); box-shadow: 0 0 0 3px var(--ef-rose-lt); }
.ef-table-edit input.ef-num { text-align: right; }

/* Bloco repetível dentro de um card (categoria da proposta) */
.ef-block {
    border: 1px solid var(--ef-border);
    border-radius: var(--ef-radius-sm);
    overflow: hidden;
}
.ef-block + .ef-block { margin-top: 16px; }
.ef-block-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--ef-bg);
    border-bottom: 1px solid var(--ef-border-soft);
    flex-wrap: wrap;
}
.ef-block-header select {
    flex: 1;
    min-width: 200px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--ef-border);
    border-radius: 8px;
    background: var(--ef-surface);
    font-family: var(--ef-font-body);
    font-size: 14px;
    color: var(--ef-text);
}
.ef-block-header select:focus { outline: none; border-color: var(--ef-rose); box-shadow: 0 0 0 3px var(--ef-rose-lt); }
.ef-block-footer .ef-field { flex-direction: row; align-items: center; gap: 8px; }
.ef-block-footer .ef-field span { white-space: nowrap; }
.ef-block-footer .ef-field input { max-width: 160px; }
.ef-block-title { flex: 1; margin: 0; font-weight: 600; font-size: 15px; }
.ef-block-total { font-weight: 600; font-variant-numeric: tabular-nums; }
.ef-block-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; flex-wrap: wrap; }

/* Editor de contratos (Summernote) com aparência de documento */
.ef-editor .note-editor.note-frame { border: 1px solid var(--ef-border); border-radius: var(--ef-radius-sm); overflow: hidden; background: var(--ef-surface); }
.ef-editor .note-toolbar { background: var(--ef-bg); border-bottom: 1px solid var(--ef-border-soft); padding: 8px; }
.ef-editor .note-editing-area { background: #EFE8EB; padding: 24px 0; }
.ef-editor .note-editable {
    background: #FFFFFF;
    max-width: 800px;
    margin: 0 auto;
    padding: 48px 56px !important;
    box-shadow: 0 1px 3px rgba(46, 31, 38, .12);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 15px;
    line-height: 1.7;
    color: #1F1A1C;
}
.ef-editor .note-editable table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.ef-editor .note-editable th, .ef-editor .note-editable td { border: 1px solid #D8CDD1; padding: 6px 10px; }
.ef-editor .note-statusbar { display: none; }

/* Painel de variáveis */
.ef-variaveis { display: flex; flex-direction: column; gap: 14px; max-height: 70vh; overflow-y: auto; }
.ef-variaveis h3 { margin: 0 0 6px; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--ef-muted); font-weight: 600; }
.ef-variavel {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--ef-border-soft);
    border-radius: 8px;
    background: var(--ef-surface);
    font-family: var(--ef-font-body);
    text-align: left;
    cursor: pointer;
}
.ef-variavel + .ef-variavel { margin-top: 6px; }
.ef-variavel:hover { border-color: var(--ef-rose); background: var(--ef-rose-lt); }
.ef-variavel code { font-size: 12px; color: var(--ef-primary); background: none; padding: 0; }
.ef-variavel span { font-size: 12px; color: var(--ef-muted); }

.ef-document ol li[data-list="bullet"] { list-style-type: disc; }

/* Avisos dentro da página */
.ef-alert {
    padding: 14px 18px;
    border-radius: var(--ef-radius-sm);
    border: 1px solid var(--ef-border);
    background: var(--ef-rose-lt);
    color: var(--ef-primary);
    font-size: 14px;
    margin-bottom: 20px;
}
.ef-alert-warn { background: var(--ef-warn-bg); border-color: #EBDDBF; color: var(--ef-warn); }
.ef-alert-ok { background: var(--ef-ok-bg); border-color: #CFE0D3; color: var(--ef-ok); }
.ef-alert ul { margin: 0; padding-left: 18px; }
.ef-alert:empty, .ef-alert.validation-summary-valid { display: none; }

.ef-list-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid var(--ef-border-soft);
    font-size: 13px;
    color: var(--ef-muted);
    flex-wrap: wrap;
}
.ef-list-footer .pagination { margin: 0; }

/* ===== Estrutura da aplicação (sidebar + conteúdo) ===== */
body.ef-app {
    display: block;
    margin: 0;
    background: var(--ef-bg);
    color: var(--ef-text);
    font-family: var(--ef-font-body);
    min-height: 100vh;
}

.ef-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 256px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px 16px 16px;
    background: var(--ef-surface);
    border-right: 1px solid var(--ef-border);
    z-index: 1030;
}

.ef-sidebar-logo { display: flex; justify-content: center; }
.ef-sidebar-logo img { width: 140px; height: auto; }

.ef-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
}

.ef-nav-group { display: flex; flex-direction: column; gap: 2px; }
.ef-nav-title {
    padding: 0 12px 6px;
    font-size: 11px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--ef-muted);
}

.ef-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--ef-radius-sm);
    color: var(--ef-text);
    font-size: 14.5px;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}
.ef-nav-item svg { flex-shrink: 0; color: var(--ef-muted); }
.ef-nav-item:hover { background: var(--ef-bg); color: var(--ef-primary); }
.ef-nav-item:hover svg { color: var(--ef-primary); }
.ef-nav-item.is-active { background: var(--ef-rose-lt); color: var(--ef-primary); font-weight: 600; }
.ef-nav-item.is-active svg { color: var(--ef-primary); }

.ef-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    background: var(--ef-bg);
}
.ef-avatar {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ef-primary);
    color: #FFFFFF;
    font-weight: 600;
    font-size: 14px;
}
.ef-user-info { flex: 1; min-width: 0; display: flex; flex-direction: column; text-decoration: none; }
.ef-user-name { font-size: 14px; font-weight: 600; color: var(--ef-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ef-user-role { font-size: 12px; color: var(--ef-muted); }
.ef-user form { margin: 0; }
.ef-user .ef-icon-btn { border: 0; background: transparent; color: var(--ef-muted); }
.ef-user .ef-icon-btn:hover { color: var(--ef-primary); }

.ef-main {
    margin-left: 256px;
    min-height: 100vh;
    padding: 36px 44px 48px;
    max-width: 1600px;
}

/* Barra inferior e menu "Mais" (celular) */
.ef-bottom-nav { display: none; }

.ef-more-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ef-more-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--ef-border-soft);
    border-radius: var(--ef-radius-sm);
    color: var(--ef-text);
    font-size: 14px;
    text-decoration: none;
    background: var(--ef-surface);
}
.ef-more-item svg { color: var(--ef-primary); flex-shrink: 0; }
.ef-more-item:hover { border-color: var(--ef-rose); color: var(--ef-primary); }

/* Paginação */
.ef-pagination { display: flex; gap: 4px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.ef-pagination a, .ef-pagination span {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--ef-border);
    background: var(--ef-surface);
    color: var(--ef-text);
    font-size: 13px;
    text-decoration: none;
}
.ef-pagination a:hover { border-color: var(--ef-rose); color: var(--ef-primary); }
.ef-pagination .is-active { background: var(--ef-primary); border-color: var(--ef-primary); color: #FFFFFF; font-weight: 600; }
.ef-pagination .is-disabled { opacity: .45; pointer-events: none; }

/* Toasts (toastr) na paleta do sistema */
#toast-container > div { opacity: 1; border-radius: 12px; box-shadow: 0 8px 24px rgba(46, 31, 38, .16); font-family: var(--ef-font-body); }
#toast-container > .toast-success { background-color: var(--ef-ok); }
#toast-container > .toast-error { background-color: #8F1D2C; }
#toast-container > .toast-warning { background-color: #9A6B14; }
#toast-container > .toast-info { background-color: var(--ef-primary); }

/* Links e ações em linha de tabela */
.ef-row-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; flex-wrap: nowrap; }
.ef-row-actions form { margin: 0; }
.ef-icon-btn.ef-icon-btn-sm { width: 34px; height: 34px; }
.ef-icon-btn:hover { border-color: var(--ef-rose); color: var(--ef-primary); }
.ef-icon-btn.is-danger { color: #8F1D2C; }
.ef-icon-btn.is-danger:hover { background: #FBEDEF; border-color: #E9C3C9; }
a.ef-icon-btn { text-decoration: none; }

.ef-btn svg { flex-shrink: 0; }

/* Formulário de página única (cadastros simples) */
.ef-form-narrow { max-width: 880px; }
.ef-form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 24px; }
.ef-check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.ef-check input { width: 18px; height: 18px; accent-color: var(--ef-primary); }
.ef-field input[type=file] { padding: 9px 12px; height: auto; }

.ef-section-title { margin: 0 0 14px; font-family: var(--ef-font-display); font-size: 22px; font-weight: 600; }

@media (max-width: 1100px) {
    .ef-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ef-layout-main-aside { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 768px) {
    .ef-title { font-size: 32px; }
    .ef-grid { grid-template-columns: minmax(0, 1fr); }
    .ef-grid > [class*="ef-col-"] { grid-column: auto; }
    .ef-kpis { grid-template-columns: minmax(0, 1fr); }
    .ef-card { padding: 18px; }
    .ef-document { padding: 28px 20px; }
    .ef-stepper { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ef-table { font-size: 13px; }
    .ef-table thead th, .ef-table tbody td, .ef-table tfoot td { padding: 10px 12px; }
    .ef-table th[style*="width"] { width: auto !important; }
    .ef-block-footer .ef-field { flex-wrap: wrap; }
}

@media (max-width: 1100px) and (min-width: 769px) {
    .ef-main { padding: 28px 28px 40px; }
}

@media (max-width: 768px) {
    .ef-sidebar { display: none; }
    .ef-main { margin-left: 0; padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
    .ef-page-header { align-items: stretch; }
    .ef-page-header > .ef-actions { width: 100%; }
    .ef-page-header > .ef-actions > .ef-btn,
    .ef-page-header > .ef-actions > form { flex: 1; }
    .ef-page-header > .ef-actions > form .ef-btn { width: 100%; }
    .ef-toolbar > * { flex: 1 1 100%; }
    .ef-layout-main-aside > aside { position: static !important; }
    .ef-list-footer { justify-content: center; text-align: center; }
    .ef-more-grid { grid-template-columns: minmax(0, 1fr); }

    .ef-bottom-nav {
        position: fixed;
        inset: auto 0 0 0;
        z-index: 1040;
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
        padding-bottom: env(safe-area-inset-bottom);
        background: rgba(255, 255, 255, .97);
        border-top: 1px solid var(--ef-border);
        box-shadow: 0 -8px 24px rgba(46, 31, 38, .08);
        backdrop-filter: blur(12px);
    }
    .ef-bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        min-height: 62px;
        border: 0;
        background: transparent;
        color: var(--ef-muted);
        font-family: var(--ef-font-body);
        font-size: 11px;
        text-decoration: none;
    }
    .ef-bottom-nav-item.is-active { color: var(--ef-primary); font-weight: 600; }
}

/* Galeria de arquivos (projetos 3D) */
.ef-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.ef-gallery-item { border: 1px solid var(--ef-border); border-radius: var(--ef-radius-sm); overflow: hidden; background: var(--ef-surface); display: flex; flex-direction: column; }
.ef-gallery-thumb { height: 160px; display: flex; align-items: center; justify-content: center; background: var(--ef-bg); color: var(--ef-muted); overflow: hidden; }
.ef-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ef-gallery-info { padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ef-gallery-info span { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ef-gallery-info form { margin: 0; }

/* Calendário mensal */
.ef-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--ef-border-soft); }
.ef-cal-head { padding: 10px 12px; font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--ef-muted); background: var(--ef-bg); }
.ef-cal-day { min-height: 118px; padding: 8px; border-right: 1px solid var(--ef-border-soft); border-bottom: 1px solid var(--ef-border-soft); display: flex; flex-direction: column; gap: 4px; }
.ef-cal-day:nth-child(7n) { border-right: 0; }
.ef-cal-day.is-other { background: #FCFAF7; }
.ef-cal-day.is-other .ef-cal-num { color: #C9B8BE; }
.ef-cal-num { font-size: 13px; font-weight: 600; color: var(--ef-text); }
.ef-cal-day.is-today .ef-cal-num { display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; border-radius: 50%; background: var(--ef-primary); color: #FFFFFF; }
.ef-cal-event { display: block; padding: 4px 8px; border-radius: 6px; font-size: 12px; font-weight: 500; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid currentColor; }
.ef-cal-event.is-ok { background: var(--ef-ok-bg); color: var(--ef-ok); }
.ef-cal-event.is-warn { background: var(--ef-warn-bg); color: var(--ef-warn); }
.ef-cal-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ef-muted); }
.ef-cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ef-cal-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.ef-cal-list { display: none; }

@media (max-width: 768px) {
    .ef-cal-grid-card { display: none; }
    .ef-cal-list { display: block; }
}

/* Barras horizontais simples (financeiro mensal) */
.ef-bars { display: flex; flex-direction: column; gap: 14px; }
.ef-bar-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) 120px; gap: 12px; align-items: center; font-size: 13px; }
.ef-bar-track { display: flex; flex-direction: column; gap: 4px; }
.ef-bar { height: 8px; border-radius: 4px; min-width: 2px; }
.ef-bar.is-in { background: var(--ef-ok); }
.ef-bar.is-out { background: var(--ef-rose); }
.ef-bar-row .ef-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* Lista de alertas */
.ef-alert-list { display: flex; flex-direction: column; gap: 10px; }
.ef-alert-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: var(--ef-radius-sm); background: var(--ef-bg); text-decoration: none; color: var(--ef-text); font-size: 14px; }
.ef-alert-item strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.ef-alert-item.is-warn { background: var(--ef-warn-bg); color: var(--ef-warn); }
.ef-alert-item.is-ok { background: var(--ef-ok-bg); color: var(--ef-ok); }
a.ef-alert-item:hover { outline: 1px solid var(--ef-rose); }

@media (max-width: 768px) {
    .ef-bar-row { grid-template-columns: 70px minmax(0, 1fr) 96px; }
}

/* Grade de caixas de seleção (perfis, permissões) */
.ef-check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ef-check-card { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--ef-border); border-radius: var(--ef-radius-sm); background: var(--ef-surface); cursor: pointer; font-size: 14px; }
.ef-check-card:has(input:checked) { border-color: var(--ef-primary); background: var(--ef-rose-lt); color: var(--ef-primary); font-weight: 500; }
.ef-check-card input { width: 18px; height: 18px; accent-color: var(--ef-primary); }

/* Telas de acesso (login, recuperação de senha) */
body.ef-auth-body { margin: 0; min-height: 100vh; background: var(--ef-bg); font-family: var(--ef-font-body); color: var(--ef-text); }
.ef-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ef-auth-brand {
    display: flex;
    flex-direction: column;
    justify-content: center; /* centraliza verticalmente para alinhar com o título 'Entrar' */
    align-items: center; /* centraliza horizontalmente o conteúdo */
    text-align: center;  /* alinha o texto ao centro */
    padding: 48px 56px;
    position: relative; /* permite posicionar o pequeno rodapé discreto */
    gap: 24px; /* espaço controlado entre logo, título e texto */
    background: linear-gradient(160deg, #7D3348 0%, #5E2536 100%);
    color: #FFFFFF;
}
.ef-auth-brand img { width: 140px; height: auto; background: #FFFFFF; border-radius: 20px; padding: 12px; }
.ef-auth-brand h2 { margin: 0; font-family: var(--ef-font-display); font-size: 48px; font-weight: 600; line-height: 1.1; color: #FFFFFF; }
.ef-auth-brand p { margin: 16px 0 0; max-width: 420px; color: var(--ef-rose-lt); font-size: 16px; line-height: 1.6; }
.ef-auth-brand small {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, .6);
    font-size: 12px;
    font-weight: 500;
    opacity: 0.85;
}
.ef-app-version {
    margin-left: 8px;
    color: rgba(255,255,255,0.75);
    font-size: 12px;
    font-weight: 500;
    opacity: 0.9;
}
.ef-auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.ef-auth-card { width: 100%; max-width: 420px; }
.ef-auth-card .ef-title { font-size: 40px; }
.ef-auth-card form { display: flex; flex-direction: column; gap: 18px; margin-top: 28px; }
.ef-auth-card .ef-btn { width: 100%; height: 48px; font-size: 15px; }
.ef-auth-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; font-size: 14px; }
.ef-auth-logo-mobile { display: none; }

@media (max-width: 900px) {
    .ef-auth { grid-template-columns: minmax(0, 1fr); }
    .ef-auth-brand { display: none; }
    .ef-auth-logo-mobile { display: block; width: 130px; margin: 0 auto 24px; }
    .ef-auth-card { text-align: left; }
}

/* Links de texto (sem classe) na paleta do sistema */
.ef-main a:not([class]), .ef-auth-card a:not([class]), .ef-alert a:not([class]) { color: var(--ef-primary); text-decoration: none; font-weight: 500; }
.ef-main a:not([class]):hover, .ef-auth-card a:not([class]):hover { color: var(--ef-primary-hover); text-decoration: underline; }

/* Janela modal (aviso de sessão) */
.ef-modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(46, 31, 38, .45); backdrop-filter: blur(2px); }
.ef-modal[hidden] { display: none; }
.ef-modal-card { width: 100%; max-width: 440px; background: var(--ef-surface); border-radius: var(--ef-radius); padding: 28px; box-shadow: 0 24px 60px rgba(46, 31, 38, .25); text-align: center; }
.ef-modal-icone { display: inline-flex; width: 56px; height: 56px; align-items: center; justify-content: center; border-radius: 50%; background: var(--ef-warn-bg); color: var(--ef-warn); margin-bottom: 12px; }
.ef-modal-card p { margin: 10px 0 22px; }
.ef-modal-card strong { color: var(--ef-text); font-variant-numeric: tabular-nums; }
.ef-modal-acoes { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* Orçamento: cartão da próxima etapa e linha do tempo */
.ef-card-destaque { border-color: var(--ef-rose); box-shadow: 0 0 0 3px var(--ef-rose-lt); }
.ef-details summary { cursor: pointer; font-size: 13px; color: #8F1D2C; }
.ef-details summary:hover { text-decoration: underline; }

.ef-timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--ef-border-soft); display: flex; flex-direction: column; gap: 16px; }
.ef-timeline li { position: relative; }
.ef-timeline li::before { content: ""; position: absolute; left: -25px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--ef-surface); border: 2px solid var(--ef-rose); }
.ef-timeline li:first-child::before { background: var(--ef-primary); border-color: var(--ef-primary); }
.ef-timeline li.is-danger::before { border-color: #8F1D2C; background: #8F1D2C; }
.ef-timeline-meta { margin-top: 4px; font-size: 12px; color: var(--ef-muted); }
.ef-timeline-obs { margin: 6px 0 0; font-size: 13px; white-space: pre-line; padding: 8px 10px; border-radius: 8px; background: var(--ef-bg); }

/* Busca no menu */
.ef-menu-busca {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 10px 0 12px;
    margin: -8px 0 -6px;
    border: 1px solid var(--ef-border);
    border-radius: var(--ef-radius-sm);
    background: var(--ef-bg);
    color: var(--ef-muted);
}
.ef-menu-busca:focus-within { border-color: var(--ef-rose); box-shadow: 0 0 0 3px var(--ef-rose-lt); background: var(--ef-surface); }
.ef-menu-busca input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-family: var(--ef-font-body); font-size: 14px; color: var(--ef-text); }
.ef-menu-busca input::-webkit-search-cancel-button { cursor: pointer; }
.ef-menu-busca kbd { font-family: var(--ef-font-body); font-size: 10px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--ef-border); background: var(--ef-surface); color: var(--ef-muted); box-shadow: none; white-space: nowrap; }
.ef-menu-busca:focus-within kbd { display: none; }
.offcanvas .ef-menu-busca { margin: 0 0 4px; height: 44px; }
.ef-nav-item.is-destaque, .ef-more-item.is-destaque { background: var(--ef-rose-lt); color: var(--ef-primary); }
.ef-nav-item:focus-visible, .ef-more-item:focus-visible { outline: 2px solid var(--ef-rose); outline-offset: 1px; }
.ef-menu-vazio { margin: 4px 12px; font-size: 13px; color: var(--ef-muted); }

/* Avatar com iniciais nas tabelas (ex.: equipe montada no detalhe do evento) */
.ef-avatar-sm { width: 30px; height: 30px; font-size: 11px; background: var(--ef-rose-lt); color: var(--ef-primary); }

/* Arquivos escolhidos antes do envio (lista-arquivos.js) */
.ef-lista-arquivos { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.ef-lista-arquivos li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 10px; border-radius: 8px; background: var(--ef-bg); }
.ef-lista-arquivos li span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ef-lista-arquivos .ef-lista-arquivos-total { background: transparent; color: var(--ef-muted); padding-top: 2px; }

/* Galeria de ícones prontos (Administração > PDF do orçamento) */
.ef-galeria-icones summary { cursor: pointer; font-size: 13px; color: var(--ef-primary); font-weight: 500; }
.ef-galeria-icones form { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ef-galeria-icones button { width: 46px; height: 46px; padding: 5px; border: 1px solid var(--ef-border); border-radius: 10px; background: var(--ef-surface); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ef-galeria-icones button:hover { border-color: var(--ef-rose); background: var(--ef-rose-lt); }
.ef-galeria-icones button.is-atual { border-color: var(--ef-primary); box-shadow: 0 0 0 2px var(--ef-rose-lt); }

/* Reordenar arrastando (ordenar-arrastando.js) */
.ef-alca-arrastar { width: 28px; height: 32px; border: 0; border-radius: 6px; background: transparent; color: var(--ef-muted); font-size: 18px; line-height: 1; cursor: grab; touch-action: none; user-select: none; display: inline-flex; align-items: center; justify-content: center; }
.ef-alca-arrastar:hover, .ef-alca-arrastar:focus-visible { background: var(--ef-rose-lt); color: var(--ef-primary); }
.is-ordenando, .is-ordenando * { cursor: grabbing !important; user-select: none; }
[data-ordenavel] > .is-arrastando { background: var(--ef-rose-lt); box-shadow: 0 6px 18px rgba(125, 51, 72, 0.18); position: relative; z-index: 1; }
[data-ordenavel] > .is-arrastando td { background: transparent; }

