/* ========================================
   RESET & VARIÁVEIS
   ======================================== */
:root {
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 70px;
    --header-height: 70px;
    --primary-color: #0066cc;
    --primary-dark: #004a99;
    --primary-light: #3385db;
    --secondary-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --success-color: #28a745;
    --text-dark: #1a202c;
    --text-muted: #6c757d;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1a365d 0%, #0f2540 100%);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    pointer-events: auto;
}

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

.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 1rem;
}

/* Quando expandida, o header fica em linha */
.sidebar:not(.collapsed) .sidebar-header {
    flex-direction: row;
    justify-content: space-between;
}

/* Quando recolhida, o toggle fica abaixo do logo */
.sidebar.collapsed .sidebar-header {
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    width: 100%;
}

/* Quando expandida, logo ocupa espaço disponível */
.sidebar:not(.collapsed) .logo {
    flex: 1;
}

.logo-svg {
    max-width: 180px;
    height: auto;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: filter 0.3s ease;
}

.logo-svg:hover {
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
}

.logo-icon {
    max-width: 40px;
    height: auto;
    display: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: filter 0.3s ease;
}

.logo-icon:hover {
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
}

/* Quando a sidebar está recolhida, mostra o ícone e oculta a logo SVG */
.sidebar.collapsed .logo-svg {
    display: none;
}

.sidebar.collapsed .logo-icon {
    display: block;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-text {
    display: none;
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 0;
    position: relative;
    z-index: 1;
}

/* Quando recolhida, permite overflow para tooltips */
.sidebar.collapsed .sidebar-nav {
    overflow-y: auto;
    overflow-x: visible;
}

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

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

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

.sidebar-nav > ul > li {
    margin-bottom: 0.25rem;
}

/* Garante que os itens principais sejam sempre visíveis quando recolhida, EXCETO se tiverem display: none inline */
.sidebar.collapsed .sidebar-nav > ul > li:not(.nav-item-group):not([style*="display: none"]) {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Respeita o display: none do config-menu-item quando não logado - PRIORIDADE MÁXIMA */
#config-menu-item[style*="display: none"],
#config-menu-item[data-hidden="true"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

/* Garante que mesmo quando a sidebar está recolhida, o config-menu-item oculto permanece oculto */
.sidebar.collapsed #config-menu-item[style*="display: none"],
.sidebar.collapsed #config-menu-item[data-hidden="true"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    cursor: pointer;
    pointer-events: auto;
}

/* Quando a sidebar está recolhida, centraliza TODOS os links e mantém clicáveis */
.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.875rem;
    width: 100%;
    min-width: 70px;
    z-index: 100;
    position: relative;
    pointer-events: auto !important;
    cursor: pointer !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Links do submenu também centralizados quando recolhida */
.sidebar.collapsed .nav-submenu .nav-link {
    justify-content: center;
    padding: 0.875rem !important;
    padding-left: 0.875rem !important; /* Remove padding extra do submenu */
}

/* Garante que os ícones sejam sempre visíveis */
.sidebar.collapsed .nav-link i {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-link.active {
    background: rgba(66, 153, 225, 0.2);
    color: white;
    border-left: 3px solid var(--primary-light);
}

/* Quando recolhida, remove a borda esquerda do active */
.sidebar.collapsed .nav-link.active {
    border-left: none;
    border-radius: 8px;
}

.nav-link i {
    font-size: 1.125rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.nav-item-group {
    margin-bottom: 1rem;
}

.nav-group-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-group-header i {
    font-size: 1rem;
}

.nav-submenu {
    list-style: none;
}

.nav-submenu .nav-link {
    padding-left: 3rem;
    font-size: 0.9375rem;
}

/* Quando recolhida, mostra apenas os ícones dos links do submenu */
.sidebar.collapsed .nav-submenu {
    display: block;
}

.sidebar.collapsed .nav-submenu .nav-link {
    justify-content: center;
    padding: 0.875rem;
    width: 100%;
}

.sidebar.collapsed .nav-group-header {
    padding: 0.875rem;
    justify-content: center;
    display: none; /* Oculta o header do grupo quando recolhida */
}

/* Garante que TODOS os links sejam sempre visíveis quando recolhida, EXCETO se tiverem display: none inline */
.sidebar.collapsed .sidebar-nav > ul > li:not([style*="display: none"]) {
    display: block !important;
}

.sidebar.collapsed .sidebar-nav > ul > li:not([style*="display: none"]) > .nav-link {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Links dentro de submenu também devem ser visíveis */
.sidebar.collapsed .nav-submenu > li {
    display: block !important;
}

.sidebar.collapsed .nav-submenu .nav-link {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Garante que os li não bloqueiem os cliques */
.sidebar.collapsed .sidebar-nav > ul > li {
    position: relative;
    z-index: 50;
    pointer-events: none;
}

/* Os links dentro dos li devem ser clicáveis e visíveis */
.sidebar.collapsed .sidebar-nav > ul > li > .nav-link {
    pointer-events: auto !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Links do submenu também devem ser clicáveis */
.sidebar.collapsed .nav-submenu > li {
    pointer-events: none;
}

.sidebar.collapsed .nav-submenu > li > .nav-link {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* nav-item-group deve ser visível quando recolhida, apenas o header é oculto */
.sidebar.collapsed .nav-item-group {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.sidebar.collapsed .sidebar-nav {
    overflow-y: auto;
    overflow-x: visible;
}

.sidebar.collapsed .nav-link:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    margin-left: 10px;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 1000;
    font-size: 0.875rem;
    pointer-events: none;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-login {
    width: 100%;
    padding: 0.75rem;
    background: var(--warning-color);
    color: #000;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-login:hover {
    background: #e0a800;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.user-details {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
}

.user-name {
    color: white;
    font-weight: 500;
}

.btn-logout-small {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout-small:hover {
    background: #c82333;
}

#user-info-sidebar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar.collapsed #user-info-sidebar .user-details,
.sidebar.collapsed .btn-login .nav-text {
    display: none;
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed + .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Header */
.header {
    background: white;
    height: var(--header-height);
    padding: 0 2rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 1.5rem;
    color: var(--text-dark);
    font-weight: 600;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-dark);
    cursor: pointer;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-login-header {
    padding: 0.5rem 1.5rem;
    background: var(--warning-color);
    color: #000;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-login-header:hover {
    background: #e0a800;
}

#user-info-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.btn-logout {
    padding: 0.5rem 1rem;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-logout:hover {
    background: #c82333;
}

/* Container */
.container {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Section */
.section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   WELCOME SECTION
   ======================================== */
.welcome-section {
    background: white;
    border-radius: 12px;
    padding: 3rem;
    box-shadow: var(--shadow-md);
}

.welcome-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.welcome-icon i {
    font-size: 2.5rem;
    color: white;
}

.welcome-section h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.welcome-content p {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature-card {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 1.5rem;
    transition: var(--transition);
    border: 2px solid transparent;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.feature-card-link {
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #d4edda, #c3e6cb) !important;
    border: none !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.25);
    transition: all 0.3s ease;
    padding: 1.25rem 1.5rem !important;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    min-height: auto;
}

.feature-card-link:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.35);
    background: linear-gradient(135deg, #c3e6cb, #b1dfbb) !important;
}

.feature-card-link:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.feature-card-link .feature-icon {
    margin-bottom: 0;
    flex-shrink: 0;
}

.feature-card-link h3 {
    margin: 0;
    color: #155724;
    font-weight: 600;
    font-size: 1.125rem;
    text-align: left;
}

/* ========================================
   DASHBOARD CARDS
   ======================================== */
.dashboard-card {
    min-height: 300px;
    display: flex;
    flex-direction: column;
}

.dashboard-content {
    flex: 1;
    margin-top: 1rem;
    max-height: 250px;
    overflow-y: auto;
    overflow-x: hidden;
}

.dashboard-loading,
.dashboard-empty,
.dashboard-error {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.dashboard-error {
    color: var(--danger-color);
}

/* Logs de Busca Preço */
.dashboard-logs-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dashboard-log-item {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 0.75rem;
    border-left: 3px solid #dee2e6;
    transition: background 0.2s;
}

.dashboard-log-item:hover {
    background: #e9ecef;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.log-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.log-status {
    font-size: 0.9rem;
}

.log-status.status-success {
    color: #28a745;
}

.log-status.status-error {
    color: #dc3545;
}

.log-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.log-barcode,
.log-ip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.log-barcode i,
.log-ip i {
    font-size: 0.75rem;
    width: 14px;
}

/* Métricas do Sistema */
.dashboard-metrics {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.metric-item {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 0.75rem;
}

.metric-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.metric-label i {
    color: var(--primary-color);
    width: 16px;
}

.metric-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

.metric-progress {
    width: 100%;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.metric-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transition: width 0.3s ease;
}

/* Sessões Ativas */
.dashboard-sessions-summary {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.session-total {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.session-count {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

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

.session-breakdown {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.session-type {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.session-type i {
    color: var(--primary-color);
}

.dashboard-sessions-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dashboard-session-item {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.session-type-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.session-type-badge.session-type-busca {
    background: #e7f3ff;
    color: #0066cc;
}

.session-type-badge.session-type-tabela {
    background: #fff3cd;
    color: #856404;
}

.session-type-badge.session-type-tvs {
    background: #d1ecf1;
    color: #0c5460;
}

.session-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.8rem;
}

.session-ip {
    font-weight: 600;
    color: var(--text-color);
}

.session-time,
.session-last {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Force Reset */
.force-reset-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.force-reset-total {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.force-reset-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.force-reset-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.force-reset-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.btn-force-reset {
    min-width: 60px;
    height: 40px;
    padding: 0.5rem;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: monospace;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-force-reset:hover {
    background: #0052a3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-force-reset:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-force-reset:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-force-reset-confirmed {
    background: #28a745 !important;
    animation: pulse-green 0.3s ease;
}

@keyframes pulse-green {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* APIs */
.dashboard-apis-summary {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.api-total {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.api-count {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

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

.dashboard-apis-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.api-category {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 0.75rem;
}

.api-category-header {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.api-routes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.api-route-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.api-method {
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.7rem;
    flex-shrink: 0;
    min-width: 50px;
    text-align: center;
}

.api-method-get {
    background: #d4edda;
    color: #155724;
}

.api-method-post {
    background: #cce5ff;
    color: #004085;
}

.api-method-delete {
    background: #f8d7da;
    color: #721c24;
}

.api-path {
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

.api-more {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-style: italic;
    margin-top: 0.25rem;
}

.dashboard-footer {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e9ecef;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Scrollbar personalizada para dashboard */
.dashboard-content::-webkit-scrollbar {
    width: 6px;
}

.dashboard-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.dashboard-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.dashboard-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.feature-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.feature-icon i {
    font-size: 1.5rem;
    color: white;
}

/* Ícones verdes para cards clicáveis */
.feature-card-link .feature-icon {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.feature-card-link .feature-icon i {
    color: white;
}

.feature-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.feature-card p {
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.important-notes {
    background: #fff3cd;
    border-left: 4px solid var(--warning-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.important-notes h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: #856404;
}

.important-notes ul {
    list-style: none;
    padding-left: 0;
}

.important-notes li {
    padding: 0.5rem 0;
    color: #856404;
    position: relative;
    padding-left: 1.5rem;
}

.important-notes li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--warning-color);
    font-weight: bold;
}

/* ========================================
   UPLOAD SECTION
   ======================================== */
.upload-area {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.upload-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.file-input-wrapper {
    flex: 1;
    min-width: 250px;
}

.file-input-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.file-input-label:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.file-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.file-name {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
}

.upload-progress {
    margin-top: 1rem;
}

.progress-bar {
    height: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
    display: none;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transition: width 0.3s ease;
}

.status-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 500;
}

.status-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* File Grid */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.file-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.file-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.file-card.draggable-file-card {
    cursor: move;
    cursor: grab;
}

.file-card.draggable-file-card:active {
    cursor: grabbing;
}

.file-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.file-card img,
.file-card video {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.order-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 102, 204, 0.9);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.85em;
    font-weight: 600;
    z-index: 10;
}

.file-preview {
    position: relative;
}

.file-info {
    padding: 1rem;
}

.file-info p {
    margin: 0.25rem 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ========================================
   UPLOAD PREVIEW AREA
   ======================================== */
.upload-preview-area {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.upload-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.upload-preview-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e9ecef;
}

.upload-preview-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.upload-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.upload-preview-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.upload-preview-info i {
    color: var(--primary-color);
    font-size: 1rem;
    flex-shrink: 0;
}

.upload-preview-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-remove-preview {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.btn-remove-preview:hover {
    background: #c82333;
}

.btn-remove-preview i {
    font-size: 0.75rem;
}

.upload-preview-content {
    position: relative;
    width: 100%;
    height: 200px;
    background: #000;
    overflow: hidden;
}

.upload-preview-media {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.upload-preview-schedule {
    padding: 1rem;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.upload-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.upload-actions .btn {
    min-width: 150px;
}

/* Melhorias na UI dos cards de arquivo */
.file-preview {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #f8f9fa;
}

.file-preview img,
.file-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.schedule-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.schedule-badge i {
    font-size: 0.7rem;
}

.file-name {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9rem;
}

.file-name i {
    color: var(--primary-color);
    font-size: 1rem;
}

.file-name span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schedule-info {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
}

.schedule-date-display {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #856404;
    font-weight: 500;
}

.schedule-date-display i {
    color: #ffc107;
}

.file-actions {
    margin-bottom: 0.75rem;
}

.file-actions .btn {
    width: 100%;
    justify-content: center;
}

.schedule-controls {
    border-top: 1px solid #e9ecef;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}

.schedule-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
}

.schedule-header i {
    color: var(--primary-color);
}

.schedule-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    transition: border-color 0.2s;
}

.schedule-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 51, 153, 0.1);
}

.schedule-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.schedule-buttons .btn {
    flex: 1;
    justify-content: center;
    font-size: 0.85rem;
    padding: 0.5rem;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
    color: #212529;
}

.schedule-status {
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
}

.schedule-status i {
    font-size: 0.85rem;
}

.schedule-status.schedule-loading {
    background: #e7f3ff;
    color: #0066cc;
}

.schedule-status.schedule-success {
    background: #d4edda;
    color: #155724;
}

.schedule-status.schedule-error {
    background: #f8d7da;
    color: #721c24;
}

.schedule-status.schedule-active {
    background: #fff3cd;
    color: #856404;
    font-weight: 500;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.test-connection {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.test-connection:hover {
    background-color: #218838;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ========================================
   CONFIG SECTION
   ======================================== */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-warning {
    background: #fff3cd;
    border-left: 4px solid var(--warning-color);
    color: #856404;
}

.alert i {
    font-size: 1.25rem;
}

.config-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
}

.config-nav button {
    padding: 0.75rem 1.5rem;
    border: none;
    background: var(--bg-light);
    color: var(--text-dark);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.config-nav button:hover {
    background: var(--border-color);
}

.config-nav button.active {
    background: var(--primary-color);
    color: white;
}

.config-tab {
    display: none;
}

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

.config-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-group-inline {
    display: flex;
    align-items: center;
}

.form-group-inline label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-group-inline input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.connection-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 500;
    display: none;
}

.connection-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.connection-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ========================================
   LOGIN MODAL
   ======================================== */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-modal-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalShow 0.3s ease-out;
}

@keyframes modalShow {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.login-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
}

.login-header h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary-color);
    font-size: 1.5rem;
    margin: 0;
}

.login-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.login-close:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.login-field label {
    font-weight: 600;
    color: var(--text-dark);
}

.login-field input {
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
}

.login-field input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.login-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.login-btn-submit {
    flex: 1;
    padding: 0.875rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.login-btn-submit:hover {
    background: var(--primary-dark);
}

.login-btn-submit:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

.login-btn-cancel {
    flex: 1;
    padding: 0.875rem;
    background: var(--text-muted);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.login-btn-cancel:hover {
    background: #5a6268;
}

.login-status {
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    display: none;
}

.login-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.login-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.login-status.info {
    background: #cce7ff;
    color: #004080;
    border: 1px solid #99d6ff;
}

/* ========================================
   FOOTER
   ======================================== */
#footer {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid var(--border-color);
    z-index: 10;
    transition: var(--transition);
}

.sidebar.collapsed ~ #footer {
    left: var(--sidebar-collapsed-width);
}

#footer img {
    height: 30px;
    width: auto;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    #footer {
        left: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 260px;
    }
    
    .header {
        padding: 0 1rem;
    }
    
    .header h1 {
        font-size: 1.25rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    .welcome-section {
        padding: 2rem 1rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .config-nav {
        flex-direction: column;
    }
    
    .config-nav button {
        width: 100%;
    }
    
    .login-modal-content {
        padding: 1.5rem;
    }
    
    .login-actions {
        flex-direction: column;
    }
}