@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800;900&display=swap');

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

:root {
    --bg-main: #050508; 
    --bg-card: rgba(255, 255, 255, 0.03);
    --text-main: #ffffff;
    --text-muted: #8e9299;
    --primary: #f6821f;
    --primary-hover: #e07212;
    --secondary: #0070f3;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --border-color: rgba(255, 255, 255, 0.1);
    --neon-glow: 0 0 15px rgba(246, 130, 31, 0.3);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.dashboard-container {
    display: grid;
    grid-template-columns: 240px 1fr;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    background: rgba(0,0,0,0.4);
    border-right: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.sidebar-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 2rem;
    text-align: left;
    color: var(--primary);
    text-transform: none;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: normal;
    color: var(--text-muted);
    transition: background 0.2s;
    border: 1px solid transparent;
}

.nav-item:hover, .nav-item.active {
    background-color: var(--bg-card);
    color: #fff;
    border: 1px solid var(--border-color);
    box-shadow: var(--neon-glow);
}

.main-content {
    background: var(--bg-main);
    padding: 32px;
    overflow-y: auto;
}

.view-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view-section.active {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

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

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    margin-bottom: 0;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 0px;
    font-weight: 800;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.stats-value {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: 'Courier New', Courier, monospace;
    color: var(--secondary);
    margin-top: 8px;
}

.card h3 {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
    font-weight: normal;
}

section > h2 {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 12px;
}

section#view-dashboard h2 {
    border: none;
    padding: 0;
}

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

th, td {
    padding: 16px 12px;
    text-align: left;
    border-bottom: 1px dashed var(--border-color);
    font-size: 0.85rem;
}

th {
    color: var(--text-muted);
    font-weight: normal;
    text-transform: uppercase;
    font-size: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.btn {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.btn-primary { 
    background-color: rgba(246, 130, 31, 0.1); 
    border-color: var(--primary); 
    color: var(--primary); 
}
.btn-primary:hover { 
    background-color: var(--primary);
    color: #fff;
    box-shadow: var(--neon-glow);
}
.btn-danger { 
    background-color: rgba(239, 68, 68, 0.1); 
    color: var(--danger); 
    border-color: rgba(239, 68, 68, 0.3); 
}
.btn-success { 
    background-color: rgba(16, 185, 129, 0.1); 
    color: var(--success); 
    border-color: rgba(16, 185, 129, 0.3); 
}

input, select {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 8px;
    margin-bottom: 1rem;
    outline: none;
    font-family: inherit;
    font-size: 0.85rem;
}

input:focus, select:focus {
    border-color: var(--primary);
    box-shadow: var(--neon-glow);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background-color: rgba(5,5,8,0.95);
    border: 1px solid var(--border-color);
    padding: 32px;
    border-radius: 16px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-gap { display: flex; gap: 0.5rem; align-items: center; }

#login-screen {
    position: fixed; inset: 0;
    background-color: var(--bg-main);
    display: flex; justify-content: center; align-items: center;
    z-index: 200;
}

.login-card {
    background-color: var(--bg-card);
    padding: 32px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    width: 400px;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}
.badge-active { background: rgba(0, 112, 243, 0.1); color: var(--secondary); border: 1px solid rgba(0, 112, 243, 0.2);}
.badge-paused { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2);}

#qr-canvas-container canvas, #qr-canvas-container img {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem auto;
    display: block;
    max-width: 100%;
}

