:root {
    /* ========== DESIGN SYSTEM - CORES ========== */
    --color-primary: #3b82f6;
    --color-primary-hover: #2563eb;
    --color-primary-light: #eff6ff;
    --color-bg: #f8fafc;
    --color-bg-secondary: #f1f5f9;
    --color-text: #1e293b;
    --color-text-light: #64748b;
    --color-text-muted: #94a3b8;
    --color-border: #e2e8f0;
    --color-border-light: #f1f5f9;
    --color-sidebar: #0f172a;
    --color-sidebar-dark: #020617;
    --color-success: #10b981;
    --color-success-light: #ecfdf5;
    --color-warning: #f59e0b;
    --color-warning-light: #fffbeb;
    --color-danger: #ef4444;
    --color-danger-light: #fef2f2;
    --color-white: #ffffff;

    /* ========== DESIGN SYSTEM - SOMBRAS ========== */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.03);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.06);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.05);

    /* ========== DESIGN SYSTEM - BORDER RADIUS ========== */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;

    /* ========== DESIGN SYSTEM - TRANSIÇÕES ========== */
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* ========== DESIGN SYSTEM - ESPAÇAMENTOS GLOBAIS ========== */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Espaçamentos específicos */
    --page-padding: 32px;
    --card-padding: 24px;
    --card-gap: 20px;
    --section-gap: 28px;
    --table-cell-padding: 16px 20px;
    --header-height: 72px;
    --sidebar-width: 260px;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family:
        'Inter',
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        Roboto,
        sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header Moderno */
.header {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    padding: 0 32px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 72px;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.95);
}
.header > *:first-child {
    justify-self: start;
}
.header > *:last-child {
    justify-self: end;
}
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}
.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--color-primary) 0%, #6366f1 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}
.company-dropdown {
    padding: 10px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-white);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    min-width: 220px;
    transition: var(--transition);
    color: var(--color-text);
}
.company-dropdown:hover {
    border-color: var(--color-primary);
    background: var(--color-bg);
}
.company-dropdown:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
/* ========== DESIGN SYSTEM - BOTÕES ========== */
.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    letter-spacing: -0.01em;
    height: 38px;
    min-width: fit-content;
    white-space: nowrap;
    text-decoration: none !important;
}
.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    text-decoration: none !important;
}
.btn:active {
    transform: translateY(0);
    box-shadow: none;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.btn-primary {
    background: var(--color-primary);
    color: white;
}
.btn-primary:hover {
    background: var(--color-primary-hover);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}
.btn-primary:active {
    background: #1d4ed8;
}
.btn-success {
    background: var(--color-success);
    color: white;
}
.btn-success:hover {
    background: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}
.btn-success:active {
    background: #047857;
}
.btn-danger {
    background: var(--color-danger);
    color: white;
}
.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}
.btn-danger:active {
    background: #b91c1c;
}
.btn-warning {
    background: var(--color-warning);
    color: white;
}
.btn-warning:hover {
    background: #d97706;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}
.btn-warning:active {
    background: #b45309;
}
.btn-secondary {
    background: #64748b;
    color: white;
}
.btn-secondary:hover {
    background: #475569;
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.35);
}
.btn-secondary:active {
    background: #334155;
}
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--color-border);
    color: var(--color-text);
}
.btn-outline:hover {
    background: var(--color-bg-secondary);
    border-color: var(--color-text-light);
}
.btn-outline:active {
    background: var(--color-border);
}
.btn-ghost {
    background: transparent;
    color: var(--color-text-light);
}
.btn-ghost:hover {
    background: var(--color-bg-secondary);
    color: var(--color-text);
    box-shadow: none;
    transform: none;
}
.btn-ghost:active {
    background: var(--color-border);
}

/* Botões de Ação (Editar/Excluir) - Tamanho Padronizado */
.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
    height: 32px;
    min-width: 32px;
    border-radius: 6px;
}
.btn-xs {
    padding: 4px 8px;
    font-size: 11px;
    height: 26px;
    min-width: 26px;
    border-radius: 5px;
}

/* Botões de Ação em Tabelas */
.actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}
.actions .btn-sm {
    width: 32px;
    height: 32px;
    padding: 0;
}

/* ========== DESIGN SYSTEM - ÍCONES SVG ========== */
.icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}
.icon-sm {
    width: 14px;
    height: 14px;
}
.icon-md {
    width: 18px;
    height: 18px;
}
.icon-lg {
    width: 20px;
    height: 20px;
}
.icon-xl {
    width: 24px;
    height: 24px;
}

/* Botões com ícones SVG */
.btn .icon {
    margin-right: 2px;
}
.btn-sm .icon {
    width: 14px;
    height: 14px;
}
.actions .btn-sm .icon {
    width: 14px;
    height: 14px;
    margin: 0;
}

/* ========== DESIGN SYSTEM - CLASSES DE ESPAÇAMENTO ========== */
.mt-xs {
    margin-top: var(--space-xs);
}
.mt-sm {
    margin-top: var(--space-sm);
}
.mt-md {
    margin-top: var(--space-md);
}
.mt-lg {
    margin-top: var(--space-lg);
}
.mt-xl {
    margin-top: var(--space-xl);
}

.mb-xs {
    margin-bottom: var(--space-xs);
}
.mb-sm {
    margin-bottom: var(--space-sm);
}
.mb-md {
    margin-bottom: var(--space-md);
}
.mb-lg {
    margin-bottom: var(--space-lg);
}
.mb-xl {
    margin-bottom: var(--space-xl);
}

.gap-xs {
    gap: var(--space-xs);
}
.gap-sm {
    gap: var(--space-sm);
}
.gap-md {
    gap: var(--space-md);
}
.gap-lg {
    gap: var(--space-lg);
}
.gap-xl {
    gap: var(--space-xl);
}

.p-sm {
    padding: var(--space-sm);
}
.p-md {
    padding: var(--space-md);
}
.p-lg {
    padding: var(--space-lg);
}
.p-xl {
    padding: var(--space-xl);
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

/* Sidebar Moderna */
.sidebar {
    position: fixed;
    left: 0;
    top: 64px;
    bottom: 0;
    width: 260px;
    background: var(--color-sidebar);
    padding: 20px 0;
    overflow-y: auto;
    z-index: 90;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar.collapsed {
    transform: translateX(-100%);
}
.nav-menu {
    list-style: none;
    padding: 0 12px;
}
.nav-item {
    margin-bottom: 2px;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition-fast);
    border-radius: var(--radius-md);
    margin: 0 4px;
}
.nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}
.nav-link.active {
    background: linear-gradient(135deg, var(--color-primary) 0%, #6366f1 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}
.nav-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    opacity: 0.9;
}
.nav-emoji {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}
.nav-badge {
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
    min-width: 18px;
    text-align: center;
}
.nav-separator {
    padding: 20px 16px 8px 16px;
    margin-top: 4px;
}
.nav-separator span {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

/* Submenus Colapsáveis */
.nav-group {
    margin-bottom: 2px;
}
.nav-group-toggle {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition-fast);
    border-radius: var(--radius-md);
    margin: 0 4px;
    cursor: pointer;
}
.nav-group-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}
.nav-group.open > .nav-group-toggle {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
}
.nav-arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.2s ease;
    opacity: 0.6;
}
.nav-group.open > .nav-group-toggle .nav-arrow {
    transform: rotate(90deg);
}
.nav-submenu {
    list-style: none;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease-out;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    margin: 0 4px;
}
.nav-group.open > .nav-submenu {
    max-height: 200px;
    transition: max-height 0.3s ease-in;
}
.nav-submenu .nav-item {
    margin-bottom: 0;
}
.nav-submenu .nav-link {
    padding: 10px 16px 10px 44px;
    font-size: 14px;
    margin: 0;
    border-radius: 0;
}
.nav-submenu .nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
}
.nav-submenu .nav-link.active {
    background: linear-gradient(135deg, var(--color-primary) 0%, #6366f1 100%);
    color: white;
    border-radius: var(--radius-sm);
    margin: 2px 4px;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    margin-top: 64px;
    padding: 28px 32px;
    height: calc(100vh - 64px);
    overflow-y: auto;
    overflow-x: hidden;
    animation: fadeIn 0.3s ease;
}

/* Páginas - altura automática */
.page {
    height: auto;
    overflow: visible;
    padding-bottom: 20px;
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Page Header */
.page-header {
    margin-bottom: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.page-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
    color: var(--color-text);
}
.page-subtitle {
    color: var(--color-text-muted);
    font-size: 14px;
}

/* Dashboard Grid & KPI Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}
.kpi-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 22px;
    border: 1px solid var(--color-border);
    transition: var(--transition);
    cursor: pointer;
    box-shadow: var(--shadow-xs);
}
.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}
.kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    font-size: 22px;
}
.kpi-icon.blue {
    background: var(--color-primary-light);
    color: var(--color-primary);
}
.kpi-icon.green {
    background: var(--color-success-light);
    color: var(--color-success);
}
.kpi-icon.orange {
    background: var(--color-warning-light);
    color: var(--color-warning);
}
.kpi-icon.purple {
    background: #f3e8ff;
    color: #9333ea;
}
.kpi-value {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 2px;
    letter-spacing: -0.5px;
    color: var(--color-text);
}
.kpi-label {
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 500;
}

/* ========== DESIGN SYSTEM - TABELAS ========== */
.table-container {
    background: var(--color-white);
    border-radius: 12px;
    border: 1px solid var(--color-border);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    max-height: calc(100vh - 340px);
    overflow-y: auto;
    overflow-x: auto;
    position: relative;
}
.table-header {
    background: var(--color-white);
    padding: 18px 24px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.table-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
}
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th {
    background: var(--color-bg);
    padding: 14px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
    height: 48px;
    vertical-align: middle;
    position: sticky;
    top: 0;
    z-index: 10;
}
.table td {
    padding: 12px 16px;
    font-size: 13px;
    white-space: nowrap;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--color-text);
    height: 32px;
    vertical-align: middle;
    border-bottom: none;
}
.table tbody tr {
    transition: all 0.15s ease;
    border-bottom: 1px solid #e5e7eb;
}
.table tbody tr:last-child {
    border-bottom: none;
}
.table tbody tr:nth-child(odd) {
    background: #ffffff;
}
.table tbody tr:nth-child(even) {
    background: #f8fafc;
}
.table tbody tr:hover {
    background: #e0f2fe !important;
    box-shadow: inset 3px 0 0 var(--color-primary);
}

/* ========== DESIGN SYSTEM - BADGES/STATUS ========== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    height: 26px;
}
.badge-blue {
    background: var(--color-primary-light);
    color: var(--color-primary);
}
.badge-green {
    background: var(--color-success-light);
    color: var(--color-success);
}
.badge-orange {
    background: var(--color-warning-light);
    color: #b45309;
}
.badge-red {
    background: var(--color-danger-light);
    color: var(--color-danger);
}
.badge-gray {
    background: var(--color-bg-secondary);
    color: var(--color-text-light);
}

/* Status Ativo/Inativo */
.status-active {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-success);
    font-weight: 600;
    font-size: 12px;
}
.status-active::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--color-success);
    border-radius: 50%;
}
.status-inactive {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 12px;
}
.status-inactive::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--color-text-muted);
    border-radius: 50%;
}
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal.active {
    display: flex;
}
.modal-content {
    background: var(--color-white);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}
@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-title {
    font-size: 18px;
    font-weight: 600;
}
.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--color-text-light);
}
.modal-body {
    padding: 24px;
}
.modal-footer {
    padding: 24px;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
.form-group {
    margin-bottom: 20px;
}
.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 12px;
}
.form-input,
.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 12px;
    transition: var(--transition);
}
.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.login-container {
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-sidebar) 0%, var(--color-sidebar-dark) 100%);
}
.login-box {
    background: var(--color-white);
    padding: 48px;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}
.login-logo {
    text-align: center;
    margin-bottom: 32px;
}
.login-logo .logo-icon {
    width: 64px;
    height: 64px;
    font-size: 32px;
    margin: 0 auto 16px;
}
.login-title {
    font-size: 21px;
    font-weight: 700;
}
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 12px;
}
.alert-error {
    background: #fee2e2;
    color: var(--color-danger);
}
.alert-success {
    background: #dcfce7;
    color: var(--color-success);
}
.page {
    display: none;
}
.page.active {
    display: block;
}
.settings-tab {
    padding: 10px 20px;
    border: none;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.settings-tab:hover {
    background: #e2e8f0;
}
.settings-tab.active {
    background: var(--color-primary);
    color: white;
}
.settings-content {
    display: none;
}
.settings-content.active {
    display: block;
}
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 80;
}
.overlay.active {
    display: block;
}
/* Computer Details Modal */
.cd-tab {
    padding: 8px 16px;
    border: none;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.cd-tab:hover {
    background: #e2e8f0;
}
.cd-tab.active {
    background: var(--color-primary);
    color: white;
}
.cd-tab-content {
    display: none;
}
.cd-tab-content:first-of-type {
    display: block;
}
.detail-card {
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
}
.detail-label {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.detail-value {
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    word-break: break-word;
}
.progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}
.progress-bar-fill.green {
    background: var(--color-success);
}
.progress-bar-fill.yellow {
    background: var(--color-warning);
}
.progress-bar-fill.red {
    background: var(--color-danger);
}

/* Computer Details Page */
.status-bar {
    display: flex;
    gap: 20px;
    padding: 18px 24px;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    flex-wrap: wrap;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-xs);
}
.status-item {
    flex: 1;
    min-width: 140px;
}
.status-label {
    font-size: 11px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: block;
    font-weight: 500;
}
.status-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
}
.status-value.status-online {
    color: var(--color-success);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.status-value.status-online::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--color-success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}
.status-value.status-offline {
    color: var(--color-danger);
}
.status-value.status-alert {
    color: var(--color-danger);
    background: var(--color-danger-light);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
}

/* Tabs Modernas */
.tabs-container {
    display: flex;
    gap: 2px;
    margin-bottom: 24px;
    padding: 4px;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    flex-wrap: wrap;
    border: 1px solid var(--color-border);
}
.tab-btn {
    padding: 10px 18px;
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--color-text-light);
    font-weight: 500;
}
.tab-btn:hover {
    background: rgba(255, 255, 255, 0.6);
    color: var(--color-text);
}
.tab-btn.active {
    background: var(--color-white);
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}
.tab-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-primary);
    opacity: 0.8;
}

.tab-content {
    display: none;
    animation: fadeIn 0.25s ease;
}
.tab-content.active {
    display: block;
}

/* Info Cards */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}
.info-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}
.info-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #3b82f6;
}
.info-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
.info-card h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-light);
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 13px;
}
.info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.info-row:first-of-type {
    padding-top: 0;
}
.info-row span {
    color: var(--color-text-muted);
    font-weight: 400;
}
.info-row strong {
    color: var(--color-text);
    text-align: right;
    max-width: 60%;
    word-break: break-word;
    font-weight: 600;
}
.info-row strong.copyable {
    cursor: pointer;
    color: var(--color-primary);
}
.info-row strong.copyable:hover {
    text-decoration: none;
}
.info-input {
    padding: 6px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    width: 180px;
    text-align: right;
}
.info-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}
.info-textarea {
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    width: 100%;
    resize: vertical;
    font-family: inherit;
}
.info-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.table-sm {
    font-size: 12px;
}
.table-sm th,
.table-sm td {
    padding: 10px 12px;
}

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #94a3b8;
}
.empty-state span {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}
.empty-state p {
    font-size: 14px;
}

.progress-bar-sm {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    min-width: 80px;
}
.progress-bar-sm .fill {
    height: 100%;
    border-radius: 3px;
}
.progress-bar-sm .fill.green {
    background: var(--color-success);
}
.progress-bar-sm .fill.yellow {
    background: var(--color-warning);
}
.progress-bar-sm .fill.red {
    background: var(--color-danger);
}

/* Modals Modernos */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.25s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 24px 24px 18px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: -0.3px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--color-bg-secondary);
    color: var(--color-text);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 18px 24px;
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: var(--color-bg);
}

/* Scrollbar Personalizada */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--color-bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Selection */
::selection {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

/* Focus States */
*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ========== TICKETS MODULE ========== */
.tickets-toolbar {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.tickets-search {
    position: relative;
    flex: 1;
    min-width: 250px;
}
.tickets-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
}
.tickets-search .search-input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--color-white);
    transition: var(--transition);
}
.tickets-search .search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.tickets-filters {
    display: flex;
    gap: 12px;
}
.filter-select {
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 13px;
    background: var(--color-white);
    cursor: pointer;
    min-width: 150px;
}
.filter-select:focus {
    outline: none;
    border-color: var(--color-primary);
}

.tickets-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.ticket-kpi {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    text-align: left;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--color-border-light);
}
.ticket-kpi::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}
.ticket-kpi:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.ticket-kpi-icon {
    font-size: 18px;
    margin-bottom: 4px;
}
.ticket-kpi-value {
    font-size: 26px;
    font-weight: 700;
}
.ticket-kpi-label {
    font-size: 11px;
    margin-top: 4px;
    color: var(--color-text-muted);
    font-weight: 500;
}

/* KPI Abertos - Azul */
.ticket-kpi[data-status='aberto'] {
    background: #eff6ff;
}
.ticket-kpi[data-status='aberto']::before {
    background: #3b82f6;
}
.ticket-kpi[data-status='aberto'] .ticket-kpi-value {
    color: #1e40af;
}
.ticket-kpi[data-status='aberto']:hover {
    background: #dbeafe;
}

/* KPI Em Andamento - Amarelo/Laranja */
.ticket-kpi[data-status='em_andamento'] {
    background: #fff7ed;
}
.ticket-kpi[data-status='em_andamento']::before {
    background: #f97316;
}
.ticket-kpi[data-status='em_andamento'] .ticket-kpi-value {
    color: #c2410c;
}
.ticket-kpi[data-status='em_andamento']:hover {
    background: #ffedd5;
}

/* KPI Aguardando - Roxo */
.ticket-kpi[data-status='aguardando'] {
    background: #faf5ff;
}
.ticket-kpi[data-status='aguardando']::before {
    background: #a855f7;
}
.ticket-kpi[data-status='aguardando'] .ticket-kpi-value {
    color: #7c3aed;
}
.ticket-kpi[data-status='aguardando']:hover {
    background: #f3e8ff;
}

/* KPI Fechados - Verde */
.ticket-kpi[data-status='fechado'] {
    background: #ecfdf5;
}
.ticket-kpi[data-status='fechado']::before {
    background: #10b981;
}
.ticket-kpi[data-status='fechado'] .ticket-kpi-value {
    color: #059669;
}
.ticket-kpi[data-status='fechado']:hover {
    background: #d1fae5;
}

.tickets-list-container {
    background: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border-light);
    overflow: hidden;
}
.tickets-list-header,
.ticket-item {
    display: grid;
    grid-template-columns: 50px 1.8fr 0.9fr 1fr 0.9fr 75px 85px 50px 50px 85px 70px;
    gap: 0;
    align-items: center;
}
.tickets-list-header {
    padding: 12px 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border-light);
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.tickets-list-header > div,
.ticket-item > div {
    padding: 0 8px;
    border-right: 1px solid var(--color-border-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
}
.tickets-list-header > div:last-child,
.ticket-item > div:last-child {
    border-right: none;
}
.tickets-list-header > div:nth-child(6),
.tickets-list-header > div:nth-child(7),
.ticket-item > div:nth-child(6),
.ticket-item > div:nth-child(7) {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}
.tickets-list {
    max-height: calc(100vh - 400px);
    overflow-y: auto;
}

/* Cabeçalho ordenável */
.tickets-list-header .sortable {
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}
.tickets-list-header .sortable:hover {
    color: var(--color-primary);
}

/* Badges de Prioridade */
.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}
.priority-badge.urgente {
    background: #fee2e2;
    color: #dc2626;
}
.priority-badge.alta {
    background: #ffedd5;
    color: #ea580c;
}
.priority-badge.media {
    background: #fef9c3;
    color: #ca8a04;
}
.priority-badge.baixa {
    background: #dcfce7;
    color: #16a34a;
}

/* Indicador de SLA */
.sla-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
}
.sla-badge.ok {
    background: #dcfce7;
    color: #16a34a;
}
.sla-badge.warning {
    background: #fef9c3;
    color: #ca8a04;
}
.sla-badge.danger {
    background: #fee2e2;
    color: #dc2626;
}

/* Ações rápidas */
.ticket-actions {
    display: flex;
    gap: 4px;
    justify-content: center;
}
.ticket-actions button {
    padding: 4px 6px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    background: #f1f5f9;
}
.ticket-actions button:hover {
    background: #e2e8f0;
}
.ticket-actions button.action-edit {
    color: #3b82f6;
}
.ticket-actions button.action-close {
    color: #16a34a;
}
.ticket-actions button.action-assign {
    color: #8b5cf6;
}

/* Indicador de anexos */
.attachment-icon {
    color: #64748b;
    font-size: 12px;
}

/* Paginação */
.tickets-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid var(--color-border-light);
}
.tickets-pagination button {
    padding: 6px 12px;
    border: 1px solid var(--color-border-light);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.tickets-pagination button:hover:not(:disabled) {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}
.tickets-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.tickets-pagination button.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}
.tickets-pagination .page-info {
    font-size: 13px;
    color: var(--color-text-light);
}

/* Botão pequeno */
.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
}
.ticket-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border-light);
    cursor: pointer;
    transition: var(--transition);
}
.ticket-item > div {
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}
.ticket-item:last-child {
    border-bottom: none;
}

/* Hover nas linhas */
.ticket-item:hover {
    background: #f1f5f9;
}
.ticket-id {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-light);
}
.ticket-info {
    min-width: 0;
}
.ticket-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}
.ticket-meta {
    font-size: 12px;
    color: var(--color-text-muted);
}
.ticket-assunto {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ticket-cliente {
    font-size: 13px;
    color: var(--color-text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ticket-empresa {
    font-size: 13px;
    color: var(--color-text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ticket-categoria {
    font-size: 12px;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ticket-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    min-width: 110px;
}
.ticket-status.aberto {
    background: #dbeafe;
    color: #1e40af;
}
.ticket-status.em_andamento {
    background: #fef3c7;
    color: #92400e;
}
.ticket-status.aguardando {
    background: #fce7f3;
    color: #9d174d;
}
.ticket-status.fechado {
    background: #d1fae5;
    color: #065f46;
}
.ticket-prioridade {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.ticket-prioridade.urgente {
    background: #fee2e2;
    color: #991b1b;
}
.ticket-prioridade.alta {
    background: #ffedd5;
    color: #9a3412;
}
.ticket-prioridade.media {
    background: #fef9c3;
    color: #854d0e;
}
.ticket-prioridade.baixa {
    background: #f0fdf4;
    color: #166534;
}
.ticket-date {
    font-size: 12px;
    color: var(--color-text-muted);
    text-align: right;
}

.tickets-empty {
    padding: 60px 20px;
    text-align: center;
}
.tickets-empty .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}
.tickets-empty h3 {
    font-size: 16px;
    color: var(--color-text);
    margin-bottom: 8px;
}
.tickets-empty p {
    font-size: 14px;
    color: var(--color-text-muted);
}

/* Ticket Details Layout - Refatorado estilo Zendesk */
.ticket-details-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    margin-top: 16px;
    min-height: 300px;
    max-height: calc(100vh - 200px);
}
.ticket-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}
.ticket-sidebar {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Header do Ticket Melhorado */
.ticket-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 100%);
    border-radius: 12px;
    margin-bottom: 16px;
}
.ticket-header-info {
    display: flex;
    align-items: center;
    gap: 16px;
}
.ticket-header-back {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
}
.ticket-header-back:hover {
    background: rgba(255, 255, 255, 0.25);
}
.ticket-header-title {
    color: #fff;
}
.ticket-header-title h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}
.ticket-header-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.ticket-protocolo-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.ticket-empresa-badge {
    background: rgba(59, 130, 246, 0.3);
    color: #fff;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}
.ticket-header-actions {
    display: flex;
    gap: 8px;
}

/* Barra de SLA */
.sla-bar-container {
    margin-bottom: 16px;
    padding: 8px 16px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}
.sla-bar-track {
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}
.sla-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition:
        width 0.5s ease,
        background-color 0.5s ease;
    width: 0%;
}
.sla-bar-info {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 11px;
    color: #64748b;
}

/* Status e Prioridade Badges no Header */
.ticket-status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}
.ticket-status-badge.aberto {
    background: #dcfce7;
    color: #166534;
}
.ticket-status-badge.em_andamento {
    background: #fef3c7;
    color: #92400e;
}
.ticket-status-badge.aguardando {
    background: #e0e7ff;
    color: #3730a3;
}
.ticket-status-badge.fechado {
    background: #f1f5f9;
    color: #475569;
}

.ticket-priority-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}
.ticket-priority-badge.baixa {
    background: #d1fae5;
    color: #065f46;
}
.ticket-priority-badge.media {
    background: #fef3c7;
    color: #92400e;
}
.ticket-priority-badge.alta {
    background: #fee2e2;
    color: #991b1b;
}
.ticket-priority-badge.urgente {
    background: #dc2626;
    color: #fff;
}

/* Área de Conversação */
.ticket-conversation {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ticket-conversation-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ticket-timeline {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    min-height: 150px;
}
.ticket-reply-area {
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
}

/* Editor de resposta com suporte a imagens */
.reply-editor-container {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}
.reply-editor {
    min-height: 80px;
    max-height: 200px;
    overflow-y: auto;
    padding: 12px;
    font-size: 14px;
    line-height: 1.5;
    outline: none;
}
.reply-editor:empty:before {
    content: attr(placeholder);
    color: #9ca3af;
    pointer-events: none;
}
.reply-editor:focus {
    outline: none;
}
.reply-editor-container:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.reply-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 4px 0;
    cursor: pointer;
}

/* Preview de imagens coladas */
.reply-images-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 12px 12px;
}
.reply-images-preview:empty {
    display: none;
}
.reply-image-item {
    position: relative;
    display: inline-block;
}
.reply-image-item img {
    border-radius: 6px;
    border: 2px solid #e5e7eb;
    object-fit: contain;
    cursor: move;
    transition: border-color 0.2s;
}
.reply-image-item img:hover {
    border-color: #3b82f6;
}
.reply-image-item.resizing img {
    border-color: #3b82f6;
    border-style: dashed;
}
.reply-image-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    background: #ef4444;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.reply-image-remove:hover {
    background: #dc2626;
}
.reply-image-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 16px;
    height: 16px;
    background: #3b82f6;
    cursor: se-resize;
    border-radius: 0 0 4px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.reply-image-resize-handle::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
}
.reply-image-size {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
}
.ticket-reply-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Sidebar Cards */
.ticket-sidebar .sidebar-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}
.ticket-sidebar .sidebar-card-header {
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    font-size: 13px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ticket-sidebar .sidebar-card-body {
    padding: 16px;
}
.ticket-sidebar {
    overflow: visible !important;
}
#sidebar-edit-mode .sidebar-card {
    overflow: visible;
}

/* Info Items na Sidebar - Modo Visualização */
#sidebar-view-mode .sidebar-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}
#sidebar-view-mode .sidebar-info-item:last-child {
    border-bottom: none;
}
#sidebar-view-mode .sidebar-info-item label {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
}
#sidebar-view-mode .sidebar-info-item span {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    text-align: right;
}

/* Info Items na Sidebar - Modo Edição */
#sidebar-edit-mode .sidebar-info-item {
    margin-bottom: 16px;
}
#sidebar-edit-mode .sidebar-info-item:last-child {
    margin-bottom: 0;
}
#sidebar-edit-mode .sidebar-info-item label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
#sidebar-edit-mode .sidebar-info-item select,
#sidebar-edit-mode .sidebar-info-item input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
}
#sidebar-edit-mode .sidebar-info-item select {
    max-height: 200px;
}
#sidebar-edit-mode .sidebar-info-item select:focus,
#sidebar-edit-mode .sidebar-info-item input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Form inputs pequenos para sidebar */
.form-input-sm {
    padding: 6px 10px;
    font-size: 13px;
}

/* Divider */
.sidebar-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 12px 0;
}

/* Anexos na Sidebar */
.anexo-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #f8fafc;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 12px;
}
.anexo-item:last-child {
    margin-bottom: 0;
}
.anexo-item a {
    color: #3b82f6;
    text-decoration: none;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.anexo-item a:hover {
    text-decoration: underline;
}
.timeline-item {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}
.timeline-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.timeline-avatar-text {
    color: white;
    font-weight: 600;
    font-size: 14px;
}
.timeline-content {
    flex: 1;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    min-width: 0;
}
.timeline-content.support {
    background: #eff6ff;
}
.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.timeline-author {
    font-weight: 600;
    font-size: 13px;
    color: var(--color-text);
}
.timeline-role {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-left: 8px;
    padding: 2px 6px;
    background: var(--color-border-light);
    border-radius: 4px;
}
.timeline-date {
    font-size: 11px;
    color: var(--color-text-muted);
}
.timeline-message {
    font-size: 14px;
    color: var(--color-text);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
.timeline-message img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    cursor: zoom-in;
    transition:
        transform 0.2s,
        box-shadow 0.2s;
    border: 1px solid var(--color-border-light);
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}
.timeline-message img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.timeline-message table,
.timeline-message .fr-table-selection-hover {
    outline: none !important;
    border: none !important;
}

.ticket-reply-area {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border-light);
}
.ticket-reply-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.ticket-info-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 12px;
}
.ticket-info-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ticket-info-item label {
    font-size: 12px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.ticket-info-item span {
    font-size: 15px;
    color: var(--color-text);
}
.ticket-info-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--color-border-light);
    border-bottom: 1px solid var(--color-border-light);
    margin: 4px 0;
}
.ticket-date-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ticket-date-item label {
    font-size: 10px;
    color: var(--color-text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
}
.ticket-date-item span {
    font-size: 12px;
    color: var(--color-text);
}
.form-input-sm {
    padding: 6px 10px;
    font-size: 13px;
}

.ticket-upload-area {
    margin-top: 12px;
}
.anexo-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 12px;
}
.anexo-item a {
    color: var(--color-primary);
    text-decoration: none;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.anexo-item a:hover {
    text-decoration: underline;
}

/* Remover sublinhado de todos os links que são botões */
a.btn:hover {
    text-decoration: none !important;
}

/* Avatar Colors */
.avatar-a {
    background: #ef4444 !important;
}
.avatar-b {
    background: #f97316 !important;
}
.avatar-c {
    background: #eab308 !important;
}
.avatar-d {
    background: #22c55e !important;
}
.avatar-e {
    background: #14b8a6 !important;
}
.avatar-f {
    background: #3b82f6 !important;
}
.avatar-g {
    background: #8b5cf6 !important;
}
.avatar-h {
    background: #ec4899 !important;
}
.avatar-i {
    background: #6366f1 !important;
}
.avatar-j {
    background: #0ea5e9 !important;
}
.avatar-k {
    background: #84cc16 !important;
}
.avatar-l {
    background: #f43f5e !important;
}
.avatar-m {
    background: #a855f7 !important;
}
.avatar-n {
    background: #06b6d4 !important;
}
.avatar-o {
    background: #10b981 !important;
}
.avatar-p {
    background: #f59e0b !important;
}
.avatar-q {
    background: #6366f1 !important;
}
.avatar-r {
    background: #dc2626 !important;
}
.avatar-s {
    background: #7c3aed !important;
}
.avatar-t {
    background: #0891b2 !important;
}
.avatar-u {
    background: #65a30d !important;
}
.avatar-v {
    background: #db2777 !important;
}
.avatar-w {
    background: #4f46e5 !important;
}
.avatar-x {
    background: #059669 !important;
}
.avatar-y {
    background: #d97706 !important;
}
.avatar-z {
    background: #7c2d12 !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 0 16px;
        height: 56px;
    }
    .mobile-toggle {
        display: block;
    }
    .sidebar {
        transform: translateX(-100%);
        width: 100%;
        max-width: 280px;
        top: 56px;
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        margin-top: 56px;
        padding: 16px;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table {
        min-width: 600px;
    }
    .modal-content {
        width: 95%;
        margin: 16px;
        border-radius: var(--radius-lg);
    }
    .info-grid {
        grid-template-columns: 1fr;
    }
    .status-bar {
        padding: 14px 16px;
        gap: 12px;
    }
    .tabs-container {
        padding: 3px;
    }
    .tab-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    .tickets-kpis {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Lista de chamados - scroll horizontal em mobile */
    .tickets-list-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .tickets-list-header,
    .ticket-item {
        min-width: 800px; /* Força largura mínima para scroll */
    }
    .tickets-list {
        max-height: calc(100vh - 350px);
        overflow-y: auto;
    }

    .ticket-details-layout {
        grid-template-columns: 1fr;
    }
    .ticket-sidebar {
        margin-top: 16px;
    }
    .ticket-header-bar {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    .ticket-header-actions {
        width: 100%;
        justify-content: center;
    }

    .tickets-filters {
        flex-direction: column;
        width: 100%;
    }
    .filter-select {
        width: 100%;
    }

    /* Editor de resposta em mobile */
    .reply-editor {
        min-height: 60px;
    }
    .ticket-reply-actions {
        flex-direction: column;
        gap: 8px;
    }
    .ticket-reply-actions > div {
        width: 100%;
        justify-content: center;
    }
    .ticket-reply-actions .btn {
        width: 100%;
    }
}

/* ========== NOTIFICAÇÕES DE CHAMADOS ========== */
.has-notification {
    animation: pulse-notification 1s ease-in-out infinite;
    position: relative;
}
.has-notification::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    animation: blink 0.5s ease-in-out infinite;
}
@keyframes pulse-notification {
    0%,
    100% {
        background: rgba(239, 68, 68, 0.1);
    }
    50% {
        background: rgba(239, 68, 68, 0.25);
    }
}
@keyframes blink {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* ========== MODAL FINALIZAR E RESPOSTAS PADRÕES ========== */
.modal-content.modal-lg {
    width: 500px;
    max-width: 500px;
    height: 450px;
    max-height: 450px;
}
.btn-success {
    background: #22c55e;
    color: white;
    border: none;
}
.btn-success:hover {
    background: #16a34a;
}
.form-row {
    display: flex;
    gap: 16px;
}
.respostas-padroes-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}
.resposta-padrao-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}
.resposta-padrao-item:last-child {
    border-bottom: none;
}
.resposta-padrao-item:hover {
    background: var(--bg-secondary);
}
.resposta-padrao-item.selected {
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid var(--primary-color);
}
.resposta-padrao-titulo {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.resposta-padrao-preview {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== MÓDULO RESPOSTAS PADRÃO ========== */
.respostas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.respostas-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}
.respostas-lista {
    background: var(--color-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-light);
    overflow: hidden;
}
.respostas-lista-header {
    padding: 12px 16px;
    background: var(--color-bg);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-light);
    border-bottom: 1px solid var(--color-border-light);
}
.respostas-lista-item {
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border-light);
    cursor: pointer;
    transition: var(--transition);
    color: #3b82f6;
    font-size: 14px;
}
.respostas-lista-item:hover {
    background: var(--color-bg);
}
.respostas-lista-item:last-child {
    border-bottom: none;
}

/* Página de Edição de Resposta */
.resposta-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--color-border-light);
    margin-bottom: 24px;
}
.resposta-page-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}
.resposta-page-actions {
    display: flex;
    gap: 8px;
}
.resposta-form-container {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 24px;
    border: 1px solid var(--color-border-light);
}
.resposta-page-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-top: 24px;
    border-top: 1px solid var(--color-border-light);
}
.resposta-footer-right {
    display: flex;
    gap: 8px;
}

/* Editor Rico */
.editor-toolbar {
    display: flex;
    gap: 4px;
    padding: 8px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-bottom: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    flex-wrap: wrap;
}
.editor-toolbar button {
    width: 32px;
    height: 32px;
    border: 1px solid var(--color-border-light);
    background: var(--color-white);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: var(--transition);
}
.editor-toolbar button:hover {
    background: var(--color-bg-secondary);
}
.editor-separator {
    width: 1px;
    height: 24px;
    background: var(--color-border);
    margin: 4px 8px;
}
.resposta-editor {
    min-height: 250px;
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    background: var(--color-white);
    font-size: 14px;
    line-height: 1.6;
    outline: none;
}
.resposta-editor table,
.resposta-editor .fr-table-selection-hover {
    outline: none !important;
    border: none !important;
}
.resposta-editor:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.resposta-editor:empty:before {
    content: attr(placeholder);
    color: var(--color-text-muted);
}

/* Botão editar mensagem */
.btn-edit-msg {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--color-text-muted);
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s;
}
.btn-edit-msg:hover {
    background: var(--color-bg-secondary);
    color: var(--color-primary);
}
.timeline-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.timeline-edited {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-left: 8px;
    font-style: italic;
}

/* Área de edição de interação */
.edit-interacao-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.edit-interacao-editor {
    width: 100%;
    min-height: 100px;
    max-height: 300px;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    background: var(--color-white);
}
.edit-interacao-editor:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.edit-interacao-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ========== UX - ESTADOS VAZIOS INTELIGENTES ========== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    background: linear-gradient(135deg, var(--color-bg) 0%, var(--color-white) 100%);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--color-border);
    margin: 20px 0;
}
.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.8;
}
.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
}
.empty-state-description {
    font-size: 14px;
    color: var(--color-text-light);
    max-width: 400px;
    margin-bottom: 20px;
    line-height: 1.6;
}
.empty-state-cta {
    margin-top: 8px;
}

/* ========== UX - CARDS CLICÁVEIS ========== */
.kpi-card-clickable {
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.kpi-card-clickable:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
}
.kpi-card-clickable:active {
    transform: translateY(-2px);
}
/* Seta removida - causava faixa preta em alguns navegadores */

/* ========== UX - HIERARQUIA VISUAL DASHBOARD ========== */
.dashboard-section {
    margin-bottom: var(--section-gap);
}
.dashboard-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dashboard-section-title::before {
    content: '';
    width: 4px;
    height: 16px;
    background: var(--color-primary);
    border-radius: 2px;
}

/* KPIs com hierarquia */
.kpi-grid-primary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--card-gap);
    margin-bottom: var(--section-gap);
}
.kpi-grid-secondary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}
.kpi-card-primary {
    padding: 24px;
    background: linear-gradient(135deg, var(--color-white) 0%, var(--color-bg) 100%);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--color-primary);
}
.kpi-card-secondary {
    padding: 16px;
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
}

/* ========== UX - LINHAS DE TABELA CLICÁVEIS ========== */
.table-row-clickable {
    cursor: pointer;
    transition: var(--transition-fast);
}
.table-row-clickable:hover {
    background: var(--color-primary-light) !important;
}

/* ========== UX - STATUS ONLINE/OFFLINE DESTACADO ========== */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.status-online {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.status-online::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--color-success);
    border-radius: 50%;
    animation: pulse-online 2s infinite;
}
.status-offline {
    background: rgba(100, 116, 139, 0.1);
    color: var(--color-text-light);
    border: 1px solid rgba(100, 116, 139, 0.3);
}
.status-offline::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--color-text-muted);
    border-radius: 50%;
}
@keyframes pulse-online {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

/* ========== UX - TICKETS KPI CLICÁVEIS ========== */
.ticket-kpi-clickable {
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
}
.ticket-kpi-clickable:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}
.ticket-kpi-clickable.active {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

/* ========== UX - QUICK ACTIONS ========== */
.quick-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: var(--section-gap);
}
.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
    cursor: pointer;
    transition: var(--transition);
}
.quick-action-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-primary-light);
}
.quick-action-btn .icon {
    color: var(--color-primary);
}

/* ========== UX - ATIVIDADE RECENTE ========== */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--color-border-light);
    cursor: pointer;
    transition: var(--transition-fast);
}
.activity-item:hover {
    background: var(--color-bg);
    margin: 0 -16px;
    padding: 16px;
    border-radius: var(--radius-md);
}
.activity-item:last-child {
    border-bottom: none;
}
.activity-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary-light);
    border-radius: 50%;
    font-size: 16px;
    flex-shrink: 0;
}
.activity-content {
    flex: 1;
    min-width: 0;
}
.activity-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 2px;
}
.activity-meta {
    font-size: 12px;
    color: var(--color-text-light);
}

/* ========== UX - CONFIGURAÇÕES SEPARADAS ========== */
.settings-section {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}
.settings-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border-light);
}
.settings-section-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary-light);
    border-radius: var(--radius-md);
    font-size: 20px;
}
.settings-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
}
.settings-section-subtitle {
    font-size: 13px;
    color: var(--color-text-light);
}

/* ========== UX - FEEDBACK VISUAL ========== */
.highlight-new {
    animation: highlight-fade 2s ease-out;
}
@keyframes highlight-fade {
    0% {
        background: rgba(59, 130, 246, 0.2);
    }
    100% {
        background: transparent;
    }
}

/* Tooltip melhorado */
[data-tooltip] {
    position: relative;
}
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: var(--color-sidebar);
    color: white;
    font-size: 12px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
    z-index: 1000;
}
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 8px);
}

/* ========== UX - ALERTAS DE DISCO COMPACTOS ========== */
.disk-alerts-container {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.disk-alerts-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}
.disk-alerts-title {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.disk-alerts-count {
    background: #dc2626;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}
.disk-alert-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.disk-alert-row:hover {
    background: #f8fafc;
}
.disk-alert-row .severity-icon {
    font-size: 14px;
    flex-shrink: 0;
}
.disk-alert-row .alert-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
}
.disk-alert-row .alert-value {
    font-size: 14px;
    font-weight: 700;
    min-width: 45px;
    text-align: right;
}
.disk-alert-row.critical .alert-value {
    color: #dc2626;
}
.disk-alert-row.warning .alert-value {
    color: #d97706;
}
.disk-alert-row .alert-arrow {
    color: #94a3b8;
    font-size: 12px;
}
.disk-alerts-more {
    font-size: 12px;
    color: #3b82f6;
    padding: 6px 8px;
    cursor: pointer;
    font-weight: 500;
}
.disk-alerts-more:hover {
    text-decoration: underline;
}

/* Tabela de Discos alinhada */
.disk-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

/* Tabela de Impressoras - largura total */
.impressoras-table {
    width: 100% !important;
    table-layout: fixed !important;
}
.impressoras-table thead,
.impressoras-table tbody,
.impressoras-table tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}
.impressoras-table th,
.impressoras-table td {
    font-size: 12px;
    word-break: break-word;
    overflow-wrap: break-word;
}
.impressoras-table th:nth-child(1),
.impressoras-table td:nth-child(1) {
    width: 16%;
}
.impressoras-table th:nth-child(2),
.impressoras-table td:nth-child(2) {
    width: 22%;
}
.impressoras-table th:nth-child(3),
.impressoras-table td:nth-child(3) {
    width: 30%;
}
.impressoras-table th:nth-child(4),
.impressoras-table td:nth-child(4) {
    width: 6%;
}
.impressoras-table th:nth-child(5),
.impressoras-table td:nth-child(5) {
    width: 8%;
}
.impressoras-table th:nth-child(6),
.impressoras-table td:nth-child(6) {
    width: 18%;
}
.disk-table th {
    text-align: left;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    border-bottom: 1px solid #e5e7eb;
}
.disk-table td {
    padding: 10px 12px;
    font-size: 13px;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
}
.disk-table tr:last-child td {
    border-bottom: none;
}
.disk-table tbody tr:nth-child(odd) {
    background: #ffffff;
}
.disk-table tbody tr:nth-child(even) {
    background: #f8fafc;
}
.disk-table tbody tr:hover {
    background: #e0f2fe !important;
}

/* ========== DROPDOWN DE AÇÕES ========== */
.dropdown-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 13px;
    color: var(--color-text);
    cursor: pointer;
    transition: var(--transition-fast);
}
.dropdown-item:hover {
    background: var(--color-bg);
}
.dropdown-item-danger {
    color: var(--color-danger) !important;
}
.dropdown-item-danger:hover {
    background: var(--color-danger-light) !important;
}

/* ========== HISTÓRICO - DESIGN COM HEADER ROXO ========== */

/* Header Roxo */
.hist-header-purple {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #818cf8 100%);
    color: white;
    padding: 24px 30px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: -20px -20px 0 -20px;
    position: relative;
    overflow: hidden;
}

.hist-header-purple::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hist-header-content {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.hist-header-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.hist-header-info h2 {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.hist-header-info p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
}

.hist-header-actions {
    display: flex;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.hist-header-btn {
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.hist-header-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

/* Stats Bar */
.hist-stats-bar {
    display: flex;
    gap: 20px;
    padding: 20px 30px;
    background: linear-gradient(135deg, #3730a3 0%, #4338ca 100%);
    margin: 0 -20px;
}

.hist-stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 10px;
    transition: all 0.2s;
}

.hist-stat-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hist-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.hist-stat-icon.hardware {
    background: #f43f5e;
}
.hist-stat-icon.software {
    background: #10b981;
}
.hist-stat-icon.rede {
    background: #f59e0b;
}
.hist-stat-icon.cadastro {
    background: #8b5cf6;
}

.hist-stat-info {
    display: flex;
    flex-direction: column;
    color: white;
}

.hist-stat-number {
    font-size: 20px;
    font-weight: 700;
}

.hist-stat-label {
    font-size: 10px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filters Bar */
.hist-filters-bar {
    display: flex;
    gap: 20px;
    padding: 20px 0;
    align-items: center;
    flex-wrap: wrap;
}

.hist-search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
    display: flex;
    align-items: center;
}

.hist-search-icon {
    position: absolute;
    left: 16px;
    font-size: 16px;
}

.hist-search-box input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    background: white;
    transition: all 0.2s;
}

.hist-search-box input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.hist-filter-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.hist-chip {
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    background: #f1f5f9;
    color: #64748b;
}

.hist-chip:hover {
    transform: translateY(-1px);
}

.hist-chip.active {
    background: #6366f1;
    color: white;
}

.hist-chip.hardware {
    background: #fff1f2;
    color: #e11d48;
    border-color: #fecdd3;
}
.hist-chip.hardware.active {
    background: #f43f5e;
    color: white;
    border-color: #f43f5e;
}

.hist-chip.software {
    background: #ecfdf5;
    color: #059669;
    border-color: #a7f3d0;
}
.hist-chip.software.active {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.hist-chip.rede {
    background: #fffbeb;
    color: #d97706;
    border-color: #fde68a;
}
.hist-chip.rede.active {
    background: #f59e0b;
    color: white;
    border-color: #f59e0b;
}

.hist-chip.cadastro {
    background: #faf5ff;
    color: #7c3aed;
    border-color: #ddd6fe;
}
.hist-chip.cadastro.active {
    background: #8b5cf6;
    color: white;
    border-color: #8b5cf6;
}

/* List Container */
.hist-list-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.hist-list-header {
    padding: 18px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
}

.hist-list-title {
    font-weight: 600;
    font-size: 15px;
    color: #1e293b;
}

.hist-list-count {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.hist-list-content {
    max-height: 500px;
    overflow-y: auto;
    padding: 16px;
}

.hist-empty-state {
    text-align: center;
    padding: 60px 40px;
    color: #94a3b8;
}

.hist-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.hist-empty-text {
    font-size: 14px;
}

/* Minimal List Items */
.hist-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 8px;
    background: #f8fafc;
    transition: all 0.2s;
    cursor: pointer;
}

.hist-item:hover {
    background: #f1f5f9;
    transform: translateX(4px);
}

.hist-item:last-child {
    margin-bottom: 0;
}

.hist-item-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.hist-item-dot.hardware {
    background: #f43f5e;
    box-shadow: 0 0 0 4px #fff1f2;
}
.hist-item-dot.software {
    background: #10b981;
    box-shadow: 0 0 0 4px #ecfdf5;
}
.hist-item-dot.rede {
    background: #f59e0b;
    box-shadow: 0 0 0 4px #fffbeb;
}
.hist-item-dot.cadastro {
    background: #8b5cf6;
    box-shadow: 0 0 0 4px #faf5ff;
}

.hist-item-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.hist-item-icon.hardware {
    background: #fff1f2;
}
.hist-item-icon.software {
    background: #ecfdf5;
}
.hist-item-icon.rede {
    background: #fffbeb;
}
.hist-item-icon.cadastro {
    background: #faf5ff;
}

.hist-item-content {
    flex: 1;
    min-width: 0;
}

.hist-item-title {
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
    margin-bottom: 4px;
}

.hist-item-change {
    font-size: 13px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hist-item-old {
    color: #94a3b8;
    text-decoration: line-through;
}

.hist-item-arrow {
    color: #6366f1;
    font-weight: 700;
}

.hist-item-new {
    font-weight: 600;
    color: #1e293b;
}

.hist-item-time {
    text-align: right;
    flex-shrink: 0;
}

.hist-item-hour {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}

.hist-item-date {
    font-size: 11px;
    color: #94a3b8;
}

/* Legacy support - keep old classes working */
.hist-top-bar {
    display: none;
}

.hist-dashboard-grid {
    display: none;
}

.hist-period-tabs {
    display: flex;
    background: white;
    border-radius: 12px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
    border: 1px solid #e2e8f0;
}

.hist-period-tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.hist-period-tab:hover {
    color: #6366f1;
    background: #f5f3ff;
}

.hist-period-tab.active {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.hist-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 12px 18px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
    border: 2px solid #e2e8f0;
    flex: 1;
    max-width: 320px;
    transition: all 0.2s;
}

.hist-search-bar:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.hist-search-bar input {
    border: none;
    background: transparent;
    font-size: 14px;
    width: 100%;
    outline: none;
    color: #1e293b;
}

.hist-search-bar input::placeholder {
    color: #94a3b8;
}

.hist-total-badge {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    padding: 12px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    font-size: 13px;
    color: white;
}

.hist-total-badge strong {
    color: white;
    font-size: 20px;
    font-weight: 700;
}

/* Dashboard Grid */
.hist-dashboard-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
}

/* Sidebar com categorias */
.hist-categories-sidebar {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.hist-sidebar-title {
    font-size: 11px;
    color: #6366f1;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hist-sidebar-title::before {
    content: '📊';
    font-size: 14px;
}

.hist-category-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 6px;
    border: 2px solid transparent;
}

.hist-category-item:hover {
    background: #f8fafc;
    transform: translateX(4px);
}

.hist-category-item.active {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border-color: #6366f1;
}

.hist-category-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hist-category-icon.all {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}
.hist-category-icon.rede {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}
.hist-category-icon.hardware {
    background: linear-gradient(135deg, #f43f5e, #e11d48);
}
.hist-category-icon.software {
    background: linear-gradient(135deg, #10b981, #059669);
}
.hist-category-icon.cadastro {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}
.hist-category-icon.config {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}
.hist-category-icon.seguranca {
    background: linear-gradient(135deg, #ec4899, #db2777);
}
.hist-category-icon.armazenamento {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}
.hist-category-icon.perifericos {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.hist-category-info {
    flex: 1;
}

.hist-category-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.hist-category-count {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.hist-category-bar {
    width: 100%;
    height: 5px;
    background: #e2e8f0;
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.hist-category-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.hist-category-bar-fill.rede {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}
.hist-category-bar-fill.hardware {
    background: linear-gradient(90deg, #f43f5e, #fb7185);
}
.hist-category-bar-fill.software {
    background: linear-gradient(90deg, #10b981, #34d399);
}
.hist-category-bar-fill.cadastro {
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}
.hist-category-bar-fill.perifericos {
    background: linear-gradient(90deg, #6366f1, #818cf8);
}
.hist-category-bar-fill.seguranca {
    background: linear-gradient(90deg, #ec4899, #f472b6);
}
.hist-category-bar-fill.armazenamento {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

/* Main Content */
.hist-main-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 650px;
    overflow-y: auto;
    padding-right: 8px;
}

.hist-main-content::-webkit-scrollbar {
    width: 6px;
}

.hist-main-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.hist-main-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.hist-main-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Date Header */
.hist-date-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    margin-top: 8px;
}

.hist-date-header:first-child {
    margin-top: 0;
}

.hist-date-header .dot {
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.hist-date-header .label {
    font-size: 12px;
    font-weight: 700;
    color: #6366f1;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hist-date-header .line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, #e2e8f0, transparent);
}

.hist-date-header .count {
    font-size: 11px;
    color: #6366f1;
    background: #eef2ff;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
}

/* Activity Card - Minimal Elegante */
.hist-activity-card {
    background: white;
    border-radius: 16px;
    padding: 18px 22px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    gap: 18px;
    align-items: center;
    transition: all 0.25s ease;
    border: 1px solid #e2e8f0;
    border-left: 4px solid transparent;
}

.hist-activity-card:hover {
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.12);
    transform: translateY(-2px);
    border-color: #c7d2fe;
}

.hist-activity-card.rede {
    border-left-color: #f59e0b;
}
.hist-activity-card.rede:hover {
    border-left-color: #f59e0b;
    background: linear-gradient(90deg, #fffbeb 0%, white 20%);
}
.hist-activity-card.hardware {
    border-left-color: #f43f5e;
}
.hist-activity-card.hardware:hover {
    border-left-color: #f43f5e;
    background: linear-gradient(90deg, #fff1f2 0%, white 20%);
}
.hist-activity-card.software {
    border-left-color: #10b981;
}
.hist-activity-card.software:hover {
    border-left-color: #10b981;
    background: linear-gradient(90deg, #ecfdf5 0%, white 20%);
}
.hist-activity-card.cadastro {
    border-left-color: #8b5cf6;
}
.hist-activity-card.cadastro:hover {
    border-left-color: #8b5cf6;
    background: linear-gradient(90deg, #faf5ff 0%, white 20%);
}
.hist-activity-card.config {
    border-left-color: #f59e0b;
}
.hist-activity-card.perifericos {
    border-left-color: #6366f1;
}
.hist-activity-card.perifericos:hover {
    border-left-color: #6366f1;
    background: linear-gradient(90deg, #eef2ff 0%, white 20%);
}
.hist-activity-card.seguranca {
    border-left-color: #ec4899;
}
.hist-activity-card.seguranca:hover {
    border-left-color: #ec4899;
    background: linear-gradient(90deg, #fdf2f8 0%, white 20%);
}
.hist-activity-card.armazenamento {
    border-left-color: #ef4444;
}
.hist-activity-card.armazenamento:hover {
    border-left-color: #ef4444;
    background: linear-gradient(90deg, #fef2f2 0%, white 20%);
}

.hist-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    position: relative;
}

.hist-card-icon::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    bottom: -2px;
    right: -2px;
    border: 2px solid white;
}

.hist-card-icon.rede {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}
.hist-card-icon.rede::after {
    background: #f59e0b;
}
.hist-card-icon.hardware {
    background: linear-gradient(135deg, #fff1f2 0%, #fecdd3 100%);
}
.hist-card-icon.hardware::after {
    background: #f43f5e;
}
.hist-card-icon.software {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}
.hist-card-icon.software::after {
    background: #10b981;
}
.hist-card-icon.cadastro {
    background: linear-gradient(135deg, #faf5ff 0%, #ede9fe 100%);
}
.hist-card-icon.cadastro::after {
    background: #8b5cf6;
}
.hist-card-icon.config {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}
.hist-card-icon.config::after {
    background: #f59e0b;
}
.hist-card-icon.perifericos {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
}
.hist-card-icon.perifericos::after {
    background: #6366f1;
}
.hist-card-icon.seguranca {
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
}
.hist-card-icon.seguranca::after {
    background: #ec4899;
}
.hist-card-icon.armazenamento {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}
.hist-card-icon.armazenamento::after {
    background: #ef4444;
}

.hist-card-body {
    flex: 1;
    min-width: 0;
}

.hist-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.hist-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
}

.hist-card-tag {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hist-card-tag.rede {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    color: #b45309;
}
.hist-card-tag.hardware {
    background: linear-gradient(135deg, #fff1f2, #fecdd3);
    color: #be123c;
}
.hist-card-tag.software {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #047857;
}
.hist-card-tag.cadastro {
    background: linear-gradient(135deg, #faf5ff, #ede9fe);
    color: #6d28d9;
}
.hist-card-tag.config {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    color: #b45309;
}
.hist-card-tag.perifericos {
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    color: #4338ca;
}
.hist-card-tag.seguranca {
    background: linear-gradient(135deg, #fdf2f8, #fce7f3);
    color: #be185d;
}
.hist-card-tag.armazenamento {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: #b91c1c;
}

.hist-card-description {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 10px;
}

.hist-card-diff {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 10px;
    font-size: 13px;
    border: 1px solid #e2e8f0;
}

.hist-card-diff .old {
    color: #94a3b8;
    text-decoration: line-through;
}

.hist-card-diff .arrow {
    color: #6366f1;
    font-size: 14px;
    font-weight: 700;
}

.hist-card-diff .new {
    color: #0f172a;
    font-weight: 700;
}

.hist-card-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

.hist-card-action.added {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #15803d;
}
.hist-card-action.removed {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #b91c1c;
}

.hist-card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
    flex-shrink: 0;
}

.hist-card-time {
    font-size: 13px;
    color: #64748b;
    text-align: right;
    padding: 8px 14px;
    background: #f8fafc;
    border-radius: 10px;
}

.hist-card-time .date {
    font-weight: 600;
    color: #475569;
    display: block;
    margin-bottom: 2px;
}

/* Card de largura total (sem grid) */
.info-card-full {
    background: var(--color-white);
    padding: 22px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-xs);
    width: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}
.info-card-full::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #3b82f6;
}
.info-card-full:hover {
    box-shadow: var(--shadow-md);
}
.info-card-full h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-light);
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Hostname Inline Edit */
.btn-icon-edit {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 6px;
    opacity: 0.6;
    transition: all 0.2s;
}
.btn-icon-edit:hover {
    opacity: 1;
    background: #f1f5f9;
}
.btn-icon-confirm {
    background: #dcfce7;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 6px 10px;
    border-radius: 6px;
    color: #16a34a;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-icon-confirm:hover {
    background: #bbf7d0;
}
.btn-icon-cancel {
    background: #fee2e2;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 6px 10px;
    border-radius: 6px;
    color: #dc2626;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-icon-cancel:hover {
    background: #fecaca;
}
.hostname-input {
    font-size: 18px;
    font-weight: 700;
    padding: 6px 12px;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    width: 200px;
    text-transform: uppercase;
    outline: none;
}
.hostname-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
.hostname-pending {
    font-size: 12px;
    color: #f59e0b;
    background: #fef3c7;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
}

/* Alertas inline na barra de status */
.status-alerts-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}
.alert-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}
.alert-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.alert-badge.critical {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.alert-badge.warning {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

/* Tabela de volumes com severidade */
.volume-row-critical {
    background: #fef2f2 !important;
    border-left: 3px solid #dc2626;
}
.volume-row-warning {
    background: #fffbeb !important;
    border-left: 3px solid #f59e0b;
}
.volume-row-critical td:first-child,
.volume-row-warning td:first-child {
    position: relative;
    padding-left: 12px;
}
.volume-severity-icon {
    margin-right: 6px;
    font-size: 14px;
}

/* Aba Discos com indicador de alerta */
.tab-btn.has-alert {
    position: relative;
}
.tab-btn.has-alert::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #dc2626;
    border-radius: 50%;
    animation: pulse-alert 2s infinite;
}
@keyframes pulse-alert {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

/* Progress bar com cores de severidade */
.progress-bar-sm .fill.critical {
    background: linear-gradient(90deg, #dc2626, #ef4444) !important;
}
.progress-bar-sm .fill.warning {
    background: linear-gradient(90deg, #d97706, #f59e0b) !important;
}
.progress-bar-sm .fill.normal {
    background: linear-gradient(90deg, #059669, #10b981) !important;
}

/* ========== NOVO DASHBOARD ========== */
.section-label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 24px 0 12px;
}
.section-label:first-of-type {
    margin-top: 0;
}

/* KPI Grid */
.dash-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}
.dash-kpi {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}
.dash-kpi:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
.dash-kpi::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}
.dash-kpi.green {
    background: rgba(34, 197, 94, 0.08);
}
.dash-kpi.green:hover {
    background: rgba(34, 197, 94, 0.18);
}
.dash-kpi.green::before {
    background: #22c55e;
}
.dash-kpi.red {
    background: rgba(239, 68, 68, 0.08);
}
.dash-kpi.red:hover {
    background: rgba(239, 68, 68, 0.18);
}
.dash-kpi.red::before {
    background: #ef4444;
}
.dash-kpi.blue {
    background: rgba(59, 130, 246, 0.08);
}
.dash-kpi.blue:hover {
    background: rgba(59, 130, 246, 0.18);
}
.dash-kpi.blue::before {
    background: #3b82f6;
}
.dash-kpi.purple {
    background: rgba(139, 92, 246, 0.08);
}
.dash-kpi.purple:hover {
    background: rgba(139, 92, 246, 0.18);
}
.dash-kpi.purple::before {
    background: #8b5cf6;
}
.dash-kpi.orange {
    background: rgba(245, 158, 11, 0.08);
}
.dash-kpi.orange:hover {
    background: rgba(245, 158, 11, 0.18);
}
.dash-kpi.orange::before {
    background: #f59e0b;
}
.dash-kpi.cyan {
    background: rgba(6, 182, 212, 0.08);
}
.dash-kpi.cyan:hover {
    background: rgba(6, 182, 212, 0.18);
}
.dash-kpi.cyan::before {
    background: #06b6d4;
}
.dash-kpi-icon {
    font-size: 28px;
    margin-bottom: 8px;
}
.dash-kpi-value {
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
}
.dash-kpi.green .dash-kpi-value {
    color: #16a34a;
}
.dash-kpi.red .dash-kpi-value {
    color: #dc2626;
}
.dash-kpi.blue .dash-kpi-value {
    color: #2563eb;
}
.dash-kpi.purple .dash-kpi-value {
    color: #7c3aed;
}
.dash-kpi.orange .dash-kpi-value {
    color: #d97706;
}
.dash-kpi.cyan .dash-kpi-value {
    color: #0891b2;
}
.dash-kpi-label {
    font-size: 13px;
    color: #64748b;
    margin-top: 4px;
}

/* Filter Cards (Computers Page) */
.filter-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12) !important;
}
#filter-card-all:hover {
    background: rgba(59, 130, 246, 0.18) !important;
}
#filter-card-online:hover {
    background: rgba(34, 197, 94, 0.18) !important;
}
#filter-card-offline:hover {
    background: rgba(239, 68, 68, 0.18) !important;
}
#filter-card-servers:hover {
    background: rgba(14, 165, 233, 0.18) !important;
}

/* Alert Grid */
.dash-alert-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}
.dash-alert {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid;
}
.dash-alert:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.dash-alert.critical {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fecaca;
}
.dash-alert.warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #fde68a;
}
.dash-alert.info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #bfdbfe;
}
.dash-alert.success {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #bbf7d0;
}
.dash-alert-icon {
    font-size: 28px;
    flex-shrink: 0;
}
.dash-alert-content {
    flex: 1;
    min-width: 0;
}
.dash-alert-title {
    font-weight: 600;
    font-size: 14px;
}
.dash-alert.critical .dash-alert-title {
    color: #991b1b;
}
.dash-alert.warning .dash-alert-title {
    color: #92400e;
}
.dash-alert.info .dash-alert-title {
    color: #1e40af;
}
.dash-alert.success .dash-alert-title {
    color: #166534;
}
.dash-alert-desc {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}
.dash-alert-count {
    font-size: 24px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 8px;
    min-width: 50px;
    text-align: center;
}
.dash-alert.critical .dash-alert-count {
    background: #fecaca;
    color: #dc2626;
}
.dash-alert.warning .dash-alert-count {
    background: #fde68a;
    color: #d97706;
}
.dash-alert.info .dash-alert-count {
    background: #bfdbfe;
    color: #2563eb;
}
.dash-alert.success .dash-alert-count {
    background: #bbf7d0;
    color: #16a34a;
}

/* Two Column Layout */
.dash-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}
@media (max-width: 1024px) {
    .dash-two-col {
        grid-template-columns: 1fr;
    }
}

/* Dashboard Cards */
.dash-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}
.dash-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.dash-card-title {
    font-weight: 600;
    font-size: 15px;
    color: #1e293b;
}
.dash-card-action {
    font-size: 12px;
    color: #3b82f6;
    cursor: pointer;
    text-decoration: none;
}
.dash-card-action:hover {
    text-decoration: underline;
}
.dash-card-body {
    padding: 16px 20px;
}

/* Dashboard Table */
.dash-table {
    width: 100%;
    font-size: 13px;
    border-collapse: collapse;
}
.dash-table th {
    text-align: left;
    padding: 10px 12px;
    background: #f8fafc;
    color: #64748b;
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
}
.dash-table td {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
}
.dash-table tr:last-child td {
    border-bottom: none;
}
.dash-table tr:hover {
    background: #f8fafc;
    cursor: pointer;
}

/* Distribution Bars */
.dash-dist-item {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
}
.dash-dist-item:last-child {
    margin-bottom: 0;
}
.dash-dist-label {
    width: 100px;
    font-size: 13px;
    color: #475569;
    flex-shrink: 0;
}
.dash-dist-bar-bg {
    flex: 1;
    height: 24px;
    background: #f1f5f9;
    border-radius: 6px;
    overflow: hidden;
    margin: 0 12px;
}
.dash-dist-bar {
    height: 100%;
    border-radius: 6px;
    display: flex;
    align-items: center;
    padding-left: 10px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    transition: width 0.5s ease;
}
.dash-dist-bar.blue {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}
.dash-dist-bar.green {
    background: linear-gradient(90deg, #22c55e, #4ade80);
}
.dash-dist-bar.purple {
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}
.dash-dist-bar.orange {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}
.dash-dist-bar.cyan {
    background: linear-gradient(90deg, #06b6d4, #22d3ee);
}
.dash-dist-value {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    min-width: 40px;
    text-align: right;
}

/* Timeline */
.dash-timeline-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}
.dash-timeline-item:last-child {
    border-bottom: none;
}
.dash-timeline-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.dash-timeline-icon.blue {
    background: #dbeafe;
}
.dash-timeline-icon.green {
    background: #dcfce7;
}
.dash-timeline-icon.orange {
    background: #fef3c7;
}
.dash-timeline-icon.red {
    background: #fee2e2;
}
.dash-timeline-content {
    flex: 1;
}
.dash-timeline-title {
    font-size: 13px;
    color: #1e293b;
}
.dash-timeline-title strong {
    font-weight: 600;
}
.dash-timeline-time {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

/* Status Grid */
.dash-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}
.dash-status-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
}
.dash-status-item.connected {
    background: #f0fdf4;
    border-color: #bbf7d0;
}
.dash-status-item.disconnected {
    background: #fef2f2;
    border-color: #fecaca;
}
.dash-status-icon {
    font-size: 32px;
}
.dash-status-info {
    flex: 1;
}
.dash-status-title {
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
}
.dash-status-desc {
    font-size: 13px;
    color: #64748b;
}

/* Status Badges */
.dash-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}
.dash-badge.aberto {
    background: #dbeafe;
    color: #1d4ed8;
}
.dash-badge.em_andamento {
    background: #fef3c7;
    color: #b45309;
}
.dash-badge.aguardando {
    background: #e0e7ff;
    color: #4338ca;
}
.dash-badge.fechado {
    background: #dcfce7;
    color: #16a34a;
}
.dash-priority {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}
.dash-priority.alta {
    background: #ef4444;
}
.dash-priority.media {
    background: #f59e0b;
}
.dash-priority.baixa {
    background: #22c55e;
}

/* Transição suave para tabelas ao filtrar */
#computers-table {
    transition: opacity 0.2s ease-in-out;
}
#computers-table.filtering {
    opacity: 0;
}
#computers-table tr {
    animation: fadeInRow 0.3s ease-out forwards;
}
@keyframes fadeInRow {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== DASHBOARD GRIDSTACK CUSTOMIZÁVEL ========== */
.grid-stack {
    background: transparent;
}

.grid-stack-item-content {
    background: transparent;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.dash-widget {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dash-widget-header {
    padding: 8px 12px;
    font-weight: 600;
    font-size: 13px;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border-light);
    background: var(--color-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.dash-widget-body {
    padding: 10px;
    flex: 1;
    overflow: auto;
}

/* Modo de edição */
.grid-stack.editing .grid-stack-item-content {
    border: 2px dashed var(--color-primary);
    cursor: move;
}

.grid-stack.editing .dash-widget {
    opacity: 0.95;
}

.grid-stack.editing .grid-stack-item:hover .grid-stack-item-content {
    border-color: var(--color-success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* Handle de resize */
.grid-stack .ui-resizable-se {
    background: var(--color-primary);
    width: 20px;
    height: 20px;
    border-radius: 4px 0 var(--radius-lg) 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.grid-stack.editing .ui-resizable-se {
    opacity: 1;
}

.grid-stack .ui-resizable-se::after {
    content: '⤡';
    position: absolute;
    right: 4px;
    bottom: 2px;
    color: white;
    font-size: 10px;
}

/* Placeholder durante drag */
.grid-stack-placeholder > .placeholder-content {
    background: var(--color-primary-light) !important;
    border: 2px dashed var(--color-primary) !important;
    border-radius: var(--radius-lg);
}

/* Ajustes para KPIs dentro do widget */
.dash-widget .dash-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    padding: 8px;
}

.dash-widget .dash-kpi {
    padding: 10px 8px;
}

.dash-widget .dash-kpi-icon {
    font-size: 18px;
}

.dash-widget .dash-kpi-value {
    font-size: 20px;
}

.dash-widget .dash-kpi-label {
    font-size: 11px;
}

/* Ajustes para Alertas dentro do widget */
.dash-widget .dash-alert-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    padding: 12px;
}

.dash-widget .dash-alert {
    padding: 18px 14px;
    min-height: 80px;
    display: flex;
    align-items: center;
}

.dash-widget .dash-alert-icon {
    font-size: 26px;
    width: 36px;
    text-align: center;
    flex-shrink: 0;
}

.dash-widget .dash-alert-content {
    flex: 1;
    min-width: 0;
}

.dash-widget .dash-alert-title {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-widget .dash-alert-desc {
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-widget .dash-alert-count {
    font-size: 18px;
    min-width: 32px;
    padding: 4px 8px;
    flex-shrink: 0;
}

/* Responsivo */
@media (max-width: 1400px) {
    .dash-widget .dash-alert-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1200px) {
    .dash-widget .dash-kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .dash-widget .dash-alert-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dash-widget .dash-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dash-widget .dash-alert-grid {
        grid-template-columns: 1fr;
    }
}

/* Toast animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Form Layout - Labels à esquerda, campos à direita */
.form-row-inline {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    gap: 16px;
}
.form-label-left {
    width: 120px;
    min-width: 120px;
    text-align: right;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
}
.form-field-right {
    flex: 1;
}
.form-field-right .form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}
.form-field-right .form-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

/* Alinhar botões de ação à direita nas tabelas */
.table td.actions {
    text-align: right !important;
    padding: 0 16px;
    vertical-align: middle;
    overflow: visible;
    background: transparent;
}

/* Drag and Drop para reordenação */
tr.drag-over {
    background: #eff6ff !important;
    border-top: 2px solid #3b82f6 !important;
}
tr[draggable='true'] {
    cursor: move;
}
.drag-handle {
    cursor: grab !important;
}
.drag-handle:active {
    cursor: grabbing !important;
}

/* Imagens inline na timeline */
.timeline-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.timeline-inline-image {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    cursor: pointer;
    transition:
        transform 0.2s,
        box-shadow 0.2s;
    border: 1px solid #e2e8f0;
}
.timeline-inline-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Modal de imagem ampliada */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    cursor: zoom-out;
}
.image-modal img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    border-radius: 4px;
}

/* Chave Inventário - Campo copiável */
.chave-inventario-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(241, 245, 249, 0.6);
    border: 1px solid rgba(203, 213, 225, 0.5);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}
.chave-inventario-copy:hover {
    background: rgba(226, 232, 240, 0.8);
    border-color: rgba(148, 163, 184, 0.6);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.chave-inventario-copy .copy-icon {
    font-size: 11px;
    opacity: 0.5;
    transition: opacity 0.2s;
}
.chave-inventario-copy:hover .copy-icon {
    opacity: 0.8;
}

/* ========== UPGRADE 2026 - ANIMAÇÕES E MODERNIZAÇÃO ========== */

/* Animações de entrada */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Aplicar animações */
.page.active {
    animation: fadeIn 0.2s ease-out;
}
.modal-content {
    animation: scaleIn 0.2s ease-out;
}
.card,
.stat-card,
.dash-widget {
    animation: slideUp 0.3s ease-out;
}

/* Hover effects modernos */
.btn {
    transition: var(--transition);
    transform: translateY(0);
}
.btn:hover {
    transform: translateY(-1px);
}
.btn:active {
    transform: translateY(0);
}

.card,
.stat-card {
    transition: var(--transition);
}
.card:hover,
.stat-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Tabelas responsivas */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -1px;
}
.table-responsive::-webkit-scrollbar {
    height: 6px;
}
.table-responsive::-webkit-scrollbar-track {
    background: var(--color-bg-secondary);
    border-radius: 3px;
}
.table-responsive::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}

/* Tabelas com hover */
.data-table tbody tr {
    transition: var(--transition-fast);
}
.data-table tbody tr:hover {
    background: var(--color-primary-light);
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-bg-secondary) 25%,
        var(--color-border-light) 50%,
        var(--color-bg-secondary) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-md);
}
@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Botões com gradiente */
.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, #2563eb 100%);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
}

/* Inputs modernos */
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

/* Cards com borda gradiente no hover */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), #8b5cf6);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    opacity: 0;
    transition: var(--transition);
}
.card:hover::before {
    opacity: 1;
}
.card {
    position: relative;
    overflow: hidden;
}

/* Badges modernos */
.badge,
.status-badge {
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 10px;
}

/* Scrollbar personalizada global */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--color-bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* ========== RESPONSIVIDADE MELHORADA ========== */

/* Tablet */
@media (max-width: 1024px) {
    :root {
        --page-padding: 20px;
        --card-padding: 20px;
    }
    .main-content {
        padding: 20px;
    }
    .page-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    .page-header .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --page-padding: 16px;
        --card-padding: 16px;
        --header-height: 56px;
    }

    /* Header mobile */
    .header {
        padding: 0 16px;
    }
    .company-dropdown {
        max-width: 140px;
        font-size: 12px;
    }

    /* Cards empilhados */
    .stats-grid,
    .kpi-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    /* Tabelas */
    .data-table {
        font-size: 12px;
    }
    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }

    /* Modais fullscreen */
    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    .modal-body {
        max-height: calc(100vh - 130px);
    }

    /* Formulários */
    .form-row {
        flex-direction: column;
    }
    .form-row > * {
        width: 100% !important;
    }

    /* Botões */
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    .btn-sm {
        padding: 6px 12px;
    }

    /* Sidebar overlay */
    .sidebar.open {
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    }
}

/* Mobile pequeno */
@media (max-width: 480px) {
    .stats-grid,
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    .page-title {
        font-size: 20px;
    }
    .card-title {
        font-size: 14px;
    }

    /* Login responsivo */
    .login-box {
        padding: 24px 20px;
        margin: 16px;
    }
}

/* ========== UTILITÁRIOS ========== */
.text-gradient {
    background: linear-gradient(135deg, var(--color-primary), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ========== FOOTER ========== */
.app-footer {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #94a3b8;
    padding: 24px 32px;
    margin-left: var(--sidebar-width);
    margin-top: auto;
    border-top: 1px solid #334155;
}
.footer-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}
.footer-line {
    margin: 6px 0;
    font-size: 12px;
    line-height: 1.6;
}
.footer-line:first-child {
    font-size: 13px;
    font-weight: 500;
    color: #e2e8f0;
}
.footer-dev a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
}
.footer-dev a:hover {
    color: #60a5fa;
    text-decoration: underline;
}
.footer-version {
    color: #64748b;
    font-size: 11px;
    margin-top: 8px;
}

@media (max-width: 768px) {
    .app-footer {
        margin-left: 0;
        padding: 20px 16px;
    }
    .footer-line {
        font-size: 11px;
    }
    .footer-line:first-child {
        font-size: 12px;
    }
}

/* ==================== ABA INTERNET - HISTÓRICO DE NAVEGAÇÃO ==================== */
.internet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 12px;
    margin-bottom: 16px;
    color: white;
}
.internet-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.internet-icon {
    font-size: 40px;
}
.internet-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}
.internet-header p {
    margin: 4px 0 0;
    opacity: 0.9;
    font-size: 13px;
}
.internet-filters {
    display: flex;
    gap: 10px;
    align-items: center;
}
.internet-filters select,
.internet-filters input {
    padding: 8px 12px;
    border-radius: 8px;
    border: none;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.95);
    color: #1e293b;
}
.internet-filters input {
    width: 200px;
}
.internet-filters select:focus,
.internet-filters input:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
}

.internet-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.internet-stat-card {
    flex: 1;
    min-width: 100px;
    padding: 12px 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    border: 1px solid #e2e8f0;
}
.internet-stat-card .stat-icon {
    font-size: 20px;
}
.internet-stat-card .stat-label {
    font-size: 12px;
    color: #64748b;
}
.internet-stat-card .stat-value {
    margin-left: auto;
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}
.internet-stat-card.chrome {
    border-left: 3px solid #4285f4;
}
.internet-stat-card.edge {
    border-left: 3px solid #0078d4;
}
.internet-stat-card.firefox {
    border-left: 3px solid #ff7139;
}
.internet-stat-card.brave {
    border-left: 3px solid #fb542b;
}
.internet-stat-card.opera {
    border-left: 3px solid #ff1b2d;
}
.internet-stat-card.comet {
    border-left: 3px solid #8b5cf6;
}

.internet-list {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    max-height: 500px;
    overflow-y: auto;
}
.internet-empty {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}
.internet-empty .empty-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}
.internet-empty p {
    font-size: 15px;
    margin: 0 0 8px;
    color: #64748b;
}
.internet-empty small {
    font-size: 12px;
}

.internet-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}
.internet-item:hover {
    background: #f8fafc;
}
.internet-item:last-child {
    border-bottom: none;
}
.internet-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.internet-item-icon.chrome {
    background: #e8f0fe;
}
.internet-item-icon.edge {
    background: #e6f2ff;
}
.internet-item-icon.firefox {
    background: #fff0eb;
}
.internet-item-icon.brave {
    background: #ffebe6;
}
.internet-item-icon.opera {
    background: #ffe6e8;
}

.internet-item-content {
    flex: 1;
    min-width: 0;
}
.internet-item-title {
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.internet-item-url {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.internet-item-url a {
    color: #3b82f6;
    text-decoration: none;
}
.internet-item-url a:hover {
    text-decoration: underline;
}
.internet-item-meta {
    text-align: right;
    flex-shrink: 0;
}
.internet-item-time {
    font-size: 11px;
    color: #64748b;
}
.internet-item-visits {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 2px;
}
/* ==================== FIM ABA INTERNET ==================== */
