/* Estilos da interface web */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
}

/* Real-time Timer Styles */
.realtime-timer {
    background: transparent;
    color: #333;
    padding: 1.5rem 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timer-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timer-time {
    font-size: 2.8rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    color: #333;
    margin-bottom: 0.3rem;
    letter-spacing: 1px;
}

.timer-date {
    font-size: 0.9rem;
    font-weight: 400;
    color: #888;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

/* Responsive Timer */
@media (max-width: 768px) {
    .realtime-timer {
        padding: 1.2rem 1rem;
        margin-bottom: 1.2rem;
    }
    
    .timer-time {
        font-size: 2.2rem;
        letter-spacing: 1px;
    }
    
    .timer-date {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .timer-time {
        font-size: 1.8rem;
    }
    
    .timer-date {
        font-size: 0.75rem;
    }
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    color: white;
    z-index: 1000;
    transition: transform 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

.brand-text {
    margin-left: 0.5rem;
}

/* Modern Sidebar Toggle Buttons */
.sidebar-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1rem;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sidebar-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1rem;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sidebar-menu {
    padding: 1rem 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-menu .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    text-decoration: none;
    position: relative;
}

.sidebar-menu .nav-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-menu .nav-link.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.15);
    font-weight: 500;
}

.sidebar-menu .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #3498db, #2980b9);
}

.sidebar-menu .nav-link i {
    font-size: 1.125rem;
    width: 20px;
    margin-right: 0.75rem;
}

.nav-text {
    font-size: 0.95rem;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.connection-status {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
    background-color: #27ae60;
    box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.3);
}

.status-indicator.warning {
    background-color: #f39c12;
    box-shadow: 0 0 0 2px rgba(243, 156, 18, 0.3);
}

.status-indicator.error {
    background-color: #e74c3c;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.3);
}

/* Main Content */
.main-content {
    margin-left: 280px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.main-content.expanded {
    margin-left: 0;
}

/* Top Bar */
.topbar {
    background: white;
    padding: 1rem 2rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 999;
}

/* Modern Sidebar Open Button - Transparent */
.sidebar-open-btn {
    background: transparent;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-right: 1rem;
}

.sidebar-open-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    color: #1e293b;
}

.sidebar-open-btn:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
    border-color: #3b82f6;
}

/* Mobile Sidebar Toggle Button */
.mobile-sidebar-toggle {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    border: 1px solid #6b7280;
    color: white;
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.2);
    margin-right: 1rem;
}

.mobile-sidebar-toggle:hover {
    background: linear-gradient(135deg, #4b5563, #374151);
    border-color: #4b5563;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
    color: white;
}

.mobile-sidebar-toggle:focus {
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.1);
    outline: none;
}

.topbar-left {
    display: flex;
    align-items: center;
}

.page-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.topbar-right {
    display: flex;
    align-items: center;
}

/* Content Area */
.content-area {
    padding: 2rem;
}

/* Route Content */
.route-content {
    display: none;
}

.route-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Responsive Design */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-area {
        padding: 1rem;
    }
    
    .topbar {
        padding: 1rem;
    }
    
    /* Hide desktop open button on mobile */
    .sidebar-open-btn {
        display: none !important;
    }
    
    /* Show mobile toggle button */
    .mobile-sidebar-toggle {
        display: inline-flex !important;
    }
}

@media (min-width: 992px) {
    /* Hide mobile toggle button on desktop */
    .mobile-sidebar-toggle {
        display: none !important;
    }
    
    /* Show desktop open button */
    .sidebar-open-btn {
        display: inline-flex !important;
    }
}

@media (max-width: 768px) {
    .topbar-right {
        flex-direction: column;
        align-items: flex-end;
        gap: 0.5rem;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    /* Mobile sidebar improvements */
    .sidebar {
        width: 100%;
        max-width: 320px;
    }
    
    .sidebar-menu .nav-link {
        padding: 1rem 1.5rem;
    }
    
    .sidebar-menu .nav-text {
        font-size: 1rem;
    }
    
    /* Mobile content adjustments */
    .content-area {
        padding: 1rem 0.5rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* Mobile button adjustments */
    .btn-group-mobile {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-group-mobile .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Mobile table adjustments */
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
    }
    
    /* Mobile form adjustments */
    .form-control,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Mobile modal adjustments */
    .modal-dialog {
        margin: 1rem;
    }
    
    /* Mobile toast adjustments */
    .toast-container {
        padding: 1rem;
    }
    
    .toast {
        min-width: 280px;
        max-width: 100%;
    }
}

/* Header Styles */
.navbar-brand {
    font-weight: 600;
}

/* Card Styles - Redesigned for White Theme */
.card {
    border: 2px solid #000000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    background: #ffffff;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-bottom: 1px solid #e8ecf0;
    border-radius: 12px 12px 0 0;
    font-weight: 600;
    color: #1e293b;
    padding: 1.25rem 1.5rem;
}

.card-header h5,
.card-header h6 {
    color: #1e293b !important;
    font-weight: 600 !important;
    margin: 0;
}

.card-header i {
    color: #475569 !important;
}

.card-body {
    background: #ffffff;
    color: #334155;
    padding: 1.5rem;
}

/* Status Cards - Redesigned */
.status-card {
    text-align: center;
    padding: 1.5rem;
    background: #ffffff;
    border-radius: 12px;
    border: 2px solid #000000;
}

.status-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

/* Metric Values in Cards */
.h4, .h5, .h6 {
    color: #1e293b !important;
    font-weight: 600 !important;
}

.text-primary {
    color: #3b82f6 !important;
}

.text-success {
    color: #10b981 !important;
}

.text-warning {
    color: #f59e0b !important;
}

.text-info {
    color: #06b6d4 !important;
}

.text-muted {
    color: #64748b !important;
}

.text-danger {
    color: #ef4444 !important;
}

/* Table Styles - Redesigned */
.table {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #000000;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: #1e293b;
    font-size: 0.875rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e8ecf0;
    padding: 1rem 0.75rem;
}

.table td {
    color: #334155;
    padding: 0.875rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
    transform: scale(1.01);
    transition: all 0.2s ease;
}

/* Badge Styles - Redesigned */
.badge {
    font-weight: 500;
    border-radius: 6px;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.badge-waiting {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fbbf24;
}

.badge-sent {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.badge-excluded {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.bg-success {
    background-color: #10b981 !important;
    color: #ffffff !important;
}

.bg-danger {
    background-color: #ef4444 !important;
    color: #ffffff !important;
}

.bg-warning {
    background-color: #f59e0b !important;
    color: #ffffff !important;
}

.bg-info {
    background-color: #06b6d4 !important;
    color: #ffffff !important;
}

/* Exception List Styles - Redesigned */
.exception-item {
    display: inline-flex;
    align-items: center;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.375rem 0.75rem;
    margin: 0.125rem;
    font-size: 0.875rem;
    color: #475569;
    font-weight: 500;
    transition: all 0.2s ease;
}

.exception-item:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.exception-item .btn-close {
    font-size: 0.75rem;
    margin-left: 0.5rem;
    color: #64748b;
}

.exception-item .btn-close:hover {
    color: #ef4444;
}

/* Log Styles - Redesigned */
.log-entry {
    padding: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    background: #ffffff;
    transition: all 0.2s ease;
}

.log-entry:hover {
    background-color: #f8fafc;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry.log-debug {
    background-color: #eff6ff;
    border-left: 4px solid #3b82f6;
    color: #1e40af;
}

.log-entry.log-info {
    background-color: #f8fafc;
    border-left: 4px solid #64748b;
    color: #334155;
}

.log-entry.log-warn {
    background-color: #fffbeb;
    border-left: 4px solid #f59e0b;
    color: #92400e;
}

.log-entry.log-error {
    background-color: #fef2f2;
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

.log-entry.log-critical {
    background-color: #fef2f2;
    border-left: 4px solid #dc2626;
    font-weight: 700;
    color: #7f1d1d;
}

.log-timestamp {
    color: #64748b;
    font-weight: 600;
    font-size: 0.75rem;
}

.log-message {
    color: #1e293b;
    margin-left: 0.5rem;
    font-weight: 500;
}

.log-context {
    color: #64748b;
    font-size: 0.75rem;
    font-style: italic;
}

.log-metadata {
    background-color: #f1f5f9;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    margin-top: 0.375rem;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.log-error-details {
    background-color: #fef2f2;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    margin-top: 0.375rem;
    color: #991b1b;
    font-family: 'Courier New', monospace;
    border: 1px solid #fecaca;
}

/* Loading Styles */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Toast Styles */
.toast {
    min-width: 300px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .container-fluid {
        padding: 10px;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    .card-header h5,
    .card-header h6 {
        font-size: 0.9rem;
    }
    
    .btn-sm {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .status-number {
        font-size: 1.5rem;
    }
    
    /* Stack sidebar below main content on mobile */
    .col-lg-4 {
        margin-top: 1rem;
    }
    
    /* Adjust form controls for mobile */
    .form-select-sm,
    .form-control-sm {
        font-size: 0.875rem;
    }
    
    /* Mobile-friendly buttons */
    .d-flex.gap-2 {
        flex-wrap: wrap;
    }
    
    /* Adjust log container height on mobile */
    #logs-container {
        height: 200px !important;
    }
}

@media (max-width: 576px) {
    .navbar .d-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .card-header .d-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .row > div[class*="col-md-"] {
        margin-bottom: 1rem;
    }
    
    /* Hide some columns on very small screens */
    .table th:nth-child(2),
    .table td:nth-child(2) {
        display: none;
    }
}

/* Utility Classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer {
    cursor: pointer;
}

.border-dashed {
    border-style: dashed !important;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Modern Card Enhancements */
.card {
    border: 2px solid #000000;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 1px solid #e9ecef;
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
}

/* Modern Button Styles - Redesigned */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
    padding: 0.5rem 1rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
    border-color: #3b82f6;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-color: #2563eb;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    border-color: #10b981;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
    border-color: #059669;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    border-color: #f59e0b;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    border-color: #d97706;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    border-color: #ef4444;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    border-color: #dc2626;
}

.btn-outline-primary {
    color: #3b82f6;
    border-color: #3b82f6;
    background: transparent;
}

.btn-outline-primary:hover {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}

/* Modern Form Controls - Redesigned */
.form-control, .form-select {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: #ffffff;
    color: #1e293b;
    padding: 0.5rem 0.75rem;
}

.form-control:focus, .form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: #ffffff;
    outline: none;
}

.form-control::placeholder, .form-select::placeholder {
    color: #9ca3af;
}

.form-label {
    color: #374151;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-control-sm, .form-select-sm {
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
}

/* Modern Badge Styles */
.badge {
    border-radius: 6px;
    font-weight: 500;
    padding: 0.5em 0.75em;
}

/* Enhanced Table Styles */
.table {
    border-radius: 8px;
    overflow: hidden;
}

.table th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #6c757d;
}

.table-hover tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.05);
    transform: scale(1.01);
    transition: all 0.2s ease;
}

/* Modern Alert Styles - Redesigned */
.alert {
    border: 1px solid;
    border-radius: 8px;
    border-left: 4px solid;
    padding: 1rem 1.25rem;
    font-weight: 500;
}

.alert-success {
    border-left-color: #10b981;
    border-color: #d1fae5;
    background: #f0fdf4;
    color: #065f46;
}

.alert-warning {
    border-left-color: #f59e0b;
    border-color: #fef3c7;
    background: #fffbeb;
    color: #92400e;
}

.alert-danger {
    border-left-color: #ef4444;
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.alert-info {
    border-left-color: #06b6d4;
    border-color: #cffafe;
    background: #f0f9ff;
    color: #0c4a6e;
}

/* Modern Modal Styles - Redesigned */
.modal-content {
    border: 2px solid #000000;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    background: #ffffff;
}

.modal-header {
    border-bottom: 1px solid #e8ecf0;
    border-radius: 12px 12px 0 0;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    padding: 1.5rem;
}

.modal-header .modal-title {
    color: #1e293b;
    font-weight: 600;
}

.modal-body {
    background: #ffffff;
    color: #334155;
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e8ecf0;
    border-radius: 0 0 12px 12px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    padding: 1.5rem;
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Status Indicators - Redesigned */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.status-indicator.online {
    background-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.status-indicator.offline {
    background-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
}

.status-indicator.warning {
    background-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3);
}

.status-indicator.error {
    background-color: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.3);
}/* En
hanced Mobile Responsiveness */
@media (max-width: 768px) {
    /* Mobile table styles */
    .mobile-table table,
    .mobile-table thead,
    .mobile-table tbody,
    .mobile-table th,
    .mobile-table td,
    .mobile-table tr {
        display: block;
    }
    
    .mobile-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .mobile-table tr {
        border: 1px solid #ccc;
        margin-bottom: 10px;
        padding: 10px;
        border-radius: 8px;
        background: white;
    }
    
    .mobile-table td {
        border: none;
        position: relative;
        padding-left: 50% !important;
        padding-top: 10px;
        padding-bottom: 10px;
    }
    
    .mobile-table td:before {
        content: attr(data-label) ": ";
        position: absolute;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
        color: #666;
    }
    
    /* Mobile card adjustments */
    .mobile-card .card-header {
        padding: 0.75rem;
    }
    
    .mobile-card .card-body {
        padding: 0.75rem;
    }
    
    /* Mobile form adjustments */
    .mobile-form .form-control,
    .mobile-form .form-select {
        margin-bottom: 0.5rem;
    }
    
    /* Mobile button groups */
    .btn-group-mobile {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-group-mobile .btn {
        width: 100%;
    }
}

/* Enhanced Focus Styles for Accessibility */
.focus-visible {
    outline: 2px solid #0d6efd !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25) !important;
}

/* Loading States */
.loading-state {
    opacity: 0.6;
    pointer-events: none;
}

.loading-state * {
    cursor: wait !important;
}

/* Enhanced Button States */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-loading {
    position: relative;
}

.btn-loading:disabled {
    color: transparent;
}

.btn-loading:disabled::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced Toast Styles */
.toast-container .toast {
    margin-bottom: 0.5rem;
}

.toast.show {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Connection Status Indicator */
.connection-indicator {
    position: relative;
}

.connection-indicator::before {
    content: "";
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
}

/* Enhanced Error States */
.error-state {
    border-color: #dc3545 !important;
    background-color: #f8d7da !important;
}

.error-message {
    color: #721c24;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Success States */
.success-state {
    border-color: #198754 !important;
    background-color: #d1e7dd !important;
}

.success-message {
    color: #0f5132;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Enhanced Table Hover Effects - Final */
.table-hover tbody tr:hover {
    background-color: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

/* Additional Card Enhancements */
.card .small {
    color: #64748b !important;
}

.card .fw-bold {
    color: #1e293b !important;
    font-weight: 600 !important;
}

/* Enhanced Form Labels */
.form-label.fw-bold {
    color: #374151 !important;
    font-weight: 600 !important;
}

/* Enhanced Text Colors */
.text-center .h4,
.text-center .h5,
.text-center .h6 {
    color: #1e293b !important;
}

.text-center small {
    color: #64748b !important;
}

/* Smooth Transitions */
.card,
.btn,
.form-control,
.form-select,
.badge {
    transition: all 0.2s ease;
}

/* Enhanced Scrollbar Styles */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Apply custom scrollbar to logs container */
#logs-container {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

/* Dark Mode Support (if needed in future) */
@media (prefers-color-scheme: dark) {
    .card {
        background-color: #2d3748;
        border-color: #4a5568;
    }
    
    .card-header {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .table {
        color: #e2e8f0;
    }
    
    .table-light {
        background-color: #4a5568;
        color: #e2e8f0;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .toast-container,
    .modal {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    .table {
        border-collapse: collapse !important;
    }
    
    .table th,
    .table td {
        border: 1px solid #000 !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
    
    .form-control,
    .form-select {
        border: 2px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .pulse,
    .fade-in {
        animation: none !important;
    }
}

/* Enhanced Mobile Navigation */
@media (max-width: 576px) {
    .navbar-brand {
        font-size: 0.9rem;
    }
    
    .navbar .btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Collapsible sidebar on very small screens */
    .sidebar-collapse .col-lg-4 {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: white;
        z-index: 1050;
        transition: right 0.3s ease;
        overflow-y: auto;
        padding: 1rem;
    }
    
    .sidebar-collapse.show .col-lg-4 {
        right: 0;
    }
    
    .sidebar-toggle {
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 1051;
        border-radius: 50%;
        width: 56px;
        height: 56px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }
}

/* Metrics Styles */
.metrics-card {
    transition: all 0.3s ease;
}

.metrics-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.alert-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-close-sm {
    padding: 0.25rem;
    font-size: 0.75rem;
}

/* Dashboard Cards - Redesigned */
.dashboard-metric {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #000000;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.dashboard-metric:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.metric-label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* Alert Animations */
@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert {
    animation: alertSlideIn 0.3s ease-out;
}

/* Progress Bars for Metrics - Redesigned */
.metric-progress {
    height: 6px;
    background-color: #f1f5f9;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.75rem;
    border: 1px solid #e2e8f0;
}

.metric-progress-bar {
    height: 100%;
    transition: width 0.6s ease;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    border-radius: 3px;
}

.metric-progress-bar.success {
    background: linear-gradient(90deg, #10b981, #059669);
}

.metric-progress-bar.warning {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.metric-progress-bar.danger {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

/* Status Indicators - Final Redesign */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.status-indicator.online {
    background-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.status-indicator.warning {
    background-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3);
}

.status-indicator.error {
    background-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
}

.status-indicator.offline {
    background-color: #6b7280;
    box-shadow: 0 0 0 2px rgba(107, 114, 128, 0.3);
}

/* Logs Styles */
.log-entry {
    background-color: #fff;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.log-entry:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.log-entry .log-level {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.log-entry .log-message {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.4;
    margin-top: 0.5rem;
}

.log-metadata {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.75rem;
    background-color: #f8f9fa;
    padding: 0.5rem;
    border-radius: 4px;
    border-left: 3px solid #dee2e6;
}

.log-stack {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.75rem;
    background-color: #fef2f2;
    padding: 0.5rem;
    border-radius: 4px;
    border-left: 3px solid #ef4444;
    max-height: 200px;
    overflow-y: auto;
}

.log-stack pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Log level specific styles */
.log-entry.border-info .log-level {
    background-color: #dbeafe;
    color: #1e40af;
}

.log-entry.border-primary .log-level {
    background-color: #e0e7ff;
    color: #3730a3;
}

.log-entry.border-warning .log-level {
    background-color: #fef3c7;
    color: #92400e;
}

.log-entry.border-danger .log-level {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Logs container scrollbar */
#logs-container {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

#logs-container::-webkit-scrollbar {
    width: 8px;
}

#logs-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

#logs-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

#logs-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Estilos específicos para a aba Sistema */
#sistema-route .form-control:focus,
#sistema-route .form-select:focus,
#sistema-route .form-check-input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

#sistema-route .form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

#sistema-route .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

#sistema-route .badge {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

#sistema-route .alert-warning {
    border-left: 4px solid #ffc107;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

#sistema-route .btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

#sistema-route .btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

#sistema-route .btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

#sistema-route .btn-outline-info:hover {
    background-color: #0dcaf0;
    border-color: #0dcaf0;
    color: white;
}

#sistema-route .btn-outline-warning:hover {
    background-color: #ffc107;
    border-color: #ffc107;
    color: black;
}

/* Animações para feedback visual */
#sistema-route .form-control.is-valid,
#sistema-route .form-select.is-valid {
    border-color: #198754;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='m2.3 6.73.94-.94 1.38 1.38 2.05-2.05.94.94-2.99 2.99z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

#sistema-route .form-control.is-invalid,
#sistema-route .form-select.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 4.6 0 3.4M5.8 8.2l.01 0'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Transições suaves */
#sistema-route .form-control,
#sistema-route .form-select,
#sistema-route .btn {
    transition: all 0.15s ease-in-out;
}

#sistema-route .alert {
    transition: opacity 0.15s ease-in-out;
}

/* Melhorias para inputs de tempo */
#sistema-route input[type="time"] {
    min-width: 120px;
}

#sistema-route input[type="number"] {
    min-width: 100px;
}

/* Status indicator melhorado */
#config-status {
    min-width: 140px;
    text-align: center;
}

/* Botão Salvar Flutuante */
.floating-save-button {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 1000;
}

.floating-save-button .btn {
    border-radius: 25px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    border: none;
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
}

.floating-save-button .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.3) !important;
    background: linear-gradient(135deg, #0b5ed7 0%, #0a58ca 100%);
}

.floating-save-button .btn:active {
    transform: translateY(0);
}

.floating-save-button .btn:disabled {
    opacity: 0.6;
    transform: none;
    background: #6c757d;
}

/* Alerta Flutuante */
.floating-warning {
    position: fixed;
    bottom: 6rem;
    left: 2rem;
    z-index: 999;
    max-width: 300px;
    border-radius: 10px;
    border: none;
    box-shadow: 0 4px 20px rgba(255, 193, 7, 0.3);
    animation: slideInLeft 0.3s ease;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsividade para a aba Sistema */
@media (max-width: 768px) {
    #sistema-route .col-md-6 {
        margin-bottom: 1rem;
    }
    
    .floating-save-button {
        bottom: 1rem;
        left: 1rem;
    }
    
    .floating-save-button .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .floating-warning {
        bottom: 4rem;
        left: 1rem;
        max-width: calc(100vw - 2rem);
    }
}

/* Estilos para a aba Métricas */
#metricas-route .metric-item {
    padding: 1rem;
    border-radius: 8px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

#metricas-route .metric-item:hover {
    background-color: #e9ecef;
    transform: translateY(-1px);
}

#metricas-route .metric-row {
    padding: 0.75rem;
    border-radius: 6px;
    background-color: #f8f9fa;
    border-left: 3px solid #dee2e6;
    transition: all 0.2s ease;
}

#metricas-route .metric-row:hover {
    background-color: #e9ecef;
    border-left-color: #0d6efd;
}

#metricas-route .metric-label {
    font-size: 0.9rem;
    color: #495057;
}

#metricas-route .metric-value {
    font-size: 1rem;
    color: #212529;
}

#metricas-route .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

#metricas-route .h4, #metricas-route .h5 {
    margin: 0;
    font-weight: 600;
}

/* Animação para valores que mudam */
#metricas-route .metric-value,
#metricas-route .h4,
#metricas-route .h5 {
    transition: all 0.3s ease;
}

#metricas-route .metric-value.updated,
#metricas-route .h4.updated,
#metricas-route .h5.updated {
    transform: scale(1.1);
    animation: pulse 0.6s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Responsividade para métricas */
@media (max-width: 768px) {
    #metricas-route .col-md-6 {
        margin-bottom: 1rem;
    }
    
    #metricas-route .h4 {
        font-size: 1.5rem;
    }
    
    #metricas-route .h5 {
        font-size: 1.25rem;
    }
    
    #metricas-route .metric-row {
        padding: 0.5rem;
    }
    
    #metricas-route .metric-item {
        padding: 0.75rem;
    }
}

/* Animação de rotação para o botão de recarregar */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}