/* =====================================================
   SUPERADMIN GRUND – FULL MODULE CSS V3
   Dioder i topprutor + statusfärger
   ===================================================== */

.grund-wrap{
  padding:20px;
  box-sizing:border-box;
  color:#10233f;
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

.grund-flash{
  margin:0 0 16px 0;
  padding:12px 16px;
  border-radius:14px;
  font-size:14px;
  font-weight:700;
  box-shadow:0 8px 18px rgba(32,71,123,0.16);
  border:1px solid transparent;
}

.grund-flash-ok{
  background:#dcfce7;
  color:#14532d;
  border-color:#86efac;
}

.grund-flash-warn{
  background:#fef3c7;
  color:#92400e;
  border-color:#fcd34d;
}

.grund-flash-error{
  background:#fee2e2;
  color:#991b1b;
  border-color:#fca5a5;
}

.grund-flash-info{
  background:#dbeafe;
  color:#1e3a8a;
  border-color:#93c5fd;
}

.grund-summary-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(180px,1fr));
  gap:14px;
  margin-bottom:16px;
}

.grund-summary-card{
  background:linear-gradient(180deg,#0d2248 0%,#132d61 100%);
  border:2px solid rgba(84,160,255,0.18);
  border-radius:16px;
  padding:14px 16px;
  box-shadow:0 10px 22px rgba(25,67,128,0.18);
}

.grund-summary-card.ok{
  border-color:#22c55e;
  box-shadow:0 0 0 2px rgba(34,197,94,0.12);
}

.grund-summary-card.warn{
  border-color:#facc15;
  box-shadow:0 0 0 2px rgba(250,204,21,0.12);
}

.grund-summary-card.bad{
  border-color:#ef4444;
  box-shadow:0 0 0 2px rgba(239,68,68,0.12);
}

.grund-summary-card.neutral{
  border-color:#60a5fa;
}

.grund-summary-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}

.grund-summary-label{
  font-size:12px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.03em;
  color:#f9e27d;
}

.grund-summary-value{
  font-size:20px;
  font-weight:800;
  line-height:1.25;
  color:#ffffff;
  word-break:break-word;
}

.grund-summary-value.small{
  font-size:14px;
  font-weight:700;
}

.grund-dot{
  width:14px;
  height:14px;
  border-radius:999px;
  flex:0 0 14px;
  box-shadow:0 0 0 2px rgba(255,255,255,0.22);
}

.grund-dot.green{
  background:#22c55e;
  box-shadow:0 0 10px rgba(34,197,94,0.85);
}

.grund-dot.red{
  background:#ef4444;
  box-shadow:0 0 10px rgba(239,68,68,0.85);
}

.grund-dot.yellow{
  background:#facc15;
  box-shadow:0 0 10px rgba(250,204,21,0.85);
}

.grund-dot.blue{
  background:#60a5fa;
  box-shadow:0 0 10px rgba(96,165,250,0.85);
}

.grund-topbar{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom:16px;
}

.grund-topbar button{
  border:none;
  border-radius:12px;
  padding:10px 16px;
  font-weight:800;
  font-size:14px;
  cursor:pointer;
  transition:transform .12s ease, opacity .12s ease, box-shadow .12s ease;
  box-shadow:0 8px 16px rgba(26,62,117,0.18);
}

.grund-topbar button:hover{
  transform:translateY(-1px);
}

.grund-topbar button:active{
  transform:translateY(0);
}

#grund-back-users{
  background:#ef4444;
  color:#ffffff;
}

#grund-refresh{
  background:#3b82f6;
  color:#ffffff;
}

#grund-save{
  background:#22c55e;
  color:#ffffff;
}

#grund-agent-login{
  background:#facc15;
  color:#1f2937;
}

#grund-agent-logout{
  background:#fb7185;
  color:#ffffff;
}

.grund-user-card{
  display:flex;
  align-items:center;
  gap:14px;
  background:linear-gradient(180deg,#0d2248 0%,#17366f 100%);
  border:1px solid rgba(84,160,255,0.22);
  border-radius:18px;
  padding:16px 18px;
  margin-bottom:16px;
  box-shadow:0 10px 24px rgba(25,67,128,0.18);
}

.grund-user-avatar{
  width:58px;
  height:58px;
  border-radius:999px;
  background:linear-gradient(180deg,#ef4444 0%,#dc2626 100%);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:24px;
  font-weight:900;
  position:relative;
  flex:0 0 58px;
}

.grund-user-dot{
  position:absolute;
  right:-2px;
  bottom:-2px;
  width:16px;
  height:16px;
  border-radius:999px;
  border:2px solid #f8fbff;
}

.grund-user-dot.on{
  background:#22c55e;
}

.grund-user-dot.off{
  background:#ef4444;
}

.grund-user-name{
  font-size:24px;
  font-weight:900;
  line-height:1.1;
  color:#ffffff;
}

.grund-user-meta{
  margin-top:4px;
  font-size:14px;
  color:#dbeafe;
}

.grund-main-layout{
  display:grid;
  grid-template-columns:minmax(360px,0.9fr) minmax(520px,1.1fr);
  gap:18px;
  align-items:start;
}

.grund-left,
.grund-right{
  min-width:0;
}

.grund-left-stack{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.grund-card{
  background:linear-gradient(180deg,#0d2248 0%,#17366f 100%);
  border:1px solid rgba(84,160,255,0.22);
  border-radius:18px;
  padding:18px;
  box-shadow:0 12px 26px rgba(25,67,128,0.16);
  color:#ffffff;
}

.grund-card-light{
  background:linear-gradient(180deg,#eef6ff 0%,#dfeeff 100%);
  border:1px solid rgba(96,165,250,0.24);
  color:#10233f;
}

.grund-card h3{
  margin:0 0 12px 0;
  font-size:18px;
  font-weight:900;
}

.grund-card-light h3{
  color:#12315f;
}

.warn-card{
  border-left:5px solid #facc15;
}

.grund-right-card{
  min-height:100%;
}

.grund-detail{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.grund-detail-title{
  font-size:24px;
  font-weight:900;
  line-height:1.15;
  color:#ffffff;
}

.dark-title{
  color:#12315f;
}

.grund-detail-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.grund-detail-grid > div{
  background:rgba(255,255,255,0.55);
  border:1px solid rgba(96,165,250,0.20);
  border-radius:14px;
  padding:12px;
  min-height:66px;
  box-sizing:border-box;
  color:#10233f;
}

.grund-detail-grid strong{
  display:inline-block;
  margin-bottom:6px;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.03em;
  color:#1d4ed8;
}

.grund-detail-block{
  background:rgba(255,255,255,0.55);
  border:1px solid rgba(96,165,250,0.20);
  border-radius:14px;
  padding:14px;
}

.grund-detail-block.danger{
  border-color:rgba(239,68,68,0.35);
  background:#fff1f2;
}

.grund-detail-block-title{
  font-size:13px;
  font-weight:900;
  margin-bottom:10px;
  color:#12315f;
}

.grund-note{
  font-size:14px;
  line-height:1.5;
  margin-top:6px;
}

.dark-text{
  color:#1e3a5f;
}

.ok-note{
  color:#14532d;
  background:#dcfce7;
  padding:8px 10px;
  border-radius:8px;
  font-weight:700;
}

.warn-note{
  color:#92400e;
  background:#fef3c7;
  padding:8px 10px;
  border-radius:8px;
  font-weight:700;
}

.grund-avatar-preview-wrap{
  width:100%;
  min-height:180px;
  border-radius:16px;
  background:#ffffff;
  border:2px dashed #93c5fd;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  margin-top:8px;
}

.grund-avatar-preview{
  max-width:100%;
  max-height:260px;
  object-fit:contain;
  display:block;
}

.grund-avatar-empty{
  font-size:16px;
  font-weight:800;
  color:#64748b;
  padding:20px;
  text-align:center;
}

.grund-form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.grund-field{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.grund-field label{
  font-size:13px;
  font-weight:800;
  color:#12315f;
}

.grund-field input,
.grund-field textarea{
  border:1px solid rgba(96,165,250,0.28);
  background:#ffffff;
  color:#10233f;
  padding:10px 12px;
  border-radius:12px;
  box-sizing:border-box;
  outline:none;
  width:100%;
}

.grund-field input{
  height:42px;
}

.grund-field textarea{
  resize:vertical;
  min-height:84px;
}

.grund-field input:focus,
.grund-field textarea:focus{
  border-color:#2563eb;
  box-shadow:0 0 0 3px rgba(37,99,235,0.14);
}

.grund-static{
  min-height:42px;
  display:flex;
  align-items:center;
  padding:0 12px;
  border-radius:12px;
  background:#ffffff;
  border:1px solid rgba(96,165,250,0.24);
  color:#10233f;
}

.grund-switch-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.grund-switch{
  display:flex;
  align-items:center;
  gap:10px;
  background:#ffffff;
  border:1px solid rgba(96,165,250,0.24);
  border-radius:14px;
  padding:12px;
  min-height:52px;
  box-sizing:border-box;
}

.grund-switch input{
  width:18px;
  height:18px;
}

.grund-switch span{
  font-weight:800;
  color:#12315f;
}

.grund-detail-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.grund-detail-actions button{
  border:none;
  border-radius:12px;
  padding:10px 16px;
  font-weight:800;
  font-size:14px;
  cursor:pointer;
  box-shadow:0 8px 16px rgba(26,62,117,0.14);
  transition:transform .12s ease, opacity .12s ease;
}

.grund-detail-actions button:hover{
  transform:translateY(-1px);
}

.grund-detail-actions button:active{
  transform:translateY(0);
}

#grund-detail-agent-login{
  background:#facc15;
  color:#1f2937;
}

#grund-detail-agent-logout{
  background:#fb7185;
  color:#ffffff;
}

.grund-empty{
  background:#ffffff;
  border:1px solid rgba(96,165,250,0.16);
  border-radius:16px;
  padding:16px;
  color:#12315f;
}

.grund-error{
  border-color:rgba(239,68,68,0.35);
  color:#b91c1c;
}

.grund-footer{
  margin-top:16px;
  font-size:13px;
  color:#35527b;
}
.grund-dirty-banner{
  margin:0 0 16px 0;
  padding:14px 18px;
  border-radius:14px;
  background:#fde047;
  color:#78350f;
  border:3px solid #f59e0b;
  font-size:16px;
  font-weight:900;
  box-shadow:0 10px 22px rgba(245,158,11,0.28);
}
.grund-field.field-ok input,
.grund-field.field-ok textarea{
  border:2px solid #22c55e;
  background:#f0fdf4;
}

.grund-field.field-warn input,
.grund-field.field-warn textarea{
  border:2px solid #facc15;
  background:#fffbeb;
}

.grund-field.field-bad input,
.grund-field.field-bad textarea{
  border:2px solid #ef4444;
  background:#fef2f2;
}

.grund-phone-rule{
  margin-top:12px;
  padding:10px 12px;
  border-radius:12px;
  font-weight:800;
}

.grund-phone-rule.field-ok{
  background:#dcfce7;
  color:#166534;
  border:2px solid #22c55e;
}

.grund-phone-rule.field-bad{
  background:#fef2f2;
  color:#991b1b;
  border:2px solid #ef4444;
}
#grund-save.is-dirty{
  box-shadow:0 0 0 4px rgba(250,204,21,0.45), 0 8px 16px rgba(26,62,117,0.18);
  filter:saturate(1.12);
}
@media (max-width: 1350px){
  .grund-summary-grid{
    grid-template-columns:repeat(3,minmax(180px,1fr));
  }
}

@media (max-width: 1150px){
  .grund-summary-grid{
    grid-template-columns:repeat(2,minmax(180px,1fr));
  }

  .grund-main-layout{
    grid-template-columns:1fr;
  }

  .grund-detail-grid,
  .grund-form-grid,
  .grund-switch-grid{
    grid-template-columns:1fr;
  }
}

@media (max-width: 700px){
  .grund-wrap{
    padding:14px;
  }

  .grund-summary-grid{
    grid-template-columns:1fr;
  }

  .grund-topbar{
    flex-direction:column;
  }
      .grund-topbar button{
    width:100%;
  }
    .grund-user-name{
    font-size:20px;
  }
}