:root {
  --bg: #f5f2ee;
  --panel: #ffffff;
  --text: #1b1f24;
  --muted: #6b7280;
  --accent: #0f766e;
  --accent-2: #0ea5a5;
  --danger: #dc2626;
  --border: #e5e7eb;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  background: radial-gradient(circle at top left, #f8fafc, #f5f2ee 40%, #f1ebe5 100%);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  background: #ffffffcc;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  gap: 16px;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.5px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
}

.nav a {
  font-weight: 600;
  color: var(--muted);
}

.menu {
  position: relative;
  margin-left: auto;
}

.menu summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
}

.menu summary::-webkit-details-marker {
  display: none;
}

.menu-panel {
  position: absolute;
  right: 0;
  top: 28px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 8px;
  display: grid;
  gap: 6px;
  min-width: 140px;
  z-index: 20;
}

.menu-panel a {
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--text);
}

.menu-panel a:hover {
  background: #f3f4f6;
}

.notif-bar {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 10px 28px;
  background: #fff7ed;
  border-bottom: 1px solid #fed7aa;
  color: #9a3412;
  font-weight: 600;
}

.user-pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-weight: 600;
  font-size: 0.85rem;
}

.container {
  max-width: 1100px;
  margin: 24px auto 48px;
  padding: 0 20px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.card.narrow {
  max-width: 420px;
  margin: 40px auto;
}

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

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafafa;
  gap: 12px;
  flex-wrap: wrap;
}

.title {
  font-weight: 600;
}

.patient-name {
  font-size: 1.6rem;
  letter-spacing: 0.2px;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.muted.small {
  font-size: 0.8rem;
}

.mini-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0;
}

input, textarea, select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  width: 100%;
}

textarea {
  min-height: 100px;
}

.btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  cursor: pointer;
  font-weight: 600;
}

.btn.icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn.icon::before {
  content: "";
  width: 14px;
  height: 14px;
  display: inline-block;
  background-color: currentColor;
  -webkit-mask-size: 14px 14px;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-size: 14px 14px;
  mask-repeat: no-repeat;
  mask-position: center;
}

.btn.icon.pencil::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25Zm14.71-9.04a1.003 1.003 0 0 0 0-1.42l-2.5-2.5a1.003 1.003 0 0 0-1.42 0l-1.83 1.83 3.75 3.75 1.99-1.66Z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25Zm14.71-9.04a1.003 1.003 0 0 0 0-1.42l-2.5-2.5a1.003 1.003 0 0 0-1.42 0l-1.83 1.83 3.75 3.75 1.99-1.66Z'/></svg>");
}

.btn.icon.trash::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M6 7h12l-1 14H7L6 7Zm3-3h6l1 2H8l1-2Z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M6 7h12l-1 14H7L6 7Zm3-3h6l1 2H8l1-2Z'/></svg>");
}

.btn.icon.check::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/></svg>");
}

.btn.icon.copy::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M16 1H4a2 2 0 0 0-2 2v12h2V3h12V1Zm3 4H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2Zm0 16H8V7h11v14Z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M16 1H4a2 2 0 0 0-2 2v12h2V3h12V1Zm3 4H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2Zm0 16H8V7h11v14Z'/></svg>");
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn.danger {
  background: #fff0f0;
  color: var(--danger);
  border-color: #fecaca;
}

.badge {
  background: #fef3c7;
  color: #92400e;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge.success {
  background: #dcfce7;
  color: #166534;
}

.pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: #ecfeff;
  color: #155e75;
  font-weight: 600;
}

.meter {
  height: 8px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
  margin-top: 6px;
}

.meter span {
  display: block;
  height: 100%;
}

.meter.green span { background: #16a34a; }
.meter.orange span { background: #f59e0b; }
.meter.red span { background: #dc2626; }

.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

@media (max-width: 768px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
  }

  .container {
    padding: 0 14px;
  }

  .card {
    padding: 16px;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .menu-panel {
    right: auto;
    left: 0;
  }
}
