/* ===========================================================================
   SmartCartório — nf-system.css
   Utility classes, icones Material Symbols, componentes de layout e navegacao.
   Substitui o que o MudBlazor trazia embutido (icons, utilities, component CSS).
   Carregado ANTES do app.css para que o app.css possa fazer override.
   =========================================================================== */

/* ===========================================================================
   1. MATERIAL SYMBOLS (asset local, Apache-2.0)
   =========================================================================== */
@font-face {
    font-family: 'Material Symbols Outlined';
    font-style: normal;
    font-weight: 100 700;
    src: url('/fonts/material-symbols/MaterialSymbolsOutlined.woff2') format('woff2-variations');
    font-display: block;
}

/* ===========================================================================
   2. CLASSE .nf-icon (uso inline: <span class="nf-icon">home</span>)
   =========================================================================== */
.nf-icon {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'liga';
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.nf-icon-sm { font-size: 20px; }
.nf-icon-lg { font-size: 32px; }

/* ===========================================================================
   3. CLASSES nf-icon-* PARA DxButton IconCssClass (::before com ligature)
   =========================================================================== */
[class*="nf-icon-"]::before {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'liga';
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.nf-icon-tune::before { content: 'tune'; }
.nf-icon-close::before { content: 'close'; }
.nf-icon-add::before { content: 'add'; }
.nf-icon-delete::before { content: 'delete'; }
.nf-icon-edit::before { content: 'edit'; }
.nf-icon-refresh::before { content: 'refresh'; }
.nf-icon-download::before { content: 'download'; }
.nf-icon-check::before { content: 'check'; }
.nf-icon-check-circle::before { content: 'check_circle'; }
.nf-icon-block::before { content: 'block'; }
.nf-icon-undo::before { content: 'undo'; }
.nf-icon-arrow-up::before { content: 'arrow_upward'; }
.nf-icon-arrow-down::before { content: 'arrow_downward'; }
.nf-icon-open::before { content: 'open_in_new'; }
.nf-icon-flag::before { content: 'flag'; }
.nf-icon-action::before { content: 'play_arrow'; }
.nf-icon-assessment::before { content: 'assessment'; }
.nf-icon-verified::before { content: 'verified'; }
.nf-icon-light-mode::before { content: 'light_mode'; }
.nf-icon-dark-mode::before { content: 'dark_mode'; }
.nf-icon-search::before { content: 'search'; }
.nf-icon-send::before { content: 'send'; }
.nf-icon-save::before { content: 'save'; }
.nf-icon-link::before { content: 'link'; }
.nf-icon-content-copy::before { content: 'content_copy'; }
.nf-icon-visibility::before { content: 'visibility'; }
.nf-icon-visibility-off::before { content: 'visibility_off'; }

/* Elimina o atraso de duplo toque somente em controles de acao. Pan e pinch-zoom
   continuam permitidos; campos de entrada e regioes rolaveis nao recebem a regra. */
button,
a[href],
summary,
input[type="button"],
input[type="submit"],
input[type="reset"],
input[type="file"],
[role="button"] {
    touch-action: manipulation;
}

/* --- Acrescentados na remediacao pos-migracao DevExpress (2026-08-20) ---------
   Regra: IconCssClass do DxButton recebe NOME DE CLASSE (nf-icon-*).
   A ligature crua do Material Symbols so vale como TEXTO em <span class="nf-icon">.
   Ligature inexistente e renderizada como texto literal pela fonte, entao todo
   nome abaixo e um simbolo canonico do Material Symbols Outlined.            */

/* Shell e navegacao */
.nf-icon-menu::before { content: 'menu'; }
.nf-icon-logout::before { content: 'logout'; }
.nf-icon-notifications::before { content: 'notifications'; }
.nf-icon-arrow-left::before { content: 'arrow_back'; }

/* Acoes de documento e arquivo */
.nf-icon-upload::before { content: 'upload'; }
.nf-icon-description::before { content: 'description'; }
.nf-icon-copy::before { content: 'content_copy'; }
.nf-icon-scanner::before { content: 'document_scanner'; }
.nf-icon-link-off::before { content: 'link_off'; }

/* Visualizador de documentos registrais */
.nf-icon-zoom-in::before { content: 'zoom_in'; }
.nf-icon-zoom-out::before { content: 'zoom_out'; }
.nf-icon-rotate-right::before { content: 'rotate_right'; }

/* Destinos de navegacao (Home.IconeDestino) e cadastros */
.nf-icon-people::before { content: 'people'; }
.nf-icon-groups::before { content: 'groups'; }
.nf-icon-admin::before { content: 'admin_panel_settings'; }
.nf-icon-bank::before { content: 'account_balance'; }
.nf-icon-gavel::before { content: 'gavel'; }
.nf-icon-event-note::before { content: 'event_note'; }
.nf-icon-menu-book::before { content: 'menu_book'; }
.nf-icon-draw::before { content: 'draw'; }
.nf-icon-badge::before { content: 'badge'; }
.nf-icon-star::before { content: 'star'; }

/* ===========================================================================
   4. UTILITY CLASSES (MudBlazor/Vuetify naming convention)
   =========================================================================== */

/* Display */
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline-block { display: inline-block !important; }

/* Flex */
.flex-column { flex-direction: column !important; }
.flex-row { flex-direction: row !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }
.align-center { align-items: center !important; }
.align-start { align-items: flex-start !important; }
.align-end { align-items: flex-end !important; }
.align-self-center { align-self: center !important; }
.justify-center { justify-content: center !important; }
.justify-space-between { justify-content: space-between !important; }
.justify-end { justify-content: flex-end !important; }

/* Gap */
.gap-1 { gap: .25rem !important; }
.gap-2 { gap: .5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }

/* Padding (MudBlazor/Vuetify style: pa-N, px-N, py-N, pt-N, pb-N, pl-N, pr-N) */
.pa-0 { padding: 0 !important; }
.pa-1 { padding: 4px !important; }
.pa-2 { padding: 8px !important; }
.pa-3 { padding: 12px !important; }
.pa-4 { padding: 16px !important; }
.pa-5 { padding: 20px !important; }
.pa-6 { padding: 24px !important; }
.pa-8 { padding: 32px !important; }
.px-1 { padding-left: 4px !important; padding-right: 4px !important; }
.px-2 { padding-left: 8px !important; padding-right: 8px !important; }
.px-3 { padding-left: 12px !important; padding-right: 12px !important; }
.px-4 { padding-left: 16px !important; padding-right: 16px !important; }
.py-1 { padding-top: 4px !important; padding-bottom: 4px !important; }
.py-2 { padding-top: 8px !important; padding-bottom: 8px !important; }
.py-3 { padding-top: 12px !important; padding-bottom: 12px !important; }
.py-4 { padding-top: 16px !important; padding-bottom: 16px !important; }
.pt-2 { padding-top: 8px !important; }
.pt-3 { padding-top: 12px !important; }
.pb-2 { padding-bottom: 8px !important; }
.pb-3 { padding-bottom: 12px !important; }

/* Margin (MudBlazor style: ma-N, mx-N, my-N, mt-N, mb-N, ml-N, mr-N) */
.ma-0 { margin: 0 !important; }
.ma-2 { margin: 8px !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.mt-1 { margin-top: 4px !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 12px !important; }
.mt-4 { margin-top: 16px !important; }
.mt-5 { margin-top: 20px !important; }
.mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 12px !important; }
.mb-4 { margin-bottom: 16px !important; }
.my-2 { margin-top: 8px !important; margin-bottom: 8px !important; }
.my-3 { margin-top: 12px !important; margin-bottom: 12px !important; }
.my-4 { margin-top: 16px !important; margin-bottom: 16px !important; }
.my-8 { margin-top: 32px !important; margin-bottom: 32px !important; }
.ml-1 { margin-left: 4px !important; }
.ml-2 { margin-left: 8px !important; }
.ml-auto { margin-left: auto !important; }
.mr-1 { margin-right: 4px !important; }
.mr-2 { margin-right: 8px !important; }
.mr-3 { margin-right: 12px !important; }

/* Text */
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-left { text-align: left !important; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-wrap { white-space: normal !important; }
.font-weight-bold { font-weight: 700 !important; }

/* Semantic text colors */
.text-primary { color: var(--nf-action) !important; }
.text-success { color: var(--nf-ok) !important; }
.text-warning { color: var(--nf-warn) !important; }
.text-danger, .text-error { color: var(--nf-err) !important; }
.text-muted { color: var(--nf-muted) !important; }
.text-tertiary { color: #6366F1 !important; }
.text-info { color: #0891B2 !important; }

/* Badge */
.badge {
    display: inline-flex; align-items: center; gap: .25rem;
    padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600;
    cursor: pointer; border: 1px solid var(--nf-line); background: var(--nf-surface);
    transition: background .15s;
}
.badge:hover { background: var(--nf-mist); }
.bg-success { background-color: var(--nf-ok) !important; color: #fff !important; }
.bg-warning { background-color: var(--nf-warn) !important; color: #fff !important; }
.bg-danger { background-color: var(--nf-err) !important; color: #fff !important; }
.bg-primary { background-color: var(--nf-action) !important; color: var(--nf-action-on) !important; }
.bg-info { background-color: #0891B2 !important; color: #fff !important; }
.bg-secondary { background-color: var(--nf-muted) !important; color: #fff !important; }

/* Responsive display */
@media (min-width: 576px) { .d-sm-flex { display: flex !important; } .d-sm-none { display: none !important; } }
@media (min-width: 768px) { .d-md-flex { display: flex !important; } .d-md-none { display: none !important; } }

/* Width/sizing */
.w-100 { width: 100% !important; }
.overflow-auto { overflow: auto !important; }
.overflow-hidden { overflow: hidden !important; }
.position-relative { position: relative !important; }

/* ===========================================================================
   5. LAYOUT SHELL (grid: appbar + drawer + main)
   =========================================================================== */
.nf-layout {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-columns: auto minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}
.nf-layout > .nf-appbar {
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
    align-items: center;
    padding: .5rem 1rem;
    gap: .5rem;
    position: sticky;
    top: 0;
    z-index: 1200;
}
.nf-drawer {
    grid-row: 3;
    grid-column: 1;
    width: 17.5rem;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--nf-shell);
    color: var(--nf-shell-on);
    border-right: 1px solid var(--nf-shell-border);
    transition: width .2s ease, visibility .2s ease;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

/* DxPopup e demais modais acessiveis expoem role=dialog. Conter o overscroll
   evita que o documento ao fundo role ao chegar ao limite do modal. */
[role="dialog"] {
    overscroll-behavior: contain;
}
.nf-drawer:not(.nf-drawer-open) {
    width: 0;
    visibility: hidden;
}
.nf-main-content {
    grid-row: 3;
    grid-column: 2;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0;
}
.nf-user-strip {
    grid-row: 2;
    grid-column: 1 / -1;
}
.nf-drawer-overlay {
    display: none;
}
.nf-layout-header-menu .nf-drawer {
    width: 0;
    visibility: hidden;
}

@media (max-width: 900px) {
    .nf-layout {
        grid-template-columns: minmax(0, 1fr);
    }
    .nf-main-content {
        grid-column: 1;
    }
    .nf-drawer,
    .nf-layout-header-menu .nf-drawer {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1400;
        width: min(86vw, 20rem);
        max-width: 100%;
        visibility: visible;
        box-shadow: var(--nf-shadow);
        transform: translateX(-105%);
        transition: transform .2s ease, visibility .2s ease;
    }
    .nf-shell-ready .nf-drawer.nf-drawer-open {
        transform: translateX(0);
    }
    .nf-drawer:not(.nf-drawer-open),
    .nf-layout-header-menu .nf-drawer:not(.nf-drawer-open) {
        width: min(86vw, 20rem);
        visibility: hidden;
    }
    .nf-drawer-overlay:not([hidden]) {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1350;
        width: 100%;
        border: 0;
        background: color-mix(in srgb, var(--nf-ink) 58%, transparent);
        cursor: pointer;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nf-drawer,
    .nf-drawer summary.nf-nav-group-title::after {
        transition: none !important;
    }
}

/* ===========================================================================
   6. COMPONENT CLASSES (paper, card, grid)
   =========================================================================== */
.nf-paper {
    background: var(--nf-surface);
    border-radius: var(--nf-radius-sm);
    box-shadow: var(--nf-shadow);
    padding: 1rem;
}
.nf-paper-outlined {
    background: var(--nf-surface);
    border: 1px solid var(--nf-line);
    border-radius: var(--nf-radius-sm);
    box-shadow: none;
}
.nf-card {
    background: var(--nf-surface);
    border: 1px solid var(--nf-line);
    border-radius: var(--nf-radius-sm);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.nf-card-header-actions {
    display: flex;
    align-items: center;
    gap: .25rem;
    margin-left: auto;
}
.nf-grid-layout {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem;
}
.nf-col-12 { grid-column: span 12; }
.nf-col-6 { grid-column: span 6; }
.nf-col-4 { grid-column: span 4; }
.nf-col-3 { grid-column: span 3; }
.nf-col-2 { grid-column: span 2; }
@media (min-width: 576px) {
    .nf-col-sm-6 { grid-column: span 6; }
    .nf-col-sm-4 { grid-column: span 4; }
    .nf-col-sm-3 { grid-column: span 3; }
}
@media (min-width: 768px) {
    .nf-col-md-6 { grid-column: span 6; }
    .nf-col-md-4 { grid-column: span 4; }
    .nf-col-md-3 { grid-column: span 3; }
    .nf-col-md-2 { grid-column: span 2; }
}

/* ===========================================================================
   7. NAVIGATION (nf-nav)
   =========================================================================== */
.nf-nav {
    display: flex;
    flex-direction: column;
    padding: .5rem 0;
    flex: 1;
    overflow-y: auto;
}
.nf-nav-group {
    border: none;
    margin: 0;
}
.nf-nav-group > summary.nf-nav-group-title {
    display: flex;
    align-items: center;
    padding: .5rem 1.25rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--nf-shell-muted);
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.nf-nav-group > summary.nf-nav-group-title::-webkit-details-marker { display: none; }
.nf-nav-group > summary.nf-nav-group-title:focus-visible {
    outline: 3px solid var(--nf-shell-on);
    outline-offset: -3px;
}
.nf-nav-group > summary.nf-nav-group-title::after {
    content: '';
    margin-left: auto;
    border: 4px solid transparent;
    border-top-color: currentColor;
    transition: transform .2s;
}
.nf-nav-group[open] > summary.nf-nav-group-title::after {
    transform: rotate(180deg);
}
.nf-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.nf-nav-list li { margin: 0; padding: 0; }
.nf-nav-link {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem 1.25rem .45rem 1.75rem;
    font-size: .86rem;
    color: var(--nf-shell-on);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background .15s, border-color .15s;
}
.nf-nav-link:hover {
    background: var(--nf-shell-hover);
    text-decoration: none;
}
.nf-nav-link.active {
    border-left-color: var(--nf-shell-on);
    background: var(--nf-shell-selected);
    font-weight: 600;
}

/* ===========================================================================
   8. TYPOGRAPHY CLASSES
   =========================================================================== */
.nf-caption { font-size: .75rem; line-height: 1.4; }
.nf-body2 { font-size: .875rem; line-height: 1.5; }
.nf-subtitle1 { font-size: 1rem; font-weight: 600; line-height: 1.4; }
.nf-subtitle2 { font-size: .875rem; font-weight: 600; line-height: 1.4; }
.nf-muted { color: var(--nf-muted) !important; }

/* ===========================================================================
   9. MISCELLANEOUS
   =========================================================================== */

/* List items */
.nf-list-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .75rem;
    border-bottom: 1px solid var(--nf-line);
    cursor: pointer;
    transition: background .15s;
}
.nf-list-item:hover { background: var(--nf-mist); }
.nf-list-item:last-child { border-bottom: none; }

/* Divider */
.nf-divider {
    border: none;
    border-top: 1px solid var(--nf-line);
    margin: .5rem 0;
}

/* Draghandle */
.nf-draghandle { cursor: move; opacity: .6; }
.nf-draghandle:hover { opacity: 1; }

/* Progress */
.progress { height: 4px; background: var(--nf-mist); border-radius: 2px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--nf-action); }
.progress-bar-striped { background-image: linear-gradient(45deg, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent); background-size: 1rem 1rem; }
.progress-bar-animated { animation: progress-bar-stripes 1s linear infinite; }
@keyframes progress-bar-stripes { from { background-position: 1rem 0; } to { background-position: 0 0; } }

/* Table basics */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .5rem; border-bottom: 1px solid var(--nf-line); text-align: left; font-size: .875rem; }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--nf-muted); font-weight: 700; }
.table-sm th, .table-sm td { padding: .3rem .5rem; }
.table-hover tbody tr:hover { background: var(--nf-mist); }

/* Spinner */
.spinner-border {
    display: inline-block; width: 2rem; height: 2rem;
    border: .25em solid var(--nf-action); border-right-color: transparent;
    border-radius: 50%; animation: nf-spinner .75s linear infinite;
}
@keyframes nf-spinner { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------------------
   LINK COM APARENCIA DE BOTAO
   DxButton renderiza <button>; um `target` cai no splat e fica inerte, e o
   markup nao tem href (sem abrir em nova aba, sem "abrir em nova guia").
   Para destino que PRECISA ser navegavel de verdade (nova aba, download),
   usar <a class="nf-btn"> em vez de DxButton.
   --------------------------------------------------------------------------- */
.nf-btn {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: .375rem .75rem;
    border: 1px solid var(--nf-shell, #012F8D);
    border-radius: .25rem;
    background: transparent;
    color: var(--nf-shell, #012F8D);
    font: inherit;
    line-height: 1.5;
    text-decoration: none;
    cursor: pointer;
}
.nf-nav-link:focus-visible {
    outline: 3px solid var(--nf-shell-on);
    outline-offset: -3px;
}
.nf-btn:hover { background: color-mix(in srgb, var(--nf-shell, #012F8D) 8%, transparent); text-decoration: none; }
.nf-btn:focus-visible { outline: 2px solid var(--nf-shell, #012F8D); outline-offset: 2px; }
.nf-btn.disabled, .nf-btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
