/* DoctorShop — Patient Dashboard shell built on doctor-dashboard.css */

body.patient-ds{
  background: linear-gradient(180deg,#f7f9ff 0%, #f3f6fb 100%) fixed;
  color: var(--text);
}

.patient-shell-subtitle{
  color: var(--muted);
  font-size: .92rem;
}

.patient-side-user{
  display:grid;
  gap:4px;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:14px;
  background:rgba(255,255,255,.75);
}

.patient-side-user strong{
  font-size:.96rem;
  line-height:1.2;
}

.patient-side-user span{
  color:var(--muted);
  font-size:.86rem;
  overflow-wrap:anywhere;
}

.patient-pagehead{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:14px;
}

.patient-pagehead h1{
  margin:0;
  font-size:1.55rem;
  letter-spacing:-.02em;
}

.patient-pagehead .subtitle{
  color:var(--muted);
  margin-top:4px;
}

.controls{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

.seg{
  display:flex;
  align-items:center;
  gap:4px;
  background:var(--panel-2);
  border:1px solid var(--border);
  border-radius:14px;
  padding:4px;
}

.seg button{
  border:0;
  background:transparent;
  color:var(--muted);
  font-weight:800;
  border-radius:10px;
  padding:9px 12px;
  cursor:pointer;
}

.seg button.active{
  background:#fff;
  color:var(--text);
  box-shadow:0 1px 6px rgba(0,0,0,.08);
}

.btn{
  appearance:none;
  border:1px solid var(--border);
  background:var(--panel);
  color:var(--text);
  border-radius:12px;
  padding:10px 12px;
  cursor:pointer;
  font-weight:700;
  transition:transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.btn:hover{ box-shadow: var(--shadow); }
.btn:active{ transform: scale(.98); }

.btn.primary{
  background:linear-gradient(180deg,#1478ff,#0062c9);
  border-color:rgba(0,98,201,.45);
  color:#fff;
  box-shadow:0 14px 34px rgba(0,113,227,.18);
}

.btn.danger{
  background:rgba(239,68,68,.08);
  border-color:rgba(239,68,68,.22);
  color:#b91c1c;
  box-shadow:none;
}

.btn:disabled{
  opacity:.55;
  cursor:not-allowed;
  box-shadow:none;
}

.grid{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap:12px;
}

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

.card{
  background:rgba(255,255,255,.92);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
  min-width:0;
}

.card .hd,
.hd{
  padding:14px;
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

.card .hd h2,
.hd h2{
  margin:0;
  font-size:.96rem;
}

.card .bd,
.bd{
  padding:12px;
}

.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0 10px;
}

.row{
  background:rgba(255,255,255,.84);
}

.row td{
  padding:12px;
  vertical-align:middle;
  border-top:1px solid var(--border);
  border-bottom:1px solid var(--border);
}

.row td:first-child{
  border-left:1px solid var(--border);
  border-top-left-radius:12px;
  border-bottom-left-radius:12px;
}

.row td:last-child{
  border-right:1px solid var(--border);
  border-top-right-radius:12px;
  border-bottom-right-radius:12px;
}

.hint,
.muted{ color:var(--muted); }

.muted2{ color:#818a9a; }

.mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:5px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.72);
  color:var(--muted);
  font-weight:800;
  font-size:.78rem;
}

.badge.good{ color:#166534; border-color:rgba(34,197,94,.25); background:rgba(34,197,94,.08); }
.badge.warn{ color:#a16207; border-color:rgba(245,158,11,.28); background:rgba(245,158,11,.12); }
.badge.bad{ color:#b91c1c; border-color:rgba(239,68,68,.25); background:rgba(239,68,68,.08); }

.kpi{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

.kpi .tile{
  background:var(--panel-2);
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
}

.kpi .tile .v{
  font-size:1.35rem;
  font-weight:900;
  letter-spacing:-.02em;
}

.kpi .tile .l{
  margin-top:4px;
  color:var(--muted);
  font-size:.88rem;
}

/* Inputs + modals */
.modal-backdrop{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.34);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:60;
  padding:16px;
}

.modal-backdrop.open{ display:flex; }

.modal{
  width:min(720px, 100%);
  background:rgba(255,255,255,.96);
  border:1px solid var(--border);
  border-radius:20px;
  box-shadow:0 30px 90px rgba(15,23,42,.18);
  overflow:hidden;
}

.modal .mh,
.mh{
  padding:14px 16px;
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.modal .mh h3,
.mh h3{
  margin:0;
  font-size:1rem;
}

.modal .mb,
.mb{
  padding:14px 16px;
}

.field{
  display:grid;
  gap:6px;
  margin:10px 0;
}

label{
  color:var(--muted);
  font-weight:700;
  font-size:.78rem;
}

input, select, textarea{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
  outline:none;
}

input:focus, select:focus, textarea:focus{
  border-color:rgba(0,113,227,.35);
  box-shadow:0 0 0 3px rgba(0,113,227,.10);
}

textarea{ min-height:84px; resize:vertical; }

.actions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  flex-wrap:wrap;
  padding-top:10px;
}

.toast{
  position:fixed;
  right:16px;
  bottom:16px;
  z-index:80;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.97);
  color:var(--text);
  box-shadow:var(--shadow);
  display:none;
  max-width:min(520px, calc(100% - 32px));
}

.toast.show{ display:block; }
.toast small{ display:block; color:var(--muted); margin-top:4px; }

.patient-table-card .bd{
  overflow:auto;
}

.patient-table-card .table{
  min-width:720px;
}

.patient-mobile-list{
  display:none;
  gap:10px;
}

.patient-mobile-card{
  border:1px solid var(--border);
  border-radius:14px;
  background:rgba(255,255,255,.84);
  padding:12px;
  display:grid;
  gap:8px;
}

.patient-mobile-card__row{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
}

.patient-mobile-card__label{
  color:var(--muted);
  font-size:.78rem;
  min-width:88px;
}

.patient-mobile-card__value{
  text-align:right;
  flex:1 1 auto;
  min-width:0;
}

.patient-mobile-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.patient-pager{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  margin-top:10px;
}

.patient-pager__info{
  color:var(--muted);
  font-size:.85rem;
}

.patient-pager__controls{
  display:flex;
  gap:8px;
  align-items:center;
}

.patient-pager__controls .btn{
  padding:8px 10px;
  border-radius:10px;
}

@media (max-width:760px){
  .patient-pagehead{
    align-items:flex-start;
  }
  .patient-table-card .bd{
    overflow:visible;
  }
  .patient-table-card .table{
    display:none;
    min-width:0;
  }
  .patient-mobile-list{
    display:grid;
  }
  .patient-mobile-card__value{
    text-align:left;
  }
  .patient-mobile-card__row{
    display:grid;
    gap:3px;
  }
  .patient-mobile-card__label{
    min-width:0;
  }
  .patient-mobile-actions{
    justify-content:stretch;
  }
  .patient-mobile-actions .btn{
    flex:1 1 calc(50% - 4px);
    min-width:0;
  }
  .patient-pager{
    align-items:stretch;
  }
  .patient-pager__controls{
    width:100%;
  }
  .patient-pager__controls .btn{
    flex:1 1 0;
  }
}
