/* ==========================================================================
   FEATURES SHOWCASE (PROFESSIONAL PARENTAL SUITE)
   ========================================================================== */

.kg-features-page-wrapper {
  position: relative;
  min-height: 100vh;
  padding-bottom: 5rem;
}

/* 1. Features Top Hero */
.kg-features-top-hero {
  padding: 4.5rem 1.5rem 2.5rem 1.5rem;
  text-align: center;
  position: relative;
}

.kg-features-hero-box {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.kg-features-main-heading {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: #f8fafc;
  margin: 1.15rem 0 0.85rem 0;
}

[data-theme="light"] .kg-features-main-heading {
  color: #0f172a;
}

.kg-features-lead-text {
  font-size: 1.05rem;
  line-height: 1.6;
  color: #94a3b8;
  max-width: 780px;
  margin: 0 auto;
}

[data-theme="light"] .kg-features-lead-text {
  color: #475569;
}

.kg-features-trust-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}

.kg-trust-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: #f8fafc;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .kg-trust-chip {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* 2. Main Active Feature Showcase Spotlight */
.kg-feature-spotlight-section {
  max-width: 1240px;
  margin: 2rem auto 0 auto;
  padding: 0 1.5rem;
}

.kg-spotlight-card {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 2.5rem;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .kg-spotlight-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

@media (max-width: 980px) {
  .kg-spotlight-card {
    grid-template-columns: 1fr;
    padding: 1.75rem;
    gap: 2rem;
  }
}

.kg-spotlight-left {
  display: flex;
  flex-direction: column;
}

.kg-spotlight-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.kg-spotlight-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #0d131f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 7px;
  border-radius: 9999px;
}

[data-theme="light"] .kg-spotlight-stepper {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.kg-stepper-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 50%;
  transition: all 0.15s ease;
}

.kg-stepper-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #00a8e8;
}

[data-theme="light"] .kg-stepper-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

.kg-stepper-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: #cbd5e1;
  padding: 0 4px;
}

[data-theme="light"] .kg-stepper-label {
  color: #334155;
}

.kg-spotlight-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.kg-spotlight-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-primary, #4f46e5);
  background: rgba(79, 70, 229, 0.08);
  border: 1px solid rgba(79, 70, 229, 0.25);
  padding: 3px 10px;
  border-radius: 9999px;
}

.kg-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary, #4f46e5);
  box-shadow: 0 0 6px var(--color-primary, #4f46e5);
}

.kg-spotlight-title-row {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.kg-spotlight-icon-circle {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  border: 1px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kg-spotlight-heading {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
  color: #f8fafc;
  margin-bottom: 0.4rem;
}

[data-theme="light"] .kg-spotlight-heading {
  color: #0f172a;
}

.kg-spotlight-subheading {
  font-size: 0.95rem;
  line-height: 1.55;
  color: #94a3b8;
}

[data-theme="light"] .kg-spotlight-subheading {
  color: #475569;
}

/* Quick Specs 4-Pill Grid */
.kg-spotlight-specs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.75rem;
}

@media (max-width: 640px) {
  .kg-spotlight-specs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.kg-spec-item {
  background: #0d131f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

[data-theme="light"] .kg-spec-item {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.kg-spec-k {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.04em;
}

.kg-spec-v {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: #cbd5e1;
}

[data-theme="light"] .kg-spec-v {
  color: #1e293b;
}

/* Benefits Checklist */
.kg-spotlight-benefits-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 2rem;
}

.kg-benefits-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #e2e8f0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

[data-theme="light"] .kg-benefits-title {
  color: #334155;
}

.kg-benefit-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #cbd5e1;
}

[data-theme="light"] .kg-benefit-row {
  color: #334155;
}

/* Spotlight Action Buttons */
.kg-spotlight-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .kg-spotlight-actions {
  border-top-color: #f1f5f9;
}

.kg-btn-spotlight-demo {
  padding: 0.8rem 1.45rem;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--radius-card);
  background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
  border: none;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.kg-btn-spotlight-demo:hover {
  background: linear-gradient(135deg, #4338ca 0%, #1d4ed8 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
}

.kg-btn-spotlight-install {
  padding: 0.8rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
}

[data-theme="light"] .kg-btn-spotlight-install {
  border-color: #cbd5e1;
  color: #334155;
}

.kg-btn-spotlight-install:hover {
  border-color: #94a3b8;
  color: #ffffff;
}

[data-theme="light"] .kg-btn-spotlight-install:hover {
  color: #0f172a;
}

/* ==========================================================================
   AUTHENTIC FLAGSHIP SMARTPHONE CHASSIS & SIMULATION
   ========================================================================== */

.kg-spotlight-right {
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1200px;
}

.kg-phone-mockup-wrapper {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 10px 14px;
}

/* Physical Hardware Side Buttons */
.kg-phone-side-btn {
  position: absolute;
  background: #252e3d;
  box-shadow: inset 0 0 1px rgba(255, 255, 255, 0.2);
  z-index: 1;
}

.kg-side-btn-vol-up {
  left: 10px;
  top: 110px;
  width: 4px;
  height: 44px;
  border-radius: 4px 0 0 4px;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.kg-side-btn-vol-down {
  left: 10px;
  top: 164px;
  width: 4px;
  height: 44px;
  border-radius: 4px 0 0 4px;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.kg-side-btn-power {
  right: 10px;
  top: 130px;
  width: 4px;
  height: 58px;
  border-radius: 0 4px 4px 0;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
}

/* Smartphone Chassis */
.kg-phone-chassis {
  position: relative;
  width: 324px;
  min-height: 640px;
  background: #111722;
  border-radius: 48px;
  border: 11px solid #1c2433;
  box-shadow: 
    0 0 0 2px #2d384c,
    0 0 0 4px #0b0f17,
    0 25px 60px -10px rgba(0, 0, 0, 0.7),
    0 0 25px rgba(0, 168, 232, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 2;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="light"] .kg-phone-chassis {
  background: #141b27;
  border-color: #1e2738;
  box-shadow: 
    0 0 0 2px #64748b,
    0 0 0 4px #cbd5e1,
    0 25px 65px -10px rgba(15, 23, 42, 0.35),
    0 0 20px rgba(0, 168, 232, 0.15);
}

/* Top Ear-Piece Speaker on outer bezel */
.kg-phone-speaker {
  width: 56px;
  height: 4.5px;
  background: #080c14;
  border-radius: 999px;
  margin: 6px auto 5px auto;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.9);
  flex-shrink: 0;
}

/* OLED Screen Glass */
.kg-phone-screen {
  flex: 1;
  background: #060911;
  border-radius: 38px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Status Bar */
.kg-phone-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.15rem 0.35rem 1.15rem;
  background: #060911;
  position: relative;
  z-index: 10;
  user-select: none;
}

.kg-phone-time {
  font-size: 0.78rem;
  font-weight: 700;
  color: #f8fafc !important;
  letter-spacing: -0.02em;
}

.kg-phone-punch-hole {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #000000;
  border: 1.5px solid #1e293b;
  box-shadow: inset 0 0 3px rgba(2, 132, 199, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kg-lens-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.75);
}

.kg-phone-status-icons {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.kg-phone-battery-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.kg-battery-pct {
  font-size: 0.68rem;
  font-weight: 700;
  color: #cbd5e1 !important;
}

/* Phone Screen Body */
.kg-phone-screen-body {
  flex: 1;
  padding: 0.75rem 0.85rem;
  background: #080d1a;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

/* Bottom Android Gesture Navigation Bar */
.kg-phone-gesture-bar {
  padding: 0.5rem 0 0.65rem 0;
  background: #080d1a;
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
}

.kg-phone-gesture-pill {
  width: 110px;
  height: 4.5px;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 9999px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* SMS Mobile View */
.kg-sim-sms-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
}

.kg-sim-contact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f1728;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  margin-bottom: 0.75rem;
}

.kg-sim-contact-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.kg-sim-avatar-wrap {
  position: relative;
}

.kg-sim-avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: #00a8e8;
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 168, 232, 0.4);
}

.kg-avatar-online {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  border: 1.5px solid #0f1728;
}

.kg-sim-contact-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: #ffffff !important;
  line-height: 1.2;
}

.kg-sim-contact-sub {
  font-size: 0.7rem;
  color: #38bdf8 !important;
  font-weight: 500;
}

.kg-sim-contact-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.kg-sim-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
}

.kg-sim-action-btn:hover {
  background: rgba(0, 168, 232, 0.25);
  color: #38bdf8;
}

/* Chat Bubbles */
.kg-sim-chat-bubbles {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
}

.kg-bubble {
  max-width: 85%;
  padding: 0.6rem 0.8rem;
  border-radius: 14px;
  font-size: 0.8rem;
  line-height: 1.35;
  position: relative;
}

.kg-bubble.me {
  align-self: flex-end;
  background: #00a8e8;
  color: #ffffff !important;
  border-bottom-right-radius: 2px;
  box-shadow: 0 3px 10px rgba(0, 168, 232, 0.3);
}

.kg-bubble.them {
  align-self: flex-start;
  background: #192336;
  color: #f1f5f9 !important;
  border-bottom-left-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.kg-bubble-text {
  margin: 0;
  color: inherit !important;
}

.kg-bubble-time {
  font-size: 0.6rem;
  opacity: 0.75;
  display: block;
  text-align: right;
  margin-top: 0.2rem;
  color: inherit !important;
}

/* Simulated Message Input Bar */
.kg-sim-chat-input-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f1626;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  padding: 0.4rem 0.5rem 0.4rem 0.85rem;
  margin-bottom: 0.6rem;
}

.kg-sim-input-text {
  font-size: 0.72rem;
  color: #64748b !important;
}

.kg-sim-send-arrow {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #00a8e8;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* In-Screen App Title Bar */
.kg-sim-app-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f1728;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.75rem;
}

.kg-sim-app-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: #f8fafc !important;
  letter-spacing: 0.04em;
}

.kg-sim-app-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Footer Sync Confirmation Note */
.kg-sim-footer-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.45rem 0.65rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 8px;
  color: #34d399 !important;
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
}

/* High Contrast Item Rows for Calls, Social, Keys, Web, Apps, Files */
.kg-sim-call-list,
.kg-sim-social-list,
.kg-sim-key-list,
.kg-sim-web-list,
.kg-sim-files-list,
.kg-sim-app-bars {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.kg-sim-call-row,
.kg-sim-social-row,
.kg-sim-key-row,
.kg-sim-web-row,
.kg-sim-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f1728 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
}

.kg-sim-caller-name,
.kg-sim-social-name,
.kg-sim-place-name,
.kg-sim-photo-name,
.kg-sim-remote-title,
.kg-sim-app-name,
.kg-sim-file-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffffff !important;
}

.kg-sim-caller-sub,
.kg-sim-social-status,
.kg-sim-photo-sub,
.kg-sim-web-sub,
.kg-sim-app-dur,
.kg-sim-file-sub {
  font-size: 0.68rem;
  color: #94a3b8 !important;
}

.kg-sim-caller-dur {
  font-size: 0.7rem;
  color: #94a3b8 !important;
  margin-top: 0.15rem;
}

.kg-call-pill {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.kg-call-pill.incoming {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
}

.kg-call-pill.missed {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
}

.kg-call-pill.outgoing {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
}

/* Location Simulation */
.kg-sim-map-mock {
  width: 100%;
  height: 180px;
  background: #0a0f1d;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0.65rem;
}

.kg-sim-map-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 22px 22px;
}

.kg-sim-map-pin {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kg-sim-pin-pulse {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.3);
  animation: pulse 2s infinite;
}

.kg-sim-safe-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 5;
  background: rgba(16, 185, 129, 0.9);
  color: #ffffff !important;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
}

.kg-sim-accuracy-pill {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 5;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #38bdf8 !important;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.kg-sim-location-details {
  background: #0f1728;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  margin-bottom: 0.65rem;
}

.kg-sim-place-status {
  font-size: 0.72rem;
  color: #34d399 !important;
  font-weight: 500;
  margin-top: 0.15rem;
}

.kg-sim-place-coords {
  font-size: 0.66rem;
  color: #94a3b8 !important;
  margin-top: 0.25rem;
}

/* Photos Simulation */
.kg-sim-photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.kg-sim-photo-card {
  background: #0f1728;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.kg-sim-photo-thumb {
  aspect-ratio: 1 / 1;
  background: #192336;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Social Simulation */
.kg-sim-badge-blue {
  background: rgba(2, 132, 199, 0.25);
  color: #38bdf8 !important;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Keystrokes Simulation */
.kg-sim-key-app {
  font-size: 0.72rem;
  font-weight: 700;
  color: #38bdf8 !important;
}

.kg-sim-key-time {
  font-size: 0.66rem;
  color: #94a3b8 !important;
}

.kg-sim-key-quote {
  font-size: 0.72rem;
  color: #f8fafc !important;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  word-break: break-word;
}

/* Web Simulation */
.kg-sim-web-url {
  font-size: 0.72rem;
  color: #ffffff !important;
}

.kg-web-pill {
  font-size: 0.66rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.kg-web-pill.allowed {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
}

.kg-web-pill.blocked {
  background: rgba(239, 68, 68, 0.22);
  color: #f87171;
}

/* Remote Simulation */
.kg-sim-remote-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  margin-bottom: 0.75rem;
}

.kg-sim-rec-status {
  font-size: 0.7rem;
  font-weight: 700;
  color: #f87171 !important;
}

.kg-sim-rec-lat {
  font-size: 0.66rem;
  color: #94a3b8 !important;
}

.kg-rec-beacon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  animation: pulse 1.5s infinite;
}

.kg-sim-remote-screen-mock {
  height: 180px;
  background: #0f1728;
  border: 1px dashed rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.85rem;
  margin-bottom: 0.65rem;
}

.kg-sim-remote-note {
  font-size: 0.7rem;
  color: #94a3b8 !important;
  margin-top: 0.25rem;
  max-width: 200px;
}

/* Apps Simulation */
.kg-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 0.2rem;
}

.kg-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #06b6d4, #3b82f6);
  border-radius: 9999px;
}

/* Files Simulation */
.kg-file-pill {
  font-size: 0.66rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.kg-file-pill.normal {
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
}

.kg-file-pill.alert {
  background: rgba(245, 158, 11, 0.22);
  color: #fbbf24;
}

/* 4. Complete 10-Module Bento Grid Explorer */
.kg-all-features-bento-section {
  max-width: 1240px;
  margin: 5rem auto 0 auto;
  padding: 0 1.5rem;
}

.kg-bento-header-box {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 3rem auto;
}

.kg-bento-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: #f8fafc;
  margin-top: 0.65rem;
  margin-bottom: 0.5rem;
}

[data-theme="light"] .kg-bento-title {
  color: #0f172a;
}

.kg-bento-subtitle {
  font-size: 1rem;
  color: #94a3b8;
  line-height: 1.6;
}

[data-theme="light"] .kg-bento-subtitle {
  color: #475569;
}

.kg-bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 980px) {
  .kg-bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.kg-bento-card {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .kg-bento-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.kg-bento-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .kg-bento-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.kg-bento-card.selected {
  border-color: #00a8e8;
  box-shadow: 0 0 0 1px #00a8e8, 0 8px 25px rgba(0, 168, 232, 0.2);
}

.kg-bento-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.kg-bento-icon-circle {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kg-bento-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
}

.kg-bento-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 0.5rem;
}

[data-theme="light"] .kg-bento-card-title {
  color: #0f172a;
}

.kg-bento-card-desc {
  font-size: 0.88rem;
  color: #94a3b8;
  line-height: 1.55;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

[data-theme="light"] .kg-bento-card-desc {
  color: #475569;
}

.kg-bento-footer {
  display: flex;
  align-items: center;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .kg-bento-footer {
  border-top-color: #f1f5f9;
}

.kg-bento-explore-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
}

/* 5. Device Compatibility Strip */
.kg-compatibility-strip-section {
  max-width: 1240px;
  margin: 5rem auto 0 auto;
  padding: 0 1.5rem;
}

.kg-compatibility-container {
  background: linear-gradient(135deg, #0d1a33 0%, #0a1122 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 20px;
  padding: 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .kg-compatibility-container {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-color: #bae6fd;
  box-shadow: 0 8px 25px rgba(0, 168, 232, 0.1);
}

@media (max-width: 860px) {
  .kg-compatibility-container {
    flex-direction: column;
    text-align: center;
    padding: 2rem;
  }
}

.kg-compat-left {
  max-width: 650px;
}

.kg-compat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 3px 9px;
  border-radius: 9999px;
  margin-bottom: 0.85rem;
}

.kg-compat-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 0.5rem;
}

[data-theme="light"] .kg-compat-title {
  color: #0f172a;
}

.kg-compat-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #94a3b8;
}

[data-theme="light"] .kg-compat-desc {
  color: #334155;
}

.kg-compat-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.kg-btn-compat-demo {
  padding: 0.85rem 1.65rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  background: #00a8e8;
  border: none;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  box-shadow: 0 4px 16px rgba(0, 168, 232, 0.4);
  transition: all 0.2s ease;
}

.kg-btn-compat-demo:hover {
  background: #0096c7;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 168, 232, 0.55);
}

.kg-btn-compat-register {
  padding: 0.85rem 1.45rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f8fafc;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

[data-theme="light"] .kg-btn-compat-register {
  border-color: #0284c7;
  color: #0284c7;
  background: #ffffff;
}

.kg-btn-compat-register:hover {
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .kg-btn-compat-register:hover {
  background: #0284c7;
  color: #ffffff;
}

/* ==========================================================================
   KiddiGuard High-Craft Animation & Modern UI Physics System
   Standards: better-ui (Jakub Krehel), MengTo Craft (Framed Grids & Rim Lighting),
              react-animation-builder, and professional-modern-animation-ui.
   ========================================================================== */

:root {
  /* Physics Easing Curves (No linear transitions) */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-exit: cubic-bezier(0.4, 0, 1, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);

  /* Standardized Tactile Timings */
  --time-micro: 180ms;
  --time-medium: 300ms;
  --time-staged: 450ms;
  --time-ambient: 4000ms;

  /* Concentric Radius Hierarchy (Outer = Inner + Padding) */
  --radius-outer: 18px;
  --radius-mid: 12px;
  --radius-inner: 8px;
  --radius-pill: 9999px;

  /* Multi-Layered Soft Ambient Shadows */
  --shadow-ambient: 0 1px 3px 0 rgba(15, 23, 42, 0.05), 0 4px 12px -2px rgba(15, 23, 42, 0.06);
  --shadow-hover-elevation: 0 8px 20px -4px rgba(15, 23, 42, 0.08), 0 4px 8px -2px rgba(79, 70, 229, 0.08);
  --shadow-glow-warm: 0 0 24px rgba(79, 70, 229, 0.2);
  --shadow-glow-cyan: 0 0 24px rgba(6, 182, 212, 0.25);
  --shadow-glow-emerald: 0 0 24px rgba(16, 185, 129, 0.25);
}

/* --------------------------------------------------------------------------
   1. Theme Transition Reflow Suppression (better-ui standard)
   -------------------------------------------------------------------------- */
body.theme-switching,
body.theme-switching *,
body.theme-switching *::before,
body.theme-switching *::after {
  transition: none !important;
}

/* --------------------------------------------------------------------------
   2. Tactile Press Feedback (Scale 0.96 standard from better-ui)
   -------------------------------------------------------------------------- */
.btn,
.metric-banner-tile,
.quick-action-card,
.nav-tab-item,
.date-pill,
.sidebar-link,
.device-select-btn {
  transition: transform var(--time-micro) var(--ease-spring),
              box-shadow var(--time-medium) var(--ease-spring),
              background-color var(--time-micro) var(--ease-soft),
              border-color var(--time-micro) var(--ease-soft) !important;
}

.btn:active,
.date-pill:active,
.device-select-btn:active {
  transform: scale(0.96) !important;
}

.metric-banner-tile:active,
.quick-action-card:active {
  transform: translateY(-2px) scale(0.98) !important;
}

/* --------------------------------------------------------------------------
   3. MengTo Border Gradients & Rim Specular Highlights
   -------------------------------------------------------------------------- */
.rim-highlight {
  position: relative;
  isolation: isolate;
}

.rim-highlight::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.4) 0%,
    rgba(79, 70, 229, 0.3) 40%,
    rgba(255, 255, 255, 0.05) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.6;
  transition: opacity var(--time-medium) var(--ease-soft);
}


.rim-highlight:hover::after {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   4. Shimmer Light Sweep on CTAs and Badges
   -------------------------------------------------------------------------- */
.shimmer-sweep {
  position: relative;
  overflow: hidden;
}

.shimmer-sweep::after {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.25) 50%,
    transparent 100%
  );
  transform: skewX(-22deg);
  pointer-events: none;
  transition: left 0.75s var(--ease-spring);
}

.shimmer-sweep:hover::after {
  left: 190%;
}

/* --------------------------------------------------------------------------
   5. Interactive Live Radar & Signal Pulses
   -------------------------------------------------------------------------- */
@keyframes radarPing {
  0% {
    transform: scale(0.85);
    opacity: 1;
  }
  70% {
    transform: scale(2.4);
    opacity: 0;
  }
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}

.live-beacon-pulse {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.live-beacon-pulse::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
  opacity: 0.8;
  animation: radarPing 2.4s cubic-bezier(0, 0, 0.2, 1) infinite;
  pointer-events: none;
}

/* Secondary delayed echo ripple */
.live-beacon-pulse::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
  opacity: 0.4;
  animation: radarPing 2.4s cubic-bezier(0, 0, 0.2, 1) infinite;
  animation-delay: 0.8s;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   6. Sound Equalizer Jumping Bars (Surveillance & Audio Telemetry)
   -------------------------------------------------------------------------- */
@keyframes eqBounce {
  0%, 100% {
    height: 4px;
  }
  50% {
    height: 18px;
  }
}

.telemetry-eq-strip {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 18px;
  padding: 0 4px;
}

.telemetry-eq-bar {
  width: 3px;
  background: var(--color-primary, #4f46e5);
  border-radius: 2px;
  animation: eqBounce 1.2s ease-in-out infinite;
}

.telemetry-eq-bar:nth-child(1) { animation-delay: 0.1s; animation-duration: 0.85s; }
.telemetry-eq-bar:nth-child(2) { animation-delay: 0.35s; animation-duration: 1.1s; }
.telemetry-eq-bar:nth-child(3) { animation-delay: 0.15s; animation-duration: 0.75s; }
.telemetry-eq-bar:nth-child(4) { animation-delay: 0.45s; animation-duration: 0.95s; }
.telemetry-eq-bar:nth-child(5) { animation-delay: 0.2s; animation-duration: 1.25s; }

/* --------------------------------------------------------------------------
   7. Stagger Cascades for Dashboard Grids
   -------------------------------------------------------------------------- */
@keyframes cascadeFadeUp {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.stagger-container > *:nth-child(1) { animation: cascadeFadeUp var(--time-medium) var(--ease-spring) 0.04s both; }
.stagger-container > *:nth-child(2) { animation: cascadeFadeUp var(--time-medium) var(--ease-spring) 0.08s both; }
.stagger-container > *:nth-child(3) { animation: cascadeFadeUp var(--time-medium) var(--ease-spring) 0.12s both; }
.stagger-container > *:nth-child(4) { animation: cascadeFadeUp var(--time-medium) var(--ease-spring) 0.16s both; }
.stagger-container > *:nth-child(5) { animation: cascadeFadeUp var(--time-medium) var(--ease-spring) 0.20s both; }
.stagger-container > *:nth-child(6) { animation: cascadeFadeUp var(--time-medium) var(--ease-spring) 0.24s both; }
.stagger-container > *:nth-child(7) { animation: cascadeFadeUp var(--time-medium) var(--ease-spring) 0.28s both; }
.stagger-container > *:nth-child(8) { animation: cascadeFadeUp var(--time-medium) var(--ease-spring) 0.32s both; }

/* --------------------------------------------------------------------------
   8. Category Metric Tiles Physical Elevation & Glow
   -------------------------------------------------------------------------- */
.category-tiles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 1200px) {
  .category-tiles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.metric-banner-tile {
  position: relative;
  border-radius: var(--radius-mid);
  padding: 18px 20px;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 128px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.15);
  transform: translateY(0);
  transition: transform var(--time-medium) var(--ease-spring),
              box-shadow var(--time-medium) var(--ease-spring),
              border-color var(--time-micro) var(--ease-soft) !important;
  color: #ffffff;
}

.metric-banner-tile:hover {
  transform: translateY(-6px) scale(1.012) !important;
  box-shadow: 0 16px 36px -6px rgba(0, 0, 0, 0.28), 0 0 24px rgba(243, 112, 33, 0.2) !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
}

.metric-banner-tile .tile-bg-watermark {
  position: absolute;
  right: -8px;
  bottom: -10px;
  opacity: 0.14;
  pointer-events: none;
  color: #ffffff;
  transform: rotate(-5deg) scale(1);
  transition: transform var(--time-medium) var(--ease-spring), opacity var(--time-micro) ease;
}

.metric-banner-tile:hover .tile-bg-watermark {
  transform: rotate(0deg) scale(1.14);
  opacity: 0.24;
}

.metric-banner-tile .tile-arrow {
  transform: translateX(0);
  transition: transform var(--time-micro) var(--ease-spring);
}

.metric-banner-tile:hover .tile-arrow {
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   9. Polished Top Telemetry Bar with Ambient Glow
   -------------------------------------------------------------------------- */
.top-telemetry-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-outer);
  padding: 12px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--time-medium) var(--ease-soft);
}

.top-telemetry-bar:hover {
  box-shadow: var(--shadow-ambient);
}

.telemetry-pill-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: -0.01em;
  transition: border-color var(--time-micro) var(--ease-soft),
              background-color var(--time-micro) var(--ease-soft);
}

.telemetry-pill-item:hover {
  border-color: var(--color-primary);
  background: var(--bg-card-hover);
}

/* --------------------------------------------------------------------------
   10. Quick Actions Command Hub Cards
   -------------------------------------------------------------------------- */
.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.quick-action-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: var(--radius-mid);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  text-align: left;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--time-medium) var(--ease-spring),
              box-shadow var(--time-medium) var(--ease-spring),
              border-color var(--time-micro) var(--ease-soft) !important;
}

.quick-action-card:hover {
  transform: translateY(-4px) scale(1.01) !important;
  box-shadow: var(--shadow-hover-elevation) !important;
  border-color: var(--color-primary) !important;
}

.quick-action-card .action-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-inner);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  background: rgba(79, 70, 229, 0.08);
  color: var(--color-primary);
  transition: transform var(--time-micro) var(--ease-spring),
              background var(--time-micro) var(--ease-soft);
}

.quick-action-card:hover .action-icon-wrap {
  transform: scale(1.08) rotate(3deg);
  background: var(--color-primary);
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   11. Smooth Rotation on Sync Triggers
   -------------------------------------------------------------------------- */
@keyframes spinSmooth {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-spin-smooth {
  animation: spinSmooth 0.85s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* --------------------------------------------------------------------------
   12. Animated High-Contrast Monospace Telemetry Pills
   -------------------------------------------------------------------------- */
.mono-telemetry-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid currentColor;
}

.badge-green {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}

.badge-orange,
.badge-indigo {
  color: #4f46e5;
  background: rgba(79, 70, 229, 0.08);
  border-color: rgba(79, 70, 229, 0.25);
}

.badge-amber {
  color: #d97706;
  background: rgba(217, 119, 6, 0.1);
  border-color: rgba(217, 119, 6, 0.3);
}

.badge-cyan {
  color: #06b6d4;
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.3);
}

/* --------------------------------------------------------------------------
   13. WCAG Focus Rings & Keyboard Navigation (better-accessibility)
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--color-primary, #4f46e5);
  outline-offset: 2px;
}

/* Exempt text inputs, textareas, selects, and input boxes that manage their own focus styles */
input:focus,
input:focus-visible,
textarea:focus,
textarea:focus-visible,
select:focus,
select:focus-visible,
.kg-input-box input,
.kg-input-box input:focus,
.kg-input-box input:focus-visible {
  outline: none !important;
  outline-offset: 0 !important;
}

/* --------------------------------------------------------------------------
   14. Typography Hygiene & Tabular Numerals (better-typography)
   -------------------------------------------------------------------------- */
.tabular-nums,
.metric-huge-number,
.time-segment-chip,
.badge-count,
.tile-count-badge,
.pill-pct,
.bar-tooltip,
.table-row td:nth-child(4),
.table-row td:nth-child(5),
.table-row td:nth-child(6),
.mono-label,
.telemetry-val {
  font-variant-numeric: tabular-nums !important;
  font-feature-settings: "tnum" 1;
}

.text-balance,
h1, h2, h3,
.panel-title,
.section-heading {
  text-wrap: balance;
}

.text-pretty,
.panel-subtitle,
.action-card-desc,
.tile-subtext {
  text-wrap: pretty;
}

/* --------------------------------------------------------------------------
   15. Accessibility: Minimum Hit Area Baseline (better-accessibility)
   -------------------------------------------------------------------------- */
@media (pointer: coarse) {
  button,
  .btn,
  .date-pill,
  .sidebar-link,
  .child-pill-btn,
  .quick-action-card {
    min-height: 44px;
  }
}

/* --------------------------------------------------------------------------
   16. Honor prefers-reduced-motion (better-accessibility & better-ui)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .live-beacon-pulse::before,
  .shimmer-sweep::after,
  .animate-spin-smooth {
    animation: none !important;
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   17. Tactile Scale on Press (better-ui: exactly scale(0.96))
   -------------------------------------------------------------------------- */
.btn:active:not(:disabled),
button:active:not(:disabled):not(.static-btn),
.date-pill:active:not(:disabled),
.sidebar-link:active,
.child-pill-btn:active,
.quick-action-card:active,
.tile-category-card:active {
  scale: 0.96;
}

.btn,
button,
.date-pill,
.sidebar-link,
.child-pill-btn,
.quick-action-card,
.tile-category-card {
  transition-property: transform, scale, background-color, border-color, box-shadow, color;
  transition-duration: 150ms;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

.static-btn,
.static-btn:active {
  scale: 1 !important;
}

/* --------------------------------------------------------------------------
   18. Image Depth Outlines (better-ui)
   -------------------------------------------------------------------------- */
img {
  outline: 1px solid rgba(0, 0, 0, 0.08);
  outline-offset: -1px;
}

[data-theme="dark"] img {
  outline: 1px solid rgba(255, 255, 255, 0.12);
  outline-offset: -1px;
}

/* --------------------------------------------------------------------------
   19. Optical Alignment for Icon-Trailing Controls (better-ui)
   -------------------------------------------------------------------------- */
.btn-icon-trailing {
  padding-inline-start: 16px;
  padding-inline-end: 14px;
}

.btn-icon-leading {
  padding-inline-start: 14px;
  padding-inline-end: 16px;
}

/* --------------------------------------------------------------------------
   20. Layered Transparent Elevation Shadows (better-ui)
   -------------------------------------------------------------------------- */
:root {
  --shadow-border:
    0px 0px 0px 1px rgba(0, 0, 0, 0.05),
    0px 1px 2px -1px rgba(0, 0, 0, 0.05),
    0px 2px 4px 0px rgba(0, 0, 0, 0.03);
  --shadow-border-hover:
    0px 0px 0px 1px rgba(0, 0, 0, 0.08),
    0px 2px 6px -1px rgba(0, 0, 0, 0.08),
    0px 4px 12px 0px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
  --shadow-border: 0 0 0 1px rgba(255, 255, 255, 0.08);
  --shadow-border-hover: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 4px 14px rgba(0, 0, 0, 0.5);
}

:root {
  color-scheme: light;
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Roboto Mono', ui-monospace, monospace;

  /* Cyber Slate & Electric Indigo Studio Theme (High Precision & Modern Contrast) */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-sand: #f1f5f9;
  --bg-card-hover: #f8fafc;
  --bg-surface-glass: rgba(255, 255, 255, 0.9);

  --border-subtle: #e2e8f0;
  --border-hover: #cbd5e1;
  --border-accent: #4f46e5;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --color-primary: #4f46e5;
  --color-primary-light: #6366f1;
  --color-primary-glow: rgba(79, 70, 229, 0.15);
  --color-promo-red: #e11d48;

  --color-secondary: #0284c7;
  --color-accent: #4f46e5;
  --color-success: #10b981;
  --color-warning: #d97706;
  --color-danger: #ef4444;

  --grid-line: rgba(226, 232, 240, 0.5);

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
  --grad-accent: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  --grad-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.8) 100%);

  /* Radius & Shadows (Concentric Hierarchy) */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.06), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
  --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.16);

  --transition-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme - Clean Studio Obsidian & Electric Cobalt */
[data-theme="light"] {
  color-scheme: light;
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-sand: #f1f5f9;
  --bg-card-hover: #f8fafc;
  --bg-surface-glass: rgba(255, 255, 255, 0.9);

  --border-subtle: #e2e8f0;
  --border-hover: #cbd5e1;
  --border-accent: #4f46e5;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --color-primary: #4f46e5;
  --color-primary-light: #6366f1;
  --color-primary-glow: rgba(79, 70, 229, 0.15);
  --color-promo-red: #e11d48;

  --color-secondary: #0284c7;
  --color-accent: #4f46e5;
  --color-success: #10b981;
  --color-warning: #d97706;
  --color-danger: #ef4444;

  --grid-line: rgba(226, 232, 240, 0.5);

  --grad-primary: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
  --grad-accent: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  --grad-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.8) 100%);

  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.06), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
  --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.16);
}

/* Dark Theme - Midnight Studio Cyber */
[data-theme="dark"] {
  color-scheme: dark;
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-card: #141e33;
  --bg-card-sand: #1e293b;
  --bg-card-hover: #1e2b48;
  --bg-surface-glass: rgba(15, 23, 42, 0.85);

  --border-subtle: #1e293b;
  --border-hover: #334155;
  --border-accent: #6366f1;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --color-primary: #6366f1;
  --color-primary-light: #818cf8;
  --color-primary-glow: rgba(99, 102, 241, 0.25);
  --color-promo-red: #f43f5e;

  --color-secondary: #38bdf8;
  --color-accent: #6366f1;
  --color-success: #34d399;
  --color-warning: #fbbf24;
  --color-danger: #f87171;

  --grid-line: rgba(30, 41, 59, 0.4);

  --grad-primary: linear-gradient(135deg, #6366f1 0%, #38bdf8 100%);
  --grad-accent: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --grad-surface: linear-gradient(180deg, rgba(20, 30, 51, 0.9) 0%, rgba(15, 23, 42, 0.9) 100%);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 24px rgba(99, 102, 241, 0.3);
}

/* Global Form Controls & Select High-Contrast Immunity */
select {
  color-scheme: dark;
  background-color: var(--bg-card);
  color: var(--text-main);
}

[data-theme="light"] select {
  color-scheme: light;
  background-color: #ffffff;
  color: #0f172a;
}

select option {
  background-color: #0d1527 !important;
  color: #f8fafc !important;
}

[data-theme="light"] select option {
  background-color: #ffffff !important;
  color: #0f172a !important;
}

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

body {
  background-color: var(--bg-primary);
  background-size: 28px 28px;
  background-image: 
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--text-main);
}

.text-gradient {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-main { color: var(--text-main); }
.text-primary { color: var(--color-primary); }
.text-primary-light { color: var(--color-primary-light); }
.text-secondary { color: var(--color-secondary); }
.text-accent { color: var(--color-accent); }
.text-amber { color: var(--color-warning); }
.text-indigo { color: var(--color-primary); }
.text-purple { color: var(--color-secondary); }
.text-success { color: var(--color-success); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--grad-surface);
  pointer-events: none;
}

/* Button System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #ffffff;
  border: 1px solid transparent;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  font-weight: 600;
}

.btn-primary:hover {
  background-color: var(--color-primary-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--color-primary-glow);
}

.btn-secondary {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-weight: 600;
}

.btn-secondary:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-link {
  background: none;
  border: none;
  color: var(--color-primary-light);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
}

.btn-link:hover {
  text-decoration: underline;
}

.full-width {
  width: 100%;
}

/* Layout */
.app-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* Navbar */
.navbar-container {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.navbar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

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

.brand-icon-wrapper {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #1f2937;
}

.brand-subtitle {
  font-size: 0.7rem;
  color: #526071;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* Mobile Portal Navbar & Drawer Controls */
.navbar-mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.navbar-mobile-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #38bdf8;
}

[data-theme="light"] .navbar-mobile-toggle {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
  color: #1e293b;
}

[data-theme="light"] .navbar-mobile-toggle:hover {
  background: rgba(0, 0, 0, 0.09);
  color: #0284c7;
}

.sidebar-mobile-close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 6px;
  transition: color 0.15s ease;
}

.sidebar-mobile-close-btn:hover {
  color: #f1f5f9;
}

[data-theme="light"] .sidebar-mobile-close-btn {
  color: #64748b;
}

[data-theme="light"] .sidebar-mobile-close-btn:hover {
  color: #0f172a;
}

.portal-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
}

.device-status-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
}

.device-dropdown-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
}

.device-select {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.device-select option {
  background: #111827;
  color: #f8fafc;
}

.dot-divider {
  opacity: 0.4;
}

.actions-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-picker-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
}

.date-input {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

.date-input::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

.user-profile-box {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding-left: 10px;
  border-left: 1px solid var(--border-subtle);
}

.avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
}

.btn-logout {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: color var(--transition-fast);
}

.btn-logout:hover {
  color: var(--color-danger);
}

/* Device Banner */
.device-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.device-meta-title {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 700;
}

.highlight-name {
  color: var(--color-primary-light);
  text-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.device-sub-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.date-quick-toggles {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.date-chip {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.date-chip.active, .date-chip:hover {
  background: rgba(99, 102, 241, 0.2);
  color: #fff;
}

/* Metric Cards Grid */
.metric-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.metric-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.metric-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--text-muted);
}

.metric-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-indigo { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.icon-rose { background: rgba(244, 63, 94, 0.15); color: #fb7185; }
.icon-purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.icon-cyan { background: rgba(6, 182, 212, 0.15); color: #38bdf8; }

.metric-value-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 0.75rem;
}

.metric-huge-number {
  font-family: var(--font-heading);
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.metric-unit {
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 600;
}

.metric-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.metric-trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.trend-up {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
}

.trend-down {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.highlight-pill {
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid;
}

.metric-sub-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 2-Column Grid */
.grid-2-col {
  display: grid;
  grid-template-columns: 2fr 1.1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 980px) {
  .grid-2-col {
    grid-template-columns: 1fr;
  }
}

/* Panels */
.chart-panel, .panel-card {
  padding: 1.75rem;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.panel-header-with-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.panel-title-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.panel-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.time-of-day-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.time-segment-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Hourly Bars Chart */
.bars-container {
  height: 220px;
  width: 100%;
  padding-top: 1rem;
  position: relative;
}

.bars-grid {
  display: flex;
  align-items: flex-end;
  height: 100%;
  gap: 5px;
  justify-content: space-between;
}

.bar-column {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  cursor: pointer;
}

.bar-track {
  width: 100%;
  height: 180px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  transition: background var(--transition-fast);
}

.bar-column:hover .bar-track {
  background: rgba(255, 255, 255, 0.06);
}

.bar-fill {
  width: 100%;
  border-radius: 6px 6px 0 0;
  transition: height 350ms cubic-bezier(0.4, 0, 0.2, 1), filter var(--transition-fast);
}

.bar-column:hover .bar-fill {
  filter: brightness(1.25);
}

.bar-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 8px;
  font-weight: 600;
  white-space: nowrap;
}

.bar-tooltip {
  position: absolute;
  bottom: 190px;
  background: #1e1b4b;
  border: 1px solid #6366f1;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  z-index: 20;
  white-space: nowrap;
  animation: fadeIn 0.15s ease-out;
}

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

.tooltip-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
}

.chart-footer-guide {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.guide-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.guide-indicator {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.indicator-high { background: #f43f5e; }
.indicator-med { background: #6366f1; }
.indicator-low { background: rgba(255, 255, 255, 0.15); }

/* Category Donut & List */
.multi-progress-bar {
  height: 14px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  display: flex;
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

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

.category-items-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.category-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.category-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.category-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.category-stats {
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-duration {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.category-percent-chip {
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

/* Weekly Trend */
.weekly-averages {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avg-stat-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.weekly-bars-container {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  height: 160px;
  padding-top: 1rem;
}

.weekly-bar-col {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.weekly-value-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.weekly-bar-track {
  width: 100%;
  max-width: 48px;
  height: 100px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.weekly-bar-fill {
  width: 100%;
  border-radius: 8px 8px 0 0;
  background: var(--grad-primary);
  transition: height 0.4s ease-out;
}

.weekly-bar-fill.today-highlight {
  background: linear-gradient(180deg, #06b6d4 0%, #3b82f6 100%);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.5);
}

.weekly-day-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-top: 8px;
}

.weekly-day-label.today-label {
  color: var(--color-accent);
  font-weight: 700;
}

/* App Usage Table */
.table-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
}

.search-input {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  width: 180px;
}

.category-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-chip:hover, .filter-chip.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.table-container {
  overflow-x: auto;
  margin-top: 1rem;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.custom-table th {
  padding: 0.85rem 1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 700;
  border-bottom: 1px solid var(--border-subtle);
}

.custom-table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.875rem;
}

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

.row-rank {
  font-weight: 700;
  color: var(--text-dim);
}

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

.app-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.app-text-meta {
  display: flex;
  flex-direction: column;
}

.app-name {
  font-weight: 700;
  color: var(--text-main);
}

.app-package {
  font-size: 0.75rem;
}

.category-pill {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.duration-highlight {
  font-size: 0.95rem;
  color: var(--text-main);
}

.progress-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-track {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  overflow: hidden;
}

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

.progress-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 36px;
}

.session-count-badge {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 13, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 1000;
  padding: 2rem 1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.modal-window {
  width: 100%;
  max-width: 540px;
  max-height: min(86vh, 760px);
  max-height: min(86dvh, 760px);
  display: flex;
  flex-direction: column;
  padding: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8);
  border-radius: var(--radius-lg, 16px);
  margin: auto 0;
  position: relative;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  background: var(--bg-card);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--text-main);
  background: var(--bg-secondary);
}

.modal-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.modal-body {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
  padding: 1.25rem 1.5rem 1.75rem 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
  -webkit-overflow-scrolling: touch;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.modal-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.modal-input:focus {
  border-color: var(--color-primary);
  background: rgba(99, 102, 241, 0.05);
}

.error-alert {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fb7185;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}

.error-banner {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fb7185;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pairing-success-view {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pairing-code-box {
  background: rgba(99, 102, 241, 0.08);
  border: 2px dashed rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.huge-pairing-code {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #fff;
  text-shadow: 0 0 20px rgba(99, 102, 241, 0.6);
}

.pairing-instructions {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.pairing-instructions h4 {
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.steps-list {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.demo-helper-box {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.auth-toggle-footer {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Empty State & Loader */
.empty-dashboard {
  padding: 4rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 500px;
  margin: 3rem auto;
}

.empty-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 400px;
  color: var(--text-muted);
}

.spinner {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* ==========================================================================
   FULL-SCREEN AUTH / REGISTRATION PAGE
   ========================================================================== */
.auth-fullscreen-container {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1.5rem 2rem 3rem 2rem;
  background-color: var(--bg-primary);
  background-size: 28px 28px;
  background-image: 
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-attachment: fixed;
  box-sizing: border-box;
}

.auth-top-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1120px;
  padding: 0.75rem 0;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.auth-brand-mini {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.auth-brand-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.auth-split-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  max-width: 1120px;
  width: 100%;
  gap: 3.5rem;
  align-items: center;
  margin: auto 0;
}

.auth-hero-showcase {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hero-kicker {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.hero-pitch h2 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.hero-desc {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.hero-feature-cards {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.hero-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.9rem 1.15rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.hero-card:hover {
  transform: translateX(3px);
  border-color: var(--border-hover);
}

.hero-card-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
}

.hero-card-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.hero-card-text strong {
  font-size: 0.92rem;
  color: var(--text-main);
}

.hero-card-text span {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.hero-footer-trust {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
}

/* Right Auth Form */
.auth-form-card-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
}

.auth-form-card {
  width: 100%;
  max-width: 440px;
  padding: 2rem 2.25rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

.auth-tabs {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
  margin-bottom: 1.5rem;
}

.auth-tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

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

.auth-form-header {
  margin-bottom: 1.5rem;
}

.auth-form-header h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
  letter-spacing: -0.01em;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

/* Base Form Inputs System */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-input,
.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.92rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.form-input::placeholder {
  color: var(--text-dim);
}

.form-input:focus,
.form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
  background: var(--bg-card);
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrap .form-input {
  padding-right: 42px;
}

.pwd-toggle-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.pwd-toggle-btn:hover {
  color: var(--text-main);
}

.btn-lg {
  padding: 0.8rem 1.5rem;
  font-size: 0.95rem;
}

.btn-block {
  width: 100%;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0 1rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-subtle);
}

.auth-divider span {
  padding: 0 0.75rem;
  color: var(--text-dim);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.demo-fill-btn {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.25);
  color: #fcd34d;
}

.demo-fill-btn:hover {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.4);
}

/* ==========================================================================
   CHILD PROFILE BAR / HUB (HEADER)
   ========================================================================== */
.child-profile-hub-card {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.75rem;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.child-switcher-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.child-pills-list {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.child-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.child-pill-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
  color: var(--text-main);
}

.child-pill-btn.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--color-primary);
  color: #fff;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

.pill-avatar {
  font-size: 1.15rem;
  line-height: 1;
}

.online-beacon {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
}

.btn-add-child-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: var(--color-primary-light);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-add-child-pill:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--color-primary);
  color: #fff;
}

.child-profile-main-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2rem;
  align-items: center;
}

.profile-identity-section {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.profile-large-avatar-badge {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(168, 85, 247, 0.3) 100%);
  border: 2px solid rgba(99, 102, 241, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), 0 0 20px rgba(99, 102, 241, 0.25);
  flex-shrink: 0;
}

.large-emoji {
  font-size: 2.5rem;
}

.avatar-status-dot {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-success);
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 10px var(--color-success);
}

.profile-meta-text {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.profile-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.profile-child-name {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.age-group-tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  background: rgba(168, 85, 247, 0.15);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.3);
  font-weight: 600;
}

.btn-edit-profile-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: color var(--transition-fast);
}

.btn-edit-profile-icon:hover {
  color: var(--color-primary-light);
  background: rgba(255, 255, 255, 0.04);
}

.profile-device-tags {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.dev-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.battery-tag {
  font-weight: 600;
}

.battery-high {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.08);
}

.battery-medium {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.08);
}

.battery-critical {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.3);
  background: rgba(248, 113, 113, 0.08);
}

.battery-icon-pulse {
  animation: pulse-battery 2s infinite ease-in-out;
}

@keyframes pulse-battery {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
}

.online-tag {
  color: #6ee7b7;
  border-color: rgba(110, 231, 183, 0.25);
  background: rgba(16, 185, 129, 0.08);
}

/* Daily Goal Gauge in Hub */
.profile-goal-actions-section {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.daily-goal-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
}

.goal-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.goal-title-cluster {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.goal-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.goal-stat-text {
  font-size: 0.95rem;
  color: var(--text-main);
}

.goal-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 0.45rem;
}

.goal-fill {
  height: 100%;
  background: var(--grad-primary);
  border-radius: 9999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.goal-fill.warning-fill {
  background: linear-gradient(90deg, #f59e0b 0%, #ef4444 100%);
}

.goal-fill.danger-fill {
  background: #f43f5e;
}

.goal-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.goal-pct-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-primary-light);
}

.profile-actions-bar {
  display: flex;
  justify-content: flex-end;
}

.sync-pulse-btn {
  font-weight: 600;
  gap: 0.4rem;
}

/* ==========================================================================
   DASHBOARD TABS BAR
   ========================================================================== */
.dashboard-tabs-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(19, 26, 44, 0.5);
  padding: 0.4rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 1.75rem;
  overflow-x: auto;
}

.dash-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.dash-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.dash-tab-btn.active {
  color: #fff;
  background: var(--color-primary);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

/* ==========================================================================
   CHILD PROFILE STUDIO MODAL
   ========================================================================== */
.profile-modal {
  max-width: 560px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  background: var(--bg-card);
}

.modal-avatar-preview {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.form-section-title {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary-light);
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 0.4rem;
}

.avatar-grid-picker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.avatar-pill-btn {
  height: 46px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.avatar-pill-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  transform: scale(1.08);
}

.avatar-pill-btn.active {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--color-primary);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
  transform: scale(1.1);
}

.emoji-display {
  font-size: 1.45rem;
}

.preset-chips-row {
  display: flex;
  gap: 0.4rem;
  margin: 0.4rem 0 0.75rem;
  flex-wrap: wrap;
}

.preset-chip {
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.preset-chip:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--text-main);
}

.preset-chip.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.custom-range-slider {
  width: 100%;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.form-select {
  cursor: pointer;
}

.grid-2-col-compact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 480px) {
  .grid-2-col-compact {
    grid-template-columns: 1fr;
  }
}

.modal-actions-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 1.5rem;
  padding-top: 1rem;
  padding-bottom: 0.25rem;
  border-top: 1px solid var(--border-subtle);
  position: sticky;
  bottom: -1.75rem;
  background: var(--bg-card);
  z-index: 5;
}

/* Pairing instructions view in modal */
.pairing-success-view {
  text-align: center;
  padding: 1rem 0;
}

.success-badge-icon {
  margin-bottom: 0.75rem;
}

.pairing-success-view h4 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.code-display-box {
  display: inline-flex;
  align-items: center;
  gap: 1.5rem;
  background: rgba(0, 0, 0, 0.4);
  border: 2px dashed var(--color-primary);
  border-radius: var(--radius-md);
  padding: 1rem 2rem;
  margin: 1.25rem auto;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.code-display-box:hover {
  transform: scale(1.03);
}

.code-pin {
  font-family: monospace;
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--color-primary-light);
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
}

.pairing-instruction-steps {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  text-align: left;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-top: 1rem;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.step-number {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ==========================================================================
   RULES TAB VIEW
   ========================================================================== */
.rules-grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
}

.rules-card {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.rules-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.rules-header-cluster {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.rules-card-avatar {
  font-size: 1.85rem;
}

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.rule-item-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.rule-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rule-info {
  flex: 1;
}

.rule-info strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.rule-value-badge {
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--color-primary-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.hardware-specs-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.spec-row:last-child {
  border-bottom: none;
}

.spec-label {
  color: var(--text-dim);
}

.spec-value {
  color: var(--text-main);
  font-weight: 500;
}

.pairing-pin-tag {
  font-family: monospace;
  background: rgba(99, 102, 241, 0.15);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  color: var(--color-primary-light);
  letter-spacing: 0.06em;
}

.hardware-actions-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}

.btn-danger-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #f43f5e;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-danger-outline:hover {
  background: rgba(244, 63, 94, 0.15);
  border-color: #f43f5e;
}

/* ==========================================================================
   NAVBAR DATE TOGGLE ENHANCEMENTS
   ========================================================================== */
.date-controls-cluster {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.date-pill-group {
  display: flex;
  background: var(--bg-secondary);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.date-pill {
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.date-pill:hover {
  color: var(--text-main);
}

.date-pill.active {
  background: var(--color-primary);
  color: #fff;
}

.user-name-label {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-full-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1f2937;
}

.user-role-tag {
  font-size: 0.68rem;
  color: #526071;
}

/* ==========================================================================
   CLEAN MODERN DUAL-THEME STYLING
   ========================================================================== */

/* Auth Top Strip */
.auth-top-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin-bottom: 2rem;
}

.auth-brand-mini {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.theme-toggle-btn:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

/* Monogram badges */
.avatar-monogram {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  border: 2px solid var(--border-subtle);
}

.profile-monogram-badge {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.profile-monogram-badge .monogram-text {
  font-family: var(--font-body);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
}

.rules-monogram-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary);
}

.pill-monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Tech Icon Picker */
.tech-icon-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.tech-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.tech-icon-btn.active {
  border-color: var(--color-primary);
  background: rgba(16, 185, 129, 0.08);
  color: var(--color-primary);
}

.icon-name-tag {
  font-size: 0.72rem;
  font-weight: 500;
}

/* Modal header clean */
.modal-header-clean {
  padding: 0 0 1rem 0;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-shrink: 0;
  margin-bottom: 1.25rem;
}

.modal-icon-preview {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-avatar-splash-clean {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem auto;
}

/* Modern Navigation Tabs in Dashboard */
.dashboard-tabs-bar {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.75rem;
  overflow-x: auto;
}

.dash-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.75rem 1.25rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
}

.dash-tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-surface-glass);
}

.dash-tab-btn.active {
  color: var(--color-primary);
  background: transparent;
  border-bottom: 2px solid var(--color-primary);
  font-weight: 600;
}

/* Auth footer */
.auth-footer-toggle {
  margin-top: 1.25rem;
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.link-btn {
  background: none;
  border: none;
  color: var(--color-primary);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.link-btn:hover {
  color: var(--color-primary-light);
}

/* ==========================================================================
   LIGHT MODE OVERRIDES FOR CARDS, TABLES, INPUTS & MODALS
   ========================================================================== */
[data-theme="light"] .glass-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .navbar-container {
  background: rgba(255, 255, 255, 0.95);
  border-bottom-color: #e2e8f0;
}

[data-theme="light"] .form-input,
[data-theme="light"] .search-input,
[data-theme="light"] .date-input {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .form-input:focus,
[data-theme="light"] .search-input:focus,
[data-theme="light"] .date-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

[data-theme="light"] .custom-table th {
  background: #f8fafc;
  color: #475569;
  border-bottom-color: #e2e8f0;
}

[data-theme="light"] .custom-table td {
  border-bottom-color: #f1f5f9;
  color: #0f172a;
}

[data-theme="light"] .table-row:hover td {
  background: #f8fafc;
}

[data-theme="light"] .date-pill-group {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

[data-theme="light"] .date-pill {
  color: #64748b;
}

[data-theme="light"] .date-pill.active {
  background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
  color: #ffffff;
}

[data-theme="light"] .btn-secondary {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #1e293b;
}

[data-theme="light"] .btn-secondary:hover {
  background: #e2e8f0;
  color: #4f46e5;
}

[data-theme="light"] .btn-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.3);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] .btn-primary:hover {
  background: linear-gradient(135deg, #4338ca 0%, #1d4ed8 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(79, 70, 229, 0.4);
}

[data-theme="light"] .auth-tab-btn {
  color: #64748b;
  border-bottom-color: transparent;
}

[data-theme="light"] .auth-tab-btn.active {
  color: #4f46e5;
  border-bottom-color: #4f46e5;
}

[data-theme="light"] .filter-chip {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #64748b;
}

[data-theme="light"] .filter-chip.active {
  background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
  color: #ffffff;
  border-color: #4f46e5;
}

[data-theme="light"] .modal-backdrop {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
}

[data-theme="light"] .modal-body {
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

[data-theme="light"] .modal-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .modal-body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .rule-item-box {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .spec-row {
  border-bottom-color: #f1f5f9;
}

[data-theme="light"] .daily-goal-box {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .goal-track {
  background: #e2e8f0;
}

[data-theme="light"] .child-pill-btn {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #475569;
}

[data-theme="light"] .child-pill-btn.active {
  background: #ffffff;
  border-color: #4f46e5;
  color: #4f46e5;
}

[data-theme="light"] .dev-tag {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #334155;
}

[data-theme="light"] .battery-tag.battery-high {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: #059669;
}

[data-theme="light"] .dash-tab-btn.active {
  background: #ffffff;
  border-color: #e2e8f0;
  border-bottom: 2px solid #4f46e5;
  color: #4f46e5;
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .auth-split-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .child-profile-main-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .rules-grid-2-col {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   MOBILE-TRACKER STYLE ADMIN PORTAL ARCHITECTURE
   ========================================================================== */

.admin-portal-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background-color: var(--bg-primary);
  color: var(--text-main);
  position: relative;
}

/* Sidebar Navigation */
.portal-sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 90;
  transition: width var(--transition-normal);
  user-select: none;
}

.portal-sidebar.sidebar-collapsed {
  width: 72px;
}

.sidebar-brand-strip {
  height: 64px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo-group {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.shield-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 0 14px var(--color-primary-glow);
}

.brand-titles {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-main {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.brand-badge-free {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  font-family: var(--font-mono);
}

.sidebar-collapse-toggle {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.sidebar-collapse-toggle:hover {
  background: var(--border-subtle);
  color: var(--text-main);
}

.sidebar-child-pill {
  margin: 12px 14px 6px;
  padding: 8px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
}

.child-avatar-chip {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--border-subtle);
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
}

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

.child-meta-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.child-meta-status {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.mini-beacon {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-success);
  display: inline-block;
  box-shadow: 0 0 6px var(--color-success);
}

.sidebar-nav-list {
  flex: 1;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: all var(--transition-fast);
}

.sidebar-nav-item:hover {
  background: var(--bg-card);
  color: var(--text-main);
}

.sidebar-nav-item.nav-item-active {
  background: var(--bg-card);
  color: var(--color-primary);
  font-weight: 600;
}

.active-indicator-bar {
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--color-primary);
}

.nav-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-item-text {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
}

.nav-index-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
}

.nav-label-title {
  font-size: 0.82rem;
}

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-add-device-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  background: transparent;
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sidebar-add-device-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--bg-card);
}

.sidebar-status-box {
  display: flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
}

.sys-ping-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sys-beacon {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 6px var(--color-success);
}

/* Main Viewport Column */
.portal-main-column {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition-normal);
}

.portal-main-column.sidebar-is-collapsed {
  margin-left: 72px;
}

.portal-content-body {
  flex: 1;
  padding: 24px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

/* ==========================================================================
   TOP TELEMETRY BAR (Online Status, Battery, Location)
   ========================================================================== */

.top-telemetry-strip {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.top-device-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 16px;
}

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

.device-selector-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* Modern Trigger Button for Device Dropdown */
.device-selector-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  border-radius: var(--radius-md, 8px);
  padding: 5px 12px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main, #f8fafc);
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  max-width: 380px;
}

.device-selector-trigger:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary, #10b981);
}

[data-theme="light"] .device-selector-trigger {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.15);
  color: #0f172a;
}

[data-theme="light"] .device-selector-trigger:hover {
  background: #f1f5f9;
  border-color: var(--primary, #059669);
}

.device-selector-current-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: inherit;
}

.device-selector-trigger .dropdown-chevron {
  color: var(--text-muted, #94a3b8);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.device-selector-trigger .dropdown-chevron.is-open {
  transform: rotate(180deg);
  color: var(--primary, #10b981);
}

/* Custom Floating Dropdown Menu Card */
.device-custom-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 320px;
  max-width: 420px;
  background: #0d1527;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.14));
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  z-index: 1000;
  backdrop-filter: blur(16px);
  overflow: hidden;
}

[data-theme="light"] .device-custom-dropdown-menu {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.15);
}

.dropdown-menu-header {
  padding: 8px 14px;
  font-size: 0.68rem;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted, #94a3b8);
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  background: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] .dropdown-menu-header {
  background: #f8fafc;
  color: #64748b;
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.dropdown-items-scroller {
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dropdown-device-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text-main, #f8fafc);
}

[data-theme="light"] .dropdown-device-item {
  color: #0f172a;
}

.dropdown-device-item:hover {
  background: rgba(16, 185, 129, 0.12);
}

.dropdown-device-item.selected {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

[data-theme="light"] .dropdown-device-item:hover {
  background: rgba(5, 150, 105, 0.08);
}

[data-theme="light"] .dropdown-device-item.selected {
  background: rgba(5, 150, 105, 0.14);
  border: 1px solid rgba(5, 150, 105, 0.3);
}

.device-item-quick-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  transition: all 0.15s ease;
  cursor: pointer;
}

.device-item-quick-delete:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #dc2626;
  transform: scale(1.08);
}

.device-item-icon-col {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--primary, #10b981);
  flex-shrink: 0;
}

[data-theme="light"] .device-item-icon-col {
  background: rgba(0, 0, 0, 0.04);
}

.status-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid #0d1527;
}

[data-theme="light"] .status-dot {
  border-color: #ffffff;
}

.status-dot.online {
  background-color: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.8);
}

.status-dot.offline {
  background-color: #64748b;
}

.device-item-text-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.device-item-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.device-item-meta {
  font-size: 0.72rem;
  font-family: var(--font-mono, monospace);
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="light"] .device-item-meta {
  color: #64748b;
}

.device-item-check {
  color: var(--primary, #10b981);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Fallback Native Select with Explicit High-Contrast Dark & Light Styles */
.device-dropdown-select {
  appearance: none;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  border-radius: var(--radius-md, 8px);
  padding: 6px 30px 6px 10px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main, #f8fafc);
  cursor: pointer;
  outline: none;
  color-scheme: dark;
  transition: all 0.2s ease;
}

.device-dropdown-select:hover {
  border-color: var(--primary, #10b981);
}

.device-dropdown-select option {
  background-color: #0d1527 !important;
  color: #f8fafc !important;
  padding: 8px 12px;
}

[data-theme="light"] .device-dropdown-select {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.15);
  color: #0f172a;
  color-scheme: light;
}

[data-theme="light"] .device-dropdown-select option {
  background-color: #ffffff !important;
  color: #0f172a !important;
}

.dropdown-chevron {
  position: absolute;
  right: 0;
  pointer-events: none;
  color: var(--text-muted);
}

.top-tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.telemetry-pill-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.telemetry-pill-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
}

.card-location {
  cursor: pointer;
}

.card-location:hover {
  border-color: var(--color-primary);
}

.pill-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-signal-active {
  color: var(--color-success);
}

.icon-signal-idle {
  color: var(--text-dim);
}

.icon-location {
  color: #3b82f6;
}

.pill-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.pill-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

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

.pill-main-val {
  font-size: 1.15rem;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--text-main);
}

.location-val {
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.location-header-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.view-map-link {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #3b82f6;
  display: flex;
  align-items: center;
  gap: 3px;
}

.battery-bar-track {
  flex: 1;
  height: 6px;
  background: var(--border-subtle);
  border-radius: 3px;
  overflow: hidden;
  max-width: 100px;
}

.battery-bar-fill {
  height: 100%;
  display: block;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.pill-footer-text {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
}

/* ==========================================================================
   CATEGORY METRIC TILES GRID (MobileTracker Free Colored Tiles)
   ========================================================================== */

.category-tiles-section {
  margin-bottom: 28px;
}

.section-title-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.section-mono-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--color-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.category-tiles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.metric-banner-tile {
  position: relative;
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 118px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  color: #ffffff;
}

.metric-banner-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Reference color themes */
.tile-blue {
  background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
}

.tile-red {
  background: linear-gradient(135deg, #b91c1c 0%, #ef4444 100%);
}

.tile-teal {
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
}

.tile-purple {
  background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 100%);
}

.tile-amber {
  background: linear-gradient(135deg, #b45309 0%, #f59e0b 100%);
}

.tile-green {
  background: linear-gradient(135deg, #15803d 0%, #22c55e 100%);
}

.tile-pink {
  background: linear-gradient(135deg, #be185d 0%, #ec4899 100%);
}

.tile-cyan {
  background: linear-gradient(135deg, #0369a1 0%, #06b6d4 100%);
}

.tile-bg-watermark {
  position: absolute;
  right: -10px;
  bottom: -10px;
  opacity: 0.15;
  pointer-events: none;
  color: #ffffff;
}

.tile-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tile-icon-bubble {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile-count-badge {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--font-heading);
  line-height: 1;
}

.tile-body {
  margin-top: 10px;
}

.tile-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tile-subtext {
  font-size: 0.7rem;
  opacity: 0.85;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-footer-bar {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.65rem;
  font-weight: 600;
  opacity: 0.9;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 6px;
}

/* ==========================================================================
   QUICK ACTION HUB (Others features panel)
   ========================================================================== */

.quick-actions-section {
  margin-bottom: 28px;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.quick-action-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.quick-action-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.quick-action-card.card-activated {
  border-color: var(--color-danger);
  background: rgba(244, 63, 94, 0.08);
}

.action-card-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.action-red .action-card-icon {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.action-teal .action-card-icon {
  background: rgba(20, 184, 166, 0.15);
  color: #14b8a6;
}

.action-purple .action-card-icon {
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
}

.action-amber .action-card-icon {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.action-blue .action-card-icon {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.action-green .action-card-icon {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.action-cyan .action-card-icon {
  background: rgba(6, 182, 212, 0.15);
  color: #06b6d4;
}

.action-darkblue .action-card-icon {
  background: rgba(99, 102, 241, 0.15);
  color: #6366f1;
}

.action-slate .action-card-icon {
  background: rgba(100, 116, 139, 0.15);
  color: #64748b;
}

.action-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.action-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

.action-card-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.action-dispatch-indicator {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.action-feedback-banner {
  margin-bottom: 14px;
  padding: 10px 14px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-sm);
  color: var(--color-success);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   LOCATION & GPS MAP VIEW
   ========================================================================== */

.location-view-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.location-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}

.loc-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.loc-badge-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loc-main-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.loc-action-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.location-grid-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.map-display-frame {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.map-frame-header {
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.telemetry-coord-pills {
  display: flex;
  align-items: center;
  gap: 8px;
}

.coord-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
}

.pill-acc {
  color: var(--color-primary);
}

.live-radar-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--color-success);
  display: flex;
  align-items: center;
  gap: 6px;
}

.radar-beacon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
}

.map-viewport-wrapper {
  position: relative;
  width: 100%;
  height: 380px;
  background: #111827;
}

.embedded-osm-map {
  width: 100%;
  height: 100%;
  border: none;
}

.radar-center-reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reticle-center-pin {
  color: #ef4444;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
  animation: bounce 1.5s infinite;
}

.reticle-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.ring-1 {
  width: 60px;
  height: 60px;
  animation: pulse-ring 2s infinite;
}

.ring-2 {
  width: 110px;
  height: 110px;
  animation: pulse-ring 2s infinite 0.5s;
}

@keyframes pulse-ring {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(1.3); opacity: 0; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.map-frame-footer {
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.loc-address-display {
  display: flex;
  align-items: center;
  gap: 8px;
}

.address-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.location-sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.geofence-card, .breadcrumbs-card {
  padding: 16px;
}

.geofence-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.geofence-item {
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
}

.geofence-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-green {
  background: var(--color-success);
  box-shadow: 0 0 6px var(--color-success);
}

.dot-neutral {
  background: var(--text-dim);
}

.geofence-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.zone-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
}

.zone-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.zone-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.badge-safe {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-neutral {
  background: var(--border-subtle);
  color: var(--text-dim);
}

.breadcrumbs-timeline {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 280px;
  overflow-y: auto;
}

.breadcrumb-node {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.node-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.node-index {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-hover);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: center;
}

.node-connector {
  width: 2px;
  height: 20px;
  background: var(--border-subtle);
  margin-top: 4px;
}

.node-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.node-address {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
}

.node-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.node-coords {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
}

/* ==========================================================================
   WEB SAFETY & ALERTS VIEWS
   ========================================================================== */

.web-safety-header-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.web-stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.web-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-emerald {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
}

.icon-blue {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.icon-red {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-danger);
}

.add-domain-form {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.blacklist-container {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.blacklist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

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

.domain-text {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.btn-icon-delete {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.btn-icon-delete:hover {
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.1);
}

/* Alert Summary Hero */
.alert-summary-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px;
}

.hero-badge-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: rgba(16, 185, 129, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-text {
  flex: 1;
}

.hero-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.hero-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.hero-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.alerts-stream-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alert-event-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.alert-item-icon {
  margin-top: 2px;
  color: var(--color-primary);
}

.alert-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.alert-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.alert-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.alert-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 2px 0 4px;
}

.keyword-categories-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.keyword-cat-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.cat-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 700;
  margin-right: 8px;
}

.cat-title {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-main);
}

.compliance-note-box {
  margin-top: 16px;
  padding: 10px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-primary);
}

/* Light Mode Overrides for New Components */
[data-theme="light"] .portal-sidebar {
  background: #ffffff;
  border-right-color: #e2e8f0;
}

[data-theme="light"] .sidebar-brand-strip {
  border-bottom-color: #e2e8f0;
}

[data-theme="light"] .sidebar-child-pill {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .sidebar-nav-item:hover {
  background: #f1f5f9;
}

[data-theme="light"] .sidebar-nav-item.nav-item-active {
  background: #f1f5f9;
  color: #059669;
}

[data-theme="light"] .top-device-info {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .telemetry-pill-card {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .pill-icon-box {
  background: #f1f5f9;
}

[data-theme="light"] .quick-action-card {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .quick-action-card:hover {
  background: #f8fafc;
}

[data-theme="light"] .map-frame-header,
[data-theme="light"] .map-frame-footer {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .coord-pill {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .geofence-item,
[data-theme="light"] .blacklist-item,
[data-theme="light"] .alert-event-item,
[data-theme="light"] .keyword-cat-pill {
  background: #f8fafc;
  border-color: #e2e8f0;
}

/* Responsive Media Queries */
@media (max-width: 1200px) {
  .category-tiles-grid,
  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .location-grid-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .navbar-mobile-toggle {
    display: inline-flex !important;
  }

  .navbar-inner {
    padding: 0.6rem 0.85rem !important;
    gap: 0.6rem !important;
  }

  .brand-badge {
    gap: 8px !important;
  }

  .brand-title {
    font-size: 1.05rem !important;
  }

  .brand-subtitle {
    display: none !important;
  }

  .date-controls-cluster {
    order: 3;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  [data-theme="light"] .date-controls-cluster {
    border-top-color: rgba(0, 0, 0, 0.06);
  }

  .date-pill-group {
    flex: 1;
    display: flex;
  }

  .date-pill {
    flex: 1;
    text-align: center;
    padding: 4px 8px !important;
    font-size: 0.78rem !important;
  }

  .date-picker-box {
    padding: 4px 8px !important;
  }

  .date-input {
    font-size: 0.78rem !important;
    width: 110px;
  }

  .actions-cluster {
    gap: 6px !important;
  }

  .actions-cluster .theme-toggle-btn span {
    display: none !important;
  }

  .actions-cluster .theme-toggle-btn {
    padding: 6px 8px !important;
  }

  .actions-cluster .btn-sm {
    padding: 6px 10px !important;
    font-size: 0.78rem !important;
  }

  .actions-cluster .user-profile-box {
    padding: 4px 6px !important;
  }

  .actions-cluster .user-name-label {
    display: none !important;
  }

  /* Off-canvas Slide-over Sidebar Drawer */
  .portal-sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    height: 100dvh !important;
    width: 280px !important;
    max-width: 85vw !important;
    z-index: 1000 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.6) !important;
    background: #0c1017 !important;
    overflow-y: auto !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
  }

  [data-theme="light"] .portal-sidebar {
    background: #ffffff !important;
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.15) !important;
    border-right-color: rgba(0, 0, 0, 0.1) !important;
  }

  .portal-sidebar.mobile-open {
    transform: translateX(0) !important;
  }

  /* Full Screen Viewport */
  .portal-main-column,
  .portal-main-column.sidebar-is-collapsed {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  .portal-content-body {
    padding: 12px 10px !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  /* Telemetry & Device Selector Mobile Layout */
  .top-device-info {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    padding: 10px 12px !important;
  }

  .device-brand-badge {
    justify-content: space-between !important;
    width: 100% !important;
  }

  .device-selector-trigger {
    max-width: 100% !important;
    width: 100% !important;
    justify-content: space-between !important;
  }

  .top-tiles-grid,
  .web-safety-header-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .category-tiles-grid,
  .quick-actions-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .grid-2-col {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* Clean Touch Friendly Modals */
  .kg-modal-card,
  .modal-content {
    width: 95% !important;
    max-width: 480px !important;
    margin: 16px auto !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    padding: 18px 16px !important;
  }
}

@media (max-width: 600px) {
  .navbar-live-telemetry-badge {
    display: none !important;
  }

  .actions-cluster .navbar-btn-text {
    display: none !important;
  }

  .actions-cluster .theme-toggle-btn,
  .actions-cluster .btn-sm {
    padding: 6px 8px !important;
  }

  .top-tiles-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .telemetry-pill-card {
    padding: 11px 13px !important;
    gap: 10px !important;
  }

  .pill-icon-box {
    width: 38px !important;
    height: 38px !important;
  }
}

@media (max-width: 480px) {
  .empty-dashboard {
    padding: 1.25rem 0.85rem !important;
    margin: 1rem auto !important;
    width: 100% !important;
  }

  .empty-parent-email-card {
    padding: 10px 12px !important;
  }

  .empty-parent-email-card .empty-copy-btn {
    width: 100% !important;
    margin-top: 4px !important;
  }

  .top-actions-cluster {
    width: 100% !important;
    flex-wrap: wrap !important;
  }

  .top-actions-cluster .btn-force-sync-action,
  .top-actions-cluster .btn-coparent-action {
    flex: 1 !important;
    justify-content: center !important;
    padding: 6px 8px !important;
    font-size: 11px !important;
  }

  .comm-stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .comm-stat-card {
    padding: 10px !important;
    gap: 8px !important;
  }

  .comm-stat-icon {
    width: 34px !important;
    height: 34px !important;
  }
}

/* ==========================================================================
   CONTACTS & CALLS TELEMETRY VIEW
   ========================================================================== */

.contacts-calls-view {
  display: flex;
  flex-direction: column;
}

.comm-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.comm-stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.comm-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-teal {
  background: rgba(20, 184, 166, 0.15);
  color: #14b8a6;
}

.icon-purple {
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
}

.comm-stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.comm-stat-val-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.comm-stat-val {
  font-size: 1.3rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--text-main);
}

.comm-toolbar {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.comm-tab-toggle-group {
  display: flex;
  background: var(--bg-secondary);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  gap: 4px;
}

.comm-tab-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.comm-tab-toggle:hover {
  color: var(--text-main);
}

.comm-tab-toggle.active {
  background: var(--bg-card);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.comm-search-and-refresh {
  display: flex;
  align-items: center;
  gap: 10px;
}

.comm-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  min-width: 240px;
}

.comm-search-input {
  background: transparent;
  border: none;
  font-size: 0.82rem;
  color: var(--text-main);
  outline: none;
  width: 100%;
}

.call-direction-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.contact-cell-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.contact-avatar-chip {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-hover);
  color: var(--color-primary);
  font-weight: 700;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-name-group {
  display: flex;
  flex-direction: column;
}

.contact-display-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-main);
}

.contact-number-mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.starred-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  color: #f59e0b;
}

.phone-type-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.phone-type-badge {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.contact-email-text {
  color: var(--text-muted);
}

.badge-call {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.badge-call-incoming {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-call-outgoing {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-call-missed {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-call-rejected {
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.timestamp-cell {
  display: flex;
  flex-direction: column;
}

/* Light mode overrides for contacts & calls */
[data-theme="light"] .comm-stat-card {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .comm-toolbar {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .comm-tab-toggle-group {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

[data-theme="light"] .comm-tab-toggle.active {
  background: #ffffff;
  color: #059669;
}

[data-theme="light"] .comm-search-box {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .contact-avatar-chip {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #059669;
}

@media (max-width: 992px) {
  .comm-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   Installed Applications Inventory Styles (clean-dashboard-ui compliance)
   ========================================================================== */
.app-avatar-badge {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm, 6px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.app-avatar-badge.user-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.app-avatar-badge.system-badge {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.badge-system {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 4px;
}

.badge-user {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 4px;
}

.mono-code-pill {
  font-family: var(--font-mono, monospace);
  font-size: 0.74rem;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  border-radius: 4px;
  color: var(--text-main, #f8fafc);
}

.category-pill-clean {
  font-size: 0.75rem;
  padding: 2px 8px;
  background: rgba(99, 102, 241, 0.1);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 9999px;
  white-space: nowrap;
}

.category-dropdown-select {
  background: var(--bg-card, #1e293b);
  color: var(--text-main, #f8fafc);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  padding: 6px 12px;
  border-radius: var(--radius-sm, 6px);
  font-size: 0.8rem;
  outline: none;
  cursor: pointer;
}

.table-action-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-danger-outline {
  background: transparent;
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.btn-danger-outline:hover {
  background: rgba(244, 63, 94, 0.15);
  border-color: #f43f5e;
}

/* Light mode overrides */
[data-theme="light"] .app-avatar-badge.user-badge {
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
}

[data-theme="light"] .app-avatar-badge.system-badge {
  background: #f1f5f9;
  color: #64748b;
  border-color: #cbd5e1;
}

[data-theme="light"] .badge-system {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}

[data-theme="light"] .badge-user {
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
}

[data-theme="light"] .mono-code-pill {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #1e293b;
}

[data-theme="light"] .category-pill-clean {
  background: #eef2ff;
  color: #4f46e5;
  border-color: #c7d2fe;
}

[data-theme="light"] .category-dropdown-select {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
}

/* ==========================================================================
   Child File Explorer Styles (clean-dashboard-ui compliance)
   ========================================================================== */
.storage-meter-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
}

.storage-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #06b6d4);
  border-radius: 9999px;
  transition: width 0.4s ease;
}

.file-window-wrapper {
  padding: 0;
  overflow: hidden;
}

.file-breadcrumbs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--bg-secondary, rgba(30, 41, 59, 0.5));
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  gap: 16px;
  flex-wrap: wrap;
}

.breadcrumb-nav-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.breadcrumbs-chain {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.breadcrumb-node {
  background: transparent;
  border: none;
  padding: 4px 8px;
  border-radius: var(--radius-sm, 4px);
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  font-size: 0.8rem;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.breadcrumb-node:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main, #f8fafc);
}

.breadcrumb-node.active {
  color: var(--text-main, #f8fafc);
  font-weight: 600;
  cursor: default;
}

.file-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.file-filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  gap: 16px;
  flex-wrap: wrap;
}

.file-table {
  margin: 0;
}

.file-row {
  cursor: default;
  transition: background var(--transition-fast);
}

.file-row.is-folder-row {
  cursor: pointer;
}

.file-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.file-row.installer-alert-row {
  background: rgba(244, 63, 94, 0.04);
}

.file-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm, 6px);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-name-group {
  display: flex;
  flex-direction: column;
}

.file-display-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main, #f8fafc);
}

.file-display-name.folder-link {
  color: #38bdf8;
  font-weight: 600;
}

.file-display-name.folder-link:hover {
  text-decoration: underline;
}

.file-path-sub {
  font-size: 0.72rem;
  color: var(--text-dim, #64748b);
}

/* Category Badge Variants */
.category-folder {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.25);
}

.category-document {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.25);
}

.category-image {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.25);
}

.category-video {
  background: rgba(244, 63, 94, 0.12);
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.25);
}

.category-audio {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.25);
}

.category-installer {
  background: rgba(244, 63, 94, 0.18);
  color: #f43f5e;
  border-color: rgba(244, 63, 94, 0.4);
}

.category-archive {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.25);
}

.file-table-thumb {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm, 6px);
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.file-location-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #38bdf8;
  font-size: 0.72rem;
  font-family: var(--font-mono, monospace);
  background: rgba(56, 189, 248, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.file-location-link:hover {
  background: rgba(56, 189, 248, 0.18);
  text-decoration: underline;
  border-color: rgba(56, 189, 248, 0.35);
}

.filter-chip-count {
  display: inline-block;
  padding: 1px 6px;
  font-size: 0.7rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  margin-left: 6px;
  font-family: var(--font-mono, monospace);
}

.filter-chip.active .filter-chip-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.file-filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.category-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* Modal Inspection Properties */
.inspect-props-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inspect-prop-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
}

.inspect-prop-label {
  font-size: 0.8rem;
  color: var(--text-muted, #94a3b8);
}

.inspect-prop-val {
  font-size: 0.82rem;
  color: var(--text-main, #f8fafc);
}

/* Light Mode Overrides for File Explorer */
[data-theme="light"] .storage-meter-bar {
  background: #e2e8f0;
}

[data-theme="light"] .file-breadcrumbs-toolbar {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .file-filter-toolbar {
  border-color: #e2e8f0;
}

[data-theme="light"] .breadcrumb-node {
  color: #64748b;
}

[data-theme="light"] .breadcrumb-node:hover:not(:disabled) {
  background: #f1f5f9;
  color: #0f172a;
}

[data-theme="light"] .breadcrumb-node.active {
  color: #0f172a;
}

[data-theme="light"] .file-row:hover {
  background: #f8fafc;
}

[data-theme="light"] .file-row.installer-alert-row {
  background: #fff1f2;
}

[data-theme="light"] .file-icon-badge {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

[data-theme="light"] .file-display-name {
  color: #0f172a;
}

[data-theme="light"] .file-display-name.folder-link {
  color: #0284c7;
}

[data-theme="light"] .inspect-prop-row {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .inspect-prop-label {
  color: #64748b;
}

[data-theme="light"] .inspect-prop-val {
  color: #0f172a;
}

/* ==========================================================================
   ENGINEERING-GRADE LIVE SURVEILLANCE & STREAMING DESIGN SYSTEM
   ========================================================================== */

.surveillance-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}

.surveillance-telemetry-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-card, #0f172a);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-md, 8px);
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
}

.surveillance-main-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 1200px) {
  .surveillance-main-grid {
    grid-template-columns: 1fr;
  }
}

.surveillance-viewport-card,
.surveillance-sidebar-card {
  background: var(--bg-card, #0f172a);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.surveillance-mode-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  padding: 0.25rem 0.5rem;
  gap: 0.5rem;
}

.surveillance-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm, 6px);
  color: var(--text-muted, #94a3b8);
  font-size: 0.82rem;
  font-family: var(--font-mono, monospace);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast, 0.15s);
}

.surveillance-tab-btn:hover {
  color: var(--text-main, #f8fafc);
  background: rgba(255, 255, 255, 0.04);
}

.surveillance-tab-btn.active {
  color: var(--color-primary, #0284c7);
  background: rgba(2, 132, 199, 0.12);
  border-color: rgba(2, 132, 199, 0.3);
}

.surveillance-main-grid.view-wide {
  grid-template-columns: 1fr;
}

.surveillance-screen-canvas {
  position: relative;
  background: #05070a;
  min-height: 660px;
  height: 76vh;
  max-height: 950px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.screen-stream-wrapper,
.camera-stream-wrapper,
.audio-intercom-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  min-height: 0;
}

.active-screen-frame,
.active-camera-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  min-height: 0;
  background: #000;
  overflow: hidden;
  padding: 8px;
  box-sizing: border-box;
}

.screen-video-element,
.camera-video-element {
  max-height: 100%;
  max-width: 100%;
  height: 100%;
  width: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.85);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* FULLSCREEN NATIVE EXPANSION */
.surveillance-screen-canvas:fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  background: #000 !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.surveillance-screen-canvas:fullscreen .screen-stream-wrapper,
.surveillance-screen-canvas:fullscreen .camera-stream-wrapper {
  height: 100vh !important;
  width: 100vw !important;
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
}

.surveillance-screen-canvas:fullscreen .active-screen-frame,
.surveillance-screen-canvas:fullscreen .active-camera-frame {
  flex: 1 !important;
  height: calc(100vh - 65px) !important;
  max-height: calc(100vh - 65px) !important;
  width: 100vw !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 10px !important;
  box-sizing: border-box !important;
  background: #000 !important;
}

.surveillance-screen-canvas:fullscreen .screen-video-element,
.surveillance-screen-canvas:fullscreen .camera-video-element {
  max-height: calc(100vh - 85px) !important;
  max-width: 98vw !important;
  height: 100% !important;
  width: auto !important;
  object-fit: contain !important;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.95) !important;
}

.surveillance-screen-canvas:fullscreen .stream-bottom-controls {
  background: rgba(15, 23, 42, 0.96) !important;
  backdrop-filter: blur(16px) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
  padding: 0.75rem 1.5rem !important;
  z-index: 100 !important;
}

.screen-overlay-hud,
.camera-overlay-hud {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

.hud-pill {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  color: #f8fafc;
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hud-rec {
  color: #ef4444;
  font-weight: 700;
  animation: pulse-danger 1.5s infinite;
}

.stream-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 3rem 1.5rem;
  text-align: center;
}

.placeholder-phone-silhouette {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 440px;
}

.placeholder-icon {
  color: var(--text-muted, #94a3b8);
  margin-bottom: 1rem;
  opacity: 0.6;
}

.placeholder-title {
  font-family: var(--font-mono, monospace);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main, #f8fafc);
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

.placeholder-desc {
  font-size: 0.85rem;
  color: var(--text-muted, #94a3b8);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

/* Center Hero Action Buttons in Live Surveillance */
.surveillance-hero-btn,
.action-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0.95rem 2.25rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ffffff !important;
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 8px 26px rgba(2, 132, 199, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  user-select: none;
}

.surveillance-hero-btn:hover,
.action-btn-primary:hover {
  background: linear-gradient(135deg, #0369a1 0%, #1d4ed8 100%);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(2, 132, 199, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  border-color: rgba(56, 189, 248, 0.8);
}

.surveillance-hero-btn:active,
.action-btn-primary:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
}

.surveillance-hero-btn.hero-btn-purple {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  border-color: rgba(167, 139, 250, 0.45);
  box-shadow: 0 8px 26px rgba(124, 58, 237, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.surveillance-hero-btn.hero-btn-purple:hover {
  background: linear-gradient(135deg, #6d28d9 0%, #4338ca 100%);
  box-shadow: 0 12px 32px rgba(124, 58, 237, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  border-color: rgba(167, 139, 250, 0.8);
}

.surveillance-hero-btn.hero-btn-emerald {
  background: linear-gradient(135deg, #059669 0%, #0284c7 100%);
  border-color: rgba(52, 211, 153, 0.45);
  box-shadow: 0 8px 26px rgba(5, 150, 105, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.surveillance-hero-btn.hero-btn-emerald:hover {
  background: linear-gradient(135deg, #047857 0%, #0369a1 100%);
  box-shadow: 0 12px 32px rgba(5, 150, 105, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  border-color: rgba(52, 211, 153, 0.8);
}

.surveillance-hero-btn.hero-btn-danger,
.action-btn-primary.btn-danger {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  border-color: rgba(248, 113, 113, 0.5);
  box-shadow: 0 8px 26px rgba(220, 38, 38, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.surveillance-hero-btn.hero-btn-danger:hover,
.action-btn-primary.btn-danger:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
  box-shadow: 0 12px 32px rgba(220, 38, 38, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  border-color: rgba(248, 113, 113, 0.85);
}

.stream-bottom-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  gap: 1rem;
  flex-wrap: wrap;
}

.stream-bottom-left-controls,
.stream-bottom-right-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.stream-fit-options {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 6px;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stream-fit-label {
  font-family: var(--font-mono, monospace);
  font-size: 0.68rem;
  color: var(--text-muted, #94a3b8);
  font-weight: 600;
  margin-right: 2px;
}

.stream-pill-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast, 0.15s);
}

.stream-pill-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
}

.stream-pill-btn.active {
  color: #ffffff;
  background: #0284c7;
  font-weight: 700;
}

.stream-control-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-md, 8px);
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main, #f8fafc);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.stream-control-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.stream-control-btn.btn-active-primary {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #ffffff;
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
}

.stream-control-btn.btn-active-primary:hover {
  background: linear-gradient(135deg, #0369a1 0%, #1d4ed8 100%);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.55);
}

.stream-control-btn.btn-active-secondary {
  background: rgba(2, 132, 199, 0.18);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
}

.stream-control-btn.btn-active-purple {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  color: #ffffff !important;
  border-color: rgba(167, 139, 250, 0.4);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
}

.stream-control-btn.btn-active-purple:hover {
  background: linear-gradient(135deg, #6d28d9 0%, #4338ca 100%);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.55);
}

.stream-control-btn.btn-active-danger {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: #ffffff !important;
  border-color: rgba(248, 113, 113, 0.5);
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.45);
}

.stream-control-btn.btn-active-danger:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.6);
}

.hud-quick-stop-btn {
  background: rgba(220, 38, 38, 0.85);
  color: #ffffff !important;
  border: 1px solid rgba(248, 113, 113, 0.6);
  border-radius: 6px;
  padding: 4px 10px;
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
  transition: all 0.15s ease;
  user-select: none;
}

.hud-quick-stop-btn:hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.65);
}

.lens-switcher-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lens-label {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  color: var(--text-muted, #94a3b8);
}

.lens-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted, #94a3b8);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  cursor: pointer;
}

.lens-toggle-btn.active {
  background: rgba(2, 132, 199, 0.15);
  color: #38bdf8;
  border-color: #0284c7;
}

/* Intercom & Audio Styles */
.audio-intercom-wrapper {
  padding: 1.5rem;
  gap: 1.5rem;
}

.intercom-dashboard-center {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.waveform-visualizer-container {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-md, 8px);
  padding: 1.25rem;
}

.visualizer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.waveform-icon {
  color: #38bdf8;
}

.visualizer-title {
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main, #f8fafc);
  letter-spacing: 0.04em;
}

.visualizer-db {
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.waveform-bars {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  height: 60px;
}

.wave-bar {
  flex: 1;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  transition: height 0.1s ease;
}

.wave-bar.active {
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

.intercom-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 768px) {
  .intercom-actions-grid {
    grid-template-columns: 1fr;
  }
}

.intercom-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-md, 8px);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.intercom-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main, #f8fafc);
}

.intercom-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted, #94a3b8);
  line-height: 1.4;
  margin: 0;
}

.intercom-volume-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.vol-icon {
  color: var(--text-muted, #94a3b8);
}

.volume-slider {
  flex: 1;
  accent-color: #0284c7;
  cursor: pointer;
}

.vol-percent {
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  color: var(--text-muted, #94a3b8);
  min-width: 36px;
}

.intercom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md, 8px);
  font-family: var(--font-mono, monospace);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  margin-top: auto;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color: #ffffff !important;
  user-select: none;
  background: linear-gradient(135deg, #059669 0%, #0284c7 100%);
  border: 1px solid rgba(52, 211, 153, 0.4);
  box-shadow: 0 4px 16px rgba(5, 150, 105, 0.4);
}

.intercom-btn:hover {
  background: linear-gradient(135deg, #047857 0%, #0369a1 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.55);
}

.intercom-btn.btn-active-danger {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
  border: 1px solid rgba(248, 113, 113, 0.5) !important;
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.45) !important;
}

.intercom-btn.btn-active-danger:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.6) !important;
}

.ptt-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 0;
}

.ptt-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(2, 132, 199, 0.12);
  border: 2px solid #0284c7;
  color: #38bdf8;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.ptt-button:hover {
  background: rgba(2, 132, 199, 0.25);
  transform: scale(1.03);
}

.ptt-button.ptt-active {
  background: #dc2626;
  border-color: #ef4444;
  color: #ffffff;
  transform: scale(0.96);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
}

.ptt-label {
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  font-weight: 700;
}

.ptt-sub {
  font-family: var(--font-mono, monospace);
  font-size: 0.62rem;
  opacity: 0.8;
}

/* Recording Controller Strip */
.recording-controller-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-md, 8px);
}

.rec-status-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  color: var(--text-main, #f8fafc);
}

.rec-circle-pulsing {
  color: #ef4444;
  fill: #ef4444;
  animation: pulse-danger 1s infinite;
}

.rec-circle-idle {
  color: var(--text-muted, #94a3b8);
}

.rec-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm, 6px);
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.rec-btn-start {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #f87171;
}

.rec-btn-start:hover {
  background: #ef4444;
  color: #ffffff;
}

.rec-btn-stop {
  background: #ef4444;
  border: 1px solid #dc2626;
  color: #ffffff;
}

/* Right Sidebar: Audio Recordings List */
.surveillance-sidebar-card {
  display: flex;
  flex-direction: column;
  height: 600px;
}

.recordings-list-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.recordings-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
}

.recordings-empty-state .empty-icon {
  color: var(--text-muted, #94a3b8);
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

.recordings-empty-state .empty-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main, #f8fafc);
  margin-bottom: 0.35rem;
}

.recordings-empty-state .empty-sub {
  font-size: 0.75rem;
  color: var(--text-muted, #94a3b8);
  line-height: 1.4;
}

.recording-item-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  border-radius: var(--radius-sm, 6px);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.recording-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rec-name-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-main, #f8fafc);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rec-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  padding: 2px;
}

.rec-delete-btn:hover {
  color: #ef4444;
}

.recording-meta-row {
  display: flex;
  gap: 0.5rem;
}

.recording-meta-row .meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-mono, monospace);
  font-size: 0.68rem;
  color: var(--text-muted, #94a3b8);
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 6px;
  border-radius: 4px;
}

.recording-audio-player {
  width: 100%;
  margin-top: 0.25rem;
}

.native-audio-player {
  width: 100%;
  height: 32px;
  filter: invert(0.85) hue-rotate(180deg);
}

.surveillance-security-notice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  font-size: 0.7rem;
  color: var(--text-muted, #94a3b8);
}

.surveillance-security-notice .notice-icon {
  color: #10b981;
  flex-shrink: 0;
}

/* Light Mode Overrides for Surveillance */
[data-theme="light"] .surveillance-telemetry-header {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .surveillance-viewport-card,
[data-theme="light"] .surveillance-sidebar-card {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .surveillance-mode-tabs {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .stream-bottom-controls {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .stream-control-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .stream-control-btn.btn-active-primary {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%) !important;
  color: #ffffff !important;
  border-color: rgba(56, 189, 248, 0.5) !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35) !important;
}

[data-theme="light"] .stream-control-btn.btn-active-purple {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%) !important;
  color: #ffffff !important;
  border-color: rgba(167, 139, 250, 0.5) !important;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35) !important;
}

[data-theme="light"] .stream-control-btn.btn-active-danger {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
  color: #ffffff !important;
  border-color: rgba(248, 113, 113, 0.6) !important;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35) !important;
}

[data-theme="light"] .lens-toggle-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

[data-theme="light"] .waveform-visualizer-container {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .intercom-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .recording-controller-strip {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .recording-item-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .native-audio-player {
  filter: none;
}

[data-theme="light"] .surveillance-security-notice {
  background: #f8fafc;
  border-color: #e2e8f0;
}

/* ==========================================================================
   INSTANT MESSAGING & MULTI-APP SIDEBAR DESIGN SYSTEM
   ========================================================================== */

/* Collapsible Sidebar Sub-Menu */
.sidebar-dropdown-group {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.dropdown-parent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.dropdown-arrow-icon {
  margin-left: auto;
  color: var(--text-muted, #94a3b8);
  display: flex;
  align-items: center;
}

.sidebar-sub-menu {
  display: flex;
  flex-direction: column;
  padding-left: 2.25rem;
  padding-right: 0.5rem;
  gap: 2px;
  max-height: 280px;
  overflow-y: auto;
}

.sidebar-sub-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.6rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm, 4px);
  color: #94a3b8;
  font-size: 0.78rem;
  font-family: var(--font-body, sans-serif);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast, 0.15s);
}

.sidebar-sub-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
}

.sidebar-sub-item.sub-item-active {
  background: rgba(2, 132, 199, 0.15);
  color: #38bdf8;
  font-weight: 600;
}

.sub-item-icon {
  display: flex;
  align-items: center;
  color: inherit;
  opacity: 0.75;
}

.sub-item-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Main Instant Messaging Viewport */
.instant-messaging-view {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.im-telemetry-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-card, #0f172a);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-md, 8px);
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
}

/* Horizontal Apps Selection Strip */
.im-apps-horizontal-scroll {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
}

.im-app-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  background: var(--bg-card, #0f172a);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: 9999px;
  color: var(--text-muted, #94a3b8);
  font-size: 0.75rem;
  font-family: var(--font-mono, monospace);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast, 0.15s);
}

.im-app-pill:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main, #f8fafc);
  border-color: rgba(255, 255, 255, 0.15);
}

.im-app-pill.active {
  background: rgba(2, 132, 199, 0.15);
  border-color: #0284c7;
  color: #38bdf8;
}

.app-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.app-pill-badge {
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 9999px;
  margin-left: 2px;
}

/* Two-Column Chat Studio Grid */
.im-studio-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.25rem;
  height: calc(100vh - 270px);
  min-height: 560px;
}

@media (max-width: 900px) {
  .im-studio-grid {
    grid-template-columns: 1fr;
    height: auto;
  }
}

.im-threads-card,
.im-chat-viewport-card {
  background: var(--bg-card, #0f172a);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Threads Sidebar */
.im-threads-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  background: rgba(0, 0, 0, 0.2);
}

.im-search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-sm, 6px);
  padding: 0.4rem 0.65rem;
}

.im-search-icon {
  color: var(--text-muted, #94a3b8);
  flex-shrink: 0;
}

.im-search-input {
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.78rem;
  color: var(--text-main, #f8fafc);
  width: 100%;
}

.im-threads-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.im-thread-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: all var(--transition-fast, 0.15s);
  border: 1px solid transparent;
}

.im-thread-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.im-thread-item.thread-selected {
  background: rgba(2, 132, 199, 0.12);
  border-color: rgba(2, 132, 199, 0.3);
}

.thread-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono, monospace);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main, #f8fafc);
  flex-shrink: 0;
}

.thread-app-pip {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg-card, #0f172a);
}

.thread-content-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.thread-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.thread-contact-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main, #f8fafc);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-time {
  font-family: var(--font-mono, monospace);
  font-size: 0.68rem;
  color: var(--text-muted, #94a3b8);
}

.thread-snippet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.thread-snippet-text {
  font-size: 0.75rem;
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-count-badge {
  font-family: var(--font-mono, monospace);
  font-size: 0.65rem;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted, #94a3b8);
  padding: 1px 5px;
  border-radius: 9999px;
  flex-shrink: 0;
}

/* Chat History Viewport */
.im-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  background: rgba(0, 0, 0, 0.2);
}

.chat-header-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #0284c7;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
  font-weight: 700;
}

.chat-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-header-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main, #f8fafc);
}

.chat-header-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.68rem;
}

.chat-status-pill,
.chat-count-pill {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted, #94a3b8);
  padding: 1px 6px;
  border-radius: 4px;
}

.safety-shield-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Chat Messages Bubble Stream */
/* Real WhatsApp Theme Styling */
.im-messages-bubble-stream {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  background-color: #0b141a;
  background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 0);
  background-size: 24px 24px;
}

[data-theme="light"] .im-messages-bubble-stream {
  background-color: #efeae2;
  background-image: radial-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 0);
}

.chat-date-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.75rem 0;
}

.date-separator-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: #8696a0;
  background: #182229;
  padding: 4px 12px;
  border-radius: 8px;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  text-transform: uppercase;
}

[data-theme="light"] .date-separator-pill {
  background: #ffffff;
  color: #54656f;
}

.im-bubble-row {
  display: flex;
  width: 100%;
}

.im-bubble-row.row-incoming {
  justify-content: flex-start;
}

.im-bubble-row.row-outgoing {
  justify-content: flex-end;
}

.im-bubble-card {
  max-width: 68%;
  padding: 6px 9px 6px 9px;
  position: relative;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  word-break: break-word;
}

.bubble-incoming {
  background: #202c33;
  color: #e9edef;
  border-radius: 8px 8px 8px 2px;
  border: none;
}

[data-theme="light"] .bubble-incoming {
  background: #ffffff;
  color: #111b21;
}

.bubble-outgoing {
  background: #005c4b;
  color: #e9edef;
  border-radius: 8px 8px 2px 8px;
  border: none;
}

[data-theme="light"] .bubble-outgoing {
  background: #d9fdd3;
  color: #111b21;
}

.bubble-message-body {
  font-size: 0.88rem;
  line-height: 1.42;
  color: inherit;
  display: inline;
}

.bubble-inline-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  float: right;
  margin-left: 12px;
  margin-top: 5px;
  vertical-align: bottom;
  user-select: none;
}

.bubble-time-text {
  font-size: 0.65rem;
  color: #8696a0;
  font-family: var(--font-mono, monospace);
}

[data-theme="light"] .bubble-time-text {
  color: #667781;
}

.wa-double-check {
  color: #53bdeb;
}

/* WhatsApp Media Attachments */
.wa-bubble-attachment {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 4px;
}

.wa-photo-preview-box,
.wa-video-preview-box {
  position: relative;
  width: 240px;
  max-width: 100%;
  height: 150px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wa-photo-preview-box:hover,
.wa-video-preview-box:hover {
  border-color: rgba(37, 211, 102, 0.5);
  transform: scale(1.01);
}

.wa-media-lead-icon {
  color: #25d366;
  opacity: 0.85;
}

.wa-photo-overlay-tag,
.wa-video-overlay-tag {
  position: absolute;
  bottom: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-mono, monospace);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  backdrop-filter: blur(4px);
}

.wa-video-play-ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(37, 211, 102, 0.2);
  border: 1px solid rgba(37, 211, 102, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wa-attachment-caption {
  font-size: 0.85rem;
  line-height: 1.35;
  color: inherit;
  padding: 2px 2px;
}

/* Document & PDF Cards */
.wa-doc-card-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  min-width: 220px;
}

[data-theme="light"] .wa-doc-card-inner {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.1);
}

.wa-doc-icon-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: #ffffff;
  width: 38px;
  height: 44px;
  border-radius: 4px;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
}

.wa-doc-type-label {
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-top: -2px;
}

.wa-doc-info-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.wa-doc-filename {
  font-size: 0.82rem;
  font-weight: 600;
  color: inherit;
  word-break: break-all;
}

.wa-doc-subtext {
  font-size: 0.68rem;
  color: var(--text-muted, #8696a0);
}

/* Voice Notes */
.wa-voice-note-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  min-width: 200px;
}

.wa-voice-mic-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #25d366;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wa-voice-waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 24px;
  flex: 1;
}

.wa-wave-bar {
  width: 3px;
  background: #25d366;
  border-radius: 2px;
  opacity: 0.75;
}

.wa-voice-duration {
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
  color: #8696a0;
  flex-shrink: 0;
}

/* Chat Header Action Buttons */
.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-header-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  padding: 6px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.chat-header-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #25d366;
}

.im-chat-footer-notice {
  padding: 0.75rem 1.25rem;
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.footer-notice-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: var(--text-muted, #94a3b8);
}

.im-chat-empty-state,
.im-empty-threads {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
}

.im-chat-empty-state .empty-icon,
.im-empty-threads .empty-icon {
  color: var(--text-muted, #94a3b8);
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

.im-chat-empty-state .empty-title,
.im-empty-threads .empty-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main, #f8fafc);
  margin-bottom: 0.35rem;
}

.im-chat-empty-state .empty-desc,
.im-empty-threads .empty-sub {
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
  max-width: 360px;
  line-height: 1.4;
}

/* Light Mode Overrides for Instant Messaging */
[data-theme="light"] .im-telemetry-strip {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .im-app-pill {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #64748b;
}

[data-theme="light"] .im-app-pill:hover {
  background: #f1f5f9;
  color: #0f172a;
}

[data-theme="light"] .im-app-pill.active {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #38bdf8;
}

[data-theme="light"] .im-threads-card,
[data-theme="light"] .im-chat-viewport-card {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .im-threads-header,
[data-theme="light"] .im-chat-header {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .im-search-bar {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .im-search-input {
  color: #0f172a;
}

[data-theme="light"] .im-thread-item:hover {
  background: #f8fafc;
}

[data-theme="light"] .im-thread-item.thread-selected {
  background: #f0f9ff;
  border-color: #bae6fd;
}

[data-theme="light"] .thread-contact-name,
[data-theme="light"] .chat-header-name {
  color: #0f172a;
}

[data-theme="light"] .bubble-incoming {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .bubble-outgoing {
  background: #0284c7;
  color: #ffffff;
}

[data-theme="light"] .im-chat-footer-notice {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .sidebar-sub-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

[data-theme="light"] .sidebar-sub-item.sub-item-active {
  background: #e0f2fe;
  color: #0284c7;
}

/* ==========================================================================
   SMS & MMS MONITORING DESIGN SYSTEM
   ========================================================================== */
.im-monitoring-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.im-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-radius: var(--radius-lg, 12px);
  flex-wrap: wrap;
  gap: 16px;
}

.im-app-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.im-app-badge-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.im-app-title {
  font-family: var(--font-heading, inherit);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main, #f8fafc);
}

.im-app-sub {
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.im-actions-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
}

.im-filter-pills {
  display: flex;
  background: var(--bg-secondary, #0f172a);
  border: 1px solid var(--border-subtle, #334155);
  border-radius: 8px;
  padding: 3px;
  gap: 4px;
}

.im-filter-btn {
  padding: 4px 12px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted, #94a3b8);
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.im-filter-btn:hover {
  color: var(--text-main, #f8fafc);
}

.im-filter-btn.active {
  background: var(--color-primary, #0284c7);
  color: #ffffff;
}

.im-chat-container {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
  min-height: 600px;
}

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

.im-threads-sidebar {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
  height: 650px;
}

.im-search-box {
  position: relative;
  padding: 12px;
  border-bottom: 1px solid var(--border-subtle, #334155);
  display: flex;
  align-items: center;
}

.im-search-box .search-icon {
  position: absolute;
  left: 22px;
  color: var(--text-muted, #94a3b8);
}

.im-search-input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  background: var(--bg-secondary, #0f172a);
  border: 1px solid var(--border-subtle, #334155);
  border-radius: 8px;
  color: var(--text-main, #f8fafc);
  font-size: 0.82rem;
  outline: none;
}

.im-search-input:focus {
  border-color: var(--color-primary, #0284c7);
}

.im-threads-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.im-thread-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.im-thread-card:hover {
  background: rgba(255, 255, 255, 0.04);
}

.im-thread-card.selected {
  background: rgba(2, 132, 199, 0.12);
  border-color: rgba(2, 132, 199, 0.35);
}

.im-thread-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bg-secondary, #1e293b);
  border: 1px solid var(--border-subtle, #334155);
  color: var(--color-primary, #38bdf8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.im-thread-info {
  flex: 1;
  min-width: 0;
}

.im-thread-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.im-thread-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main, #f8fafc);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.im-thread-time {
  font-size: 0.7rem;
  color: var(--text-muted, #94a3b8);
  flex-shrink: 0;
}

.im-thread-preview {
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mms-tag {
  color: #a855f7;
  font-weight: 700;
  font-size: 0.72rem;
}

.im-badge-count {
  background: #a855f7;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.im-conversation-pane {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
  height: 650px;
}

.im-conversation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle, #334155);
  background: rgba(15, 23, 42, 0.4);
}

.im-chat-partner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.im-partner-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #2563eb;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.82rem;
}

.im-partner-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main, #f8fafc);
}

.im-messages-scroller {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.im-bubble-row {
  display: flex;
  width: 100%;
}

.im-bubble-row.incoming {
  justify-content: flex-start;
}

.im-bubble-row.outgoing {
  justify-content: flex-end;
}

.im-bubble-container {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.im-bubble-row.incoming .im-bubble-container {
  background: var(--bg-secondary, #1e293b);
  border: 1px solid var(--border-subtle, #334155);
  color: var(--text-main, #f8fafc);
  border-bottom-left-radius: 2px;
}

.im-bubble-row.outgoing .im-bubble-container {
  background: #0284c7;
  color: #ffffff;
  border-bottom-right-radius: 2px;
}

.im-bubble-sender {
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.im-type-badge {
  background: rgba(0, 0, 0, 0.2);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--font-mono, monospace);
  font-size: 0.65rem;
}

.im-bubble-text {
  font-size: 0.86rem;
  line-height: 1.45;
  word-break: break-word;
}

.im-bubble-meta {
  font-size: 0.68rem;
  opacity: 0.75;
  display: flex;
  align-items: center;
  gap: 4px;
  align-self: flex-end;
}

.im-mms-attachment-card {
  margin: 4px 0 8px 0;
  border-radius: 8px;
  overflow: hidden;
  max-width: 280px;
}

.im-mms-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.im-mms-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  gap: 8px;
}

.im-empty-conversation {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px;
  text-align: center;
}

/* ==========================================================================
   PICTURES GALLERY DESIGN SYSTEM
   ========================================================================== */
.pictures-gallery-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pictures-header-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-radius: var(--radius-lg, 12px);
  flex-wrap: wrap;
  gap: 16px;
}

.pictures-title-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pictures-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.pictures-main-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main, #f8fafc);
}

.pictures-sub-meta {
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pictures-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-radius: var(--radius-md, 8px);
  flex-wrap: wrap;
  gap: 12px;
}

.pictures-filter-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle, #334155);
  background: var(--bg-secondary, #0f172a);
  color: var(--text-muted, #94a3b8);
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-pill-btn:hover {
  color: var(--text-main, #f8fafc);
  border-color: var(--border-hover, #475569);
}

.filter-pill-btn.active {
  background: var(--color-primary, #0284c7);
  border-color: var(--color-primary, #0284c7);
  color: #ffffff;
}

.pictures-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pictures-search-wrap .search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted, #94a3b8);
}

.pictures-search-input {
  padding: 6px 14px 6px 34px;
  background: var(--bg-secondary, #0f172a);
  border: 1px solid var(--border-subtle, #334155);
  border-radius: 6px;
  color: var(--text-main, #f8fafc);
  font-size: 0.82rem;
  outline: none;
  width: 240px;
}

.pictures-search-input:focus {
  border-color: var(--color-primary, #0284c7);
}

.pictures-masonry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.picture-card {
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
}

.picture-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  border-color: var(--color-primary, #0284c7);
}

.picture-thumbnail-container {
  position: relative;
  width: 100%;
  height: 140px;
  background: var(--bg-secondary, #0f172a);
  overflow: hidden;
}

.picture-visual-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
}

.picture-art-backdrop {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.95));
}

.picture-card-icon {
  color: var(--color-primary, #38bdf8);
  opacity: 0.4;
  transition: transform 0.2s ease;
}

.picture-card:hover .picture-card-icon {
  transform: scale(1.1);
  opacity: 0.7;
}

.picture-hover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(2, 132, 199, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.picture-card:hover .picture-hover-overlay {
  opacity: 1;
}

.overlay-icon {
  color: #ffffff;
}

.picture-ext-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #38bdf8;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.picture-card-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.picture-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main, #f8fafc);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.picture-meta-row {
  font-size: 0.7rem;
  color: var(--text-muted, #94a3b8);
  display: flex;
  align-items: center;
  gap: 6px;
}

.picture-path-pill {
  font-size: 0.65rem;
  font-family: var(--font-mono, monospace);
  color: var(--text-dim, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* Lightbox Modal */
.photo-lightbox-modal {
  width: 900px;
  max-width: 95vw;
  max-height: 90vh;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lightbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle, #334155);
}

.lightbox-title-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lightbox-filename {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main, #f8fafc);
}

.lightbox-content {
  display: grid;
  grid-template-columns: 1fr 300px;
  height: 520px;
}

@media (max-width: 768px) {
  .lightbox-content {
    grid-template-columns: 1fr;
    height: auto;
  }
}

.lightbox-preview-viewport {
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox-image-dummy {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.picture-real-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.picture-card:hover .picture-real-thumbnail {
  transform: scale(1.05);
}

.lightbox-image-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lightbox-real-photo {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
}

.lightbox-real-video {
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  background: #000000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  outline: none;
}

.picture-shimmer-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.9));
  animation: shimmerPulse 1.8s ease-in-out infinite;
}

@keyframes shimmerPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.95; }
}

.picture-shimmer-icon {
  color: var(--color-primary, #38bdf8);
  opacity: 0.45;
  animation: spinSlow 4s linear infinite;
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.lightbox-loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
  animation: fadeIn 0.3s ease;
}

.file-inspect-image-preview {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  border-radius: 6px;
  background: #000000;
  margin-bottom: 16px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.file-inspect-text-preview {
  max-height: 180px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.4);
  padding: 12px;
  border-radius: 6px;
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  color: var(--text-main, #f8fafc);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  margin-bottom: 16px;
  white-space: pre-wrap;
  word-break: break-all;
}

.lightbox-sidebar {
  padding: 20px;
  background: var(--bg-secondary, #0f172a);
  border-left: 1px solid var(--border-subtle, #334155);
  display: flex;
  flex-direction: column;
}

.lightbox-sec-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main, #f8fafc);
  margin-bottom: 14px;
}

.meta-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.76rem;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta-label {
  color: var(--text-muted, #94a3b8);
  font-size: 0.7rem;
}

.meta-val {
  color: var(--text-main, #f8fafc);
  word-break: break-all;
}

/* Media Vault (Photos & Videos Segmented Control) */
.media-type-segmented-control {
  display: flex;
  background: var(--bg-secondary, #0e1422);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  gap: 4px;
  width: fit-content;
  margin-bottom: 14px;
}

.media-seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 18px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  color: var(--text-muted, #94a3b8);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.media-seg-btn:hover {
  color: var(--text-main, #f8fafc);
  background: rgba(255, 255, 255, 0.04);
}

.media-seg-btn.active {
  background: var(--color-primary, #10b981);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

.video-play-center-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  border: 2px solid rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  backdrop-filter: blur(4px);
  transition: all 0.2s ease;
  pointer-events: none;
}

.picture-card:hover .video-play-center-btn {
  transform: translate(-50%, -50%) scale(1.15);
  background: var(--color-danger, #f43f5e);
  border-color: #ffffff;
}

.lightbox-real-video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
  outline: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   CALENDAR EVENTS DESIGN SYSTEM
   ========================================================================== */
.calendar-events-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.calendar-header-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-radius: var(--radius-lg, 12px);
  flex-wrap: wrap;
  gap: 16px;
}

.calendar-title-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.calendar-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.calendar-main-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main, #f8fafc);
}

.calendar-sub-meta {
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-radius: var(--radius-md, 8px);
  flex-wrap: wrap;
  gap: 12px;
}

.calendar-filters {
  display: flex;
  gap: 8px;
}

.calendar-filter-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle, #334155);
  background: var(--bg-secondary, #0f172a);
  color: var(--text-muted, #94a3b8);
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.calendar-filter-btn:hover {
  color: var(--text-main, #f8fafc);
}

.calendar-filter-btn.active {
  background: var(--color-primary, #0284c7);
  border-color: var(--color-primary, #0284c7);
  color: #ffffff;
}

.calendar-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.calendar-search-wrap .search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted, #94a3b8);
}

.calendar-search-input {
  padding: 6px 14px 6px 34px;
  background: var(--bg-secondary, #0f172a);
  border: 1px solid var(--border-subtle, #334155);
  border-radius: 6px;
  color: var(--text-main, #f8fafc);
  font-size: 0.82rem;
  outline: none;
  width: 260px;
}

.calendar-events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.calendar-card {
  padding: 16px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-left: 3px solid var(--color-primary, #0284c7);
}

.calendar-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calendar-date-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--color-primary, #38bdf8);
  font-weight: 600;
}

.calendar-time-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--text-muted, #94a3b8);
}

.calendar-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.calendar-event-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main, #f8fafc);
}

.calendar-event-desc {
  font-size: 0.8rem;
  color: var(--text-muted, #94a3b8);
  line-height: 1.4;
}

.calendar-event-location {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted, #94a3b8);
  margin-top: 4px;
}

.calendar-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle, #334155);
}

.status-indicator-badge {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
}

/* ==========================================================================
   WEB SAFETY & FILTERING ENHANCEMENTS
   ========================================================================== */
.web-safety-top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-radius: var(--radius-lg, 12px);
  flex-wrap: wrap;
  gap: 16px;
}

.web-title-cluster {
  display: flex;
  align-items: center;
  gap: 16px;
}

.web-badge-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.web-main-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main, #f8fafc);
}

.web-sub-meta {
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.web-tab-buttons {
  display: flex;
  gap: 8px;
}

.web-subtab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle, #334155);
  background: var(--bg-secondary, #0f172a);
  color: var(--text-muted, #94a3b8);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.web-subtab-btn:hover {
  color: var(--text-main, #f8fafc);
}

.web-subtab-btn.active {
  background: var(--color-primary, #0284c7);
  border-color: var(--color-primary, #0284c7);
  color: #ffffff;
}

.web-history-link {
  color: var(--color-primary, #38bdf8);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.web-history-link:hover {
  text-decoration: underline;
}

/* Light Theme Overrides for New Views */
[data-theme="light"] .im-header-bar,
[data-theme="light"] .pictures-header-card,
[data-theme="light"] .calendar-header-card,
[data-theme="light"] .web-safety-top-header,
[data-theme="light"] .pictures-toolbar,
[data-theme="light"] .calendar-toolbar {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .im-threads-sidebar,
[data-theme="light"] .im-conversation-pane,
[data-theme="light"] .picture-card,
[data-theme="light"] .calendar-card {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .im-filter-pills,
[data-theme="light"] .filter-pill-btn,
[data-theme="light"] .calendar-filter-btn,
[data-theme="light"] .web-subtab-btn {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #64748b;
}

[data-theme="light"] .im-search-input,
[data-theme="light"] .pictures-search-input,
[data-theme="light"] .calendar-search-input {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .im-thread-card:hover {
  background: #f8fafc;
}

[data-theme="light"] .im-thread-card.selected {
  background: #e0f2fe;
  border-color: #7dd3fc;
}

[data-theme="light"] .picture-art-backdrop {
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
}

[data-theme="light"] .picture-thumbnail-container {
  background: #f1f5f9;
}

[data-theme="light"] .lightbox-sidebar {
  background: #f8fafc;
  border-color: #e2e8f0;
}

/* ==========================================================================
   KEYSTROKES / KEYBOARD TYPING SURVEILLANCE
   ========================================================================== */
.keystrokes-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.keystrokes-header-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-radius: var(--radius-lg, 12px);
  flex-wrap: wrap;
  gap: 16px;
}

.keystrokes-title-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.keystrokes-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.keystrokes-main-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main, #f8fafc);
}

.keystrokes-sub-meta {
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.keystrokes-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-radius: var(--radius-md, 8px);
  flex-wrap: wrap;
  gap: 12px;
}

.keystrokes-filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.key-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle, #334155);
  background: var(--bg-secondary, #0f172a);
  color: var(--text-muted, #94a3b8);
  font-family: var(--font-mono, monospace);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.key-filter-btn:hover {
  color: var(--text-main, #f8fafc);
  border-color: var(--border-hover, #475569);
}

.key-filter-btn.active {
  background: var(--color-primary, #0284c7);
  border-color: var(--color-primary, #0284c7);
  color: #ffffff;
}

.keystrokes-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.keystrokes-search-wrap .search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted, #94a3b8);
}

.keystrokes-search-input {
  padding: 6px 14px 6px 34px;
  background: var(--bg-secondary, #0f172a);
  border: 1px solid var(--border-subtle, #334155);
  border-radius: 6px;
  color: var(--text-main, #f8fafc);
  font-size: 0.82rem;
  outline: none;
  width: 250px;
}

.keystrokes-search-input:focus {
  border-color: var(--color-primary, #0284c7);
}

.keystrokes-feed-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.keystroke-card {
  padding: 14px 18px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-left: 3px solid #f59e0b;
}

.keystroke-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.keystroke-app-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fbbf24;
}

.package-tag {
  opacity: 0.6;
  font-size: 0.7rem;
}

.keystroke-meta-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
}

.keystroke-len-pill {
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-muted, #94a3b8);
}

.keystroke-time-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted, #94a3b8);
}

.keystroke-text-body {
  background: rgba(0, 0, 0, 0.25);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle, #334155);
}

.keystroke-text-content {
  font-family: var(--font-mono, monospace);
  font-size: 0.88rem;
  color: var(--text-main, #f8fafc);
  line-height: 1.5;
  word-break: break-word;
}

/* Light Mode Overrides for Keystrokes */
[data-theme="light"] .keystrokes-header-card,
[data-theme="light"] .keystrokes-toolbar {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .key-filter-btn {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #64748b;
}

[data-theme="light"] .keystrokes-search-input {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .keystroke-card {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .keystroke-text-body {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .keystroke-text-content {
  color: #0f172a;
}

/* ==========================================================================
   COMMUNICATION & APPS SUB-TABS AND FILTER PILLS
   ========================================================================== */
.comm-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
  margin-bottom: 16px;
}

.comm-subtabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
}

.comm-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted, #94a3b8);
  font-family: var(--font-sans, inherit);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.comm-tab-btn:hover {
  color: var(--text-main, #f8fafc);
  background: rgba(255, 255, 255, 0.05);
}

.comm-tab-btn.active {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.4);
  color: #10b981;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.15);
}

.comm-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 14px 18px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.comm-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 240px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  border-radius: 8px;
  padding: 0 12px;
  transition: border-color 0.15s ease;
}

.comm-search-wrapper:focus-within {
  border-color: var(--color-primary, #10b981);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.comm-search-input {
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main, #f8fafc);
  font-size: 0.85rem;
}

.comm-search-input::placeholder {
  color: var(--text-dim, #64748b);
}

.comm-filter-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill,
.filter-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  background: rgba(15, 23, 42, 0.65);
  color: var(--text-muted, #94a3b8);
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
}

.filter-pill:hover,
.filter-pill-btn:hover {
  color: var(--text-main, #f8fafc);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
}

.filter-pill.active,
.filter-pill-btn.active {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.4);
  color: #10b981;
  box-shadow: 0 1px 8px rgba(16, 185, 129, 0.2);
}

.category-select-wrapper select.category-dropdown-select {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-main, #f8fafc);
  font-size: 0.8rem;
  cursor: pointer;
  outline: none;
}

/* Light Mode Overrides */
[data-theme="light"] .comm-subtabs {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

[data-theme="light"] .comm-tab-btn {
  color: #64748b;
}

[data-theme="light"] .comm-tab-btn:hover {
  color: #0f172a;
  background: #e2e8f0;
}

[data-theme="light"] .comm-tab-btn.active {
  background: #ffffff;
  border-color: #10b981;
  color: #059669;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .comm-filter-bar {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .comm-search-wrapper {
  background: #f8fafc;
  border-color: #cbd5e1;
}

[data-theme="light"] .comm-search-input {
  color: #0f172a;
}

[data-theme="light"] .filter-pill,
[data-theme="light"] .filter-pill-btn {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #64748b;
}

[data-theme="light"] .filter-pill:hover,
[data-theme="light"] .filter-pill-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

[data-theme="light"] .filter-pill.active,
[data-theme="light"] .filter-pill-btn.active {
  background: rgba(16, 185, 129, 0.12);
  border-color: #10b981;
  color: #047857;
}

[data-theme="light"] .category-select-wrapper select.category-dropdown-select {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

/* ==========================================================================
   AGENTIC AI GUARDIAN & CHILD REPORT VIEW STYLES
   ========================================================================== */

.telemetry-bar-pill-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.telemetry-pill-mono {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-md, 8px);
  background: var(--bg-card, #0f1728);
  border: 1px solid var(--border-subtle, #1c2638);
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  color: var(--text-main, #f1f5f9);
  letter-spacing: 0.03em;
}

.live-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-success, #10b981);
  box-shadow: 0 0 10px var(--color-success, #10b981);
  animation: pulse-beacon 2s infinite;
}

.pill-divider {
  color: var(--border-hover, #2e3e57);
}

.agent-report-content {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-subtle, #1c2638);
  border-radius: var(--radius-md, 8px);
  padding: 20px 24px;
}

[data-theme="light"] .agent-report-content {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .telemetry-pill-mono {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .live-pulse-dot {
  background-color: #059669;
  box-shadow: 0 0 8px #059669;
}

/* ==========================================================================
   WHATSAPP VIP SUPPORT WIDGET STYLING
   ========================================================================== */
.whatsapp-floating-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(37, 211, 102, 0.5), 0 4px 10px rgba(0, 0, 0, 0.4) !important;
}

.wa-action-btn:hover {
  background: rgba(37, 211, 102, 0.16) !important;
  border-color: rgba(37, 211, 102, 0.4) !important;
  transform: translateX(3px);
}

/* ==========================================================================
   OFFICIAL CLINICAL & FORENSIC PEDIATRIC WELLNESS REPORT - PRINT STYLES
   ========================================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 10mm 12mm 10mm 12mm;
  }

  /* Hide all dashboard chrome: sidebars, navbar, action buttons, modals, floaters */
  nav,
  aside,
  header,
  .portal-sidebar,
  .top-telemetry-bar,
  .telemetry-bar-pill-strip,
  .whatsapp-widget-container,
  .no-print,
  button,
  .btn,
  .modal-backdrop,
  .tab-pane > *:not(.agent-report-view) {
    display: none !important;
  }

  /* Reset body and container to clean white paper layout */
  body, html, #root, .portal-layout, .portal-main, .portal-content {
    background: #ffffff !important;
    color: #0f172a !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    min-height: auto !important;
    font-size: 9pt !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Hide screen-only interactive cards */
  .agent-report-view > *:not(.printable-report-only) {
    display: none !important;
  }

  /* Show the dedicated printable executive report */
  .printable-report-only {
    display: block !important;
    background: #ffffff !important;
    color: #0f172a !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Multi-Page Report Containers */
  .report-page {
    width: 100% !important;
    box-sizing: border-box !important;
    position: relative !important;
    background: #ffffff !important;
    padding: 10mm 14mm 10mm 14mm !important;
  }

  .report-page-1 {
    page-break-after: always !important;
    break-after: page !important;
    margin-bottom: 0 !important;
  }

  .report-page-2 {
    page-break-before: always !important;
    break-before: page !important;
    page-break-inside: avoid !important;
    padding: 10mm 14mm 10mm 14mm !important;
  }

  .print-page-break {
    page-break-after: always !important;
    break-after: page !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
  }

  /* Typography & Table hygiene in print */
  .printable-report-only h1, 
  .printable-report-only h2, 
  .printable-report-only h3, 
  .printable-report-only h4 {
    color: #0f172a !important;
    page-break-after: avoid !important;
  }

  .printable-report-only table {
    border-collapse: collapse !important;
    width: 100% !important;
  }

  .printable-report-only td,
  .printable-report-only th {
    color: #0f172a !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* Child Avatar Presentation in Dashboard Top Bar & Profile */
.child-avatar-header-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.child-avatar-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
}

.top-child-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #1e293b;
}

.child-avatar-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--bg-secondary, #0f172a);
}

.child-avatar-status.online {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.child-avatar-status.standby {
  background: #94a3b8;
}

.profile-monogram-badge.child-avatar-main-badge {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  border: 2.5px solid #10b981;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.25);
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.child-main-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.kg-marker-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}





