/* ========================================
   OrgSafe Prototype - Styles
   ======================================== */
*{margin:0;padding:0;box-sizing:border-box}
:root{
  --bg1:#0f172a;
  --bg2:#111827;
  --card:#ffffff;
  --muted:#6b7280;
  --text:#0b1220;
  --primary:#1B9AAA;
  --primary2:#17848F;
  --warn:#f59e0b;
  --danger:#ef4444;
  --soft:#f3f4f6;
  --border:#e5e7eb;
}

body{
  font-family:'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #0ea5e9 0%, #22c55e 100%);
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
}

.phone-frame{
  width:393px;
  height:852px;
  background:#000;
  border-radius:45px;
  box-shadow:0 20px 60px rgba(0,0,0,.35);
  overflow:hidden;
  position:relative;
}

.phone-notch{
  position:absolute; top:0; left:50%;
  transform:translateX(-50%);
  width:150px; height:30px;
  background:#000;
  border-radius:0 0 20px 20px;
  z-index:1000;
}

.screen{
  width:100%; height:100%;
  background:#F8F9FA;
  position:absolute; top:0; left:0;
  display:none;
  flex-direction:column;
  overflow:hidden;
}

.screen.active{display:flex; animation: slideIn .25s ease-out}
@keyframes slideIn{from{transform:translateX(8%); opacity:.2}to{transform:translateX(0); opacity:1}}

.header{
  background:#fff;
  padding:50px 16px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  box-shadow:0 2px 10px rgba(0,0,0,.06);
  position:sticky; top:0; z-index:100;
}

.logo{
  font-size:18px; font-weight:800; letter-spacing:.2px;
  color:var(--primary);
}
.title{font-size:16px; font-weight:700; color:#111827; flex:1; text-align:center}
.icon-btn{
  background:none; border:none; font-size:18px;
  padding:8px 10px; border-radius:10px;
  cursor:pointer; color:#111827;
}
.icon-btn:active{transform:scale(.96)}
.back-btn{
  background:none; border:none; font-size:20px;
  padding:8px 10px; border-radius:10px; cursor:pointer;
}
.back-btn:active{transform:scale(.96)}

.content{
  flex:1;
  overflow-y:auto;
  padding:18px;
  padding-bottom:110px;
}
.centered{display:flex; flex-direction:column; align-items:center}
.muted{color:var(--muted)}
.small{font-size:12px; color:var(--muted); margin-top:12px; text-align:center; line-height:1.35}
.strong{font-weight:700; color:#111827}
.headline{font-weight:800; color:#0f172a; margin-top:4px}

.hero{margin-top:10px; text-align:center}
.hero-icon{font-size:44px}
.hero h1{font-size:20px; margin:12px 0 8px; color:#0f172a}
.hero p{font-size:13px; line-height:1.5}

.card{
  width:100%;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  padding:16px;
  margin-top:14px;
  box-shadow:0 2px 10px rgba(0,0,0,.05);
}
.small-card{padding:14px}
.section{margin-top:16px}
.section-title{font-weight:700; color:#0f172a; margin:8px 0 10px}

.form{margin-top:10px}
label{display:block; font-size:12px; font-weight:700; color:#0f172a; margin:10px 0 6px}
input, textarea{
  width:100%;
  padding:12px 12px;
  border:1px solid var(--border);
  border-radius:12px;
  font-size:14px;
  outline:none;
  background:#fff;
}
textarea{resize:none}
input:focus, textarea:focus{
  border-color:rgba(27,154,170,.7);
  box-shadow:0 0 0 4px rgba(27,154,170,.12);
}

.primary,.secondary{
  width:100%;
  border:none;
  border-radius:12px;
  padding:12px 14px;
  font-weight:800;
  font-size:14px;
  cursor:pointer;
  margin-top:12px;
}
.primary{background:linear-gradient(135deg,var(--primary),var(--primary2)); color:#fff; box-shadow:0 6px 16px rgba(27,154,170,.28)}
.primary:active{transform:scale(.98)}
.secondary{
  background:#fff;
  border:2px solid var(--primary);
  color:var(--primary);
}
.secondary:active{transform:scale(.98); background:rgba(27,154,170,.08)}
.link{
  width:100%;
  background:none;
  border:none;
  margin-top:10px;
  color:var(--primary);
  font-weight:700;
  cursor:pointer;
  text-decoration:underline;
}

.segmentation{margin-top:8px}
.segmented{
  display:flex; gap:6px;
  background:var(--soft);
  border-radius:12px;
  padding:4px;
  margin-top:10px;
}
.segment{
  flex:1;
  border:none;
  background:transparent;
  padding:10px;
  border-radius:10px;
  font-weight:800;
  cursor:pointer;
  color:var(--muted);
}
.segment.active{
  background:#fff;
  color:var(--primary);
  box-shadow:0 2px 8px rgba(0,0,0,.08);
}

.pill{
  display:inline-block;
  background:rgba(27,154,170,.08);
  color:#0f172a;
  border:1px solid rgba(27,154,170,.2);
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
}
.inline{display:flex; flex-wrap:wrap; gap:8px; margin-top:10px}

.banner{
  display:flex;
  gap:12px;
  align-items:flex-start;
  background:#fff;
  border:1px solid var(--border);
  border-radius:16px;
  padding:14px;
  margin-top:14px;
}
.banner-icon{font-size:22px}
.banner.warning{border-color:rgba(245,158,11,.35); background:rgba(245,158,11,.06)}
.banner.info{border-color:rgba(59,130,246,.25); background:rgba(59,130,246,.06)}
.banner.danger{border-color:rgba(239,68,68,.35); background:rgba(239,68,68,.06)}

.welcome{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px;
  margin-top:6px;
}
.badge{
  font-size:12px;
  font-weight:800;
  color:#fff;
  background:rgba(107,114,128,.9);
  padding:8px 10px;
  border-radius:999px;
  white-space:nowrap;
}
.badge.verified{background:rgba(34,197,94,.95)}
.badge.pending{background:rgba(245,158,11,.95)}

.group-card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:16px;
  padding:14px;
  display:flex; align-items:center; gap:12px;
  cursor:pointer;
  margin-bottom:10px;
}
.group-card:active{transform:scale(.99)}
.avatar{
  width:42px; height:42px;
  display:flex; align-items:center; justify-content:center;
  background:var(--soft);
  border-radius:14px;
  font-size:20px;
}
.avatar.small{width:34px;height:34px;border-radius:12px;font-size:16px}
.group-info{flex:1}
.group-name{font-weight:800; color:#0f172a}
.group-meta{font-size:12px; color:var(--muted); margin-top:2px}
.chev{color:var(--muted); font-weight:900}

.bottom-nav{
  position:absolute;
  bottom:0; left:0; right:0;
  background:#fff;
  border-top:1px solid var(--border);
  display:flex;
  justify-content:space-around;
  padding:10px 0 22px;
}
.nav-item{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  padding:6px 12px;
  border-radius:12px;
  cursor:pointer;
}
.nav-item:active{transform:scale(.97)}
.nav-icon{font-size:20px; opacity:.6}
.nav-label{font-size:11px; font-weight:700; color:var(--muted)}
.nav-item.active .nav-icon{opacity:1}
.nav-item.active .nav-label{color:var(--primary)}

.chat{padding-bottom:140px}
.chat-date{
  font-size:12px;
  color:var(--muted);
  text-align:center;
  margin:8px 0 12px;
}
.msg{display:flex; margin:10px 0}
.msg.theirs{justify-content:flex-start}
.msg.mine{justify-content:flex-end}
.bubble{
  max-width:78%;
  background:#fff;
  border:1px solid var(--border);
  border-radius:16px;
  padding:10px 12px;
  box-shadow:0 2px 10px rgba(0,0,0,.04);
}
.msg.mine .bubble{background:rgba(27,154,170,.1); border-color:rgba(27,154,170,.25)}
.meta{font-size:11px; color:var(--muted); margin-bottom:6px}
.meta .name{font-weight:800; color:#0f172a}

.composer{
  position:absolute;
  bottom:76px; left:0; right:0;
  background:#fff;
  border-top:1px solid var(--border);
  padding:10px 12px;
  display:flex; gap:10px; align-items:center;
}
.composer input{
  flex:1;
  padding:10px 12px;
  border-radius:999px;
}
.send{
  width:40px; height:40px;
  border:none; border-radius:999px;
  background:linear-gradient(135deg,var(--primary),var(--primary2));
  color:#fff;
  cursor:pointer;
}
.send:active{transform:scale(.96)}

.divider{
  margin:16px 0 10px;
  font-size:12px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.08em;
  font-weight:800;
}

.member-card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:16px;
  padding:12px;
  display:flex;
  align-items:center;
  gap:10px;
  cursor:pointer;
  margin-bottom:10px;
}
.member-info{flex:1}
.member-name{font-weight:800; color:#0f172a}
.member-meta{font-size:12px; color:var(--muted); margin-top:2px}
.chip{
  border:1px solid rgba(27,154,170,.3);
  background:rgba(27,154,170,.08);
  color:#0f172a;
  font-weight:800;
  padding:8px 10px;
  border-radius:999px;
  cursor:pointer;
}
.chip:active{transform:scale(.98)}

.profile-card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:18px;
  padding:16px;
  text-align:center;
  margin-top:8px;
  box-shadow:0 2px 10px rgba(0,0,0,.05);
}
.profile-avatar{font-size:46px}
.profile-name{font-size:18px; font-weight:900; color:#0f172a; margin-top:8px}
.profile-meta{font-size:12px; color:var(--muted); margin-top:4px}

.otp-row{display:flex; gap:8px; justify-content:space-between; margin-top:8px}
.otp{
  width:44px;
  text-align:center;
  font-size:18px;
  font-weight:900;
  padding:10px 0;
  border-radius:12px;
}

.row{display:flex; align-items:center; justify-content:space-between; gap:10px}
.actions{margin-top:12px}
.small-btn{padding:10px 12px; font-size:12px; margin-top:0}
.tags{display:flex; flex-wrap:wrap; gap:8px; margin-top:10px}
.tag{
  font-size:11px;
  font-weight:800;
  color:#0f172a;
  background:var(--soft);
  border:1px solid var(--border);
  padding:6px 10px;
  border-radius:999px;
}

.status{
  font-size:11px;
  font-weight:900;
  padding:6px 10px;
  border-radius:999px;
  color:#0f172a;
  background:var(--soft);
  border:1px solid var(--border);
}
.status.pending{background:rgba(245,158,11,.14); border-color:rgba(245,158,11,.35)}
.status.warn{background:rgba(245,158,11,.16); border-color:rgba(245,158,11,.38)}
.status.danger{background:rgba(239,68,68,.14); border-color:rgba(239,68,68,.35)}

.notif{
  display:flex;
  gap:12px;
  background:#fff;
  border:1px solid var(--border);
  border-radius:16px;
  padding:14px;
  margin-bottom:10px;
}
.dot{
  width:10px;height:10px;border-radius:999px;background:var(--primary); margin-top:6px
}

.bullets{margin-top:10px; padding-left:18px; color:#0f172a}
.bullets li{margin-bottom:8px; line-height:1.4}
.checklist{margin-top:10px; list-style:none}
.checklist li{display:flex; gap:10px; align-items:center; margin-bottom:10px}
.chk{font-size:16px}

.chat-preview{margin-top:12px}

.modal{
  position:absolute; inset:0;
  background:rgba(0,0,0,.45);
  display:flex; align-items:center; justify-content:center;
  padding:18px;
  z-index:5000;
}
.hidden{display:none}
.modal-card{
  width:100%;
  background:#fff;
  border-radius:18px;
  border:1px solid var(--border);
  box-shadow:0 18px 60px rgba(0,0,0,.35);
  overflow:hidden;
}
.modal-head{
  padding:14px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--border);
}
.modal-body{padding:14px; color:#0f172a; font-size:13px; line-height:1.55}
.modal-actions{padding:14px; border-top:1px solid var(--border)}

/* ========================================
   IMS v4 additions (keeps OrgSafe look)
   ======================================== */

/* Small utility */
.hidden{display:none !important;}

/* Anonymous toggle */
.toggle-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:10px}
.toggle{display:flex;align-items:center;gap:10px}
.switch{
  width:44px;height:26px;border-radius:999px;
  background:#e5e7eb;position:relative;cursor:pointer;
  border:1px solid var(--border);
}
.switch::after{
  content:'';
  position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:999px;
  background:#fff;box-shadow:0 2px 6px rgba(0,0,0,.2);
  transition:all .18s ease;
}
.switch.on{
  background:rgba(27,154,170,.22);
  border-color:rgba(27,154,170,.35);
}
.switch.on::after{left:21px}

/* Super admin KPI cards */
.kpi-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-top:10px}
.kpi{
  background:#fff;border:1px solid var(--border);border-radius:16px;
  padding:12px;box-shadow:0 2px 10px rgba(0,0,0,.05);
}
.kpi .k{font-size:11px;color:var(--muted);font-weight:900;text-transform:uppercase;letter-spacing:.08em}
.kpi .v{font-size:18px;font-weight:900;color:#0f172a;margin-top:6px}

/* Simple table styled like cards */
.table{width:100%;border-collapse:separate;border-spacing:0 10px;margin-top:10px}
.table tr{background:#fff}
.table td{
  padding:12px;border-top:1px solid var(--border);border-bottom:1px solid var(--border);
}
.table tr td:first-child{
  border-left:1px solid var(--border);
  border-top-left-radius:14px;border-bottom-left-radius:14px;
}
.table tr td:last-child{
  border-right:1px solid var(--border);
  border-top-right-radius:14px;border-bottom-right-radius:14px;
}
