:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --bg: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --glass-border: rgba(255, 255, 255, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Outfit', sans-serif; }

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background:
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(239, 68, 68, 0.1) 0%, transparent 40%);
    z-index: -1;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
header {
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

/* The top menu wraps instead of running off narrower screens. */
header > div:last-child { min-width: 0; flex: 1; justify-content: flex-end; }
header nav { flex-wrap: wrap; justify-content: flex-end; }
header button { white-space: nowrap; }

/* Phones: menu goes full width under the logo, and tabs not used on the go are hidden. */
@media (max-width: 900px) {
    header { flex-wrap: wrap; padding: 1rem; gap: .75rem; }
    header > div:last-child { flex: 1 1 100%; flex-wrap: wrap; justify-content: flex-end; gap: .5rem !important; }
    header nav { order: 1; flex: 1 1 100%; justify-content: flex-start; }
    header nav a { white-space: nowrap; }
    header nav a[href="cashback.html"],
    header nav a[href="welcome-message.html"],
    header nav a[href="whatsapp.html"] { display: none; }
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
}

.full-width { grid-column: 1 / -1; }

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

/* ── Card ───────────────────────────────────────────────────────────────── */
.card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

/* ── Status badges ──────────────────────────────────────────────────────── */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.status-secure  { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.status-lost    { background: rgba(239, 68, 68, 0.2);  color: #f87171; animation: pulse 2s infinite; }
.status-finding { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.btn:hover    { background: rgba(255, 255, 255, 0.1); transform: translateY(-2px); }
.btn.primary  { background: var(--primary); border: none; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.danger   { color: var(--danger); }
.btn.danger:hover { background: rgba(239, 68, 68, 0.1); }
.btn.caution  { border-color: rgba(245, 158, 11, 0.4); color: var(--warning); }
.btn.caution:hover { background: rgba(245, 158, 11, 0.1); }
.btn.active {
    background: rgba(99, 102, 241, 0.2) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
    animation: pulse-border 2s infinite;
}
.btn.active.danger {
    background: var(--danger) !important;
    border-color: var(--danger) !important;
    color: white;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
    animation: none;
}

/* ── Controls grid ──────────────────────────────────────────────────────── */
.controls { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 2rem; }

/* ── Device info panel ──────────────────────────────────────────────────── */
.device-info  { display: flex; align-items: center; gap: 2rem; margin-bottom: 2rem; }
.device-icon  {
    width: 120px; height: 120px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 1rem;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(99, 102, 241, 0.2);
    flex-shrink: 0;
}

/* ── Map ────────────────────────────────────────────────────────────────── */
#map {
    width: 100%;
    height: 400px;
    background: #1e293b;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border: 1px dashed var(--glass-border);
    margin-top: 1rem;
    position: relative;
}

/* ── SOS banner ─────────────────────────────────────────────────────────── */
.active-sos {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    margin-bottom: 2rem;
    display: none;
}
.sos-header { display: flex; justify-content: space-between; color: var(--danger); font-weight: 700; }

/* ── Activity log ───────────────────────────────────────────────────────── */
.log-item { padding: 1rem; border-bottom: 1px solid var(--glass-border); font-size: 0.875rem; }
.log-item:last-child { border: none; }
.log-ts { color: var(--text-muted); font-size: 0.75rem; }

/* ── Form inputs ────────────────────────────────────────────────────────── */
.input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    width: 100%;
    outline: none;
}
.input:focus { border-color: var(--primary); }

/* ── Misc icons ─────────────────────────────────────────────────────────── */
.icon { width: 24px; height: 24px; fill: currentColor; }

/* ── Animations ─────────────────────────────────────────────────────────── */
@keyframes pulse       { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }
@keyframes pulse-border { 0%,100% { border-color: var(--primary); } 50% { border-color: #fff; } }
