:root {
    --bg-dark: #0a0e17;
    --bg-card: #12182a;
    --bg-table: #0d1220;
    --accent: #00aaff;
    --accent-dim: #0088cc;
    --text-primary: #ffffff;
    --text-secondary: #a0b4c8;
    --border: #1e2a3d;
    --success: #00cc66;
    --error: #ff4466;
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Exo 2', sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.header {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-dark) 100%);
    padding: 2rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.header h1 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, var(--accent), #66ddff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    margin: 0 0 1rem 0;
    font-size: 1rem;
}

.status-bar {
    display: flex;
    justify-content: center;
    align-items: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: pulse 2s infinite;
}

.status-indicator.connected .status-dot {
    background: var(--success);
}

.status-indicator.offline .status-dot {
    background: var(--error);
}

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

.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

.search-section {
    margin-bottom: 1.5rem;
}

.search-bar {
    display: flex;
    gap: 0.75rem;
    max-width: 500px;
    margin: 0 auto 1rem;
}

.search-bar input {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: var(--font-body);
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

.search-bar input:focus {
    border-color: var(--accent);
}

.search-bar input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.search-bar button {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-family: var(--font-body);
    font-weight: 600;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: var(--bg-dark);
    cursor: pointer;
    transition: background 0.2s;
}

.search-bar button:hover {
    background: var(--accent-dim);
}

.search-bar button:active {
    transform: scale(0.98);
}

.error-banner {
    padding: 0.75rem 1rem;
    background: rgba(255, 68, 102, 0.15);
    border: 1px solid var(--error);
    border-radius: 8px;
    color: var(--error);
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.error-banner.hidden {
    display: none;
}

.map-section {
    margin-bottom: 2rem;
}

.map-container {
    width: 100%;
    min-height: 500px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.leaflet-container {
    background: var(--bg-dark) !important;
    font-family: var(--font-body);
}

.pass-list-section,
.dashboard-section {
    margin-bottom: 2rem;
}

.pass-list-section h2,
.dashboard-section h2 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 1rem auto;
}

.spinner.hidden {
    display: none !important;
}

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

.table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-table);
}

.pass-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.pass-table th,
.pass-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.pass-table th {
    background: var(--bg-card);
    color: var(--accent);
    font-weight: 600;
}

.pass-table tbody tr:hover {
    background: rgba(0, 170, 255, 0.08);
}

.pass-table .empty-row td {
    color: var(--text-secondary);
    text-align: center;
    padding: 2rem;
}

.pass-list-section.fade-in .table-wrapper {
    animation: fadeIn 0.4s ease-out;
}

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

.charts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    min-height: 280px;
}

.chart-container h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--text-secondary);
}

.footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer a {
    color: var(--accent);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

@media (max-width: 900px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .header h1 {
        font-size: 1.4rem;
    }

    .search-bar {
        flex-direction: column;
    }

    .pass-table th,
    .pass-table td {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
}
