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

body {
    background: #fff5f8;
    color: #2d2d2d;
    min-height: 100vh;
}

/* ── LOGIN ─────────────────────────────────── */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffe0ec, #fff0f5);
}
.login-box {
    width: 380px;
    background: #fff;
    padding: 44px 40px;
    border-radius: 20px;
    box-shadow: 0 8px 40px rgba(255,100,150,0.15);
    text-align: center;
}
.login-box .logo { font-size: 52px; margin-bottom: 8px; }
.login-box h2 { color: #e91e8c; font-size: 24px; margin-bottom: 6px; }
.login-box p  { color: #aaa; font-size: 13px; margin-bottom: 24px; }
.login-box input,
.login-box select {
    width: 100%;
    padding: 13px 16px;
    margin: 7px 0;
    background: #fff5f8;
    border: 1.5px solid #ffd6e7;
    border-radius: 10px;
    color: #333;
    font-size: 15px;
    outline: none;
    transition: border 0.2s;
}
.login-box input:focus,
.login-box select:focus { border-color: #e91e8c; }
.btn-login {
    width: 100%;
    padding: 14px;
    margin-top: 16px;
    background: linear-gradient(135deg, #e91e8c, #ff6eb4);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
    box-shadow: 0 4px 16px rgba(233,30,140,0.3);
}
.btn-login:hover { opacity: 0.88; }
.err-msg { color: #e91e8c; font-size: 13px; margin-bottom: 10px; }

/* ── LAYOUT ─────────────────────────────────── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ── SIDEBAR ─────────────────────────────────── */
.sidebar {
    width: 240px;
    min-height: 100vh;
    background: linear-gradient(180deg, #e91e8c, #ff6eb4);
    display: flex;
    flex-direction: column;
    padding: 0;
    position: fixed;
    top: 0; left: 0;
    z-index: 100;
    box-shadow: 4px 0 20px rgba(233,30,140,0.15);
}
.sidebar-logo {
    padding: 28px 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    text-align: center;
}
.sidebar-logo .icon { font-size: 36px; }
.sidebar-logo h2 {
    color: #fff;
    font-size: 16px;
    margin-top: 8px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.sidebar-logo p {
    color: rgba(255,255,255,0.75);
    font-size: 12px;
    margin-top: 3px;
}
.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 24px;
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    border-left: 3px solid transparent;
}
.nav-item:hover,
.nav-item.active {
    background: rgba(255,255,255,0.18);
    color: #fff;
    border-left-color: #fff;
}
.nav-item .nav-icon { font-size: 18px; width: 24px; text-align: center; }
.sidebar-bottom {
    padding: 20px 24px;
    border-top: 1px solid rgba(255,255,255,0.2);
}
.logout-btn {
    width: 100%;
    padding: 10px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}
.logout-btn:hover { background: rgba(255,255,255,0.3); }

/* ── MAIN CONTENT ──────────────────────────── */
.main-content {
    margin-left: 240px;
    flex: 1;
    padding: 24px;
    background: #fff5f8;
    min-height: 100vh;
}

/* ── TOPBAR ─────────────────────────────────── */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 16px 24px;
    border-radius: 14px;
    margin-bottom: 22px;
    box-shadow: 0 2px 12px rgba(233,30,140,0.08);
    border: 1px solid #ffe0ec;
}
.topbar h2 { color: #e91e8c; font-size: 20px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.child-select {
    padding: 8px 14px;
    border-radius: 8px;
    background: #fff5f8;
    color: #333;
    border: 1.5px solid #ffd6e7;
    font-size: 14px;
    outline: none;
}

/* ── GRID ────────────────────────────────────── */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

/* ── CARD ────────────────────────────────────── */
.card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #ffe0ec;
    box-shadow: 0 2px 14px rgba(233,30,140,0.06);
}
.card-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #e91e8c;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #00cc66;
    display: inline-block;
    animation: blink 1s infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.2} }

/* ── MAP ─────────────────────────────────────── */
#map { width:100%; height:280px; border-radius:12px; overflow:hidden; }
.loc-info {
    margin-top: 10px;
    background: #fff5f8;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #888;
    border: 1px solid #ffe0ec;
}

/* ── CAMERA PARENT ──────────────────────────── */
.camera-box {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #1a0a10;
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid #ffd6e7;
}
.camera-box img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.cam-overlay-top {
    position: absolute;
    top: 0; left: 0; right: 0;
    padding: 10px 14px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.65), transparent);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.live-badge {
    background: #e91e8c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.live-badge::before {
    content:'';
    width:7px; height:7px;
    background:#fff;
    border-radius:50%;
    animation: blink 1s infinite;
}
.cam-time { color:rgba(255,255,255,0.8); font-size:12px; }
.cam-overlay-bottom {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 10px 14px;
    background: linear-gradient(to top, rgba(0,0,0,0.65), transparent);
}
.cam-label { color:rgba(255,255,255,0.8); font-size:12px; }
.no-signal {
    width:100%; height:100%;
    display:flex; flex-direction:column;
    align-items:center; justify-content:center;
    color:#555; gap:10px;
}
.no-signal span { font-size:42px; }

/* ── CAMERA CHILD ───────────────────────────── */
.child-cam-box {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background: #000;
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid #ffd6e7;
}
.child-cam-box video {
    width:100%; height:100%;
    object-fit:cover; display:block;
}
.child-cam-controls {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    display: flex;
    justify-content: center;
    gap: 12px;
}
.cam-btn {
    padding: 8px 18px;
    border-radius: 24px;
    border: 1.5px solid rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
    display: flex; align-items: center; gap: 6px;
}
.cam-btn:hover { background: rgba(255,255,255,0.28); }
.cam-btn.active { background: rgba(233,30,140,0.5); border-color: #ff6eb4; }

/* ── VOICE ───────────────────────────────────── */
.voice-box {
    background: #fff5f8;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #ffe0ec;
}
.voice-visual {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}
.mic-icon { font-size: 32px; animation: mic-pulse 1.5s infinite; }
@keyframes mic-pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.15)} }
.audio-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 32px;
}
.audio-bars span {
    display: block;
    width: 4px;
    background: linear-gradient(to top, #e91e8c, #ff6eb4);
    border-radius: 2px;
    animation: bar 0.8s infinite ease-in-out;
}
.audio-bars span:nth-child(1){height:35%;animation-delay:0s}
.audio-bars span:nth-child(2){height:75%;animation-delay:0.1s}
.audio-bars span:nth-child(3){height:55%;animation-delay:0.2s}
.audio-bars span:nth-child(4){height:100%;animation-delay:0.3s}
.audio-bars span:nth-child(5){height:45%;animation-delay:0.4s}
.audio-bars span:nth-child(6){height:65%;animation-delay:0.15s}
@keyframes bar { 0%,100%{transform:scaleY(0.4)} 50%{transform:scaleY(1)} }
.voice-label { color:#888; font-size:13px; }
audio { width:100%; border-radius:8px; accent-color:#e91e8c; }

/* ── SOS BUTTON ─────────────────────────────── */
.sos-btn {
    width: 100%;
    padding: 22px;
    background: linear-gradient(135deg, #ff2d2d, #ff6600);
    border: none;
    border-radius: 50px;
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    animation: sos-pulse 1.5s infinite;
    margin-top: 8px;
}
@keyframes sos-pulse {
    0%,100%{box-shadow:0 0 0 0 rgba(255,45,45,0.5)}
    50%{box-shadow:0 0 0 22px rgba(255,45,45,0)}
}

/* ── SOS ALERTS ─────────────────────────────── */
.sos-alert-item {
    background: #fff5f8;
    border: 1.5px solid #ffb3c6;
    border-left: 4px solid #e91e8c;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #c0114e;
}
.sos-alert-item a { color: #e91e8c; font-weight: bold; }

/* ── STATS MINI ──────────────────────────────── */
.stat-box {
    background: linear-gradient(135deg, #ffe0ec, #fff5f8);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #ffd6e7;
    text-align: center;
}
.stat-box .stat-icon { font-size: 28px; margin-bottom: 6px; }
.stat-box .stat-val  { font-size: 20px; font-weight: 700; color: #e91e8c; }
.stat-box .stat-lbl  { font-size: 12px; color: #aaa; margin-top: 2px; }

/* ── CHILD PANEL ────────────────────────────── */
.child-panel { max-width: 460px; margin: 0 auto; padding: 20px 16px; }
.child-panel .card { margin-bottom: 16px; }
.info-text { color:#aaa; font-size:12px; margin-top:8px; text-align:center; }

@media(max-width:900px){
    .sidebar{ width:200px; }
    .main-content{ margin-left:200px; }
    .grid-2,.grid-3{ grid-template-columns:1fr; }
}
@media(max-width:620px){
    .sidebar{ display:none; }
    .main-content{ margin-left:0; }
    .login-box{ width:92%; }
}
