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

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #1e1e2e;
    min-height: 100vh;
    padding: 30px;
    color: #e4e4e7;
}

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

header {
    background: transparent;
    padding: 0 0 30px 0;
    margin-bottom: 30px;
}

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

h1 {
    color: #ffffff;
    font-size: 2.2em;
    font-weight: 600;
    letter-spacing: -0.5px;
    margin: 0;
}

.nav-tabs {
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-tab {
    padding: 10px 20px;
    text-decoration: none;
    color: #9a9a9a;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 0.95em;
}

.nav-tab:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.nav-tab.active {
    color: #ffffff;
    background: linear-gradient(135deg, #1d8cf8 0%, #3358f4 100%);
    box-shadow: 0 2px 10px rgba(29, 140, 248, 0.3);
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #27293d 0%, #1e1e2e 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1d8cf8 0%, #3358f4 100%);
}

.stat-card:nth-child(2)::before {
    background: linear-gradient(90deg, #00bf8f 0%, #00d6b4 100%);
}

.stat-card:nth-child(3)::before {
    background: linear-gradient(90deg, #fd5d93 0%, #ec250d 100%);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.stat-card h3 {
    font-size: 0.85em;
    opacity: 0.7;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 400;
    color: #9a9a9a;
}

.stat-card .value {
    font-size: 2.8em;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
}

.scans-container {
    background: linear-gradient(135deg, #27293d 0%, #1e1e2e 100%);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.scans-header {
    background: rgba(255, 255, 255, 0.02);
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scans-header h2 {
    color: #ffffff;
    font-size: 1.4em;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
    color: #00d6b4;
    font-weight: 500;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #00d6b4;
    box-shadow: 0 0 10px #00d6b4;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.6;
        transform: scale(0.95);
    }
}

.scans-list {
    max-height: 600px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #3358f4 rgba(255, 255, 255, 0.05);
}

.scans-list::-webkit-scrollbar {
    width: 8px;
}

.scans-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.scans-list::-webkit-scrollbar-thumb {
    background: #3358f4;
    border-radius: 4px;
}

.scans-list::-webkit-scrollbar-thumb:hover {
    background: #1d8cf8;
}

.scan-item {
    padding: 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: grid;
    grid-template-columns: 180px 1fr 150px 150px;
    gap: 20px;
    align-items: center;
    transition: all 0.3s ease;
    animation: slideIn 0.4s ease-out;
    background: transparent;
}

@keyframes slideIn {
    from {
        transform: translateX(-30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.scan-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid #1d8cf8;
    padding-left: 27px;
}

.scan-item.new {
    background: rgba(0, 214, 180, 0.08);
    border-left: 3px solid #00d6b4;
    padding-left: 27px;
}

.scan-time {
    color: #9a9a9a;
    font-size: 0.85em;
    line-height: 1.6;
}

.scan-time div:first-child {
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 2px;
}

.scan-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.scan-details .pass-id {
    font-weight: 600;
    color: #ffffff;
    font-size: 1.05em;
    letter-spacing: 0.3px;
}

.scan-details .reader {
    color: #9a9a9a;
    font-size: 0.9em;
}

.scan-details .device-id {
    color: #b0b0b0;
    font-size: 0.85em;
    font-family: 'Courier New', monospace;
    margin-top: 4px;
}

.scan-details .event-id {
    color: #b0b0b0;
    font-size: 0.8em;
    font-family: 'Courier New', monospace;
    margin-top: 2px;
}

.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    background: linear-gradient(135deg, #1d8cf8 0%, #3358f4 100%);
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 10px rgba(29, 140, 248, 0.3);
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #525f7f;
}

.empty-state svg {
    width: 100px;
    height: 100px;
    margin-bottom: 25px;
    opacity: 0.2;
    color: #525f7f;
}

.empty-state p {
    font-size: 1.1em;
    color: #9a9a9a;
}

/* Heartbeat-specific styles */
.heartbeat-item {
    grid-template-columns: 180px 1fr 200px;
}

.heartbeat-stats {
    display: flex;
    gap: 8px;
    align-items: center;
    color: #9a9a9a;
    font-size: 0.85em;
    margin-top: 6px;
    flex-wrap: wrap;
}

.heartbeat-meta {
    color: #6a6a6a;
    font-size: 0.8em;
    margin-top: 4px;
}

.outage-info {
    margin-top: 8px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    background: rgba(253, 93, 147, 0.15);
    color: #fd5d93;
    border-left: 3px solid #fd5d93;
}

.outage-info.active {
    background: rgba(253, 93, 147, 0.2);
    animation: pulse 2s infinite;
}

.unsent-info {
    margin-top: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    border-left: 3px solid #ffc107;
}

.badge-online {
    background: linear-gradient(135deg, #00bf8f 0%, #00d6b4 100%);
    box-shadow: 0 2px 10px rgba(0, 214, 180, 0.3);
}

.badge-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    box-shadow: 0 2px 10px rgba(255, 193, 7, 0.3);
}

.badge-error {
    background: linear-gradient(135deg, #fd5d93 0%, #ec250d 100%);
    box-shadow: 0 2px 10px rgba(253, 93, 147, 0.3);
}

@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .header-top {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav-tabs {
        width: 100%;
        justify-content: stretch;
    }
    
    .nav-tab {
        flex: 1;
        text-align: center;
    }
    
    .scan-item {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .heartbeat-item {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 1.6em;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
}
