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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.hidden { display: none !important; }
.page { display: none; }
.page.active { display: block; }

/* Navbar */
.navbar {
    background: rgba(255,255,255,0.95);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo { font-size: 24px; font-weight: bold; color: #667eea; }

.nav-links a {
    margin-left: 20px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover { color: #667eea; }

/* Container */
.container { max-width: 1200px; margin: 30px auto; padding: 0 20px; }

/* Login Box */
.login-box {
    max-width: 400px;
    margin: 80px auto;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.3);
}

.login-box h2 { text-align: center; margin-bottom: 30px; color: #667eea; font-size: 28px; }

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

/* Buttons */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-success { background: #28a745; color: white; }
.btn-danger { background: #dc3545; color: white; }
.btn-warning { background: #ffc107; color: #333; }

.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.2); }

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.stat-number { font-size: 40px; font-weight: bold; color: #667eea; }
.stat-label { color: #666; margin-top: 8px; font-size: 14px; }

/* Cards */
.card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Device Card */
.device-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.device-card:hover { transform: translateY(-5px); }

.device-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 15px 20px;
    font-weight: bold;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.device-body { padding: 20px; }

.device-screen {
    width: 100%;
    height: 180px;
    background: #f0f0f0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    margin-bottom: 15px;
    border: 2px dashed #ddd;
    overflow: hidden;
}

.device-screen img { width: 100%; height: 100%; object-fit: cover; }

.device-info { margin-bottom: 15px; font-size: 14px; color: #555; }
.device-info p { margin-bottom: 5px; }

.status {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.status-available { background: #d4edda; color: #155724; }
.status-booked { background: #f8d7da; color: #721c24; }
.status-offline { background: #fff3cd; color: #856404; }

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 { color: #333; }

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
}

.close-btn:hover { color: #333; }

.modal-body { padding: 20px; }

.screen-container {
    position: relative;
    width: 100%;
    height: 350px;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.screen-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.screen-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    cursor: crosshair;
}

.control-panel {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.control-panel .btn { flex: 1; min-width: 80px; }

.type-area { margin-top: 10px; }

/* Responsive */
@media (max-width: 768px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .grid { grid-template-columns: 1fr; }
    .navbar { padding: 15px; }
    .nav-links a { margin-left: 10px; font-size: 14px; }
}