/* ==========================================================================
   Carvalho Smart — Design System v2 (tablet-first)
   Marca: azul-marinho + amarelo (logo Carvalho Automação)
   Base: Bootstrap 5.3 (sobrescrito via variáveis CSS) + Plus Jakarta Sans
   Breakpoints de layout:
     < 992px      → menu em gaveta (tablet retrato / celular)
     992–1199px   → menu em trilho de ícones (tablet paisagem)
     ≥ 1200px     → menu completo (pode ser recolhido pelo usuário)
   ========================================================================== */

/* ===== 1. Tokens ===== */
:root {
    /* Marca */
    --brand-navy-900: #0b1533;
    --brand-navy-800: #0f1d4a;
    --brand-navy-700: #16296b;
    --brand-navy-600: #1d3fa6;
    --brand-yellow: #ffd60a;
    --brand-yellow-600: #e6b800;
    --brand-yellow-soft: #fff7cc;

    /* Cores de ação e status (nomes antigos mantidos por compatibilidade) */
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-active: #1e40af;
    --primary-light: rgba(37, 99, 235, 0.1);
    --primary-rgb: 37, 99, 235;
    --primary-gradient: linear-gradient(135deg, #3b7bff 0%, #2563eb 55%, #1d4ed8 100%);
    --secondary-color: #64748b;
    --success-color: #059669;
    --success-light: rgba(5, 150, 105, 0.1);
    --warning-color: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.12);
    --danger-color: #dc2626;
    --danger-light: rgba(220, 38, 38, 0.1);
    --info-color: #0891b2;
    --info-light: rgba(8, 145, 178, 0.1);
    --purple-color: #7c3aed;
    --purple-light: rgba(124, 58, 237, 0.1);
    --teal-color: #0d9488;
    --teal-light: rgba(13, 148, 136, 0.1);
    --orange-color: #ea580c;
    --orange-light: rgba(234, 88, 12, 0.1);

    /* Layout */
    --sidebar-width: 264px;
    --sidebar-collapsed: 84px;
    --sidebar-gap: 12px;
    --header-height: 68px;
    --content-pad: 24px;
    --touch: 44px;

    /* Superfícies e texto */
    --bg-color: #f3f6fb;
    --card-bg: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #eef2f7;
    --text-color: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;
    --text-soft: #94a3b8;
    --border-color: #e6ebf2;
    --border-strong: #d5dde8;

    /* Sombras */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -12px rgba(15, 23, 42, 0.12);
    --shadow-md: 0 2px 6px rgba(15, 23, 42, 0.05), 0 16px 32px -14px rgba(15, 23, 42, 0.18);
    --shadow-lg: 0 28px 56px -16px rgba(15, 23, 42, 0.28);
    --shadow-hover: 0 4px 10px rgba(15, 23, 42, 0.06), 0 18px 36px -16px rgba(15, 23, 42, 0.22);
    --shadow-primary: 0 10px 22px -10px rgba(37, 99, 235, 0.7);

    /* Raios */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-pill: 999px;

    --transition: all 0.2s ease;
    --transition-fast: all 0.15s ease;

    /* Degradês */
    --gradient-hero: radial-gradient(620px 300px at 108% -30%, rgba(255, 214, 10, 0.22), transparent 62%),
                     radial-gradient(520px 280px at -12% 130%, rgba(96, 165, 250, 0.35), transparent 62%),
                     linear-gradient(135deg, #0f1d4a 0%, #173a9c 55%, #2563eb 100%);
    --gradient-primary: linear-gradient(135deg, #3b7bff 0%, #2563eb 60%, #1d4ed8 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-warning: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    --gradient-danger: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
    --gradient-info: linear-gradient(135deg, #22b8d6 0%, #0891b2 100%);
    --gradient-purple: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
    --gradient-orange: linear-gradient(135deg, #fb923c 0%, #ea580c 100%);
    --gradient-navy: linear-gradient(160deg, #13235a 0%, #0f1d4a 45%, #0b1533 100%);

    --font-sans: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    /* Bootstrap 5.3 */
    --bs-body-font-family: var(--font-sans);
    --bs-body-font-size: 14.5px;
    --bs-body-color: #334155;
    --bs-body-bg: #f3f6fb;
    --bs-emphasis-color: #0f172a;
    --bs-secondary-color: #64748b;
    --bs-border-color: #e6ebf2;
    --bs-border-radius: 12px;
    --bs-border-radius-sm: 8px;
    --bs-border-radius-lg: 16px;
    --bs-border-radius-xl: 20px;
    --bs-border-radius-pill: 999px;
    --bs-link-color: #2563eb;
    --bs-link-color-rgb: 37, 99, 235;
    --bs-link-hover-color: #1d4ed8;
    --bs-link-hover-color-rgb: 29, 78, 216;
    --bs-primary: #2563eb;
    --bs-primary-rgb: 37, 99, 235;
    --bs-secondary: #64748b;
    --bs-secondary-rgb: 100, 116, 139;
    --bs-success: #059669;
    --bs-success-rgb: 5, 150, 105;
    --bs-info: #0891b2;
    --bs-info-rgb: 8, 145, 178;
    --bs-warning: #f59e0b;
    --bs-warning-rgb: 245, 158, 11;
    --bs-danger: #dc2626;
    --bs-danger-rgb: 220, 38, 38;
    --bs-dark: #0f172a;
    --bs-dark-rgb: 15, 23, 42;
    --bs-light: #f1f5f9;
    --bs-light-rgb: 241, 245, 249;
    --bs-primary-bg-subtle: #e8efff;
    --bs-success-bg-subtle: #e3f6ee;
    --bs-warning-bg-subtle: #fff4dc;
    --bs-danger-bg-subtle: #fde8e8;
    --bs-info-bg-subtle: #e0f4f8;
    --bs-primary-text-emphasis: #1e40af;
    --bs-success-text-emphasis: #065f46;
    --bs-warning-text-emphasis: #7a4b00;
    --bs-danger-text-emphasis: #991b1b;
    --bs-info-text-emphasis: #155e75;
    --bs-focus-ring-color: rgba(37, 99, 235, 0.25);
}

/* ===== 2. Base ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-body);
    font-size: 14.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--text-color);
    font-weight: 700;
    letter-spacing: -0.015em;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

a, button, .btn, [onclick], label, summary, select, input[type="checkbox"], input[type="radio"] {
    touch-action: manipulation;
}

::selection {
    background: rgba(37, 99, 235, 0.18);
}

:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.45);
    outline-offset: 2px;
}

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

.fw-medium { font-weight: 500 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-extrabold { font-weight: 800 !important; }
.tabular-nums { font-variant-numeric: tabular-nums; }
.text-navy { color: var(--brand-navy-800) !important; }
.bg-navy { background: var(--brand-navy-800) !important; color: #fff; }
.text-brand-yellow { color: var(--brand-yellow) !important; }
.bg-brand-yellow { background: var(--brand-yellow) !important; color: var(--brand-navy-800) !important; }

/* ===== 3. Layout (shell) ===== */
.wrapper {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
}

.main-content {
    flex: 1;
    min-width: 0;
    margin-left: calc(var(--sidebar-width) + var(--sidebar-gap) * 2);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.25s ease;
}

.content,
.content-wrapper {
    flex: 1;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px var(--content-pad) 40px calc(var(--content-pad) - var(--sidebar-gap));
}

/* ----- Sidebar ----- */
.sidebar {
    position: fixed;
    top: var(--sidebar-gap);
    bottom: var(--sidebar-gap);
    left: var(--sidebar-gap);
    width: var(--sidebar-width);
    background: var(--gradient-navy);
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 1040;
    border-radius: var(--radius-2xl);
    box-shadow: 0 24px 48px -24px rgba(11, 21, 51, 0.65);
    transition: width 0.25s ease, transform 0.28s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.25s ease;
    overflow: hidden;
    isolation: isolate;
}

.sidebar::before {
    content: '';
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    top: -150px;
    right: -150px;
    background: radial-gradient(circle, rgba(255, 214, 10, 0.16), transparent 70%);
    z-index: -1;
    pointer-events: none;
}

.sidebar-header {
    padding: 18px 16px 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 76px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    min-width: 0;
}

.sidebar-brand:hover {
    color: #fff;
}

.brand-mark {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffe14d 0%, var(--brand-yellow) 55%, var(--brand-yellow-600) 100%);
    color: var(--brand-navy-800);
    font-size: 24px;
    box-shadow: 0 8px 18px -8px rgba(255, 214, 10, 0.75), inset 0 -2px 0 rgba(0, 0, 0, 0.08);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    min-width: 0;
}

.brand-text strong {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #fff;
    white-space: nowrap;
}

.brand-text small {
    font-size: 11.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* compatibilidade: marca antiga com ícone direto */
.sidebar-brand > i {
    font-size: 28px;
    color: var(--brand-yellow);
}

.sidebar-toggle {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 0;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

/* Recolher/expandir (rodapé do menu) */
.sidebar-collapse-btn {
    width: 100%;
    min-height: 42px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-fast);
}

.sidebar-collapse-btn .bi {
    font-size: 15px;
    width: 24px;
    text-align: center;
    transition: transform 0.2s ease;
}

.sidebar-collapse-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.sidebar-toggle {
    display: none;
}

.sidebar.active .sidebar-toggle {
    display: inline-flex;
}

.sidebar.active .sidebar-collapse-btn {
    display: none;
}

.sidebar-menu {
    flex: 1;
    padding: 4px 12px 12px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.16);
    border-radius: 6px;
}

.sidebar-menu .nav {
    gap: 2px;
}

.sidebar-menu .nav-item {
    margin: 0;
}

.sidebar-menu .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 0 14px;
    color: rgba(255, 255, 255, 0.72);
    font-weight: 500;
    font-size: 14.5px;
    border-radius: 14px;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-menu .nav-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.sidebar-menu .nav-link:active {
    background: rgba(255, 255, 255, 0.12);
}

.sidebar-menu .nav-link.active {
    background: var(--gradient-primary);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 10px 20px -10px rgba(37, 99, 235, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.sidebar-menu .nav-link i {
    font-size: 19px;
    width: 24px;
    flex: 0 0 24px;
    text-align: center;
    line-height: 1;
}

.sidebar-menu .nav-link .nav-badge {
    margin-left: auto;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--brand-yellow);
    color: var(--brand-navy-800);
    font-size: 11.5px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-header {
    padding: 16px 14px 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: rgba(255, 255, 255, 0.4);
    list-style: none;
}

.nav-header:first-child {
    padding-top: 4px;
}

.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 12px 14px;
    list-style: none;
}

.sidebar-footer {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-promo {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    padding: 16px;
    margin: 16px 2px 4px;
    background: linear-gradient(140deg, #3b7bff 0%, #2563eb 50%, #1d3fa6 100%);
    box-shadow: 0 14px 28px -16px rgba(37, 99, 235, 0.9);
    isolation: isolate;
}

.sidebar-promo::after {
    content: '';
    position: absolute;
    right: -30px;
    top: -30px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 22px solid rgba(255, 255, 255, 0.1);
    z-index: -1;
}

.sidebar-promo-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.16);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--brand-yellow);
    margin-bottom: 10px;
}

.sidebar-promo-title {
    display: block;
    font-weight: 800;
    font-size: 15px;
    line-height: 1.25;
    color: #fff;
}

.sidebar-promo-text {
    display: block;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.78);
    margin: 4px 0 12px;
    line-height: 1.4;
}

.sidebar-promo .btn {
    width: 100%;
    --bs-btn-bg: rgba(255, 255, 255, 0.95);
    --bs-btn-color: var(--brand-navy-700);
    --bs-btn-border-color: transparent;
    --bs-btn-hover-bg: #fff;
    --bs-btn-hover-color: var(--brand-navy-800);
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-bg: #e8efff;
    --bs-btn-active-color: var(--brand-navy-800);
    --bs-btn-active-border-color: transparent;
    font-weight: 700;
    box-shadow: none;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
}

.sidebar-user .user-avatar,
.user-avatar-initials {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    color: var(--brand-navy-800);
    background: linear-gradient(135deg, #ffe14d, var(--brand-yellow));
    text-transform: uppercase;
}

.user-avatar i {
    font-size: 22px;
    color: var(--brand-navy-800);
}

.user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    line-height: 1.25;
}

.user-name {
    font-weight: 700;
    font-size: 13.5px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    text-transform: capitalize;
}

.sidebar-logout {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.65);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.16);
    color: #fecaca;
}

/* botão flutuante antigo (páginas avulsas) — substituído pelo botão no header */
.mobile-menu-btn {
    display: none !important;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(11, 21, 51, 0.45);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    z-index: 1035;
}

.sidebar-overlay.active {
    display: block;
    animation: fadeOverlay 0.2s ease;
}

@keyframes fadeOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ----- Header (topbar) ----- */
.header {
    position: sticky;
    top: 0;
    z-index: 1020;
    padding: var(--sidebar-gap) var(--content-pad) 0 calc(var(--content-pad) - var(--sidebar-gap));
    background: linear-gradient(180deg, var(--bg-color) 0%, var(--bg-color) 78%, rgba(243, 246, 251, 0) 100%);
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
}

.header-inner {
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #edf1f6;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 12px 0 18px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
}

.header-titles {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.header .page-title {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-subtitle {
    font-size: 12.5px;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-subtitle:empty {
    display: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.header-menu-btn {
    display: none !important;
}

.header-back-btn {
    display: none !important;
}

.header-search {
    position: relative;
    margin: 0;
}

.header-search i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-soft);
    font-size: 15px;
    pointer-events: none;
}

.header-search input {
    width: 240px;
    height: 44px;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    background: var(--surface-3);
    padding: 0 16px 0 40px;
    font-size: 14px;
    color: var(--text-color);
    transition: var(--transition-fast);
    font-family: inherit;
}

.header-search input::placeholder {
    color: var(--text-soft);
}

.header-search input:focus {
    outline: none;
    background: #fff;
    border-color: #a9c2fa;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.header-new-os {
    border-radius: var(--radius-pill) !important;
    padding-left: 18px !important;
    padding-right: 20px !important;
}

.btn-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-3);
    border: none;
    color: var(--text-body);
    position: relative;
    font-size: 18px;
    padding: 0;
    transition: var(--transition-fast);
    flex: 0 0 auto;
}

.btn-icon:hover {
    background: #e3e9f2;
    color: var(--text-color);
}

.btn-icon:active {
    transform: scale(0.96);
}

/* .btn-icon combinado com uma variante (ex.: "btn btn-danger btn-icon") mantém a cor da variante */
.btn.btn-icon:is(.btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-warning, .btn-info, .btn-dark, .btn-light, [class*="btn-outline-"]) {
    background: var(--bs-btn-bg);
    color: var(--bs-btn-color);
    border: var(--bs-btn-border-width) solid var(--bs-btn-border-color);
}

.btn.btn-icon:is(.btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-warning, .btn-info, .btn-dark, .btn-light, [class*="btn-outline-"]):hover {
    background: var(--bs-btn-hover-bg);
    color: var(--bs-btn-hover-color);
    border-color: var(--bs-btn-hover-border-color);
}

.header .btn-icon.show {
    background: #e3e9f2;
}

.notification-badge {
    position: absolute;
    top: 7px;
    right: 7px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--danger-color);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 999px;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 44px;
    padding: 0 14px;
    background: var(--surface-3);
    border-radius: 14px;
    font-size: 17px;
    color: #128c4a;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9);
}

.status-online {
    background: #10b981;
}

.status-offline {
    background: var(--danger-color);
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    padding: 4px 12px 4px 4px;
    border-radius: 16px;
    border: 0;
    background: transparent;
    color: var(--text-color);
    text-align: left;
    transition: var(--transition-fast);
}

.user-chip:hover,
.user-chip.show {
    background: var(--surface-3);
}

.user-chip-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--gradient-primary);
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    flex: 0 0 auto;
    box-shadow: 0 6px 14px -8px rgba(37, 99, 235, 0.8);
}

.user-chip-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    max-width: 160px;
}

.user-chip-name {
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-chip-email {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-chip .bi-chevron-down {
    font-size: 12px;
    color: var(--text-soft);
}

/* compatibilidade com o botão antigo */
.user-menu-btn i {
    font-size: 22px;
}

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

.page-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.page-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--text-color);
}

.page-subtitle {
    color: var(--text-muted);
    margin: 0;
    font-size: 14.5px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    margin: 0;
    padding: 0;
    background: none;
    --bs-breadcrumb-margin-bottom: 0;
}

.breadcrumb a {
    color: var(--text-muted);
    font-weight: 500;
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb .separator {
    color: var(--border-strong);
}

.breadcrumb .current {
    color: var(--text-color);
    font-weight: 600;
}

/* ----- Hero (.panel-header = banner em degradê, usado em quase todas as páginas) ----- */
.panel-header,
.hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: var(--gradient-hero);
    border-radius: var(--radius-2xl);
    padding: 24px 28px;
    color: #fff;
    box-shadow: 0 22px 44px -26px rgba(15, 29, 74, 0.85);
    margin-bottom: 24px;
}

.panel-header::before,
.hero::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    right: -90px;
    top: -150px;
    border-radius: 50%;
    border: 46px solid rgba(255, 255, 255, 0.06);
    z-index: -1;
    pointer-events: none;
}

.panel-header::after,
.hero::after {
    content: '';
    position: absolute;
    width: 220px;
    height: 220px;
    right: 22%;
    bottom: -150px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    z-index: -1;
    pointer-events: none;
}

.panel-header h1, .panel-header h2, .panel-header h3,
.panel-header h4, .panel-header h5, .panel-header h6,
.hero h1, .hero h2, .hero h3, .hero h4, .hero h5, .hero h6 {
    color: #fff;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
    color: #fff;
    line-height: 1.2;
}

.panel-title > i.bi:first-child {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 15px;
    margin: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
}

.panel-subtitle {
    color: rgba(255, 255, 255, 0.78);
    margin: 6px 0 0;
    font-size: 14.5px;
    font-weight: 500;
}

.panel-title + .panel-subtitle {
    margin-left: 62px;
}

.panel-header .text-muted,
.hero .text-muted {
    color: rgba(255, 255, 255, 0.78) !important;
}

.panel-header .text-white-50,
.hero .text-white-50 {
    color: rgba(255, 255, 255, 0.7) !important;
}

.panel-header .badge.bg-white,
.panel-header .badge.bg-light,
.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.14) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.24);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 13px !important;
}

.panel-header .btn-outline-primary,
.panel-header .btn-outline-light,
.panel-header .btn-outline-secondary,
.hero .btn-glass,
.btn-glass {
    --bs-btn-color: #fff;
    --bs-btn-bg: rgba(255, 255, 255, 0.1);
    --bs-btn-border-color: rgba(255, 255, 255, 0.32);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: rgba(255, 255, 255, 0.2);
    --bs-btn-hover-border-color: rgba(255, 255, 255, 0.5);
    --bs-btn-active-color: var(--brand-navy-800);
    --bs-btn-active-bg: #fff;
    --bs-btn-active-border-color: #fff;
    --bs-btn-disabled-color: rgba(255, 255, 255, 0.6);
    --bs-btn-disabled-bg: transparent;
    --bs-btn-disabled-border-color: rgba(255, 255, 255, 0.25);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    box-shadow: none;
}

.panel-header .btn-primary,
.hero .btn-primary,
.panel-header .btn-light,
.hero .btn-light {
    --bs-btn-color: var(--brand-navy-700);
    --bs-btn-bg: #fff;
    --bs-btn-border-color: #fff;
    --bs-btn-hover-color: var(--brand-navy-800);
    --bs-btn-hover-bg: #eef3ff;
    --bs-btn-hover-border-color: #eef3ff;
    --bs-btn-active-color: var(--brand-navy-800);
    --bs-btn-active-bg: #dfe8ff;
    --bs-btn-active-border-color: #dfe8ff;
    box-shadow: 0 10px 20px -12px rgba(0, 0, 0, 0.45);
}

.panel-header .form-control,
.panel-header .form-select {
    border-color: transparent;
}

.avatar-circle {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex: 0 0 auto;
}

/* Saudação (hero de painel) */
.hero-greeting {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.15;
    margin: 0;
    color: #fff;
}

.hero-sub {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    font-weight: 500;
}

.hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 22px;
}

.hero-stat {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: #fff;
    transition: background 0.15s ease;
}

a.hero-stat:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.hero-stat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
}

.hero-stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.16);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex: 0 0 auto;
}

.hero-stat-value {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-stat-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

/* ===== 5. Cards ===== */
.card {
    --bs-card-bg: var(--card-bg);
    --bs-card-border-color: transparent;
    --bs-card-border-radius: var(--radius-xl);
    --bs-card-inner-border-radius: calc(var(--radius-xl) - 1px);
    --bs-card-cap-bg: transparent;
    --bs-card-spacer-x: 20px;
    --bs-card-spacer-y: 20px;
    --bs-card-cap-padding-x: 20px;
    --bs-card-cap-padding-y: 16px;
    background: var(--card-bg);
    border: 1px solid #edf1f6;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
}

.card-header:first-child {
    border-radius: calc(var(--radius-xl) - 1px) calc(var(--radius-xl) - 1px) 0 0;
}

.card-header h5,
.card-header h6,
.card-header .card-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.01em;
}

.card-header:not([class*="bg-"]) h5,
.card-header:not([class*="bg-"]) h6,
.card-header:not([class*="bg-"]) .card-title {
    color: var(--text-color);
}

.card-header :is(h5, h6, .card-title) > i.bi:first-child {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    margin: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background: rgba(37, 99, 235, 0.1);
    background: color-mix(in srgb, currentColor 12%, transparent);
}

.card-header[class*="bg-"] {
    border-bottom-color: transparent;
}

/* ações no cabeçalho do card não quebram linha */
.card-header .btn,
.card-header .badge {
    white-space: nowrap;
    flex-shrink: 0;
}

/* .card do Bootstrap quebra palavras no meio; em títulos e rótulos curtos isso fica feio */
.card :is(h1, h2, h3, h4, h5, h6, .badge, .btn, .kpi-tile-label, .stat-label, .qa-title) {
    overflow-wrap: normal;
    word-break: normal;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: var(--text-color);
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--surface-2);
}

.card-footer:last-child {
    border-radius: 0 0 calc(var(--radius-xl) - 1px) calc(var(--radius-xl) - 1px);
}

.card-footer.bg-transparent {
    background: transparent !important;
}

/* Card de seção com título e barra lateral (ref. "| Sales Revenue") */
.title-bar {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.title-bar::before {
    content: '';
    width: 4px;
    height: 20px;
    border-radius: 4px;
    background: var(--gradient-primary);
    flex: 0 0 auto;
}

.card-soft {
    background: var(--surface-2);
    box-shadow: none;
    border: 1px solid var(--border-color);
}

.card-tinted {
    --tint-rgb: var(--primary-rgb);
    background: linear-gradient(160deg, rgba(var(--tint-rgb), 0.1) 0%, rgba(var(--tint-rgb), 0.03) 100%), #fff;
    border: 1px solid rgba(var(--tint-rgb), 0.18);
    box-shadow: none;
}

.card-tinted-success { --tint-rgb: 5, 150, 105; }
.card-tinted-warning { --tint-rgb: 245, 158, 11; }
.card-tinted-danger { --tint-rgb: 220, 38, 38; }
.card-tinted-info { --tint-rgb: 8, 145, 178; }
.card-tinted-purple { --tint-rgb: 124, 58, 237; }
.card-tinted-orange { --tint-rgb: 234, 88, 12; }

.chart-container {
    position: relative;
    height: 300px;
}

.chart-container-pie {
    position: relative;
    height: 260px;
}

/* ===== 6. Indicadores (KPI) ===== */
.stat-card {
    --tint-rgb: var(--primary-rgb);
    position: relative;
    overflow: hidden;
    isolation: isolate;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 92px;
    padding: 18px;
    background: linear-gradient(140deg, rgba(var(--tint-rgb), 0.1) 0%, rgba(var(--tint-rgb), 0) 58%), #fff;
    border: 1px solid rgba(var(--tint-rgb), 0.16);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card::after {
    content: '';
    position: absolute;
    width: 96px;
    height: 96px;
    right: -32px;
    top: -32px;
    border-radius: 50%;
    background: rgba(var(--tint-rgb), 0.08);
    z-index: -1;
}

.stat-card[onclick],
a.stat-card {
    cursor: pointer;
    color: inherit;
}

.stat-card-primary { --tint-rgb: 37, 99, 235; }
.stat-card-success { --tint-rgb: 5, 150, 105; }
.stat-card-warning { --tint-rgb: 245, 158, 11; }
.stat-card-danger { --tint-rgb: 220, 38, 38; }
.stat-card-info { --tint-rgb: 8, 145, 178; }
.stat-card-teal { --tint-rgb: 13, 148, 136; }
.stat-card-purple { --tint-rgb: 124, 58, 237; }
.stat-card-orange { --tint-rgb: 234, 88, 12; }
.stat-card-secondary { --tint-rgb: 100, 116, 139; }

.stat-icon {
    flex: 0 0 auto;
    width: 50px;
    height: 50px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin: 0 !important;
    color: #fff;
    background: linear-gradient(140deg, rgba(var(--tint-rgb, 37, 99, 235), 0.78) 0%, rgb(var(--tint-rgb, 37, 99, 235)) 100%);
    box-shadow: 0 10px 18px -10px rgba(var(--tint-rgb, 37, 99, 235), 0.95);
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.stat-content h2,
.stat-content h3,
.stat-number,
.stat-content .stat-number {
    font-size: 26px;
    font-weight: 800;
    margin: 0;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-content span,
.stat-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.3;
}

.stat-meta {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Variante “stats-card” (ícone em cima) */
.stats-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    border: 1px solid #edf1f6;
}

.stats-card .card-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.stats-icon {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stats-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--text-color);
}

.stats-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

/* KPI com tendência e barra (ref. "12,543 Total Users") */
.kpi-card {
    --tint-rgb: var(--primary-rgb);
    background: #fff;
    border: 1px solid #edf1f6;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    height: 100%;
    color: inherit;
}

a.kpi-card:hover {
    color: inherit;
}

.kpi-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.kpi-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: rgba(var(--tint-rgb), 0.12);
    color: rgb(var(--tint-rgb));
}

.kpi-card-value {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-card-label {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-body);
    margin-top: -6px;
}

.kpi-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12.5px;
    color: var(--text-muted);
}

/* Medidor: trilho num tom mais claro do mesmo matiz do preenchimento */
.kpi-card .progress {
    height: 8px;
    background: rgba(var(--tint-rgb), 0.14);
}

.kpi-card .progress-bar {
    background: rgb(var(--tint-rgb));
}

.kpi-card-success { --tint-rgb: 5, 150, 105; }
.kpi-card-warning { --tint-rgb: 245, 158, 11; }
.kpi-card-danger { --tint-rgb: 220, 38, 38; }
.kpi-card-info { --tint-rgb: 8, 145, 178; }
.kpi-card-purple { --tint-rgb: 124, 58, 237; }
.kpi-card-orange { --tint-rgb: 234, 88, 12; }

.trend-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(5, 150, 105, 0.1);
    color: #047857;
    white-space: nowrap;
}

.trend-chip.down {
    background: rgba(220, 38, 38, 0.1);
    color: #b91c1c;
}

.trend-chip.neutral {
    background: var(--surface-3);
    color: var(--text-muted);
}

/* Blocos coloridos de status (ref. "495 In Stock") */
.kpi-tiles {
    display: grid;
    grid-template-columns: repeat(var(--tiles, 3), minmax(0, 1fr));
    gap: 12px;
}

.kpi-tile {
    --tile-bg: var(--gradient-primary);
    position: relative;
    overflow: hidden;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 128px;
    padding: 14px 14px 12px;
    border-radius: 18px;
    background: var(--tile-bg);
    color: #fff;
    box-shadow: 0 12px 22px -16px rgba(15, 23, 42, 0.6);
    transition: transform 0.15s ease;
}

a.kpi-tile:hover {
    color: #fff;
}

.kpi-tile::after {
    content: '';
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 0;
    height: 46%;
    border-radius: 60px 60px 0 0 / 46px 46px 0 0;
    background: rgba(255, 255, 255, 0.2);
    z-index: -1;
}

.kpi-tile-icon {
    font-size: 18px;
    line-height: 1;
    margin-bottom: auto;
    opacity: 0.95;
}

.kpi-tile-value {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-top: 10px;
}

.kpi-tile-label {
    font-size: 12.5px;
    font-weight: 700;
    opacity: 0.95;
    line-height: 1.25;
}

.kpi-tile-success { --tile-bg: linear-gradient(160deg, #34d399 0%, #10b981 45%, #059669 100%); }
/* amarelo: texto escuro (legível sobre o preenchimento claro) */
.kpi-tile-warning { --tile-bg: linear-gradient(160deg, #fde68a 0%, #fbbf24 50%, #f59e0b 100%); color: #2b1c00; }
a.kpi-tile-warning:hover { color: #2b1c00; }
.kpi-tile-danger { --tile-bg: linear-gradient(160deg, #fb7185 0%, #ef4444 45%, #dc2626 100%); }
.kpi-tile-purple { --tile-bg: linear-gradient(160deg, #a78bfa 0%, #8b5cf6 45%, #7c3aed 100%); }
.kpi-tile-info { --tile-bg: linear-gradient(160deg, #38bdf8 0%, #0ea5e9 45%, #0891b2 100%); }
.kpi-tile-orange { --tile-bg: linear-gradient(160deg, #fdba74 0%, #f97316 45%, #ea580c 100%); }
.kpi-tile-muted {
    --tile-bg: linear-gradient(160deg, #f1f5f9 0%, #e2e8f0 100%);
    color: var(--text-color);
    box-shadow: none;
}

a.kpi-tile-muted:hover {
    color: var(--text-color);
}

.kpi-tile-muted::after {
    background: rgba(15, 23, 42, 0.06);
}

/* Grade responsiva de indicadores */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

@media (min-width: 992px) {
    .kpi-grid { grid-template-columns: repeat(var(--kpi-cols, 4), minmax(0, 1fr)); }
}

.mini-stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.mini-stat-card h4 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 0;
    color: var(--text-color);
}

.mini-stat-card small {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

/* ===== 7. Ações rápidas (ref. "Quick Actions") ===== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(var(--qa-cols, 2), minmax(0, 1fr));
    gap: 12px;
}

.quick-action {
    --qa-bg: var(--gradient-primary);
    position: relative;
    overflow: hidden;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 2px;
    min-height: 108px;
    padding: 16px;
    border-radius: 18px;
    background: var(--qa-bg);
    color: #fff;
    border: 0;
    text-align: left;
    box-shadow: 0 14px 26px -18px rgba(15, 23, 42, 0.7);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.quick-action::after {
    content: '';
    position: absolute;
    right: -26px;
    top: -26px;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    z-index: -1;
}

.quick-action:hover {
    color: #fff;
}

.qa-icon {
    font-size: 24px;
    line-height: 1;
    margin-bottom: auto;
    padding-bottom: 12px;
}

.qa-title {
    font-weight: 800;
    font-size: 15px;
    line-height: 1.2;
    overflow-wrap: normal;
    word-break: normal;
}

.qa-sub {
    font-size: 12px;
    opacity: 0.88;
    font-weight: 500;
    line-height: 1.3;
    overflow-wrap: normal;
    word-break: normal;
}

.quick-action-success { --qa-bg: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.quick-action-warning { --qa-bg: linear-gradient(135deg, #fbbf24 0%, #f59e0b 60%, #d97706 100%); }
.quick-action-orange { --qa-bg: linear-gradient(135deg, #fb923c 0%, #ea580c 100%); }
.quick-action-purple { --qa-bg: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%); }
.quick-action-info { --qa-bg: linear-gradient(135deg, #22b8d6 0%, #0e7490 100%); }
.quick-action-danger { --qa-bg: linear-gradient(135deg, #f87171 0%, #dc2626 100%); }
.quick-action-navy { --qa-bg: linear-gradient(135deg, #1d3fa6 0%, #0f1d4a 100%); }

/* Barras horizontais ranqueadas (parte do todo / comparação) — uma cor, maior primeiro */
.rank-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rank-row-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    font-size: 13.5px;
}

.rank-name {
    font-weight: 600;
    color: var(--text-color);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-value {
    color: var(--text-muted);
    white-space: nowrap;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.rank-value strong {
    color: var(--text-color);
    font-weight: 700;
}

.rank-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    overflow: hidden;
}

.rank-bar > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: #2563eb;
    min-width: 4px;
    transition: width 0.4s ease;
}

/* Legenda de séries (chip com marcador colorido; o texto fica na cor de texto) */
.legend-inline {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-body);
    font-weight: 600;
}

.legend-inline .legend-key {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-inline .legend-swatch {
    width: 14px;
    height: 3px;
    border-radius: 2px;
    background: var(--swatch, #2563eb);
}

/* ===== 8. Listas, feed e avatares ===== */
.list-modern {
    list-style: none;
    margin: 0;
    padding: 0;
}

.list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    min-height: 64px;
    border-bottom: 1px solid #eef2f7;
    color: inherit;
    transition: background 0.15s ease;
}

.list-row:last-child {
    border-bottom: 0;
}

a.list-row:hover,
.list-row[onclick]:hover {
    background: rgba(37, 99, 235, 0.035);
    color: inherit;
}

.list-row[onclick] {
    cursor: pointer;
}

.list-row-body {
    flex: 1 1 auto;
    min-width: 0;
}

.list-row-title {
    font-weight: 700;
    color: var(--text-color);
    font-size: 14.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-row-sub {
    font-size: 12.5px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-row-end {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.feed {
    list-style: none;
    margin: 0;
    padding: 0;
}

.feed-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #eef2f7;
}

.feed-item:last-child {
    border-bottom: 0;
}

.feed-icon {
    --tint-rgb: var(--primary-rgb);
    width: 38px;
    height: 38px;
    border-radius: 12px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--tint-rgb), 0.1);
    color: rgb(var(--tint-rgb));
    font-size: 16px;
}

.feed-time {
    font-size: 12px;
    color: var(--text-soft);
}

.avatar {
    --avatar-bg: var(--primary-light);
    --avatar-color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--avatar-bg);
    color: var(--avatar-color);
    font-weight: 700;
    flex: 0 0 auto;
    position: relative;
}

.avatar-sm { width: 32px; height: 32px; font-size: 12px; border-radius: 10px; }
.avatar-md { width: 40px; height: 40px; font-size: 14px; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; border-radius: 16px; }
.avatar-xl { width: 72px; height: 72px; font-size: 24px; border-radius: 20px; }
.avatar-circle-round { border-radius: 50% !important; }

.avatar-initials {
    text-transform: uppercase;
}

.avatar-rank {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    color: var(--text-color);
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

/* ===== 9. Tabelas ===== */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-body);
    --bs-table-hover-bg: rgba(37, 99, 235, 0.04);
    --bs-table-striped-bg: rgba(15, 23, 42, 0.02);
    --bs-table-border-color: #eef2f7;
    margin-bottom: 0;
    font-size: 14px;
}

.table > thead > tr > th,
.table th {
    font-weight: 700;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    padding: 13px 16px;
    background: var(--surface-2);
    white-space: nowrap;
    vertical-align: middle;
}

.table > tbody > tr > td,
.table td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #eef2f7;
}

.table > tbody > tr:last-child > td {
    border-bottom: 0;
}

.table > :not(caption) > * > *:first-child {
    padding-left: 20px;
}

.table > :not(caption) > * > *:last-child {
    padding-right: 20px;
}

.table-hover > tbody > tr:hover > * {
    --bs-table-bg-state: rgba(37, 99, 235, 0.04);
}

.table tr.cursor-pointer:active > * {
    --bs-table-bg-state: rgba(37, 99, 235, 0.08);
}

.table-sm > :not(caption) > * > * {
    padding: 9px 12px;
}

.table-responsive {
    border-radius: inherit;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.card > .table-responsive:last-child,
.card > .card-body.p-0:last-child,
.card > .card-body.p-0 > .table-responsive:last-child {
    border-bottom-left-radius: calc(var(--radius-xl) - 1px);
    border-bottom-right-radius: calc(var(--radius-xl) - 1px);
}

/* ===== 10. Badges ===== */
.badge {
    --bs-badge-padding-x: 10px;
    --bs-badge-padding-y: 5px;
    --bs-badge-font-size: 12px;
    --bs-badge-font-weight: 600;
    --bs-badge-border-radius: 999px;
    letter-spacing: 0.01em;
    line-height: 1.25;
    vertical-align: middle;
}

.badge.bg-warning:not([class*="text-"]) {
    color: #3d2800;
}

.badge.bg-light:not([class*="text-"]) {
    color: var(--text-body);
}

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge-status::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex: 0 0 auto;
}

/* Status da OS */
.badge-pendente_validacao { background: #fef3c7; color: #854d0e; }
.badge-aberta { background: #dbeafe; color: #1e40af; }
.badge-agendada { background: #e0e7ff; color: #3730a3; }
.badge-em_deslocamento { background: #fef3c7; color: #92400e; }
.badge-em_atendimento { background: #ffedd5; color: #c2410c; }
.badge-aguardando_pecas { background: #fee2e2; color: #b91c1c; }
.badge-peca_disponivel { background: #dcfce7; color: #166534; }
.badge-aguardando_aprovacao { background: #fae8ff; color: #86198f; }
.badge-concluida { background: #d1fae5; color: #065f46; }
.badge-cancelada { background: #f1f5f9; color: #475569; }
.badge-faturada { background: #cffafe; color: #0e7490; }

/* Prioridade */
.badge-baixa { background: #d1fae5; color: #065f46; }
.badge-normal { background: #fef3c7; color: #92400e; }
.badge-alta { background: #ffedd5; color: #c2410c; }
.badge-urgente { background: #fee2e2; color: #b91c1c; }

/* Badges suaves */
.badge-soft-primary { background: #e8efff; color: #1e40af; }
.badge-soft-success { background: #e3f6ee; color: #065f46; }
.badge-soft-warning { background: #fff4dc; color: #7a4b00; }
.badge-soft-danger { background: #fde8e8; color: #991b1b; }
.badge-soft-info { background: #e0f4f8; color: #155e75; }
.badge-soft-purple { background: #f1eafe; color: #5b21b6; }
.badge-soft-secondary { background: #eef2f7; color: #475569; }

/* ===== 11. Botões ===== */
.btn {
    --bs-btn-padding-x: 18px;
    --bs-btn-padding-y: 9px;
    --bs-btn-font-family: var(--font-sans);
    --bs-btn-font-size: 14.5px;
    --bs-btn-font-weight: 600;
    --bs-btn-line-height: 1.4;
    --bs-btn-border-radius: 12px;
    --bs-btn-focus-box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    letter-spacing: -0.005em;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.btn > .bi {
    line-height: 1;
}

.btn:active {
    transform: scale(0.98);
}

.btn-sm,
.btn-group-sm > .btn {
    --bs-btn-padding-y: 5px;
    --bs-btn-padding-x: 12px;
    --bs-btn-font-size: 13px;
    --bs-btn-border-radius: 10px;
    min-height: 34px;
    gap: 6px;
}

.btn-lg,
.btn-group-lg > .btn {
    --bs-btn-padding-y: 13px;
    --bs-btn-padding-x: 24px;
    --bs-btn-font-size: 16px;
    --bs-btn-border-radius: 14px;
    min-height: 52px;
}

.btn-link {
    min-height: 0;
    font-weight: 600;
}

.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: #2563eb;
    --bs-btn-border-color: #2563eb;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #1d4ed8;
    --bs-btn-hover-border-color: #1d4ed8;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #1e40af;
    --bs-btn-active-border-color: #1e40af;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #2563eb;
    --bs-btn-disabled-border-color: #2563eb;
    box-shadow: var(--shadow-primary);
}

.btn-secondary {
    --bs-btn-color: #fff;
    --bs-btn-bg: #64748b;
    --bs-btn-border-color: #64748b;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #475569;
    --bs-btn-hover-border-color: #475569;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #334155;
    --bs-btn-active-border-color: #334155;
    --bs-btn-disabled-bg: #94a3b8;
    --bs-btn-disabled-border-color: #94a3b8;
}

/* Verde e ciano um tom mais escuros: texto branco com contraste AA, legível ao ar livre */
.btn-success {
    --bs-btn-color: #fff;
    --bs-btn-bg: #047857;
    --bs-btn-border-color: #047857;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #065f46;
    --bs-btn-hover-border-color: #065f46;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #064e3b;
    --bs-btn-active-border-color: #064e3b;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #047857;
    --bs-btn-disabled-border-color: #047857;
    box-shadow: 0 10px 20px -12px rgba(4, 120, 87, 0.8);
}

.btn-danger {
    --bs-btn-color: #fff;
    --bs-btn-bg: #dc2626;
    --bs-btn-border-color: #dc2626;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #b91c1c;
    --bs-btn-hover-border-color: #b91c1c;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #991b1b;
    --bs-btn-active-border-color: #991b1b;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #dc2626;
    --bs-btn-disabled-border-color: #dc2626;
    box-shadow: 0 10px 20px -12px rgba(220, 38, 38, 0.8);
}

.btn-warning {
    --bs-btn-color: #3d2800;
    --bs-btn-bg: #fbbf24;
    --bs-btn-border-color: #fbbf24;
    --bs-btn-hover-color: #2b1c00;
    --bs-btn-hover-bg: #f59e0b;
    --bs-btn-hover-border-color: #f59e0b;
    --bs-btn-active-color: #2b1c00;
    --bs-btn-active-bg: #d97706;
    --bs-btn-active-border-color: #d97706;
    --bs-btn-disabled-color: #3d2800;
    --bs-btn-disabled-bg: #fcd34d;
    --bs-btn-disabled-border-color: #fcd34d;
    box-shadow: 0 10px 20px -12px rgba(217, 119, 6, 0.8);
}

.btn-info {
    --bs-btn-color: #fff;
    --bs-btn-bg: #0e7490;
    --bs-btn-border-color: #0e7490;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #155e75;
    --bs-btn-hover-border-color: #155e75;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #164e63;
    --bs-btn-active-border-color: #164e63;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #0e7490;
    --bs-btn-disabled-border-color: #0e7490;
    box-shadow: 0 10px 20px -12px rgba(14, 116, 144, 0.8);
}

.btn-dark {
    --bs-btn-color: #fff;
    --bs-btn-bg: #0f1d4a;
    --bs-btn-border-color: #0f1d4a;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #16296b;
    --bs-btn-hover-border-color: #16296b;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #0b1533;
    --bs-btn-active-border-color: #0b1533;
}

.btn-light {
    --bs-btn-color: var(--text-body);
    --bs-btn-bg: #eef2f7;
    --bs-btn-border-color: #eef2f7;
    --bs-btn-hover-color: var(--text-color);
    --bs-btn-hover-bg: #e2e8f0;
    --bs-btn-hover-border-color: #e2e8f0;
    --bs-btn-active-color: var(--text-color);
    --bs-btn-active-bg: #d5dde8;
    --bs-btn-active-border-color: #d5dde8;
}

.btn-outline-primary {
    --bs-btn-color: #2563eb;
    --bs-btn-border-color: #bcd0fb;
    --bs-btn-bg: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #2563eb;
    --bs-btn-hover-border-color: #2563eb;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #1d4ed8;
    --bs-btn-active-border-color: #1d4ed8;
    --bs-btn-disabled-color: #2563eb;
    --bs-btn-disabled-border-color: #bcd0fb;
}

.btn-outline-secondary {
    --bs-btn-color: var(--text-body);
    --bs-btn-border-color: var(--border-strong);
    --bs-btn-bg: #fff;
    --bs-btn-hover-color: var(--text-color);
    --bs-btn-hover-bg: #f1f5f9;
    --bs-btn-hover-border-color: #c5cfdc;
    --bs-btn-active-color: var(--text-color);
    --bs-btn-active-bg: #e2e8f0;
    --bs-btn-active-border-color: #c5cfdc;
    --bs-btn-disabled-color: var(--text-soft);
    --bs-btn-disabled-border-color: var(--border-color);
}

.btn-outline-success {
    --bs-btn-color: #047857;
    --bs-btn-border-color: #a7e3cb;
    --bs-btn-bg: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #059669;
    --bs-btn-hover-border-color: #059669;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #047857;
    --bs-btn-active-border-color: #047857;
}

.btn-outline-danger {
    --bs-btn-color: #b91c1c;
    --bs-btn-border-color: #f5b5b5;
    --bs-btn-bg: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #dc2626;
    --bs-btn-hover-border-color: #dc2626;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #b91c1c;
    --bs-btn-active-border-color: #b91c1c;
}

.btn-outline-warning {
    --bs-btn-color: #a15c00;
    --bs-btn-border-color: #f9d48a;
    --bs-btn-bg: #fff;
    --bs-btn-hover-color: #2b1c00;
    --bs-btn-hover-bg: #fbbf24;
    --bs-btn-hover-border-color: #fbbf24;
    --bs-btn-active-color: #2b1c00;
    --bs-btn-active-bg: #f59e0b;
    --bs-btn-active-border-color: #f59e0b;
}

.btn-outline-info {
    --bs-btn-color: #0e7490;
    --bs-btn-border-color: #9edcea;
    --bs-btn-bg: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #0891b2;
    --bs-btn-hover-border-color: #0891b2;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #0e7490;
    --bs-btn-active-border-color: #0e7490;
}

.btn-outline-dark {
    --bs-btn-color: var(--brand-navy-800);
    --bs-btn-border-color: #c5cfdc;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--brand-navy-800);
    --bs-btn-hover-border-color: var(--brand-navy-800);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--brand-navy-900);
    --bs-btn-active-border-color: var(--brand-navy-900);
}

.btn-outline-light {
    --bs-btn-color: #fff;
    --bs-btn-border-color: rgba(255, 255, 255, 0.5);
    --bs-btn-hover-color: var(--brand-navy-800);
    --bs-btn-hover-bg: #fff;
    --bs-btn-hover-border-color: #fff;
    --bs-btn-active-color: var(--brand-navy-800);
    --bs-btn-active-bg: #fff;
    --bs-btn-active-border-color: #fff;
}

.btn-purple {
    --bs-btn-color: #fff;
    --bs-btn-bg: #7c3aed;
    --bs-btn-border-color: #7c3aed;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #6d28d9;
    --bs-btn-hover-border-color: #6d28d9;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #5b21b6;
    --bs-btn-active-border-color: #5b21b6;
}

.btn-outline-purple {
    --bs-btn-color: #6d28d9;
    --bs-btn-border-color: #d4c2fb;
    --bs-btn-bg: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #7c3aed;
    --bs-btn-hover-border-color: #7c3aed;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #6d28d9;
    --bs-btn-active-border-color: #6d28d9;
    color: var(--bs-btn-color);
    border-color: var(--bs-btn-border-color);
}

.btn-pill {
    --bs-btn-border-radius: 999px;
}

.btn-group {
    border-radius: 12px;
}

.btn-group > .btn {
    box-shadow: none;
}

.btn-group-sm {
    border-radius: 10px;
}

/* Controle segmentado (grupos de radio/btn-check) */
.segmented {
    display: inline-flex;
    padding: 4px;
    gap: 4px;
    background: var(--surface-3);
    border-radius: 14px;
}

.segmented .btn {
    --bs-btn-bg: transparent;
    --bs-btn-border-color: transparent;
    --bs-btn-color: var(--text-muted);
    --bs-btn-hover-bg: rgba(255, 255, 255, 0.7);
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-bg: #fff;
    --bs-btn-active-color: var(--primary-color);
    --bs-btn-active-border-color: transparent;
    border-radius: 11px !important;
    box-shadow: none;
}

.segmented .btn.active,
.segmented .btn-check:checked + .btn {
    background: #fff;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* ===== 12. Formulários ===== */
.form-control,
.form-select {
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-strong);
    font-size: 14.5px;
    font-family: inherit;
    color: var(--text-color);
    background-color: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.form-select {
    padding-right: 40px;
    background-position: right 14px center;
}

textarea.form-control {
    min-height: 88px;
    line-height: 1.5;
}

textarea.form-control[rows="1"],
textarea.form-control[rows="2"] {
    min-height: 64px;
}

.form-control:focus,
.form-select:focus {
    border-color: #8fb0f7;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.13);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-soft);
}

.form-control:disabled,
.form-control[readonly],
.form-select:disabled {
    background-color: var(--surface-2);
    color: var(--text-muted);
}

.form-control-sm,
.form-select-sm {
    min-height: 36px;
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 10px;
}

.form-select-sm {
    padding-right: 32px;
    background-position: right 10px center;
}

.form-control-lg,
.form-select-lg {
    min-height: 52px;
    font-size: 16px;
    border-radius: 14px;
}

.form-control-color {
    min-height: 44px;
    padding: 6px;
}

.form-control[type="file"] {
    padding: 8px 10px;
    line-height: 1.8;
}

.form-label {
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 13.5px;
    color: var(--text-body);
}

.form-text {
    font-size: 12.5px;
    color: var(--text-muted);
}

.input-group > .form-control,
.input-group > .form-select {
    min-height: 44px;
}

.input-group-text {
    border-radius: 12px;
    border-color: var(--border-strong);
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 14px;
    padding: 0 14px;
}

.input-group > .btn {
    box-shadow: none;
}

.form-check-input {
    width: 1.2em;
    height: 1.2em;
    margin-top: 0.18em;
    border: 1.5px solid #b8c4d3;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
    border-color: #8fb0f7;
}

.form-check-label {
    cursor: pointer;
}

.form-switch {
    padding-left: 3em; /* espaço entre o trilho e o texto (no desktop ficava colado) */
}

.form-switch .form-check-input {
    width: 2.5em;
    height: 1.35em;
    margin-top: 0.1em;
    margin-left: -3em;
    cursor: pointer;
}

.form-switch .form-check-input:checked {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.form-switch .form-check-label {
    cursor: pointer;
    user-select: none;
}

.was-validated .form-control:invalid,
.form-control.is-invalid {
    border-color: #f19a9a;
}

/* ===== 13. Abas e pílulas ===== */
.nav-tabs {
    --bs-nav-tabs-border-color: var(--border-color);
    --bs-nav-tabs-link-active-color: var(--primary-color);
    --bs-nav-tabs-link-active-bg: transparent;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.nav-tabs::-webkit-scrollbar {
    display: none;
}

.nav-tabs .nav-link {
    border: 0;
    border-bottom: 2.5px solid transparent;
    border-radius: 0;
    color: var(--text-muted);
    font-weight: 600;
    padding: 12px 16px;
    min-height: 46px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: -1px;
}

.nav-tabs .nav-link:hover {
    color: var(--text-color);
    border-bottom-color: var(--border-strong);
    isolation: auto;
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
    color: var(--primary-color);
    background: transparent;
    border-bottom-color: var(--primary-color);
}

.nav-pills {
    --bs-nav-pills-border-radius: 12px;
    --bs-nav-pills-link-active-bg: var(--primary-color);
    gap: 6px;
}

.nav-pills .nav-link {
    color: var(--text-body);
    font-weight: 600;
    padding: 10px 16px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-pills .nav-link:hover {
    background: var(--surface-3);
    color: var(--text-color);
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: var(--shadow-primary);
}

/* ===== 14. Dropdowns ===== */
.dropdown-menu {
    --bs-dropdown-border-radius: 16px;
    --bs-dropdown-padding-y: 6px;
    --bs-dropdown-font-size: 14px;
    background-color: var(--card-bg) !important;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    z-index: 1060 !important;
    padding: 6px;
    min-width: 12rem;
}

.dropdown-menu .dropdown-item {
    color: var(--text-body) !important;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 40px;
    transition: var(--transition-fast);
}

.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus {
    background-color: var(--surface-3) !important;
    color: var(--text-color) !important;
}

.dropdown-menu .dropdown-item.active,
.dropdown-menu .dropdown-item:active {
    background-color: var(--primary-light) !important;
    color: var(--primary-color) !important;
}

.dropdown-menu .dropdown-item.text-danger {
    color: var(--danger-color) !important;
}

.dropdown-menu .dropdown-item.text-danger:hover {
    background-color: var(--danger-light) !important;
    color: var(--danger-color) !important;
}

.dropdown-menu .dropdown-item i {
    width: 22px;
    text-align: center;
}

.dropdown-menu .dropdown-divider {
    border-color: var(--border-color);
    margin: 6px 4px;
}

.dropdown-header {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    padding: 8px 12px;
}

.dropdown-item-text {
    padding: 8px 12px;
}

.btn-group.btn-group-sm {
    position: static;
}

.btn-group .dropdown-menu {
    position: absolute !important;
}

.card-body.p-0 {
    overflow: visible !important;
}

/* ===== 15. Notificações ===== */
.notification-dropdown {
    width: 360px;
    max-width: calc(100vw - 24px);
    max-height: 440px;
    overflow: hidden;
    padding: 0 !important;
}

.notification-dropdown .dropdown-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
    font-size: 14px;
}

.notification-list {
    max-height: 340px;
    overflow-y: auto;
}

/* ===== 16. Modais ===== */
.modal {
    --bs-modal-border-radius: 22px;
    --bs-modal-inner-border-radius: 21px;
    --bs-modal-border-width: 0;
    --bs-modal-header-padding: 18px 24px;
    --bs-modal-padding: 24px;
    --bs-modal-footer-gap: 8px;
    --bs-modal-box-shadow: var(--shadow-lg);
}

.modal-backdrop {
    --bs-backdrop-bg: #0b1533;
    --bs-backdrop-opacity: 0.5;
}

.modal-content {
    border: none;
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 18px 24px;
    gap: 12px;
}

.modal-header.border-0 {
    border-bottom: 0;
}

.modal-title {
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.015em;
    display: flex;
    align-items: center;
    gap: 4px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 14px 24px;
    background: var(--surface-2);
    gap: 8px;
}

.modal-footer > * {
    margin: 0;
}

.modal-footer.border-0 {
    border-top: 0;
}

.btn-close {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 12px;
    background-size: 13px;
    opacity: 0.6;
    flex: 0 0 auto;
}

.btn-close:hover {
    opacity: 0.95;
    background-color: rgba(15, 23, 42, 0.06);
}

.btn-close-white:hover {
    background-color: rgba(255, 255, 255, 0.16);
}

.modal-header .btn-close {
    margin: -6px -10px -6px auto;
}

.bg-gradient-warning {
    background: var(--gradient-warning) !important;
}

.bg-gradient-success {
    background: var(--gradient-success) !important;
}

.bg-gradient-primary {
    background: var(--gradient-primary) !important;
}

.bg-gradient-danger {
    background: var(--gradient-danger) !important;
}

.bg-gradient-info {
    background: var(--gradient-info) !important;
}

.bg-gradient-navy {
    background: var(--gradient-hero) !important;
    color: #fff;
}

/* ===== 17. Alertas, toasts, paginação, progresso ===== */
.alert {
    --bs-alert-border-radius: 16px;
    --bs-alert-padding-x: 18px;
    --bs-alert-padding-y: 14px;
    border-width: 1px;
    font-size: 14px;
}

.alert-primary { --bs-alert-bg: #eef3ff; --bs-alert-border-color: #d3e0fd; --bs-alert-color: #1e3a8a; }
.alert-success { --bs-alert-bg: #ecfbf4; --bs-alert-border-color: #c4ecd9; --bs-alert-color: #065f46; }
.alert-warning { --bs-alert-bg: #fff8e6; --bs-alert-border-color: #fbe3a6; --bs-alert-color: #7a4b00; }
.alert-danger { --bs-alert-bg: #fef1f1; --bs-alert-border-color: #f8cfcf; --bs-alert-color: #991b1b; }
.alert-info { --bs-alert-bg: #ecf8fb; --bs-alert-border-color: #c6e8f0; --bs-alert-color: #155e75; }
.alert-secondary { --bs-alert-bg: #f4f6f9; --bs-alert-border-color: #e2e8f0; --bs-alert-color: #334155; }
.alert-light { --bs-alert-bg: #fff; --bs-alert-border-color: var(--border-color); --bs-alert-color: var(--text-body); }

.alert .alert-link {
    font-weight: 700;
}

.alert-dismissible .btn-close {
    top: 50%;
    transform: translateY(-50%);
    right: 8px;
    padding: 0;
}

.toast-container {
    z-index: 1090;
    padding-bottom: max(16px, env(safe-area-inset-bottom)) !important;
}

.toast {
    --bs-toast-border-radius: 16px;
    --bs-toast-border-color: var(--border-color);
    --bs-toast-box-shadow: var(--shadow-lg);
    --bs-toast-header-bg: #fff;
    --bs-toast-bg: #fff;
    --bs-toast-max-width: 380px;
    font-size: 14px;
    overflow: hidden;
}

.toast-header {
    padding: 10px 8px 4px 16px;
    border-bottom: 0;
    font-weight: 700;
    color: var(--text-color);
}

.toast-body {
    padding: 0 16px 14px;
    color: var(--text-body);
}

.pagination {
    --bs-pagination-border-radius: 10px;
    gap: 6px;
    flex-wrap: wrap;
}

.page-link {
    border: 1px solid var(--border-color);
    border-radius: 10px !important;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-body);
    background: #fff;
    font-weight: 600;
    font-size: 14px;
}

.page-link:hover {
    background: var(--surface-3);
    color: var(--text-color);
    border-color: var(--border-strong);
}

.page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: var(--shadow-primary);
}

.page-item.disabled .page-link {
    background: var(--surface-2);
    color: var(--text-soft);
}

.pagination-sm .page-link {
    min-width: 36px;
    height: 36px;
    font-size: 13px;
}

.progress {
    --bs-progress-height: 8px;
    --bs-progress-border-radius: 999px;
    --bs-progress-bg: var(--surface-3);
    --bs-progress-bar-bg: var(--primary-color);
}

.progress-bar {
    border-radius: 999px;
}

.list-group {
    --bs-list-group-border-color: #eef2f7;
    --bs-list-group-border-radius: 16px;
    --bs-list-group-item-padding-x: 16px;
    --bs-list-group-item-padding-y: 13px;
    --bs-list-group-action-hover-bg: var(--surface-2);
    --bs-list-group-active-bg: var(--primary-color);
    --bs-list-group-active-border-color: var(--primary-color);
}

.accordion {
    --bs-accordion-border-radius: 16px;
    --bs-accordion-inner-border-radius: 15px;
    --bs-accordion-border-color: var(--border-color);
    --bs-accordion-btn-padding-y: 16px;
    --bs-accordion-btn-padding-x: 20px;
    --bs-accordion-active-bg: #f3f7ff;
    --bs-accordion-active-color: var(--primary-active);
    --bs-accordion-btn-focus-box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.accordion-button {
    font-weight: 700;
    color: var(--text-color);
}

/* ===== 18. Estados (vazio, carregando) ===== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(243, 246, 251, 0.82);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
}

.loading-container {
    padding: 40px;
    text-align: center;
}

.empty-state {
    text-align: center;
    padding: 56px 20px;
}

.empty-state-icon {
    width: 84px;
    height: 84px;
    margin: 0 auto 18px;
    background: linear-gradient(135deg, #eef3ff, #e2e8f0);
    border-radius: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    color: var(--primary-color);
}

.empty-state h5 {
    font-weight: 700;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    max-width: 420px;
    margin: 0 auto;
}

.skeleton {
    background: linear-gradient(90deg, #eef2f7 25%, #e2e8f0 50%, #eef2f7 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== 18b. Componentes de página compartilhados ===== */

/* Barra de ações flutuante no fim de formulários longos (tablet) */
.sticky-actions {
    position: sticky;
    bottom: 12px;
    z-index: 1010;
    margin-top: 24px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: var(--shadow-md);
}

.sticky-actions .sticky-actions-info {
    margin-right: auto;
    font-size: 13px;
    color: var(--text-muted);
}

/* Pares rótulo/valor em páginas de detalhe */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px 20px;
}

.info-item {
    min-width: 0;
}

.info-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.info-value {
    display: block;
    font-weight: 600;
    color: var(--text-color);
    font-size: 14.5px;
    overflow-wrap: anywhere;
}

/* Linha do tempo (histórico de status) */
.timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}

.timeline-item {
    position: relative;
    padding: 0 0 18px 34px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 26px;
    bottom: 2px;
    width: 2px;
    border-radius: 2px;
    background: var(--border-color);
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-dot {
    --tint-rgb: var(--primary-rgb);
    position: absolute;
    left: 0;
    top: 1px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: rgb(var(--tint-rgb));
    background: rgba(var(--tint-rgb), 0.12);
    box-shadow: 0 0 0 3px #fff;
}

.timeline-title {
    font-weight: 700;
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.35;
}

.timeline-meta {
    font-size: 12.5px;
    color: var(--text-muted);
}

.timeline-note {
    margin-top: 6px;
    padding: 8px 12px;
    border-radius: 12px;
    background: var(--surface-2);
    font-size: 13.5px;
    color: var(--text-body);
}

/* Fotos (miniaturas grandes para toque) */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.photo-tile {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    overflow: hidden;
    background: var(--surface-3);
    border: 1px solid var(--border-color);
}

.photo-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-tile .photo-tile-actions {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    gap: 6px;
}

.photo-tile .photo-tile-label {
    position: absolute;
    left: 6px;
    bottom: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(11, 21, 51, 0.7);
    color: #fff;
    font-size: 11.5px;
    font-weight: 600;
}

.photo-add {
    min-height: 120px;
    aspect-ratio: 1 / 1;
    border: 2px dashed var(--border-strong);
    border-radius: 14px;
    background: var(--surface-2);
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.photo-add .bi {
    font-size: 26px;
    color: var(--primary-color);
}

.photo-add:hover,
.photo-add:active {
    border-color: var(--primary-color);
    background: #eef3ff;
}

/* Chips de filtro rápido */
.chip-group {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
}

.chip-group::-webkit-scrollbar {
    display: none;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: #fff;
    color: var(--text-body);
    font-weight: 600;
    font-size: 13.5px;
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition-fast);
    flex: 0 0 auto;
}

.chip:hover {
    border-color: #b9c6d6;
    color: var(--text-color);
}

.chip.active,
.chip[aria-pressed="true"] {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: var(--shadow-primary);
}

.chip-count {
    min-width: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    font-size: 12px;
    line-height: 20px;
    text-align: center;
}

.chip.active .chip-count,
.chip[aria-pressed="true"] .chip-count {
    background: rgba(255, 255, 255, 0.24);
}

@media (pointer: coarse) {
    .chip { min-height: 44px; }
}

/* Botões de contato (ligar / WhatsApp / navegar) */
.contact-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.contact-actions .btn {
    flex: 1 1 140px;
}

/* ===== 19. Componentes legados das páginas (mantidos e refinados) ===== */
.filter-card {
    background: var(--card-bg);
    border: 1px solid #edf1f6;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    padding: 14px 18px;
}

.filter-card > .card-body {
    padding: 0;
}

.filter-card .input-group-text {
    border-color: var(--border-strong);
}

.filter-icon {
    width: 44px;
    height: 44px;
    background: var(--surface-3);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 18px;
}

.section-header {
    padding: 12px 16px;
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid #edf1f6;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}

.section-header h6 {
    font-size: 15.5px;
    font-weight: 800;
    color: var(--text-color);
}

.section-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 17px;
    flex: 0 0 auto;
    box-shadow: var(--shadow-primary);
}

.order-card {
    border: 1px solid #e9eef5 !important;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.order-card.border-start {
    border-left-width: 5px !important;
}

.order-card.border-primary { border-left-color: var(--primary-color) !important; }
.order-card.border-success { border-left-color: #10b981 !important; }
.order-card.border-warning { border-left-color: #f59e0b !important; }
.order-card.border-danger { border-left-color: #ef4444 !important; }
.order-card.border-info { border-left-color: #06b6d4 !important; }

.order-card .card-header {
    background: var(--surface-2);
    border-bottom: 1px solid #eef2f7;
    padding: 12px 16px;
    border-radius: 0 !important;
}

.order-card .card-body {
    padding: 16px;
}

.order-card .card-title {
    font-size: 15.5px;
    font-weight: 800;
    color: var(--text-color);
}

.order-card .card-footer {
    border-top: 1px solid #eef2f7;
    border-radius: 0 !important;
    padding: 12px 16px;
}

.order-card .card-footer .d-flex > .btn {
    flex: 1 1 auto;
}

.product-row {
    background: var(--surface-2);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
}

.available-orders-card {
    border: 1px solid rgba(8, 145, 178, 0.2);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 18px 34px -24px rgba(8, 145, 178, 0.7);
}

.available-orders-header {
    background: var(--gradient-info) !important;
    padding: 16px 20px;
    color: #fff;
    border-bottom: 0;
}

.available-orders-header h6 {
    color: #fff;
}

.available-icon {
    width: 46px;
    height: 46px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
}

.specialties-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 12px;
    background: var(--surface-2);
    border-radius: var(--radius);
    max-height: 260px;
    overflow-y: auto;
}

.specialties-grid .form-check {
    margin: 0;
    padding: 10px 12px 10px 2.4em;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    min-height: 44px;
    display: flex;
    align-items: center;
}

.specialties-grid .form-check:hover {
    border-color: var(--primary-color);
}

.specialties-grid .form-check-input:checked + .form-check-label {
    color: var(--primary-color);
    font-weight: 600;
}

.specialties-grid .form-check-label {
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.technician-specialties {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.technician-specialties .badge {
    font-size: 11px;
    padding: 4px 9px;
    background: #e8efff;
    color: #1e40af;
}

.tech-unavailable {
    opacity: 0.62;
    background: var(--surface-2);
}

.tech-unavailable .card-body {
    filter: grayscale(30%);
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1015; /* acima da barra de ações (1010), abaixo do cabeçalho fixo (1020) e do menu gaveta */
    display: none;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    margin-top: 4px;
    box-shadow: var(--shadow-lg);
    max-height: 320px;
    overflow-y: auto;
    padding: 4px;
}

.autocomplete-dropdown.show {
    display: block;
}

.autocomplete-dropdown .dropdown-item {
    display: block;
    padding: 12px 14px;
    color: var(--text-body);
    text-decoration: none;
    border-radius: 10px;
    border-bottom: 0;
    cursor: pointer;
    transition: var(--transition);
    white-space: normal;
}

.autocomplete-dropdown .dropdown-item:hover,
.autocomplete-dropdown .dropdown-item.active {
    background: var(--surface-3);
}

.category-card {
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.category-icon {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.equipments-page .stat-card {
    min-height: auto;
}

.cursor-pointer {
    cursor: pointer;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* LGPD (Bate Papo) */
.lgpd-stars {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    vertical-align: middle;
}

.lgpd-star {
    color: #f5b800;
    font-size: 10px;
}

.lgpd-star-empty {
    color: #d1d5db;
    font-size: 10px;
}

.chat-header-area .lgpd-stars,
.chat-header .lgpd-stars,
#chatResidentBadge .lgpd-stars {
    gap: 2px;
}

.chat-header-area .lgpd-star,
.chat-header .lgpd-star,
#chatResidentBadge .lgpd-star,
.chat-header-area .lgpd-star-empty,
.chat-header .lgpd-star-empty,
#chatResidentBadge .lgpd-star-empty {
    font-size: 12px;
}

.lgpd-auth-list {
    padding-left: 4px;
}

.lgpd-auth-list div {
    padding: 2px 0;
}

.lgpd-auth-list .bi-check-circle-fill {
    color: var(--success-color);
}

.lgpd-auth-list .bi-circle {
    color: var(--text-muted);
}

/* Urgência (manutenções) */
@keyframes pulse-danger {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.6); transform: scale(1); }
    50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); transform: scale(1.02); }
}

.urgency-badge { transition: all 0.3s ease; }
.urgency-overdue { animation: pulse-danger 1.5s infinite; }
.urgency-today { box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4); }
.urgency-tomorrow { box-shadow: 0 2px 8px rgba(234, 88, 12, 0.4); }
.urgency-soon { box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3); }
.urgency-upcoming { box-shadow: 0 1px 4px rgba(252, 211, 77, 0.3); }
.urgency-week { box-shadow: 0 1px 3px rgba(254, 243, 199, 0.3); }
.urgency-ok { box-shadow: 0 1px 3px rgba(209, 250, 229, 0.3); }

/* ===== 20. Animações ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.3s ease; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse { animation: pulse 2s infinite; }

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin {
    animation: spin 1s linear infinite;
    display: inline-block;
}

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

/* ===== 21. Efeitos de hover só em dispositivos com mouse ===== */
@media (hover: hover) and (pointer: fine) {
    .card:hover { box-shadow: var(--shadow-hover); }
    .stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
    .order-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
    .mini-stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
    .category-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
    .quick-action:hover { transform: translateY(-2px); box-shadow: 0 18px 30px -18px rgba(15, 23, 42, 0.75); }
    a.kpi-tile:hover { transform: translateY(-2px); }
    .btn-primary:hover { box-shadow: 0 12px 24px -10px rgba(37, 99, 235, 0.75); }
}

/* Feedback de toque */
.stat-card[onclick]:active,
a.stat-card:active,
.quick-action:active,
a.kpi-tile:active,
.kpi-card[onclick]:active,
a.kpi-card:active,
.order-card:active {
    transform: scale(0.985);
}

/* ===== 22. Tablet / toque ===== */
@media (pointer: coarse) {
    .btn { min-height: 46px; min-width: 46px; }
    .btn-sm,
    .btn-group-sm > .btn { min-height: 40px; min-width: 40px; --bs-btn-padding-x: 14px; }
    .btn-link { min-width: 0; }
    .btn-lg,
    .btn-group-lg > .btn { min-height: 54px; }
    .btn-link { min-height: 40px; }

    .form-control,
    .form-select,
    .input-group > .form-control,
    .input-group > .form-select {
        min-height: 48px;
        font-size: 16px;
    }

    .form-control-sm,
    .form-select-sm {
        min-height: 40px;
        font-size: 15px;
    }

    .input-group-text {
        font-size: 15px;
    }

    .form-check {
        min-height: 40px;
        padding-left: 2.1em;
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
    }

    .form-check .form-check-input {
        width: 1.45em;
        height: 1.45em;
        margin-left: -2.1em;
        margin-top: 0;
        flex: 0 0 auto;
    }

    .form-check-inline {
        display: inline-flex;
        margin-right: 1.25rem;
    }

    .form-switch {
        padding-left: 3.4em;
    }

    .form-switch .form-check-input {
        width: 2.9em;
        height: 1.6em;
        margin-left: -3.4em;
    }

    .dropdown-menu .dropdown-item { min-height: 46px; }
    .page-link,
    .pagination-sm .page-link { min-width: 44px; height: 44px; }
    .nav-tabs .nav-link,
    .nav-pills .nav-link { min-height: 48px; }
    .btn-close { width: 44px; height: 44px; }
    .list-group-item-action { min-height: 52px; }
    .table > tbody > tr > td { padding-top: 15px; padding-bottom: 15px; }
}

/* ===== 23. Layout responsivo ===== */

/* Trilho de ícones (tablet paisagem 992–1199 ou recolhido pelo usuário) */
@media (min-width: 992px) {
    html.sb-rail .main-content {
        margin-left: calc(var(--sidebar-collapsed) + var(--sidebar-gap) * 2);
    }

    html.sb-rail .sidebar:not(.active) {
        width: var(--sidebar-collapsed);
    }

    html.sb-rail .sidebar:not(.active) .sidebar-header {
        flex-direction: column;
        justify-content: flex-start;
        padding: 16px 0 10px;
        gap: 10px;
        min-height: 0;
    }

    html.sb-rail .sidebar:not(.active) .sidebar-brand {
        gap: 0;
    }

    html.sb-rail .sidebar:not(.active) .brand-text,
    html.sb-rail .sidebar:not(.active) .nav-link span,
    html.sb-rail .sidebar:not(.active) .nav-link .nav-badge,
    html.sb-rail .sidebar:not(.active) .sidebar-promo,
    html.sb-rail .sidebar:not(.active) .user-info,
    html.sb-rail .sidebar:not(.active) .sidebar-logout {
        display: none;
    }

    html.sb-rail .sidebar:not(.active) .sidebar-menu {
        padding: 4px 14px 12px;
    }

    html.sb-rail .sidebar:not(.active) .nav-link {
        justify-content: center;
        padding: 0;
        min-height: 50px;
    }

    html.sb-rail .sidebar:not(.active) .nav-link i {
        font-size: 20px;
    }

    html.sb-rail .sidebar:not(.active) .nav-header {
        font-size: 0;
        height: 1px;
        padding: 0;
        margin: 12px 8px;
        background: rgba(255, 255, 255, 0.1);
    }

    html.sb-rail .sidebar:not(.active) .nav-header:first-child {
        display: none;
    }

    html.sb-rail .sidebar:not(.active) .sidebar-footer {
        padding: 10px 14px 14px;
        align-items: center;
    }

    html.sb-rail .sidebar:not(.active) .sidebar-user {
        padding: 6px;
        background: transparent;
    }

    html.sb-rail .sidebar:not(.active) .sidebar-collapse-btn {
        justify-content: center;
        padding: 0;
    }

    html.sb-rail .sidebar:not(.active) .sidebar-collapse-btn span {
        display: none;
    }

    html.sb-rail .sidebar:not(.active) .sidebar-collapse-btn .bi {
        transform: rotate(180deg);
    }

    html.sb-rail .sidebar:not(.active) .sidebar-footer {
        border-top-color: transparent;
    }

    /* menu expandido sobre o conteúdo (a partir do trilho) */
    html.sb-rail .sidebar.active {
        box-shadow: 0 30px 70px -20px rgba(11, 21, 51, 0.7);
    }
}

@media (max-width: 1439.98px) {
    .user-chip-email {
        display: none;
    }

    .user-chip-text {
        max-width: 130px;
    }
}

@media (max-width: 1199.98px) {
    .header-search input {
        width: 200px;
    }

    .user-chip-text {
        display: none;
    }

    .user-chip {
        padding: 4px;
    }

    .user-chip .bi-chevron-down {
        display: none;
    }

    .hero-stats {
        gap: 12px;
    }

    .hero-stat {
        padding: 14px 16px;
    }

    .hero-stat-value {
        font-size: 24px;
    }
}

/* Gaveta (tablet retrato e celular) */
@media (max-width: 991.98px) {
    :root {
        --content-pad: 16px;
    }

    .sidebar {
        transform: translateX(calc(-100% - 2 * var(--sidebar-gap)));
        box-shadow: none;
        width: min(var(--sidebar-width), calc(100vw - 48px));
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 0 30px 70px -20px rgba(11, 21, 51, 0.7);
    }

    .sidebar-collapse-btn {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
    }

    .content,
    .content-wrapper {
        padding: 16px var(--content-pad) 32px;
    }

    .header {
        padding: 10px var(--content-pad) 0;
    }

    .header-inner {
        padding: 0 8px 0 8px;
        height: 64px;
    }

    .header-menu-btn {
        display: inline-flex !important;
    }

    .header-search {
        display: none;
    }

    .panel-header,
    .hero {
        padding: 20px;
        border-radius: var(--radius-xl);
    }

    .panel-title {
        font-size: 21px;
    }

    .panel-title > i.bi:first-child {
        width: 42px;
        height: 42px;
        font-size: 19px;
        border-radius: 13px;
    }

    .panel-title + .panel-subtitle {
        margin-left: 56px;
    }

    .hero-greeting {
        font-size: 24px;
    }

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

    .table th,
    .table td {
        font-size: 13.5px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-content h2,
    .stat-content h3,
    .stat-number,
    .stat-content .stat-number {
        font-size: 24px;
    }

    /* Modais grandes ocupam a largura útil do tablet em retrato (com 16px de margem de cada lado) */
    .modal-lg,
    .modal-xl {
        --bs-modal-width: calc(100vw - 32px);
        max-width: min(760px, calc(100vw - 32px));
    }
}

@media (max-width: 767.98px) {
    .header-new-os span {
        display: none;
    }

    .header-new-os {
        width: 44px;
        padding: 0 !important;
        border-radius: 14px !important;
    }

    .status-indicator {
        display: none;
    }

    .page-header {
        margin-bottom: 16px;
    }

    .page-title {
        font-size: 22px;
    }

    .panel-title + .panel-subtitle {
        margin-left: 0;
    }

    .card-header,
    .card-body,
    .card-footer {
        padding: 16px;
    }

    .list-row {
        padding: 12px 16px;
    }

    .btn-group-mobile {
        flex-direction: column;
        width: 100%;
    }

    .btn-group-mobile .btn {
        width: 100%;
        border-radius: var(--radius) !important;
        margin-bottom: 8px;
    }

    .modal-dialog {
        margin: 8px;
    }

    .modal-footer {
        flex-wrap: wrap;
    }

    .modal-footer > .btn {
        flex: 1 1 auto;
    }

    .specialties-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .kpi-tiles {
        gap: 10px;
    }
}

@media (max-width: 575.98px) {
    .header .page-title {
        font-size: 17px;
    }

    .header-subtitle {
        display: none;
    }

    .hero-greeting {
        font-size: 21px;
    }

    .hero-stat-value {
        font-size: 21px;
    }

    .stat-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .specialties-grid {
        grid-template-columns: 1fr;
    }

    .table .d-none-mobile {
        display: none !important;
    }

    .quick-actions {
        --qa-cols: 2;
    }
}

/* PWA instalado (tela inicial): botão voltar no header */
@media (display-mode: standalone) {
    .header-back-btn {
        display: inline-flex !important;
    }

    body.is-root .header-back-btn {
        display: none !important;
    }
}

/* Áreas seguras (iPad/iPhone instalados) */
@supports (padding: max(0px)) {
    .sidebar {
        top: max(var(--sidebar-gap), env(safe-area-inset-top));
        bottom: max(var(--sidebar-gap), env(safe-area-inset-bottom));
        left: max(var(--sidebar-gap), env(safe-area-inset-left));
    }
}

/* ===== 23b. Ajustes globais pedidos pelas telas (redesign, ondas 1 e 2) ===== */

/* Modais brancos (o Bootstrap herdava o fundo acinzentado da página em --bs-modal-bg) */
.modal {
    --bs-modal-bg: #fff;
}

/* Tablet em paisagem (992–1199px): modal-xl aproveita a largura (o Bootstrap mantinha 800px) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .modal-xl {
        --bs-modal-width: min(1140px, calc(100vw - 48px));
    }
}

/* Botão claro no rodapé do modal: branco com borda, para não sumir no fundo do rodapé */
.modal-footer .btn-light {
    --bs-btn-bg: #fff;
    --bs-btn-border-color: var(--border-strong);
    --bs-btn-hover-bg: #f1f5f9;
    --bs-btn-hover-border-color: #c5cfdc;
}

/* Amarelo de alerta usado como TEXTO: tom mais escuro, legível ao sol (ícones e indicadores seguem vivos).
   :where() deixa a especificidade baixa: vence o .text-warning do Bootstrap pela ordem, mas as telas
   que já escolheram um tom próprio (ex.: chip de SLA do Meu Painel) continuam mandando. */
:where(p, span, small, strong, td, li, div).text-warning:where(:not(.badge, .spinner-border, .spinner-grow)) {
    color: #a15c00 !important;
}

/* Selo suave laranja (faltava na família .badge-soft-*) */
.badge-soft-orange {
    background: #ffeee5;
    color: #9a3412;
}

/* Ícone com margem (me-1, me-2, ms-1, ms-2) dentro de botão: o .btn já tem gap, a margem dobrava o espaço */
.btn > .bi.me-1,
.btn > .bi.me-2,
.btn > .bi.ms-1,
.btn > .bi.ms-2,
.btn > .spinner-border.me-1,
.btn > .spinner-border.me-2 {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Controle segmentado sobre o banner escuro */
.panel-header .segmented,
.hero .segmented {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.panel-header .segmented .btn,
.hero .segmented .btn {
    --bs-btn-color: rgba(255, 255, 255, 0.9);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: rgba(255, 255, 255, 0.14);
}

.panel-header .segmented .btn.active,
.panel-header .segmented .btn-check:checked + .btn,
.hero .segmented .btn.active,
.hero .segmented .btn-check:checked + .btn {
    background: #fff;
    color: var(--brand-navy-700);
}

/* Breadcrumb dentro do banner escuro: legível e com alvo de toque */
.panel-header .breadcrumb {
    --bs-breadcrumb-divider-color: rgba(255, 255, 255, 0.45);
    --bs-breadcrumb-item-active-color: #fff;
    margin-bottom: 6px;
}

.panel-header .breadcrumb a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    color: rgba(255, 255, 255, 0.78);
}

/* Link de texto simples: a margem negativa estica o alvo de toque sem empurrar o título.
   Link com classe própria (ex.: a pílula "Clientes" de Unidades) já desenha a caixa de 40px. */
.panel-header .breadcrumb a:not([class]) {
    margin: -10px 0;
}

.panel-header .breadcrumb a:hover {
    color: #fff;
}

.panel-header .breadcrumb-item.active {
    color: #fff;
    font-weight: 600;
}

/* Itens do autocompletar (cliente/produto) nos formulários */
.autocomplete-dropdown .autocomplete-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-body);
}

.autocomplete-dropdown .autocomplete-item:hover,
.autocomplete-dropdown .autocomplete-item:active {
    background: var(--surface-3);
}

.autocomplete-dropdown .autocomplete-item strong {
    display: block;
    color: var(--text-color);
    font-weight: 700;
}

.autocomplete-dropdown .autocomplete-item small {
    display: block;
    color: var(--text-muted);
    font-size: 12.5px;
}

/* Botão "adicionar foto" como <button> */
button.photo-add {
    width: 100%;
    font-family: inherit;
}

/* Utilitário que o Bootstrap 5.3 não tem (texto truncado dentro de flex) */
.min-w-0 {
    min-width: 0 !important;
}

/* Campos focados não ficam escondidos atrás do cabeçalho fixo nem da barra de ações */
html {
    scroll-padding-top: calc(var(--header-height) + 28px);
}

html:has(.sticky-actions) {
    scroll-padding-bottom: 112px;
}

/* Barra de ações respeita a área segura do iPad instalado como app */
@supports (padding: max(0px)) {
    .sticky-actions {
        bottom: max(12px, env(safe-area-inset-bottom));
    }
}

/* Select de filtros: menos folga à direita para o texto caber nas colunas estreitas
   (o texto continua alinhado a 14px, como nos campos de busca e data do mesmo card) */
.filter-card .form-select {
    padding-right: 32px;
    background-position: right 10px center;
}

/* Switch dentro de ladrilho flex (equipamentos, categorias): no mouse o texto encostava no trilho.
   No toque o .form-check já tem gap. */
@media (pointer: fine) {
    .form-check.form-switch {
        column-gap: 0.5em;
    }
}

/* Aviso flutuante (toast) com modal visível: vai para o topo, centralizado.
   No canto de baixo ele cobria por ~5 s os botões do rodapé do modal e engolia o toque.
   Usa .modal.show (sai na hora em que o modal começa a fechar) e não body.modal-open (sai só no fim
   da animação): assim o aviso de "salvo" de um modal que fecha já nasce no lugar final, sem pular. */
body:has(.modal.show) .toast-container.bottom-0 {
    top: max(12px, env(safe-area-inset-top));
    bottom: auto !important;
    right: auto !important;
    left: 50%;
    transform: translateX(-50%);
    padding: 0 12px !important;
}

/* Conteúdo de modal fechando (animação de saída, já sem .show) não aceita toque: com rede rápida a trava de
   envio já tinha sido liberada e um 2º toque no botão ainda visível gravava de novo (ex.: pagamento somado em
   dobro). O próprio .modal continua absorvendo o toque, para ele não atravessar até um modal de baixo. */
.modal.fade:not(.show) .modal-content {
    pointer-events: none;
}

/* Menu de ações de uma lista aberto e a lista rolada: o menu (z 1060) passava por cima do cabeçalho fixo
   (z 1020) e o toque no sino/avatar caía num item do menu. Enquanto ele está aberto, o cabeçalho sobe.
   Sem modal aberto: os modais ficam dentro do main e o cabeçalho não pode passar por cima do fundo deles. */
body:has(main.content .dropdown-menu.show):not(:has(.modal.show)) .header {
    z-index: 1096;
}

/* Com modal visível o aviso fica um pouco mais estreito: com 380px ele encostava no X dos modais de 500px */
body:has(.modal.show) .toast {
    --bs-toast-max-width: 340px;
}

/* Configurações tem container próprio (sem .bottom-0) e, no retrato, o settings.js põe um top inline:
   com modal aberto (Meu Perfil, Alterar Senha) o aviso cobria o campo a corrigir. */
body:has(.modal.show) .toast-container.settings-toasts {
    top: max(12px, env(safe-area-inset-top)) !important;
    right: auto !important;
    left: 50%;
    transform: translateX(-50%);
    padding: 0 12px !important;
}

/* Telas com barra de ações fixa (Salvar/Cancelar): o aviso fica logo abaixo do cabeçalho, centralizado.
   Embaixo ele cobria o Salvar; à direita, o "Voltar" e o liga/desliga do banner. */
html:has(.sticky-actions) body:not(:has(.modal.show)) .toast-container.bottom-0 {
    top: calc(var(--sidebar-gap) + var(--header-height) - 8px);
    bottom: auto !important;
    right: auto !important;
    left: 50%;
    transform: translateX(-50%);
}

@media (pointer: coarse) {
    /* Rótulo longo fica ao lado do controle, sem cair para a linha de baixo */
    .form-check:not(.form-check-inline) > .form-check-label {
        flex: 1 1 0;
        min-width: 0;
    }
}

/* ===== 24. Impressão ===== */
@media print {
    .sidebar,
    .header,
    .mobile-menu-btn,
    .sidebar-overlay,
    .btn,
    .filter-card,
    .toast-container {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .content,
    .content-wrapper {
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .panel-header,
    .hero {
        background: #fff !important;
        color: #000;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .panel-header *,
    .hero * {
        color: #000 !important;
    }
}
