/* ===== 0. VARIÁVEIS GLOBAIS E RESET ===== */
  :root {
    --bg-primary: #1a1a2a;
    --bg-secondary: #2a2a3a;
    --bg-tertiary: #3a3a5a;
    --border-color: #444;
    --text-primary: #fff;
    --text-secondary: #ccc;
    --text-muted: #888;
    --accent-color: #8aa4ff;
    --input-bg: #3a3a5a;
    --error-color: #d32f2f;
    --success-color: #388e3c;
    --warning-color: #f57c00;
    --info-color: #0d6efd;
    --font-family-base: "Segoe UI", sans-serif;
    --font-family-mono: 'Consolas', 'Monaco', 'Courier New', monospace;
    --shadow-light: 0 4px 10px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 8px 20px rgba(0, 0, 0, 0.4);
    --shadow-heavy: 0 10px 30px rgba(0, 0, 0, 0.7);
    --input-disabled-bg: #4a4a5a;
  }

  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  body {
    font-family: var(--font-family-base);
    background: linear-gradient(135deg, #1e1e2f, #3a3a5a);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
  }
/* ===== FIM VARIÁVEIS GLOBAIS E RESET ===== */

/* ===== 1. UTILITÁRIOS GERAIS ===== */
  .text-center { text-align: center; }
  .text-left { text-align: left; }
  .text-right { text-align: right; }

  .mt-1 { margin-top: 5px; }
  .mt-2 { margin-top: 10px; }
  .mt-3 { margin-top: 15px; }
  .mb-1 { margin-bottom: 5px; }
  .mb-2 { margin-bottom: 10px; }
  .mb-3 { margin-bottom: 15px; }

  .hidden { display: none !important; }
  .visible { display: block !important; }

  .content {
    max-width: 1600px;
    margin: 0 auto;
  }
/* ===== FIM UTILITÁRIOS GERAIS ===== */

/* ===== 2. BOTÕES GLOBAIS (CONSOLIDADO - V2) ===== */

/* Base do Botão */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px; /* Padronizado conforme solicitado */
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 11px; /* Ajustado para 11px */
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
    /* min-height removido */
}

/* Estados de Hover e Interação */
.btn:hover:not(:disabled):not(.btn-disabled) {
    transform: translateY(-1px);
}

/* Botão Desabilitado */
.btn-disabled, 
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    filter: grayscale(0.5);
    background: #666 !important;
    color: #999 !important;
    transform: none !important;
    box-shadow: none !important;
}

/* --- VARIANTE DE CORES (GRADIENTES ATUALIZADOS) --- */

/* Primary */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-light));
    color: white;
}
.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(138, 174, 255, 0.3);
}

/* Secondary */
.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: rgba(74, 74, 106, 0.3);
}

/* Success */
.btn-success { 
    background: linear-gradient(135deg, #2a5a2a, #3a6a3a); 
    color: white; 
}

/* Error / Delete */
.btn-error, 
.btn-delete {
    background: linear-gradient(135deg, #e53e3e, #c53030);
    color: white;
}

/* Warning / Password */
.btn-warning,
.btn-password {
    background: linear-gradient(135deg, #d69e2e, #b7791f) !important;
    color: white !important;
}

/* Info / Backup */
.btn-info,
.btn-backup {
    background: linear-gradient(135deg, #805ad5, #6b46c1);
    color: white;
}

/* --- VARIAÇÕES DE TAMANHO E LAYOUT --- */

.btn-sm, 
.btn-small {
    padding: 4px 8px; /* Proporcionalmente menor para textos curtos */
    font-size: 10px;
}

.btn-wide { 
    min-width: 200px; 
}

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}

.form-actions .btn {
    flex: 1;
    max-width: 200px;
}

/* ===== 3. FORMULÁRIOS GLOBAIS ===== */
  .form-container { max-width: 500px; margin: 0 auto; }
  .form-group { margin-bottom: 4px; }

  .form-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 6px;
    font-weight: 500;
  }

  .form-control,
  .form-group input,
  .form-group select,
  .form-group textarea {
    width: 100%;
    padding: 8px 10px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
  }

  .form-control:focus,
  .form-group input:focus,
  .form-group select:focus,
  .form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(138, 164, 255, 0.2);
  }

  .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 15px;
  }

  .form-group.full-width { grid-column: 1 / -1; }

  .checkbox-group {
    display: flex;
    gap: 10px;
    margin-top: 5px;
  }

  .checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    font-size: 13px;
    margin-bottom: 0;
    cursor: pointer;
  }

  .checkbox-group input[type="checkbox"] { margin-right: 5px; }
  .form-text { color: var(--text-muted); font-size: 12px; margin-top: 5px; display: block; }

  .input-row {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-bottom: 15px;
    align-items: flex-start;
  }

  .input-row .equipment-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
  }

  .input-row .equipment-field.full-width {
    width: 100% !important;
    flex: 1 1 100% !important;
}
/* ===== FIM FORMULÁRIOS GLOBAIS ===== */

/* ===== 4. MODAIS GLOBAIS ===== */
  .modal, .modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    backdrop-filter: blur(5px);
    overflow: auto;
    padding: 20px;
  }

  .modal-content, .modal-container {
    background: var(--bg-secondary);
    padding: 15px 20px;
    border: 1px solid var(--border-color);
    width: 424px;
    max-width: 424px;
    border-radius: 8px;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-name: animatecenterabs;
    animation-duration: 0.4s;
    margin: 0;
  }

  @keyframes animatecenterabs {
    from { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  }

  .modal-header {
    padding: 15px 20px;
    background-color: var(--bg-tertiary);
    color: var(--accent-color);
    border-bottom: 1px solid var(--border-color);
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 16px;
  }

  .close-modal, .close-btn, .close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
  }

  .close:hover, .close:focus,
  .close-modal:hover, .close-btn:hover {
    color: #ff4444;
    text-decoration: none;
    cursor: pointer;
    background: #5a5a7a;
  }

  .modal-body {
    padding: 15px 20px;
    min-height: 100px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
  }

  #videoModal .modal-container.modal-lg {
    width: 90%;
    max-width: 900px !important;
    transform: translate(-50%, -50%);
    top: 50%;
    left: 50%;
  }

  #tutorialVideoPlayer { background: black; border-radius: 6px; }
  #videoControls { flex-wrap: wrap; gap: 10px; }
  #videoControls button { padding: 5px 10px !important; font-size: 13px !important; }
  #playbackRate { width: 65px; text-align: center; appearance: none; -webkit-appearance: none; -moz-appearance: none; }

  .modal-sm { max-width: 400px; }
  .modal-md { max-width: 600px; }
  .modal-lg { max-width: 800px; }
  .modal-xl { max-width: 1000px; }
/* ===== FIM MODAIS GLOBAIS ===== */

/* ===== 5. DROPDOWN E MENUS ===== */
  .menu-dropdown { position: relative; z-index: 1002; }

  .dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    padding: 8px 0;
    border: 1px solid var(--bg-tertiary);
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: var(--shadow-heavy);
    z-index: 1001;
  }

  .dropdown-content .menu-item {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 8px 20px;
    font-size: 13px;
    margin: 0;
  }

  .dropdown-content .menu-item:hover { background: var(--bg-tertiary); }
  .menu-dropdown.active .dropdown-content { display: block; }

  .menu-dropdown.active > .menu-item {
    background: var(--bg-tertiary);
    border-radius: 4px 4px 0 0;
    border-color: #5a5aad;
  }

  .menu-dropdown > .menu-item::after {
    content: "▼";
    font-size: 10px;
    opacity: 0.7;
    transition: transform 0.2s;
  }

  .menu-dropdown.active > .menu-item::after { transform: rotate(180deg); }
  .menu-dropdown { position: relative; z-index: 1000; }
  .menu-dropdown.active { z-index: 1005; }
  .dropdown-content { z-index: 1006; }
/* ===== FIM DROPDOWN E MENUS ===== */

/* ===== 6. ALERTS & BADGES GLOBAIS ===== */
  .alert {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .alert-error, .alert-danger {
    background: var(--error-color);
    color: white;
    border-left: 4px solid #ff6b6b;
  }

  .alert-success {
    background: var(--success-color);
    color: white;
    border-left: 4px solid #6bff6b;
  }

  .alert-warning {
    background: var(--warning-color);
    color: white;
    border-left: 4px solid #ffaa00;
  }

  .alert-info {
    background: var(--info-color);
    color: white;
    border-left: 4px solid #3498db;
  }

  .badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    text-align: center;
    min-width: 50px;
  }

  .badge-admin { background: var(--accent-color); }
  .badge-user { background: #5a5a5a; }
  .badge-active { background: var(--success-color); }
  .badge-inactive { background: var(--error-color); }
  .badge-up { background: #00b300; }
  .badge-down { background: #666; }

  .badge-group { background: #2a5a7a; color: #8ff; }
  .badge-vendor { background: #2a6a6a; color: #a8fffb; }
  .badge-model { background: #7a7a2a; color: #fff9a8; }
  .badge-patrimony { background: #2a5a2a; color: #8f8; }
  .badge-port { background: #5a2a5a; color: #f8f; }
  .badge-vlan { background: #2a5a5a; color: #8ff; margin-top: 3px; display: block; }
  .badge-to { background: #5a2a2a; color: #f88; padding: 2px 6px; border-radius: 8px; font-size: 10px; cursor: help; }
/* ===== FIM ALERTS & BADGES GLOBAIS ===== */

/* ===== 7. SEÇÕES RECOLHÍVEIS ===== */
  .collapsible-section {
    border: 1px solid var(--bg-tertiary);
    border-radius: 4px;
    margin-bottom: 10px;
    overflow: visible;
    position: relative;
    padding-top: 20px;
  }

  .section-legend-title {
    position: unset;
    top: -10px;
    left: 10px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-weight: bold;
    font-size: 1.1em;
    padding: 0 10px;
    border-radius: 4px;
    z-index: 10;
  }

  .collapsible-header {
    padding: 8px;
    background-color: var(--bg-secondary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    border-bottom: 1px solid transparent;
    transition: background-color 0.2s;
    color: var(--accent-color);
  }

  .collapsible-header h4 { margin: 0; color: var(--accent-color); }
  .collapsible-header:hover { background-color: #3e5268; }

  .collapsible-header i.fa-chevron-down { transition: transform 0.3s ease; }
  .collapsible-section.expanded .collapsible-header i.fa-chevron-down { transform: rotate(180deg); }

  .collapsible-content {
    display: none;
    padding: 10px;
    background: var(--bg-primary);
  }

  .collapsible-section.expanded .collapsible-content { display: block; }

  .collapsible { transition: all 0.3s ease-in-out; overflow: hidden; }
  .collapsible:not(.expanded) { display: none; }
  .collapsible.expanded { display: block; }

  .toggle-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    flex-shrink: 0;
    margin-left: auto;
  }

  .toggle-btn:hover { background: rgba(255, 255, 255, 0.1); }
/* ===== FIM SEÇÕES RECOLHÍVEIS ===== */

/* ===== 8. CLI BOX GLOBAL ===== */
  .cli-box {
    background: #1a1a1a;
    color: #0f0;
    font-family: var(--font-family-mono);
    padding: 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    line-height: 1.3;
    font-size: 12px;
    box-shadow: inset 0 1px 10px rgba(0, 0, 0, 0.5);
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.7);
    min-height: 140px;
    max-height: 400px;
    overflow-y: auto;
  }

  .cli-span {
    display: block;
    word-break: break-word;
    line-height: 1.5;
    min-height: auto;
    margin: 0;
    padding: 0;
  }

  .cli-separator { color: #666; border-bottom: 1px solid #333; margin: 4px 0; display: block; height: 1px; }
  .cli-info { color: var(--accent-color); }
  .cli-cmd { color: #ffffff; }
  .cli-success { color: #00ff44; }
  .cli-error { color: #ff4444; }
  .cli-warning { color: #ffaa00; }
  .cli-data { color: #cccccc; }
  .cli-firmware { color: #ffaa00; font-weight: bold; }
/* ===== FIM CLI BOX GLOBAL ===== */

/* ===== 9. HEADER GLOBAL ===== */
  .deepseek-header {
    background: linear-gradient(135deg, #1a1a2a, #2a2a3a);
    color: white;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 50px;
    transition: background-color 0.3s, border-bottom-color 0.3s;
  }

  .header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    font-size: 18px;
  }

  .header-right {
    display: flex;
    align-items: center;
    gap: 15px;
  }

  .user-welcome { color: var(--text-secondary); font-size: 14px; }
  .header-controls { display: flex; gap: 10px; margin-right: 15px; }

  .theme-toggle, .debug-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
  }

  .theme-toggle:hover, .debug-toggle:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-color);
    transform: scale(1.1);
  }

  .theme-toggle.active, .debug-toggle.active {
    background: var(--accent-color);
    color: #fff;
  }

  .menu-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
  }

  .menu-toggle:hover { background: var(--bg-tertiary); }

  #floating-debug-legend {
    position: fixed;
    top: 100px;
    right: 20px;
    width: 680px;
    height: 550px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-heavy);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    font-family: var(--font-family-base);
  }

  #floating-debug-legend .legend-header {
    background: var(--bg-tertiary);
    padding: 10px;
    cursor: move;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  #floating-debug-legend .legend-header h4 {
    margin: 0;
    font-size: 13px;
    color: var(--accent-color);
    font-weight: 600;
  }

  #floating-debug-legend .legend-header button { transition: color 0.2s; }
  #floating-debug-legend .legend-header button:hover { color: #fff !important; }

  #floating-debug-legend .legend-content {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-primary);
    padding: 0;
  }

  .debug-details { border-bottom: 1px solid var(--border-color); }
  .debug-summary {
    padding: 10px;
    background: #252535;
    cursor: pointer;
    color: #fff;
    font-weight: bold;
    font-size: 11px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;
  }

  .debug-summary:hover { background: #303040; }
  .debug-summary::-webkit-details-marker { display: none; }

  .post-summary { border-left: 3px solid #f57c00; }
  .get-summary  { border-left: 3px solid #388e3c; }
  .js-summary   { border-left: 3px solid #bd93f9; }

  .count-badge {
    background: rgba(255,255,255,0.1);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 9px;
  }

  .table-scroll-wrapper {
    overflow-x: auto;
    width: 100%;
    background: var(--bg-primary);
    max-height: 200px;
  }

  .debug-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    font-size: 11px;
  }

  .debug-table th {
    background-color: #252535;
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .debug-table td, 
  .debug-table th {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    text-align: left;
    color: var(--text-secondary);
  }

  .debug-table td i { margin-right: 5px; opacity: 0.7; }
/* ===== FIM HEADER GLOBAL ===== */

/* ===== 10. SIDEBAR GLOBAL ===== */
  .sidebar {
    width: 240px;
    background: var(--bg-primary);
    height: calc(100vh - 50px);
    padding: 15px 12px;
    position: fixed;
    left: 0;
    top: 50px;
    transition: transform 0.3s ease, background-color 0.3s;
    z-index: 999;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
  }

  .sidebar.hidden { transform: translateX(-100%); }
  .sidebar nav { display: flex; flex-direction: column; gap: 8px; }

  .menu-item {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 4px;
    padding: 10px 15px;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: visible;
    margin-bottom: 4px;
  }

  .menu-item:hover, .menu-item.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: #5a5aad;
  }

  .menu-item i { width: 16px; text-align: center; font-size: 14px; opacity: 0.8; }

  .user-area {
    margin-top: auto;
    padding: 15px 12px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
    position: sticky;
    bottom: 0;
    z-index: 100;
  }

  .user-info { margin-bottom: 10px; }
  .user-name { display: block; color: #fff; font-weight: 600; font-size: 14px; margin-bottom: 3px; }
  .user-role { display: block; color: var(--accent-color); font-size: 12px; }
  .user-actions { display: flex; flex-direction: column; gap: 5px; }

  .user-menu-item {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 4px;
    padding: 10px 15px;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    width: 100%;
    font-weight: 500;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .user-menu-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: #5a5aad;
  }

  .user-menu-item i { width: 14px; text-align: center; font-size: 13px; opacity: 0.8; }
  .logout-btn { background: #c62828 !important; border-color: #d32f2f !important; }
  .logout-btn:hover { background: #d32f2f !important; border-color: #f44336 !important; }
/* ===== FIM SIDEBAR GLOBAL ===== */

/* ===== 11. MAIN CONTENT & FOOTER GLOBAIS ===== */
  .main-content {
    margin-left: 240px;
    margin-top: 50px;
    padding: 20px;
    transition: margin-left 0.3s ease;
    min-height: calc(100vh - 100px);
    position: relative;
    z-index: 1;
  }

  .main-content.expanded { margin-left: 0; }

  .container {
    background: #2e2e45;
    border-radius: 12px;
    box-shadow: var(--shadow-medium);
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
  }

  .footer {
    background: var(--bg-primary);
    color: var(--text-secondary);
    text-align: center;
    padding: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    position: fixed;
    bottom: 0;
    left: 240px;
    right: 0;
    z-index: 998;
    transition: left 0.3s ease, background-color 0.3s, border-top-color 0.3s;
    height: auto;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .footer.expanded { left: 0; }
/* ===== FIM MAIN CONTENT & FOOTER GLOBAIS ===== */

/* ===== 12. PAGINAÇÃO GLOBAL ===== */
  .pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    gap: 10px;
    flex-wrap: wrap;
  }

  .pagination-info { color: var(--text-muted); font-size: 14px; margin: 0 15px; }

  .page-btn {
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.2s;
  }

  .page-btn:hover { background: #4a4a6a; }
  .page-btn.active { background: #5a5aad; border-color: #6a6acd; }
  .page-btn:disabled { background: #2a2a3a; color: #666; cursor: not-allowed; }
  .page-btn.hidden { display: none; }

  .items-per-page {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 20px;
  }

  .items-per-page select {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 5px;
    border-radius: 4px;
}
/* ===== FIM PAGINAÇÃO GLOBAL ===== */

/* ===== 13. SCROLLBAR PERSONALIZADO ===== */
  .list-container::-webkit-scrollbar,
  .switches-list::-webkit-scrollbar,
  #cliOutput::-webkit-scrollbar,
  #tab-content-config.active::-webkit-scrollbar,
  .checkbox-list::-webkit-scrollbar,
  .modal-body::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  .list-container::-webkit-scrollbar-track,
  .switches-list::-webkit-scrollbar-track,
  #cliOutput::-webkit-scrollbar-track,
  #tab-content-config.active::-webkit-scrollbar-track,
  .checkbox-list::-webkit-scrollbar-track,
  .modal-body::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
  }

  .list-container::-webkit-scrollbar-thumb,
  .switches-list::-webkit-scrollbar-thumb,
  #cliOutput::-webkit-scrollbar-thumb,
  #tab-content-config.active::-webkit-scrollbar-thumb,
  .checkbox-list::-webkit-scrollbar-thumb,
  .modal-body::-webkit-scrollbar-thumb {
    background: #5a5aad;
    border-radius: 4px;
  }

  .list-container::-webkit-scrollbar-thumb:hover,
  .switches-list::-webkit-scrollbar-thumb:hover,
  #cliOutput::-webkit-scrollbar-thumb:hover,
  #tab-content-config.active::-webkit-scrollbar-thumb:hover,
  .checkbox-list::-webkit-scrollbar-thumb:hover,
  .modal-body::-webkit-scrollbar-thumb:hover {
    background: #6a6acd;
}
/* ===== FIM SCROLLBAR PERSONALIZADO ===== */

/* ===== 14. TEMA CLARO ===== */
  body.light-theme {
    --bg-primary: #f4f6f8;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eef2f5;
    --border-color: #dce1e6;
    --text-primary: #2c3e50;
    --text-secondary: #5e6d7e;
    --text-muted: #8898aa;
    --accent-color: #4a5568;
    --input-bg: #fdfdfd;
    --error-color: #dc3545;
    --success-color: #198754;
    --info-color: #0d6efd;
    --warning-color: #ffc107;
    --input-disabled-bg: #e9ecef;
    
    background-color: var(--bg-primary) !important;
    background-image: none !important;
    color: var(--text-primary);
  }

  body.light-theme .deepseek-header{
    background: unset;
  }

  body.light-theme .theme-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-light);
    color: var(--text-primary);
  }

  body.light-theme .header-left span,
  body.light-theme .user-welcome { color: var(--text-primary); }

  body.light-theme .menu-toggle { color: var(--text-secondary); }
  body.light-theme .menu-toggle:hover { background: var(--bg-tertiary); }

  body.light-theme .user-area {
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
  }

  body.light-theme .user-area .user-name { color: var(--text-primary); }
  body.light-theme .user-area .user-role { color: var(--accent-color); }

  body.light-theme .user-area .user-menu-item {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 4px;
  }

  body.light-theme .user-area .user-menu-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--accent-color);
  }

  body.light-theme .user-area .logout-btn {
    background: var(--error-color) !important;
    border-color: var(--error-color) !important;
    color: white !important;
  }

  body.light-theme .user-area .logout-btn:hover {
    background: #c62828 !important;
    border-color: #c62828 !important;
  }

  body.light-theme .sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
  }

  body.light-theme .menu-item {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 4px;
  }

  body.light-theme .menu-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--accent-color);
    transform: none;
    box-shadow: none;
  }

  body.light-theme .menu-item.active {
    background: var(--bg-tertiary);
    color: var(--accent-color);
    border-color: var(--accent-color);
    font-weight: 600;
  }

  body.light-theme .dropdown-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-top: none;
    box-shadow: var(--shadow-light);
  }

  body.light-theme .dropdown-content .menu-item {
    color: var(--text-secondary);
    border-left: 3px solid transparent;
  }

  body.light-theme .dropdown-content .menu-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-left-color: var(--accent-color);
  }

  body.light-theme .menu-dropdown.active > .menu-item {
    background: var(--bg-tertiary);
    color: var(--accent-color);
    border-color: var(--accent-color);
    font-weight: 600;
  }

  body.light-theme .btn-primary,
  body.light-theme .mode-select-btn {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
  }

  body.light-theme .btn-primary:hover,
  body.light-theme .mode-select-btn:hover {
    background: #3c4456;
    border-color: #3c4456;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  }

  body.light-theme .btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
  }

  body.light-theme .btn-secondary:hover {
    background: #dbe0e5;
    color: var(--text-primary);
    border-color: #adb5bd;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }

  body.light-theme .form-control,
  body.light-theme input[type="text"],
  body.light-theme input[type="password"],
  body.light-theme input[type="email"],
  body.light-theme input[type="number"],
  body.light-theme textarea,
  body.light-theme select {
    background-color: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
  }

  body.light-theme .form-control:focus,
  body.light-theme input:focus,
  body.light-theme textarea:focus,
  body.light-theme select:focus {
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 0 2px rgba(74, 85, 104, .15) !important;
    background-color: var(--input-bg) !important;
  }

  body.light-theme ::placeholder { color: var(--text-muted) !important; }

  body.light-theme .table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
  }

  body.light-theme .data-table th,
  body.light-theme .users-table th {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color);
  }

  body.light-theme .data-table thead tr:first-child th.header-group-0 { background-color: unset !important; }
  body.light-theme .data-table thead tr:first-child th.header-group-1 { background-color: unset !important; }
  body.light-theme .data-table thead tr:first-child th.header-group-2 { background-color: unset !important; }
  body.light-theme .data-table thead tr:first-child th.header-group-3 { background-color: unset !important; }

  body.light-theme .data-table td,
  body.light-theme .users-table td {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
  }

  body.light-theme .data-table tr:nth-child(even) td,
  body.light-theme .users-table tr:nth-child(even) td {
    background: #f8f9fa !important;
  }

  body.light-theme .data-table tr:hover td,
  body.light-theme .users-table tr:hover td {
    background: var(--bg-tertiary);
  }

  body.light-theme .modal-content,
  body.light-theme .modal-container {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-light);
  }

  body.light-theme .modal-header {
    background-color: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
  }

  body.light-theme .alert-error,
  body.light-theme .alert-danger {
    background: #f8d7da !important;
    color: var(--error-color) !important;
    border-left-color: var(--error-color);
  }

  body.light-theme .alert-success {
    background: #d4edda;
    color: var(--success-color);
    border-left-color: var(--success-color);
  }

  body.light-theme .alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left-color: #856404;
  }

  body.light-theme .alert-info {
    background: #eef3ff !important;
    color: var(--info-color) !important;
    border-left-color: var(--info-color);
  }

  body.light-theme .cli-box {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    text-shadow: none;
    border: 1px solid var(--border-color);
    box-shadow: none;
  }

  body.light-theme .cli-info { color: var(--accent-color); }
  body.light-theme .cli-cmd { color: var(--text-primary); }
  body.light-theme .cli-success { color: var(--success-color); }
  body.light-theme .cli-error { color: var(--error-color); }

  body.light-theme .footer {
    background: var(--bg-secondary);
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
  }

  body.light-theme .container,
  body.light-theme .auth-box,
  body.light-theme .dashboard-card,
  body.light-theme .mode-card,
  body.light-theme .form-container,
  body.light-theme .list-container,
  body.light-theme .user-content,
  body.light-theme .switches-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-light);
    color: var(--text-primary);
  }

  body.light-theme .dashboard-card h3,
  body.light-theme .mode-card h3,
  body.light-theme h2, body.light-theme h3 {
    color: var(--text-primary);
  }

  body.light-theme .dashboard-card p,
  body.light-theme .mode-card p {
    color: var(--text-secondary);
  }

  body.light-theme .mode-icon i { color: var(--accent-color); }

  body.light-theme .badge-group { background: #eef2f5; color: var(--accent-color); }
  body.light-theme .badge-vendor { background: #d4edda; color: var(--success-color); }
  body.light-theme .badge-model { background: #fff3cd; color: #856404; }
  body.light-theme .badge-port { background: #eef2f5; color: var(--text-primary); }
  body.light-theme .badge-vlan { background: #e0f7fa; color: #00796b; }
  body.light-theme .badge-to { background: #f8d7da; color: #721c24; }

  body.light-theme .firmware-outdated {
    background-color: #f8d7da !important;
    color: var(--error-color) !important;
  }

  body.light-theme .firmware-up-to-date {
    background-color: #d4edda !important;
    color: var(--success-color) !important;
  }

  body.light-theme .firmware-missing {
    color: var(--text-muted) !important;
    font-style: italic;
  }

  body.light-theme .switch-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-light);
  }

  body.light-theme .switch-header .model-tab,
  body.light-theme .switch-header .ip-tab {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-bottom: none;
  }

  body.light-theme .switch-header .model-tab h3 { color: var(--text-primary); }
  body.light-theme .switch-header .ip-tab span { color: var(--accent-color); }

  body.light-theme .switch-body {
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    box-shadow: none;
  }

  body.light-theme .port-item {
    background: var(--bg-secondary);
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  body.light-theme .port-item:hover {
    background: #f1f3f5;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  }

  body.light-theme #portInfoModal .modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-medium);
  }

  body.light-theme #portInfoModal .form-group input[readonly],
  body.light-theme #portInfoModal .form-group textarea {
    background: #f8f9fa;
    color: var(--text-secondary);
    border: 1px solid #e9ecef;
  }

  body.light-theme #portInfoModal .form-group input,
  body.light-theme #portInfoModal .form-group select {
    background-color: var(--input-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
  }

  body.light-theme .filter-group label { color: var(--text-muted); }
  body.light-theme .info-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-light);
  }

  body.light-theme .info-header {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
  }

  body.light-theme .info-item { border-bottom: 1px solid #e9ecef; }
  body.light-theme .info-item label { color: var(--text-muted); }
  body.light-theme .info-value { color: var(--text-primary); }

  body.light-theme .legend-collapsible {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-light);
  }

  body.light-theme .legend-toggle {
    background: var(--bg-tertiary);
    color: var(--text-primary);
  }

  body.light-theme .legend-box {
    background: var(--bg-secondary);
    color: var(--text-secondary);
  }

  body.light-theme .legend-box td { color: var(--text-secondary); }

  body.light-theme .port-item.vlan-highlight {
    animation: vlan-pulse-light 2s infinite;
  }

  @keyframes vlan-pulse-light {
    0% { border-color: #e44949af; border-width: 1px; }
    50% { border-color: var(--accent-color); border-width: 3px; }
    100% { border-color: #e44949af; border-width: 1px; }
  }

  body.light-theme .port-item.filtered-out {
    opacity: 0.15;
    transform: scale(0.9);
    background: var(--bg-tertiary); 
  }

  body.light-theme .status-msg {
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
  }

  body.light-theme .filters-modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-medium);
  }

  body.light-theme .filters-modal-header {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
  }

  body.light-theme .filter-divider::before { background: var(--border-color); }
  body.light-theme .filter-divider span {
    background: var(--bg-secondary);
    color: var(--accent-color);
  }

  body.light-theme #filters-modal .filter-group select {
    background: var(--input-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
  }

  body.light-theme #filter-box {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(200, 200, 220, 0.8);
  }

  body.light-theme .switches-header { background: var(--bg-tertiary); }
  body.light-theme .switch-item:hover { background: var(--bg-tertiary); }
  body.light-theme .section-header {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
  }

  body.light-theme .section-header:hover { background: #e2e6ea; }
  body.light-theme #search-results .cli-span[style*="color: #fff"],
  body.light-theme #search-results .cli-span b[style*="color:#fff"] {
    color: var(--text-primary) !important;
  }

  body.light-theme #search-results .cli-span b[style*="color:#0f0"] {
    color: var(--success-color) !important;
  }

  body.light-theme #search-results .cli-span b[style*="color:#f00"] {
    color: var(--error-color) !important;
  }

  body.light-theme .collapsible-header {
    padding: 8px;
    background-color: var(--bg-tertiary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
    color: var(--accent-color);
  }

  body.light-theme .collapsible-header h4 { margin: 0; color: var(--text-primary); }
  body.light-theme .collapsible-header:hover { background-color: #e2e6ea; }
  body.light-theme .section-header h7 { color: var(--text-primary); }

  body.light-theme .main-layout {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-light);
  }

  body.light-theme .content-wrapper { background: var(--bg-secondary); }
  body.light-theme .main-title {
    color: var(--accent-color);
    background: var(--bg-tertiary);
  }

  body.light-theme .tab-bar {
    background: var(--bg-tertiary);
    border-left: 1px solid var(--border-color);
  }

  body.light-theme .tab-item {
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
  }

  body.light-theme .tab-item.active {
    background-color: var(--bg-secondary);
    color: var(--accent-color);
  }

  body.light-theme .control-footer-wrapper {
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
  }

  body.light-theme .collapsible-content { background: var(--bg-secondary); }
  body.light-theme .section-legend-title {
    background: var(--bg-secondary);
    color: var(--text-primary);
  }

  body.light-theme .cli-box {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
  }

  body.light-theme .cli-group-row {
    background: #f8f9fa;
    border-left-color: var(--accent-color);
  }

  body.light-theme .cli-group-row.active { background: rgba(74, 85, 104, 0.1); }
  body.light-theme .cli-group-row.completed { background: rgba(25, 135, 84, 0.1); }
  body.light-theme .cli-group-row.failed { background: rgba(220, 53, 69, 0.1); }

  body.light-theme .fa-spinner.fa-spin { color: var(--accent-color); }
  body.light-theme .cli-group-row span:nth-child(2) { color: var(--text-primary); }
  body.light-theme #tutorialContainer {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    box-shadow: none;
  }

  body.light-theme #tutorialStepTitle { color: var(--accent-color); }

  body.light-theme #ipConfig .chk-item:has(#chk_change_vlan) {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
  }

  body.light-theme #vlanAdminId:disabled {
    background-color: var(--input-disabled-bg);
    color: var(--text-muted);
}
/* ===== FIM TEMA CLARO ===== */

/* ===== 15. TEMA ESCURO ALTERNATIVO (theme-dark) - Cores Neutras ===== */
  body.theme-dark {
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-tertiary: #2d2d2d;
    --border-color: #404040;
    --text-primary: #e8e8e8;
    --text-secondary: #b0b0b0;
    --text-muted: #8a8a8a;
    --accent-color: #6c7a8c; /* Cinza-azulado neutro */
    --input-bg: #2d2d2d;
    --error-color: #ff6b6b;
    --success-color: #5cd85a;
    --warning-color: #ffb347;
    --info-color: #6c7a8c; /* Coordenado com accent-color */
    
    background: linear-gradient(135deg, #121212, #1e1e1e) !important;
    color: var(--text-primary);
  }

  body.theme-dark .deepseek-header {
    background: linear-gradient(135deg, #121212, #1e1e1e);
    border-bottom: 1px solid var(--border-color);
  }

  body.theme-dark .sidebar {
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
  }

  body.theme-dark .menu-item {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
  }

  body.theme-dark .menu-item:hover,
  body.theme-dark .menu-item.active {
    background: #323232; /* Cinza um pouco mais claro */
    color: #cccccc; /* Cinza claro */
    border-color: #484848; /* Borda cinza */
  }

  body.theme-dark .btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
  }

  body.theme-dark .btn:hover {
    background: #323232; /* Cinza mais claro */
    border-color: #484848; /* Borda cinza */
  }

  body.theme-dark .btn-primary {
    background: #4a5568; /* Cinza azulado escuro */
    border-color: #5a6578; /* Cinza azulado um pouco mais claro */
    color: #ffffff;
  }

  body.theme-dark .btn-primary:hover {
    background: #5a6578; /* Mais claro no hover */
    border-color: #6a7588;
  }

  body.theme-dark .container,
  body.theme-dark .auth-box,
  body.theme-dark .dashboard-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
  }

  body.theme-dark .cli-box {
    background: #1a1a1a;
    color: #8ba0c0; /* Azul acinzentado suave */
    border: 1px solid var(--border-color);
    text-shadow: 0 0 5px rgba(139, 160, 192, 0.5);
  }

  body.theme-dark .cli-info { color: #8ba0c0; }
  body.theme-dark .cli-cmd { color: var(--text-primary); }
  body.theme-dark .cli-success { color: #5cd85a; }
  body.theme-dark .cli-error { color: #ff6b6b; }
  body.theme-dark .cli-warning { color: #ffb347; }
  body.theme-dark .cli-data { color: #b0b0b0; }
  body.theme-dark .cli-firmware { color: #ffb347; }

  body.theme-dark .badge-group { background: #3a4a5a; color: #a0b5d5; }
  body.theme-dark .badge-vendor { background: #3a5a5a; color: #a0d5d5; }
  body.theme-dark .badge-model { background: #5a5a3a; color: #d5d5a0; }
  body.theme-dark .badge-port { background: #5a3a5a; color: #d5a0d5; }
  body.theme-dark .badge-vlan { background: #3a5a6a; color: #a0d5e5; }
  body.theme-dark .badge-to { background: #5a3a3a; color: #d5a0a0; }
  
  body.theme-dark .alert-error {
    background: #3a2222;
    color: #ff6b6b;
    border-left: 4px solid #ff6b6b;
  }
  
  body.theme-dark .alert-success {
    background: #223a22;
    color: #5cd85a;
    border-left: 4px solid #5cd85a;
  }
  
  body.theme-dark .alert-warning {
    background: #3a3222;
    color: #ffb347;
    border-left: 4px solid #ffb347;
  }
  
  body.theme-dark .alert-info {
    background: #222a3a;
    color: #8ba0c0;
    border-left: 4px solid #8ba0c0;
  }
  
  /* Ajustes para tabelas no tema escuro */
  body.theme-dark .data-table th {
    background: #2a2a2a !important;
  }
  
  body.theme-dark .data-table tr:nth-child(even) {
    background: #252525;
  }
  
  body.theme-dark .data-table tr:hover {
    background: #323232;
  }
  
  body.theme-dark .data-table a {
    color: #8ba0c0;
    font-style: italic;
    text-decoration: none;
    font-size: 11px;
  }

  body.theme-dark .data-table a:hover {
    color: #a0b5d5;
    text-decoration: underline;
  }
  
  /* Ajustes para modais */
  body.theme-dark .modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
  }
  
  body.theme-dark .modal-header {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    color: #cccccc;
  }
  
  /* Ajustes para formulários */
  body.theme-dark .form-control {
    background: var(--input-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
  }
  
  body.theme-dark .form-control:focus {
    border-color: #555555;
    box-shadow: 0 0 0 2px rgba(85, 85, 85, 0.2);
  }
  
  /* Ajustes para botões específicos */
  body.theme-dark .btn-secondary {
    background: #3a3a3a;
    border-color: #4a4a4a;
  }
  
  body.theme-dark .btn-success {
    background: #2a5a2a;
    border-color: #3a6a3a;
  }
  
  body.theme-dark .btn-error,
  body.theme-dark .btn-delete {
    background: #5a2a2a;
    border-color: #6a3a3a;
  }
  
  body.theme-dark .btn-warning {
    background: #5a4a2a;
    border-color: #6a5a3a;
  }
  
  body.theme-dark .btn-info {
    background: #2a4a5a;
    border-color: #3a5a6a;
  }
  
  /* Ajustes para collapsible sections */
  body.theme-dark .collapsible-header {
    background: var(--bg-tertiary);
    color: #cccccc;
  }
  
  body.theme-dark .collapsible-header:hover {
    background: #323232;
  }
  
  body.theme-dark .collapsible-content {
    background: var(--bg-secondary);
  }
  
  body.theme-dark .section-legend-title {
    background: var(--bg-primary);
    color: #cccccc;
  }
  
  /* Ajustes para dropdowns */
  body.theme-dark .dropdown-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
  }
  
  body.theme-dark .dropdown-content .menu-item:hover {
    background: #323232;
    color: #cccccc;
  }
  
  body.theme-dark .menu-dropdown.active > .menu-item {
    background: #323232;
    color: #cccccc;
    border-color: #555555;
  }
  
  /* Ajustes para paginação */
  body.theme-dark .page-btn {
    background: #3a3a3a;
    border-color: #4a4a4a;
    color: #cccccc;
  }
  
  body.theme-dark .page-btn:hover {
    background: #4a4a4a;
  }
  
  body.theme-dark .page-btn.active {
    background: #5a5a5a;
    border-color: #6a6a6a;
  }
  
  /* Ajustes para toggle buttons */
  body.theme-dark .toggle-btn {
    border: 1px solid #555555;
    color: #cccccc;
  }
  
  body.theme-dark .toggle-btn:hover {
    background: #3a3a3a;
  }
  
  /* Ajustes para filtros */
  body.theme-dark .filter-group-header {
    background: #2d2d2d;
    color: #b0b0b0;
    border: 1px solid #404040;
  }
  
  body.theme-dark .filter-group-header:hover {
    background: #353535;
  }
  
  /* Ajustes para badges de firmware */
  body.theme-dark .firmware-outdated {
    background-color: #3a2222 !important;
    color: #ff6b6b !important;
  }
  
  body.theme-dark .firmware-up-to-date {
    color: #5cd85a !important;
  }
  
  /* Ajustes para carrossel */
  body.theme-dark .carousel-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
  }
  
  body.theme-dark .carousel-image-zoom-wrapper {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.05);
  }
  
  body.theme-dark .carousel-caption {
    background: rgba(0, 0, 0, 0.15);
    color: var(--text-secondary);
    border-left: 3px solid #555555;
  }
  
  body.theme-dark #currentStepDisplay {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
  }
/* ===== FIM TEMA ESCURO ALTERNATIVO ===== */

/* ===== 16. CARROSSEL COMPLETO (TUTORIAL) ===== */
  .carousel-container {
    overflow: hidden;
    margin: 0 auto 20px auto;
    width: 100%;
    max-width: 580px;
    height: 380px;
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    box-shadow: var(--shadow-medium);
  }

  .carousel-slide {
    display: flex;
    transition: transform 0.4s ease-in-out;
    height: 100%;
    width: 100%;
  }

  .carousel-item {
    min-width: 100%;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    box-sizing: border-box;
    flex-shrink: 0;
  }

  .carousel-image-zoom-wrapper {
    overflow: hidden;
    position: relative;
    width: 100%;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .carousel-image-zoom {
    width: 450px;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    cursor: crosshair;
    transition: transform 0.3s ease-out;
    transform-origin: center center;
    max-width: none !important;
    max-height: none !important;
  }

  .carousel-image-zoom.zooming { transform: scale(2) !important; }
  .carousel-caption {
    width: 100%;
    padding: 12px 15px;
    text-align: justify;
    text-justify: inter-word;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    margin-top: 15px;
    box-sizing: border-box;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-style: normal;
    border-left: 3px solid var(--accent-color);
  }

  .carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    padding: 10px;
    width: 100%;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
  }

  .carousel-controls .btn {
    padding: 8px 20px;
    min-width: 100px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
  }

  .carousel-controls .btn:hover:not(:disabled) {
    background: var(--bg-tertiary);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  }

  .carousel-controls .btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    background: var(--bg-secondary);
  }

  #currentStepDisplay {
    font-size: 14px;
    font-weight: bold;
    color: var(--text-primary);
    min-width: 80px;
    text-align: center;
    background: var(--bg-secondary);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
  }

  body.light-theme .carousel-container {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    box-shadow: var(--shadow-light);
  }

  body.light-theme .carousel-image-zoom-wrapper {
    background: var(--bg-tertiary);
    border-color: rgba(0, 0, 0, 0.1);
  }

  body.light-theme .carousel-caption {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
    border-left-color: var(--accent-color);
  }

  body.light-theme .carousel-controls .btn {
    background: var(--bg-tertiary);
    color: var(--text-primary);
  }

  body.light-theme .carousel-controls .btn:hover:not(:disabled) {
    background: #e2e6ea;
  }

  body.light-theme #currentStepDisplay {
    background: var(--bg-tertiary);
    color: var(--text-primary);
  }

  #stateVerification .carousel-controls {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 1000 !important;
    position: relative !important;
  }

  #stateVerification .carousel-controls .btn {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 8px 20px !important;
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
  }

  #prevSlide, #nextSlide {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
/* ===== FIM CARROSSEL COMPLETO ===== */

/* ===== VARIÁVEIS DE TEMA (Base DeepSeek) ===== */
:root {
    /* Tema Escuro (Padrão) */
    --bg-primary: #0f131a;
    --bg-secondary: #1a1d29;
    --bg-tertiary: #222633;
    --text-primary: #e2e8f0;
    --text-secondary: #cbd5e0;
    --text-muted: #8a9ba8;
    --text-dark: #2d3748;
    --border-color: #2a2e3a;
    --accent-color: #8aaeff;
    --accent-light: #a4c4ff;
    --success-color: #38c172;
    --error-color: #e53e3e;
    --warning-color: #f6ad55;
    --info-color: #4299e1;
    --input-bg: #1e222e;
    --shadow-light: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-medium: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-heavy: 0 12px 36px rgba(0, 0, 0, 0.5);
}

/* Tema Claro */
body.light-theme {
    --bg-primary: #f8fafc;
    --bg-secondary: #edf2f7;
    --bg-tertiary: #e2e8f0;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --text-dark: #1a202c;
    --border-color: #cbd5e0;
    --accent-color: #2b6cb0;
    --accent-light: #3182ce;
    --success-color: #38a169;
    --error-color: #e53e3e;
    --warning-color: #d69e2e;
    --info-color: #3182ce;
    --input-bg: #ffffff;
    --shadow-light: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-heavy: 0 12px 36px rgba(0, 0, 0, 0.15);
}

/* ===== RESET E ESTILOS GERAIS ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
    padding: 0;
    margin: 0;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    width: 100%;
    /* max-width: 1200px; */
    margin: 0 auto;
    padding: 20px;
}

/* ===== TABELAS GLOBAIS ===== */
.table-container {
    width: 100%;
    max-height: 500px;
    margin: 15px 0;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    position: relative;
    z-index: 1;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    border-collapse: separate !important;
    border-spacing: 0;
    width: 100%;
    font-size: 12px;
    min-width: 1000px;
    table-layout: fixed !important;
}

.data-table th {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    font-weight: 600;
    padding: 8px 6px !important;
    border: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 20;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    box-sizing: border-box;
    height: 35px !important;
    text-align: center;
}

.data-table td {
    border: 1px solid var(--border-color);
    padding: 6px !important;
    vertical-align: middle;
    word-wrap: break-word;
    color: var(--text-secondary);
    font-size: 12px !important;
    height: 40px !important;
    line-height: 1.3 !important;
    text-align: center;
}

/* Ajuste específico para colunas de texto (alinhamento à esquerda) */
.data-table tbody td:nth-child(2),
.data-table tbody td:nth-child(3),
.data-table tbody td:nth-child(4),
.data-table tbody td:nth-child(5) {
    text-align: left !important;
}

.data-table tr { 
    height: 40px !important; 
}

.data-table tr:nth-child(even) { 
    background: rgba(58, 58, 90, 0.1); 
}

.data-table tr:hover { 
    background: rgba(58, 58, 90, 0.2); 
    cursor: pointer;
}

.data-table a { 
    color: var(--accent-color); 
    text-decoration: none; 
    font-size: 11px; 
    transition: color 0.2s ease;
}

.data-table a:hover { 
    text-decoration: underline; 
    color: var(--accent-light);
}

/* Cabeçalhos agrupados */
.data-table thead tr:first-child th.header-group-0,
.data-table thead tr:first-child th.header-group-1,
.data-table thead tr:first-child th.header-group-2,
.data-table thead tr:first-child th.header-group-3,
.data-table thead tr:first-child th.header-group-4 {
    text-align: center !important;
    vertical-align: middle !important;
    background-image: none !important;
}

.data-table thead tr:first-child th.header-group-0 { 
    background-color: rgba(74, 74, 74, 0.3) !important; 
}

.data-table thead tr:first-child th.header-group-1 { 
    background-color: rgba(74, 74, 90, 0.3) !important; 
}

.data-table thead tr:first-child th.header-group-2 { 
    background-color: rgba(90, 74, 74, 0.3) !important; 
}

.data-table thead tr:first-child th.header-group-3 { 
    background-color: rgba(74, 90, 74, 0.3) !important; 
}

.data-table thead tr:first-child th.header-group-4 { 
    background-color: rgba(90, 90, 74, 0.3) !important; 
}

/* Cabeçalho duplo fixo */
.data-table thead tr:nth-child(1) th {
    top: 0 !important;
    z-index: 30 !important;
    height: 35px;
    border-bottom: 1px solid var(--border-color);
}

.data-table thead tr:nth-child(2) th {
    top: 35px !important;
    background-color: var(--bg-tertiary);
    z-index: 30 !important;
    border-bottom: 2px solid var(--accent-color);
}

/* ===== CONFIGURAÇÕES DE LARGURA DE COLUNAS POR TABELA ===== */

/* Configuração comum para checkbox no modo admin - TODAS AS TABELAS */
.admin .data-table thead th.col-checkbox,
.admin .data-table tbody td.col-checkbox {
    width: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
    text-align: center !important;
}

/* ===== CONFIGURAÇÕES PARA users.php - Tabela useT ===== */

/* ID */
.admin .data-table.useT thead th.col-id,
.admin .data-table.useT tbody td.col-id {
    width: 20px !important;
    min-width: 20px !important;
    max-width: 20px !important;
}
.user .data-table.useT thead th.col-id,
.user .data-table.useT tbody td.col-id {
    width: 20px !important;
    min-width: 20px !important;
    max-width: 20px !important;
}

/* Nome de Usuário */
.admin .data-table.useT thead th.col-username,
.admin .data-table.useT tbody td.col-username {
    width: 140px !important;
    min-width: 140px !important;
    max-width: 140px !important;
}
.user .data-table.useT thead th.col-username,
.user .data-table.useT tbody td.col-username {
    width: 140px !important;
    min-width: 140px !important;
    max-width: 140px !important;
}

/* E-mail */
.admin .data-table.useT thead th.col-email,
.admin .data-table.useT tbody td.col-email {
    width: 200px !important;
    min-width: 200px !important;
    max-width: 200px !important;
}
.user .data-table.useT thead th.col-email,
.user .data-table.useT tbody td.col-email {
    width: 200px !important;
    min-width: 200px !important;
    max-width: 200px !important;
}

/* Nome Completo */
.admin .data-table.useT thead th.col-fullname,
.admin .data-table.useT tbody td.col-fullname {
    width: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;
}
.user .data-table.useT thead th.col-fullname,
.user .data-table.useT tbody td.col-fullname {
    width: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;
}

/* Função */
.admin .data-table.useT thead th.col-role,
.admin .data-table.useT tbody td.col-role {
    width: 130px !important;
    min-width: 130px !important;
    max-width: 130px !important;
}
.user .data-table.useT thead th.col-role,
.user .data-table.useT tbody td.col-role {
    width: 130px !important;
    min-width: 130px !important;
    max-width: 130px !important;
}

/* Status */
.admin .data-table.useT thead th.col-status,
.admin .data-table.useT tbody td.col-status {
    width: 130px !important;
    min-width: 130px !important;
    max-width: 130px !important;
}
.user .data-table.useT thead th.col-status,
.user .data-table.useT tbody td.col-status {
    width: 130px !important;
    min-width: 130px !important;
    max-width: 130px !important;
}

/* Data do Cadastro */
.admin .data-table.useT thead th.col-created,
.admin .data-table.useT tbody td.col-created {
    width: 130px !important;
    min-width: 130px !important;
    max-width: 130px !important;
}
.user .data-table.useT thead th.col-created,
.user .data-table.useT tbody td.col-created {
    width: 130px !important;
    min-width: 130px !important;
    max-width: 130px !important;
}

/* Último Login */
.admin .data-table.useT thead th.col-lastlogin,
.admin .data-table.useT tbody td.col-lastlogin {
    width: 130px !important;
    min-width: 130px !important;
    max-width: 130px !important;
}
.user .data-table.useT thead th.col-lastlogin,
.user .data-table.useT tbody td.col-lastlogin {
    width: 130px !important;
    min-width: 130px !important;
    max-width: 130px !important;
}

/* ===== CONFIGURAÇÕES PARA cabEstruturado.php - Tabela cabT ===== */

/* Switch */
.admin .data-table.cabT thead th.col-switch,
.admin .data-table.cabT tbody td.col-switch {
    width: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;
}
.user .data-table.cabT thead th.col-switch,
.user .data-table.cabT tbody td.col-switch {
    width: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;
}

/* Porta */
.admin .data-table.cabT thead th.col-port,
.admin .data-table.cabT tbody td.col-port {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
}
.user .data-table.cabT thead th.col-port,
.user .data-table.cabT tbody td.col-port {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
}

/* TO */
.admin .data-table.cabT thead th.col-to,
.admin .data-table.cabT tbody td.col-to {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
}
.user .data-table.cabT thead th.col-to,
.user .data-table.cabT tbody td.col-to {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
}

/* Estado TO */
.admin .data-table.cabT thead th.col-to-state,
.admin .data-table.cabT tbody td.col-to-state {
    width: 200px !important;
    min-width: 200px !important;
    max-width: 200px !important;
}
.user .data-table.cabT thead th.col-to-state,
.user .data-table.cabT tbody td.col-to-state {
    width: 200px !important;
    min-width: 200px !important;
    max-width: 200px !important;
}

/* VLAN Untagged */
.admin .data-table.cabT thead th.col-vlan-untagged,
.admin .data-table.cabT tbody td.col-vlan-untagged {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
}
.user .data-table.cabT thead th.col-vlan-untagged,
.user .data-table.cabT tbody td.col-vlan-untagged {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
}

/* VLAN Tagged */
.admin .data-table.cabT thead th.col-vlan-tagged,
.admin .data-table.cabT tbody td.col-vlan-tagged {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
}
.user .data-table.cabT thead th.col-vlan-tagged,
.user .data-table.cabT tbody td.col-vlan-tagged {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
}

/* Observações */
.admin .data-table.cabT thead th.col-notes,
.admin .data-table.cabT tbody td.col-notes {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
}
.user .data-table.cabT thead th.col-notes,
.user .data-table.cabT tbody td.col-notes {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
}

/* ===== CONFIGURAÇÕES PARA list2.php - Tabela patT ===== */

/* Patrimônio/Local */
.admin .data-table.patT thead th.col-patrimony,
.admin .data-table.patT tbody td.col-patrimony {
    width: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;
}
.user .data-table.patT thead th.col-patrimony,
.user .data-table.patT tbody td.col-patrimony {
    width: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;
}

/* Grupo/Fabricante/Modelo */
.admin .data-table.patT thead th.col-group,
.admin .data-table.patT tbody td.col-group {
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
}
.user .data-table.patT thead th.col-group,
.user .data-table.patT tbody td.col-group {
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
}

/* IP/MAC */
.admin .data-table.patT thead th.col-ipmac,
.admin .data-table.patT tbody td.col-ipmac {
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
}
.user .data-table.patT thead th.col-ipmac,
.user .data-table.patT tbody td.col-ipmac {
    width: 130px !important;
    min-width: 130px !important;
    max-width: 130px !important;
}

/* Switch/IP */
.admin .data-table.patT thead th.col-switch,
.admin .data-table.patT tbody td.col-switch {
    width: 130px !important;
    min-width: 130px !important;
    max-width: 130px !important;
}
.user .data-table.patT thead th.col-switch,
.user .data-table.patT tbody td.col-switch {
    width: 130px !important;
    min-width: 130px !important;
    max-width: 130px !important;
}

/* Porta/VLAN */
.admin .data-table.patT thead th.col-portvlan,
.admin .data-table.patT tbody td.col-portvlan {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
}
.user .data-table.patT thead th.col-portvlan,
.user .data-table.patT tbody td.col-portvlan {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
}

/* TO */
.admin .data-table.patT thead th.col-to,
.admin .data-table.patT tbody td.col-to {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
}
.user .data-table.patT thead th.col-to,
.user .data-table.patT tbody td.col-to {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
}

/* Firmware */
.admin .data-table.patT thead th.col-firmware,
.admin .data-table.patT tbody td.col-firmware {
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
    white-space: normal !important;
    word-wrap: break-word !important;
}
.user .data-table.patT thead th.col-firmware,
.user .data-table.patT tbody td.col-firmware {
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
    white-space: normal !important;
    word-wrap: break-word !important;
}

/* Backup */
.admin .data-table.patT thead th.col-backup,
.admin .data-table.patT tbody td.col-backup {
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
}
.user .data-table.patT thead th.col-backup,
.user .data-table.patT tbody td.col-backup {
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
}

/* ===== TRUNCATED CONTENT ===== */
.truncated-content {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.4;
}

/* ===== BADGES (NOVO DESIGN COM CONTRASTE MELHORADO) ===== */
.badges-container {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 24px !important;
    padding: 2px 0;
}

/* Badge base - estilo comum */
.badge {
    padding: 3px 8px !important;
    border-radius: 12px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 60px !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

/* Badge específicos - cores mais escuras e contrastantes */
.badge-admin { 
    background: rgba(138, 164, 255, 0.25) !important;
    color: var(--accent-color) !important;
    border-color: rgba(138, 164, 255, 0.4) !important;
}

.badge-user { 
    background: rgba(100, 100, 120, 0.25) !important;
    color: var(--text-secondary) !important;
    border-color: rgba(100, 100, 120, 0.4) !important;
}

.badge-active { 
    background: rgba(56, 142, 60, 0.25) !important;
    color: var(--success-color) !important;
    border-color: rgba(56, 142, 60, 0.4) !important;
}

.badge-inactive { 
    background: rgba(211, 47, 47, 0.25) !important;
    color: var(--error-color) !important;
    border-color: rgba(211, 47, 47, 0.4) !important;
}

.badge-group { 
    background: rgba(42, 90, 122, 0.25) !important;
    color: #6bc5ff !important;
    border-color: rgba(42, 90, 122, 0.4) !important;
}

.badge-vendor { 
    background: rgba(42, 106, 106, 0.25) !important;
    color: #4fd1c7 !important;
    border-color: rgba(42, 106, 106, 0.4) !important;
}

.badge-model { 
    background: rgba(122, 122, 42, 0.25) !important;
    color: #ecc94b !important;
    border-color: rgba(122, 122, 42, 0.4) !important;
}

.badge-port { 
    background: rgba(90, 42, 90, 0.25) !important;
    color: #d6bcfa !important;
    border-color: rgba(90, 42, 90, 0.4) !important;
}

.badge-vlan { 
    background: rgba(42, 90, 90, 0.25) !important;
    color: #81e6d9 !important;
    border-color: rgba(42, 90, 90, 0.4) !important;
}

.badge-to { 
    background: rgba(90, 42, 42, 0.25) !important;
    color: #fc8181 !important;
    border-color: rgba(90, 42, 42, 0.4) !important;
}

/* Firmware badges */
.firmware-outdated {
    background: rgba(211, 47, 47, 0.25) !important;
    color: var(--error-color) !important;
    border-color: rgba(211, 47, 47, 0.4) !important;
    position: relative;
}

.firmware-outdated::after {
    content: " ⚠";
    font-size: 0.9em;
    color: var(--error-color);
}

.firmware-up-to-date { 
    background: rgba(56, 142, 60, 0.25) !important;
    color: var(--success-color) !important; 
    border-color: rgba(56, 142, 60, 0.4) !important;
}

/* Badge container para firmware com status */
.badge-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 100%;
    padding: 2px 0;
}

.firmware-status {
    font-size: 10px;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 1px;
}

/* Estados de backup */
.backup-status-on { 
    color: var(--success-color) !important; 
}

.backup-status-off { 
    color: var(--text-muted) !important; 
}

/* Ajustes para tema claro */
body.light-theme .badge {
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

body.light-theme .badge-admin { 
    background: rgba(138, 164, 255, 0.15) !important;
    color: #2b6cb0 !important;
}

body.light-theme .badge-user { 
    background: rgba(160, 174, 192, 0.15) !important;
    color: #4a5568 !important;
}

body.light-theme .badge-active { 
    background: rgba(56, 178, 172, 0.15) !important;
    color: #2c7a7b !important;
}

body.light-theme .badge-inactive { 
    background: rgba(245, 101, 101, 0.15) !important;
    color: #c53030 !important;
}

body.light-theme .badge-group { 
    background: rgba(66, 153, 225, 0.15) !important;
    color: #2b6cb0 !important;
}

body.light-theme .badge-vendor { 
    background: rgba(72, 187, 120, 0.15) !important;
    color: #276749 !important;
}

body.light-theme .badge-model { 
    background: rgba(237, 137, 54, 0.15) !important;
    color: #c05621 !important;
}

body.light-theme .badge-port { 
    background: rgba(159, 122, 234, 0.15) !important;
    color: #6b46c1 !important;
}

body.light-theme .badge-vlan { 
    background: rgba(49, 151, 149, 0.15) !important;
    color: #285e61 !important;
}

body.light-theme .firmware-outdated {
    background: rgba(245, 101, 101, 0.15) !important;
    color: #c53030 !important;
}

body.light-theme .firmware-up-to-date { 
    background: rgba(72, 187, 120, 0.15) !important;
    color: #276749 !important;
}

/* ===== CÉLULAS COM ELEMENTOS ESPECÍFICOS ===== */
.empty {
    color: var(--text-muted);
    font-style: italic;
    font-size: 11px;
}

/* Células com layout vertical */
.cell-vertical {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 4px 0;
}

/* Informações de rede */
.network-info,
/* .switch-info, */
.port-info,
.firmware-info,
.backup-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    width: 100%;
    padding: 4px 0;
}

/* Informações específicas */
.patrimony-info,
.location-info,
.user-info,
.email-info,
.name-info,
.date-info {
    display: block;
    line-height: 1.4;
    margin: 2px 0;
}

.patrimony-info strong {
    color: var(--text-primary);
    font-weight: 600;
}

.email-info a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.email-info a:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

.date-info i {
    color: var(--text-muted);
    margin-right: 4px;
}

/* Botão de backup */
.view-backup {
    background: rgba(155, 89, 182, 0.1);
    color: var(--accent-color);
    border: 1px solid rgba(155, 89, 182, 0.2);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.view-backup:hover {
    background: rgba(155, 89, 182, 0.2);
    border-color: rgba(155, 89, 182, 0.3);
}

/* ===== CONTROLES PRINCIPAIS ===== */
.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.controls-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.controls-right {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    flex: 1;
}

/* Menu principal de controles */
.controls-row.main-controls {
    margin: 15px 0;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
    box-shadow: var(--shadow-light);
    position: relative;
    z-index: 10;
}

.controls-row.main-controls .controls-left,
.controls-row.main-controls .controls-right {
    flex: none;
    height: 36px;
    display: flex;
    align-items: center;
}

/* ===== FILTROS AVANÇADOS ===== */
.filter-buttons-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

#filter-box {
    position: fixed;
    top: 170px;
    left: 50%;
    transform: translateX(-50%);
    width: 964px;
    max-width: calc(100vw - 40px);
    max-height: 70vh;
    background: var(--bg-primary);
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    box-shadow: var(--shadow-heavy);
    padding: 35px 8px 8px 8px;
    z-index: 1050;
    display: none;
}

#filter-box.filter-box-visible { 
    display: block; 
}

#filter-box.filter-box-dragging {
    box-shadow: 0 15px 50px rgba(90, 90, 173, 0.6) !important;
    border-color: var(--accent-color) !important;
    cursor: grabbing !important;
    transition: none !important;
    user-select: none;
}

.filter-drag-area {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30px;
    cursor: move;
    z-index: 1051;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(to right, var(--accent-color), #2a2a5a);
    opacity: 0.3;
    transition: opacity 0.2s ease;
}

.filter-drag-area:hover { 
    opacity: 0.7; 
}

.filter-drag-area:active { 
    opacity: 0.9; 
}

.filter-group-wrapper {
    position: relative;
    min-width: 180px;
    flex: 1 1 180px;
    z-index: 1;
}

.checkbox-list {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1100 !important;
    display: none;
    flex-direction: column;
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 0 0 6px 6px;
    background: var(--bg-secondary);
    box-shadow: var(--shadow-medium);
    margin-top: 2px;
}

.checkbox-list.checkbox-list-open { 
    display: flex !important; 
}

.filter-group-header {
    position: relative;
    z-index: 2;
    width: 180px;
    background: var(--input-bg);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--accent-color);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
    white-space: nowrap;
    transition: background-color 0.2s ease;
}

.filter-group-header:hover { 
    background-color: rgba(58, 58, 90, 0.1); 
}

.filter-group-header.active {
    background-color: rgba(74, 74, 90, 0.15);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: none;
}

.filter-form {
    font-size: 12px;
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 6px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10px, 1fr));
    gap: 4px;
    align-items: start;
    position: relative;
    z-index: 99;
}

#search-input-group {
    flex: 1 1 100%;
    max-width: 400px;
    margin-bottom: 15px;
    position: relative;
}

#search-input-group small {
    color: var(--text-muted); 
    font-size: 11px; 
    display: block;
}

#search-input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-primary);
    width: 70%;
    margin: 10px 2px;
    box-sizing: border-box;
}

#active-filters-badges {
    margin-top: 10px;
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 25px;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
    grid-column: 1 / -1;
}

.filter-badge {
    background: rgba(138, 164, 255, 0.15);
    color: var(--accent-color);
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    border: 1px solid rgba(138, 164, 255, 0.3);
}

.filter-badge .remove-filter {
    margin-left: 8px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.filter-badge .remove-filter:hover { 
    opacity: 1; 
}

#dynamic-search-results {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    z-index: 1001;
    max-width: 320px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: var(--shadow-medium);
}

.search-results-title {
    padding: 10px;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    font-size: 12px;
    border-bottom: 1px solid var(--border-color);
}

.search-result-item {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:hover { 
    background: var(--bg-tertiary); 
}

.search-result-all { 
    background: rgba(90, 90, 173, 0.1); 
}

.search-result-all strong { 
    color: var(--accent-color); 
}

.filter-box-close {
    position: absolute !important;
    top: 5px !important;
    right: 5px !important;
    width: 24px !important;
    height: 24px !important;
    border: none !important;
    background: rgba(255, 107, 107, 0.9) !important;
    color: white !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    z-index: 1052 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
    transition: background 0.2s !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
}

.filter-box-close:hover { 
    background: #ff5252 !important; 
}

#filter-controls { 
    display: none; 
}

#filter-controls.filter-controls-visible { 
    display: flex !important; 
}

/* ===== CHECKBOXES DE SELEÇÃO ===== */
.patrimony-select-checkbox,
.port-select-checkbox,
.user-select-checkbox {
    cursor: pointer;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--accent-color);
}

#select-all-patrimony:indeterminate,
#select-all-estrutura:indeterminate,
#select-all-users:indeterminate {
    accent-color: var(--accent-color);
}

.checkbox-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

/* ===== CONTROLES DE AÇÃO (MENU FLUTUANTE) ===== */
.controls-row.action-controls {
    margin: 10px 0;
    padding: 10px 15px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    display: none;
    justify-content: space-between;
    align-items: center;
    min-height: 50px;
    box-shadow: var(--shadow-light);
    position: relative;
    z-index: 10;
    transition: all 0.3s ease;
}

.controls-row.action-controls.visible {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.controls-row.action-controls.hidden {
    display: none;
    opacity: 0;
    transform: translateY(-10px);
}

.action-controls .action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* ===== PAGINAÇÃO ===== */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0;
    padding: 10px 15px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    flex-wrap: wrap;
    gap: 10px;
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 5px;
}

.page-btn {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--input-bg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
}

.page-btn:hover:not(.disabled) {
    background: var(--bg-tertiary);
    border-color: var(--accent-color);
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    color: var(--text-muted);
    font-size: 12px;
    margin: 0 10px;
}

.pagination-info-full {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 12px;
}

.items-per-page {
    display: flex;
    align-items: center;
    gap: 8px;
}

.items-per-page label {
    color: var(--text-muted);
    font-size: 12px;
}

.items-per-page select {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
}

/* ===== MODAIS ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.modal-content {
    background: var(--bg-primary);
    margin: 5% auto;
    padding: 0;
    border: 5px solid var(--border-color);
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: var(--shadow-heavy);
}

.modal-header {
    padding: 15px 20px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 16px;
}

.modal-header .close {
    color: var(--text-muted);
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-header .close:hover {
    color: var(--error-color);
}

.modal-body {
    padding: 20px;
}

#portInfoModal .modal-content {
  padding: 10px;
}


.input-field {
    margin-bottom: 15px;
}

.input-field label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 13px;
}

.input-field input,
.input-field select,
.input-field textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 13px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* ===== ESTADOS VAZIOS ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 18px;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 20px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.empty-state-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
}

.empty-state-content i {
    font-size: 32px;
}

/* ===== 19. RESPONSIVIDADE GLOBAL ===== */

/* Ocultar user-welcome em telas menores que 425px */
@media (max-width: 425px) {
    .user-welcome {
        display: none !important;
    }
}

/* Ajuste específico para os botões de controle das tabelas */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.mobile-visible { transform: translateX(0); }
    
    .main-content {
        margin-left: 0;
        margin-top: 50px;
        margin-bottom: 60px;
        padding: 10px;
        min-height: calc(100vh - 110px);
    }
    
    .footer { left: 0; margin-bottom: 0; }
    
    /* Menu de controles - Layout em duas linhas como carrossel */
    .controls-row.main-controls {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .controls-row.main-controls .controls-left,
    .controls-row.main-controls .controls-right {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        width: 100%;
        padding: 5px 0;
        gap: 8px;
        scrollbar-width: thin;
        scrollbar-color: var(--accent-color) transparent;
        -webkit-overflow-scrolling: touch;
    }
    
    .controls-row.main-controls .controls-left::-webkit-scrollbar,
    .controls-row.main-controls .controls-right::-webkit-scrollbar {
        height: 4px;
    }
    
    .controls-row.main-controls .controls-left::-webkit-scrollbar-track,
    .controls-row.main-controls .controls-right::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .controls-row.main-controls .controls-left::-webkit-scrollbar-thumb,
    .controls-row.main-controls .controls-right::-webkit-scrollbar-thumb {
        background-color: var(--accent-color);
        border-radius: 10px;
    }
    
    /* Botões como carrossel - linhas específicas */
    .controls-row.main-controls .controls-left {
        order: 2; /* Fica na linha de baixo */
        justify-content: flex-start;
    }
    
    .controls-row.main-controls .controls-right {
        order: 1; /* Fica na linha de cima */
        justify-content: flex-end;
    }
    
    /* Estilo dos botões no modo carrossel */
    .controls-row.main-controls .btn {
        flex: 0 0 auto;
        white-space: nowrap;
        min-width: max-content;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    /* Botões desabilitados em mobile */
    .controls-row.main-controls .btn-disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }
    
    /* Botão de delete selecionados em mobile */
    .controls-row.main-controls #btn-delete-selected {
        background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
        border: 1px solid #ff6666;
    }
    
    .filter-form { grid-template-columns: 1fr; gap: 12px; align-items: stretch; }
    .filter-actions-container {
        justify-content: center;
        padding-top: 10px;
        margin-top: 5px;
    }
    
    .filter-actions-buttons { width: 100%; justify-content: space-around; }
    .filter-box-toggle { margin-bottom: 10px; }
    .pagination { flex-direction: column; gap: 15px; }
    .items-per-page { margin-left: 0; justify-content: center; }
    
    /* Ajustes para tabelas com classes CSS */
    .data-table { 
        font-size: 0.8em;
        min-width: 1200px !important;
    }
    
    /* Configurações específicas por tipo de tabela */
    .data-table.useT,
    .data-table.cabT,
    .data-table.patT {
        min-width: 1200px !important;
        width: 1200px !important;
    }
    
    /* Reduzir tamanho de badges */
    .badge {
        font-size: 10px !important;
        padding: 3px 6px !important;
        min-width: 50px !important;
    }
    
    /* Ajuste para colunas específicas em tabela patrimônio */
    .data-table.patT tbody td.col-group .badges-container {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
        min-height: 70px !important;
    }
    
    .data-table.patT tbody td.col-group .badge-group,
    .data-table.patT tbody td.col-group .badge-vendor,
    .data-table.patT tbody td.col-group .badge-model {
        width: 100% !important;
        max-width: 100% !important;
        white-space: normal !important;
        text-overflow: clip !important;
        overflow: visible !important;
        flex: none !important;
        margin: 2px 0 !important;
        padding: 4px 8px !important;
        border-radius: 4px !important;
        text-align: left !important;
        display: block !important;
    }
    
    /* Ajuste para conteúdo truncado */
    .data-table.patT tbody td.col-patrimony .patrimony-info,
    .data-table.patT tbody td.col-patrimony .location-info,
    .data-table.patT tbody td .truncated-content {
        white-space: normal !important;
        word-break: break-word !important;
        line-height: 1.4 !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }
    
    /* Ajuste de altura das linhas */
    .data-table tbody tr { height: auto !important; min-height: 70px !important; }
    .data-table tbody td { height: auto !important; min-height: 60px !important; padding: 8px !important; }
    
    /* Formulários e botões */
    .form-grid { grid-template-columns: 1fr; gap: 8px; }
    .btn-group { flex-direction: column; }
    .actions { flex-direction: column; gap: 3px; }
    .actions .btn-sm { width: 100%; justify-content: center; }
    
    /* Modais */
    .modal-content, .modal-container { width: 95% !important; margin: 10px auto !important; }
    .form-actions { flex-direction: column; }
    .form-actions .btn { max-width: 100%; }
    
    /* Carrossel */
    .carousel-container { height: 400px; max-width: 100%; }
    .carousel-image-zoom-wrapper { height: 240px; }
    .carousel-image-zoom { width: 350px; max-height: 220px; }
    .carousel-caption { font-size: 12px; padding: 10px 12px; text-align: left; }
    .carousel-controls .btn { padding: 6px 15px; min-width: 80px; font-size: 13px; }
    .carousel-controls { gap: 10px; }
    
    /* Filter Box - Móvel */
    #filter-box {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: 70vh !important;
        height: auto !important;
        border-radius: 8px 8px 0 0 !important;
        border: 2px solid rgba(175, 175, 175, 0.5) !important;
        box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.3) !important;
        z-index: 1001 !important;
        cursor: default !important;
        padding: 25px 15px 15px 15px;
        overflow-y: auto;
    }
    
    .filter-drag-area { display: none !important; }
    .filter-group-header { width: 100%; cursor: pointer; }
    .checkbox-list { 
        position: relative !important; 
        top: auto !important; 
        left: auto !important; 
        right: auto !important; 
        margin-top: 5px; 
        z-index: 1002;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 4px;
        padding: 8px;
        max-height: 200px;
        overflow-y: auto;
    }
    
    /* Container da tabela para rolagem horizontal */
    .table-container {
        max-height: 400px !important;
        border: 1px solid var(--border-color) !important;
        margin: 10px 0 !important;
        overflow-x: auto;
        overflow-y: auto;
        position: relative;
    }
    
    /* Mensagem indicando rolagem horizontal */
    .table-container::after {
        content: '← Role para os lados →' !important;
        display: block;
        padding: 10px !important;
        font-size: 12px !important;
        background: rgba(0,0,0,0.3) !important;
        border-top: 2px solid var(--accent-color) !important;
        color: #8aa4ff !important;
        font-weight: bold !important;
        text-align: center;
        position: sticky;
        bottom: 0;
        width: 100%;
    }
}

/* ===== Ajuste específico para telas entre 425px e 768px ===== */
@media (min-width: 426px) and (max-width: 768px) {
    .user-welcome {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    /* Menu de controles com mais espaço */
    .controls-row.main-controls .btn {
        padding: 8px 14px;
        font-size: 13px;
    }
}

/* ===== Tablet (1400px) ===== */
@media (max-width: 1400px) {
    .data-table { min-width: 1200px !important; }
    
    /* Configuração específica para cada tipo de tabela */
    .data-table.useT { min-width: 1100px !important; }
    .data-table.cabT { min-width: 1000px !important; }
    .data-table.patT { min-width: 1200px !important; }
    
    /* Ajuste para badges em telas médias */
    .data-table.patT tbody td.col-group .badges-container {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
        min-height: 70px !important;
    }
    
    .data-table.patT tbody td.col-group .badge-group,
    .data-table.patT tbody td.col-group .badge-vendor,
    .data-table.patT tbody td.col-group .badge-model {
        width: 100% !important;
        max-width: 100% !important;
        white-space: normal !important;
        text-overflow: clip !important;
        overflow: visible !important;
        flex: none !important;
        margin: 2px 0 !important;
        padding: 4px 8px !important;
        border-radius: 4px !important;
        text-align: left !important;
        display: block !important;
    }
    
    .data-table.patT tbody td.col-patrimony .patrimony-info,
    .data-table.patT tbody td.col-patrimony .location-info,
    .data-table.patT tbody td .truncated-content {
        white-space: normal !important;
        word-break: break-word !important;
        line-height: 1.4 !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }
    
    .data-table tbody tr { height: auto !important; min-height: 70px !important; }
    .data-table tbody td { height: auto !important; min-height: 60px !important; padding: 8px !important; }
    .filter-group-header { width: 160px; }
}

/* ===== Telas pequenas (800px) ===== */
@media (max-width: 800px) {
    /* Larguras mínimas para cada tipo de tabela */
    .table-container .data-table.useT { min-width: 1400px !important; width: 1400px !important; }
    .table-container .data-table.cabT { min-width: 1200px !important; width: 1200px !important; }
    .table-container .data-table.patT { min-width: 1560px !important; width: 1560px !important; }
    
    .table-container { 
        max-height: 400px !important; 
        border: 1px solid var(--border-color) !important; 
        margin: 10px 0 !important; 
    }
    
    .data-table { 
        font-size: 11px !important; 
    }
    
    .data-table thead th, 
    .data-table tbody td { 
        padding: 8px 6px !important; 
        font-size: 11px !important; 
        min-height: 45px !important; 
    }
    
    .badges-container { min-height: 30px !important; }
    .badges-container .badge-group, 
    .badges-container .badge-vendor, 
    .badges-container .badge-model { 
        font-size: 10px !important; 
        padding: 3px 6px !important; 
    }
    
    .truncated-content { line-height: 1.4 !important; max-height: none !important; }
    .actions-container { flex-direction: column !important; gap: 4px !important; }
    .actions-container form { width: 100% !important; }
    .actions-container button { 
        width: 100% !important; 
        justify-content: center !important; 
        text-align: center !important; 
    }
}

/* ===== Mobile muito pequeno (480px) ===== */
@media (max-width: 480px) {
    /* Ocultar user-welcome já está no início do CSS */
    .container { padding: 0; }
    .filter-actions-buttons { flex-direction: column; }
    .filter-actions-buttons button { width: 100%; }
    .content { padding: 10px; }
    .modal-body { padding: 10px; }
    .btn-group { flex-direction: column; }
    .btn { justify-content: center; }
    
    /* Menu de controles - ajustes para telas muito pequenas */
    .controls-row.main-controls .controls-left,
    .controls-row.main-controls .controls-right {
        gap: 6px;
        padding: 8px 0;
    }
    
    .controls-row.main-controls .btn {
        padding: 6px 10px;
        font-size: 11px;
        min-height: 36px;
        width: 130px;
    }
    
    .controls-row.main-controls .btn i {
        margin-right: 4px;
        font-size: 10px;
    }
    
    /* Carrossel em telas muito pequenas */
    .carousel-container { height: 420px; }
    .carousel-item { padding: 10px; }
    .carousel-image-zoom-wrapper { height: 200px; }
    .carousel-image-zoom { width: 280px; max-height: 180px; }
    .carousel-caption { font-size: 11px; min-height: 70px; text-align: left; }
    
    /* Tabelas em telas muito pequenas */
    .data-table { min-width: 1200px; }
    
    /* Ajuste de badges em colunas específicas */
    .data-table.patT tbody td.col-group .badges-container { 
        flex-direction: column; 
        align-items: flex-start; 
    }
    
    .data-table.patT tbody td.col-group .badge-group, 
    .data-table.patT tbody td.col-group .badge-vendor, 
    .data-table.patT tbody td.col-group .badge-model { 
        max-width: 100%; 
        width: 100%; 
    }
    
    /* Controles em telas muito pequenas */
    .controls-left a.btn { 
        text-align: center !important; 
        justify-content: center !important; 
    }
    
    .filter-buttons-container .btn { 
        flex: 1 !important; 
        min-width: 120px !important; 
        text-align: center !important; 
    }
    
    /* Mensagem de rolagem horizontal */
    .table-container::after {
        content: '← Role para os lados →' !important;
        padding: 10px !important;
        font-size: 12px !important;
        background: rgba(0,0,0,0.3) !important;
        border-top: 2px solid var(--accent-color) !important;
        color: #8aa4ff !important;
        font-weight: bold !important;
        text-align: center;
    }
}

/* ===== Ajustes específicos para filter-box responsivo ===== */
@media (max-width: 768px) {
    #search-input-group {
        margin-bottom: 15px;
    }
    
    #active-filters-badges {
        margin-bottom: 10px;
    }
    
    .filter-group-header {
        padding: 10px 12px;
        background: var(--bg-secondary);
        border-radius: 4px;
        margin-bottom: 5px;
        border: 1px solid var(--border-color);
    }
    
    .filter-group-header i {
        float: right;
        transition: transform 0.3s;
    }
    
    .filter-group-header.active i {
        transform: rotate(180deg);
    }
    
    /* Overlay para filter-box em mobile */
    .filter-box-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        display: none;
    }
    
    .filter-box-overlay.active {
        display: block;
    }
}

/* ===== Ajustes para tablets em modo paisagem ===== */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .table-container {
        max-height: 500px !important;
    }
    
    .data-table {
        font-size: 12px !important;
    }
    
    .data-table thead th,
    .data-table tbody td {
        padding: 10px 8px !important;
    }
    
    #filter-box {
        max-width: 90% !important;
        max-height: 80vh !important;
    }
    
    /* Menu de controles em tablets paisagem */
    .controls-row.main-controls {
        flex-direction: row;
        align-items: center;
    }
    
    .controls-row.main-controls .controls-left,
    .controls-row.main-controls .controls-right {
        flex-wrap: wrap;
        overflow-x: visible;
    }
}

/* ===== Ajustes para telas muito altas ===== */
@media (min-height: 1000px) {
    #filter-box {
        max-height: 50vh !important;
    }
    
    .table-container {
        max-height: 600px !important;
    }
}

/* ===== Ajustes específicos para mobile vertical ===== */
@media (max-width: 768px) and (orientation: portrait) {
    .controls-row.main-controls {
        gap: 8px;
    }
    
    .controls-row.main-controls .controls-left,
    .controls-row.main-controls .controls-right {
        min-height: 44px; /* Altura mínima para toque */
    }
}

/* ===== Ajustes específicos para mobile horizontal ===== */
@media (max-width: 768px) and (orientation: landscape) {
    .controls-row.main-controls {
        flex-direction: row;
        align-items: center;
    }
    
    .controls-row.main-controls .controls-left,
    .controls-row.main-controls .controls-right {
        flex: 1;
        overflow-x: auto;
    }
    
    .controls-row.main-controls .controls-left {
        order: 1;
    }
    
    .controls-row.main-controls .controls-right {
        order: 2;
    }
}

/* ===== Ajuste para setas de navegação no carrossel de botões ===== */
@media (max-width: 768px) {
    /* Indicador visual de que há mais botões para rolar */
    .controls-row.main-controls .controls-left::after,
    .controls-row.main-controls .controls-right::after {
        content: ' ›';
        color: var(--accent-color);
        font-size: 14px;
        font-weight: bold;
        align-self: center;
        margin-left: 5px;
        opacity: 0.7;
    }
    
    /* Quando estiver no final do scroll, remover indicador */
    .controls-row.main-controls .controls-left.at-end::after,
    .controls-row.main-controls .controls-right.at-end::after {
        content: '';
    }
}

/* ===== Animação para botões no carrossel ===== */
@media (max-width: 768px) {
    .controls-row.main-controls .btn {
        transition: all 0.2s ease;
    }
    
    .controls-row.main-controls .btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    }
    
    .controls-row.main-controls .btn:active {
        transform: translateY(0);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }
}

/* ===== Ajuste para botões desabilitados ===== */
@media (max-width: 768px) {
    .controls-row.main-controls .btn-disabled {
        opacity: 0.4;
        cursor: not-allowed;
        transform: none !important;
        box-shadow: none !important;
    }
}
/* ===== FIM RESPONSIVIDADE GLOBAL ===== */