/* ============================================================
   Izal PHC — brand stylesheet (the only CSS file)
   Brand: blue #1b6ec2 / deep #0d4a8f / sky #eaf3fb / green #4caf7d
   RTL-first: logical properties only (inline-start/end), so the
   English LTR view mirrors without extra rules.
   ============================================================ */

:root {
  --blue: #1b6ec2;
  --deep: #0d4a8f;
  --sky: #eaf3fb;
  --card-border: #d3e6f6;
  --green: #4caf7d;
  --green-dark: #3d9268;
  --ink: #17324d;
  --muted: #5b7590;
  --amber: #e8a13a;
  --red: #d9534f;
  --radius: 14px;
  --font-display: 'Cairo', 'Tajawal', sans-serif;
  --font-body: 'Tajawal', 'Outfit', sans-serif;
}

[lang="en"] body,
html[lang="en"] {
  --font-display: 'Outfit', 'Cairo', sans-serif;
  --font-body: 'Outfit', 'Tajawal', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--sky);
}

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.35; color: var(--deep); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.container { max-width: 1100px; margin-inline: auto; padding-inline: 1rem; }
.container.narrow { max-width: 720px; }

/* ---------- header ---------- */
.header-band {
  position: relative;
  background: linear-gradient(135deg, var(--deep), var(--blue));
  color: #fff;
  overflow: hidden;
}
.ecg {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  width: 100%;
  height: 46px;
  color: var(--green);
  opacity: .5;
  pointer-events: none;
}
.header-inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding-block: .9rem 1.4rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: #fff;
  min-width: 0;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  flex: none;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  background: #fff;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-family: var(--font-display); font-size: 1.05rem; line-height: 1.4; }
.brand-text em { font-style: normal; color: #a8e6c7; font-size: .88rem; font-weight: 500; }
.header-actions { display: flex; align-items: center; gap: .5rem; }
.header-wa { display: none; }
.lang-btn {
  font-family: var(--font-body);
  font-size: .85rem;
  font-weight: 700;
  color: #fff;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 999px;
  padding: .3rem .95rem;
  cursor: pointer;
}
.lang-btn:hover { background: rgba(255,255,255,.28); }

/* ---------- nav ---------- */
.site-nav {
  background: #fff;
  border-bottom: 1px solid var(--card-border);
  box-shadow: 0 2px 10px rgba(13,74,143,.06);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-inner { display: flex; flex-direction: column; }
.nav-toggle {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  color: var(--deep);
  background: none;
  border: 0;
  padding: .7rem 0;
  text-align: start;
  cursor: pointer;
}
.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0 0 .6rem;
  display: none;
  flex-direction: column;
  gap: .1rem;
}
.nav-menu.open { display: flex; }
.nav-menu a {
  display: block;
  padding: .45rem .8rem;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 500;
}
.nav-menu a:hover { background: var(--sky); text-decoration: none; }
.nav-menu a.active { background: var(--blue); color: #fff; }

@media (min-width: 800px) {
  .header-wa { display: inline-flex; }
  .nav-toggle { display: none; }
  .nav-menu { display: flex !important; flex-direction: row; flex-wrap: wrap; padding: .45rem 0; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .98rem;
  border-radius: 999px;
  padding: .55rem 1.5rem;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
  transition: transform .1s ease, box-shadow .1s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(13,74,143,.18); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-whatsapp { background: var(--green); color: #fff; }
.btn-outline { background: #fff; color: var(--blue); border-color: var(--blue); }
.btn-sm { font-size: .86rem; padding: .3rem 1rem; }

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--deep), var(--blue) 70%);
  color: #fff;
  text-align: center;
  padding-block: 2.6rem 3rem;
}
.hero h1 { color: #fff; font-size: clamp(1.45rem, 4vw, 2.3rem); margin: 0 0 .4rem; }
.hero-tagline {
  color: #a8e6c7;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  margin: 0 0 .8rem;
}
.hero-sub { max-width: 620px; margin: 0 auto 1.4rem; opacity: .93; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: center; }

/* ---------- sections & cards ---------- */
.section { padding-block: 2.4rem; }
.section-alt { background: #fff; border-block: 1px solid var(--card-border); }
.section-title {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  margin: 0 0 1.2rem;
  padding-inline-start: .85rem;
  border-inline-start: 5px solid var(--green);
}
.page-head { padding-block-start: 2rem; }
.page-lead { color: var(--muted); max-width: 700px; margin-block: -0.6rem 1.4rem; }
.page-note { color: var(--muted); font-size: .92rem; margin-block-start: 1.2rem; }
.section-more { margin-block-start: 1rem; font-weight: 700; }

.card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(13,74,143,.05);
}
.empty-card { padding: 1.6rem; text-align: center; color: var(--muted); }
.empty-card .btn { margin-block-start: .6rem; }

.grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) {
  .services-grid, .news-grid { grid-template-columns: repeat(3, 1fr); }
  .doctors-grid, .contact-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- services ---------- */
.service-card { padding: 1.2rem; text-align: center; }
.service-card h3 { font-size: 1.05rem; margin: .5rem 0 .3rem; }
.service-card p { font-size: .9rem; color: var(--muted); margin: 0; }
.service-icon {
  width: 62px; height: 62px;
  margin-inline: auto;
  display: grid; place-items: center;
  font-size: 1.9rem;
  background: var(--sky);
  border: 1px solid var(--card-border);
  border-radius: 50%;
}
.icon-whatsapp { display: block; }
.icon-whatsapp-inline { flex: none; }
.service-icon-whatsapp {
  color: var(--green);
  font-size: 0;
}

/* ---------- doctors ---------- */
.doctor-card { padding: 1.2rem; text-align: center; }
.doctor-card h3 { font-size: 1.02rem; margin: .6rem 0 .35rem; }
.doctor-card p { font-size: .88rem; color: var(--muted); }
.doctor-photo {
  width: 96px; height: 96px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--sky);
  margin-inline: auto;
}
.doctor-photo-placeholder {
  display: grid; place-items: center;
  font-size: 2.3rem;
  background: var(--sky);
}

/* ---------- schedule table ---------- */
.table-wrap { overflow-x: auto; }
.schedule-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.schedule-table th, .schedule-table td {
  padding: .7rem .9rem;
  text-align: start;
  border-bottom: 1px solid var(--card-border);
  white-space: nowrap;
}
.schedule-table thead th {
  background: var(--deep);
  color: #fff;
  font-family: var(--font-display);
  font-size: .92rem;
}
.public-schedule-table th,
.public-schedule-table td {
  text-align: center;
}
.public-schedule-table .badge {
  margin-inline: auto;
}
.schedule-table tbody tr:last-child td { border-bottom: 0; }
.schedule-table tbody tr:hover { background: var(--sky); }

/* ---------- badges ---------- */
.badge {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  padding: .12rem .7rem;
  border-radius: 999px;
  background: var(--sky);
  color: var(--deep);
  border: 1px solid var(--card-border);
}
.badge-specialty { background: #eaf6f0; color: var(--green-dark); border-color: #cdeadd; }
.badge-ok { background: #e6f5ec; color: #256e4a; border-color: #bfe5d0; }
.badge-limited { background: #fdf3e2; color: #9a6614; border-color: #f3ddb0; }
.badge-out { background: #fdeaea; color: #a13030; border-color: #f2c6c6; }
.badge-ministry { background: var(--deep); color: #fff; border-color: var(--deep); }
.badge-pinned { background: #fff8e6; color: #8a6d1a; border-color: #efe0ae; }

/* ---------- filter bar / forms ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
  margin-block-end: 1.2rem;
}
.filter-bar label { font-weight: 700; color: var(--deep); }
.filter-bar select, .filter-bar input,
.notify-form input {
  font-family: var(--font-body);
  font-size: .95rem;
  padding: .45rem .9rem;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  min-width: 0;
}
.filter-bar input[type="search"] { flex: 1 1 200px; }
.filter-bar select:focus, .filter-bar input:focus, .notify-form input:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

/* ---------- pharmacy ---------- */
.med-list { display: flex; flex-direction: column; gap: .8rem; }
.med-card {
  padding: 1rem 1.2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
}
.med-main h3 { margin: 0 0 .3rem; font-size: 1.05rem; }
.med-badges { display: flex; flex-wrap: wrap; gap: .35rem; }
.med-updated { font-size: .8rem; color: var(--muted); margin: .35rem 0 0; }
.notify-box summary { list-style: none; }
.notify-box summary::-webkit-details-marker { display: none; }
.notify-form {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-block-start: .7rem;
  padding: .8rem;
  background: var(--sky);
  border-radius: var(--radius);
}

/* ---------- news ---------- */
.news-card { overflow: hidden; display: flex; flex-direction: column; }
.news-card img { width: 100%; height: 165px; object-fit: cover; }
.news-card-body { padding: 1rem 1.2rem 1.2rem; }
.news-card h3 { font-size: 1.05rem; margin: .5rem 0 .3rem; }
.news-card h3 a { color: var(--deep); }
.news-card p { font-size: .92rem; color: var(--muted); margin: 0; }
.news-date { font-size: .8rem !important; margin-block-end: .4rem !important; }
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .9rem;
  margin-block-start: 1.5rem;
  font-weight: 700;
}

/* ---------- article / about / booking ---------- */
.article-card { padding: 1.6rem; }
.article-card h1 { font-size: 1.5rem; margin: .4rem 0; }
.article-card h2 { font-size: 1.15rem; margin: 1.4rem 0 .4rem; }
.article-image { width: 100%; border-radius: var(--radius); margin-block-end: .8rem; }
.article-body { white-space: normal; }
.about-tagline { color: var(--green-dark); font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }

.booking-card { padding: 1.6rem; }
.booking-card h2 { margin-block-start: 0; }
.booking-info { list-style: none; padding: 0; margin: 1rem 0; display: flex; flex-direction: column; gap: .4rem; }
.booking-cta {
  background: var(--sky);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  margin-block-start: 1rem;
}

/* ---------- contact ---------- */
.contact-card {
  padding: 1.3rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}
.contact-card h3 { margin: .5rem 0 .3rem; }
.contact-card p {
  color: var(--muted);
  font-size: .92rem;
  min-height: 3.6em;
  margin-bottom: 0;
}
.contact-card .btn {
  margin-top: auto;
}
.contact-glyph {
  display: block;
  font-size: 1.35rem;
  line-height: 1;
}
.service-icon-phone {
  color: #e13a74;
}
.service-icon-map {
  color: #d94566;
}
.service-icon-facebook {
  color: #1877f2;
}
.contact-glyph-facebook {
  font-size: 1.9rem;
  font-weight: 700;
  transform: translateY(1px);
}

/* ---------- messages ---------- */
.messages { margin-block-start: 1rem; }
.message {
  padding: .7rem 1.1rem;
  border-radius: var(--radius);
  margin-block-end: .5rem;
  font-weight: 500;
  border: 1px solid;
}
.message-success { background: #e6f5ec; color: #256e4a; border-color: #bfe5d0; }
.message-info { background: var(--sky); color: var(--deep); border-color: var(--card-border); }
.message-error { background: #fdeaea; color: #a13030; border-color: #f2c6c6; }

/* ---------- footer ---------- */
.site-footer {
  margin-block-start: 2.5rem;
  background: linear-gradient(135deg, var(--deep), var(--blue));
  color: #dcebfa;
}
.footer-grid {
  display: grid;
  gap: 1.6rem;
  grid-template-columns: 1fr;
  padding-block: 2.2rem;
}
@media (min-width: 720px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-col h3 { color: #fff; font-size: 1.02rem; margin: 0 0 .6rem; }
.footer-col p { font-size: .92rem; margin: .3rem 0; }
.footer-tagline { color: #a8e6c7; font-family: var(--font-display); font-weight: 700; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-block-end: .35rem; }
.footer-links a { color: #dcebfa; font-size: .95rem; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.18);
  padding-block: .9rem;
  font-size: .85rem;
  text-align: center;
}
.footer-bottom p { margin: 0; }

/* ---------- WhatsApp float ---------- */
.wa-float {
  position: fixed;
  inset-inline-end: 1.1rem;
  bottom: 1.1rem;
  z-index: 90;
  width: 54px; height: 54px;
  display: grid; place-items: center;
  background: var(--green);
  color: #fff;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
.wa-float:hover { background: var(--green-dark); }

/* ---------- manage panel ---------- */
.manage-body {
  min-height: 100vh;
  background: linear-gradient(180deg, #f3f8fd 0%, var(--sky) 100%);
}
.manage-header {
  background: linear-gradient(135deg, var(--deep), var(--blue));
  color: #fff;
  box-shadow: 0 3px 14px rgba(13,74,143,.14);
}
.manage-header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: "brand public actions";
  align-items: center;
  gap: 1rem;
  padding-block: 1rem;
}
.manage-brand {
  grid-area: brand;
  justify-self: start;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .9rem;
}
.manage-public-link {
  grid-area: public;
  justify-self: center;
  text-align: center;
  color: #dcebfa;
  font-weight: 700;
}
.manage-header-actions {
  grid-area: actions;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.manage-nav {
  background: rgba(255,255,255,.12);
  border-top: 1px solid rgba(255,255,255,.12);
}
.manage-nav-inner {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding-block: .65rem;
}
.manage-nav a {
  color: #fff;
  padding: .4rem .9rem;
  border-radius: 999px;
  font-weight: 700;
}
.manage-nav a:hover,
.manage-nav a.active {
  background: rgba(255,255,255,.18);
  text-decoration: none;
}
.manage-main {
  padding-block: 2rem 3rem;
}
.manage-auth-wrap {
  max-width: 520px;
  margin: 2rem auto 0;
}
.manage-auth-card,
.manage-panel {
  padding: 1.4rem;
}
.manage-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.manage-stats {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1rem;
  margin-block-end: 1rem;
}
@media (min-width: 700px) {
  .manage-stats {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}
.manage-stat-card {
  padding: 1.2rem;
  text-align: center;
}
.manage-stat-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--deep);
}
.manage-stat-card span {
  color: var(--muted);
  font-weight: 700;
}
.manage-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 980px) {
  .manage-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .manage-grid-wide {
    grid-template-columns: minmax(260px, .9fr) minmax(0, 2fr);
  }
}
.manage-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-block-end: 1rem;
}
.manage-panel-head h2 {
  margin: 0;
  font-size: 1.15rem;
}
.manage-subpanel {
  margin-block-end: 1.2rem;
  padding: 1rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: #f9fcff;
}
.manage-subpanel h3 {
  margin: 0 0 .8rem;
  font-size: 1rem;
}
.manage-list,
.manage-selector-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.manage-list li,
.manage-selector-list li {
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: #fff;
  padding: .85rem 1rem;
}
.manage-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem .9rem;
}
.manage-selector-list a {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  color: var(--ink);
}
.manage-selector-list a.active {
  color: var(--deep);
  font-weight: 700;
}
.manage-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.manage-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.manage-form-grid.single {
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  .manage-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.manage-span-2 {
  grid-column: 1 / -1;
}
.manage-form label {
  display: inline-block;
  margin-block-end: .35rem;
  color: var(--deep);
  font-weight: 700;
}
.manage-input,
.manage-form input,
.manage-form select,
.manage-form textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: .96rem;
  padding: .62rem .9rem;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}
.manage-form input[type="checkbox"] {
  width: auto;
  margin-inline-end: .35rem;
}
.manage-checkbox {
  display: flex;
  align-items: center;
}
.manage-checkbox label {
  margin: 0;
}
.manage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}
.manage-inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}
.manage-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}
.manage-link-btn {
  background: none;
  border: 0;
  color: var(--blue);
  font: inherit;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}
.manage-link-btn:hover {
  text-decoration: underline;
}
.pharmacy-editor {
  padding: 1rem 1.1rem;
  margin-block-end: .9rem;
}
.pharmacy-page-shell {
  margin-block-start: -1.1rem;
}
.calendar-page-shell {
  margin-block-start: -1.1rem;
}
.doctors-page-shell {
  margin-block-start: -1.1rem;
}
.pharmacy-page-head {
  padding-block-start: 0;
  margin-block-end: .85rem;
}
.pharmacy-page-head .page-lead {
  margin-block-end: .9rem;
}
.calendar-page-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding-block-start: 0;
  margin-block-end: .85rem;
  text-align: start;
}
.calendar-page-head .page-lead {
  margin-block-end: .9rem;
}
.calendar-page-head .manage-actions {
  width: 100%;
  justify-content: center;
  align-items: center;
}
.calendar-page-head .page-note {
  margin: 0;
  text-align: center;
}
.doctors-page-head {
  padding-block-start: 0;
  margin-block-end: .85rem;
}
.doctors-page-head .page-lead {
  margin-block-end: .9rem;
}
.pharmacy-page-content {
  display: grid;
  gap: 0;
}
.pharmacy-editor-inline {
  margin-block-end: 1rem;
}
.pharmacy-editor .manage-panel-head {
  margin-block-end: .75rem;
}
.pharmacy-editor-form {
  gap: .75rem;
}
.pharmacy-editor-grid {
  align-items: end;
  gap: .75rem;
}
.pharmacy-editor-field label {
  font-size: .85rem;
  margin-block-end: .25rem;
}
.pharmacy-editor-field .manage-input {
  min-height: 42px;
}
.pharmacy-editor-checkbox {
  min-height: 42px;
  align-self: end;
  padding-block-end: .55rem;
}
.pharmacy-editor-actions {
  align-self: end;
  justify-content: flex-start;
  padding-block-end: .1rem;
}
.pharmacy-form-errors ul,
.pharmacy-editor-field ul,
.pharmacy-editor-checkbox ul {
  margin: .25rem 0 0;
  padding-inline-start: 1rem;
  color: #a13030;
  font-size: .85rem;
}
.pharmacy-table-panel {
  padding: 1rem 1.1rem;
}
.pharmacy-table-head {
  margin-block-end: .75rem;
}
.pharmacy-table-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
}
.pharmacy-table-head .page-note {
  margin: 0;
  max-width: none;
}
.pharmacy-table {
  min-width: 0;
}
.pharmacy-table th,
.pharmacy-table td {
  padding: .8rem .7rem;
  vertical-align: middle;
}
.pharmacy-name-cell {
  font-weight: 700;
}
.pharmacy-update-form {
  flex-wrap: nowrap;
  gap: .45rem;
}
.pharmacy-availability-select {
  min-width: 150px;
  max-width: 190px;
  padding: .45rem .7rem;
}
.pharmacy-row-actions {
  flex-wrap: nowrap;
  gap: .45rem;
}
.pharmacy-row-actions form {
  margin: 0;
}
.manage-dialog {
  width: min(920px, calc(100vw - 2rem));
  border: 0;
  padding: 0;
  background: transparent;
}
.manage-dialog::backdrop {
  background: rgba(9, 34, 66, .45);
  backdrop-filter: blur(2px);
}
.manage-dialog-card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(18, 46, 90, .18);
  padding: 1rem 1.1rem 1.1rem;
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
}
.manage-dialog-narrow {
  width: min(440px, calc(100vw - 2rem));
}
.manage-dialog-narrow p {
  margin: .2rem 0 .8rem;
}
.confirm-delete-name {
  font-weight: 700;
  color: var(--deep);
}
.btn-danger {
  background: var(--red);
  color: #fff;
}
.pharmacy-dialog-form {
  gap: .9rem;
}
.pharmacy-dialog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem 1rem;
  align-items: end;
}
.pharmacy-dialog-field {
  min-width: 0;
}
.pharmacy-dialog-field .manage-input {
  width: 100%;
}
.pharmacy-dialog-checkbox {
  align-self: center;
  padding-block-end: 0;
  min-height: auto;
}
.pharmacy-dialog-actions {
  justify-content: flex-start;
  gap: .65rem;
  margin-top: .15rem;
}
.calendar-dialog-notes {
  grid-column: 1 / -1;
}
.calendar-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .9rem;
  flex-wrap: wrap;
}
.calendar-dialog-footer .pharmacy-dialog-actions {
  margin-top: 0;
  margin-inline-start: 0;
  justify-content: center;
  align-items: center;
}
.weekly-calendar-panel {
  padding: 1rem 1.1rem;
}
.weekly-calendar-table {
  width: 100%;
  min-width: 920px;
  table-layout: fixed;
}
/* doctor column stays visible while the week scrolls */
.weekly-calendar-table th:first-child,
.weekly-calendar-table td:first-child {
  position: sticky;
  inset-inline-start: 0;
  width: 180px;
  background: #fff;
  z-index: 2;
}
.weekly-calendar-table thead th:first-child {
  background: var(--deep);
  z-index: 3;
}
.weekly-calendar-table tbody tr:hover td:first-child {
  background: var(--sky);
}
.weekly-calendar-table th,
.weekly-calendar-table td {
  padding: .6rem .4rem; /* narrow columns: the default .9rem inline padding starves the slot cards */
  vertical-align: middle;
  text-align: center;
  white-space: normal; /* outranks .schedule-table's nowrap so long names wrap instead of spilling */
}
.weekly-calendar-table thead th {
  text-align: center;
}
.weekly-day-head .weekly-day-name {
  font-weight: 700;
}
.weekly-day-head .weekly-day-date {
  margin-top: .15rem;
  font-size: .8rem;
  font-weight: 500;
  opacity: .85;
}
.weekly-calendar-doctor-cell {
  text-align: center;
}
.weekly-calendar-doctor-cell strong,
.weekly-calendar-doctor-cell span {
  display: block;
}
.weekly-calendar-doctor-cell span {
  margin-top: .2rem;
  color: var(--muted);
  font-size: .9rem;
}
.weekly-calendar-day-cell {
  text-align: center;
}
.weekly-slot-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .45rem;
}
.weekly-slot-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  width: 100%;
  padding: .5rem .3rem;
  border: 1px solid #cfe1f4;
  border-radius: 14px;
  background: #f7fbff;
  text-align: center;
}
.weekly-slot-card strong {
  color: var(--deep);
  font-size: .88rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}
/* start/end stacked on two fixed lines so every card aligns identically */
.weekly-slot-time {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .05rem;
}
.weekly-slot-time span {
  white-space: nowrap;
  line-height: 1.25;
}
.weekly-slot-time span + span {
  color: var(--blue);
  font-weight: 600;
}
.weekly-slot-card span {
  color: var(--muted);
  font-size: .85rem;
}
.weekly-slot-card-inactive {
  background: #fbfbfb;
  border-color: #e1e5ea;
  opacity: .78;
}
.weekly-slot-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .65rem;
  font-size: .9rem;
}
.weekly-slot-actions form {
  margin: 0;
}
.weekly-slot-empty {
  color: var(--muted);
  font-size: .88rem;
  padding: .3rem 0;
  text-align: center;
}
.weekly-slot-add {
  display: inline-flex;
  margin-top: .55rem;
  justify-content: center;
  font-weight: 700;
}
@media (min-width: 760px) {
  .pharmacy-editor-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) 180px 180px auto;
  }
  .pharmacy-dialog-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 180px 180px;
  }
}
@media (max-width: 759px) {
  .pharmacy-update-form,
  .pharmacy-row-actions {
    flex-wrap: wrap;
  }
  .pharmacy-availability-select {
    min-width: 100%;
    max-width: none;
  }
  .pharmacy-page-shell {
    margin-block-start: -.5rem;
  }
  .doctors-page-shell {
    margin-block-start: -.5rem;
  }
  .pharmacy-dialog-grid {
    grid-template-columns: 1fr;
  }
  .pharmacy-dialog-actions {
    flex-wrap: wrap;
  }
  .calendar-dialog-footer {
    align-items: flex-start;
  }
}

/* ---------- mobile refinements (public + manage) ---------- */
@media (max-width: 640px) {
  .container { padding-inline: .8rem; }

  /* public site */
  .brand { gap: .55rem; }
  .brand-mark { width: 40px; height: 40px; }
  .brand-mark img { width: 40px; height: 40px; }
  .brand-text strong { font-size: .92rem; }
  .brand-text em { font-size: .78rem; }
  .hero { padding-block: 2rem 2.4rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .section { padding-block: 1.7rem; }
  .page-head { padding-block-start: 1.4rem; }
  .schedule-table th, .schedule-table td { padding: .55rem .6rem; font-size: .92rem; }
  .article-card, .booking-card { padding: 1.1rem; }
  .med-card { padding: .85rem .9rem; }
  .wa-float { width: 48px; height: 48px; }

  /* "This week" table -> stacked label:value cards (no horizontal clipping) */
  .public-schedule-table { min-width: 0; }
  .public-schedule-table thead { display: none; }
  .public-schedule-table,
  .public-schedule-table tbody,
  .public-schedule-table tr,
  .public-schedule-table td { display: block; width: 100%; }
  .public-schedule-table tr {
    padding: .5rem 0;
    border-bottom: 1px solid var(--card-border);
  }
  .public-schedule-table tbody tr:last-child { border-bottom: 0; }
  .public-schedule-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 0;
    padding: .28rem .9rem;
    text-align: end;
  }
  .public-schedule-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 700;
    font-size: .82rem;
    white-space: nowrap;
  }
  .public-schedule-table td.cell-doctor { font-weight: 700; color: var(--deep); }

  /* manage panel chrome */
  .manage-header-inner {
    padding-block: .7rem;
    gap: .35rem .8rem;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand actions"
      "public public";
  }
  .manage-brand { gap: .6rem; }
  .manage-public-link { justify-self: center; }
  .manage-main { padding-block: 1.2rem 2rem; }
  .manage-auth-card, .manage-panel { padding: 1rem; }
  .manage-panel-head h2 { font-size: 1.05rem; }
  .manage-stat-card strong { font-size: 1.6rem; }
  .calendar-page-head .manage-actions { justify-content: center; }

  /* weekly calendar: slimmer pinned column, denser cells */
  .weekly-calendar-table { min-width: 800px; }
  .weekly-calendar-table th:first-child,
  .weekly-calendar-table td:first-child { width: 130px; }
  .weekly-calendar-doctor-cell strong { font-size: .88rem; }
  .weekly-calendar-doctor-cell span { font-size: .78rem; }
  .weekly-calendar-table th,
  .weekly-calendar-table td { padding: .45rem .3rem; }
  .weekly-slot-card { padding: .35rem .25rem; }
  .weekly-slot-card strong { font-size: .78rem; }
  .weekly-slot-actions { font-size: .84rem; gap: .5rem; }
  .weekly-slot-empty { font-size: .8rem; }
  .weekly-slot-add { font-size: .88rem; margin-top: .4rem; }
  .weekly-day-head .weekly-day-name { font-size: .84rem; }
  .weekly-day-head .weekly-day-date { font-size: .74rem; }
}
