:root {
    --erp-bg: #08090b;
    --erp-bg-deep: #06070a;
    --erp-surface: #101317;
    --erp-surface-muted: #171b20;
    --erp-glass: rgba(16, 19, 23, 0.9);
    --erp-border: #2b323b;
    --erp-border-strong: #4c5968;
    --erp-text: #f5f7fa;
    --erp-text-secondary: #c7cdd6;
    --erp-text-muted: #858c98;
    --erp-blue: #2f6bff;
    --erp-blue-hover: #5e8cff;
    --erp-blue-soft: rgba(47, 107, 255, 0.14);
    --erp-orange: #f3a100;
    --erp-danger: #ff6b6b;
    --erp-success: #45c486;
    --erp-warning: #f2c14e;
    --like-blue: var(--erp-blue);
    --like-orange: var(--erp-orange);
    --primary-blue: var(--erp-blue);
    --light-blue: var(--erp-blue-hover);
    --accent-orange: var(--erp-orange);
    --dark-bg: var(--erp-bg);
    --card-bg: var(--erp-surface);
    --border-color: var(--erp-border);
    --text-light: var(--erp-text);
    --text-muted: var(--erp-text-muted);
    --bs-body-color: var(--erp-text);
    --bs-body-bg: var(--erp-bg);
    --bs-border-color: var(--erp-border);
}

*, *::before, *::after { box-sizing: border-box; }

html { min-height: 100%; scroll-behavior: smooth; }

body.erp-body {
    min-height: 100vh;
    margin: 0;
    color: var(--erp-text);
    color-scheme: dark;
    font-family: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
    background:
        linear-gradient(180deg, rgba(255,255,255,.045), transparent 360px),
        linear-gradient(135deg, #08090b 0%, #0b111c 46%, #090b10 100%);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.erp-body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: linear-gradient(180deg, #000, transparent 92%);
}
.view-as-exit { position:fixed; left:18px; bottom:18px; z-index:1100; }
.view-as-exit button { padding:10px 14px; border:1px solid rgba(243,161,0,.6); border-radius:999px; color:#fff; background:#17130b; box-shadow:0 14px 38px rgba(0,0,0,.5); font-size:.75rem; font-weight:800; }

a { text-decoration: none; }

/* Espaçamento consistente para ícones seguidos de texto em todas as ações. */
.btn {
    align-items: center;
    justify-content: center;
    gap: .48rem;
}

a.btn, button.btn { display: inline-flex; }

.erp-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: rgba(8, 9, 11, .82);
    box-shadow: 0 16px 42px rgba(0,0,0,.22);
    backdrop-filter: blur(18px);
}

.erp-header__inner {
    width: 100%;
    min-height: 72px;
    padding: 0 clamp(14px, 2vw, 34px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: clamp(14px, 2vw, 30px);
}

.erp-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    flex: 0 0 auto;
    color: var(--erp-text);
}

.erp-brand img { width: 58px; height: 42px; object-fit: contain; }
.erp-brand__name { font-weight: 850; letter-spacing: -.025em; }
.erp-brand__name small { display: block; color: var(--erp-text-muted); font-size: .67rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.erp-nav { min-width: 0; width: auto; max-width: 100%; display: flex; align-items: center; justify-content: center; gap: 5px; overflow-x: auto; scrollbar-width: none; }
.erp-nav::-webkit-scrollbar { display: none; }
.erp-nav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 13px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--erp-text-secondary);
    font-size: .9rem;
    font-weight: 720;
    white-space: nowrap;
    transition: 180ms ease;
}
.erp-nav a:hover { color: var(--erp-text); background: rgba(255,255,255,.05); border-color: var(--erp-border); }
.erp-nav a.active { color: #dce7ff; background: var(--erp-blue-soft); border-color: rgba(47,107,255,.42); }

.erp-profile { position: relative; justify-self: end; }
.erp-profile__button {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(47,107,255,.58);
    border-radius: 50%;
    color: var(--erp-text);
    background: linear-gradient(135deg, var(--erp-blue), #8bb0ff);
    box-shadow: 0 10px 28px rgba(47,107,255,.2);
}
.erp-profile__button img { width: 100%; height: 100%; object-fit: cover; }
.erp-profile__button {
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.erp-profile__button:hover,
.erp-profile__button[aria-expanded="true"] {
    transform: translateY(-2px) scale(1.04);
    border-color: rgba(158,194,255,.9);
    box-shadow: 0 14px 34px rgba(47,107,255,.32), 0 0 0 4px rgba(47,107,255,.1);
}
.erp-profile .dropdown-menu.show {
    animation: profile-menu-in 220ms cubic-bezier(.2,.8,.2,1) both;
    transform-origin: top right;
}
.erp-profile .dropdown-menu {
    min-width: 220px;
    margin-top: 12px !important;
    padding: 10px !important;
}
.erp-profile .dropdown-menu > li:first-child {
    margin-bottom: 4px;
    border: 1px solid rgba(47,107,255,.14);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(47,107,255,.1), rgba(255,255,255,.02));
}
.erp-profile .dropdown-divider { border-color: rgba(255,255,255,.08); }
.erp-profile .dropdown-menu.show li {
    animation: profile-item-in 260ms cubic-bezier(.2,.8,.2,1) both;
}
.erp-profile .dropdown-menu.show li:nth-child(2) { animation-delay: 25ms; }
.erp-profile .dropdown-menu.show li:nth-child(3) { animation-delay: 45ms; }
.erp-profile .dropdown-menu.show li:nth-child(4) { animation-delay: 65ms; }
.erp-profile .dropdown-menu.show li:nth-child(5) { animation-delay: 85ms; }
.erp-profile .dropdown-menu.show li:nth-child(6) { animation-delay: 105ms; }

@keyframes profile-menu-in {
    from { opacity: 0; clip-path: inset(0 0 82% 0 round 10px); filter: blur(3px); }
    to { opacity: 1; clip-path: inset(0 0 0 0 round 10px); filter: blur(0); }
}
@keyframes profile-item-in {
    from { opacity: 0; transform: translateX(8px); }
    to { opacity: 1; transform: translateX(0); }
}

.erp-main { min-height: calc(100vh - 72px); padding: clamp(22px, 3vw, 42px) 0 56px; }
.erp-container { width: min(100% - 32px, 1280px); margin: 0 auto; }

.dropdown-menu {
    padding: 8px !important;
    border: 1px solid var(--erp-border) !important;
    border-radius: 10px !important;
    background: rgba(16,19,23,.98) !important;
    box-shadow: 0 24px 60px rgba(0,0,0,.42) !important;
}
.dropdown-item { border-radius: 7px; color: var(--erp-text-secondary) !important; }
.dropdown-item { transition: color 150ms ease, background 150ms ease, transform 150ms ease; }
.dropdown-item:hover, .dropdown-item:focus { color: var(--erp-text) !important; background: var(--erp-blue-soft) !important; transform: translateX(3px); }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-heading__eyebrow { margin: 0 0 6px; color: var(--erp-blue-hover); font-size: .74rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.page-heading h1 { margin: 0; color: var(--erp-text); font-size: clamp(2rem, 4vw, 3.4rem); font-weight: 850; letter-spacing: -.045em; line-height: 1.02; }
.page-heading p { max-width: 720px; margin: 9px 0 0; color: var(--erp-text-secondary); }
.page-heading__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

.erp-body .page-title { padding-top: 0 !important; margin-bottom: 28px !important; text-align: left !important; }
.erp-body .page-title h1 {
    margin-bottom: 7px !important;
    color: var(--erp-text) !important;
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    -webkit-text-fill-color: currentColor !important;
    font-size: clamp(2rem, 4vw, 3.2rem) !important;
    font-weight: 850 !important;
    letter-spacing: -.04em;
}
.erp-body .page-title p { color: var(--erp-text-secondary) !important; font-size: 1rem !important; opacity: 1 !important; }

.card, .surface-panel, .info-card, .user-card, .stats-card {
    color: var(--erp-text);
    border: 1px solid var(--erp-border) !important;
    border-radius: 10px !important;
    background: linear-gradient(180deg, rgba(20,24,29,.94), rgba(12,15,19,.92)) !important;
    box-shadow: 0 12px 30px rgba(0,0,0,.2) !important;
    backdrop-filter: blur(10px);
}
.card { overflow: hidden; }
.card-header, .info-card .card-header {
    color: var(--erp-text) !important;
    border: 0 !important;
    border-bottom: 1px solid var(--erp-border) !important;
    border-radius: 0 !important;
    background: rgba(255,255,255,.025) !important;
}
.card-footer { border-top: 1px solid var(--erp-border) !important; background: rgba(0,0,0,.16) !important; }
.card-body { color: var(--erp-text); }

.btn {
    min-height: 40px;
    border-radius: 8px !important;
    font-weight: 750;
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease, border-color 180ms ease !important;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
    border-color: rgba(47,107,255,.6) !important;
    color: #07100e !important;
    background: linear-gradient(135deg, var(--erp-blue), #8bb0ff) !important;
    box-shadow: 0 12px 28px rgba(47,107,255,.18);
}
.btn-primary:hover { color: #07100e !important; background: linear-gradient(135deg, var(--erp-blue-hover), var(--erp-blue)) !important; }
.btn-secondary, .btn-dark { border-color: var(--erp-border) !important; color: var(--erp-text) !important; background: rgba(255,255,255,.055) !important; }
.btn-outline-light, .btn-outline-secondary { color: var(--erp-text-secondary); border-color: var(--erp-border-strong); }
.btn-outline-light:hover, .btn-outline-secondary:hover { color: var(--erp-text); background: rgba(255,255,255,.07); }

.form-control, .form-select, .input-group-text {
    min-height: 43px;
    border-color: var(--erp-border) !important;
    border-radius: 8px;
    color: var(--erp-text) !important;
    background: rgba(4,6,8,.62) !important;
}
.form-control:focus, .form-select:focus {
    border-color: rgba(47,107,255,.75) !important;
    box-shadow: 0 0 0 4px rgba(47,107,255,.14) !important;
    background: rgba(4,6,8,.82) !important;
}
.form-control::placeholder { color: var(--erp-text-muted); }
.form-control[type="file"] {
    overflow: hidden;
    padding: 5px;
    color: var(--erp-text-secondary) !important;
    cursor: pointer;
}
.form-control[type="file"]::file-selector-button {
    min-height: 31px;
    margin: -1px 12px -1px -1px;
    padding: 7px 13px;
    border: 1px solid #43536a;
    border-radius: 6px;
    color: #edf4ff;
    background: linear-gradient(135deg, #23334d, #182235);
    font: inherit;
    font-weight: 750;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease;
}
.form-control[type="file"]::-webkit-file-upload-button {
    min-height:31px;
    margin:-1px 12px -1px -1px;
    padding:7px 13px;
    border:1px solid #43536a;
    border-radius:6px;
    color:#edf4ff;
    background:linear-gradient(135deg,#23334d,#182235);
    font:inherit;
    font-weight:750;
    cursor:pointer;
}
.form-control[type="file"]:hover::file-selector-button { border-color: #7297d1; background: linear-gradient(135deg, #2b4267, #1d2d49); }
input.form-control:-webkit-autofill,
input.form-control:-webkit-autofill:hover,
input.form-control:-webkit-autofill:focus,
input.form-control:-webkit-autofill:active {
    -webkit-text-fill-color: var(--erp-text) !important;
    caret-color: var(--erp-text) !important;
    -webkit-box-shadow: 0 0 0 1000px #080b10 inset !important;
    box-shadow: 0 0 0 1000px #080b10 inset !important;
    border-color: rgba(47,107,255,.75) !important;
    transition: background-color 9999s ease-out 0s;
}
.form-label { color: var(--erp-text-secondary) !important; font-weight: 720; }
.form-check-input { background-color: rgba(4,6,8,.68); border-color: var(--erp-border-strong); }
.form-check-input:checked { background-color: var(--erp-blue); border-color: var(--erp-blue); }

.erp-body .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--erp-text-secondary);
    --bs-table-border-color: var(--erp-border);
    --bs-table-striped-bg: rgba(255,255,255,.025);
    --bs-table-striped-color: var(--erp-text-secondary);
    --bs-table-active-bg: rgba(47,107,255,.11);
    --bs-table-active-color: var(--erp-text);
    --bs-table-hover-bg: rgba(47,107,255,.07);
    --bs-table-hover-color: var(--erp-text);
}
.table thead th { color: var(--erp-text-muted); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: rgba(47,107,255,.07); --bs-table-color-state: var(--erp-text); }

.text-muted, .text-white-50 { color: var(--erp-text-muted) !important; }
.text-white { color: var(--erp-text) !important; }
.text-body, .text-body-emphasis { color: var(--erp-text) !important; }
.text-body-secondary, .text-secondary { color: var(--erp-text-secondary) !important; }
.text-primary { color: #8cc4ff !important; }
.text-warning { color: var(--erp-warning) !important; }

.alert {
    --bs-alert-color: var(--erp-text);
    border-radius: 8px;
    border-width: 1px;
    color: var(--erp-text) !important;
    background: rgba(255,255,255,.045);
}
.alert-info { border-color: rgba(76,174,255,.36); background: rgba(76,174,255,.1); }
.alert-success { border-color: rgba(69,196,134,.36); background: rgba(69,196,134,.1); }
.alert-warning { border-color: rgba(242,193,78,.4); background: rgba(242,193,78,.1); }
.alert-danger { border-color: rgba(255,107,107,.38); background: rgba(255,107,107,.1); }
.modal-content { border: 1px solid var(--erp-border); border-radius: 10px; color: var(--erp-text); background: var(--erp-surface); box-shadow: 0 28px 80px rgba(0,0,0,.55); }
.modal-header, .modal-footer { border-color: var(--erp-border); }
.btn-close { filter: invert(1) grayscale(1); }

.erp-body .list-group {
    --bs-list-group-color: var(--erp-text-secondary);
    --bs-list-group-bg: rgba(12,15,19,.76);
    --bs-list-group-border-color: var(--erp-border);
    --bs-list-group-action-color: var(--erp-text-secondary);
    --bs-list-group-action-hover-color: var(--erp-text);
    --bs-list-group-action-hover-bg: rgba(47,107,255,.07);
    --bs-list-group-active-color: var(--erp-text);
    --bs-list-group-active-bg: var(--erp-blue-soft);
    --bs-list-group-active-border-color: rgba(47,107,255,.42);
}
.erp-body .accordion {
    --bs-accordion-color: var(--erp-text-secondary);
    --bs-accordion-bg: rgba(12,15,19,.76);
    --bs-accordion-border-color: var(--erp-border);
    --bs-accordion-btn-color: var(--erp-text);
    --bs-accordion-btn-bg: rgba(255,255,255,.025);
    --bs-accordion-active-color: var(--erp-text);
    --bs-accordion-active-bg: var(--erp-blue-soft);
}
.erp-body .pagination {
    --bs-pagination-color: #9ec2ff;
    --bs-pagination-bg: rgba(12,15,19,.82);
    --bs-pagination-border-color: var(--erp-border);
    --bs-pagination-hover-color: var(--erp-text);
    --bs-pagination-hover-bg: rgba(47,107,255,.1);
    --bs-pagination-hover-border-color: var(--erp-border-strong);
    --bs-pagination-disabled-color: var(--erp-text-muted);
    --bs-pagination-disabled-bg: rgba(12,15,19,.5);
    --bs-pagination-disabled-border-color: var(--erp-border);
}
.erp-body .toast,
.erp-body .offcanvas,
.erp-body .popover {
    color: var(--erp-text);
    border-color: var(--erp-border);
    background-color: var(--erp-surface);
}

.erp-module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 14px; }
.erp-module-card {
    min-height: 190px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 21px;
    border: 1px solid var(--erp-border);
    border-radius: 10px;
    color: var(--erp-text);
    background: linear-gradient(180deg, rgba(20,24,29,.93), rgba(12,15,19,.91));
    box-shadow: 0 12px 30px rgba(0,0,0,.18);
    transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}
.erp-module-card:hover { color: var(--erp-text); transform: translateY(-3px); border-color: var(--erp-border-strong); box-shadow: 0 22px 48px rgba(0,0,0,.3); }
.erp-module-card__icon { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid rgba(47,107,255,.38); border-radius: 9px; color: #a7c5ff; background: var(--erp-blue-soft); font-size: 1.15rem; }
.erp-module-card h2 { margin: 24px 0 5px; font-size: 1.2rem; font-weight: 820; }
.erp-module-card p { margin: 0; color: var(--erp-text-muted); font-size: .86rem; }
.erp-module-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; color: var(--erp-text-secondary); font-size: .78rem; font-weight: 720; }
.erp-module-card--locked { opacity: .55; cursor: not-allowed; }

.erp-dashboard-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(300px,.65fr); gap: 16px; margin-top: 16px; }
.erp-dashboard-grid--single { grid-template-columns: minmax(0,1fr); }
.erp-home-widgets { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.erp-home-widget { min-width:0; margin:0; }
.erp-home-widget--priority { grid-column:1/-1; }
.erp-home-widget .erp-panel__head h2 { display:flex; align-items:center; gap:9px; }
.erp-home-widget .erp-panel__head h2 i { color:#8cc4ff; }
.erp-panel__links { display:flex; gap:14px; }
.home-heading { margin-bottom:20px; }
.erp-panel { padding: 21px; }
.erp-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.erp-panel__head h2 { margin: 0; font-size: 1rem; font-weight: 820; }
.erp-panel__head a { color: #9ec2ff; font-size: .78rem; font-weight: 750; }
.erp-list { display: grid; gap: 9px; }
.erp-list-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 13px; border: 1px solid var(--erp-border); border-radius: 8px; background: rgba(0,0,0,.14); }
.erp-list-item strong { display: block; color: var(--erp-text); font-size: .9rem; }
.erp-list-item small { color: var(--erp-text-muted); }
.erp-empty { padding: 34px 18px; text-align: center; color: var(--erp-text-muted); }
.erp-empty i { display: block; margin-bottom: 10px; color: #6e8bc4; font-size: 1.7rem; }
.erp-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid var(--erp-border); border-radius: 999px; color: var(--erp-text-secondary); background: rgba(255,255,255,.035); font-size: .7rem; font-weight: 760; white-space: nowrap; }

.erp-form-page { display:grid; gap:16px; max-width:1040px; margin:0 auto; }
.erp-form-card { padding:clamp(18px,3vw,28px); }
.erp-form-card__head { display:flex; align-items:flex-start; gap:13px; margin-bottom:22px; }
.erp-form-card__head > span { flex:0 0 42px; width:42px; height:42px; display:grid; place-items:center; border:1px solid rgba(47,107,255,.35); border-radius:9px; color:#a7c5ff; background:var(--erp-blue-soft); }
.erp-form-card__head h2 { margin:0 0 3px; color:var(--erp-text); font-size:1rem; font-weight:820; }
.erp-form-card__head p { margin:0; color:var(--erp-text-muted); font-size:.8rem; }
.erp-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.erp-field { min-width:0; }
.erp-field--wide { grid-column:span 1; }
.erp-field--full { grid-column:1/-1; }
.erp-field > label:not(.form-check) { display:block; margin-bottom:7px; color:var(--erp-text-secondary); font-size:.78rem; font-weight:750; }
.erp-inline-control { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:9px; align-items:start; }
.erp-chip-list { min-height:50px; display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:9px; border:1px dashed var(--erp-border-strong); border-radius:9px; background:rgba(0,0,0,.16); }
.erp-chip-list > small { padding:4px; color:var(--erp-text-muted); }
.erp-chip { display:inline-flex; align-items:center; gap:7px; padding:7px 9px; border:1px solid rgba(47,107,255,.3); border-radius:999px; color:#dce7ff; background:var(--erp-blue-soft); font-size:.76rem; font-weight:720; }
.erp-chip button { width:21px; height:21px; display:grid; place-items:center; padding:0; border:0; border-radius:50%; color:#dce7ff; background:rgba(255,255,255,.08); }
.erp-form-actions { position:sticky; bottom:10px; z-index:5; display:flex; justify-content:flex-end; gap:9px; padding:12px; border:1px solid var(--erp-border); border-radius:10px; background:rgba(10,13,17,.92); box-shadow:0 16px 42px rgba(0,0,0,.34); backdrop-filter:blur(16px); }
.erp-day-schedule > div { display:grid; gap:10px; }
.erp-day-card { padding:15px; border:1px solid var(--erp-border); border-radius:9px; background:rgba(0,0,0,.16); }
.erp-day-card h3 { margin:0 0 13px; color:var(--erp-text); font-size:.88rem; font-weight:800; text-transform:capitalize; }
.erp-day-card h3 i { margin-right:8px; color:#8cc4ff; }
.erp-dependency-picker { padding:10px; border:1px solid var(--erp-border); border-radius:9px; background:rgba(0,0,0,.15); }
.erp-dependency-options { max-height:230px; display:grid; gap:6px; margin-top:9px; overflow:auto; }
.erp-dependency-option { display:flex; align-items:flex-start; gap:9px; padding:9px; border:1px solid transparent; border-radius:7px; color:var(--erp-text-secondary); cursor:pointer; }
.erp-dependency-option:hover { border-color:var(--erp-border); background:rgba(255,255,255,.035); }
.entity-panel { overflow:hidden; }
.entity-list__header,.entity-row { display:grid; grid-template-columns:minmax(240px,1.3fr) minmax(200px,1fr) minmax(170px,.7fr) auto; align-items:center; gap:16px; }
.entity-list__header { padding:11px 18px; border-bottom:1px solid var(--erp-border); color:var(--erp-text-muted); background:rgba(255,255,255,.02); font-size:.67rem; font-weight:820; letter-spacing:.07em; text-transform:uppercase; }
.entity-row { min-width:0; padding:14px 18px; border-bottom:1px solid var(--erp-border); }
.entity-row:last-child { border-bottom:0; }
.entity-row:hover { background:rgba(47,107,255,.045); }
.entity-row__primary { min-width:0; display:flex; align-items:center; gap:11px; color:var(--erp-text); }
.entity-row__primary:hover { color:#b8d0ff; }
.entity-avatar { flex:0 0 42px; width:42px; height:42px; display:grid; place-items:center; border:1px solid rgba(47,107,255,.3); border-radius:50%; color:#a7c5ff; background:var(--erp-blue-soft); }
.entity-row :is(strong,small) { display:block; min-width:0; overflow:hidden; text-overflow:ellipsis; }
.entity-row strong { color:var(--erp-text); font-size:.84rem; }
.entity-row small { margin-top:3px; color:var(--erp-text-muted); font-size:.72rem; }
.entity-row__badges,.entity-row__actions { display:flex; align-items:center; flex-wrap:wrap; gap:7px; }
.entity-row__actions { justify-content:flex-end; }
.profile-layout { display:grid; grid-template-columns:minmax(240px,.38fr) minmax(0,1fr); gap:16px; }
.profile-identity,.profile-details { padding:clamp(20px,3vw,30px); }
.profile-identity { display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; }
.profile-identity > img,.profile-identity__placeholder { width:clamp(120px,15vw,170px); aspect-ratio:1; display:grid; place-items:center; margin-bottom:20px; border:2px solid rgba(47,107,255,.45); border-radius:28px; object-fit:cover; background:var(--erp-blue-soft); }
.profile-identity__placeholder i { color:#a7c5ff; font-size:3.4rem; }
.profile-identity h2 { margin:13px 0 4px; color:var(--erp-text); font-size:1.45rem; font-weight:850; }
.profile-identity p,.profile-details header p { margin:0; color:var(--erp-text-muted); }
.profile-details header { margin-bottom:22px; }
.profile-details header h2 { margin:0 0 4px; color:var(--erp-text); font-size:1.05rem; font-weight:820; }
.profile-data-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.profile-data-grid > div { min-width:0; display:flex; align-items:center; gap:11px; padding:14px; border:1px solid var(--erp-border); border-radius:9px; background:rgba(0,0,0,.14); }
.profile-data-grid > div > i { flex:0 0 34px; width:34px; height:34px; display:grid; place-items:center; border-radius:8px; color:#9ec2ff; background:var(--erp-blue-soft); }
.profile-data-grid span { min-width:0; }
.profile-data-grid small,.profile-data-grid strong { display:block; overflow:hidden; text-overflow:ellipsis; }
.profile-data-grid small { color:var(--erp-text-muted); font-size:.68rem; }
.profile-data-grid strong { margin-top:2px; color:var(--erp-text); font-size:.82rem; }
.profile-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:9px; margin-top:22px; }

/* Normaliza páginas legadas enquanto são migradas para os componentes do ERP. */
.erp-body :is(.entrada-container,.saida-container,.profile-container,.table-container) { color:var(--erp-text); }
.erp-body :is(.entrada-card,.saida-card,.profile-info,.table-container) { border-color:var(--erp-border) !important; border-radius:10px !important; background:linear-gradient(180deg,rgba(20,24,29,.94),rgba(12,15,19,.92)) !important; box-shadow:0 12px 30px rgba(0,0,0,.18); }
.erp-body :is(.form-input,.barcode-input) { border-color:var(--erp-border) !important; border-radius:8px !important; color:var(--erp-text) !important; background:rgba(4,6,8,.62) !important; }
.erp-body :is(.header-entrada,.header-saida) h1 { color:var(--erp-text); }
.legacy-form-page { max-width:1040px; padding:0 !important; }
.legacy-form-page > .d-flex:first-child { margin-bottom:22px !important; }
.legacy-form-page :is(.card,.profile-container) { border-radius:10px !important; }
.legacy-form-page :is(.card-body,.profile-container) { background:transparent !important; }
.contacts-form-page { max-width:1040px; padding:0 !important; }
.contacts-form-page .card-body { background:transparent !important; }
.contacts-form-page h1 { color:var(--erp-text) !important; font-size:clamp(1.8rem,4vw,2.7rem) !important; font-weight:850 !important; letter-spacing:-.04em; }
.user-admin-show :is(.profile-card,.profile-info) { border-color:var(--erp-border) !important; border-radius:10px !important; background:linear-gradient(180deg,rgba(20,24,29,.94),rgba(12,15,19,.92)) !important; }
.users-admin-page .user-card:hover,.user-admin-show .info-card:hover { transform:none !important; }
.users-admin-create { max-width:900px !important; padding:0 !important; }
.users-admin-create .form-card { padding:clamp(18px,3vw,28px) !important; border:1px solid var(--erp-border) !important; border-radius:10px !important; background:linear-gradient(180deg,rgba(20,24,29,.94),rgba(12,15,19,.92)) !important; box-shadow:0 12px 30px rgba(0,0,0,.2) !important; }
.users-admin-create .form-card h1 { margin-bottom:22px !important; color:var(--erp-text) !important; font-size:clamp(1.55rem,4vw,2.25rem) !important; font-weight:850 !important; letter-spacing:-.035em; }
.users-admin-create .checkbox-group { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px 16px; padding:13px !important; border:1px solid var(--erp-border) !important; border-radius:9px !important; background:rgba(0,0,0,.14) !important; }
.users-admin-create .checkbox-group > :is(hr,h3) { grid-column:1/-1; }

@media (max-width: 1240px) {
    .erp-header__inner { grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); padding-block: 10px; }
    .erp-nav { grid-column: 1 / -1; grid-row: 2; justify-self:center; justify-content:center; }
    .erp-profile { grid-column: 3; grid-row: 1; }
}

@media (max-width: 1050px) {
    .erp-module-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 760px) {
    .erp-container { width: min(100% - 22px, 1280px); }
    .erp-header__inner { padding-inline: 11px; }
    .erp-main { padding:18px 0 34px; }
    .erp-brand__name { display: none; }
    .erp-brand img { width: 50px; }
    .erp-nav { width:calc(100vw - 22px); justify-self:stretch; justify-content:flex-start; gap:3px; scroll-snap-type:x proximity; }
    .erp-nav a { min-height:38px; padding:7px 10px; font-size:.75rem; scroll-snap-align:start; }
    .erp-nav a i { display: none; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .page-heading__actions { justify-content: flex-start; }
    .erp-dashboard-grid { grid-template-columns: 1fr; }
    .erp-home-widgets { grid-template-columns:1fr; }
    .page-heading h1,.erp-body .page-title h1 { font-size:clamp(1.7rem,9vw,2.35rem) !important; }
    .page-heading__actions { width:100%; }
    .page-heading__actions .btn { flex:1 1 145px; }
    .card-body { padding:16px !important; }
    .surface-panel,.erp-panel { padding:16px; }
    .table-responsive { margin-inline:-4px; padding-bottom:4px; overscroll-behavior-inline:contain; -webkit-overflow-scrolling:touch; }
    .modal-dialog { margin:10px; }
    .dropdown-menu { max-width:calc(100vw - 22px); }
    input.form-control,select.form-select,textarea.form-control { font-size:16px; }
    .erp-form-grid { grid-template-columns:1fr; gap:13px; }
    .erp-field--wide,.erp-field--full { grid-column:1; }
    .erp-inline-control { grid-template-columns:1fr; }
    .erp-inline-control .btn { width:100%; justify-content:center; }
    .erp-form-actions { bottom:calc(72px + env(safe-area-inset-bottom)); }
    .erp-form-actions > * { flex:1; justify-content:center; }
    .entity-panel { overflow:visible; border:0 !important; background:transparent !important; box-shadow:none !important; }
    .entity-list__header { display:none; }
    .entity-list { display:grid; gap:10px; }
    .entity-row { grid-template-columns:1fr auto; gap:12px; padding:14px; border:1px solid var(--erp-border) !important; border-radius:10px; background:linear-gradient(180deg,rgba(20,24,29,.94),rgba(12,15,19,.92)); }
    .entity-row__primary { grid-column:1/-1; }
    .entity-row__detail { min-width:0; }
    .entity-row__badges { justify-content:flex-end; }
    .entity-row__actions { grid-column:1/-1; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
    .entity-row__actions .btn { width:100%; justify-content:center; }
    .profile-layout,.profile-data-grid { grid-template-columns:1fr; }
    .profile-identity { flex-direction:row; justify-content:flex-start; gap:16px; text-align:left; }
    .profile-identity > img,.profile-identity__placeholder { flex:0 0 82px; width:82px; margin:0; border-radius:20px; }
    .profile-identity__placeholder i { font-size:2rem; }
    .profile-identity h2 { margin-top:9px; }
    .profile-actions { display:grid; grid-template-columns:1fr; }
    .profile-actions .btn { width:100%; justify-content:center; }
    .users-admin-page { padding:0 !important; }
    .users-admin-page .page-title { margin-bottom:18px !important; }
    .users-admin-page .page-title p { margin-bottom:0; }
    .users-admin-page > .text-center .btn-lg { width:100%; }
    .users-admin-page .table-container { padding:0 !important; border:0 !important; background:transparent !important; box-shadow:none !important; }
    .users-admin-page .table-responsive { overflow:visible; }
    .users-admin-table,.users-admin-table tbody { display:block; width:100%; }
    .users-admin-table thead { display:none; }
    .users-admin-table tbody { display:grid; gap:10px; }
    .users-admin-table tbody tr { display:grid; grid-template-columns:64px minmax(0,1fr); gap:4px 10px; padding:14px; border:1px solid var(--erp-border); border-radius:10px; background:linear-gradient(180deg,rgba(20,24,29,.94),rgba(12,15,19,.92)); }
    .users-admin-table tbody td { display:block; min-width:0; padding:3px 0 !important; border:0 !important; overflow-wrap:anywhere; }
    .users-admin-table tbody td:nth-child(1) { grid-row:1/5; }
    .users-admin-table tbody td:nth-child(2) { color:var(--erp-text); font-weight:800; }
    .users-admin-table tbody td:nth-child(3) { color:var(--erp-text-muted); font-size:.76rem; }
    .users-admin-table tbody td:nth-child(4),.users-admin-table tbody td:nth-child(5) { font-size:.75rem; }
    .users-admin-table tbody td:nth-child(6) { grid-column:1/-1; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; margin-top:8px; }
    .users-admin-table tbody td:nth-child(6) :is(a,button,form),.users-admin-table tbody td:nth-child(6) form button { width:100%; margin:0 !important; justify-content:center; }
    .users-admin-table tbody td:nth-child(6) form { display:block !important; }
    .user-admin-show { padding:0 !important; }
    .user-admin-show .profile-info { padding:13px !important; margin-bottom:10px !important; transform:none !important; }
    .user-admin-show .card-body > .text-center:last-child { display:grid; grid-template-columns:1fr; gap:8px; }
    .user-admin-show .card-body > .text-center:last-child .btn { width:100%; margin:0 !important; justify-content:center; }
    .user-admin-show .modal-dialog { margin:8px; }
    .user-admin-show .modal-footer { display:grid; grid-template-columns:1fr 1fr; }
    .user-admin-show .modal-footer .btn { margin:0; justify-content:center; }
    .contacts-form-page { padding:0 !important; }
    .contacts-form-page > .d-flex:first-child { align-items:flex-start !important; flex-direction:column; gap:12px; }
    .contacts-form-page > .d-flex:first-child h1 { font-size:1.65rem !important; line-height:1.15; }
    .contacts-form-page > .d-flex:first-child > :is(a,.btn,div) { width:100%; }
    .contacts-form-page > .d-flex:first-child .btn { width:100%; justify-content:center; margin:0 !important; }
    .contacts-form-page .card-body { padding:15px !important; }
    .contacts-form-page form > .d-flex:last-child { display:grid !important; grid-template-columns:1fr; }
    .contacts-form-page form > .d-flex:last-child .btn { width:100%; justify-content:center; }
    .contact-show-page .d-flex.gap-2 { display:grid !important; grid-template-columns:1fr; }
    .contact-show-page .d-flex.gap-2 :is(a,button,form),.contact-show-page .d-flex.gap-2 form button { width:100%; justify-content:center; }
    .legacy-form-page { margin-top:0 !important; }
    .legacy-form-page > .d-flex:first-child { align-items:flex-start !important; flex-direction:column; gap:10px; }
    .legacy-form-page > .d-flex:first-child > * { width:100%; }
    .legacy-form-page > .d-flex:first-child .btn { justify-content:center; }
    .legacy-form-page .card-body { padding:15px !important; }
    .users-admin-create .checkbox-group { grid-template-columns:1fr; }
    .users-admin-create .checkbox-group > :is(hr,h3) { grid-column:1; }
    .users-admin-create form > .d-flex:last-child { display:grid !important; grid-template-columns:1fr; }
}

@media (max-width: 520px) {
    .erp-module-grid { grid-template-columns: 1fr; }
    .erp-module-card { min-height: 160px; }
    .erp-panel__head { align-items:flex-start; flex-direction:column; }
    .erp-list-item { align-items:flex-start; flex-wrap:wrap; }
    .btn-group { flex-wrap:wrap; gap:5px; }
    .document-library > .d-flex:first-child { align-items:flex-start !important; }
    .document-library h1 { font-size:clamp(1.65rem,8vw,2.15rem) !important; line-height:1.1; }
    .document-library .table-responsive { overflow:visible; }
    .document-library table,.document-library tbody { display:block; width:100%; }
    .document-library thead { display:none; }
    .document-library tbody tr { display:grid; gap:9px; margin-bottom:12px; padding:14px; border:1px solid var(--erp-border); border-radius:10px; background:rgba(0,0,0,.15); }
    .document-library tbody td { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding:0 !important; border:0 !important; text-align:right; }
    .document-library tbody td::before { flex:0 0 auto; color:var(--erp-text-muted); font-size:.67rem; font-weight:800; letter-spacing:.05em; text-transform:uppercase; }
    .document-library tbody td:nth-child(1)::before { content:"Nome"; }
    .document-library tbody td:nth-child(2)::before { content:"Descrição"; }
    .document-library tbody td:nth-child(3)::before { content:"Data"; }
    .document-library tbody td:nth-child(4)::before { content:"Ações"; }
    .document-library tbody td > .d-flex,.document-library tbody td > .btn-group { justify-content:flex-end; }
    .document-library .form-control[type="file"]::file-selector-button { width:100%; margin:0 0 6px; }
    .document-library .form-control[type="file"] { min-height:78px; white-space:normal; }
}
