:root {
    --bg-dark: #09090b; --bg-panel: rgba(24, 24, 27, 0.85);
    --accent: #06b6d4; --accent-hover: #0891b2;
    --text-main: #f8fafc; --text-muted: #94a3b8; --danger: #ef4444;
}
body, html { margin: 0; padding: 0; height: 100%; font-family: 'Inter', sans-serif; background: var(--bg-dark); color: var(--text-main); overflow: hidden; }
.glass-panel { background: var(--bg-panel); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(255, 255, 255, 0.08); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7); }
.input-premium { width: 100%; padding: 12px; margin-bottom: 15px; background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.1); color: white; border-radius: 6px; box-sizing: border-box; outline: none; }
.input-premium:focus { border-color: var(--accent); }
.btn-premium { background: var(--accent); color: #000; font-weight: bold; border: none; padding: 12px 24px; border-radius: 6px; cursor: pointer; transition: all 0.3s; width: 100%; text-transform: uppercase; }
.btn-premium:hover { background: var(--accent-hover); box-shadow: 0 0 15px rgba(6, 182, 212, 0.5); }

header { position: absolute; top: 20px; left: 50px; z-index: 1000; padding: 10px 25px; border-radius: 12px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.logo { font-size: 20px; font-weight: 900; letter-spacing: 2px; }
.logo span { color: var(--accent); }
.nav-links a, .nav-links button { background: none; border:none; color: var(--text-muted); text-decoration: none; font-size: 14px; margin-left: 15px; cursor: pointer; }
.nav-links a:hover, .nav-links button:hover { color: var(--accent); }

#map { width: 100%; height: 100vh; z-index: 1; position: absolute; top:0; left:0; }
#sidebar { position: absolute; top: 0; right: -100%; width: 450px; height: 100vh; z-index: 2000; transition: right 0.4s ease; border-left: 1px solid rgba(255,255,255,0.1); overflow-y: auto; padding: 20px; box-sizing: border-box; }
#sidebar.active { right: 0; }
.close-btn { background: none; border: none; color: white; font-size: 28px; cursor: pointer; float: right; }
.close-btn:hover { color: var(--accent); }

.cam-card { background: #0f172a; border-radius: 10px; margin-bottom: 20px; overflow: hidden; border: 1px solid rgba(255,255,255,0.05); }
.cam-title { padding: 12px; font-size: 13px; font-weight: 600; background: #1e293b; display: flex; justify-content: space-between; align-items: center;}
.video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; }
.video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
.tag { font-size: 10px; background: var(--accent); color: #000; padding: 2px 6px; border-radius: 4px; }
.cine-btn { background: transparent; border: 1px solid var(--accent); color: var(--accent); border-radius: 4px; cursor: pointer; font-size: 11px; padding: 3px 8px;}

#cine-mode { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: #000; z-index: 9999; }
#cine-mode iframe { width: 100%; height: 100%; border: none; }
#close-cine { position: absolute; top: 20px; right: 20px; background: rgba(0,0,0,0.5); border: 1px solid var(--accent); color: white; padding: 10px 15px; cursor: pointer; border-radius: 8px; z-index: 10000; }

.leaflet-popup-content-wrapper { background: var(--bg-dark); color: white; border: 1px solid var(--accent); }
.leaflet-popup-tip { background: var(--bg-dark); border: 1px solid var(--accent); }

#custom-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 9999; justify-content: center; align-items: center; }
.modal-content { background: var(--bg-dark); padding: 30px; border-radius: 12px; border: 1px solid var(--danger); text-align: center; }
.modal-btns { display: flex; gap: 10px; margin-top: 20px; }
.btn-danger { background: var(--danger); color: white; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; }
.btn-cancel { background: #333; color: white; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; }

/* Subida Archivo Premium */
.file-upload-wrapper { position: relative; overflow: hidden; display: inline-block; width: 100%; margin-bottom: 15px;}
.file-upload-wrapper input[type=file] { font-size: 100px; position: absolute; left: 0; top: 0; opacity: 0; cursor: pointer; }
.file-upload-btn { background: transparent; border: 2px dashed var(--accent); color: var(--accent); padding: 15px; text-align: center; border-radius: 6px; display: block; font-weight: bold; transition: 0.3s;}
.file-upload-wrapper:hover .file-upload-btn { background: rgba(6, 182, 212, 0.1); }

@media (max-width: 768px) {
    header { top: 10px; left: 10px; right: 10px; justify-content: center; }
    #sidebar { width: 100%; right: -100%; }
    .admin-grid { grid-template-columns: 1fr; }
}