:root {
    --frota-ink: #192228;
    --frota-sidebar: #1b242b;
    --frota-sidebar-hover: #2a3741;
    --frota-accent: #ffcd56;
    --frota-accent-hover: #f0b940;
    --frota-bg: #f2f4f5;
    --frota-surface: #fff;
    --frota-edge: #dce2e5;
    --frota-muted: #52616b;
    --sidebar-width: 250px;
    --bs-body-font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --bs-body-color: var(--frota-ink);
    --bs-body-bg: var(--frota-bg);
    --bs-secondary-color: var(--frota-muted);
    --bs-border-color: var(--frota-edge);
    --bs-primary-rgb: 255, 205, 86;
}

body { min-height: 100vh; }
a { color: #23536e; }
:focus-visible { outline: 3px solid #3c83a8; outline-offset: 3px; }
.btn { font-weight: 650; }
.btn-primary {
    --bs-btn-color: #1b2329;
    --bs-btn-bg: var(--frota-accent);
    --bs-btn-border-color: var(--frota-accent);
    --bs-btn-hover-color: #1b2329;
    --bs-btn-hover-bg: var(--frota-accent-hover);
    --bs-btn-hover-border-color: var(--frota-accent-hover);
    --bs-btn-active-color: #1b2329;
    --bs-btn-active-bg: var(--frota-accent-hover);
    --bs-btn-active-border-color: var(--frota-accent-hover);
    --bs-btn-disabled-color: #3f474b;
    --bs-btn-disabled-bg: #f2dca3;
    --bs-btn-disabled-border-color: #f2dca3;
    --bs-btn-focus-shadow-rgb: 134, 94, 7;
}
.btn-outline-secondary {
    --bs-btn-color: #364650;
    --bs-btn-border-color: #bac6cc;
    --bs-btn-hover-color: #1d2931;
    --bs-btn-hover-bg: #e6edef;
    --bs-btn-hover-border-color: #bac6cc;
    --bs-btn-active-color: #1d2931;
    --bs-btn-active-bg: #e0e8eb;
}
.form-control, .form-select { background-color: #fff; }
.form-control:focus, .form-select:focus {
    border-color: #5487a0;
    box-shadow: 0 0 0 .18rem #d7eaf3;
}
.form-label { font-size: .88rem; font-weight: 650; }
.form-check-input:checked { background-color: #286480; border-color: #286480; }
.skip-link { position: fixed; z-index: 1200; top: .5rem; left: .5rem; padding: .6rem; background: #fff; }

.sidebar {
    --bs-offcanvas-width: var(--sidebar-width);
    --bs-offcanvas-bg: var(--frota-sidebar);
    --bs-offcanvas-color: #fff;
    background: var(--frota-sidebar);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 1.1rem 1rem;
}
.brand-row { display: flex; align-items: center; justify-content: space-between; padding: .55rem .3rem 1.4rem; border-bottom: 1px solid #3a4851; }
.brand { display: inline-flex; align-items: center; gap: .75rem; color: #fff; text-decoration: none; font-size: .9rem; line-height: 1.05; }
.brand:hover { color: #fff; }
.brand strong { font-size: 1.35rem; font-weight: 760; }
.brand-mark { background: var(--frota-accent); color: var(--frota-sidebar); width: 42px; height: 42px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 1.3rem; }
.nav-sections { flex: 1; min-height: 0; overflow-y: auto; padding-block: .75rem; }
.nav-section summary { cursor: pointer; list-style: none; }
.nav-section summary::-webkit-details-marker { display: none; }
.nav-section[open] .sidebar-chevron { transform: rotate(180deg); }
.sidebar-submenu { margin-left: .8rem; padding-left: .4rem; border-left: 1px solid #42535d; }
.sidebar-submenu .sidebar-link { min-height: 33px; padding-block: .3rem; }
.sidebar-link { display: flex; align-items: center; gap: .72rem; color: #e6edf0; text-decoration: none; font-size: .88rem; min-height: 38px; padding: .48rem .65rem; border: 1px solid transparent; border-radius: 7px; margin: .1rem 0; }
.sidebar-link .bi { flex: 0 0 1.05rem; font-size: 1rem; }
.sidebar-link:hover { color: #fff; background: var(--frota-sidebar-hover); }
.sidebar-link.is-active { color: #fff; background: var(--frota-sidebar-hover); border-color: #42535d; box-shadow: inset 3px 0 0 var(--frota-accent); font-weight: 700; }
.sidebar-link.is-active .bi { color: var(--frota-accent); }
.sidebar-road { height: 11px; margin: .5rem .35rem .25rem; border-block: 1px solid #42505a; flex-shrink: 0; display: grid; align-content: center; }
.sidebar-road::before { content: ""; border-top: 2px dashed #b7a162; }
.workspace { min-width: 0; }
.topbar { background: var(--frota-surface); border-bottom: 1px solid var(--frota-edge); min-height: 68px; display: flex; justify-content: space-between; align-items: center; padding-inline: clamp(1rem, 3vw, 2.25rem); gap: 1rem; }
.topbar-company { display: flex; align-items: center; gap: .6rem; min-width: 0; font-weight: 700; }
.topbar-company span, .user-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-company .bi { color: var(--frota-muted); }
.menu-button { padding: .25rem .5rem; font-size: 1.2rem; }
.user-button { display: flex; gap: .45rem; align-items: center; padding: .25rem .4rem; color: var(--frota-ink); }
.user-name { max-width: min(160px, 20vw); font-size: .86rem; }
.user-avatar { display: inline-grid; place-items: center; width: 33px; height: 33px; border: 1px solid #d8e3e9; border-radius: 50%; background: #e7eff4; color: #2a475a; }
.main-content { max-width: 1470px; margin-inline: auto; padding: clamp(1rem, 3vw, 2.25rem); }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-bottom: 1.35rem; }
.page-heading h1, .dashboard-heading h1, .guest-form h1 { font-size: clamp(1.7rem, 3.5vw, 2.5rem); font-weight: 750; letter-spacing: -.047em; margin: 0; }
.panel { background: var(--frota-surface); border: 1px solid var(--frota-edge); border-radius: 12px; box-shadow: 0 4px 14px #19222808; }
.form-panel { padding: clamp(1rem, 3vw, 1.65rem); max-width: 880px; }
.form-actions { display: flex; justify-content: flex-end; gap: .55rem; margin-top: 1.35rem; }
.role-check { background: #f2f5f6; border-radius: 6px; padding: .42rem .65rem .42rem 1.95rem; }
.role-check .form-check-input { margin-left: -1.3rem; }
.record-form { min-height: 0; }
.modal-content > .record-form { display: flex; flex-direction: column; }
.modal-content > .record-form .modal-body { overflow-y: auto; }
.modal-header, .modal-footer { flex-shrink: 0; }
.swal2-popup .swal2-confirm { background: #243844; color: #fff; }
.swal2-popup.swal2-toast { border: 1px solid var(--frota-edge); }

.dashboard-heading { position: relative; isolation: isolate; overflow: hidden; background: linear-gradient(118deg, #1b252c 19%, #344854 100%); color: #fff; padding: clamp(1.4rem, 4vw, 2.6rem); border-radius: 14px; min-height: 154px; display: flex; align-items: center; }
.dashboard-heading p { margin: .5rem 0 0; color: #d7e0e4; font-weight: 600; }
.dashboard-road { position: absolute; z-index: -1; width: 34%; min-width: 160px; right: -3%; top: 0; bottom: 0; display: grid; place-items: center; transform: skewX(-24deg); border: 2px solid #76858d; background: #1b272f40; }
.dashboard-road::before { position: absolute; content: ""; border-left: 3px dashed #e5b547; top: 0; bottom: 0; left: 54%; }
.dashboard-road .bi { transform: skewX(24deg); background: #334651; color: #ffcd56; padding: .06em .18em; font-size: clamp(2.1rem, 5vw, 4.6rem); }
.section-heading { font-weight: 720; font-size: 1.15rem; margin: 0 0 .85rem; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: .8rem; }
.metric-card { position: relative; background: #fff; border: 1px solid var(--frota-edge); border-radius: 12px; display: grid; justify-items: start; gap: .28rem; color: var(--frota-ink); text-decoration: none; padding: 1rem; min-width: 0; }
.metric-card:hover { border-color: #7c929f; color: #1a3543; }
.metric-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; font-size: 1rem; background: #f8efd7; color: #514116; border-radius: 7px; }
.metric-value { font-size: 1.7rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.metric-label { color: var(--frota-muted); font-size: .86rem; }
.metric-arrow { position: absolute; top: .95rem; right: 1rem; color: #61737e; }

.operation-filters > div { min-width: 0; max-width: 100%; }
.operation-filters .form-select { max-width: min(240px, 100%); }
.filter-bar { display: flex; flex-wrap: wrap; align-items: end; gap: .65rem; padding: .9rem; border-bottom: 1px solid var(--frota-edge); }
.filter-search { flex: 1 1 220px; }
.data-table { --bs-table-bg: transparent; font-size: .9rem; }
.data-table th, .data-table td { padding: .78rem .9rem; }
.data-table th { background: #edf2f4; font-size: .74rem; letter-spacing: .035em; text-transform: uppercase; color: #4b5c65; }
.data-table td { overflow-wrap: anywhere; }
.action-cell { text-align: right; white-space: nowrap; }
.tag, .status { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .42rem; border-radius: 5px; font-size: .76rem; line-height: 1.3; font-weight: 650; }
.tag { color: #344d5a; background: #eaf0f4; margin-right: .2rem; white-space: nowrap; }
.status .bi { font-size: .43rem; }
.status-active { background: #e4f1e8; color: #19563a; }
.status-inactive { background: #edf0f2; color: #53616a; }
.empty-state { min-height: 145px; display: grid; place-content: center; text-align: center; color: var(--frota-muted); padding: .9rem; }
.empty-state i { font-size: 1.6rem; color: #64808e; }
.empty-state p { margin: .35rem 0 0; }
.list-footer, .list-pagination { display: flex; gap: .6rem; align-items: center; }
.list-footer { justify-content: space-between; color: var(--frota-muted); padding: .75rem .9rem; font-size: .82rem; flex-wrap: wrap; }
#catalog-results[aria-busy="true"] { opacity: .65; }

.guest-body { background: #fff; }
.guest-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(310px, 45%) 1fr; }
.guest-aside { position: relative; overflow: hidden; background: linear-gradient(155deg, #1a242c 25%, #2d414d); color: #fff; padding: clamp(1.2rem, 5vw, 4rem); }
.guest-aside-content { height: 100%; min-height: 400px; }
.road-art { position: absolute; inset: 21% 0 0; isolation: isolate; color: var(--frota-accent); display: grid; place-items: center; }
.road-art > .bi { background: #243844; padding: .18em .28em; border-radius: .2em; font-size: clamp(3.5rem, 13vw, 10rem); box-shadow: 0 15px 70px #0f171d60; }
.road-line { position: absolute; z-index: -1; top: 0; bottom: 0; border-inline-start: 2px solid #778a93; transform: skewX(-26deg); }
.road-line-left { left: 27%; }
.road-line-right { left: 73%; }
.road-line-center { left: 50%; border-color: var(--frota-accent); border-inline-start-style: dashed; opacity: .7; }
.guest-content { display: grid; place-items: center; padding: clamp(1.2rem, 6vw, 5rem); }
.guest-form { width: min(100%, 410px); }
.guest-form h1 { margin-bottom: .55rem; }

@media (min-width: 992px) {
    .sidebar.offcanvas-lg { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); background-color: var(--frota-sidebar) !important; }
    .workspace { margin-left: var(--sidebar-width); }
}
@media (max-width: 767px) {
    .guest-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .guest-aside { padding: 1rem 1.1rem; }
    .guest-aside-content { min-height: 0; }
    .road-art { inset: 0 1.5rem 0 auto; width: 100px; }
    .road-art .bi { font-size: 1.7rem; }
    .guest-content { align-items: start; padding-top: clamp(2rem, 16vw, 5rem); }
    .table-cards, .table-cards tbody, .table-cards tr { display: block; }
    .table-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .table-cards tbody { padding: .65rem; }
    .table-cards tr { border: 1px solid var(--frota-edge); border-radius: 8px; padding: .45rem .55rem; margin-bottom: .55rem; }
    .table-cards td { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: space-between; padding: .32rem .05rem; border: 0; }
    .table-cards td::before { content: attr(data-label); color: var(--frota-muted); font-weight: 650; margin-right: auto; }
    .table-cards td.action-cell { align-items: center; }
    .filter-bar > div { flex: 1 1 135px; }
    .filter-bar > .filter-search { flex-basis: 100%; }
}
@media (max-width: 420px) {
    .user-name { display: none; }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-road { opacity: .78; right: -12%; }
}
