/* ==========================================================
   KidShield - حماية طفلك | Design System & Stylesheet
   Modern, Responsive, RTL-First, Dark & Light Mode
   ========================================================== */

:root {
    --font-main: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Dark Theme Palette (Default) */
    --bg-base: #0b0f19;
    --bg-surface: #111827;
    --bg-card: #1f2937;
    --bg-card-hover: #283548;
    --border-color: rgba(255, 255, 255, 0.09);
    --border-highlight: rgba(99, 102, 241, 0.3);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Semantic Accent Colors */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.25);

    --success: #10b981;
    --success-hover: #059669;
    --success-bg: rgba(16, 185, 129, 0.15);

    --danger: #f43f5e;
    --danger-hover: #e11d48;
    --danger-bg: rgba(244, 63, 94, 0.15);
    --danger-glow: rgba(244, 63, 94, 0.4);

    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);

    --info: #0ea5e9;
    --info-bg: rgba(14, 165, 233, 0.15);

    /* Radii & Shadows */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--primary-glow);

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-base: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-highlight: rgba(99, 102, 241, 0.2);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* ================= Base & Reset ================= */
html {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    min-width: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    direction: rtl;
    position: relative;
}

html[dir="ltr"], html[dir="ltr"] body, [dir="ltr"], [dir="ltr"] body, body.ltr {
    direction: ltr !important;
    text-align: left;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html[dir="ltr"] .modal-header,
html[dir="ltr"] .card-header,
html[dir="ltr"] .card-title,
html[dir="ltr"] .form-group,
html[dir="ltr"] .sub-header,
html[dir="ltr"] .shield-desc,
html[dir="ltr"] .quick-details,
html[dir="ltr"] .stream-overlay-meta,
html[dir="ltr"] .settings-group {
    text-align: left !important;
}

html[dir="ltr"] .mirror-controls-bar .auto-capture-badge {
    margin-right: 0 !important;
    margin-left: auto !important;
}

html[dir="ltr"] #viewAudioGalleryBtn {
    margin-right: 0 !important;
    margin-left: auto !important;
}

button, input, select, textarea {
    font-family: inherit;
    box-sizing: border-box;
}

/* ================= SOS Urgent Banner ================= */
.sos-banner {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(90deg, #b91c1c 0%, #dc2626 50%, #b91c1c 100%);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.6);
    animation: pulseRedBanner 1.5s infinite;
}

@keyframes pulseRedBanner {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.92; }
}

.sos-banner-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

.sos-icon-pulse {
    font-size: 1.8rem;
    animation: shake 0.6s infinite alternate;
}

@keyframes shake {
    from { transform: rotate(-8deg) scale(1); }
    to { transform: rotate(8deg) scale(1.15); }
}

.sos-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.sos-title {
    font-size: 1.15rem;
    font-weight: 800;
}

.sos-desc {
    font-size: 0.9rem;
    opacity: 0.95;
}

.sos-actions {
    display: flex;
    gap: 10px;
}

/* ================= Main Navigation Header ================= */
.app-header {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 900;
    backdrop-filter: blur(12px);
}

.header-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #ffffff;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.brand-text h1 {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge-pro {
    font-size: 0.7rem;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #fff;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 700;
    text-transform: uppercase;
}

.tagline {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* Child Quick Status Header */
.child-live-status {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.avatar-wrapper {
    position: relative;
    width: 36px;
    height: 36px;
}

.child-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.online-indicator {
    position: absolute;
    bottom: -1px;
    left: -1px;
    width: 12px;
    height: 12px;
    background-color: var(--success);
    border-radius: 50%;
    border: 2px solid var(--bg-card);
    box-shadow: 0 0 6px var(--success);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.online-status-badge {
    transition: all 0.3s ease;
    white-space: nowrap;
}

@keyframes statusPulse {
    0% { transform: scale(0.92); opacity: 0.85; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(0.92); opacity: 0.85; }
}

.status-dot {
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.child-meta {
    display: flex;
    flex-direction: column;
}

.name-zone {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
}

.zone-badge {
    font-size: 0.7rem;
    padding: 1px 7px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.zone-badge.in-zone {
    background: var(--success-bg);
    color: var(--success);
}

.zone-badge.out-zone {
    background: var(--danger-bg);
    color: var(--danger);
}

.telemetry {
    display: flex;
    gap: 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* View Switcher Tabs */
.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.view-switch-tabs {
    display: flex;
    background: var(--bg-card);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.tab-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.utility-btns {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.icon-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

/* ================= Buttons & Form UI ================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    width: fit-content;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 0.76rem;
}

.btn-xs {
    padding: 2px 6px;
    font-size: 0.7rem;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}

.btn-danger:hover {
    background: var(--danger-hover);
    box-shadow: 0 4px 14px var(--danger-glow);
}

.btn-warning {
    background: var(--warning);
    color: #111827;
}

.btn-secondary {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-surface);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    transition: var(--transition);
}

.btn-outline-danger:hover {
    background: var(--danger);
    color: #ffffff;
    box-shadow: 0 2px 10px var(--danger-glow);
}

.btn-info {
    background: var(--info);
    color: #ffffff;
    transition: var(--transition);
}

.btn-info:hover {
    background: #0284c7;
    box-shadow: 0 4px 14px var(--info-bg);
}

/* Toggle Switches */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #374151;
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--success);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* ================= View Panel Management ================= */
.main-content {
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px;
}

.view-panel {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.view-panel.active-panel {
    display: block;
}

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

/* ================= Quick Action Top Bar ================= */
.quick-action-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.quick-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.quick-card:hover {
    border-color: var(--border-highlight);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.quick-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.lock-card .quick-icon { background: var(--danger-bg); color: var(--danger); }
.ring-card .quick-icon { background: var(--info-bg); color: var(--info); }
.screentime-quick .quick-icon { background: var(--warning-bg); color: var(--warning); }
.mode-quick .quick-icon { background: var(--success-bg); color: var(--success); }
.stealth-quick .quick-icon { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.stealth-quick.is-hidden-active { border-color: rgba(139, 92, 246, 0.4); background: rgba(139, 92, 246, 0.05); }

.quick-details {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-status {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.card-status.highlight {
    color: var(--warning);
    font-weight: 700;
}

/* ================= Dashboard Grid Layout ================= */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 24px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

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

.dashboard-col {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

/* Reusable Cards */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.card-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
}

.card-title h3 {
    font-size: 1.05rem;
    font-weight: 700;
}

.card-body {
    padding: 20px;
}

.card-body.p-0 {
    padding: 0;
}

/* ================= Map & Geofencing ================= */
.leaflet-map-wrapper {
    height: 380px;
    width: 100%;
    z-index: 10;
}

/* Custom Google Maps Layer Switcher Styling */
.leaflet-control-layers {
    background: rgba(15, 23, 42, 0.94) !important;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(51, 65, 85, 0.8) !important;
    border-radius: 10px !important;
    color: #f8fafc !important;
    font-family: 'Cairo', system-ui, sans-serif !important;
    font-size: 11.5px !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5) !important;
    padding: 6px 10px !important;
}

.leaflet-control-layers-expanded {
    padding: 8px 12px !important;
}

.leaflet-control-layers label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
    cursor: pointer;
    color: #e2e8f0;
}

.leaflet-control-layers label:hover {
    color: #38bdf8;
}

.leaflet-control-layers input[type="radio"] {
    accent-color: #10b981;
    cursor: pointer;
}

.map-info-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.82rem;
    flex-wrap: wrap;
    gap: 10px;
}

.muted-label {
    color: var(--text-muted);
    margin-left: 5px;
}

.safe-zones-section {
    padding: 18px 20px;
}

.sub-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.sub-header h4 {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.zones-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.zone-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.84rem;
    font-weight: 600;
}

.zone-tag.active-zone {
    border-color: var(--success);
    background: var(--success-bg);
    color: var(--success);
}

.zone-tag .remove-zone-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0 3px;
}

.zone-tag .remove-zone-btn:hover {
    color: var(--danger);
}

/* Child Marker Pulsing Style */
.child-map-pulse-marker {
    position: relative;
    width: 44px;
    height: 44px;
}

.child-map-pulse-marker .pulse-ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.4);
    animation: pulseGeofence 2s infinite ease-out;
}

@keyframes pulseGeofence {
    0% { transform: scale(0.8); opacity: 0.9; }
    100% { transform: scale(1.6); opacity: 0; }
}

.child-map-pulse-marker img {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid #10b981;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

/* ================= Screen Time Card ================= */
.progress-bar-container {
    margin-bottom: 20px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.progress-track {
    height: 10px;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}

.progress-fill.warning-fill {
    background: linear-gradient(90deg, #10b981, #f59e0b);
}

.schedule-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 640px) {
    .schedule-settings-grid {
        grid-template-columns: 1fr;
    }
}

.schedule-box {
    display: flex;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 14px;
    border-radius: var(--radius-md);
}

.box-icon {
    font-size: 1.3rem;
    color: var(--primary);
}

.box-text {
    flex: 1;
}

.box-text label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.slider-val-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slider-val-group input[type="range"] {
    flex: 1;
}

.time-picker-row {
    display: flex;
    gap: 10px;
    font-size: 0.8rem;
}

.time-input {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 3px 6px;
    border-radius: 4px;
}

/* ================= App Blocker Section ================= */
.apps-list-toolbar {
    padding: 12px 18px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-input {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary);
}

.apps-category-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.cat-pill {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.cat-pill.active, .cat-pill:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.apps-items-container {
    max-height: 280px;
    overflow-y: auto;
}

.app-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.app-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.app-row-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-row-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
}

.app-row-title strong {
    display: block;
    font-size: 0.88rem;
}

.app-row-title small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.app-status-badge {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.app-status-badge.blocked {
    background: var(--danger-bg);
    color: var(--danger);
}

.app-status-badge.allowed {
    background: var(--success-bg);
    color: var(--success);
}

/* ================= Web Shield Section ================= */
.shield-toggles {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 18px;
}

.shield-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.shield-item:last-child {
    border-bottom: none;
}

.shield-desc strong {
    display: block;
    font-size: 0.88rem;
    margin-bottom: 2px;
}

.shield-desc small {
    color: var(--text-secondary);
    font-size: 0.76rem;
}

.custom-block-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.domain-input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.custom-blocked-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.domain-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--danger-bg);
    color: var(--danger);
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
}

.domain-tag button {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 0.78rem;
}

/* ================= Activity Timeline ================= */
.activity-timeline {
    list-style: none;
    max-height: 240px;
    overflow-y: auto;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-color);
}

.timeline-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.timeline-icon.danger { background: var(--danger-bg); color: var(--danger); }
.timeline-icon.warning { background: var(--warning-bg); color: var(--warning); }
.timeline-icon.success { background: var(--success-bg); color: var(--success); }
.timeline-icon.info { background: var(--info-bg); color: var(--info); }

.timeline-content {
    flex: 1;
}

.timeline-msg {
    font-size: 0.82rem;
    color: var(--text-primary);
}

.timeline-time {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ======================================================== */
/* PHONE SIMULATOR (Child Device View)                     */
/* ======================================================== */
.phone-simulator-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

.phone-frame {
    width: 380px;
    height: 760px;
    background: #0f172a;
    border: 12px solid #1e293b;
    border-radius: 46px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.phone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 24px;
    background: #1e293b;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 100;
}

.phone-speaker {
    width: 48px;
    height: 4px;
    background: #475569;
    border-radius: 4px;
}

.phone-camera {
    width: 8px;
    height: 8px;
    background: #334155;
    border-radius: 50%;
}

.phone-screen {
    flex: 1;
    background: linear-gradient(180deg, #1e1b4b 0%, #0f172a 100%);
    display: flex;
    flex-direction: column;
    padding: 30px 18px 18px;
    overflow-y: auto;
    position: relative;
    user-select: none;
}

.phone-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 700;
    color: #cbd5e1;
    margin-bottom: 14px;
}

.status-icons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.child-hero-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    margin-bottom: 16px;
}

.child-badge-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #818cf8;
    object-fit: cover;
}

.child-hero-text h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
}

.child-hero-text p {
    font-size: 0.75rem;
    color: #cbd5e1;
}

.remaining-time-pill {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fbbf24;
    padding: 4px 14px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Child SOS Emergency Button */
.sos-trigger-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.sos-big-btn {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    border: 4px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(220, 38, 38, 0.6);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    outline: none;
}

.sos-big-btn:active {
    transform: scale(0.92);
}

.sos-big-btn i {
    font-size: 2rem;
    margin-bottom: 2px;
}

.sos-big-btn span {
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.5px;
}

.sos-big-btn small {
    font-size: 0.65rem;
    opacity: 0.9;
}

.sos-waves {
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    border: 2px solid rgba(239, 68, 68, 0.6);
    animation: wavePulse 1.8s infinite;
}

@keyframes wavePulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.35); opacity: 0; }
}

/* Child Apps Grid */
.kid-apps-section {
    margin-bottom: 16px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 10px;
    font-weight: 700;
}

.kid-apps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.kid-app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s;
}

.kid-app-item:hover {
    transform: scale(1.05);
}

.kid-app-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.kid-app-item.is-blocked .kid-app-icon {
    filter: grayscale(0.8);
    opacity: 0.6;
}

.lock-badge-on-app {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #0f172a;
}

.kid-app-item span {
    font-size: 0.72rem;
    color: #cbd5e1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* Child Safe Browser Demo */
.kid-browser-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 12px;
}

.browser-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: #38bdf8;
    margin-bottom: 8px;
    font-weight: 700;
}

.browser-input-row {
    display: flex;
    gap: 6px;
}

.browser-input-row input {
    flex: 1;
    background: #0f172a;
    border: 1px solid #334155;
    color: #fff;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
}

.browser-result-msg {
    margin-top: 8px;
    padding: 8px;
    border-radius: 6px;
    font-size: 0.74rem;
}

.browser-result-msg.blocked {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.browser-result-msg.allowed {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
}

/* Phone Screen Lock Overlay */
.phone-lock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(16px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px 20px;
}

.lock-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.lock-big-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    border: 2px solid rgba(239, 68, 68, 0.4);
}

.lock-overlay-content h2 {
    font-size: 1.3rem;
    color: #ffffff;
}

.lock-overlay-content p {
    font-size: 0.85rem;
    color: #94a3b8;
}

.lock-meta-badge {
    background: rgba(255, 255, 255, 0.08);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    color: #e2e8f0;
}

.phone-home-indicator {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 4px;
    background: #475569;
    border-radius: 4px;
}

/* ======================================================== */
/* DUAL INTERACTIVE SIMULATOR (Side by Side)               */
/* ======================================================== */
.dual-notice-banner {
    background: linear-gradient(90deg, #312e81, #1e1b4b);
    border: 1px solid #4338ca;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #c7d2fe;
}

.dual-split-container {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 24px;
    align-items: start;
}

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

.dual-pane {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.pane-title {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

/* ================= Modals ================= */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(env(safe-area-inset-top, 16px) + 12px) 16px calc(env(safe-area-inset-bottom, 16px) + 16px) 16px;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

.modal-backdrop:not([style*="display: none"]):not([style*="display:none"]) {
    pointer-events: auto !important;
}

/* Strict guarantee that any hidden overlay never intercepts touch or clicks */
[style*="display: none"],
[style*="display:none"],
.modal-backdrop[style*="display: none"],
.modal-backdrop[style*="display:none"],
#parentRegisterModal[style*="display: none"],
#parentRegisterModal[style*="display:none"],
#adminPinLockModal[style*="display: none"],
#adminPinLockModal[style*="display:none"] {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

button, .btn, .mobile-nav-item, .pin-key-btn, [role="button"], a {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

button > *, .btn > *, .mobile-nav-item > *, .pin-key-btn > * {
    pointer-events: none;
}

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: zoomModal 0.25s ease-out;
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 44px);
    max-height: calc(100vh - 44px);
    margin: auto;
    box-sizing: border-box;
}

@keyframes zoomModal {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.modal-body {
    padding: 20px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    max-height: calc(100dvh - 140px);
    max-height: calc(100vh - 140px);
    box-sizing: border-box;
}

.modal-body img,
.modal-body video {
    max-height: min(45vh, 320px);
    object-fit: contain;
}

.modal-footer {
    padding: 14px 20px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.form-input, .form-select, .form-range {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.form-hint {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.blocked-app-icon-large {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: var(--danger-bg);
    color: var(--danger);
    font-size: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* ==========================================================
   Live Screen Mirroring & Screenshot Gallery Styles
   ========================================================== */
.live-pill-badge {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: var(--success);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 6px;
}

.blink-dot {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    animation: blinkAnim 1.2s infinite;
}

@keyframes blinkAnim {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.85); }
}

.screen-mirror-wrapper {
    background: #090d16;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    height: 240px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.screen-mirror-stream {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.stream-overlay-meta {
    position: absolute;
    bottom: 10px;
    left: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
}

.stream-active-app {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pulse-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 6px #38bdf8;
}

.stream-fps {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    color: #94a3b8;
    font-family: monospace;
}

.mirror-controls-bar {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    flex-wrap: wrap;
}

/* In-Screen App Content Simulation Views */
.sim-screen-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* YouTube Simulator View */
.yt-simulator-box {
    background: #0f0f0f;
    color: #ffffff;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
}

.yt-top-bar {
    padding: 8px 12px;
    background: #181818;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
}

.yt-back-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
}

.yt-video-player-frame {
    height: 120px;
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.yt-video-player-frame i.fa-play {
    font-size: 2.2rem;
    color: rgba(255, 255, 255, 0.8);
}

.yt-video-timeline {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
}

.yt-video-timeline-fill {
    width: 65%;
    height: 100%;
    background: #ef4444;
}

.yt-video-details {
    padding: 10px 12px;
    flex: 1;
}

.yt-video-details h4 {
    font-size: 0.84rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: #f8fafc;
}

.yt-video-details small {
    font-size: 0.72rem;
    color: #94a3b8;
}

/* Chat Simulator View */
.chat-simulator-box {
    background: #0b141a;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
}

.chat-sim-header {
    background: #202c33;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #e9edef;
}

.chat-sim-messages {
    flex: 1;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.chat-sim-bubble {
    max-width: 80%;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    line-height: 1.4;
}

.chat-sim-bubble.received {
    background: #202c33;
    color: #e9edef;
    align-self: flex-start;
}

.chat-sim-bubble.sent {
    background: #005c4b;
    color: #e9edef;
    align-self: flex-end;
}

/* Screenshots Gallery Modal */
.modal-card.modal-wide {
    max-width: 720px;
}

.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    max-height: 420px;
    overflow-y: auto;
    padding: 4px;
}

.screenshot-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.screenshot-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.screenshot-thumb-wrapper {
    height: 130px;
    background: #090d16;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.screenshot-thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.screenshot-meta {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.screenshot-app-tag {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
}

.screenshot-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.screenshot-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 6px;
}

/* ==========================================================
   Device Hardware Serial & Independent Apps Styling
   ========================================================== */
.child-app-body {
    background-color: #0b0f19;
    min-height: 100vh;
    padding-bottom: 30px;
}

.child-phone-header {
    background: #111827;
    border-bottom: 1px solid var(--border-color);
    padding: 14px 20px;
    position: sticky;
    top: 0;
    z-index: 900;
}

.child-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.phone-time {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
}

.phone-status-badges {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pairing-badge {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: var(--warning);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 6px;
}

.battery-tag {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.device-id-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed var(--border-highlight);
    border-radius: var(--radius-md);
    padding: 12px 16px;
}

.device-id-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.device-id-label {
    font-size: 0.82rem;
    color: #94a3b8;
    font-weight: 700;
}

.serial-display-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.serial-code-text {
    font-family: monospace;
    font-size: 1.05rem;
    font-weight: 900;
    color: #38bdf8;
    background: #0f172a;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #334155;
    letter-spacing: 1px;
}

.serial-notice {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.child-screen-wrapper {
    max-width: 520px;
    margin: 20px auto;
    padding: 0 16px;
}

.child-view-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ================= Child Ringing Alert Banner ================= */
.child-ringing-alert {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: 9999;
    background: linear-gradient(135deg, #b91c1c, #ef4444);
    color: #ffffff;
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    box-shadow: 0 10px 30px rgba(220, 38, 38, 0.5);
    animation: ringBannerPulse 1.2s infinite alternate;
}

@keyframes ringBannerPulse {
    0% { transform: scale(0.98); box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4); }
    100% { transform: scale(1.02); box-shadow: 0 12px 35px rgba(220, 38, 38, 0.7); }
}

.ringing-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.ringing-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ringing-text strong {
    font-size: 0.95rem;
}

.ringing-text small {
    font-size: 0.8rem;
    opacity: 0.9;
}

/* ================= Study Mode Badge ================= */
.study-mode-badge {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #818cf8;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.battery-tag.is-charging {
    color: #f59e0b;
}

.battery-tag.is-charging i {
    animation: chargingPulse 1.5s infinite;
}

@keyframes chargingPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.15); }
}

.screenshot-preview-full {
    width: 100%;
    max-height: min(48vh, 340px);
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* ==========================================================
   Comprehensive Mobile Phone Optimization (iOS / Android)
   RTL, Safe Area, Touch Targets & Ultra-Responsive Layouts
   ========================================================== */

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    touch-action: manipulation;
}

/* Safe Area Inset Support */
@supports (padding-top: env(safe-area-inset-top)) {
    .app-header, .child-phone-header {
        padding-top: max(10px, env(safe-area-inset-top));
        padding-left: max(14px, env(safe-area-inset-left));
        padding-right: max(14px, env(safe-area-inset-right));
    }
}

/* Bottom Navigation Bar & Tab Views */
.mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    z-index: 1500;
    align-items: center;
    justify-content: space-around;
    padding-bottom: max(4px, env(safe-area-inset-bottom));
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.45);
}

.mobile-nav-item {
    background: transparent;
    border: none;
    outline: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: inherit;
    flex: 1;
    height: 100%;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    padding: 6px 0;
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item i {
    font-size: 1.25rem;
    transition: transform 0.2s ease, color 0.2s ease;
}

.mobile-nav-item.active {
    color: #38bdf8 !important;
}

.mobile-nav-item.active i {
    transform: translateY(-2px) scale(1.1);
    color: #38bdf8 !important;
    filter: drop-shadow(0 2px 8px rgba(56, 189, 248, 0.5));
}

.mobile-nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 24px;
    height: 3px;
    border-radius: 2px;
    background: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
}

.parent-screen-view {
    display: none !important;
    width: 100%;
    animation: fadeInParentView 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.parent-screen-view.active {
    display: block !important;
}

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

.main-content {
    padding-bottom: 95px !important;
}

.parent-view-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

/* Tablets and Mobile Phones (< 768px) */
@media (max-width: 768px) {
/* ================= Modern Header Styling (Honor 200 Pro & Mobile Optimized) ================= */
.app-header {
    background: rgba(15, 23, 42, 0.92);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 950;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.header-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.header-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
}

.brand-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.trial-pill {
    background: rgba(245, 158, 11, 0.16);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #f59e0b;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.header-actions-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 6px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.header-icon-action {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-icon-action:hover, .header-icon-action:active {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    transform: scale(0.96);
}

.header-icon-action.highlight-scan {
    background: rgba(6, 182, 212, 0.18);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.header-icon-action.highlight-link {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}

.child-live-status {
    width: 100%;
    background: rgba(30, 41, 59, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
}

.child-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.child-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.child-name-row strong {
    font-size: 0.95rem;
    font-weight: 800;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.child-serial-subrow {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 1px 0;
}

.child-serial-badge {
    font-family: monospace;
    font-size: 0.72rem;
    font-weight: 700;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    padding: 1px 6px;
    border-radius: 6px;
    border: 1px solid rgba(56, 189, 248, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.5px;
}

.child-status-controls-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.header-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.04);
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.header-ping-btn, .header-unlink-btn {
    padding: 2px 7px !important;
    font-size: 0.68rem !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    cursor: pointer;
}

.avatar-wrapper {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s;
}

.avatar-wrapper:active {
    transform: scale(0.92);
}

.last-seen-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.25);
}

    /* Quick Action Cards in 2x2 Grid - Guaranteed zero horizontal overflow */
    .quick-action-bar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
        gap: 8px;
        margin-bottom: 14px;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    .quick-card {
        padding: 8px;
        flex-direction: column;
        align-items: stretch;
        justify-content: space-between;
        min-height: 110px;
        border-radius: 12px;
        gap: 6px;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow: hidden;
        box-sizing: border-box;
    }

    .quick-icon {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
        border-radius: 8px;
    }

    .quick-details {
        min-width: 0 !important;
        width: 100%;
        overflow: hidden;
    }

    .card-label {
        font-size: 0.72rem;
        line-height: 1.25;
        white-space: normal;
        word-break: break-word;
    }

    .card-status {
        font-size: 0.65rem;
        white-space: normal;
        word-break: break-word;
    }

    .quick-card .btn {
        width: 100%;
        padding: 5px 4px;
        font-size: 0.65rem;
        line-height: 1.2;
        justify-content: center;
        border-radius: 8px;
        white-space: normal;
        text-align: center;
        word-break: break-word;
    }

    /* Main Container - Zero Overflow */
    .main-content {
        padding: 10px 8px;
        padding-bottom: 84px; /* space for bottom nav bar */
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    .dashboard-grid {
        grid-template-columns: 100% !important;
        gap: 12px;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
    }

    .dashboard-col {
        gap: 12px;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
    }

    /* Cards */
    .card {
        border-radius: 12px;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow: hidden;
        box-sizing: border-box;
    }

    .card-header {
        padding: 10px 12px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap !important;
        gap: 6px;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    .card-title {
        min-width: 0 !important;
        max-width: 100%;
        flex: 1 1 auto;
    }

    .card-title h3 {
        font-size: 0.88rem;
        white-space: normal;
        word-break: break-word;
    }

    .header-badges-group {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        align-items: center;
    }

    /* Map responsive */
    #parentMap, .leaflet-map-wrapper {
        height: 250px;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    .map-actions {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 4px;
    }

    .map-actions .btn {
        flex: 1;
        justify-content: center;
        padding: 5px 4px;
        font-size: 0.68rem;
        white-space: normal;
        text-align: center;
    }

    .map-info-strip {
        flex-direction: column;
        gap: 4px;
        padding: 8px 12px;
        width: 100%;
        box-sizing: border-box;
    }

    .strip-item strong {
        font-size: 0.82rem;
        word-break: break-word;
    }

    /* Screen mirror responsive */
    .screen-mirror-wrapper {
        height: 220px;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
    }

    .screen-mirror-stream {
        width: 100%;
        height: 100%;
        max-width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        overflow: hidden;
    }

    .screen-mirror-stream img {
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
        object-fit: contain;
        margin: auto;
    }

    .stream-overlay-meta {
        bottom: 6px;
        left: 8px;
        right: 8px;
        max-width: calc(100% - 16px);
        box-sizing: border-box;
    }

    .stream-active-app {
        font-size: 0.68rem;
        padding: 3px 8px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mirror-controls-bar {
        padding: 8px 10px;
        display: flex;
        flex-wrap: wrap !important;
        gap: 8px;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    .mirror-controls-bar .btn {
        flex: 1 1 calc(50% - 6px);
        min-width: 0;
        justify-content: center;
        font-size: 0.68rem;
        padding: 6px 4px;
        white-space: normal;
        text-align: center;
        line-height: 1.25;
    }

    /* App blocker responsive */
    .apps-toolbar {
        padding: 8px 10px;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        align-items: center;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    .search-input-wrapper {
        min-width: 0;
        flex: 1 1 180px;
    }

    .app-row {
        padding: 10px 12px;
        min-height: 50px;
        width: 100%;
        box-sizing: border-box;
    }

    .app-row-title strong {
        font-size: 0.84rem;
        word-break: break-word;
    }

    .app-row-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
        flex-shrink: 0;
    }

    /* Safe Zones */
    .safe-zones-section {
        padding: 12px;
        width: 100%;
        box-sizing: border-box;
    }

    .sub-header {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: space-between;
        align-items: center;
    }

    /* Mobile Bottom Navigation Bar */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: rgba(17, 24, 39, 0.95);
        backdrop-filter: blur(16px);
        border-top: 1px solid var(--border-color);
        z-index: 1500;
        align-items: center;
        justify-content: space-around;
        padding-bottom: max(0px, env(safe-area-inset-bottom));
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.35);
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: #94a3b8;
        text-decoration: none;
        font-size: 0.7rem;
        font-weight: 700;
        flex: 1;
        height: 100%;
        transition: color 0.2s, transform 0.15s;
    }

    .mobile-nav-item i {
        font-size: 1.15rem;
    }

    .mobile-nav-item.active, .mobile-nav-item:active {
        color: #38bdf8;
        transform: translateY(-1px);
    }

    /* Modals on Mobile Phones */
    .modal-backdrop {
        padding: calc(env(safe-area-inset-top, 16px) + 8px) 12px calc(env(safe-area-inset-bottom, 16px) + 14px) 12px;
        align-items: center; /* Centered & parallel on screen, no bottom overflow */
        justify-content: center;
    }

    .modal-card {
        border-radius: 18px; /* Balanced rounded corners on all sides */
        max-height: calc(100dvh - 36px);
        max-height: calc(100vh - 36px);
        width: 100%;
        max-width: calc(100% - 12px);
        margin: auto;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .modal-header {
        padding: 14px 16px;
        flex-shrink: 0;
    }

    .modal-body {
        padding: 14px 16px;
        flex: 1 1 auto;
        min-height: 0;
        max-height: calc(100dvh - 125px);
        max-height: calc(100vh - 125px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .modal-footer {
        padding: 12px 16px;
        flex-shrink: 0;
    }

    .screenshots-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .screenshot-thumb-wrapper {
        height: 110px;
    }
}

/* Small Smart Phones (< 480px) */
@media (max-width: 480px) {
    .modal-card {
        border-radius: 16px;
        max-height: calc(100dvh - 28px);
        max-height: calc(100vh - 28px);
        max-width: calc(100% - 8px);
    }

    .modal-body {
        padding: 12px 14px;
        max-height: calc(100dvh - 110px);
        max-height: calc(100vh - 110px);
    }

    /* Child Companion App */
    .child-screen-wrapper {
        margin: 6px auto;
        padding: 0 10px;
        max-width: 100%;
    }

    .child-phone-header {
        padding: 10px 12px;
    }

    .child-header-top {
        margin-bottom: 8px;
        flex-wrap: wrap;
        gap: 6px;
    }

    .phone-time {
        font-size: 0.95rem;
    }

    .phone-status-badges {
        gap: 6px;
        flex-wrap: wrap;
    }

    .device-id-card {
        padding: 10px 12px;
    }

    .device-id-meta {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .serial-display-row {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
    }

    .serial-code-text {
        font-size: 0.86rem;
        padding: 5px 6px;
        flex: 1;
        text-align: center;
        letter-spacing: 0.5px;
    }

    .serial-display-row .btn {
        padding: 5px 8px;
        font-size: 0.72rem;
    }

    .child-hero-card {
        padding: 14px;
        gap: 8px;
    }

    .child-badge-avatar img {
        width: 60px;
        height: 60px;
    }

    .child-hero-text h2 {
        font-size: 1.15rem;
    }

    .child-hero-text p {
        font-size: 0.8rem;
    }

    .remaining-time-pill {
        font-size: 0.8rem;
        padding: 6px 14px;
    }

    .sos-big-btn {
        height: 82px;
        border-radius: 16px;
    }

    .sos-big-btn i {
        font-size: 1.7rem;
    }

    .sos-big-btn span {
        font-size: 1.2rem;
    }

    .kid-apps-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .kid-app-icon {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
        border-radius: 12px;
    }

    .kid-app-item span {
        font-size: 0.68rem;
    }

    .kid-browser-box {
        padding: 12px;
    }

    .browser-input-row {
        display: flex;
        gap: 6px;
    }

    .browser-input-row input {
        flex: 1;
        font-size: 0.8rem;
    }

    .child-ringing-alert {
        top: 10px;
        left: 10px;
        right: 10px;
        padding: 12px;
        gap: 10px;
    }

    .ringing-icon-box {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    .ringing-text strong {
        font-size: 0.85rem;
    }

    .ringing-text small {
        font-size: 0.72rem;
    }
}

/* ================= QR Code & Barcode Camera Scanner Modal ================= */
.scanner-card {
    max-width: 440px !important;
    width: 95% !important;
    border-radius: var(--radius-lg);
}

.scanner-viewport {
    position: relative;
    width: 100%;
    height: 330px;
    background: #000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#qrScannerVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scanner-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.4);
}

.scanner-frame {
    position: relative;
    width: 220px;
    height: 220px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.48);
    border-radius: 12px;
}

.scanner-corner {
    position: absolute;
    width: 26px;
    height: 26px;
    border-color: #6366f1;
    border-style: solid;
}

.scanner-corner.top-left {
    top: -2px;
    left: -2px;
    border-width: 4px 0 0 4px;
    border-top-left-radius: 8px;
}

.scanner-corner.top-right {
    top: -2px;
    right: -2px;
    border-width: 4px 4px 0 0;
    border-top-right-radius: 8px;
}

.scanner-corner.bottom-left {
    bottom: -2px;
    left: -2px;
    border-width: 0 0 4px 4px;
    border-bottom-left-radius: 8px;
}

.scanner-corner.bottom-right {
    bottom: -2px;
    right: -2px;
    border-width: 0 4px 4px 0;
    border-bottom-right-radius: 8px;
}

.scanner-laser {
    position: absolute;
    left: 4px;
    right: 4px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #f43f5e, #ec4899, transparent);
    box-shadow: 0 0 12px #f43f5e;
    animation: scanLaser 2s ease-in-out infinite alternate;
}

@keyframes scanLaser {
    0% {
        top: 8px;
        opacity: 0.8;
    }
    100% {
        top: calc(100% - 10px);
        opacity: 1;
    }
}

/* ===================================================
   Screen-on-Screen (PiP & Floating Screen Overlay)
=================================================== */

/* 1. Android Native System PiP Mode */
body.pip-mode-active {
    overflow: hidden !important;
    background: #000 !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.pip-mode-active header,
body.pip-mode-active .quick-action-bar,
body.pip-mode-active .dashboard-col.map-column,
body.pip-mode-active .apps-card,
body.pip-mode-active .web-shield-card,
body.pip-mode-active .timeline-card,
body.pip-mode-active .mobile-bottom-nav,
body.pip-mode-active .modal-backdrop,
body.pip-mode-active .mirror-controls-bar,
body.pip-mode-active .camera-snapshot-bar,
body.pip-mode-active .stream-overlay-meta,
body.pip-mode-active .card-header,
body.pip-mode-active .floating-screen-overlay {
    display: none !important;
}

body.pip-mode-active .dashboard-grid,
body.pip-mode-active .dashboard-col.controls-column,
body.pip-mode-active #parentMirrorCard,
body.pip-mode-active #parentMirrorCard .card-body,
body.pip-mode-active .screen-mirror-wrapper,
body.pip-mode-active #parentMirrorStream {
    display: block !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: #000 !important;
}

body.pip-mode-active #parentMirrorStream img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    border-radius: 0 !important;
}

/* 2. In-App Floating Screen-on-Screen Widget */
.floating-screen-overlay {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 220px;
    height: 380px;
    background: #0b0f19;
    border: 2px solid var(--primary);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.75), 0 0 16px rgba(59, 130, 246, 0.45);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    user-select: none;
    touch-action: none;
    transition: box-shadow 0.2s ease;
}

.floating-screen-overlay:hover {
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.85), 0 0 24px rgba(59, 130, 246, 0.65);
}

.floating-screen-header {
    background: #111827;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.floating-screen-title {
    font-size: 0.74rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.floating-screen-actions {
    display: flex;
    gap: 6px;
}

.floating-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #cbd5e1;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.floating-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.floating-btn.close:hover {
    background: #ef4444;
    color: #fff;
}

.floating-screen-content {
    flex: 1;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.floating-screen-content img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.floating-screen-footer {
    background: #111827;
    padding: 6px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.68rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.floating-fps-badge {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.65rem;
}

/* ==========================================
   Usage Reports & Screen Analytics
   ========================================== */
.reports-card {
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-top: 14px;
}

.reports-filter-group {
    display: inline-flex;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2px;
    gap: 2px;
}

.filter-pill {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-pill:hover {
    color: var(--text-primary);
}

.filter-pill.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.35);
}

.reports-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

@media (min-width: 768px) {
    .reports-kpi-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.kpi-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.kpi-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.kpi-value {
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 2px;
}

.stacked-bar-container {
    height: 14px;
    width: 100%;
    background: var(--bg-surface);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.stacked-segment {
    height: 100%;
    transition: width 0.4s ease;
}

.segment-social, .dot-social { background: #8b5cf6; }
.segment-games, .dot-games { background: #10b981; }
.segment-entertainment, .dot-entertainment { background: #ef4444; }
.segment-education, .dot-education { background: #3b82f6; }
.segment-tools, .dot-tools { background: #f59e0b; }

.category-legend-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 10px;
}

.legend-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.74rem;
    color: var(--text-muted);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.usage-apps-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.usage-app-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.usage-app-row:hover {
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(59, 130, 246, 0.03);
}

.usage-app-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.usage-app-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.usage-app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.usage-app-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.usage-app-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.usage-app-name {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.usage-app-cat-badge {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-muted);
}

.usage-app-bar-wrap {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.usage-app-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.usage-app-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.usage-app-time {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-primary);
}

.usage-app-pct {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ================= Ambient Audio Recording Styles ================= */
.ambient-audio-bar {
    transition: all 0.25s ease;
}

.ambient-audio-bar:hover {
    border-color: rgba(16, 185, 129, 0.5) !important;
    background: rgba(16, 185, 129, 0.08) !important;
}

.audio-recording-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    transition: all 0.2s ease;
}

.audio-recording-card:hover {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

.audio-recording-card audio {
    filter: invert(0.1) hue-rotate(90deg);
}

/* ================= Safety Shields: Photos, Calls & SMS ================= */
.photo-strip-thumb {
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.photo-strip-thumb:hover {
    transform: scale(1.05);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.photo-safety-card-item {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.photo-safety-card-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.call-preview-item {
    transition: background 0.15s ease, border-color 0.15s ease;
}

.call-preview-item:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(59, 130, 246, 0.3);
}

.call-row-item {
    transition: all 0.2s ease;
}

.call-row-item:hover {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.blocked-number-row {
    transition: all 0.2s ease;
}

.blocked-number-row:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.4);
}

.sms-preview-item {
    transition: background 0.15s ease, border-color 0.15s ease;
}

.sms-preview-item:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(245, 158, 11, 0.3);
}

.sms-safety-card-item {
    transition: all 0.2s ease;
}

.sms-safety-card-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ================= Permissions Audit Shield Styles ================= */
.perms-audit-card {
    transition: all 0.2s ease;
}

.perm-mini-chip {
    transition: all 0.2s ease;
}

.perm-mini-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.perm-mini-chip.missing {
    animation: permPulseBorder 2s infinite ease-in-out;
}

@keyframes permPulseBorder {
    0%, 100% {
        border-color: rgba(239, 68, 68, 0.35);
    }
    50% {
        border-color: rgba(239, 68, 68, 0.85);
        box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
    }
}

.perm-detail-row {
    transition: all 0.2s ease;
}

.perm-detail-row:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.perm-detail-row.is-missing {
    border-color: rgba(239, 68, 68, 0.5) !important;
}

.perm-icon-bubble {
    transition: transform 0.2s ease;
}

.perm-detail-row:hover .perm-icon-bubble {
    transform: scale(1.08);
}

/* App Time Limit Badge & Preset Buttons */
.set-app-limit-btn {
    transition: all 0.2s ease;
    border-radius: 6px;
    font-weight: 600;
}

.set-app-limit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.25);
}

.limit-preset-btn {
    padding: 8px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.limit-preset-btn:hover {
    transform: translateY(-1px);
}

.app-tab-filter-btn {
    cursor: pointer;
    transition: all 0.2s ease;
}

.app-tab-filter-btn.active {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
}

/* App Details & Settings Buttons */
.view-app-details-btn {
    transition: all 0.2s ease;
    border-radius: 6px;
    font-weight: 600;
}

.view-app-details-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.25);
}

/* Screenshot Quick Delete Button & Hover Overlay */
.screenshot-card {
    position: relative;
}

.screenshot-quick-delete-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-size: 0.72rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    opacity: 0.85;
    transition: all 0.2s ease;
    z-index: 10;
}

.screenshot-quick-delete-btn:hover {
    opacity: 1;
    transform: scale(1.15);
    background: #dc2626;
}

/* Photo Safety Card Action Buttons */
.photo-safety-action-btn {
    padding: 3px 6px;
    font-size: 0.68rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.photo-safety-action-btn:hover {
    transform: translateY(-1px);
}

/* ==========================================================
   Multi-Child Device Switcher Bar Styles
   ========================================================== */
.children-tab-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #111827;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    overflow-x: auto;
    white-space: nowrap;
    position: relative;
    z-index: 95;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.children-tab-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    flex-shrink: 0;
}

.children-tab-scroll {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
}

.children-tab-scroll::-webkit-scrollbar {
    display: none;
}

.child-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 14px;
    background: #1f2937;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f8fafc;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    flex-shrink: 0;
}
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    flex-shrink: 0;
}

.child-chip:hover {
    background: #283548;
    border-color: #6366f1;
    transform: translateY(-1px);
}

.child-chip.active {
    background: rgba(99, 102, 241, 0.25);
    border-color: #6366f1;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.child-chip-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #94a3b8;
    flex-shrink: 0;
    transition: background 0.3s;
}

.child-chip-dot.online {
    background: #10b981;
    box-shadow: 0 0 7px #10b981;
}

.child-chip-batt {
    font-size: 0.73rem;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-right: 2px;
}







/* ==========================================
   Universal Responsive Layout (Phones & Tablets)
   ========================================== */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

.child-chip-unlink-btn:hover {
    background: rgba(239, 68, 68, 0.45) !important;
    color: #ffffff !important;
    transform: scale(1.08);
}

@media (max-width: 768px) {
    .main-container, .container, .dashboard-grid {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
        box-sizing: border-box !important;
    }
    .dashboard-grid, .controls-grid, .safety-shields-grid, .gallery-grid {
        grid-template-columns: 1fr !important;
    }
    .modal-card, .scanner-card {
        width: 95% !important;
        max-width: 95vw !important;
        max-height: 92vh !important;
        overflow-y: auto !important;
    }
    .scanner-viewport video {
        max-height: 55vh !important;
        width: 100% !important;
        object-fit: cover !important;
    }
}

@media (min-width: 769px) and (max-width: 1180px) {
    .main-container, .container {
        max-width: 96% !important;
        margin: 0 auto !important;
    }
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 14px !important;
    }
    .safety-shields-grid, .controls-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    .modal-card, .scanner-card {
        max-width: 640px !important;
        width: 88% !important;
    }
}

@media (min-width: 1181px) {
    .main-container, .container {
        max-width: 1360px !important;
        margin: 0 auto !important;
    }
}
