/* ============================================================
   SAMARITANUS · Dispecerat de Monitorizare la Domiciliu
   Tema: "MISSION CONTROL" — deep navy + cyan + holographic
   Inspirație: NASA JSC, SpaceX Dragon, Lockheed Skunk Works
   ============================================================ */

:root{
  /* Brand Samaritanus */
  --sam-red:        #ff4d57;
  --sam-red-deep:   #d8232a;
  --sam-yellow:     #ffd23f;
  --sam-amber:      #ffa726;

  /* Mission Control palette — navy with cyan glow */
  --bg-0: #0a1530;
  --bg-1: #0e1c40;
  --bg-2: #142654;
  --bg-3: #1b3068;
  --bg-4: #233d80;
  --bg-5: #2c4a96;

  /* Accents */
  --cyan:        #00e0ff;
  --cyan-soft:   #5ce8ff;
  --cyan-deep:   #007aa3;
  --teal:        #00c8a8;
  --violet:      #8a7bff;
  --gold:        #ffd23f;

  /* Lines & glows */
  --line-1: rgba(120,180,255,0.10);
  --line-2: rgba(120,200,255,0.22);
  --line-3: rgba(140,220,255,0.38);
  --glow-cyan:  0 0 18px rgba(0,224,255,0.35);
  --glow-cyan2: 0 0 0 1px rgba(0,224,255,0.45), 0 0 22px rgba(0,224,255,0.25);
  --glow-red:   0 0 0 1px rgba(255,77,87,0.55), 0 0 28px rgba(255,77,87,0.35);
  --glow-gold:  0 0 0 1px rgba(255,210,63,0.45), 0 0 22px rgba(255,210,63,0.25);

  /* Text */
  --t-1: #f0f7ff;
  --t-2: #b8cdec;
  --t-3: #7d97c4;
  --t-mute: #56709c;

  /* Severity */
  --sev-red:    #ff4d57;
  --sev-orange: #ff9430;
  --sev-yellow: #ffd23f;
  --sev-green:  #2cf3a0;
  --sev-blue:   #5ce8ff;
  --sev-grey:   #7d97c4;

  --radius: 10px;
  --radius-sm: 6px;
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

*{ box-sizing: border-box; }

html, body{
  margin:0; padding:0; height:100%;
  color: var(--t-1);
  font-family: var(--sans);
  font-size: 14px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(0,180,255,0.18) 0%, transparent 55%),
    radial-gradient(1000px 600px at 110% 110%, rgba(138,123,255,0.16) 0%, transparent 60%),
    radial-gradient(700px 500px at 50% 50%, rgba(0,224,255,0.05) 0%, transparent 70%),
    linear-gradient(180deg, #0c1a3c 0%, #081231 60%, #050d24 100%);
}
body::before{
  content:"";
  position: fixed; inset:0; pointer-events:none; z-index:0;
  background-image:
    linear-gradient(rgba(120,200,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120,200,255,0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 30%, rgba(0,0,0,0.2) 90%);
}
body::after{
  content:"";
  position: fixed; inset:0; pointer-events:none; z-index:0;
  background:
    radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,0.45) 50%, transparent 60%),
    radial-gradient(1.5px 1.5px at 70% 20%, rgba(255,255,255,0.4) 50%, transparent 60%),
    radial-gradient(1.5px 1.5px at 85% 70%, rgba(255,255,255,0.35) 50%, transparent 60%),
    radial-gradient(2px 2px at 30% 80%, rgba(255,255,255,0.3) 50%, transparent 60%),
    radial-gradient(1px 1px at 50% 40%, rgba(255,255,255,0.5) 50%, transparent 60%),
    radial-gradient(1.5px 1.5px at 10% 60%, rgba(255,255,255,0.35) 50%, transparent 60%);
  opacity: .6;
}
.app-shell, .launcher-wrap{ position:relative; z-index:1; }

/* ============================================================ LAUNCHER */
.launcher-body{ overflow:auto; }
.launcher-wrap{
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  padding: 40px 24px;
}
.launcher-card{
  width: min(1100px, 100%);
  background: linear-gradient(180deg, rgba(28,60,130,0.55), rgba(14,28,64,0.65));
  border: 1px solid var(--line-2);
  border-radius: 18px;
  padding: 36px 40px;
  box-shadow:
    0 30px 80px rgba(0,40,90,.6),
    inset 0 1px 0 rgba(180,220,255,.08),
    var(--glow-cyan);
  backdrop-filter: blur(12px) saturate(140%);
}
.brand-block{ display:flex; gap:22px; align-items:center; margin-bottom: 26px; }
.brand-logo-xl{
  width:96px; height:96px; border-radius:14px; object-fit:cover;
  box-shadow: 0 10px 32px rgba(216,35,42,.45), 0 0 0 1px rgba(0,224,255,0.3), var(--glow-cyan);
}
.brand-name{
  font-size: 34px; font-weight: 800; letter-spacing: 5px; color: var(--t-1);
  text-shadow: 0 0 22px rgba(0,224,255,.45);
}
.brand-sub{ font-size: 15px; color: var(--cyan-soft); margin-top:2px; letter-spacing: 1.5px; }
.brand-tag{ font-size: 12px; color: var(--gold); margin-top:8px;
  font-family: var(--mono); letter-spacing: 2px; text-transform: uppercase; }

.launcher-status{
  display:inline-flex; align-items:center; gap:10px;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(44,243,160,.10); border: 1px solid rgba(44,243,160,.35);
  color: var(--sev-green); font-family: var(--mono); font-size:12px;
  margin-bottom: 26px;
  box-shadow: 0 0 18px rgba(44,243,160,.15);
}
.dot-sep{ color: var(--t-mute); }

.launcher-grid{ display:grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 20px; }
.launcher-grid-3{ grid-template-columns: 1fr 1fr 1fr; }
.launcher-tile{
  background: linear-gradient(180deg, rgba(35,61,128,0.6), rgba(20,38,84,0.5));
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 22px;
  display:flex; flex-direction:column; min-height: 320px;
  position: relative; overflow: hidden;
}
.launcher-tile::before{
  content:""; position:absolute; inset:0;
  background: radial-gradient(400px 200px at 100% 0%, rgba(0,224,255,0.10), transparent 70%);
  pointer-events:none;
}
.tile-icon{ font-size: 28px; margin-bottom: 8px; filter: drop-shadow(0 0 10px rgba(0,224,255,0.5)); }
.tile-title{ font-size: 18px; font-weight: 800; letter-spacing: 3px; color: var(--t-1); }
.tile-sub{ font-size: 12px; color: var(--cyan-soft); margin-bottom: 14px; letter-spacing: 1.5px; }
.tile-list{ list-style:none; padding:0; margin: 6px 0 18px; flex:1; }
.tile-list li{ padding: 6px 0; color: var(--t-2); border-bottom: 1px dashed var(--line-1); font-size: 13px; }
.tile-list li::before{ content:"›"; color: var(--cyan); margin-right:8px; }

.launcher-actions{ display:flex; align-items:center; gap:16px; padding: 12px 0; flex-wrap:wrap; }
.launcher-actions .hint{ color: var(--t-3); font-size: 12px; }
.launcher-footer{
  display:flex; gap: 28px; padding-top: 18px; border-top: 1px solid var(--line-1);
  color: var(--t-3); font-size: 12px; font-family: var(--mono);
}
.launcher-footer b{ color: var(--t-2); font-weight: 600; }

/* Buttons */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding: 10px 16px; border-radius: 8px; border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(35,61,128,0.6), rgba(20,38,84,0.6));
  color: var(--t-1); font-weight: 600; font-size: 13px;
  cursor: pointer; letter-spacing: .5px; transition: all .15s ease;
  backdrop-filter: blur(6px);
}
.btn:hover{ border-color: var(--cyan); transform: translateY(-1px); box-shadow: var(--glow-cyan); }
.btn-primary{
  background: linear-gradient(180deg, var(--sam-red), var(--sam-red-deep));
  border-color: rgba(255,255,255,.15);
  box-shadow: 0 8px 26px rgba(255,77,87,.45);
  color: white;
}
.btn-primary:hover{ filter: brightness(1.1); box-shadow: 0 10px 30px rgba(255,77,87,.6); }
.btn-accent{
  background: linear-gradient(180deg, #ffe066, #ffb300);
  color: #1a1300; border-color: rgba(0,0,0,.2);
  box-shadow: 0 8px 24px rgba(255,210,63,.35);
}
.btn-ghost{ background: transparent; }
.btn-danger{ background: linear-gradient(180deg, #ff5a64, #c81720); border-color: rgba(0,0,0,.2); color:white; }
.btn-success{ background: linear-gradient(180deg, #44ffb0, #14b577); color:#02160c; border-color: transparent; font-weight:700; }
.btn-warning{ background: linear-gradient(180deg, #ffaa3d, #d97400); color:#1e1000; border-color: transparent; font-weight:700; }
.btn-blue{ background: linear-gradient(180deg, #2ec1ff, #0078d4); border-color: transparent; color:white; }
.btn-cyan{ background: linear-gradient(180deg, #46f0ff, #00a8c8); border-color: transparent; color:#022; font-weight:700; }

.btn-sm{ padding: 6px 10px; font-size: 12px; }
.btn-xs{ padding: 3px 8px; font-size: 11px; border-radius:5px; }

/* ============================================================ SHELL */
.app-shell{
  display: grid;
  grid-template-rows: 48px 1fr 28px;
  height: 100vh;
}

.topbar{
  display:flex; align-items:center; gap: 14px;
  padding: 0 16px;
  background: linear-gradient(180deg, rgba(28,60,130,0.75), rgba(14,28,64,0.65));
  border-bottom: 1px solid var(--line-2);
  box-shadow: 0 1px 0 rgba(0,224,255,0.12), 0 8px 30px rgba(0,30,80,0.5);
  backdrop-filter: blur(8px);
  position: relative;
}
.topbar::after{
  content:""; position:absolute; left:0; right:0; bottom:-1px; height:1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity:.5;
}
.topbar .brand{ display:flex; align-items:center; gap:10px; }
.topbar .brand img{ width: 30px; height:30px; border-radius:6px;
  box-shadow: 0 0 0 1px rgba(0,224,255,.4), 0 0 14px rgba(0,224,255,.25); }
.topbar .brand-title{ font-weight:800; letter-spacing: 4px; font-size: 14px;
  text-shadow: 0 0 14px rgba(0,224,255,.45); }
.topbar .brand-sub{ color: var(--cyan-soft); font-size:11px; letter-spacing:1.8px; }
.topbar .sep{ width:1px; height:22px; background: var(--line-2); }
.topbar .pill{
  display:inline-flex; align-items:center; gap:6px;
  background: rgba(0,224,255,0.06);
  border:1px solid rgba(0,224,255,0.25);
  padding: 4px 10px; border-radius: 999px;
  font-family: var(--mono); font-size:11px;
  color: var(--cyan-soft);
}
.topbar .grow{ flex:1; }
.topbar .clock{ font-family: var(--mono); color: var(--cyan-soft); font-weight:600;
  text-shadow: 0 0 8px rgba(0,224,255,.3); letter-spacing:1px; }
.topbar .opname{ color: var(--t-2); font-size: 12px; }
.topbar .opname b{ color: var(--t-1); }

.dot{ width:9px; height:9px; border-radius:50%; display:inline-block; }
.dot-red{ background: var(--sev-red); box-shadow: 0 0 12px var(--sev-red); }
.dot-orange{ background: var(--sev-orange); box-shadow: 0 0 10px var(--sev-orange); }
.dot-yellow{ background: var(--sev-yellow); box-shadow: 0 0 10px var(--sev-yellow); }
.dot-green{ background: var(--sev-green); box-shadow: 0 0 10px var(--sev-green); }
.dot-blue{ background: var(--sev-blue); box-shadow: 0 0 10px var(--sev-blue); }
.dot-grey{ background: var(--sev-grey); }
.pulse-green{ background: var(--sev-green);
  animation: pulseG 1.6s infinite;
  box-shadow: 0 0 0 0 rgba(44,243,160,.7); }
@keyframes pulseG{
  0%{ box-shadow: 0 0 0 0 rgba(44,243,160,.5), 0 0 10px var(--sev-green); }
  70%{ box-shadow: 0 0 0 12px rgba(44,243,160,0), 0 0 10px var(--sev-green); }
  100%{ box-shadow: 0 0 0 0 rgba(44,243,160,0), 0 0 10px var(--sev-green); }
}

.sev-chip{
  display:inline-flex; align-items:center; gap:6px;
  padding: 2px 9px; border-radius: 999px;
  font-family: var(--mono); font-size:11px; letter-spacing: 1px;
  border:1px solid var(--line-2);
}
.sev-red    { background: rgba(255,77,87,.15);  color: #ffb3b8; border-color: rgba(255,77,87,.45); }
.sev-orange { background: rgba(255,148,48,.15); color: #ffd4a3; border-color: rgba(255,148,48,.45); }
.sev-yellow { background: rgba(255,210,63,.15); color: #ffe88c; border-color: rgba(255,210,63,.45); }
.sev-green  { background: rgba(44,243,160,.15); color: #93f9cd; border-color: rgba(44,243,160,.45); }
.sev-blue   { background: rgba(92,232,255,.15); color: #b8f1ff; border-color: rgba(92,232,255,.45); }

.statusbar{
  display:flex; align-items:center; gap:14px;
  padding: 0 14px;
  background: linear-gradient(180deg, rgba(14,28,64,0.6), rgba(10,21,48,0.85));
  border-top: 1px solid var(--line-2);
  font-family: var(--mono); font-size: 11px; color: var(--t-3);
  position: relative;
}
.statusbar::before{
  content:""; position:absolute; left:0; right:0; top:-1px; height:1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity:.4;
}
.statusbar .grow{ flex:1; }

/* Panels */
.panel{
  background: linear-gradient(180deg, rgba(35,61,128,0.32), rgba(14,28,64,0.42));
  border:1px solid var(--line-2);
  border-radius: var(--radius);
  display:flex; flex-direction:column; min-height: 0;
  backdrop-filter: blur(8px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(180,220,255,0.06), 0 6px 20px rgba(0,20,60,0.35);
  position: relative; overflow: hidden;
}
.panel::before{
  content:""; position: absolute; inset:0; pointer-events:none;
  background: radial-gradient(600px 240px at -10% -10%, rgba(0,224,255,0.08), transparent 60%);
}
.panel-h{
  display:flex; align-items:center; gap: 10px;
  padding: 9px 12px;
  background: linear-gradient(180deg, rgba(44,74,150,0.55), rgba(20,38,84,0.45));
  border-bottom: 1px solid var(--line-2);
  position: relative;
}
.panel-h::after{
  content:""; position:absolute; left:0; right:0; bottom:-1px; height:1px;
  background: linear-gradient(90deg, transparent 5%, rgba(0,224,255,0.55) 50%, transparent 95%);
}
.panel-h .title{ font-weight: 700; letter-spacing: 2.5px; font-size: 11px; color: var(--cyan-soft);
  text-shadow: 0 0 8px rgba(0,224,255,0.25); }
.panel-h .badge{
  background: rgba(0,224,255,0.10); padding: 2px 8px; border-radius:999px;
  font-family: var(--mono); font-size: 10px; color: var(--cyan-soft);
  border:1px solid rgba(0,224,255,0.3);
}
.panel-h .spacer{ flex:1; }
.panel-h .corner{ font-family: var(--mono); color: var(--t-mute); font-size:10px; letter-spacing: 1px; }
.panel-b{ flex:1; min-height: 0; overflow:auto; padding: 10px 12px; position: relative; z-index:1; }

/* ============================================================ MONITOR 1 */
.m1-grid{
  display:grid;
  grid-template-columns: 1.05fr 1.4fr 1.05fr;
  grid-template-rows: minmax(0,1fr) 220px;
  gap: 10px;
  padding: 10px;
  min-height:0;
}
.m1-queue   { grid-column: 1; grid-row: 1; }
.m1-map     { grid-column: 2; grid-row: 1; }
.m1-patients{ grid-column: 3; grid-row: 1; }
.m1-stats   { grid-column: 1; grid-row: 2; }
.m1-feed    { grid-column: 2 / span 2; grid-row: 2; }

/* ---- Rutină zilnică (wellness monitor) ---- */
.rt-toolbar{
  display:flex; align-items:center; gap:14px;
  padding:4px 2px 8px; border-bottom:1px solid rgba(255,255,255,.05);
  margin-bottom:8px;
}
.rt-legend{
  display:inline-flex; align-items:center; gap:6px;
  font-family: var(--mono); font-size:10px;
  color: var(--t-2); letter-spacing:.5px;
}
.rt-cell{
  width:14px; height:14px; border-radius:3px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  display:inline-block;
}
.rt-cell.done{    background: rgba(60,210,140,.6); border-color: rgba(60,210,140,.9); }
.rt-cell.pending{ background: rgba(255,200,80,.5); border-color: rgba(255,200,80,.9); animation: rtPulse 1.6s infinite; }
.rt-cell.missed{  background: rgba(255,80,80,.6);  border-color: rgba(255,80,80,1); }
.rt-cell.upcoming{background: rgba(255,255,255,.03); border-color: rgba(255,255,255,.08); }
.rt-cell.crit{    background: rgba(255,80,80,.25); border-color: rgba(255,80,80,.7); border-style:dashed; }

@keyframes rtPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,200,80,.5); }
  50%     { box-shadow: 0 0 0 4px rgba(255,200,80,0); }
}

.rt-grid{
  display:grid;
  grid-template-columns: 200px 60px 1fr 70px 80px;
  row-gap: 4px;
  font-family: var(--mono);
  font-size: 11px;
}
.rt-grid .rt-head{
  font-size:10px; letter-spacing:1.2px;
  color: var(--t-mute); padding:4px 6px;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.rt-row{
  display:contents;
}
.rt-row > div{
  padding:6px 6px;
  border-bottom:1px solid rgba(255,255,255,.04);
  display:flex; align-items:center;
}
.rt-row:hover > div{
  background: rgba(0,224,255,.04);
}
.rt-row .rt-pname{
  color: var(--t-1); font-weight:600;
  display:flex; flex-direction:column; gap:2px;
}
.rt-row .rt-pname small{
  font-weight:400; color: var(--t-mute);
  font-size: 9px; letter-spacing:.5px; text-transform:uppercase;
}
.rt-row .rt-score{
  font-weight:700; font-size:13px;
}
.rt-row .rt-score.ok    { color: var(--sev-green); }
.rt-row .rt-score.warn  { color: var(--sev-yellow); }
.rt-row .rt-score.alert { color: var(--sev-red); text-shadow: 0 0 8px rgba(255,80,80,.5); }

.rt-timeline{
  display:flex; gap:2px; flex:1;
  position:relative;
}
.rt-act{
  flex:1; min-width: 0;
  height: 26px;
  border-radius:3px;
  border:1px solid rgba(255,255,255,.08);
  display:flex; align-items:center; justify-content:center;
  font-size:11px; cursor:pointer;
  position:relative;
  transition: transform .15s ease, box-shadow .15s ease;
}
.rt-act:hover{
  transform: scale(1.15);
  z-index:5;
  box-shadow: 0 0 0 1px rgba(0,224,255,.6), 0 4px 12px rgba(0,224,255,.3);
}
.rt-act.done    { background: rgba(60,210,140,.25); border-color: rgba(60,210,140,.8); }
.rt-act.pending { background: rgba(255,200,80,.25); border-color: rgba(255,200,80,.9); animation: rtPulse 1.6s infinite; }
.rt-act.missed  { background: rgba(255,80,80,.3);   border-color: rgba(255,80,80,1); }
.rt-act.upcoming{ background: rgba(255,255,255,.02); border-color: rgba(255,255,255,.08); opacity:.55; }
.rt-act.critical{ box-shadow: inset 0 0 0 1px rgba(255,80,80,.5); }
.rt-act.missed.critical{
  animation: rtCritFlash 1.2s infinite;
}
@keyframes rtCritFlash{
  0%,100% { box-shadow: 0 0 0 1px rgba(255,80,80,1), 0 0 8px rgba(255,80,80,.6); }
  50%     { box-shadow: 0 0 0 2px rgba(255,80,80,1), 0 0 16px rgba(255,80,80,1); }
}
.rt-act .rt-tip{
  position:absolute; bottom:calc(100% + 6px); left:50%;
  transform: translateX(-50%);
  background: #0a1722; color: #d8eaf2;
  border:1px solid rgba(0,224,255,.4);
  padding: 6px 8px; border-radius:6px;
  font-size:11px; white-space:nowrap;
  opacity:0; pointer-events:none;
  transition: opacity .15s;
  z-index: 10;
  box-shadow: 0 6px 20px rgba(0,0,0,.7);
}
.rt-act:hover .rt-tip{ opacity:1; }
.rt-tip b{ color: #00e0ff; }

.rt-row .rt-profile{
  font-size:10px; color: var(--t-mute);
  letter-spacing:.3px;
}
.rt-row .rt-voice{
  font-size:10px; color: var(--accent-cyan, #00e0ff);
}
.rt-row .rt-voice::before{ content:"🎙 "; }

.rt-alerts{
  margin-top: 10px;
  display:flex; flex-direction:column; gap: 6px;
}
.rt-alert{
  display:flex; align-items:center; gap:10px;
  padding: 8px 10px; border-radius:6px;
  background: rgba(255,80,80,.08);
  border:1px solid rgba(255,80,80,.4);
  font-size:12px;
  animation: rtPulseBg 2s infinite;
}
.rt-alert.warn{
  background: rgba(255,200,80,.08);
  border-color: rgba(255,200,80,.4);
  animation: none;
}
@keyframes rtPulseBg{
  0%,100% { background: rgba(255,80,80,.08); }
  50%     { background: rgba(255,80,80,.18); }
}
.rt-alert .rt-alert-icon{ font-size:18px; }
.rt-alert .rt-alert-action{
  margin-left:auto;
  background: rgba(0,224,255,.12);
  border:1px solid rgba(0,224,255,.5);
  color: #d8eaf2;
  padding:4px 10px; border-radius:4px;
  cursor:pointer; font-family: var(--mono);
  font-size:11px;
}
.rt-alert .rt-alert-action:hover{ background: rgba(0,224,255,.22); }

/* ---- Wellness mini-bar pe card-ul de abonat ---- */
.pat-wellness{
  display:flex; align-items:center; gap:4px;
  margin-top: 4px;
  font-family: var(--mono); font-size:10px;
}
.pat-wellness .pw-pct{
  font-weight:700; min-width: 28px;
}
.pat-wellness .pw-pct.ok    { color: var(--sev-green); }
.pat-wellness .pw-pct.warn  { color: var(--sev-yellow); }
.pat-wellness .pw-pct.alert { color: var(--sev-red); }
.pat-wellness .pw-dots{
  display:flex; gap:1px;
}
.pat-wellness .pw-dot{
  width:6px; height:6px; border-radius:1px;
  background: rgba(255,255,255,.08);
}
.pat-wellness .pw-dot.done    { background: var(--sev-green); }
.pat-wellness .pw-dot.pending { background: var(--sev-yellow); }
.pat-wellness .pw-dot.missed  { background: var(--sev-red); }

/* ============================================================ MONITOR 3 — WELLNESS */
.m3-grid{
  display:grid;
  grid-template-columns: 250px 1fr 360px;
  grid-template-rows: minmax(0,1fr);
  gap: 10px;
  padding: 10px;
  min-height: 0;
}
.m3-filters  { grid-column: 1; }
.m3-routine  { grid-column: 2; }
.m3-alerts   { grid-column: 3; }

.m3-grid-content{
  /* timeline mai aerisit decât în M1 */
  grid-template-columns: 220px 70px 1fr 90px 120px;
  row-gap: 6px;
}

/* Timeline extins (X = expanded) cu emoji + oră vizibilă */
.rt-timeline-x{
  display:flex; gap:3px;
  align-items:stretch;
  min-height: 44px;
}
.rt-timeline-x .rt-act{
  flex:1; min-width: 0;
  height: 44px;
  border-radius: 5px;
  flex-direction: column;
  gap: 1px;
  padding: 4px 2px;
}
.rt-timeline-x .rt-act-emoji{
  font-size: 15px;
  line-height: 1;
}
.rt-timeline-x .rt-act-time{
  font-size: 8.5px;
  letter-spacing: .3px;
  color: rgba(255,255,255,.65);
  font-family: var(--mono);
}
.rt-timeline-x .rt-act.upcoming .rt-act-time{ color: rgba(255,255,255,.35); }

.m3-grid-content .rt-row > div{
  padding: 8px 8px;
}
.m3-grid-content .rt-row .rt-pname{ font-size:12px; }
.m3-grid-content .rt-row .rt-pname small{ font-size:9.5px; }
.m3-grid-content .rt-score{ font-size:15px; }

select.search-input{
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, rgba(0,224,255,.6) 50%),
                    linear-gradient(135deg, rgba(0,224,255,.6) 50%, transparent 50%);
  background-position: calc(100% - 16px) center, calc(100% - 10px) center;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 28px;
}
select.search-input option{ background:#0a1722; color:#d8eaf2; }

/* ============================================================ M3 CARDS */
.m3-cards{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 14px;
  padding: 4px 2px;
}
.m3-card{
  background: linear-gradient(180deg, rgba(20,36,68,.85), rgba(10,20,40,.75));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 14px;
  position: relative;
  display: flex; flex-direction: column;
  gap: 12px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  overflow: hidden;
}
.m3-card::before{
  content:""; position:absolute; left:0; top:0; bottom:0; width:4px;
}
.m3-card--ok::before    { background: linear-gradient(180deg, var(--sev-green), transparent); }
.m3-card--warn::before  { background: linear-gradient(180deg, var(--sev-yellow), transparent); }
.m3-card--alert::before { background: linear-gradient(180deg, var(--sev-red), transparent);
  box-shadow: 0 0 18px rgba(255,80,80,.5); animation: cardAlertPulse 2s infinite; }
@keyframes cardAlertPulse{
  0%,100% { box-shadow: 0 0 12px rgba(255,80,80,.4); }
  50%     { box-shadow: 0 0 22px rgba(255,80,80,.8); }
}
.m3-card:hover{
  transform: translateY(-2px);
  border-color: rgba(0,224,255,.35);
  box-shadow: 0 8px 24px rgba(0,30,80,.5), 0 0 0 1px rgba(0,224,255,.2);
}
.m3-card--alert{
  border-color: rgba(255,80,80,.4);
  background: linear-gradient(180deg, rgba(60,20,28,.85), rgba(30,12,18,.75));
}

/* ---- Header ---- */
.m3-card-head{
  display:grid;
  grid-template-columns: 56px 1fr 78px;
  gap: 12px;
  align-items: center;
}
.m3-avatar{
  width: 56px; height: 56px; border-radius: 50%;
  display:flex; align-items:center; justify-content:center;
  font-weight: 700; font-size: 18px; color: #fff;
  position: relative;
  box-shadow: 0 4px 14px rgba(0,0,0,.4), inset 0 0 0 2px rgba(255,255,255,.1);
  font-family: var(--sans, system-ui);
  letter-spacing: .5px;
}
.m3-avatar-badge{
  position: absolute; bottom: -2px; right: -4px;
  background: #0a1722;
  border: 2px solid rgba(0,224,255,.5);
  width: 24px; height: 24px; border-radius: 50%;
  display:flex; align-items:center; justify-content:center;
  font-size: 13px;
}
.m3-card-id{ min-width: 0; }
.m3-card-name{
  font-weight: 700; font-size: 15px; color: var(--t-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.m3-card-sub{
  display:flex; align-items:center; gap:6px;
  margin-top: 3px;
  font-size: 11px; color: var(--t-2);
}
.m3-pill{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  padding: 1px 7px; border-radius: 8px;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: .5px;
}
.m3-pill--red    { color: var(--sev-red); border-color: rgba(255,80,80,.4); }
.m3-pill--orange { color: var(--sev-orange); border-color: rgba(255,148,48,.4); }
.m3-pill--yellow { color: var(--sev-yellow); border-color: rgba(255,210,63,.4); }
.m3-pill--green  { color: var(--sev-green); border-color: rgba(60,210,140,.4); }
.m3-pill--grey   { color: var(--t-mute); }
.m3-card-diag{
  font-size: 11px; color: var(--t-mute);
  margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Score ring */
.m3-card-score{
  position: relative;
  width: 78px; height: 78px;
  display:flex; align-items:center; justify-content:center;
  flex-direction: column;
}
.m3-ring{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.m3-score-pct{
  font-weight: 700; font-size: 22px;
  font-family: var(--mono);
  line-height: 1;
}
.m3-score-pct span{ font-size: 11px; opacity: .8; }
.m3-score-lbl{
  font-size: 9px; color: var(--t-mute);
  letter-spacing: 1.5px; text-transform: uppercase;
  margin-top: 2px;
}

/* ---- Timeline ---- */
.m3-card-timeline{
  background: rgba(0,0,0,.2);
  border-radius: 8px;
  padding: 10px 10px 8px;
  border: 1px solid rgba(255,255,255,.04);
}
.m3-timeline-strip{
  display: flex;
  gap: 3px;
  margin-bottom: 8px;
}
.m3-dot{
  flex: 1; min-width: 0;
  height: 38px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,.08);
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  gap: 1px;
  cursor:pointer;
  transition: transform .15s ease, box-shadow .15s ease, z-index 0s;
  position: relative;
}
.m3-dot:hover{
  transform: scale(1.18);
  z-index: 5;
  box-shadow: 0 0 0 1px rgba(0,224,255,.6), 0 6px 14px rgba(0,224,255,.35);
}
.m3-dot-emoji{ font-size: 13px; line-height: 1; }
.m3-dot-time{
  font-size: 8px; font-family: var(--mono);
  color: rgba(255,255,255,.55);
  letter-spacing: .2px;
}
.m3-dot--done{
  background: rgba(60,210,140,.22);
  border-color: rgba(60,210,140,.7);
}
.m3-dot--pending{
  background: rgba(255,200,80,.22);
  border-color: rgba(255,200,80,.85);
  animation: rtPulse 1.6s infinite;
}
.m3-dot--missed{
  background: rgba(255,80,80,.28);
  border-color: rgba(255,80,80,1);
}
.m3-dot--upcoming{
  background: rgba(255,255,255,.025);
  border-color: rgba(255,255,255,.07);
  opacity: .55;
}
.m3-dot--upcoming .m3-dot-time{ color: rgba(255,255,255,.3); }
.m3-dot.is-crit{ box-shadow: inset 0 0 0 1.5px rgba(255,80,80,.55); }
.m3-dot--missed.is-crit{ animation: rtCritFlash 1.2s infinite; }

.m3-timeline-meta{
  display:flex; gap:6px; flex-wrap: wrap;
}
.m3-meta-chip{
  font-family: var(--mono); font-size: 10px;
  padding: 2px 7px; border-radius: 4px;
  letter-spacing: .3px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
}
.m3-meta-chip.ok    { color: var(--sev-green); border-color: rgba(60,210,140,.3); }
.m3-meta-chip.warn  { color: var(--sev-yellow); border-color: rgba(255,210,63,.3); }
.m3-meta-chip.alert { color: var(--sev-red); border-color: rgba(255,80,80,.4); background: rgba(255,80,80,.05); }
.m3-meta-chip.muted { color: var(--t-mute); }

/* ---- Voce familie ---- */
.m3-card-voice{
  display:grid;
  grid-template-columns: 40px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: linear-gradient(180deg, rgba(0,80,140,.18), rgba(0,40,80,.12));
  border-radius: 8px;
  border: 1px solid rgba(0,224,255,.18);
}
.m3-voice-avatar{
  width: 40px; height: 40px; border-radius: 50%;
  display:flex; align-items:center; justify-content:center;
  font-size: 16px; color:#fff;
  box-shadow: 0 0 0 2px rgba(0,224,255,.3);
}
.m3-voice-from{
  font-size: 11px; color: var(--t-1);
  display:flex; gap:8px; align-items:baseline;
}
.m3-voice-from b{ font-size:12px; }
.m3-voice-from .muted{ font-family: var(--mono); font-size: 10px; }
.m3-voice-msg{
  font-size: 12px; color: #c0e8ff;
  font-style: italic;
  margin-top: 3px;
  line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.m3-voice-ctx{
  font-size: 10px; color: var(--t-mute);
  font-family: var(--mono);
  margin-top: 3px;
}
.m3-voice-play{
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(180deg, #46f0ff, #00a8c8);
  border: 0;
  color: #022;
  font-weight: 700; font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,224,255,.3);
  transition: transform .12s ease;
}
.m3-voice-play:hover{ transform: scale(1.1); }
.m3-voice-play.is-playing{
  animation: voicePlay 1s infinite;
  background: linear-gradient(180deg, #ffb838, #d27c00);
}
@keyframes voicePlay{
  0%,100% { box-shadow: 0 0 0 0 rgba(255,184,56,.6); }
  50%     { box-shadow: 0 0 0 8px rgba(255,184,56,0); }
}

/* ---- Next activity ---- */
.m3-card-next{
  display:flex; align-items:center; gap: 8px;
  padding: 8px 10px;
  background: rgba(0,224,255,.06);
  border: 1px dashed rgba(0,224,255,.25);
  border-radius: 6px;
  font-size: 12px;
}
.m3-next-lbl{
  font-family: var(--mono); font-size: 10px;
  color: var(--t-mute); letter-spacing: 1px;
}
.m3-next-time{
  font-family: var(--mono); font-weight: 700;
  color: #00e0ff;
}
.m3-next-icon{ font-size: 14px; }
.m3-next-label{ color: var(--t-1); flex:1; }
.m3-next-crit{
  background: rgba(255,80,80,.18);
  color: var(--sev-red);
  border: 1px solid rgba(255,80,80,.4);
  padding: 1px 7px; border-radius: 4px;
  font-size: 9px; font-family: var(--mono);
  letter-spacing: 1px; font-weight: 700;
}

/* ---- Actions ---- */
.m3-card-actions{
  display:grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}
.m3-btn{
  padding: 8px 6px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--t-1);
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  transition: all .15s ease;
  font-family: var(--sans, system-ui);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.m3-btn:hover{
  background: rgba(0,224,255,.1);
  border-color: rgba(0,224,255,.4);
}
.m3-btn-primary{
  background: linear-gradient(180deg, rgba(0,224,255,.18), rgba(0,168,200,.08));
  border-color: rgba(0,224,255,.4);
  color: #cbeefa;
}
.m3-btn-primary:hover{
  background: linear-gradient(180deg, rgba(0,224,255,.32), rgba(0,168,200,.18));
}
.m3-btn-alert{
  background: linear-gradient(180deg, rgba(255,80,80,.25), rgba(180,40,40,.15));
  border-color: rgba(255,80,80,.6);
  color: #ffd0d0;
  font-weight: 700;
  animation: btnAlertPulse 1.6s infinite;
}
@keyframes btnAlertPulse{
  0%,100% { box-shadow: 0 0 0 0 rgba(255,80,80,.5); }
  50%     { box-shadow: 0 0 0 4px rgba(255,80,80,0); }
}
.m3-btn-alert:hover{
  background: linear-gradient(180deg, rgba(255,80,80,.4), rgba(180,40,40,.25));
}

/* ============================================================ M3 CARDS */
.m3-cards{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 14px;
  padding: 4px 2px;
}
.m3-card{
  background: linear-gradient(180deg, rgba(20,36,68,.85), rgba(10,20,40,.75));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 14px;
  position: relative;
  display: flex; flex-direction: column;
  gap: 12px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  overflow: hidden;
}
.m3-card::before{
  content:""; position:absolute; left:0; top:0; bottom:0; width:4px;
}
.m3-card--ok::before    { background: linear-gradient(180deg, var(--sev-green), transparent); }
.m3-card--warn::before  { background: linear-gradient(180deg, var(--sev-yellow), transparent); }
.m3-card--alert::before { background: linear-gradient(180deg, var(--sev-red), transparent);
  box-shadow: 0 0 18px rgba(255,80,80,.5); animation: cardAlertPulse 2s infinite; }
@keyframes cardAlertPulse{
  0%,100% { box-shadow: 0 0 12px rgba(255,80,80,.4); }
  50%     { box-shadow: 0 0 22px rgba(255,80,80,.8); }
}
.m3-card:hover{
  transform: translateY(-2px);
  border-color: rgba(0,224,255,.35);
  box-shadow: 0 8px 24px rgba(0,30,80,.5), 0 0 0 1px rgba(0,224,255,.2);
}
.m3-card--alert{
  border-color: rgba(255,80,80,.4);
  background: linear-gradient(180deg, rgba(60,20,28,.85), rgba(30,12,18,.75));
}

/* ---- Header ---- */
.m3-card-head{
  display:grid;
  grid-template-columns: 56px 1fr 78px;
  gap: 12px;
  align-items: center;
}
.m3-avatar{
  width: 56px; height: 56px; border-radius: 50%;
  display:flex; align-items:center; justify-content:center;
  font-weight: 700; font-size: 18px; color: #fff;
  position: relative;
  box-shadow: 0 4px 14px rgba(0,0,0,.4), inset 0 0 0 2px rgba(255,255,255,.1);
  font-family: var(--sans, system-ui);
  letter-spacing: .5px;
}
.m3-avatar-badge{
  position: absolute; bottom: -2px; right: -4px;
  background: #0a1722;
  border: 2px solid rgba(0,224,255,.5);
  width: 24px; height: 24px; border-radius: 50%;
  display:flex; align-items:center; justify-content:center;
  font-size: 13px;
}
.m3-card-id{ min-width: 0; }
.m3-card-name{
  font-weight: 700; font-size: 15px; color: var(--t-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.m3-card-sub{
  display:flex; align-items:center; gap:6px;
  margin-top: 3px;
  font-size: 11px; color: var(--t-2);
}
.m3-pill{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  padding: 1px 7px; border-radius: 8px;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: .5px;
}
.m3-pill--red    { color: var(--sev-red); border-color: rgba(255,80,80,.4); }
.m3-pill--orange { color: var(--sev-orange); border-color: rgba(255,148,48,.4); }
.m3-pill--yellow { color: var(--sev-yellow); border-color: rgba(255,210,63,.4); }
.m3-pill--green  { color: var(--sev-green); border-color: rgba(60,210,140,.4); }
.m3-pill--grey   { color: var(--t-mute); }
.m3-card-diag{
  font-size: 11px; color: var(--t-mute);
  margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Score ring */
.m3-card-score{
  position: relative;
  width: 78px; height: 78px;
  display:flex; align-items:center; justify-content:center;
  flex-direction: column;
}
.m3-ring{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.m3-score-pct{
  font-weight: 700; font-size: 22px;
  font-family: var(--mono);
  line-height: 1;
}
.m3-score-pct span{ font-size: 11px; opacity: .8; }
.m3-score-lbl{
  font-size: 9px; color: var(--t-mute);
  letter-spacing: 1.5px; text-transform: uppercase;
  margin-top: 2px;
}

/* ---- Timeline ---- */
.m3-card-timeline{
  background: rgba(0,0,0,.2);
  border-radius: 8px;
  padding: 10px 10px 8px;
  border: 1px solid rgba(255,255,255,.04);
}
.m3-timeline-strip{
  display: flex;
  gap: 3px;
  margin-bottom: 8px;
}
.m3-dot{
  flex: 1; min-width: 0;
  height: 38px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,.08);
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  gap: 1px;
  cursor:pointer;
  transition: transform .15s ease, box-shadow .15s ease, z-index 0s;
  position: relative;
}
.m3-dot:hover{
  transform: scale(1.18);
  z-index: 5;
  box-shadow: 0 0 0 1px rgba(0,224,255,.6), 0 6px 14px rgba(0,224,255,.35);
}
.m3-dot-emoji{ font-size: 13px; line-height: 1; }
.m3-dot-time{
  font-size: 8px; font-family: var(--mono);
  color: rgba(255,255,255,.55);
  letter-spacing: .2px;
}
.m3-dot--done{
  background: rgba(60,210,140,.22);
  border-color: rgba(60,210,140,.7);
}
.m3-dot--pending{
  background: rgba(255,200,80,.22);
  border-color: rgba(255,200,80,.85);
  animation: rtPulse 1.6s infinite;
}
.m3-dot--missed{
  background: rgba(255,80,80,.28);
  border-color: rgba(255,80,80,1);
}
.m3-dot--upcoming{
  background: rgba(255,255,255,.025);
  border-color: rgba(255,255,255,.07);
  opacity: .55;
}
.m3-dot--upcoming .m3-dot-time{ color: rgba(255,255,255,.3); }
.m3-dot.is-crit{ box-shadow: inset 0 0 0 1.5px rgba(255,80,80,.55); }
.m3-dot--missed.is-crit{ animation: rtCritFlash 1.2s infinite; }

.m3-timeline-meta{
  display:flex; gap:6px; flex-wrap: wrap;
}
.m3-meta-chip{
  font-family: var(--mono); font-size: 10px;
  padding: 2px 7px; border-radius: 4px;
  letter-spacing: .3px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
}
.m3-meta-chip.ok    { color: var(--sev-green); border-color: rgba(60,210,140,.3); }
.m3-meta-chip.warn  { color: var(--sev-yellow); border-color: rgba(255,210,63,.3); }
.m3-meta-chip.alert { color: var(--sev-red); border-color: rgba(255,80,80,.4); background: rgba(255,80,80,.05); }
.m3-meta-chip.muted { color: var(--t-mute); }

/* ---- Voce familie ---- */
.m3-card-voice{
  display:grid;
  grid-template-columns: 40px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: linear-gradient(180deg, rgba(0,80,140,.18), rgba(0,40,80,.12));
  border-radius: 8px;
  border: 1px solid rgba(0,224,255,.18);
}
.m3-voice-avatar{
  width: 40px; height: 40px; border-radius: 50%;
  display:flex; align-items:center; justify-content:center;
  font-size: 16px; color:#fff;
  box-shadow: 0 0 0 2px rgba(0,224,255,.3);
}
.m3-voice-from{
  font-size: 11px; color: var(--t-1);
  display:flex; gap:8px; align-items:baseline;
}
.m3-voice-from b{ font-size:12px; }
.m3-voice-from .muted{ font-family: var(--mono); font-size: 10px; }
.m3-voice-msg{
  font-size: 12px; color: #c0e8ff;
  font-style: italic;
  margin-top: 3px;
  line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.m3-voice-ctx{
  font-size: 10px; color: var(--t-mute);
  font-family: var(--mono);
  margin-top: 3px;
}
.m3-voice-play{
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(180deg, #46f0ff, #00a8c8);
  border: 0;
  color: #022;
  font-weight: 700; font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,224,255,.3);
  transition: transform .12s ease;
}
.m3-voice-play:hover{ transform: scale(1.1); }
.m3-voice-play.is-playing{
  animation: voicePlay 1s infinite;
  background: linear-gradient(180deg, #ffb838, #d27c00);
}
@keyframes voicePlay{
  0%,100% { box-shadow: 0 0 0 0 rgba(255,184,56,.6); }
  50%     { box-shadow: 0 0 0 8px rgba(255,184,56,0); }
}

/* ---- Next activity ---- */
.m3-card-next{
  display:flex; align-items:center; gap: 8px;
  padding: 8px 10px;
  background: rgba(0,224,255,.06);
  border: 1px dashed rgba(0,224,255,.25);
  border-radius: 6px;
  font-size: 12px;
}
.m3-next-lbl{
  font-family: var(--mono); font-size: 10px;
  color: var(--t-mute); letter-spacing: 1px;
}
.m3-next-time{
  font-family: var(--mono); font-weight: 700;
  color: #00e0ff;
}
.m3-next-icon{ font-size: 14px; }
.m3-next-label{ color: var(--t-1); flex:1; }
.m3-next-crit{
  background: rgba(255,80,80,.18);
  color: var(--sev-red);
  border: 1px solid rgba(255,80,80,.4);
  padding: 1px 7px; border-radius: 4px;
  font-size: 9px; font-family: var(--mono);
  letter-spacing: 1px; font-weight: 700;
}

/* ---- Actions ---- */
.m3-card-actions{
  display:grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}
.m3-btn{
  padding: 8px 6px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--t-1);
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  transition: all .15s ease;
  font-family: var(--sans, system-ui);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.m3-btn:hover{
  background: rgba(0,224,255,.1);
  border-color: rgba(0,224,255,.4);
}
.m3-btn-primary{
  background: linear-gradient(180deg, rgba(0,224,255,.18), rgba(0,168,200,.08));
  border-color: rgba(0,224,255,.4);
  color: #cbeefa;
}
.m3-btn-primary:hover{
  background: linear-gradient(180deg, rgba(0,224,255,.32), rgba(0,168,200,.18));
}
.m3-btn-alert{
  background: linear-gradient(180deg, rgba(255,80,80,.25), rgba(180,40,40,.15));
  border-color: rgba(255,80,80,.6);
  color: #ffd0d0;
  font-weight: 700;
  animation: btnAlertPulse 1.6s infinite;
}
@keyframes btnAlertPulse{
  0%,100% { box-shadow: 0 0 0 0 rgba(255,80,80,.5); }
  50%     { box-shadow: 0 0 0 4px rgba(255,80,80,0); }
}
.m3-btn-alert:hover{
  background: linear-gradient(180deg, rgba(255,80,80,.4), rgba(180,40,40,.25));
}

.kpi-strip{ display:flex; align-items:center; gap:14px; }
.kpi{ display:flex; align-items:center; gap:6px; font-family: var(--mono); font-size: 12px; color: var(--t-2); }
.kpi b{ color: var(--t-1); font-weight: 700; font-size: 14px;
  text-shadow: 0 0 10px rgba(0,224,255,.35); }

.call-card{
  position:relative;
  border:1px solid var(--line-2);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(44,74,150,0.45), rgba(20,38,84,0.55));
  padding: 10px 12px; margin-bottom: 8px;
  display:grid; grid-template-columns: 1fr auto; gap: 6px;
  cursor:pointer; transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.call-card:hover{ transform: translateY(-1px); border-color: var(--cyan); box-shadow: var(--glow-cyan); }
.call-card.sev-red    { border-left: 4px solid var(--sev-red);    box-shadow: var(--glow-red); animation: flashRed 2s infinite; }
.call-card.sev-orange { border-left: 4px solid var(--sev-orange); }
.call-card.sev-yellow { border-left: 4px solid var(--sev-yellow); }
.call-card.sev-green  { border-left: 4px solid var(--sev-green);  }
.call-card.sev-blue   { border-left: 4px solid var(--sev-blue);   }
.call-card.taken{ opacity:.45; }
@keyframes flashRed{
  0%, 100%{ box-shadow: var(--glow-red); }
  50%     { box-shadow: 0 0 0 1px rgba(255,77,87,.7), 0 0 40px rgba(255,77,87,.55); }
}
.call-code{ font-family: var(--mono); font-size: 11px; color: var(--cyan-soft); letter-spacing: 1px; }
.call-name{ font-weight: 700; font-size: 14px; color: var(--t-1); }
.call-meta{ font-size: 12px; color: var(--t-2); margin-top: 2px; }
.call-tags{ display:flex; gap:6px; flex-wrap:wrap; margin-top: 6px; }
.tag{
  display:inline-flex; align-items:center; gap:4px;
  background: rgba(0,224,255,0.08); border:1px solid rgba(0,224,255,0.25);
  padding: 2px 7px; border-radius: 4px; font-family: var(--mono); font-size: 10px; color: var(--cyan-soft);
}
.call-side{ text-align:right; display:flex; flex-direction:column; gap:6px; align-items:flex-end; justify-content:space-between; }
.call-timer{ font-family: var(--mono); font-size: 17px; font-weight: 700; color: var(--t-1);
  text-shadow: 0 0 10px rgba(0,224,255,.35); }
.call-timer.over{ color: var(--sev-red); text-shadow: 0 0 12px rgba(255,77,87,.6); }

.patient-row{
  display:grid; grid-template-columns: 18px 1fr auto; gap: 8px;
  padding: 7px 6px; border-bottom: 1px solid var(--line-1);
  cursor:pointer; align-items:center;
  border-radius: 4px;
}
.patient-row:hover{ background: rgba(0,224,255,0.06); }
.patient-row .pname{ font-weight: 600; font-size: 13px; }
.patient-row .pmeta{ color: var(--t-3); font-size: 11px; }
.patient-row .pvit{ font-family: var(--mono); font-size: 11px; color: var(--t-2); text-align:right; }

.filter-row{
  display:flex; gap:6px; padding: 8px 0; border-bottom: 1px solid var(--line-1); margin-bottom:6px;
  flex-wrap: wrap;
}
.chip{
  padding: 3px 9px; border-radius: 999px; font-family: var(--mono); font-size: 11px;
  border:1px solid var(--line-2); color: var(--t-2); cursor:pointer; user-select:none;
  background: rgba(0,224,255,0.04);
}
.chip.active{ background: var(--sam-red); border-color: var(--sam-red); color: white;
  box-shadow: 0 0 16px rgba(255,77,87,.45); }
.chip:hover{ border-color: var(--cyan); }
.search-input{
  width:100%; padding: 8px 10px; border-radius: 6px;
  background: rgba(10,21,48,0.6); border:1px solid var(--line-2); color: var(--t-1);
  font-family: var(--mono); font-size: 12px; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-input:focus{ border-color: var(--cyan); box-shadow: var(--glow-cyan); }
.search-input::placeholder{ color: var(--t-mute); }

#m1-map-canvas{ width:100%; height: 100%; border-radius: 0 0 var(--radius) var(--radius); }
.leaflet-container{ background: #0e1c40 !important; }
.leaflet-control-attribution{ display:none !important; }
.leaflet-tile{
  /* dă tonul navy + cyan tile-urilor dark CartoDB */
  filter: hue-rotate(200deg) saturate(1.4) brightness(0.85) contrast(1.05);
}

.stat-row{
  display:flex; justify-content:space-between; padding: 7px 0;
  border-bottom: 1px dashed var(--line-1); font-size:12px;
}
.stat-row b{ font-family: var(--mono); color: var(--cyan-soft);
  text-shadow: 0 0 10px rgba(0,224,255,.3); }
.heat-grid{ display:grid; grid-template-columns: repeat(24, 1fr); gap: 2px; margin-top: 8px; }
.heat-cell{ height: 14px; border-radius: 2px; background: rgba(120,200,255,0.06); }

.feed-row{
  display:grid; grid-template-columns: 64px 28px 1fr;
  gap: 8px; padding: 5px 0; border-bottom: 1px dotted var(--line-1);
  font-family: var(--mono); font-size: 11.5px;
}
.feed-row .ftime{ color: var(--cyan-soft); }
.feed-row .ftxt{ color: var(--t-2); }
.feed-row.warn .ftxt{ color: #ffd4a3; }
.feed-row.crit .ftxt{ color: #ffb3b8; }
.feed-row.ok .ftxt{ color: #93f9cd; }
.feed-row.info .ftxt{ color: var(--cyan-soft); }

/* ============================================================ MONITOR 2 */
.m2-grid{
  display:grid;
  grid-template-columns: 1.1fr 1.4fr 1fr;
  grid-template-rows: auto 1fr 1fr 140px;
  gap: 10px;
  padding: 10px;
  min-height: 0;
}
.m2-header{ grid-column: 1 / span 3; grid-row: 1; }
.m2-ident{ grid-column: 1; grid-row: 2; }
.m2-prot { grid-column: 2; grid-row: 2; }
.m2-vital{ grid-column: 3; grid-row: 2; }
.m2-hist { grid-column: 1; grid-row: 3; }
.m2-comm { grid-column: 2; grid-row: 3; }
.m2-log  { grid-column: 3; grid-row: 3; }
.m2-actions{ grid-column: 1 / span 3; grid-row: 4; }

.idle-state{
  display:flex; align-items:center; justify-content:center;
  height: 100%; color: var(--cyan-soft);
  font-family: var(--mono); letter-spacing: 2px; font-size: 13px;
  border: 1.5px dashed var(--line-2); border-radius: 12px; margin: 10px;
  background: linear-gradient(180deg, rgba(35,61,128,0.12), rgba(14,28,64,0.18));
}

.active-head{
  display:grid;
  grid-template-columns: minmax(140px, auto) minmax(0, 1fr) auto;
  gap: 18px;
  align-items:center;
  padding: 14px 16px;
  min-height: 96px;
}
.active-head > div{ min-width: 0; }
.active-head .code{
  font-family: var(--mono); font-size: 26px; font-weight: 800;
  letter-spacing: 3px; color: var(--t-1);
  text-shadow: 0 0 14px rgba(0,224,255,.45);
}
.active-head .pat{
  font-size: 19px; font-weight: 800; color: var(--t-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.active-head .pmeta{
  color: var(--t-3); font-size: 12px; font-family: var(--mono);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.active-head .timer{
  font-family: var(--mono); font-size: 28px; font-weight: 800; color: var(--cyan-soft);
  text-shadow: 0 0 14px rgba(0,224,255,.5); letter-spacing: 1px;
}
.active-head .acts{ display:flex; gap:8px; flex-wrap: nowrap; }

.ident-block{ display:flex; gap:12px; align-items:flex-start; margin-bottom: 12px; }
.ident-avatar{
  width:60px; height:60px; border-radius: 50%;
  background: linear-gradient(135deg, var(--sam-red), #6a0e12);
  display:flex; align-items:center; justify-content:center;
  font-size: 24px; font-weight:800; color:white;
  border: 2px solid rgba(255,255,255,.12);
  box-shadow: 0 0 22px rgba(255,77,87,.4);
}
.ident-block .name{ font-size: 17px; font-weight: 800; color: var(--t-1); }
.ident-block .meta{ color: var(--t-3); font-size: 12px; font-family: var(--mono); margin-top: 2px; }
.kv{ display:grid; grid-template-columns: 110px 1fr; gap: 4px 10px; margin-top: 10px; font-size: 12.5px; }
.kv .k{ color: var(--cyan-soft); font-family: var(--mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
.kv .v{ color: var(--t-1); }
.contact-row{ display:flex; justify-content:space-between; align-items:center;
  padding: 6px 0; border-bottom: 1px dashed var(--line-1); font-size: 12.5px; }
.contact-row .role{ color: var(--t-3); font-size: 11px; }

.protocol-title{ font-weight:800; letter-spacing:1px; margin-bottom: 6px; color: var(--t-1); }
.protocol-sub{ color: var(--cyan-soft); font-size:12px; margin-bottom: 12px; letter-spacing: 1px; }
.proto-step{
  display:flex; align-items:center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  background: linear-gradient(180deg, rgba(35,61,128,0.4), rgba(20,38,84,0.4));
  border: 1px solid var(--line-2); margin-bottom: 6px;
  transition: all .15s ease;
}
.proto-step.done{ background: rgba(44,243,160,.10); border-color: rgba(44,243,160,.4); }
.proto-step .num{ font-family: var(--mono); color: var(--cyan-soft); font-size: 11px; width: 20px; }
.proto-step .txt{ flex:1; font-size: 13px; color: var(--t-1); }
.proto-step .ans{ display:flex; gap:4px; }
.proto-step .ans button{
  padding: 4px 11px; font-size: 11px; border-radius: 4px;
  border:1px solid var(--line-2); background: rgba(0,224,255,0.05); color: var(--t-2); cursor:pointer;
  font-weight: 600; letter-spacing:.5px;
}
.proto-step .ans button:hover{ border-color: var(--cyan); }
.proto-step .ans button.yes.sel{ background: var(--sev-red); color:white; border-color: transparent;
  box-shadow: 0 0 12px rgba(255,77,87,.4); }
.proto-step .ans button.no.sel{ background: var(--sev-green); color:#02160c; border-color: transparent;
  box-shadow: 0 0 12px rgba(44,243,160,.4); }
.proto-step.done .num::before{ content:"✓ "; color: var(--sev-green); }

.proto-summary{
  margin-top: 12px; padding: 12px; border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,77,87,.10), rgba(255,77,87,.05));
  border: 1px solid rgba(255,77,87,.35); font-size: 12.5px; color: var(--t-1);
  box-shadow: inset 0 0 18px rgba(255,77,87,.15);
}
.proto-summary b{ color: #ffb3b8; }

.vital-grid{ display:grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vital-card{
  background: linear-gradient(180deg, rgba(35,61,128,0.45), rgba(20,38,84,0.45));
  border: 1px solid var(--line-2);
  border-radius: 8px; padding: 10px 12px;
  position: relative; overflow:hidden;
}
.vital-card::after{
  content:""; position:absolute; inset:0; pointer-events:none;
  background: radial-gradient(220px 80px at 100% 0%, rgba(0,224,255,0.08), transparent 70%);
}
.vital-card .lbl{ font-family: var(--mono); font-size: 10px; letter-spacing: 1.5px; color: var(--cyan-soft); text-transform: uppercase; }
.vital-card .val{ font-family: var(--mono); font-size: 24px; font-weight: 800; margin-top: 2px; color: var(--t-1);
  text-shadow: 0 0 12px rgba(0,224,255,.3); }
.vital-card .unit{ font-size: 11px; color: var(--t-3); }
.vital-card.crit .val{ color: var(--sev-red); text-shadow: 0 0 14px rgba(255,77,87,.55); }
.vital-card.warn .val{ color: var(--sev-orange); text-shadow: 0 0 14px rgba(255,148,48,.5); }
.vital-card.ok   .val{ color: var(--sev-green); text-shadow: 0 0 14px rgba(44,243,160,.45); }
.vital-spark{ height: 36px; margin-top:6px; position: relative; z-index:1; }

.news2-bar{
  display:flex; align-items:center; gap:8px;
  padding: 10px 12px; border-radius: 8px; margin-top: 10px;
  background: linear-gradient(180deg, rgba(255,77,87,.12), rgba(255,77,87,.05));
  border: 1px solid rgba(255,77,87,.4);
  font-size:12.5px; color: var(--t-1);
}
.news2-bar b{ font-family: var(--mono); font-size:20px; color: #ffb3b8;
  text-shadow: 0 0 12px rgba(255,77,87,.5); }

.comm-call{
  display:flex; align-items:center; gap: 12px;
  padding: 10px; border-radius: 8px;
  background: linear-gradient(180deg, rgba(35,61,128,0.4), rgba(20,38,84,0.4));
  border: 1px solid var(--line-2); margin-bottom:10px;
}
.comm-call .av{
  width: 40px; height: 40px; border-radius:50%;
  background: linear-gradient(135deg, var(--sam-red), #6a0e12);
  display:flex; align-items:center; justify-content:center; font-weight: 800; color:white;
  box-shadow: 0 0 16px rgba(255,77,87,.4);
}
.comm-call .who{ flex:1; }
.comm-call .who .n{ font-weight: 700; font-size: 13px; color: var(--t-1); }
.comm-call .who .s{ color: var(--cyan-soft); font-size: 11px; font-family: var(--mono); }
.waveform{ display:flex; gap:2px; align-items:end; height: 32px; }
.waveform i{ width: 3px; background: var(--cyan); border-radius: 1.5px; animation: wf 1.1s infinite ease-in-out;
  box-shadow: 0 0 8px var(--cyan); }
.waveform i:nth-child(2n){ animation-duration: .9s; }
.waveform i:nth-child(3n){ animation-duration: 1.3s; background: var(--gold); box-shadow: 0 0 8px var(--gold); }
@keyframes wf{ 0%,100%{ height:6px; } 50%{ height: 28px; } }

.sms-grid{ display:grid; grid-template-columns: 1fr 1fr; gap:6px; margin-top:8px; }
.sms-templ{
  padding: 9px 10px; border-radius: 6px; font-size: 12px; color: var(--t-2);
  background: linear-gradient(180deg, rgba(35,61,128,0.35), rgba(20,38,84,0.35));
  border: 1px solid var(--line-2); cursor:pointer; transition: all .15s ease;
}
.sms-templ:hover{ border-color: var(--gold); color: var(--t-1); box-shadow: var(--glow-gold); }

.log-row{
  display:grid; grid-template-columns: 64px 1fr;
  gap: 8px; padding: 5px 0; border-bottom: 1px dotted var(--line-1);
  font-size: 12px;
}
.log-row .lt{ color: var(--cyan-soft); font-family: var(--mono); font-size: 11px; }
.log-row .ll{ color: var(--t-1); }
.log-row .ll b{ color: var(--gold); }

.actions-grid{
  display:grid; grid-template-columns: repeat(8, 1fr); gap: 8px;
  padding: 10px 12px;
}
.act-btn{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px;
  padding: 12px 6px; border-radius: 10px;
  background: linear-gradient(180deg, rgba(35,61,128,0.5), rgba(20,38,84,0.5));
  border: 1px solid var(--line-2); color: var(--t-1);
  cursor:pointer; font-size: 11px; font-weight: 600;
  transition: all .12s ease;
  backdrop-filter: blur(4px);
}
.act-btn:hover{ transform: translateY(-2px); border-color: var(--cyan); box-shadow: var(--glow-cyan); }
.act-btn .ico{ font-size: 22px; filter: drop-shadow(0 0 8px rgba(0,224,255,0.45)); }
.act-btn.red   { border-color: rgba(255,77,87,.45); background: rgba(255,77,87,.10); }
.act-btn.red:hover{ background: rgba(255,77,87,.22); box-shadow: var(--glow-red); }
.act-btn.orange{ border-color: rgba(255,148,48,.45); background: rgba(255,148,48,.10); }
.act-btn.yellow{ border-color: rgba(255,210,63,.45); background: rgba(255,210,63,.10); }
.act-btn.green { border-color: rgba(44,243,160,.45); background: rgba(44,243,160,.10); }
.act-btn.blue  { border-color: rgba(92,232,255,.45); background: rgba(92,232,255,.10); }

.case-tabs{ display:flex; gap:4px; padding: 4px 10px 0; }
.case-tab{
  padding: 6px 12px; border-radius: 6px 6px 0 0;
  background: rgba(35,61,128,0.4); border: 1px solid var(--line-2); border-bottom: none;
  color: var(--t-2); font-size:12px; cursor:pointer; font-family: var(--mono);
}
.case-tab.active{ background: rgba(0,224,255,0.10); color: var(--t-1); border-color: var(--cyan);
  box-shadow: 0 -2px 14px rgba(0,224,255,0.25); }
.case-tab .x{ margin-left:8px; color: var(--t-mute); }
.case-tab .x:hover{ color: var(--sev-red); }

/* Scrollbars */
*::-webkit-scrollbar{ width:8px; height:8px; }
*::-webkit-scrollbar-thumb{ background: rgba(0,224,255,0.18); border-radius:4px; }
*::-webkit-scrollbar-thumb:hover{ background: rgba(0,224,255,0.32); }
*::-webkit-scrollbar-track{ background: transparent; }

.hide{ display:none !important; }
.row{ display:flex; gap:8px; align-items:center; }
.col{ display:flex; flex-direction:column; gap:8px; }
.muted{ color: var(--t-3); }
.mono{ font-family: var(--mono); }
hr.sep{ border:none; border-top: 1px solid var(--line-1); margin: 10px 0; }

/* ============================================================ TOASTS */
.toast-stack{
  position: fixed; top: 64px; right: 18px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
  max-width: 360px;
}
.toast{
  pointer-events: auto;
  display: grid; grid-template-columns: 36px 1fr auto; gap: 10px;
  align-items: center;
  padding: 12px 14px; border-radius: 10px;
  background: linear-gradient(180deg, rgba(35,61,128,0.92), rgba(14,28,64,0.92));
  border: 1px solid var(--line-3);
  box-shadow: 0 14px 40px rgba(0,20,60,0.6), var(--glow-cyan);
  color: var(--t-1);
  font-size: 13px;
  backdrop-filter: blur(10px) saturate(140%);
  animation: toastIn .35s cubic-bezier(.2,.9,.3,1.2);
  min-width: 280px;
}
.toast.out{ animation: toastOut .25s ease forwards; }
.toast .ico{
  width: 36px; height: 36px; border-radius: 50%;
  display:flex; align-items:center; justify-content:center;
  font-size: 18px;
  background: rgba(0,224,255,0.15); border:1px solid rgba(0,224,255,0.4);
}
.toast .ttl{ font-weight:700; letter-spacing:.5px; }
.toast .sub{ color: var(--t-3); font-size: 11.5px; margin-top:2px; font-family: var(--mono); }
.toast .x{ cursor: pointer; color: var(--t-3); padding: 0 6px; font-size: 16px; }
.toast .x:hover{ color: var(--t-1); }
.toast.crit{ border-color: rgba(255,77,87,0.55); box-shadow: 0 14px 40px rgba(0,20,60,0.6), var(--glow-red); }
.toast.crit .ico{ background: rgba(255,77,87,0.18); border-color: rgba(255,77,87,0.5); }
.toast.ok{ border-color: rgba(44,243,160,0.5); box-shadow: 0 14px 40px rgba(0,20,60,0.6), 0 0 24px rgba(44,243,160,0.3); }
.toast.ok .ico{ background: rgba(44,243,160,0.15); border-color: rgba(44,243,160,0.45); }
.toast.warn{ border-color: rgba(255,210,63,0.5); box-shadow: 0 14px 40px rgba(0,20,60,0.6), var(--glow-gold); }
.toast.warn .ico{ background: rgba(255,210,63,0.15); border-color: rgba(255,210,63,0.45); }
@keyframes toastIn{
  from{ transform: translateX(40px) scale(.95); opacity: 0; }
  to  { transform: translateX(0)     scale(1);   opacity: 1; }
}
@keyframes toastOut{
  to{ transform: translateX(40px) scale(.95); opacity: 0; }
}

/* ============================================================ MAP OVERLAY (caz tactic) */
.map-overlay{
  position: absolute; top: 50px; left: 10px; right: 10px;
  z-index: 500;
  background: linear-gradient(180deg, rgba(14,28,64,0.85), rgba(10,21,48,0.85));
  border: 1px solid var(--line-3);
  border-radius: 8px;
  padding: 10px 14px;
  display: none;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 14px;
  backdrop-filter: blur(10px) saturate(140%);
  box-shadow: 0 6px 24px rgba(0,20,60,0.5), var(--glow-cyan);
  animation: overlayIn .3s ease;
}
.map-overlay.on{ display: grid; }
.map-overlay .mo-cell .k{
  font-family: var(--mono); font-size: 10px; letter-spacing:1.5px;
  color: var(--cyan-soft); text-transform: uppercase;
}
.map-overlay .mo-cell .v{
  font-family: var(--mono); font-size: 14px; font-weight: 700;
  color: var(--t-1); margin-top: 2px;
  text-shadow: 0 0 10px rgba(0,224,255,0.3);
}
.map-overlay .mo-cell .v.crit{ color: #ffb3b8; text-shadow: 0 0 10px rgba(255,77,87,0.5); }
.map-overlay .mo-cell .v.ok  { color: #93f9cd; text-shadow: 0 0 10px rgba(44,243,160,0.45); }
@keyframes overlayIn{
  from{ transform: translateY(-8px); opacity: 0; }
  to  { transform: translateY(0);    opacity: 1; }
}

/* Pulsing ring pe abonatul cazului activ (Leaflet circleMarker) */
.leaflet-active-case{
  animation: caseRingPulse 1.4s infinite ease-in-out;
}
@keyframes caseRingPulse{
  0%,100%{ filter: drop-shadow(0 0 4px rgba(255,77,87,0.5)); }
  50%    { filter: drop-shadow(0 0 18px rgba(255,77,87,0.95)); }
}

/* Call-card când e preluat de operatorul curent */
.call-card.mine{
  background: linear-gradient(180deg, rgba(44,243,160,0.18), rgba(20,38,84,0.55));
  border-left-width: 4px;
  border-color: rgba(44,243,160,0.55);
  box-shadow: 0 0 0 1px rgba(44,243,160,0.35), 0 0 22px rgba(44,243,160,0.18);
  opacity: 1 !important;
}
.call-card.mine .call-code::after{
  content: " · ✋ AL TĂU";
  color: var(--sev-green);
  font-weight: 700;
  letter-spacing: 1px;
}

/* ============================================================ DEVICE STRIP (Monitor 2 · vitale) */
.dev-strip{
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 4px 0 8px;
}
.dev-pill{
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 9px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(35,61,128,0.45), rgba(20,38,84,0.5));
  border: 1px solid var(--line-2);
  font-size: 11px; line-height: 1.1;
  max-width: 100%;
}
.dev-pill.ok  { border-color: rgba(44,243,160,0.4); box-shadow: 0 0 12px rgba(44,243,160,0.08); }
.dev-pill.warn{ border-color: rgba(255,210,63,0.4); }
.dev-pill.crit{ border-color: rgba(255,77,87,0.55); box-shadow: 0 0 14px rgba(255,77,87,0.18); animation: devPulse 2.4s infinite; }
@keyframes devPulse{
  0%,100%{ box-shadow: 0 0 14px rgba(255,77,87,0.18); }
  50%    { box-shadow: 0 0 20px rgba(255,77,87,0.45); }
}
.dev-pill .dev-ic{ font-size: 14px; filter: drop-shadow(0 0 6px rgba(0,224,255,0.4)); }
.dev-pill .dev-info{ display: flex; flex-direction: column; gap: 1px; }
.dev-pill .dev-mod{ color: var(--t-1); font-weight: 600; font-size: 11px; }
.dev-pill .dev-meta{ color: var(--cyan-soft); font-family: var(--mono); font-size: 9.5px; letter-spacing: .5px; }
.dev-pill .dev-bat{
  font-family: var(--mono); font-size: 10px; color: var(--cyan-soft);
  padding: 1px 5px; border-radius: 4px;
  background: rgba(0,224,255,0.08); border:1px solid rgba(0,224,255,0.2);
}
.dev-pill .dev-bat.low{
  color: #ffb3b8; background: rgba(255,77,87,0.12); border-color: rgba(255,77,87,0.4);
}

/* ============================================================ TREND CHART */
.chart-wrap{ margin-top: 12px; }
.chart-h{
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.chart-legend{
  display:flex; gap: 10px; align-items: center;
  font-family: var(--mono); font-size: 10px; color: var(--t-3);
}
.chart-legend .lg-dot{
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 4px; vertical-align: middle;
}
.trend-svg{
  width: 100%; height: auto;
  background: linear-gradient(180deg, rgba(10,21,48,0.4), rgba(14,28,64,0.2));
  border: 1px solid var(--line-1);
  border-radius: 6px;
  padding: 4px;
}
.trend-box{
  margin-top: 8px; padding: 8px 10px; border-radius: 6px;
  font-size: 12px; color: var(--t-1);
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(35,61,128,0.3), rgba(20,38,84,0.3));
}
.trend-box.warn{
  border-color: rgba(255,210,63,0.5);
  background: linear-gradient(180deg, rgba(255,210,63,0.10), rgba(255,148,48,0.05));
  box-shadow: inset 0 0 16px rgba(255,210,63,0.1);
}
.trend-box.ok{
  border-color: rgba(44,243,160,0.4);
  background: linear-gradient(180deg, rgba(44,243,160,0.08), rgba(20,200,168,0.04));
}
.trend-box b{ color: var(--cyan-soft); }

/* ============================================================ PDF INBOX (ViHealth via WhatsApp) */
.pdf-inbox-h{
  display: flex; align-items: center; justify-content: space-between;
  margin: 10px 0 6px;
}
.pdf-inbox{
  display: flex; flex-direction: column; gap: 4px;
  border: 1px dashed var(--line-2);
  border-radius: 6px;
  padding: 6px;
  background: linear-gradient(180deg, rgba(10,21,48,0.5), rgba(14,28,64,0.3));
}
.pdf-row{
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 4px;
  background: rgba(35,61,128,0.25);
  border: 1px solid var(--line-1);
  transition: background .2s;
}
.pdf-row:hover{ background: rgba(35,61,128,0.45); }
.pdf-dot{
  width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px;
  box-shadow: 0 0 8px currentColor;
}
.pdf-dot.ok  { background: #2cf3a0; color: #2cf3a0; }
.pdf-dot.warn{ background: #ffd23f; color: #ffd23f; }
.pdf-dot.crit{ background: #ff4d57; color: #ff4d57; animation: devPulse 1.6s infinite; }
.pdf-meta{ flex: 1; min-width: 0; }
.pdf-vals{ font-size: 12px; color: var(--t-1); line-height: 1.3; }
.pdf-vals b{ color: var(--cyan-soft); font-weight: 700; }
.pdf-sub{
  font-size: 10px; color: var(--t-3); letter-spacing: .3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pdf-flag{
  display: inline-block; margin-left: 4px;
  padding: 1px 5px; font-size: 10px; border-radius: 3px;
  background: rgba(255,77,87,0.18); color: #ffb3b8;
  border: 1px solid rgba(255,77,87,0.4);
}
.pdf-st{
  font-family: var(--mono); font-size: 10px;
  padding: 2px 6px; border-radius: 4px; white-space: nowrap;
}
.pdf-st.ok  { color: #2cf3a0; background: rgba(44,243,160,0.1);  border: 1px solid rgba(44,243,160,0.3); }
.pdf-st.warn{ color: #ffd23f; background: rgba(255,210,63,0.1); border: 1px solid rgba(255,210,63,0.4); }

/* ============================================================ MODAL */
.modal-backdrop{
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at center, rgba(5,12,32,0.85), rgba(2,6,18,0.97));
  backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
  z-index: 9999;
  animation: mfadeIn .15s ease;
}
.modal-backdrop.show{ display: flex; }
@keyframes mfadeIn { from{ opacity: 0 } to{ opacity: 1 } }

.modal-card{
  width: min(560px, 92vw);
  max-height: 88vh; overflow: auto;
  background: linear-gradient(180deg, #0f2049, #0a1633);
  border: 1px solid rgba(0,224,255,0.35);
  border-radius: 10px;
  box-shadow: 0 0 40px rgba(0,224,255,0.18), 0 20px 60px rgba(0,0,0,0.6);
  animation: mslideIn .2s ease;
}
.modal-card.wide{ width: min(820px, 96vw); }
@keyframes mslideIn { from{ transform: translateY(-12px); opacity: 0 } to{ transform: translateY(0); opacity:1 } }

.modal-h{
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(35,61,128,0.5), rgba(20,38,84,0.2));
  border-radius: 10px 10px 0 0;
}
.modal-ttl{
  font-family: var(--mono); font-size: 13px; letter-spacing: 1.5px;
  color: var(--cyan-soft); text-transform: uppercase;
}
.modal-x{
  cursor: pointer; font-size: 18px; color: var(--t-3);
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; transition: background .15s;
}
.modal-x:hover{ background: rgba(255,77,87,0.15); color: #ff4d57; }

.modal-b{ padding: 16px 18px; font-size: 13px; color: var(--t-1); line-height: 1.5; }
.modal-f{
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 12px 18px;
  border-top: 1px solid var(--line-2);
  background: rgba(10,21,48,0.4);
  border-radius: 0 0 10px 10px;
}

.modal-warn{
  padding: 8px 12px; border-radius: 6px;
  background: rgba(255,77,87,0.12);
  border: 1px solid rgba(255,77,87,0.4);
  color: #ffb3b8; font-size: 12px; margin-bottom: 8px;
}
.modal-list{ margin: 4px 0 0; padding-left: 18px; font-size: 12.5px; }
.modal-list li{ margin: 3px 0; }
.modal-addr{
  padding: 8px 12px; border-radius: 6px;
  background: rgba(0,224,255,0.08); border: 1px solid rgba(0,224,255,0.25);
  color: var(--t-1); font-size: 13px;
}
.modal-radio{
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin: 4px 0;
  background: rgba(35,61,128,0.25);
  border: 1px solid var(--line-1);
  border-radius: 6px; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.modal-radio:hover{ background: rgba(35,61,128,0.45); border-color: rgba(0,224,255,0.3); }
.modal-radio input{ accent-color: var(--cyan-soft); }
.modal-sel, .modal-ta{
  width: 100%; box-sizing: border-box;
  padding: 8px 10px; font-size: 13px;
  background: rgba(10,21,48,0.6);
  border: 1px solid var(--line-2);
  color: var(--t-1);
  border-radius: 6px;
  font-family: inherit;
}
.modal-sel:focus, .modal-ta:focus{ outline: none; border-color: var(--cyan-soft); }
.modal-ta{ min-height: 60px; resize: vertical; }
.modal-chk{
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; font-size: 12.5px;
}
.modal-chk input{ accent-color: var(--cyan-soft); }
.slots-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.slot-r{
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: rgba(35,61,128,0.25);
  border: 1px solid var(--line-1);
  border-radius: 6px; cursor: pointer; font-size: 12.5px;
}
.slot-r:hover{ background: rgba(35,61,128,0.45); }

/* On-call card */
.oncall-card{
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: rgba(35,61,128,0.3);
  border: 1px solid var(--line-2);
  border-radius: 6px;
}
.oncall-av{
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #00e0ff, #2cf3a0);
  color: #0a1633; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}

/* ---- M3 Live update pulse (ZIUA 5) ---- */
.m3-card--just-updated{
  animation: m3Updated 3.4s ease-out;
}
.m3-card--just-updated::after{
  content: "● LIVE UPDATE";
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  font-family: ui-monospace, monospace;
  letter-spacing: 1.5px;
  color: #00e676;
  background: rgba(0,230,118,.12);
  border: 1px solid rgba(0,230,118,.4);
  padding: 3px 8px;
  border-radius: 4px;
  animation: m3UpdatedBadge 3.4s ease-out forwards;
  pointer-events: none;
  z-index: 5;
}
@keyframes m3Updated {
  0%   { box-shadow: 0 0 0 0 rgba(0,230,118,.7), 0 8px 24px rgba(0,30,80,.5); }
  20%  { box-shadow: 0 0 0 6px rgba(0,230,118,.35), 0 0 24px rgba(0,230,118,.4); }
  100% { box-shadow: 0 0 0 0 rgba(0,230,118,0), 0 8px 24px rgba(0,30,80,.5); }
}
@keyframes m3UpdatedBadge {
  0%   { opacity: 0; transform: translateY(-4px); }
  10%  { opacity: 1; transform: translateY(0); }
  85%  { opacity: 1; }
  100% { opacity: 0; }
}

/* Video mock */
.video-mock{ display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.video-feed{
  position: relative; aspect-ratio: 16/10;
  background: linear-gradient(135deg, #0a1633, #1a2f5e);
  border: 1px solid var(--line-2); border-radius: 8px;
  overflow: hidden;
}
.video-conn{
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  color: var(--cyan-soft); font-family: var(--mono); font-size: 13px;
}
.video-meta{
  position: absolute; bottom: 8px; left: 10px;
  font-family: var(--mono); font-size: 11px; color: var(--t-3);
  background: rgba(0,0,0,0.4); padding: 3px 8px; border-radius: 4px;
}
.video-grid{
  position: absolute; inset: 0; opacity: 0.1;
  background-image:
    linear-gradient(rgba(0,224,255,0.4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,224,255,0.4) 1px, transparent 1px);
  background-size: 30px 30px;
}
.video-self{
  position: absolute; bottom: 10px; right: 10px;
  width: 110px; height: 70px;
  background: linear-gradient(135deg, #1a2f5e, #0a1633);
  border: 2px solid rgba(0,224,255,0.4);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.video-self-label{
  font-family: var(--mono); font-size: 9px; color: var(--cyan-soft);
  text-align: center; padding: 4px;
}
.conn-options{
  display: flex; flex-direction: column; gap: 4px;
}
.conn-options button{ width: 100%; text-align: left; }
.wa-preview{
  padding: 8px 10px;
  background: rgba(37,211,102,0.08);
  border: 1px solid rgba(37,211,102,0.3);
  border-radius: 6px;
  font-size: 11.5px; line-height: 1.4;
  color: var(--t-1); font-style: italic;
}
.video-side{ font-size: 12px; }
.device-call-info{
  padding: 10px; border-radius: 6px;
  background: linear-gradient(135deg, #2cf3a0, #00e0ff);
  color: #0a1633; font-weight: 600; text-align: center;
  font-size: 12px;
}
.part-row{
  padding: 6px 8px; margin: 4px 0;
  background: rgba(35,61,128,0.25);
  border: 1px solid var(--line-1);
  border-radius: 4px; font-size: 12px;
}

/* Rx check */
.rx-check{
  padding: 8px 10px; border-radius: 6px;
  background: rgba(44,243,160,0.08);
  border: 1px solid rgba(44,243,160,0.3);
  color: #2cf3a0; font-size: 12px;
}

/* Report preview */
.report-preview{
  background: #fff;
  color: #1a2244;
  padding: 16px 18px;
  border-radius: 6px;
  font-family: Georgia, serif;
  font-size: 12px;
  margin-bottom: 10px;
}
.rp-h{ display: flex; align-items: center; gap: 12px; border-bottom: 2px solid #1a2244; padding-bottom: 8px; margin-bottom: 10px; }
.rp-logo{ width: 38px; height: 38px; border-radius: 50%; background: #1a2244; color: #fff; font-size: 18px; display: inline-flex; align-items: center; justify-content: center; }
.rp-ttl{ font-weight: 700; font-size: 14px; }
.rp-sub{ font-size: 11px; color: #555; font-family: ui-monospace, monospace; }
.rp-tbl{ width: 100%; border-collapse: collapse; }
.rp-tbl td{ padding: 4px 6px; border-bottom: 1px dotted #ccc; vertical-align: top; }
.rp-tbl td.k{ width: 28%; color: #555; font-weight: 600; }
.rp-foot{ margin-top: 10px; font-size: 10px; color: #888; text-align: center; }

/* =================================================================
   ZIUA 6 — Voce familie reală
   ================================================================= */

/* Containerul cu cele 2 butoane (play + rec) lângă mesaj */
.m3-voice-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Buton play — verde dacă există voce REALĂ */
.m3-voice-play {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  color: var(--t-text);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  transition: all .15s ease;
}
.m3-voice-play:hover { background: rgba(255,255,255,.16); }
.m3-voice-play.is-playing {
  background: var(--t-accent, #5ce8ff);
  color: #001;
  box-shadow: 0 0 0 4px rgba(92,232,255,.25);
}
.m3-voice-play.is-real {
  background: linear-gradient(135deg, #1ac978, #0f9a5a);
  border-color: #1ac978;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(26,201,120,.25), 0 0 14px rgba(26,201,120,.5);
}
.m3-voice-play.is-real::after {
  content: "●";
  position: absolute;
  font-size: 8px;
  color: #fff;
  margin-left: -10px;
  margin-top: -14px;
}

/* Buton REC */
.m3-voice-rec {
  background: rgba(255,77,87,.12);
  border: 1px solid rgba(255,77,87,.4);
  color: #ff8a92;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  transition: all .15s ease;
}
.m3-voice-rec:hover {
  background: rgba(255,77,87,.22);
  color: #fff;
  transform: scale(1.06);
}

/* ----- Recorder modal ----- */
.m3-vrec-back {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000;
  animation: m3vrecFade .15s ease;
}
@keyframes m3vrecFade { from { opacity: 0; } to { opacity: 1; } }
.m3-vrec-modal {
  width: min(540px, 92vw);
  background: linear-gradient(180deg, #161b25, #0e1219);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  overflow: hidden;
}
.m3-vrec-head {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(180deg, rgba(255,77,87,.08), transparent);
}
.m3-vrec-title { font-weight: 700; font-size: 16px; color: #fff; }
.m3-vrec-sub { font-size: 12px; color: var(--t-mute, #8794a8); margin-top: 2px; }
.m3-vrec-close {
  background: transparent; border: none; color: #fff;
  font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.m3-vrec-close:hover { background: rgba(255,255,255,.08); }
.m3-vrec-body { padding: 18px 20px; }
.m3-vrec-suggest {
  background: rgba(92,232,255,.06);
  border-left: 3px solid #5ce8ff;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 14px;
}
.m3-vrec-suggest-lbl { font-size: 11px; color: #5ce8ff; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.m3-vrec-suggest-text { font-style: italic; color: #cfe4ff; margin-top: 4px; }
.m3-vrec-status {
  text-align: center;
  padding: 12px;
  color: var(--t-text);
  font-size: 14px;
}
.m3-vrec-time {
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  margin: 4px 0 8px;
  letter-spacing: 2px;
}
.m3-vrec-meter {
  height: 8px;
  background: rgba(255,255,255,.06);
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0 16px;
}
.m3-vrec-meter-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #1ac978, #ffd24a, #ff4d57);
  transition: width .05s linear;
}
.m3-vrec-actions {
  display: flex; gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.m3-btn-rec {
  background: #ff4d57 !important;
  color: #fff !important;
  border-color: #ff4d57 !important;
  font-weight: 700;
}
.m3-btn-rec:hover:not(:disabled) { background: #ff6b73 !important; }
.m3-btn-rec:disabled { opacity: .35; cursor: not-allowed; }
.m3-btn-stop {
  background: rgba(255,255,255,.08);
  color: #fff;
  border-color: rgba(255,255,255,.16);
}
.m3-btn-stop:disabled { opacity: .35; cursor: not-allowed; }
.m3-vrec-meta {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.06);
  font-size: 12px;
  color: var(--t-mute);
}
.m3-vrec-meta input {
  width: 100%;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  margin-top: 4px;
  font-size: 13px;
}
