/* 
   OficinaOS - Core Design System 
   Premium Responsive Management System
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@400;500;600;700;800;900&display=swap');

/* Global Scrollbar Hide - Premium Look (Chrome, Safari, Brave, Firefox, Edge) */
*,
*::before,
*::after {
    box-sizing: border-box;
}

*,
html,
body,
.layout,
.main-content {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
    scrollbar-color: transparent transparent !important;
}

*::-webkit-scrollbar,
html::-webkit-scrollbar,
body::-webkit-scrollbar,
.layout::-webkit-scrollbar,
.main-content::-webkit-scrollbar,
section::-webkit-scrollbar,
div::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

:root {
    /* Default Theme (Orange) */
    --primary: #F97316;
    --primary-rgb: 249, 115, 22;
    --primary-light: #FB923C;
    --primary-dark: #EA580C;
    --primary-glow: rgba(249, 115, 22, 0.4);

    /* Stat Icon Colors */
    --stat-1: #F97316;
    --stat-1-rgb: 249, 115, 22;
    --stat-2: #FACC15;
    --stat-2-rgb: 250, 204, 21;
    --stat-3: #FB923C;
    --stat-3-rgb: 251, 146, 60;

    --accent: #F97316;
    --accent-glow: rgba(249, 115, 22, 0.4);

    --stat-1: #F97316;
    --stat-2: #FACC15;
    --stat-3: #FB923C;
    --stat-4: #EA580C;

    --bg-dark: #0A0A0A;
    --bg-card: #171717;
    --bg-surface: #121212;
    --bg-glass: rgba(23, 23, 23, 0.95);
    --border-glass: rgba(255, 255, 255, 0.08);

    --text-white: #FFFFFF;
    --text-muted: #A3A3A3;
    --text-dim: #737373;

    --success: #10b981;
    --warning: #F97316;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Spacing & Sizing */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --header-height: 80px;
    --sidebar-width: 280px;
    --sidebar-collapsed: 88px;

    /* Transitions */
    --transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Theme Classes */
body.theme-blue {
    --primary: #06b6d4;
    --primary-rgb: 6, 182, 212;
    --primary-light: #22d3ee;
    --primary-dark: #0891b2;
    --primary-glow: rgba(6, 182, 212, 0.4);
    --accent: #6366f1;
    --stat-1: #06b6d4;
    --stat-1-rgb: 6, 182, 212;
    --stat-2: #3b82f6;
    --stat-2-rgb: 59, 130, 246;
    --stat-3: #6366f1;
    --stat-3-rgb: 99, 102, 241;
    --stat-4: #8b5cf6;
    --stat-4-rgb: 139, 92, 246;
}

body.theme-green {
    --primary: #10b981;
    --primary-rgb: 16, 185, 129;
    --primary-light: #34d399;
    --primary-dark: #059669;
    --primary-glow: rgba(16, 185, 129, 0.4);
    --accent: #059669;
    --stat-1: #10b981;
    --stat-1-rgb: 16, 185, 129;
    --stat-2: #059669;
    --stat-2-rgb: 5, 150, 105;
    --stat-3: #22d3ee;
    --stat-3-rgb: 34, 211, 238;
    --stat-4: #0891b2;
    --stat-4-rgb: 8, 145, 178;
}

body.theme-red {
    --primary: #ef4444;
    --primary-rgb: 239, 68, 68;
    --primary-light: #f87171;
    --primary-dark: #dc2626;
    --primary-glow: rgba(239, 68, 68, 0.4);
    --accent: #dc2626;
    --stat-1: #ef4444;
    --stat-1-rgb: 239, 68, 68;
    --stat-2: #f87171;
    --stat-2-rgb: 248, 113, 113;
    --stat-3: #fca5a5;
    --stat-3-rgb: 252, 165, 165;
    --stat-4: #dc2626;
    --stat-4-rgb: 220, 38, 38;
}

body.theme-purple {
    --primary: #a855f7;
    --primary-rgb: 168, 85, 247;
    --primary-light: #c084fc;
    --primary-dark: #9333ea;
    --primary-glow: rgba(168, 85, 247, 0.4);
    --accent: #ec4899;
    --stat-1: #a855f7;
    --stat-1-rgb: 168, 85, 247;
    --stat-2: #d946ef;
    --stat-2-rgb: 217, 70, 239;
    --stat-3: #ec4899;
    --stat-3-rgb: 236, 72, 153;
    --stat-4: #f43f5e;
    --stat-4-rgb: 244, 63, 94;
}

body.theme-orange {
    --primary: #F97316;
    --primary-rgb: 249, 115, 22;
    --primary-light: #FB923C;
    --primary-dark: #EA580C;
    --primary-glow: rgba(249, 115, 22, 0.4);
    --accent: #F97316;
    --stat-1: #F97316;
    --stat-1-rgb: 249, 115, 22;
    --stat-2: #FACC15;
    --stat-2-rgb: 250, 204, 21;
    --stat-3: #FB923C;
    --stat-3-rgb: 251, 146, 60;
    --stat-4: #EA580C;
    --stat-4-rgb: 234, 88, 12;
}

/* Light Theme Variables */
body.light-mode {
    --bg-dark: #F3F4F6;
    --bg-card: #FFFFFF;
    --bg-glass: #FFFFFF;
    --border-glass: rgba(0, 0, 0, 0.08);

    --text-white: #111827;
    --text-muted: #4B5563;
    --text-dim: #6B7280;

    --primary-glow: rgba(255, 107, 0, 0.2);
}

body.light-mode {
    --bg-dark: #f0f2f5;
    --bg-card: #ffffff;
    --bg-surface: #ffffff;
    --bg-glass: #ffffff;
    --border-glass: rgba(0, 0, 0, 0.08);
    --text-white: #1a1a1a;
    --text-muted: #64748b;
    --text-dim: #94a3b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

/* ── Global Android Tap Highlight Fix ── */
a,
button,
input,
select,
textarea,
label,
[role="button"],
[tabindex],
.btn,
.tab-btn,
.hub-card-premium,
.widget-header,
.icon-btn,
.theme-dot,
.collapsible-widget .widget-header,
.cl-widget-container,
.cl-input,
select.cl-input,
.action-btn,
.cl-btn-primary {
    -webkit-tap-highlight-color: transparent !important;
    tap-highlight-color: transparent !important;
    touch-action: manipulation;
    outline: none !important;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    line-height: 1.6;
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw;
    position: relative;
}

h1,
h2,
h3,
h4,
.font-heading {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Utilities */
.glass {
    background: var(--bg-glass);
    /* blur removed */
    /* -webkit-backdrop-filter: none; */
    border: 1px solid rgba(var(--primary-rgb), 0.3) !important;
    border-radius: 20px !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--primary-gradient-end, var(--accent, var(--primary-dark))));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    padding: 12px 28px;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 8px 25px var(--primary-glow);
    filter: brightness(1.1);
}

/* Base Layout Structure */
.layout {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-dark);
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden !important;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px;
    transition: var(--transition);
    width: calc(100% - var(--sidebar-width));
    max-width: 100%;
}

.layout.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed);
    width: calc(100% - var(--sidebar-collapsed));
}

/* Sidebar Styling */
.sidebar {
    background-color: var(--bg-dark);
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    border-right: 1px solid var(--border-glass);
    transition: var(--transition);
    overflow: visible;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

/* Texto visível: aparece com delay, após o sidebar terminar de abrir */
.logo span,
.sidebar-nav span {
    white-space: nowrap;
    overflow: hidden;
    opacity: 1;
    max-width: 200px;
    transition: opacity 0.22s ease 0.32s, max-width 0.22s ease 0.32s;
}

/* Texto oculto: desaparece imediatamente ao fechar (sem delay) */
.sidebar.collapsed .logo span,
.sidebar.collapsed .sidebar-nav span {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    pointer-events: none;
    transition: opacity 0.12s ease 0s, max-width 0.12s ease 0s;
}

.user-info {
    white-space: nowrap;
    transition: var(--transition);
}

.sidebar.collapsed .logo {
    justify-content: center;
    gap: 0;
}

.sidebar.collapsed .sidebar-nav a {
    justify-content: center;
    padding: 12px 0;
    gap: 0;
}

.sidebar.collapsed .sidebar-nav li.active a,
.sidebar.collapsed .sidebar-nav a:hover {
    background: transparent;
    border-color: transparent;
    /* Só esconde a cor, mantém 1px */
    box-shadow: none;
    color: var(--primary);
    /* Desaparece rápido ao fechar */
    transition: background 0.1s ease 0s, border-color 0.1s ease 0s, box-shadow 0.1s ease 0s;
}

.sidebar.collapsed .user-profile {
    justify-content: center;
    padding: 12px 0;
    background: none;
    border: none;
}

.sidebar.collapsed .sidebar-nav {
    flex: 0 1 auto !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 0 !important;
}

.sidebar.collapsed .sidebar-footer {
    padding: 20px 0;
    margin-top: 0;
    flex-shrink: 0 !important;
}

.sidebar.collapsed .user-profile {
    display: flex;
    justify-content: center;
    margin: 10px 0;
    border: none;
    width: 100%;
    padding: 0;
    gap: 0;
    /* Zerar o gap para nao desviar o icone */
}

.sidebar.collapsed .logout-btn {
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.sidebar.collapsed .logout-btn i {
    width: 24px;
    height: 24px;
}

.sidebar-toggle-btn {
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    color: var(--primary);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--primary);
    z-index: 1100;
    box-shadow: 0 0 10px var(--primary-glow);
}

.sidebar-toggle-btn i {
    width: 14px;
    height: 14px;
    stroke-width: 4px;
}

.sidebar-toggle-btn:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 20px var(--primary-glow);
}

.sidebar.collapsed .sidebar-toggle-btn {
    transform: translateY(-50%) rotate(180deg);
}

.sidebar.collapsed .sidebar-toggle-btn:hover {
    transform: translateY(-50%) rotate(180deg) scale(1.1);
}

.sidebar-header {
    padding: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar.collapsed .sidebar-header {
    padding: 32px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
}

.os-logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--white) 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.os-gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--primary-gradient-end, var(--accent, var(--primary-dark))));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: var(--primary);
    font-size: 1.15em;
    font-weight: 800;
    vertical-align: baseline;
}

.sidebar-nav {
    flex: 0 1 auto !important;
    padding: 20px;
    min-height: 0 !important;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 8px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    border: 1px solid transparent;
    /* Sempre 1px, só muda a cor */
    transition: var(--transition);
}

.sidebar-nav a i,
.sidebar-nav a svg {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sidebar.collapsed .sidebar-nav a:hover i,
.sidebar.collapsed .sidebar-nav a:hover svg {
    transform: scale(1.5) !important;
    color: var(--primary) !important;
    filter: none !important;
}

.sidebar.transitioning .sidebar-nav a {
    pointer-events: none !important;
    background: transparent !important;
}

/* Hover: resposta imediata */
.sidebar-nav a:hover {
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary);
    border-color: rgba(var(--primary-rgb), 0.15);
    box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.05);
}

/* Item ativo: borda/fundo aparecem com delay, após sidebar abrir */
.sidebar-nav li.active a {
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary);
    border-color: rgba(var(--primary-rgb), 0.15);
    box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.05);
    /* Anima só a COR do border (não a largura) — delay sincroniza com o texto */
    transition: background 0.22s ease 0.32s, border-color 0.22s ease 0.32s, box-shadow 0.22s ease 0.32s, color 0.15s ease 0s;
}

.sidebar-nav li.active a span {
    background: linear-gradient(135deg, var(--primary), var(--primary-gradient-end, var(--accent, var(--primary-dark))));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
}



.sidebar-nav a i {
    width: 20px;
    height: 20px;
}

/* User Card Sidebar (Top) */
.user-card-sidebar {
    padding: 10px 20px;
    margin-bottom: 5px;
    transition: var(--transition);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    transition: var(--transition);
}

.user-profile:hover {
    background: rgba(var(--primary-rgb), 0.08);
    border-color: rgba(var(--primary-rgb), 0.2);
}

.avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: var(--primary);
    color: #fff;
    border-radius: 12px;
    /* Avatar levemente quadrado para combinar com o novo estilo */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.2);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    flex: 1;
    min-width: 0;
    /* Permite truncar texto longo */
}

.user-info p {
    font-size: 0.85rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-name {
    font-weight: 600;
    color: var(--text-white);
}

.user-role {
    color: var(--text-dim);
    font-size: 0.75rem !important;
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
}

.logout-btn:hover {
    color: var(--danger);
    transform: scale(1.1);
}

/* Sidebar Collapsed Overrides */
.sidebar.collapsed .user-card-sidebar {
    padding: 8px 0;
    display: flex;
    justify-content: center;
}

.sidebar.collapsed .user-profile {
    background: transparent;
    border: none;
    padding: 0;
    justify-content: center;
}

.sidebar.collapsed .user-info,
.sidebar.collapsed .logout-btn {
    display: none;
}

.sidebar.collapsed .avatar {
    margin: 0;
}

/* Top Header */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
    position: sticky;
    top: 20px;
    z-index: 100;
}

.header-left h1 {
    font-size: 1.5rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    border-radius: 20px !important;
    border: 1px solid rgba(var(--primary-rgb), 0.3) !important;
    min-width: 320px;
}

.search-bar input {
    background: none;
    border: none;
    color: var(--text-white);
    outline: none;
    width: 100%;
}

.icon-btn,
.icon-btn i,
.icon-btn svg {
    color: var(--text-white) !important;
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    border: 1px solid var(--border-glass);
    transition: var(--transition);
    background: var(--bg-glass) !important;
    -webkit-tap-highlight-color: transparent !important;
    outline: none !important;
    user-select: none;
}

.icon-btn i {
    display: block;
    width: 20px;
    height: 20px;
}

.icon-btn:hover,
.icon-btn:hover i {
    background: var(--primary) !important;
    color: white !important;
}

.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 10px;
}

.mobile-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-white);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    margin-right: 12px;
}

.mobile-toggle i {
    font-size: 1.5rem;
}

/* Theme Switcher Styles */
.theme-selector {
    display: flex;
    gap: 8px;
    padding: 10px;
    background: var(--bg-glass);
    border-radius: var(--radius-full);
}

.theme-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent !important;
    outline: none !important;
}

.theme-dot:hover {
    transform: scale(1.2);
}

.theme-dot.active {
    border-color: #fff;
    box-shadow: 0 0 10px var(--primary-glow);
}

.dot-orange {
    background: linear-gradient(135deg, #F97316, rgba(249, 115, 22, 0.8));
}

.dot-blue {
    background: linear-gradient(135deg, #06b6d4, rgba(6, 182, 212, 0.8));
}

.dot-green {
    background: linear-gradient(135deg, #10b981, rgba(16, 185, 129, 0.8));
}

.dot-red {
    background: linear-gradient(135deg, #ef4444, rgba(239, 68, 68, 0.8));
}

.dot-purple {
    background: linear-gradient(135deg, #a855f7, rgba(168, 85, 247, 0.8));
}

.dot-white {
    background: linear-gradient(135deg, #ffffff, #f1f5f9);
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

body.light-mode .dot-white {
    background: linear-gradient(135deg, #ffffff, #f1f5f9);
    border: 1px solid rgba(0, 0, 0, 0.2) !important;
}

@media (max-width: 768px) {
    .theme-selector {
        padding: 5px;
        gap: 5px;
    }

    .theme-dot {
        width: 14px;
        height: 14px;
    }
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: min-content;
    gap: 24px;
    transition: var(--transition);
    /* Ensure grid transition */
}

.col-span-2 {
    grid-column: span 2;
}

.col-span-3 {
    grid-column: span 3;
}

/* Cards Styling (Identical to inicio.css patterns) */
.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid rgba(var(--primary-rgb), 0.3) !important;
    border-radius: 20px !important;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--primary);
}


.light-mode .stat-card {
    background: #ffffff;
    background: linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%);
    border: 2px solid rgba(var(--primary-rgb), 0.3);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.light-mode .stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.25);
}

.stat-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: var(--transition);
}

.stat-icon i {
    transition: transform 0.3s ease;
}


.os-tabs-section {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-md);
}

.stat-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-white);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.stat-footer {
    font-size: 0.7rem;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Welcome Card */
.welcome-card {
    padding: 40px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1) 0%, rgba(var(--primary-rgb), 0.05) 100%);
    position: relative;
    overflow: hidden;
    border-left: 4px solid var(--primary);
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    z-index: 0;
}

.welcome-content h2 {
    font-size: 2rem;
    margin-bottom: 12px;
}

.welcome-content p {
    color: var(--text-muted);
    margin-bottom: 24px;
    max-width: 80%;
}

/* Activity Section & Tables */
.activity-section {
    padding: 24px;
    border-radius: var(--radius-lg);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.view-all {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 16px;
    border-bottom: 1px solid var(--border-glass);
}

.data-table td {
    padding: 16px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.data-table tr:hover td {
    background: var(--bg-glass);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid var(--warning);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
}

.badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
}

/* Color Glows */
.bg-primary-glow {
    background: rgba(var(--primary-rgb), 0.08);
    border: 1px solid rgba(var(--primary-rgb), 0.2);
}

.bg-stat-icon-1-glow {
    background: linear-gradient(135deg, rgba(var(--stat-1-rgb), 0.15), rgba(var(--stat-1-rgb), 0.08));
    border: 1px solid rgba(var(--stat-1-rgb), 0.2);
}

.bg-stat-icon-2-glow {
    background: linear-gradient(135deg, rgba(var(--stat-2-rgb), 0.15), rgba(var(--stat-2-rgb), 0.08));
    border: 1px solid rgba(var(--stat-2-rgb), 0.2);
}

.bg-stat-icon-3-glow {
    background: linear-gradient(135deg, rgba(var(--stat-3-rgb), 0.15), rgba(var(--stat-3-rgb), 0.08));
    border: 1px solid rgba(var(--stat-3-rgb), 0.2);
}

.bg-stat-icon-4-glow {
    background: linear-gradient(135deg, rgba(var(--stat-4-rgb), 0.15), rgba(var(--stat-4-rgb), 0.08));
    border: 1px solid rgba(var(--stat-4-rgb), 0.2);
}

.text-stat-1 {
    color: var(--stat-1);
}

.text-stat-2 {
    color: var(--stat-2);
}

.text-stat-3 {
    color: var(--stat-3);
}

.text-stat-4 {
    color: var(--stat-4);
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* Celulares e Tablets (telas até 768px) */
@media (max-width: 768px) {
    .sidebar {
        width: var(--sidebar-width);
        height: 100vh;
        background: var(--bg-card) !important;
        border-right: 1px solid rgba(var(--primary-rgb), 0.2) !important;
        /* Força fundo sólido no mobile */
        transform: translateX(-100%);
        overflow: visible;
        z-index: 1000;
        position: fixed;
        transition: transform 0.3s ease;
        display: flex;
        flex-direction: column;
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active .sidebar-nav {
        flex: 1 1 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        min-height: 0 !important;
    }

    .sidebar.active .sidebar-footer {
        flex-shrink: 0 !important;
    }

    .sidebar-nav {
        flex: 1 1 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        min-height: 0 !important;
    }

    .sidebar-footer {
        flex-shrink: 0 !important;
    }

    .sidebar-toggle-btn {
        display: none;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 16px;
    }

    .mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Tablet e Desktop (Conectando encolhimento e expansão) */
@media (min-width: 769px) {
    .sidebar-toggle-btn {
        display: flex;
    }

    /* Encolhimento quando expandido no tablet */
    .layout:not(.sidebar-collapsed) .main-content {
        margin-left: var(--sidebar-width) !important;
        width: calc(100% - var(--sidebar-width)) !important;
    }

    /* Expansão quando colapsado no tablet */
    .layout.sidebar-collapsed .main-content {
        margin-left: var(--sidebar-collapsed) !important;
        width: calc(100% - var(--sidebar-collapsed)) !important;
    }
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
        /* Mantém 3 colunas conforme fotos */
        gap: 16px;
    }

    .col-span-2 {
        grid-column: span 2;
    }

    .col-span-3 {
        grid-column: span 3;
    }

    .main-content {
        padding: 16px;
    }

    /* Em telas muito pequenas (abaixo de 600px) com a barra aberta, 
       ajustamos as colunas para não espremer demais */
    @media (max-width: 700px) {
        .dashboard-grid {
            grid-template-columns: repeat(2, 1fr);
        }

        .col-span-2,
        .col-span-3 {
            grid-column: span 2;
        }
    }

    .main-content {
        padding: 16px;
    }

    .top-header {
        margin-bottom: 24px;
        padding: 12px 16px;
        display: flex;
        align-items: center;
    }

    .welcome-card {
        padding: 24px;
        /* Slightly more compact */
    }

    .welcome-content h2 {
        font-size: 1.4rem;
    }

    .stat-card {
        width: 100%;
        padding: 14px;
    }

    .stat-value {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .welcome-card {
        padding: 20px;
        /* Even more compact on small phones */
    }

    .welcome-content h2 {
        font-size: 1.5rem;
    }

    .welcome-content p {
        font-size: 0.9rem;
        max-width: 100%;
    }

    .stat-card {
        padding: 16px;
        border-radius: var(--radius-md);
        display: flex;
        flex-direction: row;
        /* Force horizontal on mobile */
        align-items: center;
        gap: 16px;
        background: var(--bg-card);
        border: 1px solid var(--border-glass);
    }

    .stat-icon {
        width: 48px;
        height: 48px;
        min-width: 48px;
        font-size: 1.4rem;
        border-radius: 12px;
    }

    .stat-value {
        font-size: 1.4rem;
        font-weight: 800;
        line-height: 1.2;
    }

    .stat-label {
        font-size: 0.85rem;
        color: var(--text-muted);
    }

    .top-header {
        position: relative;
        top: 0;
        margin-bottom: 20px;
        padding: 10px 16px;
    }

    .search-bar {
        display: none;
    }

    .main-content {
        padding: 16px;
    }

    .dashboard-grid {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .dashboard-grid>* {
        margin: 0 !important;
    }
}

/* Utilities */
.flex {
    display: flex;
}

.gap-2 {
    gap: 8px;
}

.text-center {
    text-align: center;
}

.p-10 {
    padding: 40px;
}

.text-info {
    color: var(--info);
}

.text-danger {
    color: var(--danger);
}

.text-success {
    color: var(--success);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-glass);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Search Results UI */
.search-bar {
    position: relative;
}

.search-results {
    position: absolute;
    top: 130%;
    right: 0;
    width: 350px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-glass);
}

.search-results.hidden {
    display: none;
}

.search-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    color: var(--text-white);
    text-decoration: none;
    transition: background 0.2s;
}

.search-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.search-item i {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.search-item .item-content {
    display: flex;
    flex-direction: column;
}

.search-item .item-type {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-dim);
}

.search-item .item-title {
    font-size: 0.9rem;
    font-weight: 500;
}

/* OS Status Tabs Component */
.os-tabs-section {
    padding: 0;
    margin-bottom: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
}

/* Responsive OS Tabs */
.tabs-header {
    display: flex;
    width: 100%;
    /* Garante que preencha tudo */
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-glass);
    overflow: hidden;
}

.tab-btn {
    flex: 1;
    /* Distribuição Igualitária */
    display: flex;
    align-items: center;
    justify-content: center;
    /* Centraliza conteúdo no botão */
    gap: 8px;
    padding: 20px 12px;
    background: transparent;
    border: none;
    border-right: 1px solid var(--border-glass);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    position: relative;
    font-family: 'Outfit', sans-serif;
}

.tab-btn i {
    font-size: 1.2rem;
    transition: var(--transition);
}

.tab-btn:hover {
    background: rgba(var(--primary-rgb), 0.05);
    color: var(--primary);
}

.tab-btn:hover .tab-count {
    background: var(--primary);
    color: white;
}

.tab-btn.active {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
}

.tab-count {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
    transition: var(--transition);
}

.tab-btn.active .tab-count {
    background: var(--primary);
    color: #fff;
}

.tabs-content {
    display: none;
    padding: 24px;
    background: rgba(0, 0, 0, 0.1);
}

.os-tabs-section.expanded .tabs-content {
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.os-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Compact OS Mini Card */
.os-mini-card {
    padding: 14px 18px;
    border-radius: 20px !important;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100% !important;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.os-mini-card:hover {
    transform: translateY(-5px) !important;
}

/* Cores de borda específicas no Hover para paridade total */
.os-mini-card.cl-card-color-0:hover { border-color: #ff6b00 !important; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4) !important; }
.os-mini-card.cl-card-color-1:hover { border-color: #38bdf8 !important; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4) !important; }
.os-mini-card.cl-card-color-2:hover { border-color: #10b981 !important; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4) !important; }
.os-mini-card.cl-card-color-3:hover { border-color: #a855f7 !important; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4) !important; }
.os-mini-card.cl-card-color-4:hover { border-color: #f59e0b !important; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4) !important; }
.os-mini-card.cl-card-color-5:hover { border-color: #ef4444 !important; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4) !important; }
.os-mini-card.cl-card-color-6:hover { border-color: #06b6d4 !important; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4) !important; }


.os-mini-card:hover .cl-card-shimmer {
    opacity: 1 !important;
}

/* Garantia de variáveis para a fumaça (shimmer) interna */
.cl-card-color-0 { --accent-r: 255; --accent-g: 107; --accent-b: 0; }
.cl-card-color-1 { --accent-r: 56; --accent-g: 189; --accent-b: 248; }
.cl-card-color-2 { --accent-r: 16; --accent-g: 185; --accent-b: 129; }
.cl-card-color-3 { --accent-r: 168; --accent-g: 85; --accent-b: 247; }
.cl-card-color-4 { --accent-r: 245; --accent-g: 158; --accent-b: 11; }
.cl-card-color-5 { --accent-r: 239; --accent-g: 68; --accent-b: 68; }
.cl-card-color-6 { --accent-r: 6; --accent-g: 182; --accent-b: 212; }


.cl-card-color-3, .os-mini-card.cl-card-color-3 { --accent-r: 168; --accent-g: 85; --accent-b: 247; } /* Purple */
.cl-card-color-4, .os-mini-card.cl-card-color-4 { --accent-r: 245; --accent-g: 158; --accent-b: 11; } /* Amber */
.cl-card-color-5, .os-mini-card.cl-card-color-5 { --accent-r: 239; --accent-g: 68; --accent-b: 68; }  /* Red */
.cl-card-color-6, .os-mini-card.cl-card-color-6 { --accent-r: 6; --accent-g: 182; --accent-b: 212; }  /* Cyan */

.cl-card-color-3 { --accent-r: 168; --accent-g: 85; --accent-b: 247; } /* Purple */
.cl-card-color-4 { --accent-r: 245; --accent-g: 158; --accent-b: 11; } /* Amber */
.cl-card-color-5 { --accent-r: 239; --accent-g: 68; --accent-b: 68; }  /* Red */
.cl-card-color-6 { --accent-r: 6; --accent-g: 182; --accent-b: 212; }  /* Cyan */


.os-mini-header {
    width: 100%;
    overflow: hidden;
    min-width: 0;
    position: relative;
    z-index: 2;
}

.client-name-compact {
    font-size: 0.95rem;
    color: var(--text-white);
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    width: 100%;
}

.vehicle-compact,
.date-compact {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.os-mini-footer-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: auto;
    position: relative;
    z-index: 2;
}

.os-status-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.os-id-compact {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
}

.os-badge-compact {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
}

.btn-eye-compact {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    transition: var(--transition);
    text-decoration: none;
}

.btn-eye-compact:hover {
    background: var(--primary);
    color: #fff;
    transform: scale(1.1);
}

/* Badge Status Variants */
.status-open {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-progress {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.status-budget {
    background: rgba(234, 179, 8, 0.1);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.2);
}

.status-approved {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-finished {
    background: rgba(163, 163, 163, 0.1);
    color: #cbd5e1;
    border: 1px solid rgba(163, 163, 163, 0.2);
}

.status-default {
    background: rgba(115, 115, 115, 0.1);
    color: #737373;
    border: 1px solid rgba(115, 115, 115, 0.2);
}

.empty-state-tabs {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    color: var(--text-dim);
    gap: 16px;
    width: 100%;
}

.empty-state-tabs i {
    font-size: 3rem;
    opacity: 0.3;
}

/* Responsive OS Tabs */
@media (max-width: 1024px) {
    .tabs-header {
        background: rgba(255, 255, 255, 0.05);
        overflow-x: hidden;
    }

    .tab-btn {
        padding: 16px 12px;
        font-size: 0.8rem;
        flex: 1;
        justify-content: center;
        gap: 6px;
    }

    .tab-label {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .os-cards-grid {
        grid-template-columns: 1fr; 
        gap: 15px;
    }
    
    .os-tabs-section {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        box-sizing: border-box;
    }
}

@media (max-width: 600px) {
    .dashboard-grid {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 16px !important;
    }
    
    .os-tabs-section {
        margin: 0 !important;
        width: 100% !important;
    }
    
    .tabs-content {
        padding: 16px 12px !important;
    }

    .os-mini-card {
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

/* Widgets responsiveness is now handled by .dashboard-grid */

/* Dashboard Widgets: Sales, Finance, Stock */
.premium-widget {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    border-radius: var(--radius-md) !important;
    height: 100%;
    transition: var(--transition);
    background: var(--bg-card);
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border-glass);
}

.premium-widget:hover {
    border-color: var(--primary);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Collapsible behavior for mobile */
@media (max-width: 850px) {
    .collapsible-widget .widget-content {
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        padding: 0 !important;
        margin: 0 !important;
        transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .collapsible-widget.expanded .widget-content {
        max-height: 1200px;
        opacity: 1;
        padding: 20px 0 0 0 !important;
    }

    .header-action-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.05);
        color: var(--text-muted);
        transition: var(--transition);
    }

    .collapsible-widget.expanded .header-action-mobile {
        transform: rotate(180deg);
        background: rgba(var(--primary-rgb), 0.1);
        color: var(--primary);
    }
}

@media (min-width: 851px) {
    .header-action-mobile {
        display: none;
    }
}

.widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: var(--transition);
}


.premium-widget:hover .header-icon {
    transform: none;
}

.premium-widget:hover .icon-stat-1 {
    box-shadow: none !important;
}

.premium-widget:hover .icon-stat-2 {
    box-shadow: none !important;
}

.premium-widget:hover .icon-stat-3 {
    box-shadow: none !important;
}

.header-icon.icon-stat-1 {
    background: rgba(var(--stat-1-rgb), 0.08);
    color: var(--stat-1);
    border: 1px solid rgba(var(--stat-1-rgb), 0.2);
    box-shadow: none !important;
}

.header-icon.icon-stat-2 {
    background: rgba(var(--stat-2-rgb), 0.08);
    color: var(--stat-2);
    border: 1px solid rgba(var(--stat-2-rgb), 0.2);
    box-shadow: none !important;
}

.header-icon.icon-stat-3 {
    background: rgba(var(--stat-3-rgb), 0.08);
    color: var(--stat-3);
    border: 1px solid rgba(var(--stat-3-rgb), 0.2);
    box-shadow: none !important;
}

.header-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.header-action {
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: var(--transition);
}

.header-action:hover {
    color: var(--primary-color);
    transform: translateX(3px);
}

/* Mini List Items */
.mini-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mini-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid var(--border-glass);
    transition: var(--transition);
}

.mini-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(4px);
}

.item-main {
    display: flex;
    flex-direction: column;
}

.item-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
}

.item-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.item-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.item-link {
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Finance Specific */
.finance-item {
    gap: 12px;
    justify-content: flex-start;
}

.item-icon-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.item-icon-circle.type-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.item-icon-circle.icon-pink-light {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

.item-icon-circle.type-income {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.item-icon-circle.type-expense {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.item-value {
    font-size: 0.9rem;
    font-weight: 700;
}

.item-value.type-income {
    color: #22c55e;
}

.item-value.type-expense {
    color: #ef4444;
}

.item-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Stock Items */
.stock-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 0;
    min-width: 0;
}

.stock-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.stock-name {
    font-weight: 500;
    color: var(--text-color);
    max-width: 70%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stock-count {
    color: var(--text-muted);
    font-size: 0.75rem;
    flex-shrink: 0;
}

.stock-progress-bg {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.stock-progress-bar {
    height: 100%;
    border-radius: 10px;
    transition: width 1s ease-in-out;
}

.stock-progress-bar.level-critical {
    background: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.stock-progress-bar.level-warning {
    background: #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.stock-progress-bar.level-safe {
    background: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

/* Empty States */
.empty-widget {
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
}

.empty-widget i {
    font-size: 2rem;
    opacity: 0.5;
}

@media (max-width: 850px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    .os-tabs-section {
        grid-column: span 3;
    }

    .premium-widget {
        grid-column: span 3;
        /* Empilha apenas no tablet modo retrato ou celular */
        height: auto;
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .os-tabs-section {
        grid-column: span 1;
    }
}

@media (max-width: 850px) {
    .tab-btn {
        flex-direction: column;
        /* Empilha ícone e texto */
        padding: 12px 8px;
        gap: 4px;
        height: auto;
    }

    .tab-btn i {
        font-size: 1.4rem;
        margin-bottom: 2px;
    }

    .tab-label {
        font-size: 0.65rem;
        font-weight: 600;
        text-transform: uppercase;
    }

    .tab-count {
        position: absolute;
        top: 6px;
        right: 4px;
        font-size: 0.6rem;
        padding: 1px 5px;
        min-width: 18px;
        border-radius: 6px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    }
}

@media (max-width: 600px) {
    .tabs-content {
        padding: 16px;
    }

    .os-cards-grid {
        grid-template-columns: 1fr;
        /* Single column on small screens */
        gap: 16px;
    }

    .tab-btn {
        padding: 12px 4px;
        flex-direction: column;
        gap: 4px;
        justify-content: center;
        border-right: 1px solid var(--border-glass);
        flex: 1; /* Distribute equally within 100% */
        min-width: 0; /* Prevent pushing width */
        height: auto;
    }

    .tab-label {
        font-size: 0.65rem;
        text-transform: uppercase;
        font-weight: 600;
    }

    .tab-count {
        position: absolute;
        top: 6px;
        right: 6px;
        font-size: 0.6rem;
        padding: 1px 4px;
        min-width: 18px;
    }

    .os-mini-card {
        padding: 16px;
    }

    .os-mini-body h4 {
        font-size: 1rem;
    }
}

/* Notifications Center */
.notifications-container {
    position: relative;
}

.notifications-dropdown {
    position: absolute;
    top: 130%;
    right: -10px;
    width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    overflow: hidden;
    transform-origin: top right;
    animation: scaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    isolation: isolate;
}


@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border-glass);
}

.notif-header h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-white);
    font-weight: 600;
}

.notif-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.02);
}

.notif-tab {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 600;
}

.notif-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.notif-tab:hover:not(.active) {
    color: var(--text-white);
}

.notif-body {
    max-height: 320px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border-glass);
    transition: var(--transition);
    cursor: pointer;
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.notif-item.unread {
    background: rgba(var(--primary-rgb), 0.05);
    border-left: 3px solid var(--primary);
}

.notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.notif-content {
    flex: 1;
}

.notif-title {
    margin: 0 0 4px 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-white);
}

.notif-desc {
    margin: 0 0 6px 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.notif-time {
    margin: 0;
    font-size: 0.7rem;
    color: var(--text-dim);
}

.notif-footer {
    padding: 12px;
    text-align: center;
    border-top: 1px solid var(--border-glass);
    background: rgba(0, 0, 0, 0.1);
}

.notif-footer a {
    color: var(--primary);
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.notif-footer a:hover {
    color: var(--text-white);
}

@media (max-width: 768px) {

    /* Card Mobile Slim e Centralizado - FIX: Animação sem pular */
    .notifications-dropdown {
        position: fixed;
        top: 80px;
        left: 50%;
        transform: translateX(-50%) !important;
        width: 80vw;
        max-width: 310px;
        z-index: 9999;
        background: var(--bg-card);
        backdrop-filter: none;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
        border: 1px solid var(--border-glass);
        border-radius: var(--radius-md);
        animation: mobileFadeIn 0.25s ease-out forwards;
        transform-origin: center top;
    }

    .notif-body {
        max-height: 280px;
        overflow-y: auto;
    }

    .notif-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: center;
        display: flex;
    }

    .notif-tab {
        flex: none !important;
        padding: 8px 12px !important;
        font-size: 0.75rem !important;
        white-space: nowrap;
    }
}

/* Animação exclusiva para o celular nascer no centro */
@keyframes mobileFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.notifications-overlay {
    display: none !important;
}

/* Overlay mobile apenas com escurecimento leve */
.notifications-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9998;
}

@media (max-width: 768px) {
    .notifications-overlay {
        display: block;
    }
}

@media (max-width: 400px) {
    .tab-btn {
        min-width: 0;
        padding: 10px 2px;
    }

    /* Hide label on very small screens to fit all 5 buttons */
    .tab-label {
        display: none;
    }

    .tab-btn i {
        font-size: 1.4rem;
    }
}

/* 1. Removido Blur em Toda Aplicação (Exceto Popups) */
*:not(.swal2-container):not(.swal2-popup) {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Travar o scroll da tela quando o popup abrir */
body.swal2-shown,
html.swal2-shown {
    overflow: hidden !important;
}

/* Limpeza de Sombra/Fumaça em elementos Glass no Light Mode (como o top-header) */
body.light-mode .glass {
    background: #ffffff !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
    border: 1px solid rgba(var(--primary-rgb), 0.2) !important;
}

/* 2. Cards Realçados em Light Mode */
body.light-mode .stat-card,
body.light-mode .welcome-card,
body.light-mode .os-mini-card,
body.light-mode .hub-card-premium,
body.light-mode .cl-mc-card {
    background: #ffffff !important;
    background-image: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    border: 2px solid rgba(var(--primary-rgb), 0.3) !important;
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.1) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

body.light-mode .stat-card:hover,
body.light-mode .welcome-card:hover,
body.light-mode .os-mini-card:hover,
body.light-mode .hub-card-premium:hover,
body.light-mode .cl-mc-card:hover {
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15) !important;
}

/* Remove retângulo azul/outline ao clicar nos cards */
.stat-card,
.cl-stat-card,
.welcome-card,
.os-mini-card,
.hub-card-premium,
.cl-mc-card,
.cl-stat-card * {
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
    user-select: none;
}

/* Remove setinhas nativas dos inputs tipo number (spinners) */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

input[type="number"] {
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}

/* Ajuste para que o grupo de status (Ativo/Inativo) respeite o tamanho/largura dos campos */
.cl-status-toggle-group {
    width: 100% !important;
    height: 46px !important;
    display: flex !important;
    padding: 4px !important;
    gap: 6px !important;
    margin-top: 0 !important;
    align-items: center !important;
    background: rgba(0, 0, 0, 0.15) !important;
    border-radius: 10px !important;
}

.cl-status-toggle-item {
    flex: 1 !important;
    display: flex !important;
    height: 100% !important;
}

.cl-status-toggle-pill {
    flex: 1 !important;
    justify-content: center !important;
    height: 100% !important;
    padding: 0 !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
}

/* Exibe o texto ao lado do ícone dentro do toggle pill */
.cl-status-toggle-pill span {
    display: inline !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px !important;
}

.cl-status-toggle-pill i {
    width: 16px !important;
    height: 16px !important;
    stroke-width: 2.5 !important;
}

.cl-status-toggle-pill {
    gap: 4px !important;
}

body.light-mode .cl-status-toggle-group {
    background: #f1f5f9 !important;
    border: 1px solid rgba(var(--primary-rgb), 0.2) !important;
}

/* ── Premium Table Styling (cl-table & cl-table-responsive) ── */
.cl-table-responsive {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin-bottom: 1rem !important;
}

.cl-table {
    width: 100% !important;
    max-width: 100% !important;
    border-collapse: collapse !important;
    text-align: left !important;
    vertical-align: middle !important;
    background: transparent !important;
}

.cl-table th {
    padding: 3px 18px !important;
    font-weight: 600 !important;
    font-size: 0.8rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: var(--text-muted, #94a3b8) !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.08) !important;
}

.cl-table td {
    padding: 3px 18px !important;
    font-size: 0.9rem !important;
    color: #f8fafc !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.cl-table tbody tr {
    transition: background 0.2s ease !important;
}

.cl-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02) !important;
}

.cl-table tfoot td {
    padding: 6px 18px !important;
    font-size: 0.95rem !important;
    border-top: 2px solid rgba(255, 255, 255, 0.08) !important;
    border-bottom: none !important;
}

/* Ajustes finos para botões de ação e alinhamento na tabela */
.cl-table th.text-center, 
.cl-table td.text-center {
    text-align: center !important;
}

.cl-table th.text-right, 
.cl-table td.text-right {
    text-align: right !important;
}

/* Light mode adjustments */
body.light-mode .cl-table th {
    color: #64748b !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

body.light-mode .cl-table td {
    color: #0f172a !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-mode .cl-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02) !important;
}

body.light-mode .cl-table tfoot td {
    border-top: 2px solid #e2e8f0 !important;
}