/* ── Modo escuro (v3-dark) ── */
input:not([type]),
input[type="text"]:not([data-no-uppercase]):not(.no-uppercase),
input[type="search"]:not([data-no-uppercase]):not(.no-uppercase),
textarea:not([data-no-uppercase]):not(.no-uppercase) {
    text-transform: uppercase;
}

.quick-actions-config {
    max-width: 780px;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
    border-radius: 6px;
    background: var(--bs-body-bg);
}

.quick-action-config-item {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    min-height: 58px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--bs-border-color);
    transition: background-color .15s ease, opacity .15s ease;
}

.quick-action-config-item:last-child {
    border-bottom: 0;
}

.quick-action-config-item.is-selected {
    background: rgba(var(--bs-primary-rgb), .06);
}

.quick-action-config-item.is-dragging {
    opacity: .45;
}

.quick-action-drag {
    color: var(--bs-secondary-color);
    cursor: grab;
    font-size: 1.15rem;
}

.quick-action-check {
    display: grid;
    grid-template-columns: 22px 34px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-width: 0;
    cursor: pointer;
}

.quick-action-check .form-check-input {
    margin: 0;
}

.quick-action-check small {
    display: block;
    overflow: hidden;
    color: var(--bs-secondary-color);
    font-size: .75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-action-icon {
    display: inline-grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid var(--bs-border-color);
    border-radius: 6px;
    color: var(--bs-primary);
    background: var(--bs-tertiary-bg);
}

.quick-action-order {
    display: flex;
    gap: 4px;
}

.quick-action-order .btn {
    display: inline-grid;
    width: 30px;
    height: 30px;
    padding: 0;
    place-items: center;
}

@media (max-width: 575.98px) {
    .quick-action-config-item {
        grid-template-columns: 20px minmax(0, 1fr) auto;
        padding-inline: 6px;
    }

    .quick-action-check {
        grid-template-columns: 20px 30px minmax(0, 1fr);
        gap: 6px;
    }

    .quick-action-icon {
        width: 28px;
        height: 28px;
    }
}

input[type="email"],
input[type="password"],
input[type="url"],
input[name*="email" i],
input[name*="senha" i],
input[name*="password" i],
input[name*="token" i],
input[name*="license" i],
input[name*="licenca" i],
input[name*="url" i],
input[name*="link" i],
input[name*="api_key" i],
textarea[name*="json" i],
textarea[name*="xml" i],
textarea[name*="payload" i],
.no-uppercase {
    text-transform: none;
}

body.v3-dark {
    background: radial-gradient(circle at top left, #0f172a 0%, #1e293b 60%, #0f172a 100%) !important;
    color: #e2e8f0;
}
body.v3-dark .sidebar-gradient {
    background: linear-gradient(180deg, #1e3a5f 0%, #162d4a 35%, #0f2034 65%, #091525 100%) !important;
    border-right: 1px solid rgba(96,165,250,.20);
    box-shadow: 0 0 30px rgba(15,23,42,.50);
}
body.v3-dark .app-content {
    background: rgba(15,23,42,.72);
    border-color: rgba(255,255,255,.08);
    box-shadow: 0 20px 55px rgba(0,0,0,.35);
}
body.v3-dark .app-toolbar {
    background: linear-gradient(135deg, rgba(30,41,59,.85), rgba(15,23,42,.80));
    border-color: rgba(255,255,255,.08);
}
body.v3-dark .card,
body.v3-dark .modal-content,
body.v3-dark .dropdown-menu {
    background: linear-gradient(180deg, rgba(30,41,59,.95), rgba(15,23,42,.97));
    border-color: rgba(255,255,255,.10);
    color: #e2e8f0;
}
body.v3-dark .table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(255,255,255,.04);
    color: #e2e8f0;
}
body.v3-dark .table th,
body.v3-dark .table td { color: #e2e8f0; border-color: rgba(255,255,255,.08); }
body.v3-dark .form-control,
body.v3-dark .form-select {
    border-radius: 14px;
    border-color: rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    color: #e2e8f0;
}
body.v3-dark .form-control:focus,
body.v3-dark .form-select:focus {
    box-shadow: 0 0 0 .2rem rgba(96,165,250,.20);
    border-color: #60a5fa;
    background: rgba(255,255,255,.09);
}
body.v3-dark .text-muted { color: #94a3b8 !important; }
body.v3-dark .btn-outline-secondary { color: #94a3b8; border-color: rgba(255,255,255,.14); }
body.v3-dark .btn-outline-dark { color: #cbd5e1; border-color: rgba(255,255,255,.14); }

/* ── Temas ── */
body.theme-classic {
    background: radial-gradient(circle at top left, #dbeafe 0%, #c7d2fe 30%, #eef2ff 60%, #f8fafc 100%) !important;
}
body.theme-classic aside {
    background: linear-gradient(180deg,#2563eb 0%,#1d4ed8 45%,#1e3a8a 100%) !important;
}

body.theme-cyber {
    background: radial-gradient(circle at top right, #08121f 0%, #0b1b2b 45%, #03111c 100%) !important;
    color: #d7fff0;
}
body.theme-cyber aside {
    background: linear-gradient(180deg,#031821 0%,#052532 55%,#062c3a 100%) !important;
    border-right: 1px solid rgba(0,255,136,.25);
    box-shadow: 0 0 22px rgba(0,255,136,.14);
}
body.theme-cyber .card { background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.04)); border: 1px solid rgba(0,255,136,.2); color: #d7fff0; }
body.theme-cyber .btn-primary { background: linear-gradient(135deg,#00c57a,#00a965); border-color: transparent; }

body.theme-royal {
    background: radial-gradient(circle at top left, #5b21b6 0%, #312e81 40%, #0f172a 100%) !important;
    color: #eee8ff;
}
body.theme-royal aside {
    background: linear-gradient(180deg,#312e81 0%,#4c1d95 55%,#111827 100%) !important;
    border-right: 1px solid rgba(182,138,255,.28);
}
body.theme-royal .card { background: linear-gradient(180deg, rgba(255,255,255,.11), rgba(255,255,255,.04)); border: 1px solid rgba(182,138,255,.26); color: #eee8ff; }
body.theme-royal .btn-primary { background: linear-gradient(135deg,#9468ff,#7042d8); border-color: transparent; }

body.theme-sunset {
    background: radial-gradient(circle at top right, #fb923c 0%, #7c2d12 45%, #111827 100%) !important;
    color: #ffe8dc;
}
body.theme-sunset aside {
    background: linear-gradient(180deg,#9a3412 0%,#7c2d12 55%,#1f2937 100%) !important;
    border-right: 1px solid rgba(255,190,120,.3);
}
body.theme-sunset .card { background: linear-gradient(180deg, rgba(255,255,255,.11), rgba(255,255,255,.04)); border: 1px solid rgba(255,179,120,.26); color: #ffe8dc; }
body.theme-sunset .btn-primary { background: linear-gradient(135deg,#ff8a3d,#e45b13); border-color: transparent; }

body.theme-classic .btn,
body.theme-cyber .btn,
body.theme-royal .btn,
body.theme-sunset .btn {
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(0,0,0,.16);
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

body.theme-classic .btn:hover,
body.theme-cyber .btn:hover,
body.theme-royal .btn:hover,
body.theme-sunset .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 28px rgba(0,0,0,.22);
}

body.theme-classic .card,
body.theme-classic .modal-content,
body.theme-classic .dropdown-menu {
    background: linear-gradient(180deg, rgba(255,255,255,.95) 0%, rgba(248,250,255,.90) 100%);
    border: 1px solid rgba(255,255,255,.45);
    box-shadow: 0 18px 50px rgba(15,23,42,.10);
    backdrop-filter: blur(14px);
}
body.theme-classic .table { --bs-table-bg: transparent; --bs-table-striped-bg: rgba(13,110,253,.04); }
body.theme-classic .form-control,
body.theme-classic .form-select {
    border-radius: 14px;
    border-color: rgba(148,163,184,.35);
    background: rgba(255,255,255,.92);
}
body.theme-classic .form-control:focus,
body.theme-classic .form-select:focus {
    box-shadow: 0 0 0 .2rem rgba(99,102,241,.15);
    border-color: #6366f1;
}

body.theme-cyber .modal-content,
body.theme-cyber .dropdown-menu { background: linear-gradient(180deg, rgba(8,31,45,.98), rgba(5,21,31,.97)); border: 1px solid rgba(0,255,136,.26); color: #d7fff0; box-shadow: 0 12px 24px rgba(0,255,136,.16); }
body.theme-cyber .table { --bs-table-bg: transparent; --bs-table-striped-bg: rgba(0,255,136,.05); color: #d7fff0; }
body.theme-cyber .table th, body.theme-cyber .table td { color: #d7fff0; border-color: rgba(0,255,136,.16); }
body.theme-cyber .form-control,
body.theme-cyber .form-select { border-radius: 14px; border-color: rgba(0,255,136,.26); background: rgba(255,255,255,.04); color: #d7fff0; }
body.theme-cyber .form-control:focus,
body.theme-cyber .form-select:focus { box-shadow: 0 0 0 .2rem rgba(0,255,136,.18); border-color: #00d98a; background: rgba(255,255,255,.07); }

body.theme-royal .modal-content,
body.theme-royal .dropdown-menu { background: linear-gradient(180deg, rgba(65,44,104,.97), rgba(38,26,61,.97)); border: 1px solid rgba(182,138,255,.28); color: #eee8ff; box-shadow: 0 12px 24px rgba(182,138,255,.16); }
body.theme-royal .table { --bs-table-bg: transparent; --bs-table-striped-bg: rgba(182,138,255,.06); color: #eee8ff; }
body.theme-royal .table th, body.theme-royal .table td { color: #eee8ff; border-color: rgba(182,138,255,.16); }
body.theme-royal .form-control,
body.theme-royal .form-select { border-radius: 14px; border-color: rgba(182,138,255,.26); background: rgba(255,255,255,.05); color: #eee8ff; }
body.theme-royal .form-control:focus,
body.theme-royal .form-select:focus { box-shadow: 0 0 0 .2rem rgba(182,138,255,.18); border-color: #a678ff; background: rgba(255,255,255,.08); }

body.theme-sunset .modal-content,
body.theme-sunset .dropdown-menu { background: linear-gradient(180deg, rgba(115,55,28,.96), rgba(60,27,15,.97)); border: 1px solid rgba(255,190,120,.3); color: #ffe8dc; box-shadow: 0 12px 24px rgba(255,143,71,.17); }
body.theme-sunset .table { --bs-table-bg: transparent; --bs-table-striped-bg: rgba(255,179,120,.08); color: #ffe8dc; }
body.theme-sunset .table th, body.theme-sunset .table td { color: #ffe8dc; border-color: rgba(255,190,120,.16); }
body.theme-sunset .form-control,
body.theme-sunset .form-select { border-radius: 14px; border-color: rgba(255,190,120,.28); background: rgba(255,255,255,.06); color: #ffe8dc; }
body.theme-sunset .form-control:focus,
body.theme-sunset .form-select:focus { box-shadow: 0 0 0 .2rem rgba(255,143,71,.2); border-color: #ff9d55; background: rgba(255,255,255,.08); }

body.theme-cyber .nav-pills .nav-link.active,
body.theme-royal .nav-pills .nav-link.active,
body.theme-sunset .nav-pills .nav-link.active,
body.theme-classic .nav-pills .nav-link.active {
    border-radius: 14px;
}

/* ── Sidebar ── */
.sidebar-gradient {
    background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 35%, #1e40af 65%, #1e3a8a 100%) !important;
    border-right: 1px solid rgba(147,197,253,.30);
    box-shadow: 0 0 30px rgba(37,99,235,.28);
    position: relative;
    overflow: hidden;
}
.sidebar-gradient::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, rgba(255,255,255,.10), transparent 35%, transparent 60%, rgba(191,219,254,.08));
    pointer-events: none;
}
.sidebar-gradient::after {
    content: '';
    position: absolute;
    top: -20%;
    left: -35%;
    width: 70%;
    height: 140%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.14), transparent);
    transform: rotate(12deg);
    filter: blur(8px);
    animation: sidebarGlowSweep 7s linear infinite;
    pointer-events: none;
    opacity: .7;
}

/* ── Logo ── */
.app-logo-wrap {
    position: relative;
    display: inline-block;
}
.app-logo-wrap::before {
    content: '';
    position: absolute;
    inset: -10px -18px;
    border-radius: 24px;
    background: radial-gradient(circle, rgba(191,219,254,.30), rgba(96,165,250,.16), transparent 72%);
    filter: blur(12px);
    animation: logoPulseGlow 3.6s ease-in-out infinite;
    pointer-events: none;
}

/* ── App Shell ── */
.app-shell {
    position: relative;
    overflow: hidden;
}
.app-shell::before,
.app-shell::after {
    content: '';
    position: fixed;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .28;
    pointer-events: none;
    z-index: 0;
}
.app-shell::before,
.app-shell::after {
    display: none;
}

.app-sidebar {
    width: 280px;
    padding: 22px 18px;
    position: relative;
    z-index: 2;
    transition: width .22s ease, padding .22s ease;
}

/* ── Sidebar collapsed ── */
.app-shell.sidebar-collapsed .app-sidebar {
    width: 68px;
    padding-left: 8px;
    padding-right: 8px;
}
.app-shell.sidebar-collapsed .app-sidebar .sidebar-section-label,
.app-shell.sidebar-collapsed .app-sidebar .app-brand-badge,
.app-shell.sidebar-collapsed .app-sidebar .btn span,
.app-shell.sidebar-collapsed .app-sidebar .sidebar-user-name,
.app-shell.sidebar-collapsed .app-sidebar .sidebar-user-role,
.app-shell.sidebar-collapsed .app-sidebar .fw-bold.fs-5 {
    display: none !important;
}
.app-shell.sidebar-collapsed .app-sidebar .sidebar-user-info {
    justify-content: center;
    padding: 8px;
}
.app-shell.sidebar-collapsed .app-sidebar .btn {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
    gap: 0;
    position: relative;
}
.app-shell.sidebar-collapsed .app-sidebar .nav-ico {
    margin-right: 0;
}
.app-shell.sidebar-collapsed .app-sidebar .btn.active-nav::after {
    display: none;
}
.app-shell.sidebar-collapsed .app-sidebar form .btn {
    display: inline-flex !important;
}
.app-shell.sidebar-collapsed .app-main {
    padding-left: 12px;
}
/* Tooltip nos itens colapsados */
.app-shell.sidebar-collapsed .app-sidebar .btn[data-tippy] {
    overflow: visible;
}

/* ── Main / Content ── */
.app-main {
    position: relative;
    z-index: 1;
    padding: 20px;
}
.app-content {
    background: rgba(255,255,255,.86);
    border: 1px solid rgba(148,163,184,.24);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 16px 40px rgba(15,23,42,.10);
    transition: opacity .24s ease, transform .24s ease, filter .24s ease;
}
body.v3-leaving .app-content {
    opacity: .35;
    transform: translateY(8px) scale(.992);
    filter: blur(2px);
}
body.v3-leaving .v3-preloader {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

/* ── Toolbar ── */
.app-toolbar {
    background: rgba(248,250,252,.94);
    border: 1px solid rgba(148,163,184,.24);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 10px 24px rgba(15,23,42,.06);
}
.app-toolbar .btn-primary,
.app-toolbar .btn-outline-primary,
.app-toolbar .btn-outline-secondary,
.app-toolbar .btn-outline-dark {
    border-radius: 14px !important;
}
.app-toolbar .btn-primary {
    background: linear-gradient(135deg, #0b63ff, #0a4be1 55%, #0837b8) !important;
    border-color: transparent !important;
    box-shadow: 0 14px 28px rgba(11,99,255,.22);
}
.app-toolbar .btn-outline-primary {
    color: #0b56f0;
    border-color: rgba(11,99,255,.22);
    background: linear-gradient(135deg, rgba(11,99,255,.08), rgba(147,197,253,.10));
}
.app-content .btn-primary {
    background: linear-gradient(135deg, #0b63ff, #0a4be1 55%, #0837b8) !important;
    border-color: transparent !important;
    box-shadow: 0 14px 28px rgba(11,99,255,.20);
}
.app-content .btn-outline-primary {
    color: #0b56f0;
    border-color: rgba(11,99,255,.20);
    background: linear-gradient(135deg, rgba(11,99,255,.08), rgba(147,197,253,.10));
}

/* ── Toggle ── */
.v3-toggle {
    min-width: 44px;
    font-size: 1rem;
    font-weight: 700;
}

/* ── Preloader ── */
.v3-preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, rgba(96,165,250,.22), transparent 28%), linear-gradient(135deg, rgba(2,6,23,.92), rgba(15,23,42,.96));
    backdrop-filter: blur(12px);
    transition: opacity .35s ease, visibility .35s ease;
    animation: v3PreloaderAutoHide 0s 2.5s forwards;
}
.v3-preloader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
@keyframes v3PreloaderAutoHide {
    to { opacity: 0; visibility: hidden; pointer-events: none; }
}
.v3-preloader-box {
    text-align: center;
    color: #fff;
}
.v3-preloader-ring {
    width: 76px;
    height: 76px;
    margin: 0 auto 14px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,.12);
    border-top-color: #60a5fa;
    border-right-color: #a78bfa;
    animation: v3Spin 1.1s linear infinite;
    box-shadow: 0 0 30px rgba(96,165,250,.18);
}
.v3-preloader-title {
    font-weight: 700;
    letter-spacing: .04em;
}
.v3-preloader-subtitle {
    color: rgba(255,255,255,.68);
    font-size: .78rem;
    margin-top: 4px;
}

/* ── Keyframes ── */
@keyframes v3Spin {
    to { transform: rotate(360deg); }
}
@keyframes sidebarGlowSweep {
    0% { transform: translateX(0) rotate(12deg); }
    100% { transform: translateX(240%) rotate(12deg); }
}
@keyframes logoPulseGlow {
    0%, 100% { opacity: .62; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.04); }
}

/* ── Sidebar buttons ── */
.app-sidebar .btn {
    justify-content: flex-start;
    align-items: center;
    gap: 20px;
    border-radius: 14px !important;
    border-color: rgba(255,255,255,.12) !important;
    background: rgba(255,255,255,.05);
    color: rgba(255,255,255,.88) !important;
    backdrop-filter: blur(10px);
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
    position: relative;
    overflow: hidden;
    font-size: .82rem;
    font-weight: 500;
    letter-spacing: .01em;
    padding: 8px 12px;
}
.app-sidebar .btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255,255,255,.08), transparent);
    opacity: 0;
    transition: opacity .16s ease;
    border-radius: 14px;
}
.app-sidebar .btn:hover {
    background: rgba(255,255,255,.14) !important;
    border-color: rgba(255,255,255,.28) !important;
    color: #fff !important;
    transform: translateX(3px);
    box-shadow: 0 4px 18px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.12);
}
.app-sidebar .btn:hover::before { opacity: 1; }

.app-sidebar .btn.active-nav {
    background: rgba(255,255,255,.18) !important;
    border-color: rgba(255,255,255,.38) !important;
    color: #fff !important;
    box-shadow: 0 4px 20px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.20);
    font-weight: 600;
}
.app-sidebar .btn.active-nav .nav-ico {
    background: linear-gradient(135deg, rgba(255,255,255,.45), rgba(147,197,253,.30)) !important;
    box-shadow: 0 0 0 1px rgba(255,255,255,.20), 0 4px 14px rgba(96,165,250,.35), 0 0 20px rgba(96,165,250,.25) !important;
}
.app-sidebar .btn.active-nav::after {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 3px;
    background: linear-gradient(180deg, #93c5fd, #60a5fa);
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 8px rgba(96,165,250,.6);
}

.app-sidebar .btn span {
    padding-left: 2px;
    letter-spacing: .01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.app-sidebar .nav-ico {
    width: 32px;
    height: 32px;
    min-width: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    text-align: center;
    opacity: 1;
    font-size: .95rem;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(255,255,255,.22), rgba(96,165,250,.14));
    border: 1px solid rgba(255,255,255,.18);
    box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 4px 12px rgba(2,6,23,.20);
    position: relative;
    flex-shrink: 0;
    transition: box-shadow .16s ease, background .16s ease;
}

/* ── Sidebar section labels ── */
.sidebar-section-label {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255,255,255,.38);
    padding: 4px 4px 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,.10);
}

/* ── Sidebar user info ── */
.sidebar-user-info {
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 14px;
    padding: 10px 12px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 2px 8px rgba(59,130,246,.4);
}
.sidebar-user-name {
    font-size: .82rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-user-role {
    font-size: .7rem;
    color: rgba(255,255,255,.5);
    line-height: 1;
}

.sidebar-profile-focus {
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 10px;
    padding: 8px;
    background: rgba(255,255,255,.06);
}

.app-quick-menu {
    min-width: 220px;
}

.app-quick-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .9rem;
}

.search-shortcut {
    border-radius: 999px !important;
}

/* UI polish layer */
:root {
    --ui-radius: 8px;
    --ui-border: rgba(148, 163, 184, .28);
    --ui-soft: #f8fafc;
    --ui-text: #0f172a;
    --ui-muted: #64748b;
    --action-view: #0d6efd;
    --action-edit: #f59f00;
    --action-success: #198754;
    --action-print: #6f42c1;
    --action-danger: #dc3545;
}

.card,
.modal-content,
.dropdown-menu,
.list-group-item,
.alert {
    border-radius: var(--ui-radius) !important;
}

.card {
    border-color: var(--ui-border) !important;
}

.card-header {
    border-top-left-radius: var(--ui-radius) !important;
    border-top-right-radius: var(--ui-radius) !important;
}

.btn,
.form-control,
.form-select,
.input-group-text,
.page-link,
.badge {
    border-radius: 7px !important;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    min-height: 34px;
    font-weight: 700;
    box-shadow: none;
    transition: transform .14s ease, box-shadow .14s ease, background-color .14s ease, border-color .14s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, .10);
}

.btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-outline-success,
.btn-success {
    --bs-btn-border-color: var(--action-success);
}

.btn-outline-warning,
.btn-warning {
    --bs-btn-border-color: var(--action-edit);
}

.btn-outline-danger,
.btn-danger {
    --bs-btn-border-color: var(--action-danger);
}

.btn-outline-primary,
.btn-primary {
    --bs-btn-border-color: var(--action-view);
}

.btn-outline-secondary .bi-printer,
.btn-secondary .bi-printer,
.btn-outline-dark .bi-printer,
.btn-dark .bi-printer {
    color: var(--action-print);
}

.table {
    vertical-align: middle;
}

.table thead th {
    background: var(--ui-soft);
    color: #334155;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
    white-space: nowrap;
    border-bottom-color: var(--ui-border);
}

.table tbody tr {
    transition: background-color .14s ease;
}

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

.module-toolbar,
.filter-toolbar,
.finance-filter-bar,
form.row.g-2.align-items-end {
    background: var(--ui-soft);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    padding: 10px;
}

.module-toolbar .form-label,
.filter-toolbar .form-label,
.finance-filter-bar .form-label,
form.row.g-2.align-items-end .form-label {
    color: var(--ui-muted);
    font-size: .72rem;
    font-weight: 800;
    margin-bottom: 3px;
    text-transform: uppercase;
}

.action-group,
.table-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.action-group .btn,
.table-actions .btn,
.table td .btn.btn-sm {
    min-width: 34px;
    min-height: 32px;
    padding-inline: 9px;
}

.list-group-item {
    border-color: rgba(148, 163, 184, .20);
}

.text-muted {
    color: var(--ui-muted) !important;
}

.progress {
    border-radius: 999px;
    background: #e2e8f0;
}

.progress-bar {
    border-radius: inherit;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }

    .btn:hover {
        transform: none;
    }
}

@media (max-width: 768px) {
    .btn {
        min-height: 38px;
    }

    .table-responsive {
        border-radius: var(--ui-radius);
        border: 1px solid var(--ui-border);
    }

    .module-toolbar,
    .filter-toolbar,
    .finance-filter-bar,
    form.row.g-2.align-items-end {
        padding: 8px;
    }
}

.sidebar-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: -8px -4px 12px;
    padding: 8px 4px 12px;
    border-bottom: 1px solid rgba(255,255,255,.14);
}

.sidebar-nav-group {
    padding: 4px;
    border-radius: 16px;
    background: rgba(15,23,42,.10);
    border: 1px solid rgba(255,255,255,.08);
}

/* ── Sidebar brand badge ── */
.app-brand-badge {
    display: inline-block;
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: .06em;
    color: rgba(255,255,255,.45);
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px;
    padding: 2px 10px;
    margin-top: 4px;
}

/* ── Sidebar scrollbar ── */
.app-sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.15) transparent;
}
.app-sidebar::-webkit-scrollbar { width: 4px; }
.app-sidebar::-webkit-scrollbar-track { background: transparent; }
.app-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }
.app-sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.28); }

/* ── Sidebar logout btn ── */
.sidebar-logout-btn {
    background: rgba(239,68,68,.12) !important;
    border-color: rgba(239,68,68,.24) !important;
    color: rgba(255,180,180,.9) !important;
    font-size: .82rem;
    font-weight: 600;
}
.sidebar-logout-btn:hover {
    background: rgba(239,68,68,.22) !important;
    border-color: rgba(239,68,68,.4) !important;
    color: #fca5a5 !important;
    transform: none !important;
}

/* ── Toolbar melhorias ── */
.app-toolbar {
    background: rgba(248,250,252,.94);
    border: 1px solid rgba(148,163,184,.24);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 10px 14px;
    box-shadow: 0 10px 24px rgba(15,23,42,.06);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.app-toolbar .btn { font-size: .8rem; }
.app-toolbar .form-control-sm { font-size: .8rem; border-radius: 12px !important; }

/* ── Notificações badge pulse ── */
#notif-count {
    animation: badgePulse 2s ease infinite;
}
.modal {
    z-index: 1065;
}
.modal.show {
    pointer-events: auto;
}
.modal-dialog {
    pointer-events: auto;
}
.modal-content,
.modal iframe {
    pointer-events: auto;
}
#notificacoesModal {
    z-index: 1065 !important;
}
.modal-backdrop {
    z-index: 1060;
}
@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,.4); }
    50% { box-shadow: 0 0 0 5px rgba(220,38,38,0); }
}

/* ── Cards melhorias ── */
.card {
    transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(15,23,42,.12) !important;
}

/* ── Badges de status ── */
.badge { font-weight: 600; letter-spacing: .03em; }

/* ── Tables melhorias ── */
.table thead th {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
}
.table tbody tr { transition: background .12s ease; }

/* ── Form melhorias ── */
.form-label {
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .02em;
    margin-bottom: .3rem;
}
.form-control, .form-select {
    transition: border-color .15s ease, box-shadow .15s ease;
}

/* ── Page title ── */
.page-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -.01em;
    color: #1e293b;
    line-height: 1.2;
}
.page-subtitle {
    font-size: .8rem;
    color: #64748b;
    margin-top: 2px;
}
body.v3-dark .page-title { color: #e2e8f0; }
body.v3-dark .page-subtitle { color: #94a3b8; }

/* ── Scrollbar global ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,.04); border-radius: 6px; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.18); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.30); }
body.v3-dark ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); }
body.v3-dark ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.28); }

/* ── Focus ring acessível ── */
:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

/* ── Mobile sidebar ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.52);
    z-index: 1090;
    opacity: 0;
    transition: opacity .18s ease;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-bottom-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 1030;
    min-height: 64px;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 4px;
    padding: 8px;
    border-radius: 20px;
    background: rgba(255,255,255,.94);
    border: 1px solid rgba(148,163,184,.28);
    box-shadow: 0 18px 45px rgba(15,23,42,.22);
    backdrop-filter: blur(18px);
}

.products-mobile-list {
    display: none;
}
.mobile-bottom-nav a,
.mobile-bottom-nav button {
    border: 0;
    background: transparent;
    color: #475569;
    text-decoration: none;
    border-radius: 14px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: .68rem;
    font-weight: 700;
    line-height: 1;
    min-height: 48px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}
.mobile-bottom-nav a:active,
.mobile-bottom-nav button:active {
    transform: scale(.96);
}
.mobile-bottom-nav i {
    font-size: 1.15rem;
    line-height: 1;
}
.mobile-bottom-nav .active {
    color: #0b56f0;
    background: rgba(13,110,253,.10);
}
.mobile-bottom-nav button.is-open {
    color: #0b56f0;
    background: rgba(13,110,253,.12);
}
body.v3-dark .mobile-bottom-nav {
    background: rgba(15,23,42,.94);
    border-color: rgba(255,255,255,.12);
}
body.v3-dark .mobile-bottom-nav a,
body.v3-dark .mobile-bottom-nav button {
    color: #cbd5e1;
}
body.v3-dark .mobile-bottom-nav .active {
    color: #93c5fd;
    background: rgba(96,165,250,.16);
}

@media (max-width: 991.98px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
        background: #f6f8fb !important;
    }
    .app-shell {
        display: block !important;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    .app-shell::before,
    .app-shell::after {
        display: none;
    }
    .app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100dvh;
        width: min(90vw, 360px) !important;
        max-width: 360px !important;
        z-index: 1100;
        transform: translateX(-104%);
        transition: transform .22s ease;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        padding: calc(14px + env(safe-area-inset-top)) 12px calc(96px + env(safe-area-inset-bottom));
        border-radius: 0 16px 16px 0;
        overscroll-behavior: contain;
    }
    .app-sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 18px 0 55px rgba(15,23,42,.32);
    }
    body.sidebar-open {
        overflow: hidden;
        overscroll-behavior: none;
    }
    .app-shell.sidebar-collapsed .app-sidebar {
        width: min(90vw, 360px) !important;
        padding: calc(14px + env(safe-area-inset-top)) 12px calc(96px + env(safe-area-inset-bottom)) !important;
    }
    .app-shell.sidebar-collapsed .app-sidebar .sidebar-section-label {
        display: flex !important;
    }
    .app-shell.sidebar-collapsed .app-sidebar .app-brand-badge,
    .app-shell.sidebar-collapsed .app-sidebar .sidebar-user-name,
    .app-shell.sidebar-collapsed .app-sidebar .sidebar-user-role,
    .app-shell.sidebar-collapsed .app-sidebar .fw-bold.fs-5 {
        display: block !important;
    }
    .app-shell.sidebar-collapsed .app-sidebar .btn span {
        display: inline !important;
    }
    .app-shell.sidebar-collapsed .app-sidebar .btn {
        justify-content: flex-start;
        padding: 8px 12px;
        gap: 14px;
    }
    .app-shell.sidebar-collapsed .app-sidebar .nav-ico {
        margin-right: 0;
        width: 30px;
        min-width: 30px;
    }
    .app-shell.sidebar-collapsed .app-sidebar .sidebar-user-info {
        justify-content: flex-start;
        padding: 10px;
    }
    .app-sidebar .btn[data-bs-toggle="collapse"] {
        min-height: 42px;
    }
    .app-sidebar .btn {
        min-height: 44px;
        border-radius: 12px;
        touch-action: manipulation;
    }
    .app-sidebar .sidebar-nav-group {
        display: grid;
        gap: 4px;
    }
    .app-sidebar .collapse {
        min-width: 0;
    }
    .app-main {
        width: 100%;
        max-width: 100vw;
        min-width: 0;
        padding: 6px 6px calc(96px + env(safe-area-inset-bottom));
    }
    .app-content {
        width: 100%;
        max-width: 100%;
        padding: 10px;
        border-radius: 14px;
        overflow-x: hidden;
        background: #ffffff;
        border-color: rgba(148,163,184,.22);
        box-shadow: 0 8px 26px rgba(15,23,42,.08);
        backdrop-filter: none;
    }
    body.v3-dark .app-content {
        background: #0f172a;
    }
    .app-toolbar {
        position: sticky;
        top: 4px;
        z-index: 1020;
        display: grid !important;
        grid-template-columns: 1fr;
        align-items: center;
        gap: 8px;
        padding: 8px;
        border-radius: 14px;
        margin-bottom: 12px !important;
        background: #ffffff;
        border-color: rgba(148,163,184,.24);
        box-shadow: 0 8px 22px rgba(15,23,42,.08);
        backdrop-filter: none;
    }
    .app-toolbar-main > .btn,
    .app-toolbar-actions .btn,
    .app-search-form .btn {
        min-width: 42px;
        touch-action: manipulation;
    }
    .app-toolbar-main {
        min-width: 0;
        width: 100%;
        flex-wrap: nowrap;
    }
    .app-search-form {
        flex: 1;
        min-width: 0;
        max-width: 100%;
    }
    .app-search-form input[name="q"] {
        min-width: 0 !important;
        width: 100%;
    }
    .app-search-form .btn span,
    .app-toolbar-actions a span {
        display: none;
    }
    .app-toolbar-actions {
        flex-wrap: nowrap !important;
        justify-content: space-between;
        gap: 6px !important;
        width: 100%;
    }
    .app-toolbar-actions .btn,
    .app-toolbar-main > .btn,
    .app-search-form .btn {
        width: 40px;
        height: 38px;
        padding: 0 !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .app-toolbar-actions .btn i,
    .app-search-form .btn i {
        margin: 0 !important;
    }
    .card {
        border-radius: 14px !important;
        box-shadow: 0 6px 18px rgba(15,23,42,.07) !important;
    }
    .card:hover {
        transform: none;
    }
    .table-responsive {
        border-radius: 14px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        max-width: 100%;
    }
    .table-responsive .table {
        width: max-content;
        min-width: 100%;
    }
    table.table {
        max-width: none;
    }
    .card,
    .card-body,
    .modal-content,
    .modal-body,
    .tab-content,
    .tab-pane {
        max-width: 100%;
        min-width: 0;
    }
    .card > .table,
    .card-body > .table,
    .app-content > .table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .row {
        min-width: 0;
    }
    .row > [class*="col-"] {
        min-width: 0;
    }
    .form-control,
    .form-select,
    textarea,
    input,
    select {
        max-width: 100%;
    }
    .input-group {
        flex-wrap: wrap;
        max-width: 100%;
    }
    .input-group > .form-control,
    .input-group > .form-select {
        min-width: 0;
    }
    .d-flex {
        min-width: 0;
    }
    .d-flex.flex-nowrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .justify-content-between {
        min-width: 0;
    }
    .btn-group,
    .btn-toolbar {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .btn {
        white-space: normal;
        max-width: 100%;
    }
    .btn + .btn {
        margin-left: 0;
    }
    .card-body,
    .modal-body {
        min-width: 0;
    }
    [style*="min-width"] {
        min-width: 0 !important;
    }
    [style*="max-width"] {
        max-width: 100% !important;
    }
    [style*="width:220px"],
    [style*="width: 220px"],
    [style*="width:200px"],
    [style*="width: 200px"] {
        width: 100% !important;
    }
    .modal-dialog {
        margin: .5rem;
    }
    .btn {
        min-height: 38px;
    }
    .row.g-3 {
        --bs-gutter-x: .75rem;
        --bs-gutter-y: .75rem;
    }
    .products-page-head,
    .products-page-actions,
    .products-table-toolbar,
    .products-bulk-actions {
        align-items: stretch !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        width: 100%;
    }
    .products-page-head > h4,
    .products-table-toolbar > small {
        width: 100%;
    }
    .products-page-actions .btn,
    .products-bulk-actions .btn {
        flex: 1 1 calc(50% - 8px);
        min-width: 132px;
    }
    .products-table-wrap {
        position: relative;
        overflow-x: auto !important;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        border: 1px solid rgba(148,163,184,.24);
    }
    .products-table {
        min-width: 980px !important;
    }
    .products-table .product-actions-col {
        position: sticky;
        right: 0;
        z-index: 3;
        min-width: 132px;
        background: #fff;
        box-shadow: -10px 0 16px rgba(15,23,42,.08);
    }
    .products-table thead .product-actions-col {
        z-index: 4;
        background: #f8fafc;
    }
    .products-table tr.table-warning .product-actions-col {
        background: #fff3cd;
    }
    .product-row-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .product-row-actions .btn,
    .product-row-actions form,
    .product-row-actions form .btn {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    body {
        font-size: .92rem;
    }
    .app-main {
        padding-left: 4px;
        padding-right: 4px;
    }
    .app-content {
        padding: 8px;
        border-radius: 12px;
    }
    .app-content > .d-flex,
    .card-body > .d-flex,
    .modal-body > .d-flex {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    .app-content > .d-flex > *,
    .card-body > .d-flex > *,
    .modal-body > .d-flex > * {
        min-width: 0;
    }
    .app-content > .d-flex > .d-flex,
    .card-body > .d-flex > .d-flex {
        width: 100%;
    }
    .row {
        --bs-gutter-x: .65rem;
        --bs-gutter-y: .65rem;
    }
    .row > [class*="col-"] {
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }
    .col-6,
    .col-md-3,
    .col-md-4,
    .col-md-5,
    .col-md-6,
    .col-md-8,
    .col-lg-3,
    .col-lg-4,
    .col-lg-6,
    .col-xl-6 {
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }
    .card-body {
        padding: .85rem;
    }
    .form-control,
    .form-select,
    .btn {
        min-height: 42px;
    }
    .input-group,
    form .d-flex,
    form .gap-2 {
        flex-wrap: wrap !important;
    }
    .input-group > *,
    form .d-flex > *,
    form .gap-2 > * {
        min-width: 0;
    }
    form .btn,
    form a.btn {
        width: 100%;
    }
    .app-toolbar .app-search-form {
        flex-wrap: nowrap !important;
    }
    .app-toolbar .app-search-form .btn {
        width: 42px !important;
        flex: 0 0 42px !important;
    }
    .app-toolbar .app-search-form input[name="q"] {
        flex: 1 1 auto;
    }
    .table-responsive {
        overflow-x: visible;
        border-radius: 0;
    }
    table.responsive-card-table {
        display: block;
        width: 100% !important;
        min-width: 0 !important;
        border-collapse: separate;
        border-spacing: 0;
    }
    table.responsive-card-table thead {
        display: none;
    }
    table.responsive-card-table tbody {
        display: grid;
        gap: 10px;
    }
    table.responsive-card-table tr {
        display: block;
        width: 100%;
        border: 1px solid rgba(148,163,184,.28);
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 6px 18px rgba(15,23,42,.06);
        overflow: hidden;
    }
    table.responsive-card-table tr.table-warning {
        background: #fff8e1;
    }
    table.responsive-card-table td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        width: 100% !important;
        max-width: 100%;
        min-height: 38px;
        padding: 8px 10px !important;
        border: 0;
        border-bottom: 1px solid rgba(148,163,184,.16);
        text-align: right !important;
        white-space: normal;
        word-break: break-word;
    }
    table.responsive-card-table td:last-child {
        border-bottom: 0;
    }
    table.responsive-card-table td::before {
        content: attr(data-label);
        flex: 0 0 42%;
        max-width: 42%;
        text-align: left;
        color: #64748b;
        font-weight: 700;
        font-size: .78rem;
        text-transform: uppercase;
        letter-spacing: .03em;
    }
    table.responsive-card-table td[data-label=""]::before {
        display: none;
    }
    table.responsive-card-table td[data-label="Ações"],
    table.responsive-card-table td[data-label="Acoes"] {
        display: block;
        text-align: left !important;
        background: #f8fafc;
    }
    table.responsive-card-table td[data-label="Ações"]::before,
    table.responsive-card-table td[data-label="Acoes"]::before {
        display: block;
        max-width: 100%;
        margin-bottom: 8px;
    }
    table.responsive-card-table td[data-label="Ações"] .btn,
    table.responsive-card-table td[data-label="Acoes"] .btn,
    table.responsive-card-table td[data-label="Ações"] form,
    table.responsive-card-table td[data-label="Acoes"] form {
        width: 100%;
        margin: 0 0 6px 0;
    }
    table.responsive-card-table td input,
    table.responsive-card-table td select,
    table.responsive-card-table td textarea {
        width: 100%;
    }
    .products-table {
        min-width: 0 !important;
    }
    .products-table .product-actions-col {
        position: static;
        min-width: 0;
        background: #f8fafc !important;
        box-shadow: none;
    }
    .product-row-actions {
        display: grid;
        gap: 6px;
    }
    .products-desktop-table {
        display: none !important;
    }
    .products-mobile-list {
        display: grid;
        gap: 12px;
    }
    .product-mobile-card {
        border: 1px solid rgba(148,163,184,.26);
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 8px 22px rgba(15,23,42,.07);
        padding: 12px;
    }
    .product-mobile-card.is-critical {
        border-color: rgba(220,53,69,.32);
        background: #fff8e8;
    }
    .product-mobile-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 8px;
    }
    .product-mobile-check {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        color: #64748b;
        font-size: .85rem;
        font-weight: 700;
    }
    .product-mobile-name {
        font-weight: 800;
        color: #0f172a;
        line-height: 1.25;
        margin-bottom: 10px;
        word-break: break-word;
    }
    .product-mobile-fields {
        display: grid;
        gap: 7px;
        margin-bottom: 12px;
    }
    .product-mobile-fields div {
        display: grid;
        grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
        gap: 10px;
        align-items: start;
        border-top: 1px solid rgba(148,163,184,.16);
        padding-top: 7px;
    }
    .product-mobile-fields span {
        color: #64748b;
        font-size: .76rem;
        text-transform: uppercase;
        letter-spacing: .03em;
        font-weight: 800;
    }
    .product-mobile-fields strong {
        min-width: 0;
        text-align: right;
        word-break: break-word;
        font-size: .9rem;
    }
    .product-mobile-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        border-top: 1px solid rgba(148,163,184,.16);
        padding-top: 10px;
    }
    .product-mobile-actions form,
    .product-mobile-actions .btn {
        width: 100%;
    }
    .app-toolbar-actions {
        width: 100%;
        justify-content: space-between;
    }
    .app-toolbar-actions .btn {
        flex: 1 1 0;
    }
    h1, .h1 { font-size: 1.55rem; }
    h2, .h2 { font-size: 1.35rem; }
    h4, .h4 { font-size: 1.12rem; }
    .nav-pills {
        overflow-x: auto;
        flex-wrap: nowrap !important;
        padding-bottom: 4px;
    }
    .nav-pills .nav-link {
        white-space: nowrap;
    }
    .mobile-bottom-nav {
        left: 6px;
        right: 6px;
        bottom: max(6px, env(safe-area-inset-bottom));
        min-height: 58px;
        padding: 6px;
        border-radius: 16px;
    }
    .mobile-bottom-nav a,
    .mobile-bottom-nav button {
        font-size: .62rem;
    }
    .sidebar-nav-group {
        background: transparent;
        border-color: rgba(255,255,255,.08);
    }
    .app-sidebar .btn {
        min-height: 42px;
        padding: 7px 10px;
    }
    .app-sidebar .nav-ico {
        width: 30px;
        height: 30px;
        min-width: 30px;
    }
}

/* Professional polish overrides */
body.theme-classic {
    background: #eef2f7 !important;
}

body.theme-classic aside.sidebar-gradient,
.sidebar-gradient {
    background: linear-gradient(180deg, #11365f 0%, #16416f 48%, #10243d 100%) !important;
    box-shadow: 0 8px 28px rgba(15, 23, 42, .16);
}

.sidebar-gradient::after {
    animation: none;
    opacity: .16;
}

.app-content {
    background: #ffffff;
    border-color: rgba(148, 163, 184, .24);
    border-radius: 10px;
    box-shadow: 0 12px 34px rgba(15, 23, 42, .08);
}

.app-toolbar {
    background: #f8fafc;
    border-color: rgba(148, 163, 184, .28);
    border-radius: 8px;
    box-shadow: none;
}

.app-sidebar .btn {
    border-radius: 8px !important;
    background: transparent;
    gap: 10px;
}

.app-sidebar .nav-ico,
.sidebar-user-info,
.app-brand-badge {
    border-radius: 8px;
}

.card {
    box-shadow: 0 8px 22px rgba(15, 23, 42, .06);
}

.btn:hover {
    box-shadow: 0 6px 14px rgba(15, 23, 42, .08);
}

/* System Pro 4.0 - clean operational theme */
:root {
    --sp-bg: #eef2f7;
    --sp-surface: #ffffff;
    --sp-surface-soft: #f8fafc;
    --sp-border: #d7dee8;
    --sp-text: #111827;
    --sp-muted: #667085;
    --sp-blue: #0d6efd;
    --sp-green: #198754;
    --sp-yellow: #f0ad00;
    --sp-red: #dc3545;
    --sp-shadow: 0 6px 18px rgba(15, 23, 42, .06);
}

body.theme-classic {
    background: var(--sp-bg) !important;
    color: var(--sp-text);
}

body.theme-classic .card,
body.theme-classic .modal-content,
body.theme-classic .dropdown-menu {
    background: var(--sp-surface) !important;
    border: 1px solid var(--sp-border) !important;
    box-shadow: var(--sp-shadow) !important;
    backdrop-filter: none !important;
}

body.theme-classic .app-content {
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    box-shadow: var(--sp-shadow);
    backdrop-filter: none;
}

body.theme-classic .app-toolbar,
body.theme-classic .finance-filter-band,
body.theme-classic .module-toolbar,
body.theme-classic .filter-toolbar,
body.theme-classic form.row.g-2.align-items-end {
    background: var(--sp-surface-soft) !important;
    border-color: var(--sp-border) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}

.app-brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    background: #0d3f70;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    box-shadow: none;
}

.btn,
body.theme-classic .btn,
body.theme-dark .btn {
    border-radius: 7px !important;
    box-shadow: none !important;
    transform: none !important;
    transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}

.btn:hover,
.card:hover,
body.theme-classic .btn:hover,
body.theme-dark .btn:hover {
    transform: none !important;
}

.card:hover {
    box-shadow: var(--sp-shadow) !important;
}

.btn-primary,
.app-content .btn-primary,
.app-toolbar .btn-primary {
    background: var(--sp-blue) !important;
    border-color: var(--sp-blue) !important;
}

.btn-success,
.app-content .btn-success {
    background: var(--sp-green) !important;
    border-color: var(--sp-green) !important;
}

.btn-warning,
.app-content .btn-warning {
    background: var(--sp-yellow) !important;
    border-color: var(--sp-yellow) !important;
    color: #111827 !important;
}

.btn-danger,
.app-content .btn-danger {
    background: var(--sp-red) !important;
    border-color: var(--sp-red) !important;
}

.btn-outline-primary { color: var(--sp-blue) !important; border-color: rgba(13, 110, 253, .45) !important; background: transparent !important; }
.btn-outline-success { color: var(--sp-green) !important; border-color: rgba(25, 135, 84, .45) !important; background: transparent !important; }
.btn-outline-warning { color: #a66f00 !important; border-color: rgba(240, 173, 0, .55) !important; background: transparent !important; }
.btn-outline-danger { color: var(--sp-red) !important; border-color: rgba(220, 53, 69, .45) !important; background: transparent !important; }

.table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: #f8fafc;
    --bs-table-hover-bg: #eef4ff;
    font-size: .84rem;
}

.table > :not(caption) > * > * {
    padding: .42rem .55rem;
    border-bottom-color: rgba(148, 163, 184, .22);
}

.table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f1f5f9 !important;
    color: #334155;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.table-sm > :not(caption) > * > * {
    padding: .34rem .45rem;
}

.badge {
    letter-spacing: 0;
}

/* Dark mode refined */
body.theme-dark,
body.v3-dark {
    background: #0b1220 !important;
    color: #d6deea;
    --sp-bg: #0b1220;
    --sp-surface: #111827;
    --sp-surface-soft: #0f172a;
    --sp-border: rgba(148, 163, 184, .22);
    --sp-text: #e5edf7;
    --sp-muted: #9aa8ba;
    --sp-shadow: 0 10px 26px rgba(0, 0, 0, .22);
}

body.theme-dark .sidebar-gradient,
body.v3-dark .sidebar-gradient {
    background: #0f172a !important;
    border-right: 1px solid rgba(148, 163, 184, .18);
    box-shadow: none;
}

body.theme-dark .sidebar-gradient::before,
body.theme-dark .sidebar-gradient::after,
body.v3-dark .sidebar-gradient::before,
body.v3-dark .sidebar-gradient::after {
    display: none;
}

/* v4.0 - telas operacionais mais limpas */
.module-clean-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.module-clean-title {
    margin: 0;
    font-size: 1.18rem;
    font-weight: 800;
    color: #172033;
}
.module-clean-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.module-summary-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1px;
    overflow: hidden;
    margin-bottom: 14px;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 8px;
    background: rgba(148, 163, 184, .22);
    box-shadow: 0 4px 14px rgba(15, 23, 42, .04);
}
.module-summary-item {
    min-width: 0;
    padding: 10px 12px;
    background: #fff;
}
.module-summary-item small {
    display: block;
    color: #64748b;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
}
.module-summary-item strong {
    display: block;
    margin-top: 3px;
    color: #111827;
    font-size: 1.04rem;
    line-height: 1.2;
}
.module-filter-panel {
    margin-bottom: 14px;
    border: 1px solid rgba(148, 163, 184, .24);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .04);
}
.module-filter-panel > .card-body {
    padding: 12px;
}
.module-advanced-filters {
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid rgba(148, 163, 184, .18);
}
.module-insights {
    margin-bottom: 14px;
}
.module-insights .card {
    box-shadow: 0 4px 14px rgba(15, 23, 42, .04) !important;
}
.module-table-card {
    border: 1px solid rgba(148, 163, 184, .22) !important;
    border-radius: 8px !important;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .04) !important;
}
.module-table-card .card-body {
    padding: 12px;
}
.module-table-card .table {
    font-size: .84rem;
}
.module-table-card .table > :not(caption) > * > * {
    padding: .42rem .52rem;
}
.module-table-card .table thead th {
    background: #f8fafc;
    border-bottom-color: rgba(148, 163, 184, .22);
    color: #475569;
}
.module-row-actions {
    display: inline-flex;
    justify-content: flex-end;
    gap: 6px;
}
.module-row-actions .btn {
    min-width: 34px;
}
.action-view { --bs-btn-color: #0d6efd; --bs-btn-border-color: rgba(13,110,253,.35); --bs-btn-hover-bg: #0d6efd; --bs-btn-hover-border-color: #0d6efd; --bs-btn-hover-color: #fff; }
.action-done { --bs-btn-color: #198754; --bs-btn-border-color: rgba(25,135,84,.35); --bs-btn-hover-bg: #198754; --bs-btn-hover-border-color: #198754; --bs-btn-hover-color: #fff; }
.action-edit { --bs-btn-color: #b7791f; --bs-btn-border-color: rgba(245,158,11,.45); --bs-btn-hover-bg: #f59e0b; --bs-btn-hover-border-color: #f59e0b; --bs-btn-hover-color: #111827; }
.action-risk { --bs-btn-color: #dc3545; --bs-btn-border-color: rgba(220,53,69,.35); --bs-btn-hover-bg: #dc3545; --bs-btn-hover-border-color: #dc3545; --bs-btn-hover-color: #fff; }
.action-muted { --bs-btn-color: #64748b; --bs-btn-border-color: rgba(100,116,139,.32); --bs-btn-hover-bg: #64748b; --bs-btn-hover-border-color: #64748b; --bs-btn-hover-color: #fff; }
body.v3-dark .module-clean-title { color: #e5edf7; }
body.v3-dark .module-summary-strip,
body.v3-dark .module-filter-panel,
body.v3-dark .module-table-card {
    border-color: rgba(148, 163, 184, .18) !important;
    background: rgba(148, 163, 184, .18);
}
body.v3-dark .module-summary-item,
body.v3-dark .module-filter-panel {
    background: #111827;
}
body.v3-dark .module-summary-item small { color: #94a3b8; }
body.v3-dark .module-summary-item strong { color: #f8fafc; }
body.v3-dark .module-table-card .table thead th { background: #0f172a; color: #cbd5e1; }
@media (max-width: 767.98px) {
    .module-clean-header {
        align-items: stretch;
        flex-direction: column;
    }
    .module-clean-actions {
        display: grid;
        grid-template-columns: 1fr auto;
    }
    .module-clean-actions > .btn {
        width: 100%;
    }
    .module-summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .module-row-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }
}

/* Cascata final responsiva da ficha de OS */
@media (min-width: 1600px) {
    .app-content-v5 {
        max-width: 1760px;
        padding-inline: 32px !important;
    }
}

@media (min-width: 1200px) and (max-width: 1599.98px) {
    .app-content-v5 {
        padding: 18px 20px 30px !important;
    }

    .os-action-toolbar .card-body {
        flex-wrap: nowrap !important;
        overflow-x: auto;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .app-content-v5 {
        padding: 16px 14px 28px !important;
    }

    .os-record-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .os-record-summary > div:nth-child(3),
    .os-record-summary > div:nth-child(5) {
        border-right: 0;
    }

    .os-record-summary > div:nth-child(-n+3) {
        border-bottom: 1px solid var(--v5-border);
    }

    .os-action-toolbar .card-body {
        flex-wrap: nowrap !important;
        overflow-x: auto;
    }

    .os-sla-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .os-readiness-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .os-readiness-grid > span:nth-child(2n) {
        border-right: 0;
    }

    .os-readiness-grid > span:nth-last-child(-n+4) {
        border-bottom: 1px solid #edf0f4;
    }

    .os-readiness-grid > span:nth-last-child(-n+2) {
        border-bottom: 0;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .app-content-v5 {
        padding: 14px 12px 26px !important;
    }

    .os-record-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .os-record-summary > div:nth-child(3) {
        border-right: 0;
    }

    .os-record-summary > div:nth-child(-n+3) {
        border-bottom: 1px solid var(--v5-border);
    }

    .os-action-toolbar .card-body {
        flex-wrap: nowrap !important;
        overflow-x: auto;
    }

    .os-sla-grid,
    .os-readiness-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .os-readiness-grid > span:nth-child(2n) {
        border-right: 0;
    }

    .os-readiness-grid > span:nth-last-child(-n+4) {
        border-bottom: 1px solid #edf0f4;
    }

    .os-readiness-grid > span:nth-last-child(-n+2) {
        border-bottom: 0;
    }
}

@media (max-width: 767.98px) {
    .os-record-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .os-action-toolbar .card-body {
        flex-wrap: nowrap !important;
        overflow-x: auto;
    }

    .os-action-toolbar .btn,
    .os-action-toolbar form,
    .os-action-toolbar form .btn {
        width: auto !important;
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .os-sla-grid {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
        overflow-x: auto;
    }

    .os-readiness-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .os-form-savebar .btn {
        width: auto !important;
    }
}

@media (max-width: 419.98px) {
    .os-record-summary,
    .os-readiness-grid {
        grid-template-columns: 1fr !important;
    }

    .os-record-summary > div,
    .os-readiness-grid > span {
        border-right: 0 !important;
    }

    .os-form-savebar > div {
        display: none;
    }

    .os-form-savebar .btn {
        width: 100% !important;
    }
}

/* v4.0.6 - adaptacao por resolucao */
.os-sla-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.os-sla-item {
    min-width: 0;
}

.os-sla-item > div {
    border-color: var(--v5-border) !important;
    border-radius: 6px !important;
}

.os-items-table-wrap {
    max-width: 100%;
    overflow: auto;
}

.os-items-table-wrap #items-table {
    min-width: 720px;
}

#appEditModal.app-edit-modal-wide .modal-dialog {
    width: min(96vw, 1520px);
    max-width: min(96vw, 1520px);
    margin: 1.25rem auto;
}

#appEditModal.app-edit-modal-wide .modal-body {
    padding: 14px;
}

@media (min-width: 1600px) {
    .app-content-v5 {
        max-width: 1760px;
        padding-inline: 32px !important;
    }

    .os-record-summary {
        grid-template-columns: repeat(5, minmax(180px, 1fr));
    }

    .os-form-section-title {
        margin-top: 5px;
    }
}

@media (min-width: 1200px) and (max-width: 1599.98px) {
    .app-content-v5 {
        padding: 18px 20px 30px !important;
    }

    .os-action-toolbar .card-body {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .os-action-toolbar .btn,
    .os-action-toolbar form {
        flex: 0 0 auto;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .app-v5-brandbar {
        grid-template-columns: 170px minmax(260px, 1fr) auto;
        gap: 12px;
        padding-inline: 14px;
    }

    .app-v5-module-nav {
        padding-inline: 10px;
    }

    .app-v5-nav-item {
        padding-inline: 8px;
        font-size: .72rem;
    }

    .app-content-v5 {
        padding: 16px 14px 28px !important;
    }

    .os-record-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .os-record-summary > div:nth-child(3) {
        border-right: 0;
    }

    .os-record-summary > div:nth-child(-n+3) {
        border-bottom: 1px solid var(--v5-border);
    }

    .os-record-summary > div:nth-child(5) {
        border-right: 0;
    }

    .os-action-toolbar .card-body {
        flex-wrap: nowrap !important;
        overflow-x: auto;
    }

    .os-action-toolbar .btn,
    .os-action-toolbar form {
        flex: 0 0 auto;
    }

    .os-sla-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .os-readiness-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .os-readiness-grid > span:nth-child(2n) {
        border-right: 0;
    }

    .os-readiness-grid > span:nth-last-child(-n+4) {
        border-bottom: 1px solid #edf0f4;
    }

    .os-readiness-grid > span:nth-last-child(-n+2) {
        border-bottom: 0;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .app-content-v5 {
        padding: 14px 12px 26px !important;
    }

    .os-form-header {
        align-items: flex-start;
    }

    .os-record-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .os-record-summary > div:nth-child(3) {
        border-right: 0;
    }

    .os-record-summary > div:nth-child(-n+3) {
        border-bottom: 1px solid var(--v5-border);
    }

    .os-action-toolbar .card-body {
        flex-wrap: nowrap !important;
        overflow-x: auto;
    }

    .os-action-toolbar .btn,
    .os-action-toolbar form {
        flex: 0 0 auto;
    }

    .os-sla-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .os-readiness-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .os-readiness-grid > span:nth-child(2n) {
        border-right: 0;
    }

    .os-readiness-grid > span:nth-last-child(-n+4) {
        border-bottom: 1px solid #edf0f4;
    }

    .os-readiness-grid > span:nth-last-child(-n+2) {
        border-bottom: 0;
    }

    #os-dados > .card-body,
    #os-evidencias > .card-body,
    #os-historico > .card-body {
        padding: 12px;
    }

    #appEditModal.app-edit-modal-wide .modal-dialog {
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
        margin: 10px auto;
    }

    #appEditModal.app-edit-modal-wide .modal-content {
        max-height: calc(100vh - 20px);
    }
}

@media (max-width: 767.98px) {
    .os-form-header {
        align-items: stretch;
    }

    .os-form-header .module-clean-actions {
        display: flex;
        width: 100% !important;
        justify-content: space-between;
    }

    .os-form-subtitle {
        line-height: 1.35;
    }

    .os-section-nav {
        margin-bottom: 10px;
        padding-bottom: 2px;
    }

    .os-section-nav a {
        min-height: 36px;
        background: #fff;
        border-color: var(--v5-border);
    }

    .os-action-toolbar {
        overflow: hidden;
    }

    .os-action-toolbar .card-body {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: thin;
    }

    .os-action-toolbar .btn,
    .os-action-toolbar form,
    .os-action-toolbar form .btn {
        width: auto !important;
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .os-sla-grid {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
        overflow-x: auto;
        padding-bottom: 2px;
    }

    #os-dados > .card-body,
    #os-evidencias > .card-body,
    #os-historico > .card-body {
        padding: 10px;
    }

    #os-dados form.row.g-3 {
        --bs-gutter-x: .65rem;
        --bs-gutter-y: .75rem;
    }

    .os-form-section-title {
        margin-top: 4px;
        padding-top: 10px;
    }

    .os-items-table-wrap {
        margin-inline: -2px;
    }

    .os-close-readiness-head {
        align-items: flex-start;
    }

    .os-form-savebar {
        margin-inline: -2px;
        padding: 8px;
    }

    .os-form-savebar .btn {
        width: auto !important;
        flex: 0 0 auto;
        white-space: nowrap;
    }

    #signature-pad {
        display: block;
        max-width: 100%;
    }

    #appEditModal.app-edit-modal-wide .modal-dialog {
        width: 100%;
        max-width: 100%;
        min-height: 100%;
        margin: 0;
    }

    #appEditModal.app-edit-modal-wide .modal-content {
        min-height: 100vh;
        border: 0 !important;
        border-radius: 0 !important;
    }

    #appEditModal.app-edit-modal-wide .modal-header {
        position: sticky;
        top: 0;
        z-index: 4;
        padding: 10px 12px;
        background: var(--v5-surface);
    }

    #appEditModal.app-edit-modal-wide .modal-body {
        padding: 8px;
    }
}

@media (max-width: 419.98px) {
    .os-record-summary {
        grid-template-columns: 1fr !important;
    }

    .os-record-summary > div {
        border-right: 0;
        border-bottom: 1px solid var(--v5-border);
    }

    .os-record-summary > div:last-child {
        grid-column: auto;
    }

    .os-readiness-grid {
        grid-template-columns: 1fr;
    }

    .os-readiness-grid > span {
        border-right: 0;
        border-bottom: 1px solid #edf0f4 !important;
    }

    .os-readiness-grid > span:last-child {
        border-bottom: 0 !important;
    }

    .os-form-savebar > div {
        display: none;
    }

    .os-form-savebar .btn {
        width: 100% !important;
    }
}

@media (min-width: 768px) and (max-height: 720px) {
    .app-v5-header {
        position: relative;
    }

    .os-form-savebar {
        bottom: 4px;
    }

    #appEditModal.app-edit-modal-wide .modal-dialog {
        margin-block: 6px;
    }
}

/* v4.0.5 - ficha operacional da ordem de servico */
.os-form-header {
    align-items: flex-end;
}

.os-form-subtitle {
    max-width: 760px;
    margin: 4px 0 0;
    color: var(--v5-muted);
    font-size: .76rem;
}

.os-current-status {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding-inline: 10px;
    color: #344054 !important;
}

.os-record-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 14px;
    overflow: hidden;
    border: 1px solid var(--v5-border);
    border-radius: 6px;
    background: var(--v5-surface);
}

.os-record-summary > div {
    min-width: 0;
    padding: 10px 12px;
    border-right: 1px solid var(--v5-border);
}

.os-record-summary > div:last-child {
    border-right: 0;
}

.os-record-summary small,
.os-record-summary strong {
    display: block;
}

.os-record-summary small {
    margin-bottom: 3px;
    color: var(--v5-muted);
    font-size: .66rem;
    font-weight: 750;
    text-transform: uppercase;
}

.os-record-summary strong {
    overflow: hidden;
    color: var(--v5-text);
    font-size: .82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.os-section-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: -5px 0 14px;
    overflow-x: auto;
}

.os-section-nav a {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 5px 9px;
    border: 1px solid transparent;
    border-radius: 5px;
    color: #526071;
    font-size: .72rem;
    font-weight: 700;
    text-decoration: none;
}

.os-section-nav a:hover {
    color: var(--v5-blue);
    background: #edf3ff;
    border-color: #d6e2f8;
}

.os-anchor-offset {
    scroll-margin-top: 180px;
}

.os-action-toolbar .card-body {
    padding: 8px 10px;
}

.os-action-toolbar .btn {
    min-height: 32px;
}

.os-form-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
    padding-top: 12px;
    border-top: 1px solid var(--v5-border);
}

.os-form-section-title:first-of-type {
    padding-top: 0;
    border-top: 0;
}

.os-form-section-title > span {
    width: 30px;
    height: 30px;
    display: grid;
    flex: 0 0 30px;
    place-items: center;
    border-radius: 5px;
    color: var(--v5-blue);
    background: #edf3ff;
}

.os-form-section-title > div {
    min-width: 0;
}

.os-form-section-title strong,
.os-form-section-title small {
    display: block;
}

.os-form-section-title strong {
    color: var(--v5-text);
    font-size: .86rem;
}

.os-form-section-title small {
    margin-top: 2px;
    color: var(--v5-muted);
    font-size: .69rem;
}

.os-close-readiness {
    overflow: hidden;
    border: 1px solid #d7dfeb;
    border-left: 3px solid #f59e0b;
    border-radius: 6px;
    background: #fbfcfe;
}

.os-close-readiness.is-complete {
    border-left-color: var(--v5-green);
}

.os-close-readiness-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid #e8ecf2;
}

.os-close-readiness-head strong,
.os-close-readiness-head small {
    display: block;
}

.os-close-readiness-head strong {
    font-size: .84rem;
}

.os-close-readiness-head small {
    margin-top: 2px;
    color: var(--v5-muted);
    font-size: .68rem;
}

.os-readiness-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.os-readiness-grid > span {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 10px;
    border-right: 1px solid #edf0f4;
    border-bottom: 1px solid #edf0f4;
    color: #667085;
    font-size: .72rem;
}

.os-readiness-grid > span:nth-child(4n) {
    border-right: 0;
}

.os-readiness-grid > span:nth-last-child(-n+4) {
    border-bottom: 0;
}

.os-readiness-grid > span i {
    color: #a5adba;
}

.os-readiness-grid > span.is-ready {
    color: #166534;
    background: #f3fbf6;
}

.os-readiness-grid > span.is-ready i {
    color: var(--v5-green);
}

.os-form-savebar {
    position: sticky;
    bottom: 8px;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #ccd6e4;
    border-radius: 6px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
}

.os-form-savebar > div {
    min-width: 0;
}

.os-form-savebar strong,
.os-form-savebar small {
    display: block;
}

.os-form-savebar strong {
    font-size: .8rem;
}

.os-form-savebar small {
    color: var(--v5-muted);
    font-size: .68rem;
}

body.theme-dark .os-record-summary,
body.v3-dark .os-record-summary,
body.theme-dark .os-close-readiness,
body.v3-dark .os-close-readiness,
body.theme-dark .os-form-savebar,
body.v3-dark .os-form-savebar {
    background: #111827;
    border-color: var(--v5-border);
}

body.theme-dark .os-form-section-title > span,
body.v3-dark .os-form-section-title > span {
    background: #17243a;
}

body.theme-dark .os-readiness-grid > span,
body.v3-dark .os-readiness-grid > span,
body.theme-dark .os-close-readiness-head,
body.v3-dark .os-close-readiness-head {
    border-color: var(--v5-border);
}

body.theme-dark .os-readiness-grid > span.is-ready,
body.v3-dark .os-readiness-grid > span.is-ready {
    color: #86efac;
    background: rgba(22, 163, 74, .08);
}

@media (max-width: 767.98px) {
    .os-record-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .os-record-summary > div {
        border-bottom: 1px solid var(--v5-border);
    }

    .os-record-summary > div:nth-child(even) {
        border-right: 0;
    }

    .os-record-summary > div:last-child {
        grid-column: 1 / -1;
        border-bottom: 0;
    }

    .os-readiness-grid {
        grid-template-columns: 1fr 1fr;
    }

    .os-readiness-grid > span:nth-child(2n) {
        border-right: 0;
    }

    .os-readiness-grid > span:nth-last-child(-n+4) {
        border-bottom: 1px solid #edf0f4;
    }

    .os-readiness-grid > span:nth-last-child(-n+2) {
        border-bottom: 0;
    }

    .os-form-savebar {
        bottom: 4px;
    }

    .os-form-savebar small {
        display: none;
    }
}

body.theme-dark .app-content,
body.v3-dark .app-content,
body.theme-dark .card,
body.theme-dark .modal-content,
body.theme-dark .dropdown-menu,
body.v3-dark .card,
body.v3-dark .modal-content,
body.v3-dark .dropdown-menu {
    background: #111827 !important;
    border-color: rgba(148, 163, 184, .20) !important;
    color: #d6deea;
    box-shadow: var(--sp-shadow) !important;
    backdrop-filter: none;
}

body.theme-dark .app-toolbar,
body.v3-dark .app-toolbar,
body.theme-dark .finance-filter-band,
body.v3-dark .finance-filter-band,
body.theme-dark form.row.g-2.align-items-end,
body.v3-dark form.row.g-2.align-items-end {
    background: #0f172a !important;
    border-color: rgba(148, 163, 184, .20) !important;
    box-shadow: none;
}

/* v4.0 - acabamento geral nota 10 */
:root {
    --sp-primary: #2563eb;
    --sp-primary-hover: #1d4ed8;
    --sp-success: #16a34a;
    --sp-success-hover: #15803d;
    --sp-warning: #f59e0b;
    --sp-warning-hover: #d97706;
    --sp-danger: #dc2626;
    --sp-danger-hover: #b91c1c;
    --sp-muted-action: #64748b;
    --sp-radius: 8px;
    --sp-radius-sm: 6px;
    --sp-border-light: rgba(148, 163, 184, .24);
    --sp-shadow-soft: 0 3px 10px rgba(15, 23, 42, .05);
    --sp-shadow-button: 0 2px 6px rgba(15, 23, 42, .08);
}

body {
    color: #172033;
    background: #f5f7fb !important;
}

.app-main {
    padding: 16px;
}

.app-content {
    background: #fff !important;
    border: 1px solid var(--sp-border-light) !important;
    border-radius: var(--sp-radius) !important;
    padding: 18px !important;
    box-shadow: var(--sp-shadow-soft) !important;
    backdrop-filter: none !important;
}

.app-toolbar {
    background: #fff !important;
    border: 1px solid var(--sp-border-light) !important;
    border-radius: var(--sp-radius) !important;
    box-shadow: var(--sp-shadow-soft) !important;
}

.card,
.modal-content,
.dropdown-menu,
.list-group-item,
.alert,
.table-responsive {
    border-radius: var(--sp-radius) !important;
}

.card {
    border: 1px solid var(--sp-border-light) !important;
    box-shadow: var(--sp-shadow-soft) !important;
    transition: box-shadow .14s ease, border-color .14s ease !important;
}

.card:hover {
    transform: none !important;
    box-shadow: 0 5px 14px rgba(15, 23, 42, .07) !important;
}

.card-body {
    padding: 14px;
}

.btn {
    border-radius: var(--sp-radius-sm) !important;
    min-height: 34px;
    padding: .38rem .72rem;
    font-size: .84rem;
    font-weight: 700;
    letter-spacing: 0;
    box-shadow: none !important;
}

.btn-sm {
    min-height: 30px;
    padding: .25rem .55rem;
    font-size: .78rem;
}

.btn:hover {
    transform: none !important;
    box-shadow: var(--sp-shadow-button) !important;
}

.btn:focus-visible,
.form-control:focus,
.form-select:focus {
    border-color: rgba(37, 99, 235, .65) !important;
    box-shadow: 0 0 0 .18rem rgba(37, 99, 235, .14) !important;
}

.btn-primary,
.app-content .btn-primary,
.app-toolbar .btn-primary {
    background: var(--sp-primary) !important;
    border-color: var(--sp-primary) !important;
    color: #fff !important;
}

.btn-primary:hover,
.app-content .btn-primary:hover,
.app-toolbar .btn-primary:hover {
    background: var(--sp-primary-hover) !important;
    border-color: var(--sp-primary-hover) !important;
}

.btn-success {
    background: var(--sp-success) !important;
    border-color: var(--sp-success) !important;
    color: #fff !important;
}

.btn-success:hover {
    background: var(--sp-success-hover) !important;
    border-color: var(--sp-success-hover) !important;
}

.btn-warning {
    background: var(--sp-warning) !important;
    border-color: var(--sp-warning) !important;
    color: #111827 !important;
}

.btn-warning:hover {
    background: var(--sp-warning-hover) !important;
    border-color: var(--sp-warning-hover) !important;
}

.btn-danger {
    background: var(--sp-danger) !important;
    border-color: var(--sp-danger) !important;
    color: #fff !important;
}

.btn-danger:hover {
    background: var(--sp-danger-hover) !important;
    border-color: var(--sp-danger-hover) !important;
}

.btn-outline-primary,
.app-content .btn-outline-primary,
.app-toolbar .btn-outline-primary,
.action-view {
    color: var(--sp-primary) !important;
    border-color: rgba(37, 99, 235, .34) !important;
    background: #fff !important;
}

.btn-outline-primary:hover,
.app-content .btn-outline-primary:hover,
.app-toolbar .btn-outline-primary:hover,
.action-view:hover {
    color: #fff !important;
    background: var(--sp-primary) !important;
    border-color: var(--sp-primary) !important;
}

.btn-outline-success,
.action-done {
    color: var(--sp-success) !important;
    border-color: rgba(22, 163, 74, .36) !important;
    background: #fff !important;
}

.btn-outline-success:hover,
.action-done:hover {
    color: #fff !important;
    background: var(--sp-success) !important;
    border-color: var(--sp-success) !important;
}

.btn-outline-warning,
.action-edit {
    color: #a16207 !important;
    border-color: rgba(245, 158, 11, .45) !important;
    background: #fff !important;
}

.btn-outline-warning:hover,
.action-edit:hover {
    color: #111827 !important;
    background: var(--sp-warning) !important;
    border-color: var(--sp-warning) !important;
}

.btn-outline-danger,
.action-risk {
    color: var(--sp-danger) !important;
    border-color: rgba(220, 38, 38, .36) !important;
    background: #fff !important;
}

.btn-outline-danger:hover,
.action-risk:hover {
    color: #fff !important;
    background: var(--sp-danger) !important;
    border-color: var(--sp-danger) !important;
}

.btn-outline-secondary,
.btn-outline-dark,
.action-muted {
    color: var(--sp-muted-action) !important;
    border-color: rgba(100, 116, 139, .30) !important;
    background: #fff !important;
}

.btn-outline-secondary:hover,
.btn-outline-dark:hover,
.action-muted:hover {
    color: #fff !important;
    background: var(--sp-muted-action) !important;
    border-color: var(--sp-muted-action) !important;
}

.dropdown-menu {
    padding: 6px;
    border: 1px solid var(--sp-border-light) !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .12) !important;
}

.dropdown-item {
    border-radius: var(--sp-radius-sm);
    min-height: 34px;
    display: flex;
    align-items: center;
    font-size: .84rem;
    font-weight: 650;
}

.dropdown-item:hover {
    background: #f1f5f9;
}

.form-label {
    color: #64748b;
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.form-control,
.form-select,
.input-group-text {
    border-radius: var(--sp-radius-sm) !important;
    border-color: rgba(148, 163, 184, .34);
    min-height: 36px;
    font-size: .88rem;
}

.form-control-sm,
.form-select-sm {
    min-height: 32px;
    font-size: .82rem;
}

.table {
    color: #172033;
}

.table thead th {
    background: #f8fafc !important;
    color: #475569 !important;
    border-bottom: 1px solid rgba(148, 163, 184, .24) !important;
    font-size: .72rem !important;
    font-weight: 800 !important;
    letter-spacing: 0 !important;
}

.table > :not(caption) > * > * {
    border-color: rgba(148, 163, 184, .18);
}

.table tbody tr:hover {
    background: #f8fafc !important;
}

.badge {
    border-radius: 999px !important;
    font-size: .7rem;
    font-weight: 750;
    letter-spacing: 0;
    padding: .28em .55em;
}

.module-clean-header {
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(148, 163, 184, .18);
}

.module-clean-title {
    font-size: 1.12rem;
    letter-spacing: 0;
}

.module-summary-strip {
    border-radius: var(--sp-radius) !important;
    box-shadow: var(--sp-shadow-soft) !important;
}

.module-summary-item {
    padding: 9px 11px;
}

.module-summary-item strong {
    font-size: .98rem;
}

.module-filter-panel,
.module-table-card {
    border-radius: var(--sp-radius) !important;
    box-shadow: var(--sp-shadow-soft) !important;
}

.module-row-actions .btn,
.table td .btn.btn-sm {
    width: 32px;
    min-width: 32px;
    padding-left: 0;
    padding-right: 0;
}

body.theme-dark,
body.v3-dark {
    background: #0b1220 !important;
}

body.theme-dark .app-content,
body.v3-dark .app-content,
body.theme-dark .app-toolbar,
body.v3-dark .app-toolbar,
body.theme-dark .card,
body.v3-dark .card,
body.theme-dark .modal-content,
body.v3-dark .modal-content,
body.theme-dark .dropdown-menu,
body.v3-dark .dropdown-menu,
body.theme-dark .module-filter-panel,
body.v3-dark .module-filter-panel {
    background: #111827 !important;
    border-color: rgba(148, 163, 184, .20) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .18) !important;
}

body.theme-dark .btn-outline-primary,
body.v3-dark .btn-outline-primary,
body.theme-dark .btn-outline-success,
body.v3-dark .btn-outline-success,
body.theme-dark .btn-outline-warning,
body.v3-dark .btn-outline-warning,
body.theme-dark .btn-outline-danger,
body.v3-dark .btn-outline-danger,
body.theme-dark .btn-outline-secondary,
body.v3-dark .btn-outline-secondary,
body.theme-dark .btn-outline-dark,
body.v3-dark .btn-outline-dark {
    background: transparent !important;
}

body.theme-dark .form-control,
body.v3-dark .form-control,
body.theme-dark .form-select,
body.v3-dark .form-select,
body.theme-dark .input-group-text,
body.v3-dark .input-group-text {
    background: #0f172a !important;
    border-color: rgba(148, 163, 184, .24) !important;
    color: #e5edf7 !important;
}

body.theme-dark .table thead th,
body.v3-dark .table thead th {
    background: #0f172a !important;
    color: #cbd5e1 !important;
}

body.theme-dark .table tbody tr:hover,
body.v3-dark .table tbody tr:hover {
    background: rgba(148, 163, 184, .08) !important;
}

@media (max-width: 767.98px) {
    .app-content {
        padding: 12px !important;
    }
    .btn {
        min-height: 40px;
    }
    .btn-sm {
        min-height: 36px;
    }
    .module-row-actions .btn,
    .table td .btn.btn-sm {
        width: 100%;
    }
    .module-clean-actions {
        grid-template-columns: minmax(0, 1fr) auto;
    }
}

body.theme-dark .form-control,
body.theme-dark .form-select,
body.v3-dark .form-control,
body.v3-dark .form-select {
    background: #0b1220 !important;
    border-color: rgba(148, 163, 184, .28) !important;
    color: #e5edf7 !important;
}

body.theme-dark .form-control:focus,
body.theme-dark .form-select:focus,
body.v3-dark .form-control:focus,
body.v3-dark .form-select:focus {
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 .18rem rgba(96, 165, 250, .16) !important;
}

body.theme-dark .table,
body.v3-dark .table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(148, 163, 184, .06);
    --bs-table-hover-bg: rgba(96, 165, 250, .10);
    color: #d6deea;
}

body.theme-dark .table thead th,
body.v3-dark .table thead th {
    background: #182235 !important;
    color: #b8c4d4;
    border-bottom-color: rgba(148, 163, 184, .22);
}

body.theme-dark .table th,
body.theme-dark .table td,
body.v3-dark .table th,
body.v3-dark .table td {
    color: #d6deea;
    border-color: rgba(148, 163, 184, .16);
}

body.theme-dark .text-muted,
body.v3-dark .text-muted {
    color: var(--sp-muted) !important;
}

body.theme-dark .list-group-item,
body.v3-dark .list-group-item {
    background: #111827;
    color: #d6deea;
    border-color: rgba(148, 163, 184, .16);
}

body.theme-dark .dropdown-item,
body.v3-dark .dropdown-item {
    color: #d6deea;
}

body.theme-dark .dropdown-item:hover,
body.v3-dark .dropdown-item:hover {
    background: rgba(96, 165, 250, .12);
}

/* System Pro 4.0 - layout operacional */
:root {
    --v5-bg: #f4f6f9;
    --v5-surface: #ffffff;
    --v5-border: #dfe4eb;
    --v5-text: #182230;
    --v5-muted: #657184;
    --v5-blue: #2563eb;
    --v5-green: #16834a;
    --v5-yellow: #b77905;
    --v5-red: #c83b3b;
}

body {
    background: var(--v5-bg) !important;
    color: var(--v5-text);
}

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

.app-v5-header {
    position: sticky;
    top: 0;
    z-index: 1025;
    background: var(--v5-surface);
    border-bottom: 1px solid var(--v5-border);
}

.app-v5-brandbar {
    position: relative;
    min-height: 58px;
    display: grid;
    grid-template-columns: minmax(180px, 230px) minmax(260px, 620px) minmax(220px, 1fr);
    align-items: center;
    gap: 20px;
    padding: 8px 22px;
    border-bottom: 1px solid #edf0f4;
}

.app-v5-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--v5-text);
    text-decoration: none;
    width: max-content;
}

.app-v5-brand-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: #1d4ed8;
    color: #fff;
    font-size: 1rem;
    font-weight: 900;
}

.app-v5-brand > span:last-child {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.app-v5-brand strong {
    font-size: .93rem;
    letter-spacing: 0;
}

.app-v5-brand small {
    margin-top: 4px;
    color: var(--v5-muted);
    font-size: .67rem;
}

.app-demo-badge {
    position: absolute;
    left: 174px;
    top: 9px;
    padding: 2px 5px;
    border-radius: 4px;
    background: #fff3cd;
    color: #8a5a00;
    font-size: .58rem;
    font-weight: 900;
}

.app-v5-search {
    height: 38px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 11px;
    background: #f7f8fa;
    border: 1px solid var(--v5-border);
    border-radius: 6px;
}

.app-v5-search:focus-within {
    background: #fff;
    border-color: #8eb2f7;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .08);
}

.app-v5-search input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--v5-text);
    font-size: .84rem;
}

.app-v5-search kbd {
    padding: 2px 5px;
    background: #fff;
    border: 1px solid #d9dee6;
    border-bottom-width: 2px;
    border-radius: 4px;
    color: #7b8492;
    font: 600 .65rem/1.3 system-ui;
}

.app-v5-user-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 7px;
}

.app-v5-icon-btn {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #526071;
}

.app-v5-icon-btn:hover {
    background: #f1f4f8;
    border-color: var(--v5-border);
}

.app-v5-user {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 8px 3px 4px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--v5-text);
    text-align: left;
}

.app-v5-user:hover {
    background: #f1f4f8;
}

.app-v5-avatar {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #e7eefc;
    color: #1d4ed8;
    font-weight: 800;
}

.app-v5-user-copy {
    display: flex;
    flex-direction: column;
    min-width: 92px;
    line-height: 1.15;
}

.app-v5-user-copy strong {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .78rem;
}

.app-v5-user-copy small {
    margin-top: 3px;
    color: var(--v5-muted);
    font-size: .65rem;
}

.app-v5-module-nav {
    min-height: 39px;
    display: flex;
    align-items: stretch;
    gap: 1px;
    padding: 0 18px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.app-v5-nav-item,
.app-v5-nav-home {
    min-height: 39px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 0 11px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #3e4a59;
    text-decoration: none;
    font-size: .76rem;
    font-weight: 700;
    white-space: nowrap;
}

.app-v5-nav-home {
    width: 38px;
    padding: 0;
    font-size: .94rem;
}

.app-v5-nav-item:hover,
.app-v5-nav-home:hover,
.app-v5-nav-home.active,
.app-v5-nav-item.active,
.app-v5-module-nav .dropdown.show .app-v5-nav-item {
    color: var(--v5-blue);
    border-bottom-color: var(--v5-blue);
    background: #f7f9fc;
}

.app-v5-menu-grid {
    width: 260px;
    grid-template-columns: 1fr;
    padding: 8px;
    z-index: 1100;
}

.app-v5-menu-grid.show {
    display: grid;
}

.app-v5-menu-grid .dropdown-item {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 8px;
    min-height: 38px;
    padding: 7px 9px;
    border-radius: 5px;
    font-size: .8rem;
}

.app-v5-menu-grid .dropdown-item i {
    color: #617086;
    font-size: .95rem;
}

.app-v5-quickbar {
    min-height: 66px;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 7px 22px;
    overflow-x: auto;
    border-top: 1px solid #f0f2f5;
    background: #fbfcfd;
}

.app-v5-quick-label {
    margin-right: 10px;
    color: #8a94a2;
    font-size: .65rem;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-v5-quick-action {
    width: 68px;
    min-width: 68px;
    height: 51px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #435064;
    text-decoration: none;
}

.app-v5-quick-action:hover {
    color: var(--v5-blue);
    background: #fff;
    border-color: #d9e2f1;
}

.app-v5-quick-action i {
    font-size: 1.05rem;
}

.app-v5-quick-action span {
    font-size: .65rem;
    font-weight: 700;
    white-space: nowrap;
}

.app-v5-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.app-content-v5 {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 22px 26px 34px !important;
    flex: 1;
}

.app-v5-footer {
    padding: 13px 24px;
    border-top: 1px solid var(--v5-border);
    color: #87909e;
    font-size: .68rem;
    text-align: center;
}

.dashboard-v5-head,
.module-clean-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding: 0 0 13px;
    border-bottom: 1px solid var(--v5-border);
}

.dashboard-v5-head h1 {
    margin: 2px 0 3px;
    font-size: 1.35rem;
    font-weight: 750;
}

.dashboard-v5-head p,
.dashboard-v5-panel-head p {
    margin: 0;
    color: var(--v5-muted);
    font-size: .76rem;
}

.dashboard-v5-eyebrow {
    color: var(--v5-blue);
    font-size: .66rem;
    font-weight: 800;
    text-transform: uppercase;
}

.dashboard-v5-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 18px;
    background: var(--v5-surface);
    border: 1px solid var(--v5-border);
    border-radius: 6px;
}

.dashboard-v5-stat {
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border-right: 1px solid var(--v5-border);
    color: var(--v5-text);
    text-decoration: none;
}

.dashboard-v5-stat:last-child {
    border-right: 0;
}

.dashboard-v5-stat:hover {
    background: #fafbfd;
}

.stat-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    font-size: 1rem;
}

.stat-blue { color: #1d4ed8; background: #eaf1ff; }
.stat-yellow { color: #9a6700; background: #fff4d6; }
.stat-green { color: #087443; background: #e2f6ea; }
.stat-red { color: #b4232e; background: #fdebec; }

.dashboard-v5-stat > span:last-child {
    display: flex;
    flex-direction: column;
}

.dashboard-v5-stat small {
    color: var(--v5-muted);
    font-size: .7rem;
}

.dashboard-v5-stat strong {
    margin-top: 2px;
    font-size: 1.25rem;
    line-height: 1;
}

.dashboard-v5-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr);
    gap: 18px;
    margin-bottom: 18px;
}

.dashboard-v5-grid-secondary {
    grid-template-columns: 1fr 1fr;
}

.dashboard-v5-side {
    display: grid;
    gap: 18px;
}

.dashboard-v5-panel {
    min-width: 0;
    background: var(--v5-surface);
    border: 1px solid var(--v5-border);
    border-radius: 6px;
}

.dashboard-v5-panel-head {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid #e8ebef;
}

.dashboard-v5-panel-head h2 {
    margin: 0 0 2px;
    font-size: .9rem;
    font-weight: 750;
}

.dashboard-v5-panel-head > a {
    color: var(--v5-blue);
    font-size: .72rem;
    font-weight: 700;
    text-decoration: none;
}

.dashboard-v5-list-item {
    min-height: 57px;
    display: grid;
    grid-template-columns: 9px minmax(0, 1fr) 14px;
    align-items: center;
    gap: 10px;
    padding: 9px 15px;
    border-bottom: 1px solid #edf0f3;
    color: var(--v5-text);
    text-decoration: none;
}

.dashboard-v5-list-item:last-child {
    border-bottom: 0;
}

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

.priority-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--v5-blue);
}

.priority-danger { background: var(--v5-red); }
.priority-success { background: var(--v5-green); }
.priority-warning { background: var(--v5-yellow); }

.dashboard-v5-list-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.dashboard-v5-list-copy strong {
    overflow: hidden;
    color: #273345;
    font-size: .78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-v5-list-copy small {
    margin-top: 3px;
    color: var(--v5-muted);
    font-size: .67rem;
}

.dashboard-v5-list-item > i {
    color: #9aa3af;
    font-size: .65rem;
}

.dashboard-v5-today {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.dashboard-v5-today > div {
    min-height: 68px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10px 15px;
    border-right: 1px solid #edf0f3;
    border-bottom: 1px solid #edf0f3;
}

.dashboard-v5-today > div:nth-child(even) { border-right: 0; }
.dashboard-v5-today > div:nth-last-child(-n+2) { border-bottom: 0; }
.dashboard-v5-today strong { font-size: 1.05rem; }
.dashboard-v5-today span { color: var(--v5-muted); font-size: .68rem; }

.dashboard-v5-mini-list > a,
.dashboard-v5-stock > a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 8px 14px;
    border-bottom: 1px solid #edf0f3;
    color: var(--v5-text);
    text-decoration: none;
}

.dashboard-v5-mini-list > a:last-child,
.dashboard-v5-stock > a:last-child {
    border-bottom: 0;
}

.agenda-date {
    width: 34px;
    height: 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    background: #edf3ff;
    color: #1d4ed8;
    font-size: .56rem;
    text-transform: uppercase;
}

.agenda-date strong { font-size: .85rem; line-height: 1; }
.dashboard-v5-mini-list > a > span:last-child,
.dashboard-v5-stock > a > span { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.dashboard-v5-mini-list strong,
.dashboard-v5-stock strong { overflow: hidden; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-v5-mini-list small,
.dashboard-v5-stock small { margin-top: 2px; color: var(--v5-muted); font-size: .65rem; }
.dashboard-v5-stock b { color: var(--v5-red); font-size: .85rem; }

.dashboard-v5-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: #edf0f3;
}

.dashboard-v5-actions a {
    min-height: 74px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #fff;
    color: #425066;
    text-decoration: none;
    font-size: .68rem;
    font-weight: 700;
}

.dashboard-v5-actions a:hover {
    color: var(--v5-blue);
    background: #f8faff;
}

.dashboard-v5-actions i { font-size: 1.05rem; }

.dashboard-v5-empty {
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #758194;
    font-size: .75rem;
}

.dashboard-v5-empty i { color: var(--v5-green); font-size: 1.5rem; }
.dashboard-v5-empty.compact { min-height: 70px; }

.dashboard-v5-admin-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr) auto;
    align-items: center;
    gap: 0;
    border: 1px solid #d4deef;
    border-left: 3px solid var(--v5-blue);
    border-radius: 6px;
    background: #f8faff;
}

.dashboard-v5-admin-summary > div {
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    border-right: 1px solid #dfe6f2;
}

.dashboard-v5-admin-summary span { color: var(--v5-muted); font-size: .67rem; }
.dashboard-v5-admin-summary strong { margin-top: 3px; font-size: .9rem; }
.dashboard-v5-admin-summary > a { padding: 14px 18px; color: var(--v5-blue); font-size: .72rem; font-weight: 750; text-decoration: none; white-space: nowrap; }

/* Módulos mais compactos */
.module-clean-title {
    margin: 0;
    font-size: 1.18rem !important;
}

.module-summary-strip {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    margin-bottom: 14px !important;
    border: 1px solid var(--v5-border) !important;
    border-radius: 6px !important;
    background: #fff !important;
    box-shadow: none !important;
}

.module-summary-item {
    min-width: 0 !important;
    border-right: 1px solid var(--v5-border);
    background: transparent !important;
}

.module-summary-item:last-child { border-right: 0; }
.module-filter-panel,
.module-table-card,
.card {
    border-color: var(--v5-border) !important;
    border-radius: 6px !important;
    box-shadow: none !important;
}

.module-filter-panel .card-body { padding: 12px 14px; }
.module-table-card .card-body { padding: 12px; }
.table { font-size: .79rem; }
.table > :not(caption) > * > * { padding: .48rem .55rem; }
.table thead th { white-space: nowrap; }
.os-row-menu {
    width: 270px;
}
.os-row-menu .dropdown-item {
    grid-template-columns: 22px 1fr;
}
.os-row-menu form .btn {
    width: 100% !important;
}
.module-advanced-filters {
    padding-top: 10px;
}
.settings-nav-compact {
    width: min(100%, 420px);
    margin-bottom: 4px;
}
.settings-nav-compact .form-select {
    background-color: #f8fafc;
    font-weight: 700;
}
.fin-summary-grid .card-body {
    padding: 10px 12px;
}
.fin-summary-grid h5,
.fin-summary-grid h6 {
    margin: 3px 0 0;
    font-size: .95rem;
}
.btn { border-radius: 5px !important; font-weight: 700; }
.btn-success { background: var(--v5-green) !important; border-color: var(--v5-green) !important; }
.btn-primary { background: var(--v5-blue) !important; border-color: var(--v5-blue) !important; }
.btn-warning { background: #d99a16 !important; border-color: #d99a16 !important; }
.btn-danger { background: var(--v5-red) !important; border-color: var(--v5-red) !important; }

body.theme-dark,
body.v3-dark {
    --v5-bg: #0f141c;
    --v5-surface: #171d27;
    --v5-border: #2b3442;
    --v5-text: #e5eaf1;
    --v5-muted: #99a5b5;
}

body.theme-dark .app-v5-header,
body.v3-dark .app-v5-header,
body.theme-dark .app-v5-brandbar,
body.v3-dark .app-v5-brandbar,
body.theme-dark .app-v5-quickbar,
body.v3-dark .app-v5-quickbar,
body.theme-dark .dashboard-v5-panel,
body.v3-dark .dashboard-v5-panel,
body.theme-dark .dashboard-v5-stats,
body.v3-dark .dashboard-v5-stats,
body.theme-dark .dashboard-v5-actions a,
body.v3-dark .dashboard-v5-actions a,
body.theme-dark .module-summary-strip,
body.v3-dark .module-summary-strip {
    background: var(--v5-surface) !important;
    border-color: var(--v5-border) !important;
}

body.theme-dark .app-v5-search,
body.v3-dark .app-v5-search {
    background: #10161f;
    border-color: var(--v5-border);
}

body.theme-dark .app-v5-search input,
body.v3-dark .app-v5-search input,
body.theme-dark .app-v5-user,
body.v3-dark .app-v5-user,
body.theme-dark .app-v5-brand,
body.v3-dark .app-v5-brand,
body.theme-dark .dashboard-v5-stat,
body.v3-dark .dashboard-v5-stat,
body.theme-dark .dashboard-v5-list-item,
body.v3-dark .dashboard-v5-list-item,
body.theme-dark .dashboard-v5-mini-list > a,
body.v3-dark .dashboard-v5-mini-list > a,
body.theme-dark .dashboard-v5-stock > a,
body.v3-dark .dashboard-v5-stock > a {
    color: var(--v5-text);
}

body.theme-dark .dashboard-v5-list-copy strong,
body.v3-dark .dashboard-v5-list-copy strong {
    color: var(--v5-text);
}

@media (max-width: 991.98px) {
    .app-v5-brandbar {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 10px;
        padding: 8px 12px;
    }
    .app-v5-brand > span:last-child,
    .app-v5-user-copy,
    .app-v5-search kbd {
        display: none;
    }
    .app-v5-module-nav { padding: 0 8px; }
    .app-v5-quickbar { padding: 6px 12px; }
    .dashboard-v5-grid { grid-template-columns: 1fr; }
    .dashboard-v5-grid-secondary { grid-template-columns: 1fr; }
}

@media (max-width: 767.98px) {
    .app-v5-brandbar {
        grid-template-columns: 36px minmax(0, 1fr) auto;
    }
    .app-v5-user-actions { gap: 2px; }
    .app-v5-user { padding: 2px; }
    .app-v5-avatar { width: 34px; height: 34px; }
    .app-v5-icon-btn { width: 34px; }
    .app-v5-module-nav { min-height: 42px; }
    .app-v5-nav-item,
    .app-v5-nav-home { min-height: 42px; padding: 0 9px; font-size: .71rem; }
    .app-v5-quick-label { display: none; }
    .app-v5-quick-action { min-width: 61px; width: 61px; }
    .app-content-v5 { padding: 14px 10px 28px !important; }
    .dashboard-v5-head { align-items: flex-start; }
    .dashboard-v5-head h1 { font-size: 1.15rem; }
    .dashboard-v5-stats { grid-template-columns: 1fr 1fr; }
    .dashboard-v5-stat { min-height: 68px; padding: 10px; border-bottom: 1px solid var(--v5-border); }
    .dashboard-v5-stat:nth-child(even) { border-right: 0; }
    .dashboard-v5-stat:nth-last-child(-n+2) { border-bottom: 0; }
    .stat-icon { width: 32px; height: 32px; }
    .dashboard-v5-stat strong { font-size: 1.05rem; }
    .dashboard-v5-actions { grid-template-columns: repeat(2, 1fr); }
    .dashboard-v5-admin-summary { grid-template-columns: 1fr; }
    .dashboard-v5-admin-summary > div { border-right: 0; border-bottom: 1px solid var(--v5-border); }
    .module-summary-strip { grid-template-columns: 1fr 1fr; }
    .module-summary-item:nth-child(even) { border-right: 0; }
    .module-clean-header { align-items: flex-start; }
    .module-clean-actions { width: auto !important; }
}

/* v4.0.4 - navegacao mais leve e maior area util */
.app-v5-modules-toggle {
    display: none;
}

.app-content.app-content-v5 {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.app-v5-quickbar {
    min-height: 54px;
    gap: 6px;
    padding-block: 6px;
}

.app-v5-quick-label {
    margin-right: 4px;
}

.app-v5-quick-action {
    width: auto;
    min-width: 74px;
    height: 40px;
    flex-direction: row;
    gap: 6px;
    padding: 0 10px;
    background: #fff;
    border-color: #e4e8ee;
}

.app-v5-quick-action i {
    color: var(--v5-blue);
    font-size: .92rem;
}

.app-v5-quick-action span {
    font-size: .68rem;
}

.app-v5-quick-config {
    width: 36px;
    min-width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    margin-left: 2px;
    border: 1px solid transparent;
    border-radius: 5px;
    color: #718096;
    text-decoration: none;
}

.app-v5-quick-config:hover {
    color: var(--v5-blue);
    background: #fff;
    border-color: #d9e2f1;
}

.module-clean-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
}

.module-clean-actions .dropdown-toggle::after {
    margin-left: .45rem;
}

.module-table-card {
    overflow: visible;
}

.module-table-card > .table-responsive,
.module-table-card .card-body > .table-responsive {
    overflow: auto;
    border-radius: 0 !important;
}

.card-header {
    min-height: 46px;
    padding: 10px 14px;
    background: #f8fafc;
    border-bottom-color: var(--v5-border);
    font-size: .86rem;
    font-weight: 750;
}

.pagination {
    gap: 3px;
}

.page-link {
    min-width: 32px;
    min-height: 32px;
    display: grid;
    place-items: center;
    padding: .25rem .5rem;
    border-radius: 5px !important;
    color: #526071;
    font-size: .78rem;
}

body.theme-dark .app-v5-quick-action,
body.v3-dark .app-v5-quick-action {
    background: #111827;
    border-color: var(--v5-border);
    color: var(--v5-text);
}

.app-workspace-cover {
    position: relative;
    height: clamp(110px, 13vw, 190px);
    overflow: hidden;
    background: #e9eef5;
    border-bottom: 1px solid var(--app-border, #d9e0e8);
}

.app-workspace-cover img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

.app-workspace-cover-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(15, 23, 42, .58), rgba(15, 23, 42, .08) 58%, transparent);
}

.app-workspace-cover-copy {
    position: absolute;
    left: clamp(18px, 4vw, 64px);
    bottom: 18px;
    display: flex;
    flex-direction: column;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
}

.app-workspace-cover-copy strong {
    font-size: clamp(18px, 2vw, 28px);
    line-height: 1.1;
}

.app-workspace-cover-copy span {
    margin-top: 4px;
    font-size: 13px;
}

.app-v5-admin-panel-action {
    width: 154px;
    min-width: 154px;
    flex: 0 0 154px;
    box-sizing: border-box;
    border-color: #b8c7dc;
    background: #eef4fb;
    color: #234b78;
}

.app-v5-admin-panel-action span {
    display: block;
    min-width: 0;
    line-height: 1;
    white-space: nowrap;
}

.app-v5-admin-panel-action i {
    flex: 0 0 auto;
}

.app-v5-admin-panel-action:hover {
    border-color: #86a9d0;
    background: #e3edf8;
    color: #173d69;
}

.app-admin-workspace .app-v5-shell {
    height: 100vh;
    min-height: 620px;
    overflow: hidden;
}

.app-admin-workspace .app-v5-header {
    flex: 0 0 auto;
}

.app-admin-workspace .app-workspace-cover {
    flex: 1 1 auto;
    width: 100%;
    height: auto;
    min-height: 340px;
    border-bottom: 0;
}

.app-admin-workspace .app-workspace-cover-copy {
    bottom: clamp(24px, 5vh, 64px);
}

.app-admin-workspace .app-workspace-cover-copy strong {
    font-size: clamp(24px, 3vw, 44px);
}

.app-admin-workspace .app-v5-main {
    display: none;
}

.app-settings-cover-preview {
    width: 100%;
    max-width: 480px;
    aspect-ratio: 16 / 5;
    overflow: hidden;
    border: 1px solid var(--app-border, #d9e0e8);
    border-radius: 6px;
    background: #eef2f6;
}

.app-settings-cover-preview img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.app-module-modal {
    --bs-modal-zindex: 1100;
}

.app-module-modal .modal-dialog {
    width: calc(100vw - 32px);
    max-width: none;
    height: calc(100vh - 32px);
    margin: 16px auto;
}

.app-module-modal .modal-content {
    height: 100%;
    overflow: hidden;
    border-radius: 7px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .24);
}

.app-module-modal .modal-header {
    min-height: 54px;
    padding: 8px 14px;
}

.app-module-modal-title,
.app-module-modal-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.app-module-modal-title h5 {
    margin: 0;
    font-size: 16px;
}

.app-module-modal-actions {
    margin-left: auto;
}

.app-module-modal .modal-body {
    position: relative;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    background: #f4f6f9;
}

.app-module-modal iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
    opacity: 0;
    background: #f4f6f9;
    transition: opacity .12s ease;
}

.app-module-modal iframe.is-ready {
    opacity: 1;
}

.app-module-loading {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: #64748b;
    background: #f4f6f9;
}

.app-module-loading.is-hidden {
    display: none;
}

body.theme-dark .app-module-modal .modal-body,
body.theme-dark .app-module-modal iframe,
body.theme-dark .app-module-loading,
body.v3-dark .app-module-modal .modal-body,
body.v3-dark .app-module-modal iframe,
body.v3-dark .app-module-loading {
    background: #111827;
}

body:has(.app-module-modal.show) .app-workspace-cover {
    filter: none;
}

.app-popup-page {
    min-height: 100vh;
    background: var(--app-bg, #f4f6f9);
}

.app-popup-content {
    min-height: 100vh;
    padding: 14px;
}

.app-popup-content > .module-clean-header:first-child,
.app-popup-content > .dashboard-v5:first-child {
    margin-top: 0;
}

@media (max-width: 767.98px) {
    .app-workspace-cover {
        height: 105px;
    }

    .app-workspace-cover-copy {
        left: 14px;
        bottom: 12px;
    }

    .app-admin-workspace .app-v5-shell {
        min-height: 100vh;
    }

    .app-admin-workspace .app-workspace-cover {
        min-height: 260px;
    }

    .app-v5-admin-panel-action {
        min-width: 61px;
        width: 61px;
        flex-basis: 61px;
    }

    .app-module-modal .modal-dialog {
        width: 100vw;
        height: 100vh;
        margin: 0;
    }

    .app-module-modal .modal-content {
        border: 0;
        border-radius: 0;
    }

    .app-module-modal-actions span {
        display: none;
    }
}

body.theme-dark .card-header,
body.v3-dark .card-header {
    background: #121a26;
    border-color: var(--v5-border);
    color: var(--v5-text);
}

@media (max-width: 767.98px) {
    body.v5-modules-open {
        overflow: hidden;
    }

    .app-v5-header {
        position: sticky;
    }

    .app-v5-brandbar {
        grid-template-columns: 36px minmax(0, 1fr) auto;
        min-height: 54px;
        padding: 7px 10px;
    }

    .app-v5-modules-toggle {
        display: grid;
        width: 36px;
        height: 36px;
        color: #415066;
        background: #f3f6fa;
        border-color: var(--v5-border);
    }

    .app-v5-modules-toggle.is-active {
        color: #fff;
        background: var(--v5-blue);
        border-color: var(--v5-blue);
    }

    .app-v5-brand {
        display: none;
    }

    .app-v5-search {
        height: 36px;
    }

    .app-v5-module-nav {
        position: absolute;
        top: 54px;
        left: 8px;
        right: 8px;
        display: none;
        max-height: calc(100vh - 72px);
        padding: 8px;
        overflow: auto;
        flex-wrap: wrap;
        align-content: flex-start;
        gap: 4px;
        background: var(--v5-surface);
        border: 1px solid var(--v5-border);
        border-radius: 6px;
        box-shadow: 0 16px 32px rgba(15, 23, 42, .18);
    }

    .app-v5-module-nav.is-open {
        display: flex;
    }

    .app-v5-module-nav > .dropdown {
        flex: 1 1 calc(50% - 4px);
    }

    .app-v5-nav-item,
    .app-v5-nav-home {
        width: 100%;
        min-height: 40px;
        justify-content: flex-start;
        padding: 0 10px;
        border: 1px solid #e5e9ef;
        border-radius: 5px;
        background: #f8fafc;
        font-size: .73rem;
    }

    .app-v5-nav-home {
        flex: 1 1 100%;
    }

    .app-v5-nav-item:hover,
    .app-v5-nav-home:hover,
    .app-v5-nav-home.active,
    .app-v5-nav-item.active,
    .app-v5-module-nav .dropdown.show .app-v5-nav-item {
        border-color: #bfd1f5;
        background: #edf3ff;
    }

    .app-v5-quickbar {
        min-height: 50px;
        padding: 5px 8px;
    }

    .app-v5-quick-action {
        min-width: 44px;
        width: 44px;
        height: 38px;
        padding: 0;
    }

    .app-v5-quick-action span {
        display: none;
    }

    .app-v5-quick-action i {
        font-size: 1rem;
    }

    .app-v5-quick-config {
        min-width: 38px;
    }

    .app-content-v5 {
        padding: 12px 8px 26px !important;
    }

    .module-clean-header {
        gap: 10px;
    }

    .module-clean-title {
        font-size: 1.05rem !important;
    }

    .module-summary-strip {
        overflow-x: auto;
        grid-template-columns: repeat(2, minmax(135px, 1fr)) !important;
    }

    body.theme-dark .app-v5-modules-toggle,
    body.v3-dark .app-v5-modules-toggle,
    body.theme-dark .app-v5-nav-item,
    body.v3-dark .app-v5-nav-item,
    body.theme-dark .app-v5-nav-home,
    body.v3-dark .app-v5-nav-home {
        background: #111827;
        border-color: var(--v5-border);
        color: var(--v5-text);
    }
}

/* Resolucao final: manter estes overrides no fim do arquivo */
@media (min-width: 1600px) {
    .app-content-v5 { max-width: 1760px; padding-inline: 32px !important; }
}

@media (min-width: 1200px) and (max-width: 1599.98px) {
    .app-content-v5 { padding: 18px 20px 30px !important; }
    .os-action-toolbar .card-body { flex-wrap: nowrap !important; overflow-x: auto; }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .app-content-v5 { padding: 16px 14px 28px !important; }
    .os-record-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .os-record-summary > div:nth-child(3),
    .os-record-summary > div:nth-child(5) { border-right: 0; }
    .os-record-summary > div:nth-child(-n+3) { border-bottom: 1px solid var(--v5-border); }
    .os-action-toolbar .card-body { flex-wrap: nowrap !important; overflow-x: auto; }
    .os-sla-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .os-readiness-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .os-readiness-grid > span:nth-child(2n) { border-right: 0; }
    .os-readiness-grid > span:nth-last-child(-n+4) { border-bottom: 1px solid #edf0f4; }
    .os-readiness-grid > span:nth-last-child(-n+2) { border-bottom: 0; }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .app-content-v5 { padding: 14px 12px 26px !important; }
    .os-record-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .os-record-summary > div:nth-child(3) { border-right: 0; }
    .os-record-summary > div:nth-child(-n+3) { border-bottom: 1px solid var(--v5-border); }
    .os-action-toolbar .card-body { flex-wrap: nowrap !important; overflow-x: auto; }
    .os-sla-grid,
    .os-readiness-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .os-readiness-grid > span:nth-child(2n) { border-right: 0; }
    .os-readiness-grid > span:nth-last-child(-n+4) { border-bottom: 1px solid #edf0f4; }
    .os-readiness-grid > span:nth-last-child(-n+2) { border-bottom: 0; }
}

@media (max-width: 767.98px) {
    .os-record-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .os-action-toolbar .card-body { flex-wrap: nowrap !important; overflow-x: auto; }
    .os-action-toolbar .btn,
    .os-action-toolbar form,
    .os-action-toolbar form .btn { width: auto !important; flex: 0 0 auto; white-space: nowrap; }
    .os-sla-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); overflow-x: auto; }
    .os-readiness-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .os-form-savebar .btn { width: auto !important; }
}

@media (max-width: 419.98px) {
    .os-record-summary,
    .os-readiness-grid { grid-template-columns: 1fr !important; }
    .os-record-summary > div,
    .os-readiness-grid > span { border-right: 0 !important; }
    .os-form-savebar > div { display: none; }
    .os-form-savebar .btn { width: 100% !important; }
}

/* Sistema responsivo: camada final compartilhada por todos os modulos */
.app-content-v5 img,
.app-content-v5 video,
.app-content-v5 iframe {
    max-width: 100%;
}

.app-content-v5 canvas:not(#signature-pad) {
    max-width: 100% !important;
}

.app-content-v5 .input-group {
    flex-wrap: nowrap;
}

.app-content-v5 .input-group > .form-control,
.app-content-v5 .input-group > .form-select {
    min-width: 0;
}

.app-content-v5 .nav-tabs,
.app-content-v5 .nav-pills {
    max-width: 100%;
}

.app-content-v5 .table-responsive {
    scrollbar-width: thin;
}

.app-content-v5 .dropdown-menu {
    max-width: min(92vw, 420px);
}

@media (min-width: 1200px) {
    .module-summary-strip {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .module-summary-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

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

    .modal-xl {
        --bs-modal-width: calc(100vw - 32px);
    }
}

@media (max-width: 991.98px) {
    .module-clean-header,
    .pdv-hero,
    .app-content-v5 > .d-flex.justify-content-between.align-items-center {
        align-items: flex-start !important;
    }

    .module-clean-actions {
        max-width: 100%;
        overflow-x: auto;
        padding-bottom: 2px;
        flex-wrap: nowrap !important;
        scrollbar-width: thin;
    }

    .module-clean-actions > *,
    .module-clean-actions .btn,
    .module-clean-actions form {
        flex: 0 0 auto;
        width: auto !important;
    }

    .app-content-v5 .nav-tabs,
    .app-content-v5 .nav-pills {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 4px;
        scrollbar-width: thin;
    }

    .app-content-v5 .nav-tabs .nav-item,
    .app-content-v5 .nav-pills .nav-item,
    .app-content-v5 .nav-tabs .nav-link,
    .app-content-v5 .nav-pills .nav-link {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .app-content-v5 [style*="max-width"] input,
    .app-content-v5 input[style*="max-width"],
    .app-content-v5 select[style*="max-width"] {
        max-width: 100% !important;
    }

    .pdv-wrap .dropdown-menu {
        min-width: min(300px, calc(100vw - 32px)) !important;
    }
}

@media (max-width: 767.98px) {
    .app-content-v5 {
        width: 100%;
        overflow-x: hidden;
    }

    .module-clean-header {
        flex-direction: column;
        width: 100%;
    }

    .module-clean-actions {
        width: 100%;
    }

    .module-clean-actions > .btn:first-child,
    .module-clean-actions > a.btn:first-child {
        flex: 1 1 auto;
    }

    .module-filter-panel .card-body,
    .finance-filter-band,
    .pdv-card .card-body {
        padding: 12px !important;
    }

    .module-filter-panel form .d-flex.align-items-end,
    .finance-filter-band form .d-flex.align-items-end,
    .app-content-v5 form .d-flex.align-items-end {
        display: flex !important;
        flex-wrap: wrap;
        gap: 8px !important;
    }

    .module-filter-panel form .d-flex.align-items-end .btn,
    .finance-filter-band form .d-flex.align-items-end .btn,
    .app-content-v5 form .d-flex.align-items-end .btn {
        flex: 1 1 120px;
        width: auto !important;
    }

    .module-summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        overflow: visible;
    }

    .responsive-card-table tbody tr {
        margin-bottom: 10px;
        border: 1px solid var(--v5-border) !important;
        border-radius: 6px !important;
        box-shadow: none !important;
        overflow: hidden;
    }

    .responsive-card-table tbody td {
        min-height: 38px;
        padding: 8px 10px !important;
        gap: 12px;
    }

    .responsive-card-table tbody td::before {
        flex: 0 0 38%;
        max-width: 38%;
        font-size: .69rem;
        line-height: 1.2;
    }

    .responsive-card-table tbody td > .d-flex,
    .responsive-card-table tbody td > .d-inline-flex,
    .responsive-card-table tbody td > form {
        max-width: 62%;
        justify-content: flex-end !important;
    }

    .responsive-card-table tbody td input,
    .responsive-card-table tbody td select,
    .responsive-card-table tbody td textarea {
        max-width: 100% !important;
        min-width: 0;
    }

    .app-content-v5 .card:not(.module-summary-strip) {
        border-radius: 6px;
        box-shadow: none !important;
    }

    .app-content-v5 .card-body {
        padding: 12px;
    }

    .pdv-total-box {
        align-items: flex-start !important;
    }

    .pdv-total-box > div:last-child {
        width: 100%;
        text-align: right;
    }

    .pdv-wrap #items-table .form-control,
    .pdv-wrap #items-table .form-select {
        width: 100% !important;
    }

    .modal-dialog.modal-lg,
    .modal-dialog.modal-xl {
        width: calc(100vw - 16px);
        max-width: none;
        margin: 8px;
    }

    .modal-dialog-scrollable {
        height: calc(100dvh - 16px);
    }

    .modal-dialog-scrollable .modal-content {
        max-height: calc(100dvh - 16px);
    }

    .modal-header,
    .modal-footer {
        padding: 10px 12px;
    }

    .modal-body {
        padding: 12px;
    }
}

@media (max-width: 575.98px) {
    .app-content-v5 {
        padding: 10px 8px 24px !important;
    }

    .module-clean-title,
    .pdv-title,
    .app-content-v5 h4 {
        font-size: 1.05rem !important;
    }

    .module-summary-strip {
        gap: 6px;
    }

    .module-summary-strip > * {
        min-width: 0;
        padding: 9px !important;
    }

    .app-content-v5 form .btn-group,
    .app-content-v5 form .input-group {
        width: 100%;
    }

    .app-content-v5 form .input-group .btn {
        width: auto !important;
        flex: 0 0 auto;
    }

    .responsive-card-table tbody td {
        align-items: flex-start;
    }

    .responsive-card-table tbody td::before {
        flex-basis: 34%;
        max-width: 34%;
    }

    .responsive-card-table tbody td > .d-flex,
    .responsive-card-table tbody td > .d-inline-flex,
    .responsive-card-table tbody td > form {
        max-width: 66%;
    }

    .modal-dialog:not(.modal-sm) {
        width: 100%;
        min-height: 100dvh;
        margin: 0;
    }

    .modal-dialog:not(.modal-sm) .modal-content {
        min-height: 100dvh;
        border: 0;
        border-radius: 0;
    }

    .modal-dialog-scrollable {
        height: 100dvh;
    }

    .modal-dialog-scrollable .modal-content {
        max-height: 100dvh;
    }
}

@media (max-width: 389.98px) {
    .module-summary-strip {
        grid-template-columns: 1fr !important;
    }

    .responsive-card-table tbody td {
        display: block !important;
    }

    .responsive-card-table tbody td::before {
        display: block;
        max-width: 100%;
        margin-bottom: 4px;
    }

    .responsive-card-table tbody td > .d-flex,
    .responsive-card-table tbody td > .d-inline-flex,
    .responsive-card-table tbody td > form {
        max-width: 100%;
        justify-content: flex-start !important;
    }
}

/* Painel amplo de acoes da ordem de servico */
.os-actions-trigger {
    width: 36px !important;
    min-width: 36px !important;
    height: 34px;
    font-size: 1rem;
}

.os-action-dialog {
    --bs-modal-width: 720px;
}

.os-action-dialog .modal-header {
    align-items: flex-start;
    padding: 16px 18px;
}

.os-action-dialog .modal-body {
    padding: 18px;
}

.os-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.os-action-option {
    min-width: 0;
    min-height: 78px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid #dce3ec;
    border-radius: 6px;
    background: #fff;
    color: #27364a;
    text-align: left;
    text-decoration: none;
    transition: border-color .15s ease, background-color .15s ease;
}

button.os-action-option {
    width: 100%;
    font: inherit;
}

.os-action-option:hover,
.os-action-option:focus-visible {
    border-color: #8db4f2;
    background: #f5f9ff;
    color: #174ea6;
}

.os-action-option > i {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: #edf4ff;
    color: var(--v5-blue);
    font-size: 1.15rem;
}

.os-action-option > span {
    min-width: 0;
}

.os-action-option strong,
.os-action-option small {
    display: block;
}

.os-action-option strong {
    margin-bottom: 2px;
    font-size: .9rem;
}

.os-action-option small {
    color: #718096;
    font-size: .76rem;
}

.os-action-option-edit > i {
    background: #fff8e6;
    color: #a16207;
}

.os-action-option-whatsapp > i {
    background: #eaf8ef;
    color: #198754;
}

.os-action-option.is-success {
    border-color: #86d3a6;
    background: #f0fbf4;
    color: #13713a;
}

.os-action-status {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--v5-border);
}

.os-action-status .btn {
    min-height: 36px;
    white-space: nowrap;
}

body.theme-dark .os-action-option,
body.v3-dark .os-action-option {
    border-color: rgba(148, 163, 184, .25);
    background: #172033;
    color: #e5e7eb;
}

body.theme-dark .os-action-option:hover,
body.v3-dark .os-action-option:hover {
    border-color: #4f83cc;
    background: #1c2a40;
}

body.theme-dark .os-action-option small,
body.v3-dark .os-action-option small {
    color: #9ca9bc;
}

@media (max-width: 575.98px) {
    .os-action-dialog {
        width: 100%;
        margin: 0;
    }

    .os-action-dialog .modal-content {
        min-height: 100dvh;
    }

    .os-action-grid {
        grid-template-columns: 1fr;
    }

    .os-action-option {
        min-height: 68px;
        padding: 11px 12px;
    }

    .os-action-status {
        grid-template-columns: 1fr;
    }

    .os-action-status .btn {
        width: 100% !important;
    }
}

/* Visualizacao adaptativa por resolucao */
.app-layout-menu {
    width: 330px;
    padding: 8px;
}

.app-layout-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 8px 9px;
    border-bottom: 1px solid var(--v5-border);
}

.app-layout-menu-head strong {
    font-size: .8rem;
}

.app-layout-menu-head small {
    color: var(--v5-muted);
    font-size: .68rem;
}

.app-layout-option {
    display: grid !important;
    grid-template-columns: 28px minmax(0, 1fr) 20px;
    gap: 8px;
    min-height: 52px;
    padding: 7px 8px;
}

.app-layout-option > i:first-child {
    color: #617086;
    font-size: 1rem;
    text-align: center;
}

.app-layout-option > span {
    min-width: 0;
}

.app-layout-option strong,
.app-layout-option small {
    display: block;
}

.app-layout-option strong {
    color: var(--v5-text);
    font-size: .79rem;
}

.app-layout-option small {
    margin-top: 2px;
    color: var(--v5-muted);
    font-size: .68rem;
    font-weight: 500;
}

.app-layout-check {
    visibility: hidden;
    color: var(--v5-green);
}

.app-layout-option.active {
    background: #edf4ff;
}

.app-layout-option.active .app-layout-check {
    visibility: visible;
}

html[data-app-layout="compact"] .app-content-v5 {
    max-width: 1440px !important;
}

html[data-app-layout="wide"] .app-content-v5 {
    max-width: 1920px !important;
}

html[data-app-layout="full"] .app-content-v5 {
    max-width: none !important;
    margin-inline: 0;
}

@media (min-width: 1600px) {
    html[data-app-layout="auto"] .app-content-v5 {
        width: calc(100% - 40px);
        max-width: 1920px !important;
        padding-inline: 28px !important;
    }
}

@media (min-width: 2200px) {
    html[data-app-layout="auto"] .app-content-v5 {
        width: 100%;
        max-width: none !important;
        padding-inline: clamp(32px, 2.2vw, 72px) !important;
    }

    html[data-app-layout="auto"] .app-v5-brandbar,
    html[data-app-layout="full"] .app-v5-brandbar {
        grid-template-columns: 260px minmax(520px, 900px) minmax(280px, 1fr);
        padding-inline: clamp(28px, 2vw, 64px);
    }

    html[data-app-layout="auto"] .app-v5-module-nav,
    html[data-app-layout="auto"] .app-v5-quickbar,
    html[data-app-layout="full"] .app-v5-module-nav,
    html[data-app-layout="full"] .app-v5-quickbar {
        padding-inline: clamp(28px, 2vw, 64px);
    }

    html[data-app-layout="auto"] .module-summary-strip,
    html[data-app-layout="full"] .module-summary-strip {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
    }
}

@media (min-width: 3000px) {
    html[data-app-layout="auto"] .app-content-v5,
    html[data-app-layout="full"] .app-content-v5 {
        padding-inline: clamp(48px, 2.5vw, 96px) !important;
    }

    html[data-app-layout="auto"] .table,
    html[data-app-layout="full"] .table {
        font-size: .82rem;
    }
}

@media (max-width: 767.98px) {
    .app-layout-menu {
        position: fixed !important;
        top: 54px !important;
        right: 8px !important;
        left: auto !important;
        width: min(330px, calc(100vw - 16px));
        max-width: none !important;
        transform: none !important;
    }

    html[data-app-layout] .app-content-v5 {
        width: 100%;
        max-width: none !important;
        margin-inline: 0;
    }
}

body.theme-dark .app-layout-option.active,
body.v3-dark .app-layout-option.active {
    background: rgba(37, 99, 235, .16);
}

body.theme-dark .app-layout-option strong,
body.v3-dark .app-layout-option strong {
    color: #e5e7eb;
}

.app-layout-menu-section {
    margin-top: 6px;
    padding: 9px 8px 5px;
    border-top: 1px solid var(--v5-border);
    color: var(--v5-muted);
    font-size: .67rem;
    font-weight: 800;
    text-transform: uppercase;
}

.app-density-control {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 3px 5px 5px;
}

.app-density-control button {
    min-width: 0;
    min-height: 32px;
    padding: 4px 6px;
    border: 1px solid var(--v5-border);
    border-radius: 5px;
    background: #fff;
    color: #526071;
    font-size: .68rem;
    font-weight: 700;
}

.app-density-control button.active {
    border-color: #8db4f2;
    background: #edf4ff;
    color: #174ea6;
}

html[data-app-density="compact"] .app-content-v5 {
    padding-top: 14px !important;
}

html[data-app-density="compact"] .card-body {
    padding: 11px 12px;
}

html[data-app-density="compact"] .table > :not(caption) > * > * {
    padding: .38rem .45rem;
}

html[data-app-density="compact"] .form-control,
html[data-app-density="compact"] .form-select,
html[data-app-density="compact"] .btn {
    min-height: 32px;
    font-size: .8rem;
}

html[data-app-density="dense"] .app-content-v5 {
    padding-top: 10px !important;
}

html[data-app-density="dense"] .dashboard-v5-head,
html[data-app-density="dense"] .module-clean-header {
    margin-bottom: 9px;
    padding-bottom: 8px;
}

html[data-app-density="dense"] .card-body {
    padding: 8px 10px;
}

html[data-app-density="dense"] .table {
    font-size: .73rem;
}

html[data-app-density="dense"] .table > :not(caption) > * > * {
    padding: .27rem .38rem;
}

html[data-app-density="dense"] .form-control,
html[data-app-density="dense"] .form-select,
html[data-app-density="dense"] .btn {
    min-height: 29px;
    font-size: .75rem;
}

html[data-app-density="dense"] .module-summary-item {
    padding: 6px 8px !important;
}

.app-row-actions-source {
    display: none !important;
}

.app-row-actions-trigger {
    width: 34px !important;
    min-width: 34px !important;
}

.app-row-actions-dialog {
    --bs-modal-width: 480px;
}

.app-row-actions-panel {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.app-row-actions-panel > .btn,
.app-row-actions-panel > a,
.app-row-actions-panel > form,
.app-row-actions-panel > form .btn {
    width: 100% !important;
}

.app-row-actions-panel > .btn,
.app-row-actions-panel > a,
.app-row-actions-panel > form .btn {
    min-height: 44px;
}

.app-row-actions-panel > a,
.app-row-actions-panel > .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.app-table-pager {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 8px 10px;
    border-top: 1px solid var(--v5-border);
    background: #fbfcfd;
}

.app-table-pager-info {
    margin-right: auto;
    color: var(--v5-muted);
    font-size: .75rem;
    font-weight: 700;
}

.app-table-pager label {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--v5-muted);
    font-size: .72rem;
    white-space: nowrap;
}

.app-table-pager .form-select {
    width: 72px;
}

.app-server-pagination {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin: -1px 0 16px;
    padding: 8px 10px;
    border: 1px solid var(--v5-border);
    border-radius: 0 0 6px 6px;
    background: #fbfcfd;
}

.app-server-pagination > span {
    margin-right: auto;
    color: var(--v5-muted);
    font-size: .75rem;
    font-weight: 700;
}

.app-server-pagination-size label {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--v5-muted);
    font-size: .72rem;
    white-space: nowrap;
}

.app-server-pagination-size .form-select {
    width: 72px;
}

.app-skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 2000;
    padding: 8px 12px;
    border-radius: 5px;
    background: #111827;
    color: #fff;
    text-decoration: none;
    transform: translateY(-150%);
}

.app-skip-link:focus {
    transform: translateY(0);
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid rgba(37, 99, 235, .42) !important;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

body.theme-dark .app-density-control button,
body.v3-dark .app-density-control button,
body.theme-dark .app-table-pager,
body.v3-dark .app-table-pager,
body.theme-dark .app-server-pagination,
body.v3-dark .app-server-pagination {
    border-color: rgba(148, 163, 184, .22);
    background: #111827;
    color: #cbd5e1;
}

body.theme-dark .app-density-control button.active,
body.v3-dark .app-density-control button.active {
    background: rgba(37, 99, 235, .18);
    color: #bfdbfe;
}

@media (max-width: 575.98px) {
    .app-row-actions-dialog {
        width: 100%;
        margin: 0;
    }

    .app-row-actions-dialog .modal-content {
        min-height: 100dvh;
    }

    .app-row-actions-panel {
        grid-template-columns: 1fr;
    }

    .app-table-pager {
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .app-server-pagination {
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .app-table-pager-info {
        width: 100%;
        margin-right: 0;
    }

    .app-server-pagination > span {
        width: 100%;
        margin-right: 0;
    }
}
