/* ═══════════════════════════════════════════════════════════════
   EasyHealth — ডাক্তার প্যানেল
   রঙ মোবাইল অ্যাপের সাথে মিলিয়ে রাখা হয়েছে
   ═══════════════════════════════════════════════════════════════ */

:root {
  --primary: #0FAFB1;
  --primary-light: #3BA9F0;
  --primary-dark: #0B7F81;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --border: #E2E8F0;
  --text: #1E293B;
  --text-muted: #64748B;
  --error: #EF4444;
  --success: #10B981;
}

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

body {
  font-family: 'Noto Sans Bengali', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.hidden { display: none !important; }

/* ── লগইন ── */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #ECFDF5, #F0F9FF);
}

.login-box {
  background: var(--surface);
  padding: 36px;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(15, 175, 177, 0.12);
  width: 100%;
  max-width: 400px;
}

.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }

.brand-mark {
  width: 46px; height: 46px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 26px; font-weight: 700;
}

.brand h1 { font-size: 21px; }
.brand p { font-size: 13px; color: var(--text-muted); }

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 16px 0 6px;
}

input[type=text], input[type=email], input[type=password],
input[type=date], textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 175, 177, 0.1);
}

.hint {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 16px;
}

/* ── বাটন ── */

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 13px 22px;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.btn-block { width: 100%; margin-top: 24px; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  color: var(--text);
}
.btn-ghost:hover { background: #F1F5F9; }

.btn-danger {
  background: var(--error);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn-round {
  background: #F1F5F9;
  border: 1px solid var(--border);
  padding: 11px 20px;
  border-radius: 24px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

.btn-remove {
  background: transparent;
  border: none;
  color: var(--error);
  font-size: 22px;
  cursor: pointer;
  padding: 0 8px;
  line-height: 1;
}

#loginBtn { width: 100%; margin-top: 24px; }

/* ── এরর ও লোডিং ── */

.error {
  background: #FEF2F2;
  color: var(--error);
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-top: 14px;
  white-space: pre-line;
}

.loading { text-align: center; padding: 36px 0; }

.spinner {
  width: 30px; height: 30px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── টপবার ── */

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 13px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand-sm { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-sm .brand-mark { width: 32px; height: 32px; font-size: 19px; border-radius: 9px; }

.topbar-right { display: flex; align-items: center; gap: 16px; }
.doctor-name { font-size: 14px; font-weight: 500; }

.toggle { display: flex; align-items: center; gap: 7px; font-size: 13px; margin: 0; }
.toggle input { width: 17px; height: 17px; accent-color: var(--primary); }
.online { color: var(--success); font-weight: 600; }

/* ── কনটেইনার ── */

.container { max-width: 860px; margin: 0 auto; padding: 26px 20px 60px; }

h2 { font-size: 20px; margin-bottom: 4px; }
h3 { font-size: 15px; margin: 22px 0 10px; }
.sub { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; }
.optional { font-weight: 400; color: var(--text-muted); font-size: 12px; }

/* ── কলের তালিকা ── */

.calls { display: flex; flex-direction: column; gap: 11px; }

.call-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.call-name { font-weight: 600; font-size: 15px; }
.call-meta { font-size: 12px; color: var(--text-muted); }

.empty {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 48px 24px;
  text-align: center;
}
.empty h3 { margin: 0 0 6px; }
.empty p { font-size: 13px; color: var(--text-muted); }

/* ── ভিডিও কল ── */

.call-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.video-area {
  position: relative;
  background: #0F172A;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.video-remote { width: 100%; height: 100%; }
.video-remote video { width: 100%; height: 100%; object-fit: cover; }

.video-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: rgba(255,255,255,.55);
  font-size: 14px;
}

.video-local {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 168px;
  aspect-ratio: 3 / 4;
  background: #1E293B;
  border-radius: 11px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.15);
}
.video-local video { width: 100%; height: 100%; object-fit: cover; }

.call-controls {
  display: flex;
  gap: 11px;
  justify-content: center;
  margin-top: 18px;
  flex-wrap: wrap;
}

.diag {
  margin-top: 14px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: ui-monospace, monospace;
  text-align: center;
}

/* ── প্রেসক্রিপশন ── */

.rx-patient {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  border-radius: 11px;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
}

.med-row, .test-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.med-row input { flex: 1; min-width: 0; }
.test-row input { flex: 1; }

@media (max-width: 640px) {
  .med-row { flex-wrap: wrap; }
  .med-row input { flex: 1 1 45%; }
  .video-local { width: 108px; }
  .topbar { flex-wrap: wrap; gap: 10px; }
}

/* ── ট্যাব ── */

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: -1px;
}

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

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.rx-card { cursor: default; }
.rx-card .call-meta { margin-top: 2px; }

/* ── রোগীর তথ্য কার্ড ── */

.patient-card { margin: 10px 0 18px; }

.pd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px 18px;
  padding: 12px 14px;
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: 11px;
}

.pd-item { display: flex; flex-direction: column; }
.pd-item span { font-size: 10px; color: var(--text-muted); }
.pd-item b { font-size: 13px; }

.warn-box {
  margin-top: 10px;
  padding: 10px 13px;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  border-radius: 10px;
  font-size: 12px;
  color: #92400E;
}

/* ── প্রেসক্রিপশন বিস্তারিত মডাল ── */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal-box {
  background: var(--surface);
  border-radius: 16px;
  width: 100%;
  max-width: 620px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 { font-size: 17px; }

.modal-body { padding: 20px; overflow-y: auto; }

.rx-sec { margin-bottom: 18px; }
.rx-sec-title {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.rx-sec-body { font-size: 14px; }

.rx-med {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  margin-bottom: 8px;
}
.rx-med-name { font-weight: 600; font-size: 14px; }
.rx-med-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.rx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rx-chip {
  background: #F0FDFA;
  border: 1px solid #A7F3D0;
  border-radius: 20px;
  padding: 3px 11px;
  font-size: 12px;
}

.call-card[data-rx] { cursor: pointer; }
.call-card[data-rx]:hover { border-color: var(--primary); }

/* ── কার জন্য প্রেসক্রিপশন ── */

.for-whom {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 13px;
  color: #1E40AF;
  margin-bottom: 10px;
}
