:root{
  --primary:#16A34A;
  --primary-dark:#14532D;
  --primary-light:#BBF7D0;
  --primary-lighter:#F0FDF4;
  --field-bg:#F0FDF4;
  --surface:#F0FDF4;
  --red:#16A34A;
  --red-dark:#14532D;
  --yellow:#BBF7D0;
  --yellow-dark:#14532D;
  --text:#14532D;
  --text-muted:#14532D;
  --text-faint:#14532D;
  --border:#BBF7D0;
  --bg:#F0FDF4;
  --card:#F0FDF4;
  --radius:12px;
  --shadow:0 1px 3px rgba(20,83,45,.12), 0 1px 2px rgba(20,83,45,.08);
}

*{box-sizing:border-box;}
.ui-icon{width:1em;height:1em;display:inline-block;vertical-align:-0.14em;margin-right:.28em;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}
.btn-icon .ui-icon,.stat-icon .ui-icon{margin-right:0;vertical-align:middle;}

body{
  font-family:"Inter","Segoe UI",system-ui,-apple-system,sans-serif;
  background:var(--bg);
  color:var(--text);
  margin:0;
  font-size:13px;
}

a{color:var(--primary); text-decoration:none;}
a:hover{text-decoration:underline;}

/* ===== Top bar ===== */
.topbar{
  height:56px;
  background:#F0FDF4;
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 20px;
  position:sticky;
  top:0;
  z-index:50;
}
.topbar-logo{
  display:flex;
  align-items:center;
  gap:6px;
  font-weight:700;
  font-size:15px;
  color:var(--primary);
}
.san-pablo-topbar-logo{width:48px; height:48px; object-fit:contain; flex:0 0 auto;}
.topbar-right{display:flex; align-items:center; gap:16px;}
.topbar-clock{color:var(--text-muted); font-size:11px; white-space:nowrap;}
.bell-wrap{position:relative; color:var(--text-muted); cursor:pointer;}
.topbar-logout{
  display:inline-flex;
  align-items:center;
  gap:5px;
  border:1px solid var(--border);
  border-radius:6px;
  padding:6px 9px;
  background:#F0FDF4;
  color:var(--text-muted);
  font:600 11.5px/1 inherit;
  cursor:pointer;
}
.topbar-logout svg{width:15px; height:15px;}
.topbar-logout:hover{color:var(--red); border-color:var(--red);}
.bell-badge{
  position:absolute; top:-6px; right:-6px;
  background:var(--red); color:#F0FDF4; font-size:10px;
  width:15px; height:15px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-weight:700;
}
.avatar{
  width:32px; height:32px; border-radius:50%;
  background:var(--primary); color:#F0FDF4;
  display:flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:700; cursor:pointer;
}

/* ===== Layout ===== */
.layout{
  display:flex;
  height:calc(100vh - 56px);
  min-height:0;
  overflow:hidden;
}
.layout > #sidebar-root{
  flex:0 0 220px;
  min-height:0;
  overflow-y:auto;
  background:#14532D;
}

/* ===== Sidebar ===== */
.sidebar{
  width:220px;
  min-height:100%;
  background:#14532D;
  border-right:1px solid #14532D;
  padding:16px 12px;
  flex-shrink:0;
}
.side-label{
  font-size:10px;
  font-weight:700;
  letter-spacing:.06em;
  color:#BBF7D0;
  text-transform:uppercase;
  margin:16px 8px 6px;
}
.side-label:first-child{margin-top:2px;}
.side-link{
  display:flex;
  align-items:center;
  gap:9px;
  padding:8px 10px;
  border-radius:6px;
  color:#F0FDF4;
  font-size:12.5px;
  font-weight:500;
  margin-bottom:2px;
  cursor:pointer;
}
.side-link svg{flex-shrink:0; width:16px; height:16px;}
.side-link:hover{background:#BBF7D0; color:#14532D; text-decoration:none;}
.side-link.active{background:var(--primary); color:#F0FDF4;}
.side-link.active svg{stroke:#F0FDF4;}
.side-link.plus{color:#BBF7D0; font-weight:600;}
.side-link.plus.active{color:#F0FDF4;}

/* ===== Main content ===== */
.main{
  flex:1;
  min-width:0;
  min-height:0;
  padding:24px 28px;
  overflow-y:auto;
  overflow-x:hidden;
}
.page-title{
  display:flex; align-items:center; gap:8px;
  font-size:18px; font-weight:700; margin:0 0 16px;
  color:var(--text);
}
.page-title svg{color:var(--primary);}
.back-link{
  display:inline-flex; align-items:center; gap:5px;
  font-size:12px; color:var(--primary); font-weight:600;
  margin-bottom:12px; cursor:pointer;
}

/* ===== Cards ===== */
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
.card-pad{padding:18px 20px;}

/* ===== Buttons ===== */
.btn{
  display:inline-flex; align-items:center; gap:6px;
  border:none; border-radius:6px;
  padding:9px 16px;
  font-size:12.5px; font-weight:600;
  cursor:pointer;
  transition:filter .15s;
  white-space:nowrap;
}
.btn:hover{filter:brightness(0.94);}
.btn-primary{background:var(--primary); color:#F0FDF4;}
.btn-secondary{background:#BBF7D0; color:#14532D;}
.btn-outline{background:#F0FDF4; color:var(--text); border:1px solid var(--border);}
.btn-danger{background:var(--red); color:#F0FDF4;}
.btn-yellow{background:var(--yellow); color:#14532D;}
.btn-sm{padding:6px 12px; font-size:11.5px;}
.btn-icon{width:30px; height:30px; padding:0; justify-content:center; border-radius:6px;}

/* ===== Forms ===== */
/* Keep numeric validation and keyboards without browser spinner arrows. */
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
label{font-size:12px; font-weight:600; color:var(--text); margin-bottom:5px; display:block;}
label .req{color:var(--red);}
.form-control, select.form-control, textarea.form-control{
  width:100%;
  border:1px solid var(--border);
  border-radius:6px;
  padding:9px 12px;
  font-size:12.5px;
  color:var(--text);
  background:#F0FDF4;
  font-family:inherit;
}
.form-control:focus{outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-light);}
.form-control::placeholder{color:var(--text-faint);}
.form-control[disabled]{background:#F0FDF4; color:var(--text-faint);}
.date-input-wrap{position:relative;}
.date-input-wrap svg{position:absolute; left:12px; top:50%; width:16px; height:16px; transform:translateY(-50%); color:var(--text-muted); pointer-events:none; z-index:1;}
.date-input-wrap input{padding-left:36px;}
.form-row{display:grid; gap:16px; margin-bottom:16px;}
.form-row.cols-2{grid-template-columns:1fr 1fr;}
.form-row.cols-3{grid-template-columns:1fr 1fr 1fr;}
.form-section-title{
  font-size:11px; font-weight:700; letter-spacing:.05em;
  color:var(--primary); text-transform:uppercase; margin:4px 0 14px;
}
.input-icon-wrap{position:relative;}
.input-icon-wrap .form-control{padding-right:42px;}
.input-icon-wrap .toggle-eye{
  position:absolute; right:12px; top:50%; transform:translateY(-50%);
  width:24px; height:24px; padding:2px; display:flex; align-items:center; justify-content:center;
  border:0; background:transparent; color:var(--text-faint); cursor:pointer;
}
.input-icon-wrap .toggle-eye:hover{color:var(--primary);}
.input-icon-wrap .toggle-eye:focus-visible{outline:2px solid var(--primary-light); border-radius:4px;}
.input-icon-wrap .toggle-eye svg{width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round;}
.input-icon-wrap .toggle-eye .eye-slash{display:none;}
.input-icon-wrap .toggle-eye.is-visible .eye-slash{display:block;}

/* ===== Tables ===== */
.table-wrap{overflow-x:auto; border-radius:var(--radius); border:1px solid var(--border);}
.patient-table-wrap{min-height:260px;}
.scrollable-record-table{max-height:min(55vh,460px); overflow:auto;}
.scrollable-record-table table.data thead th{position:sticky; top:0; z-index:2;}
.scrollable-schedule-list,.scrollable-approval-list{max-height:min(62vh,520px); overflow-y:auto; padding-right:4px;}
table.data{width:100%; border-collapse:collapse; font-size:12px; background:#F0FDF4;}
table.data thead th{
  background:var(--primary); color:#F0FDF4;
  text-align:left; font-weight:600; font-size:11px;
  padding:11px 14px; white-space:nowrap;
}
table.data tbody td{
  padding:11px 14px; border-bottom:1px solid var(--border); color:var(--text);
  white-space:nowrap;
}
table.data tbody td.wrap{white-space:normal; max-width:260px;}
table.data tbody tr:last-child td{border-bottom:none;}
table.data tbody tr:hover{background:var(--primary-lighter);}
table.data tbody tr td.name{font-weight:600; color:var(--text);}
table.data a.view{font-weight:600;}
.vaccine-register{table-layout:fixed; min-width:620px;}
.vaccine-register th:first-child{width:25%;}
.vaccine-register th:nth-child(2){width:25%; text-align:center;}
.vaccine-register th:nth-child(3){width:25%;}
.vaccine-register th:nth-child(4){width:25%;}
.vaccine-register tbody td{height:28px; padding:6px 14px;}
.vaccine-register tbody td.vaccine-group{vertical-align:top; font-weight:600; background:var(--primary-lighter);}
.vaccine-register tbody td.dose-cell{text-align:center; font-weight:600; color:var(--text-muted);}
.vaccine-register .register-date,
.vaccine-register .register-reaction{width:100%; min-width:0; border:0; border-bottom:1px solid transparent; border-radius:3px; padding:4px 5px; background:transparent; color:var(--text); font:inherit;}
.vaccine-register .register-date:focus,
.vaccine-register .register-reaction:focus{outline:none; border-bottom-color:var(--primary); background:#F0FDF4;}
.vaccine-register .register-reaction::placeholder{color:var(--text-faint);}
.vaccine-register .register-date::-webkit-calendar-picker-indicator{cursor:pointer; opacity:.75;}

/* ===== Badges ===== */
.badge{
  display:inline-block; padding:3px 10px; border-radius:20px;
  font-size:10.5px; font-weight:700;
}
.badge-green{background:#16A34A; color:#F0FDF4;}
.badge-yellow{background:#BBF7D0; color:#14532D;}
.badge-red{background:#14532D; color:#F0FDF4;}
.badge-gray{background:#BBF7D0; color:#14532D;}
.badge-pill-role{
  display:inline-block; padding:2px 10px; border-radius:20px;
  font-size:10.5px; font-weight:700; text-transform:lowercase;
}
.role-admin{background:#14532D; color:#F0FDF4;}
.role-nurse{background:#BBF7D0; color:#14532D;}
.role-doctor{background:#16A34A; color:#F0FDF4;}
.role-bhw{background:#BBF7D0; color:#14532D;}
.role-bns{background:#E0F2FE; color:#0F172A;}

/* ===== Stat cards ===== */
.stat-grid{display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:20px;}
.stat-card{
  background:#F0FDF4; border:1px solid var(--border); border-radius:var(--radius);
  padding:16px 18px; display:flex; align-items:center; gap:14px; box-shadow:var(--shadow);
}
.stat-icon{
  width:42px; height:42px; border-radius:10px;
  display:flex; align-items:center; justify-content:center;
  font-size:18px; flex-shrink:0; background:var(--primary-light);
}
.stat-num{font-size:20px; font-weight:800; line-height:1.1; color:var(--text);}
.stat-label{font-size:11px; color:var(--text-muted); margin-top:2px;}

/* ===== Welcome banner ===== */
.banner{
  background:#16A34A;
  border-radius:var(--radius);
  padding:22px 26px;
  color:#F0FDF4;
  margin-bottom:20px;
}
.banner h2{margin:0 0 4px; font-size:18px; font-weight:700;}
.banner p{margin:0; font-size:12px; opacity:.9;}

/* ===== Tabs ===== */
.tabs{display:flex; gap:4px; border-bottom:1px solid var(--border); margin-bottom:18px;}
.tab{
  padding:9px 14px; font-size:12.5px; font-weight:600; color:var(--text-muted);
  cursor:pointer; border-bottom:2px solid transparent; display:flex; align-items:center; gap:6px;
}
.tab.active{color:var(--primary); border-bottom-color:var(--primary);}
.pill-tabs{display:flex; gap:8px; margin-bottom:16px;}
.pill-tab{
  flex:1; text-align:center; padding:8px; border-radius:6px; font-weight:600; font-size:12.5px;
  cursor:pointer; background:#BBF7D0; color:#14532D;
}
.pill-tab.active{background:var(--primary); color:#F0FDF4;}

/* ===== Toolbar ===== */
.toolbar{display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; gap:12px; flex-wrap:wrap;}
.action-toolbar{align-items:center;}
.toolbar-left{display:flex; gap:10px; align-items:center; flex:1; flex-wrap:wrap;}
.search-wrap{position:relative; max-width:280px; flex:1; min-width:180px;}
.search-wrap svg{position:absolute; left:11px; top:50%; transform:translateY(-50%); color:var(--text-faint);}
.search-wrap input{padding-left:34px;}
select.form-control{width:auto; min-width:150px;}

/* ===== Profile header ===== */
.profile-header{display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:16px; flex-wrap:wrap;}
.profile-id{display:flex; align-items:center; gap:14px;}
.profile-avatar{
  width:52px; height:52px; border-radius:50%; background:var(--primary);
  color:#F0FDF4; display:flex; align-items:center; justify-content:center;
  font-weight:800; font-size:15px; flex-shrink:0;
}
.profile-name{font-size:17px; font-weight:800; margin:0 0 3px;}
.profile-meta{display:flex; gap:14px; font-size:12px; color:var(--text-muted); flex-wrap:wrap;}
.profile-meta span{display:flex; align-items:center; gap:4px;}
.detail-grid{display:grid; grid-template-columns:repeat(6,1fr); gap:12px; margin-bottom:18px;}
.detail-box{background:#F0FDF4; border:1px solid var(--border); border-radius:8px; padding:12px 14px;}
.detail-box .k{font-size:10px; font-weight:700; letter-spacing:.04em; color:var(--text-faint); text-transform:uppercase; margin-bottom:4px;}
.detail-box .v{font-size:12.5px; font-weight:600; color:var(--text);}

.metric-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-bottom:18px;}
.metric-card{background:#F0FDF4; border:1px solid var(--border); border-radius:8px; padding:16px 18px; text-align:center;}
.metric-card .k{font-size:10.5px; font-weight:700; letter-spacing:.04em; color:var(--text-faint); text-transform:uppercase; margin-bottom:6px;}
.metric-card .v{font-size:15px; font-weight:800; margin-bottom:2px;}
.metric-card .sub{font-size:11px; color:var(--text-muted);}

/* ===== Modal ===== */
.modal-overlay{
  position:fixed; inset:0; background:rgba(20,83,45,.5);
  display:none; align-items:center; justify-content:center; z-index:200; padding:20px;
}
.modal-overlay.open{display:flex;}
.modal-box{
  background:#F0FDF4; border-radius:10px; width:100%; max-width:480px;
  box-shadow:0 20px 50px rgba(20,83,45,.25); max-height:90vh; overflow-y:auto;
}
.modal-box.wide{max-width:620px;}
.modal-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 20px; border-bottom:1px solid var(--border);
}
.modal-head h3{margin:0; font-size:14.5px; font-weight:700;}
.modal-close{cursor:pointer; color:var(--text-faint); font-size:17px; line-height:1; background:none; border:none;}
.modal-body{padding:20px;}
.modal-foot{display:flex; justify-content:flex-end; gap:10px; padding:14px 20px; border-top:1px solid var(--border);}
.baby-book-dialog{width:min(210mm, calc(100vw - 40px)); height:min(297mm, 92vh); max-width:none; max-height:92vh; display:flex; flex-direction:column; overflow:hidden; border:1px solid #BBF7D0; background:var(--primary-lighter); box-shadow:0 24px 60px rgba(20,83,45,.28);}
.baby-book-dialog > .modal-head{background:var(--primary-dark); color:#F0FDF4; border-bottom:1px solid rgba(240,253,244,.18);}
.baby-book-dialog > .modal-head .modal-close{color:#F0FDF4;}
.baby-book-content{padding:0; overflow:auto; min-height:0; background:#F0FDF4;}
.baby-book-heading{background:var(--primary); color:#F0FDF4; padding:12px 16px; display:flex; justify-content:space-between; gap:12px; align-items:center;}
.baby-book-heading small{display:block; font-size:11px; margin-top:3px; opacity:.9;}
.baby-book-heading #baby-book-child{font-size:12px; font-weight:700; text-align:right;}
.baby-book-summary{display:grid; grid-template-columns:repeat(4,1fr); gap:10px; padding:14px 16px 0;}
.baby-book-summary .detail-box{background:rgba(240,253,244,.92); border-color:#BBF7D0;}
.baby-book-actions{margin:12px 16px 8px;}
.baby-book-content .table-wrap{margin:0 16px 12px;}
.baby-book-content table.data{table-layout:fixed;}
.baby-book-content table.data th,
.baby-book-content table.data td{width:25%; white-space:normal; overflow-wrap:anywhere;}
#modal-injection{z-index:210;}


/* ===== Schedule list ===== */
.sched-item{
  background:#F0FDF4; border:1px solid var(--border); border-radius:8px;
  padding:14px 16px; display:flex; align-items:flex-start; justify-content:space-between;
  margin-bottom:10px; gap:10px;
}
.sched-date{font-size:11px; color:var(--text-muted); display:flex; align-items:center; gap:6px; margin-bottom:4px;}
.sched-title{font-weight:700; font-size:13px; margin-bottom:3px;}
.sched-desc{font-size:12px; color:var(--text-muted); margin-bottom:8px;}
.sched-tags{display:flex; gap:6px;}
.tag{font-size:10px; font-weight:700; padding:2px 9px; border-radius:20px;}
.tag-prenatal{background:#BBF7D0; color:#14532D;}
.tag-vaccination{background:#16A34A; color:#F0FDF4;}
.tag-barangay{background:#BBF7D0; color:#14532D;}

/* ===== Approval card ===== */
.approve-card{
  background:#F0FDF4; border:1px solid var(--border); border-left:4px solid var(--yellow);
  border-radius:8px; padding:16px 18px; display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap;
}
.approve-info{display:flex; gap:36px; flex-wrap:wrap;}
.approve-info .k{font-size:10px; font-weight:700; color:var(--text-faint); text-transform:uppercase; margin-bottom:3px;}
.approve-info .v{font-size:12.5px; font-weight:600;}

/* ===== Footer note on login ===== */
.login-page{
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  position:relative; background:#14532D;
  background-size:cover; background-position:center;
}
.login-overlay{position:absolute; inset:0; background:linear-gradient(135deg, rgba(20,83,45,.88), rgba(22,163,74,.82));}
.login-card{
  position:relative; z-index:2; background:#F0FDF4; border-radius:14px;
  width:100%; max-width:400px; padding:36px 34px; box-shadow:0 25px 60px rgba(20,83,45,.3);
}
.login-logo{text-align:center; margin-bottom:18px;}
.san-pablo-login-logo{display:block; width:min(260px,100%); height:62px; object-fit:contain; margin:0 auto 12px; padding:5px 8px; background:#F0FDF4; border-radius:10px;}
.login-logo .heart-circle{font-size:26px; color:var(--red); margin-bottom:6px;}
.login-logo h1{font-size:18px; font-weight:800; color:var(--primary); margin:0 0 4px;}
.login-logo p{font-size:12px; color:var(--text-muted); margin:0;}
.login-footer{
  position:relative; z-index:2; position:fixed; bottom:14px; left:0; right:0;
  text-align:center; color:rgba(240,253,244,.85); font-size:11.5px;
}

/* ===== Misc ===== */
.mb-0{margin-bottom:0;}
.flex{display:flex;}
.gap-8{gap:8px;}
.text-muted{color:var(--text-muted);}
.chart-legend{display:flex; flex-direction:column; gap:6px; font-size:12px;}
.chart-legend .dot{width:9px; height:9px; border-radius:50%; display:inline-block; margin-right:6px;}
.chart-wrap{display:flex; gap:30px; align-items:center; justify-content:center; flex-wrap:wrap; padding:10px 0 20px;}

@media (max-width: 767px){
  .layout > #sidebar-root{display:none;}
  .sidebar{display:none;}
  .stat-grid{grid-template-columns:repeat(2,1fr);}
  .detail-grid{grid-template-columns:repeat(3,1fr);}
  .metric-grid{grid-template-columns:1fr;}
  .form-row.cols-2, .form-row.cols-3{grid-template-columns:1fr;}
  .baby-book-dialog{width:calc(100vw - 20px); height:calc(100dvh - 20px); max-height:calc(100dvh - 20px);}
  .baby-book-heading{align-items:flex-start; flex-direction:column;}
  .baby-book-heading #baby-book-child{text-align:left;}
  .baby-book-summary{grid-template-columns:repeat(2,1fr); padding:14px 14px 0; gap:8px;}
  .baby-book-actions{margin:14px 14px 10px;}
  .baby-book-content .table-wrap{margin:0 14px 14px;}
}

.sidebar-account { padding: 18px 20px; margin-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.2); color: #fff; }
.sidebar-account strong { display: block; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.sidebar-account span { display: block; margin-top: 4px; font-size: 12px; font-style: italic; color: #bbf7d0; }

.sidebar-identity { display:flex; align-items:center; gap:10px; min-width:0; }
.sidebar-identity strong { overflow-wrap:anywhere; }
#sidebar-photo-button { width:44px; height:44px; flex-shrink:0; padding:0; overflow:hidden; border-radius:50%; border:1px solid #bbf7d0; background:#f0fdf4; cursor:pointer; font-size:24px; }
#sidebar-photo-button img { width:100%; height:100%; object-fit:cover; }
#sidebar-photo-button:disabled { opacity:.6; cursor:wait; }

/* Shared outlined icon treatment and profile upload control. */
.side-link > svg { width:20px; height:20px; flex-shrink:0; stroke-width:1.8; }
.side-link { border-radius:10px; }
.side-link:focus-visible, #sidebar-photo-button:focus-visible { outline:3px solid #86efac; outline-offset:4px; }
#sidebar-photo-button { position:relative; width:52px; height:52px; overflow:visible; display:grid; place-items:center; color:#15803d; border:2px solid #bbf7d0; transition:background .15s, box-shadow .15s; }
#sidebar-photo-button:hover { background:#dcfce7; box-shadow:0 0 0 4px rgba(187,247,208,.15); }
#sidebar-photo-button > svg { width:27px; height:27px; }
#sidebar-photo-button > img { border-radius:50%; }
#sidebar-photo-button .profile-camera-badge { position:absolute; right:-4px; bottom:-3px; margin:0; width:22px; height:22px; border:2px solid #fff; border-radius:50%; background:#15803d; color:#fff; display:grid; place-items:center; pointer-events:none; }
#sidebar-photo-button .profile-camera-badge svg { width:12px; height:12px; }

/* Keep account details in one aligned column beside the avatar. */
.sidebar-account { padding:20px 16px; }
.sidebar-identity { align-items:flex-start; gap:14px; }
.sidebar-account-details { flex:1; min-width:0; padding-top:2px; text-align:left; }
.sidebar-account-details strong { line-height:1.35; margin:0 0 5px; }
.sidebar-account-details span { font-style:normal; line-height:1.45; margin-top:2px; overflow-wrap:anywhere; }
#add-injection-button[hidden] { display:none !important; }

/* Keep modal selectors compact after Bootstrap's modal-body flex defaults. */
#modal-patient-baby-book > .modal-box > .modal-body { flex:0 0 auto; }
#modal-patient-baby-book > .modal-box > .modal-head { flex:0 0 auto; }
#patient-baby-book-frame { flex:1 1 0 !important; min-height:0; }
body.baby-book-only > .layout, body.baby-book-only > #topbar-root { display:none !important; }
body.baby-book-only { margin:0; padding:0; }
body.baby-book-only .baby-book-content { overflow:visible; }

/* Profile layout: avatar beside name and compact account metadata. */
.sidebar-account { padding:20px 14px; }
.sidebar-identity { align-items:center; gap:12px; }
#sidebar-photo-button { width:64px; height:64px; }
.sidebar-account-details { padding:0; }
.sidebar-account-details strong { font-size:17px; margin:0 0 7px; line-height:1.3; }
.sidebar-account-meta { display:flex; flex-wrap:wrap; align-items:center; gap:4px 10px; }
.sidebar-account-meta .sidebar-meta-item { display:inline-flex; align-items:center; gap:4px; margin:0; min-width:0; font-size:11px; line-height:1.4; }
.sidebar-account-meta .sidebar-meta-item > span { display:inline; margin:0; font-size:inherit; }
.sidebar-meta-item > svg { width:13px; height:13px; flex-shrink:0; }

/* Centered sidebar profile matching the reference arrangement. */
.sidebar-identity { flex-direction:column; align-items:center; gap:10px; }
#sidebar-photo-button { width:76px; height:76px; }
.sidebar-account-details { width:100%; text-align:center; }
.sidebar-account-details strong { font-size:20px; margin-bottom:8px; }
.sidebar-account-meta { justify-content:center; }

.prenatal-workspace-controls { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 20px; flex:0 0 auto; border-top:1px solid var(--border); }
.prenatal-workspace-controls span { flex:1; }
.prenatal-workspace-patient { margin-bottom:16px; }
.prenatal-workspace-table { min-width:1180px; }
.prenatal-workspace-table .form-control { width:100%; min-width:90px; }
.prenatal-workspace-table input[type="date"] { min-width:145px; }
.prenatal-workspace-table textarea { min-width:180px; }
#prenatal-batch-controls[hidden] { display:none !important; }

.growth-workspace-controls {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 20px;flex:0 0 auto;}
#growth-batch-controls[hidden] {display:none!important;}
.growth-workspace-patient {margin-bottom:16px;}
.growth-workspace-table {min-width:650px;}
.growth-workspace-table .form-control {width:100%;min-width:90px;}

input[aria-invalid="true"],select[aria-invalid="true"],textarea[aria-invalid="true"]{border:1px solid #dc2626!important;outline-color:#dc2626;}
.field-error{display:block;color:#b91c1c;font-size:12px;margin-top:5px;}
.field-error:empty{display:none;}

.field-error{font-family:inherit;line-height:1.5;color:var(--red,#b91c1c);}
.form-control[aria-invalid="true"]{border-color:var(--red,#dc2626)!important;background:var(--surface,#f0fdf4);}
.form-control[aria-invalid="true"]:focus{outline:none;box-shadow:0 0 0 3px rgba(220,38,38,.12);}

/* Responsive shared navigation: closed drawers occupy no page width. */
.sidebar-toggle{display:none;align-items:center;justify-content:center;width:40px;height:40px;flex:0 0 40px;border:1px solid var(--border);border-radius:8px;background:transparent;color:var(--primary-dark);cursor:pointer;}
.sidebar-toggle svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;}
#sidebar-backdrop{display:none;}
.main{scrollbar-gutter:stable;}
@media(max-width:1000px){
 .sidebar-toggle{display:inline-flex;}
 .topbar{gap:10px;}
 .topbar-logo{margin-right:auto;min-width:0;}
 .topbar-clock{display:none;}
 .topbar-right{gap:8px;}
 .layout > #sidebar-root{display:block;position:fixed;inset:var(--navigation-top,64px) auto 0 0;width:min(280px,85vw);z-index:1001;visibility:hidden;transform:translateX(-100%);overflow-y:auto;}
 .layout > #sidebar-root .sidebar{display:block;width:100%;}
 body.sidebar-open .layout > #sidebar-root{visibility:visible;transform:translateX(0);}
 body.sidebar-open #sidebar-backdrop{display:block;position:fixed;inset:var(--navigation-top,64px) 0 0;z-index:1000;border:0;background:rgba(0,0,0,.35);}
 .main{padding:16px;}
 .scheduling-layout{grid-template-columns:1fr!important;}
 .record-tab{min-width:0;}
}
@media(max-width:420px){.topbar-logo span{font-size:15px;}.san-pablo-topbar-logo{width:32px;height:32px;}.topbar-logout span{display:none;}.topbar{padding-inline:10px;}}
@media print{.sidebar-toggle,#sidebar-backdrop{display:none!important;}}

.topbar-brand{display:flex;flex-direction:column;min-width:0;line-height:1.2;}
.topbar-brand small{font-size:10px;font-weight:500;color:var(--text-muted);margin-top:3px;white-space:normal;}
@media(max-width:600px){.topbar{height:auto;min-height:64px;padding-block:8px;}.topbar-brand small{font-size:9px;max-width:190px;}}
