/* CarePulse theme — Black, Red, White, Light Blue */
:root{
  --cp-black:#15171c;
  --cp-red:#d32f2f;
  --cp-red-dark:#b71c1c;
  --cp-white:#ffffff;
  --cp-blue:#e3f2fd;       /* light blue surface */
  --cp-blue-accent:#4fa3e3;
  --cp-gray:#f4f6f9;
  --cp-text:#22252b;
}
body{ background:var(--cp-gray); color:var(--cp-text); font-family:"Segoe UI",system-ui,Arial,sans-serif; }
a{ text-decoration:none; }

/* Sidebar */
.cp-sidebar{
  background:var(--cp-black); color:#cfd3da; height:100vh; width:240px;
  position:fixed; top:0; left:0; padding-top:1rem; overflow-y:auto;
}
.cp-brand{ color:var(--cp-white); font-weight:700; font-size:1.2rem; padding:.4rem 1.25rem .6rem; display:flex; align-items:center; gap:.5rem;}
.cp-brand .dot{ width:12px;height:12px;border-radius:50%;background:var(--cp-red); box-shadow:0 0 0 4px rgba(211,47,47,.25);}
.cp-nav a{ color:#cfd3da; display:block; padding:.42rem 1.25rem; border-left:3px solid transparent; font-size:.9rem; white-space:nowrap;}
.cp-nav a:hover{ background:#1f2128; color:#fff; }
.cp-nav a.active{ background:#23262e; color:#fff; border-left-color:var(--cp-red); }
/* ── Collapsible sidebar section headers ─────────────────────── */
.cp-nav .cp-sec-btn{
  display:flex; align-items:center; justify-content:space-between; width:100%;
  padding:.5rem 1rem .5rem 1.1rem; margin:.5rem 0 .1rem;
  background:rgba(211,47,47,.16); border:0; border-left:3px solid var(--cp-red);
  border-radius:0 5px 5px 0; color:#fff;
  font-size:.68rem; font-weight:800; letter-spacing:.08em; text-transform:uppercase;
  cursor:pointer; text-align:left; line-height:1.4;
}
.cp-nav .cp-sec-btn:hover{ background:rgba(211,47,47,.34); color:#fff; }
.cp-nav .cp-sec-btn:focus{ outline:none; box-shadow:none; }
.cp-nav .cp-sec-btn .sec-icon{ color:#ff8a97; font-size:.9rem; margin-right:.45rem; flex-shrink:0; }
.cp-nav .cp-sec-btn .sec-chev{ font-size:.7rem; color:rgba(255,255,255,.55); transition:transform .22s; flex-shrink:0; margin-left:auto; }
.cp-nav .cp-sec-btn[aria-expanded="true"] .sec-chev{ transform:rotate(180deg); color:#ff8a97; }
.cp-nav .cp-sec-body a{ padding-left:2.1rem; font-size:.86rem; }

/* Content shifted for sidebar */
.cp-content{ margin-left:240px; }
@media (max-width: 991px){ .cp-sidebar{ position:static; width:100%; min-height:auto;} .cp-content{ margin-left:0; } }

.cp-topbar{ background:var(--cp-white); border-bottom:3px solid var(--cp-red); padding:.75rem 1.25rem; display:flex; justify-content:space-between; align-items:center;}
.cp-card{ background:var(--cp-white); border:1px solid #e6e9ee; border-radius:.6rem; }
.cp-stat{ border-radius:.6rem; padding:1rem 1.1rem; color:#fff; }
.cp-stat .n{ font-size:1.6rem; font-weight:700; }
.cp-stat .l{ font-size:.8rem; opacity:.92; }
.bg-cp-black{ background:var(--cp-black);} .bg-cp-red{ background:var(--cp-red);} .bg-cp-blue{ background:var(--cp-blue-accent);}
.text-cp-red{ color:var(--cp-red)!important; }
.btn-cp{ background:var(--cp-red); border-color:var(--cp-red); color:#fff; }
.btn-cp:hover{ background:var(--cp-red-dark); border-color:var(--cp-red-dark); color:#fff; }
.btn-cp-blue{ background:var(--cp-blue-accent); border-color:var(--cp-blue-accent); color:#fff;}
.cp-pill{ font-size:.72rem; padding:.2rem .55rem; border-radius:1rem; }
table thead th{ background:var(--cp-blue); color:var(--cp-black); font-size:.82rem; text-transform:uppercase; letter-spacing:.03em;}
.cp-issue-block{ border-left:4px solid var(--cp-red); background:#fff5f5; }
.cp-issue-warn{ border-left:4px solid #f0ad4e; background:#fff9ef; }
.cp-issue-ok{ border-left:4px solid #2e7d32; background:#f1f8f2; }

/* ---- Additions for views ---- */
.cp-stat{ background:var(--cp-black); }
.cp-stat-blue{ background:var(--cp-blue-accent); }
.cp-stat-danger{ background:var(--cp-red); }
.cp-stat-label{ font-size:.78rem; opacity:.92; display:flex; align-items:center; gap:.4rem; }
.cp-stat-value{ font-size:1.7rem; font-weight:700; margin-top:.25rem; }

.cp-card-head{ display:flex; justify-content:space-between; align-items:center; padding:.85rem 1rem; border-bottom:1px solid #e6e9ee; font-weight:600; }
.cp-card-title{ font-weight:600; margin-bottom:.75rem; color:var(--cp-black); }

.cp-table{ font-size:.9rem; }
.cp-table td, .cp-table th{ vertical-align:middle; }

.cp-dl{ display:grid; grid-template-columns:110px 1fr; gap:.35rem .75rem; margin:0; font-size:.9rem; }
.cp-dl dt{ color:#6b7280; font-weight:500; }
.cp-dl dd{ margin:0; }

.cp-issue{ display:flex; gap:.6rem; align-items:flex-start; padding:.7rem .9rem; border-radius:.4rem; margin-bottom:.6rem; }
.cp-issue i{ font-size:1.1rem; margin-top:.1rem; }

/* Login */
.cp-login-wrap{ min-height:100vh; display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,var(--cp-black),#23262e); padding:1.5rem; }
.cp-login-card{ background:#fff; border-radius:.8rem; padding:2rem; width:100%; max-width:400px; box-shadow:0 12px 40px rgba(0,0,0,.25); border-top:4px solid var(--cp-red); }
.cp-login-brand{ font-size:1.6rem; font-weight:700; color:var(--cp-black); display:inline-flex; align-items:center; gap:.5rem; }
.cp-login-brand .dot{ width:14px;height:14px;border-radius:50%;background:var(--cp-red); box-shadow:0 0 0 4px rgba(211,47,47,.25);}
.cp-login-hint{ margin-top:1.25rem; padding:.6rem .8rem; background:var(--cp-blue); border-radius:.4rem; font-size:.82rem; color:var(--cp-black); }


/* Visible, themed sidebar scrollbar so it's obvious the menu scrolls */
.cp-sidebar{ scrollbar-width:thin; scrollbar-color:#4a4f5a var(--cp-black); }
.cp-sidebar::-webkit-scrollbar{ width:9px; }
.cp-sidebar::-webkit-scrollbar-track{ background:var(--cp-black); }
.cp-sidebar::-webkit-scrollbar-thumb{ background:#4a4f5a; border-radius:6px; border:2px solid var(--cp-black); }
.cp-sidebar::-webkit-scrollbar-thumb:hover{ background:#6b7280; }


/* ---- ShaGha brand + footer ---- */
.cp-brand-gha{ color:var(--cp-red); }
.cp-footer{
  display:flex; justify-content:space-between; align-items:center;
  padding:.85rem 1.5rem; margin-top:1rem;
  border-top:1px solid #e6e9ee; background:var(--cp-white);
  color:#6b7280; font-size:.82rem;
}
.cp-footer-gha{ color:var(--cp-red); font-weight:600; }
.cp-footer-muted{ color:#9aa0aa; }

/* ── Update 106: Scheduler (front-desk command centre). ShaGha palette: sky blue / red / black / white. ── */
.sch-toolbar{display:flex;flex-wrap:wrap;gap:.4rem;align-items:center;background:var(--cp-white);border:1px solid #dfe6ee;border-radius:10px;padding:.45rem .6rem;margin-bottom:.5rem}
.sch-toolbar .sch-date{font-weight:700;color:var(--cp-black);margin:0 .35rem;white-space:nowrap}
.sch-toolbar .btn-cp-red{background:var(--cp-red);border-color:var(--cp-red);color:#fff}
.sch-toolbar .btn-cp-red:hover{background:var(--cp-red-dark);color:#fff}
.sch-toolbar .btn-sky{background:var(--cp-blue);border-color:#b9dcf7;color:var(--cp-black)}
.sch-toolbar .btn-sky.active,.sch-toolbar .btn-sky:hover{background:var(--cp-blue-accent);color:#fff;border-color:var(--cp-blue-accent)}
.sch-wrap{display:flex;gap:.5rem;align-items:flex-start}
.sch-board{flex:1 1 auto;min-width:0;background:#fff;border:1px solid #dfe6ee;border-radius:10px;overflow:auto;max-height:calc(100vh - 210px)}
.sch-side{flex:0 0 290px;max-height:calc(100vh - 210px);overflow:auto}
.sch-side .sch-panel{background:#fff;border:1px solid #dfe6ee;border-radius:10px;margin-bottom:.5rem}
.sch-side .sch-panel h6{font-size:.78rem;text-transform:uppercase;letter-spacing:.03em;margin:0;padding:.45rem .6rem;background:var(--cp-blue);border-radius:10px 10px 0 0;display:flex;justify-content:space-between}
.sch-side .sch-panel ul{list-style:none;margin:0;padding:.25rem .6rem .45rem;font-size:.8rem}
.sch-side .sch-panel li{padding:.2rem 0;border-bottom:1px dashed #edf1f5}
.sch-side .sch-panel li:last-child{border-bottom:0}
.sch-grid{display:flex;min-width:max-content;position:relative}
.sch-gutter{flex:0 0 54px;position:sticky;left:0;background:#fff;z-index:3}
.sch-gutter .sch-t{font-size:11px;color:#6b7480;text-align:right;padding-right:6px;border-top:1px solid #eef1f4}
.sch-col{flex:0 0 200px;border-left:1px solid #e6ebf0}
.sch-col.compact{flex-basis:160px}
.sch-colhead{height:44px;position:sticky;top:0;background:#fff;z-index:2;border-bottom:2px solid var(--cp-blue-accent);padding:4px 6px;font-size:12px;line-height:1.2;overflow:hidden}
.sch-colhead .sub{font-weight:400;color:#6b7480;font-size:11px}
.sch-dot{display:inline-block;width:9px;height:9px;border-radius:50%;vertical-align:middle}
.sch-body{position:relative}
.sch-slot{position:absolute;left:0;right:0;border-top:1px solid #f2f4f7}
.sch-slot.hour{border-top-color:#e2e7ec}
.sch-slot:hover{background:rgba(79,163,227,.08);cursor:copy}
.sch-now{position:absolute;left:0;right:0;border-top:2px solid var(--cp-red);z-index:4;pointer-events:none}
.sch-card{position:absolute;border-radius:6px;padding:2px 22px 2px 6px;font-size:11.5px;line-height:1.25;color:#fff;overflow:hidden;cursor:pointer;box-shadow:0 1px 2px rgba(0,0,0,.25);border-left:5px solid rgba(0,0,0,.35)}
.sch-card:focus{outline:3px solid var(--cp-black);outline-offset:1px;z-index:5}
.sch-card.inactive{background-image:repeating-linear-gradient(45deg,rgba(255,255,255,.18) 0 6px,transparent 6px 12px);opacity:.85;text-decoration:line-through}
.sch-card .nm{font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sch-card .ln{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;opacity:.95}
.sch-card .more{position:absolute;top:1px;right:1px;border:0;background:rgba(255,255,255,.22);color:#fff;border-radius:4px;width:20px;height:20px;line-height:18px;padding:0;font-size:14px}
.sch-card .more:hover,.sch-card .more:focus{background:#fff;color:var(--cp-black)}
.sch-badges{display:flex;gap:3px;flex-wrap:wrap;margin-top:1px}
.sch-badge{display:inline-flex;align-items:center;gap:2px;background:rgba(255,255,255,.92);color:var(--cp-black);border-radius:3px;padding:0 3px;font-size:10px;font-weight:600}
.sch-badge.danger{background:#fff;color:var(--cp-red-dark);box-shadow:inset 0 0 0 1px var(--cp-red)}
.sch-week .sch-day{flex:1 0 170px;border-left:1px solid #e6ebf0;min-height:300px}
.sch-week .sch-day .sch-colhead{height:auto}
.sch-week .sch-card{position:relative;margin:4px;display:block}
.sch-qa{position:fixed;z-index:1080;background:#fff;border:1px solid #cfd8e3;border-radius:10px;box-shadow:0 10px 30px rgba(21,23,28,.25);min-width:250px;max-width:320px;max-height:78vh;overflow:auto;padding:.3rem 0;font-size:.85rem}
.sch-qa .grp{font-size:.68rem;text-transform:uppercase;letter-spacing:.05em;color:#6b7480;padding:.35rem .8rem .1rem;border-top:1px solid #eef1f4}
.sch-qa .grp:first-of-type{border-top:0}
.sch-qa a,.sch-qa button.it{display:flex;gap:.5rem;align-items:center;width:100%;text-align:left;background:none;border:0;padding:.3rem .8rem;color:var(--cp-black);text-decoration:none}
.sch-qa a:hover,.sch-qa a:focus,.sch-qa button.it:hover,.sch-qa button.it:focus{background:var(--cp-blue);outline:0}
.sch-qa .hd{padding:.35rem .8rem;font-weight:700;border-bottom:2px solid var(--cp-red)}
.sch-legend span{display:inline-flex;align-items:center;gap:3px;margin-right:.6rem;font-size:.75rem}
.sch-legend i.sw{display:inline-block;width:10px;height:10px;border-radius:2px}
.sch-ready{background:#fff;border:1px solid #dfe6ee;border-left:5px solid var(--cp-red);border-radius:10px;margin-bottom:.5rem}
.sch-ready summary{padding:.45rem .7rem;font-weight:700;cursor:pointer}
.sch-privacy .sch-card .nm{letter-spacing:.04em}
@media (max-width: 991.98px){.sch-wrap{flex-direction:column}.sch-side{flex-basis:auto;width:100%;max-height:none}.sch-board{max-height:none;width:100%}}
@media print{.sch-toolbar,.sch-side,.sch-card .more,.cp-sidebar{display:none!important}.sch-board{max-height:none;overflow:visible}}
