/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --dark: #0f172a;
    --gray: #64748b;
    --light: #f1f5f9;
    --white: #ffffff;
    --sidebar-width: 280px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--dark);
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    box-shadow: 8px 0 40px rgba(0,0,0,0.2);
    z-index: 1000;
    overflow-y: auto;
    backdrop-filter: blur(10px);
}

.sidebar-header {
    padding: 35px 25px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.02);
}

.sidebar-header h3 {
    color: var(--white);
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.sidebar-header p {
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
    font-weight: 500;
}

.sidebar-menu {
    padding: 25px 0;
}

.menu-item {
    padding: 16px 28px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid transparent;
    font-weight: 500;
    margin: 3px 0;
}

.menu-item:hover {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, transparent 100%);
    color: var(--white);
    border-left-color: var(--primary);
    padding-left: 32px;
}

.menu-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0.05) 100%);
    color: var(--white);
    border-left-color: var(--primary);
}

.menu-item i {
    margin-right: 18px;
    font-size: 1.3rem;
    width: 28px;
    text-align: center;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 35px;
    min-height: 100vh;
}

/* Compact Top Bar */
.compact-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    margin-bottom: 25px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--gray);
    font-weight: 500;
}

.breadcrumb i {
    font-size: 0.85rem;
    color: var(--primary);
}

.breadcrumb span {
    color: var(--dark);
    font-weight: 600;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 6px 14px 6px 6px;
    border-radius: 50px;
    box-shadow: 0 2px 10px rgba(31, 38, 135, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.user-avatar-mini {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.user-name-mini {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark);
}

/* Old top bar styles - kept for backward compatibility */
.top-bar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 25px 35px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    margin-bottom: 35px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.page-title {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    letter-spacing: -1px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 18px;
    background: rgba(99, 102, 241, 0.05);
    padding: 12px 20px;
    border-radius: 50px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(31, 38, 135, 0.12);
    margin-bottom: 30px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(31, 38, 135, 0.2);
}

.card-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    border-bottom: 2px solid rgba(99, 102, 241, 0.1);
    padding: 28px;
}

.card-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-title i {
    color: var(--primary);
}

.card-body {
    padding: 30px;
}

.card-footer {
    background: linear-gradient(180deg, rgba(241, 245, 249, 0.5) 0%, rgba(255, 255, 255, 0.8) 100%);
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    padding: 25px 30px;
    display: flex;
    gap: 12px;
}

/* Buttons */
.btn {
    padding: 14px 32px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(99, 102, 241, 0.5);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: var(--white);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.35);
}

.btn-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(16, 185, 129, 0.5);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: var(--white);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(239, 68, 68, 0.5);
}

.btn-info {
    background: linear-gradient(135deg, var(--info) 0%, #2563eb 100%);
    color: var(--white);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.35);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
    color: var(--white);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.35);
}

.btn-lg {
    padding: 17px 40px;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 10px 22px;
    font-size: 0.9rem;
}

/* Forms */
.form-group {
    margin-bottom: 28px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--dark);
    font-size: 1rem;
}

.form-label i {
    color: var(--primary);
}

.form-control {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.1), 0 4px 20px rgba(99, 102, 241, 0.15);
    transform: translateY(-2px);
}

.form-control.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.form-text {
    font-size: 0.9rem;
    color: var(--gray);
    margin-top: 8px;
    display: block;
    font-weight: 500;
}

input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Route Items */
.route-item {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 22px;
    border-left: 5px solid transparent;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(31, 38, 135, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.route-item:hover {
    border-left-color: var(--primary);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.2);
    transform: translateX(8px) scale(1.01);
}

.route-item.active {
    border-left-color: var(--success);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.route-item.inactive {
    opacity: 0.65;
    border-left-color: #cbd5e1;
}

.badge {
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.badge-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: var(--white);
}

.badge-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: var(--white);
}

/* Stats Cards */
.stat-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    border-radius: 20px;
    padding: 32px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.4);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.stat-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.5);
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.95;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

/* Alerts */
.alert {
    padding: 18px 24px;
    border-radius: 14px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

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

.alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border-left: 5px solid var(--success);
}

.alert-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border-left: 5px solid var(--danger);
}

/* Code Tags */
code {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #e11d48;
    font-weight: 600;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 55px 45px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.login-header {
    text-align: center;
    margin-bottom: 45px;
}

.login-title {
    font-size: 2.3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    letter-spacing: -1px;
}

.login-subtitle {
    color: var(--gray);
    font-size: 1rem;
    font-weight: 500;
}

/* Table for Logs */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

table th {
    background: linear-gradient(135deg, #f9fafb 0%, #f1f5f9 100%);
    padding: 18px;
    text-align: left;
    font-weight: 700;
    color: var(--dark);
    border: none;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table td {
    padding: 18px;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}

table tr {
    transition: all 0.3s ease;
}

table tr:hover td {
    background: rgba(99, 102, 241, 0.05);
    transform: scale(1.01);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
    }

    .compact-top-bar {
        padding: 10px 0;
        margin-bottom: 20px;
    }

    .breadcrumb {
        font-size: 0.85rem;
    }

    .user-menu {
        padding: 5px 12px 5px 5px;
    }

    .user-name-mini {
        font-size: 0.8rem;
    }

    .top-bar {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .stat-card {
        margin-bottom: 18px;
    }

    .page-title {
        font-size: 1.6rem;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-dark), var(--primary));
}

/* ========================================
   NOVOS ESTILOS - CARDS DE ROTAS
   ======================================== */

/* Routes Header */
.routes-header {
    margin-bottom: 35px;
}

.routes-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.routes-stats {
    display: flex;
    gap: 20px;
}

.stat-mini {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 20px 25px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 20px rgba(31, 38, 135, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.stat-mini:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(31, 38, 135, 0.15);
}

.stat-mini i {
    font-size: 2rem;
    color: var(--primary);
    opacity: 0.8;
}

.stat-mini.success i {
    color: var(--success);
}

.stat-mini-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark);
    line-height: 1;
}

.stat-mini-label {
    font-size: 0.85rem;
    color: var(--gray);
    font-weight: 600;
}

/* Routes Grid */
.routes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

/* Route Card */
.route-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.route-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.route-card:hover::before {
    transform: scaleX(1);
}

.route-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 16px 48px rgba(99, 102, 241, 0.25);
}

.route-card.inactive {
    opacity: 0.7;
}

.route-card.inactive::before {
    background: linear-gradient(90deg, #94a3b8, #cbd5e1);
}

/* Route Card Header */
.route-card-header {
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
}

.route-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.8rem;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.route-card-status {
    display: flex;
    align-items: center;
}

.status-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-badge i {
    font-size: 0.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-badge.active {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.status-badge.inactive {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #475569;
    box-shadow: 0 4px 12px rgba(71, 85, 105, 0.1);
}

/* Route Card Body */
.route-card-body {
    padding: 25px;
}

.route-card-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 20px;
    line-height: 1.3;
}

.route-card-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(241, 245, 249, 0.5);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.info-item:hover {
    background: rgba(99, 102, 241, 0.08);
    transform: translateX(4px);
}

.info-item i {
    color: var(--primary);
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.info-label {
    font-size: 0.8rem;
    color: var(--gray);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    grid-column: 2;
    justify-self: start;
}

.info-value {
    font-size: 0.9rem;
    color: var(--dark);
    font-weight: 600;
    grid-column: 3;
    justify-self: end;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Route Card Footer */
.route-card-footer {
    padding: 20px 25px;
    background: linear-gradient(180deg, rgba(241, 245, 249, 0.3), rgba(255, 255, 255, 0.5));
    border-top: 1px solid rgba(226, 232, 240, 0.5);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.btn-icon:hover::before {
    width: 100px;
    height: 100px;
}

.btn-icon-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-icon-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-icon-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-icon-danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 40px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.empty-state-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-icon i {
    font-size: 4rem;
    color: var(--primary);
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 15px;
}

.empty-state-text {
    font-size: 1.1rem;
    color: var(--gray);
    margin-bottom: 30px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================
   FORMULÁRIOS MODERNOS
   ======================================== */

.form-container {
    max-width: 900px;
    margin: 0 auto;
}

.modern-form {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.form-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.form-section:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.18);
}

.form-section-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.08));
    padding: 25px 30px;
    border-bottom: 2px solid rgba(99, 102, 241, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.form-section-header i {
    font-size: 1.5rem;
    color: var(--primary);
}

.form-section-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark);
}

.form-row {
    padding: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.form-hint {
    font-size: 0.85rem;
    color: var(--gray);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-error {
    font-size: 0.9rem;
    color: var(--danger);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.optional-badge {
    display: inline-block;
    padding: 3px 10px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    font-size: 0.7rem;
    border-radius: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 8px;
}

/* Checkbox Custom */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 50px;
    height: 28px;
    background: #cbd5e1;
    border-radius: 50px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-custom::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: linear-gradient(135deg, var(--success), #059669);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::before {
    left: 25px;
}

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

/* Form Actions */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding: 20px 0;
}

.btn-secondary {
    background: linear-gradient(135deg, #64748b, #475569);
    color: white;
    box-shadow: 0 8px 25px rgba(100, 116, 139, 0.35);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(100, 116, 139, 0.5);
}

/* SweetAlert Custom */
.swal-modern {
    border-radius: 20px !important;
    backdrop-filter: blur(20px);
}

.swal-btn-confirm,
.swal-btn-cancel {
    border-radius: 12px !important;
    font-weight: 600 !important;
    padding: 12px 28px !important;
}

/* Live Indicator */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--danger);
}

.live-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .routes-grid {
        grid-template-columns: 1fr;
    }

    .routes-header-content {
        flex-direction: column;
        align-items: stretch;
    }

    .routes-stats {
        flex-direction: column;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .compact-stats-row {
        grid-template-columns: 1fr 1fr !important;
    }

    .routes-compact-header {
        flex-direction: column;
        gap: 15px;
    }

    .stats-pills {
        width: 100%;
        justify-content: space-between;
    }
}

/* ========================================
   NOVO DESIGN COMPACTO E MODERNO
   ======================================== */

/* Compact Stats Row */
.compact-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 35px;
}

.compact-stat-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 20px rgba(31, 38, 135, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.compact-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    transition: all 0.3s ease;
}

.compact-stat-card.gradient-purple::before {
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
}

.compact-stat-card.gradient-green::before {
    background: linear-gradient(90deg, #10b981, #059669);
}

.compact-stat-card.gradient-orange::before {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.compact-stat-card.gradient-blue::before {
    background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.compact-stat-card.gradient-success::before {
    background: linear-gradient(90deg, #10b981, #059669);
}

.compact-stat-card.gradient-red::before {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.compact-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(31, 38, 135, 0.15);
}

.compact-stat-card:hover::before {
    height: 100%;
    opacity: 0.05;
}

.compact-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.gradient-purple .compact-stat-icon {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    color: #6366f1;
}

.gradient-green .compact-stat-icon {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.1));
    color: #10b981;
}

.gradient-orange .compact-stat-icon {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.1));
    color: #f59e0b;
}

.gradient-blue .compact-stat-icon {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.1));
    color: #3b82f6;
}

.gradient-success .compact-stat-icon {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.1));
    color: #10b981;
}

.gradient-red .compact-stat-icon {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.1));
    color: #ef4444;
}

.compact-stat-content {
    flex: 1;
}

.compact-stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--dark);
    line-height: 1;
    margin-bottom: 5px;
}

.compact-stat-label {
    font-size: 0.85rem;
    color: var(--gray);
    font-weight: 600;
}

.live-updates .compact-stat-value {
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.live-pulse {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* Modern Card */
.modern-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(31, 38, 135, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.6);
    margin-bottom: 30px;
    overflow: hidden;
}

.modern-card-header {
    padding: 20px 25px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.03), rgba(139, 92, 246, 0.03));
    flex-wrap: wrap;
    gap: 15px;
}

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

.modern-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modern-card-title i {
    color: var(--primary);
    font-size: 1rem;
}

.auto-refresh-badge {
    padding: 4px 12px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.1));
    color: #059669;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    user-select: none;
}

.auto-refresh-badge:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.2));
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

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

.auto-refresh-badge i.fa-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.btn-text {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.btn-text:hover {
    color: var(--primary-dark);
    gap: 10px;
}

.modern-card-body {
    padding: 0;
}

/* Activity Item */
.activity-item-wrapper {
    border-bottom: 1px solid rgba(226, 232, 240, 0.4);
    transition: all 0.3s ease;
}

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

.activity-item-wrapper.expanded .activity-item {
    background: rgba(99, 102, 241, 0.05);
}

.activity-item {
    padding: 18px 25px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.activity-item:hover {
    background: rgba(99, 102, 241, 0.03);
}

.activity-expand {
    margin-left: auto;
    color: var(--gray);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.activity-item:hover .activity-expand {
    color: var(--primary);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.activity-icon.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.1));
    color: #10b981;
}

.activity-icon.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.1));
    color: #ef4444;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 4px;
}

.activity-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--gray);
}

.activity-phone {
    font-family: 'Courier New', monospace;
    background: rgba(241, 245, 249, 0.8);
    padding: 2px 8px;
    border-radius: 4px;
}

.activity-time {
    display: flex;
    align-items: center;
    gap: 4px;
}

.activity-status {
    flex-shrink: 0;
}

.status-pill {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-block;
}

.status-pill.success {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
}

.status-pill.error {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
}

.status-pill.neutral {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #475569;
}

/* Empty Activity */
.empty-activity {
    padding: 60px 40px;
    text-align: center;
    color: var(--gray);
}

.empty-activity i {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 15px;
}

.empty-activity h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.empty-activity p {
    font-size: 0.95rem;
}

/* Quick Actions Row */
.quick-actions-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.quick-action-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 20px rgba(31, 38, 135, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--dark);
    font-weight: 600;
    font-size: 1.05rem;
    position: relative;
    overflow: hidden;
}

.quick-action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.quick-action-card.gradient-green::before {
    background: linear-gradient(90deg, #10b981, #059669);
}

.quick-action-card.gradient-purple::before {
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
}

.quick-action-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(31, 38, 135, 0.15);
}

.quick-action-card:hover::before {
    height: 100%;
    opacity: 0.05;
}

.quick-action-card i {
    font-size: 1.8rem;
}

.quick-action-card.gradient-green i {
    color: #10b981;
}

.quick-action-card.gradient-purple i {
    color: #6366f1;
}

/* ========================================
   ROUTES PAGE - COMPACT DESIGN
   ======================================== */

.routes-compact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.stats-pills {
    display: flex;
    gap: 12px;
}

.stat-pill {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 12px rgba(31, 38, 135, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
}

.stat-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(31, 38, 135, 0.12);
}

.stat-pill-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark);
    line-height: 1;
}

.stat-pill-label {
    font-size: 0.8rem;
    color: var(--gray);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-pill.success .stat-pill-number {
    color: #10b981;
}

.stat-pill.inactive .stat-pill-number {
    color: #94a3b8;
}

/* Modern Table Card */
.modern-table-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(31, 38, 135, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.6);
    overflow: hidden;
}

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

.modern-table thead {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.03), rgba(139, 92, 246, 0.03));
    border-bottom: 2px solid rgba(226, 232, 240, 0.5);
}

.modern-table thead th {
    padding: 16px 20px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modern-table tbody tr {
    border-bottom: 1px solid rgba(226, 232, 240, 0.3);
    transition: all 0.3s ease;
}

.modern-table tbody tr:last-child {
    border-bottom: none;
}

.modern-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.03);
}

.modern-table tbody tr.row-inactive {
    opacity: 0.6;
}

.modern-table tbody td {
    padding: 16px 20px;
    vertical-align: middle;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 auto;
}

.status-dot.active {
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
    animation: pulse 2s infinite;
}

.status-dot.inactive {
    background: #cbd5e1;
}

.table-cell-primary {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 3px;
}

.table-cell-secondary {
    font-size: 0.8rem;
    color: var(--gray);
}

.modern-code {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    background: rgba(241, 245, 249, 0.8);
    padding: 4px 10px;
    border-radius: 6px;
    color: #e11d48;
    font-weight: 600;
}

.modern-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.modern-badge.success {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
}

.modern-badge.inactive {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #475569;
}

.action-buttons-compact {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.action-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.action-icon.edit {
    color: #6366f1;
}

.action-icon.edit:hover {
    background: rgba(99, 102, 241, 0.1);
    transform: scale(1.1);
}

.action-icon.delete {
    color: #ef4444;
}

.action-icon.delete:hover {
    background: rgba(239, 68, 68, 0.1);
    transform: scale(1.1);
}

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

/* Empty State Compact */
.empty-state-compact {
    padding: 80px 40px;
    text-align: center;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(31, 38, 135, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.08));
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-icon i {
    font-size: 2.5rem;
    color: var(--primary);
    opacity: 0.4;
}

.empty-state-compact h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 10px;
}

.empty-state-compact p {
    font-size: 1rem;
    color: var(--gray);
    margin-bottom: 25px;
}

/* ========================================
   ACTIVITY DETAILS & PAGINATION
   ======================================== */

/* Message Type Badge */
.message-type-badge {
    padding: 4px 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    color: #6366f1;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Activity Details */
.activity-details {
    background: linear-gradient(135deg, rgba(241, 245, 249, 0.5), rgba(255, 255, 255, 0.3));
    padding: 20px 25px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding: 0 25px;
    }
    to {
        opacity: 1;
        max-height: 500px;
        padding: 20px 25px;
    }
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.detail-header {
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.08));
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.detail-content {
    padding: 16px;
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    line-height: 1.6;
    color: #334155;
    background: rgba(248, 250, 252, 0.8);
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.detail-content::-webkit-scrollbar {
    width: 6px;
}

.detail-content::-webkit-scrollbar-track {
    background: rgba(241, 245, 249, 0.5);
}

.detail-content::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 3px;
}

/* Pagination Styles */
.pagination-wrapper {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination .page-item {
    display: inline-block;
}

.pagination .page-link {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: var(--dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(31, 38, 135, 0.08);
    display: inline-block;
}

.pagination .page-link:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.pagination .page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination .page-item:first-child .page-link,
.pagination .page-item:last-child .page-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Search Form */
.search-form {
    margin: 0;
}

.search-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-group i.fa-search {
    position: absolute;
    left: 14px;
    color: var(--gray);
    font-size: 0.9rem;
}

.search-input {
    padding: 10px 16px 10px 42px;
    border: 2px solid rgba(226, 232, 240, 0.8);
    border-radius: 10px;
    font-size: 0.9rem;
    width: 280px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    font-family: inherit;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.search-clear {
    position: absolute;
    right: 12px;
    color: var(--gray);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(107, 114, 128, 0.1);
}

.search-clear:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    text-decoration: none;
}

/* Retry Button */
.btn-retry {
    padding: 10px 18px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-retry:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-retry:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Activity From Number Badge */
.activity-from-number {
    padding: 4px 12px;
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.15), rgba(37, 211, 102, 0.1));
    color: #128C7E;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Courier New', monospace;
}

.activity-from-number i {
    font-size: 0.85rem;
}

/* Responsive Activity Details */
@media (max-width: 768px) {
    .details-grid {
        grid-template-columns: 1fr;
    }

    .activity-meta {
        flex-wrap: wrap;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .search-input {
        width: 100%;
    }

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

    .compact-stats-row {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* ========================================
   CARDS DE MÉTRICAS ESPECIAIS - NOVO DESIGN
   ======================================== */

.metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border-left: 4px solid transparent;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.metric-card.purple {
    border-left-color: #6366f1;
    background: linear-gradient(135deg, white 0%, #f5f3ff 100%);
}

.metric-card.pink {
    border-left-color: #ec4899;
    background: linear-gradient(135deg, white 0%, #fdf2f8 100%);
}

.metric-card.amber {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, white 0%, #fffbeb 100%);
}

.metric-card.teal {
    border-left-color: #14b8a6;
    background: linear-gradient(135deg, white 0%, #f0fdfa 100%);
}

.metric-card-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.metric-info h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.metric-info h4 i {
    font-size: 0.75rem;
}

.metric-value {
    font-size: 2.25rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
    margin-bottom: 6px;
}

.metric-subtitle {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
}

.metric-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.75rem;
    opacity: 0.15;
}

.metric-card.purple .metric-icon {
    color: #6366f1;
}

.metric-card.pink .metric-icon {
    color: #ec4899;
}

.metric-card.amber .metric-icon {
    color: #f59e0b;
}

.metric-card.teal .metric-icon {
    color: #14b8a6;
}

/* Split Content Cards */
.split-cards-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.split-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.split-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(135deg, #fafbfc 0%, #f8fafc 100%);
}

.split-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.split-card-title i {
    color: #6366f1;
    font-size: 0.875rem;
}

.split-card-body {
    padding: 24px;
}

.stats-flex {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 16px;
}

.stat-block {
    text-align: center;
    flex: 1;
}

.stat-block-value {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
    margin-bottom: 6px;
}

.stat-block-value.purple { color: #6366f1; }
.stat-block-value.green { color: #10b981; }
.stat-block-value.red { color: #ef4444; }

.stat-block-label {
    font-size: 0.8125rem;
    color: #64748b;
    font-weight: 600;
}

/* Type Distribution List */
.type-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.type-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.type-item:hover {
    background: #f1f5f9;
    transform: translateX(4px);
}

.type-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.type-item-left i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.type-item-left i.fa-comment { color: #6366f1; }
.type-item-left i.fa-info-circle { color: #f59e0b; }

.type-item-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
}

.type-item-value {
    font-weight: 700;
    color: #6366f1;
    font-size: 0.9375rem;
}

/* Failed Destinations Table */
.failed-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.failed-table thead {
    background: linear-gradient(135deg, #fafbfc 0%, #f8fafc 100%);
    border-bottom: 2px solid #e2e8f0;
}

.failed-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 700;
    color: #64748b;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.failed-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s ease;
}

.failed-table tbody tr:hover {
    background: #f8fafc;
}

.failed-table td {
    padding: 14px 16px;
    color: #334155;
}

.failed-table .route-name {
    font-weight: 600;
    color: #0f172a;
}

.failed-table .domain-code {
    font-family: 'Courier New', monospace;
    font-size: 0.8125rem;
    color: #64748b;
}

.failures-badge {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
    padding: 6px 14px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.8125rem;
    display: inline-block;
}

.config-link {
    color: #6366f1;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8125rem;
    transition: all 0.2s ease;
}

.config-link:hover {
    color: #4f46e5;
    text-decoration: underline;
}

.config-link i {
    margin-right: 4px;
}

/* Empty State */
.no-data-state {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.no-data-state i {
    font-size: 2.5rem;
    opacity: 0.4;
    margin-bottom: 12px;
}

.no-data-state div {
    font-size: 0.9375rem;
    font-weight: 500;
    margin-top: 8px;
}

@media (max-width: 968px) {
    .metrics-row {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }

    .split-cards-row {
        grid-template-columns: 1fr;
    }
}
