/* Shared workspace shell. It only changes authenticated CRM screens. */
:root {
  --workspace-navy: #080d45;
  --workspace-green: #00b875;
  --workspace-blue: #0879ed;
  --workspace-ink: #121a4d;
  --workspace-muted: #65708c;
  --workspace-line: #dce4f2;
  --workspace-surface: #f6f8fd;
  --workspace-card: #ffffff;
}

body.workspace-shell {
  background: var(--workspace-surface);
  color: var(--workspace-ink);
}

.workspace-shell .test {
  margin-left: 272px;
  min-height: 30px;
  padding: 7px 18px;
  background: #e8f2ff;
  color: #31547c;
  font-weight: 700;
}

.workspace-sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  display: flex;
  width: 272px;
  flex-direction: column;
  padding: 26px 16px 18px;
  background: var(--workspace-navy);
  color: #fff;
}

.workspace-sidebar__brand {
  margin: 0 8px 30px;
  color: #fff;
}

.workspace-sidebar .brand .brand-name { color: #fff; }
.workspace-sidebar .brand .brand-plus { color: var(--workspace-green); }

.workspace-nav { display: grid; gap: 6px; }

.workspace-nav__link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #dfe7ff;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.workspace-nav__link > span {
  display: inline-grid;
  width: 20px;
  place-items: center;
  color: #8fa9eb;
  font-size: 18px;
}

.workspace-nav__link:hover { background: #172066; color: #fff; }
.workspace-nav__link[aria-current="page"] {
  border-color: #274496;
  background: #1a2a78;
  color: #fff;
}
.workspace-nav__link[aria-current="page"] > span { color: var(--workspace-green); }

.workspace-account {
  margin-top: auto;
  border-top: 1px solid #293575;
  padding-top: 14px;
}

.workspace-account summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 5px 8px;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  list-style: none;
}
.workspace-account summary::-webkit-details-marker { display: none; }
.workspace-account summary:hover { background: #172066; }
.workspace-account__avatar {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--workspace-green);
  color: var(--workspace-navy);
  font-size: 13px;
  font-weight: 800;
}
.workspace-account__label,
.workspace-account__email { display: block; }
.workspace-account__label { font-size: 12px; font-weight: 800; }
.workspace-account__email {
  max-width: 175px;
  overflow: hidden;
  color: #b9c8ef;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workspace-account__menu { display: grid; gap: 4px; padding: 8px; }
.workspace-account__menu a {
  min-height: 40px;
  padding: 10px;
  border-radius: 8px;
  color: #dfe7ff;
  font-size: 13px;
  text-decoration: none;
}
.workspace-account__menu a:hover { background: #172066; color: #fff; }
.workspace-account__menu form { margin: 4px 0 0; }
.workspace-account__menu button { width: 100%; background: #273777; border-color: #40549e; }

.app-shell { min-height: calc(100vh - 30px); margin-left: 272px; }
.workspace-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  min-height: 62px;
  padding: 10px 36px;
  border-bottom: 1px solid var(--workspace-line);
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 2px 14px rgb(8 13 69 / 4%);
  backdrop-filter: blur(12px);
}
.workspace-header__brand { display: none; }
.workspace-header__context {
  color: var(--workspace-muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
}
.workspace-menu-toggle { display: none; }

.workspace-shell .workspace-main {
  max-width: none;
  margin: 0;
  padding: 32px 36px 72px;
}

/* Each screen currently carries its own tab strip. The shell supplies that navigation. */
.workspace-shell .workspace-main > .tabs { display: none !important; }

.workspace-shell h1,
.workspace-shell h2,
.workspace-shell h3 { color: var(--workspace-navy); }
.workspace-shell p,
.workspace-shell .muted,
.workspace-shell footer { color: var(--workspace-muted); }
.workspace-shell .eyebrow { color: var(--workspace-blue); font-weight: 800; }
.workspace-shell .heading { align-items: flex-start; }
.workspace-shell .heading > label {
  padding: 11px 13px;
  border: 1px solid var(--workspace-line);
  border-radius: 12px;
  background: var(--workspace-card);
}
.workspace-shell .heading > label select { margin-top: 4px; }
.workspace-shell .panel,
.workspace-shell .room,
.workspace-shell .operator-page > section,
.workspace-shell .operator-page > article {
  border-color: var(--workspace-line);
  border-radius: 14px;
  background: var(--workspace-card);
  box-shadow: 0 6px 24px rgb(8 13 69 / 4%);
}
.workspace-shell .room { border-left: 4px solid var(--workspace-green); }
.workspace-shell button,
.workspace-shell #book-patient {
  border-color: var(--workspace-blue);
  background: var(--workspace-blue);
}
.workspace-shell button.secondary,
.workspace-shell .button.secondary,
.workspace-shell .btn-secondary,
.workspace-shell .btn-info {
  border-color: #c8d7f0;
  background: #fff;
  color: var(--workspace-navy);
}
.workspace-shell input:focus,
.workspace-shell select:focus,
.workspace-shell textarea:focus,
.workspace-shell button:focus-visible,
.workspace-shell a:focus-visible,
.workspace-shell summary:focus-visible {
  outline: 3px solid var(--workspace-blue);
  outline-offset: 3px;
}

.workspace-mobile-nav,
.workspace-more-menu { display: none; }

@media (max-width: 780px) {
  .workspace-shell .test { margin-left: 0; }
  .workspace-sidebar { display: none; }
  .app-shell { min-height: calc(100vh - 30px); margin-left: 0; padding-bottom: 76px; }
  .workspace-header {
    min-height: 58px;
    padding: 7px 16px;
    gap: 10px;
  }
  .workspace-header__brand { display: inline-flex; }
  .workspace-header__brand img { width: 36px; height: 36px; flex-basis: 36px; }
  .workspace-header__brand .brand-name,
  .workspace-header__brand .brand-plus { font-size: 20px; }
  .workspace-header__context { display: none; }
  .workspace-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 42px;
    margin-left: auto;
    padding: 8px 11px;
    border-color: #c8d7f0;
    background: #fff;
    color: var(--workspace-navy);
    font-size: 13px;
  }
  .workspace-menu-toggle > span:first-child { font-size: 18px; line-height: 1; }
  .workspace-shell .workspace-main { padding: 24px 16px 28px; }
  .workspace-shell .heading { gap: 18px; }
  .workspace-shell .heading > label { width: 100%; min-width: 0; }
  .workspace-shell .panel,
  .workspace-shell .room,
  .workspace-shell .operator-page > section,
  .workspace-shell .operator-page > article { border-radius: 12px; }
  .workspace-mobile-nav {
    position: fixed;
    z-index: 30;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    min-height: 68px;
    padding: 5px 8px calc(5px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--workspace-line);
    background: rgb(255 255 255 / 96%);
    box-shadow: 0 -5px 20px rgb(8 13 69 / 9%);
    backdrop-filter: blur(12px);
  }
  .workspace-mobile-nav a,
  .workspace-mobile-nav button {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px 2px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--workspace-muted);
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
  }
  .workspace-mobile-nav a > span,
  .workspace-mobile-nav button > span { font-size: 17px; line-height: 1; }
  .workspace-mobile-nav a[aria-current="page"],
  .workspace-mobile-nav button[aria-expanded="true"] { color: var(--workspace-blue); }
  .workspace-more-menu {
    position: fixed;
    z-index: 35;
    right: 12px;
    bottom: 78px;
    left: 12px;
    max-width: 460px;
    margin: auto;
    padding: 12px;
    border: 1px solid var(--workspace-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 16px 42px rgb(8 13 69 / 20%);
  }
  .workspace-more-menu:not([hidden]) { display: block; }
  .workspace-more-menu[hidden] { display: none; }
  .workspace-more-menu__head { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 10px; color: var(--workspace-navy); }
  .workspace-more-menu__head button { min-height: 36px; padding: 4px 12px; font-size: 20px; }
  .workspace-more-menu > a {
    display: block;
    min-height: 44px;
    padding: 12px;
    border-radius: 9px;
    color: var(--workspace-navy);
    font-weight: 700;
    text-decoration: none;
  }
  .workspace-more-menu > a:hover { background: #edf4ff; }
  .workspace-more-menu form { margin: 6px 0 0; }
  .workspace-more-menu form button { width: 100%; }
}

@media (min-width: 781px) and (max-width: 1120px) {
  .workspace-sidebar { width: 232px; }
  .workspace-shell .test, .app-shell { margin-left: 232px; }
  .workspace-shell .workspace-main { padding-inline: 28px; }
  .workspace-header { padding-inline: 28px; }
  .workspace-account__email { max-width: 136px; }
}

/* Override legacy generic aside/header rules only for the application shell. */
.workspace-sidebar { margin:0; border-radius:0; }
.workspace-sidebar__brand img { background:white; border-radius:10px; padding:4px; }
@media(max-width:780px) {
 .workspace-header { flex-wrap:nowrap; }
 .workspace-header .brand { flex-basis:auto; }
 .workspace-shell .workspace-menu-toggle { background:#fff; color:var(--workspace-navy); border-color:var(--workspace-line); }
}
/* Feather icons, MIT license in static/vendor/feather/LICENSE. */
.nav-icon{display:inline-block;width:24px;height:24px;flex:none;background:currentColor;mask:var(--nav-icon) center/contain no-repeat;-webkit-mask:var(--nav-icon) center/contain no-repeat}
.icon-home{--nav-icon:url('/static/vendor/feather/home.svg')}.icon-calendar{--nav-icon:url('/static/vendor/feather/calendar.svg')}.icon-users{--nav-icon:url('/static/vendor/feather/users.svg')}.icon-message-square{--nav-icon:url('/static/vendor/feather/message-square.svg')}.icon-menu{--nav-icon:url('/static/vendor/feather/menu.svg')}
body.workspace-shell [data-campaign-nav][hidden]{display:none!important}
@media(max-width:780px){
 body.workspace-shell .workspace-mobile-nav{display:flex;gap:0;box-shadow:0 -2px 12px rgb(8 13 69 / 3%);min-height:66px}
 body.workspace-shell .workspace-mobile-nav>a,body.workspace-shell .workspace-mobile-nav>button{flex:1;font-size:11px;font-weight:500;gap:5px;color:#627b8c;min-height:54px}
 body.workspace-shell .workspace-mobile-nav .nav-icon{width:25px;height:25px}
 body.workspace-shell .workspace-mobile-nav a[aria-current="page"],body.workspace-shell .workspace-mobile-nav button[aria-expanded="true"]{color:#009e95;font-weight:600}
}

/* The active practice is a persistent workspace context, never a hidden menu filter. */
body.workspace-shell .workspace-header__context.has-practice-context{display:flex;align-items:center;gap:16px;min-width:0;overflow:visible;white-space:normal;flex:1;letter-spacing:0}
body.workspace-shell .workspace-header .workspace-practice-control,
body.workspace-shell .workspace-header .workspace-site-control{display:flex;flex-direction:column;gap:2px;min-width:0;max-width:320px;margin:0;padding:0;background:transparent;border:0;border-radius:0;color:#65736e;font-size:11px;font-weight:500}
body.workspace-shell .workspace-header .workspace-practice-control[hidden],
body.workspace-shell .workspace-header .workspace-practice-name[hidden]{display:none}
body.workspace-shell .workspace-header .workspace-practice-control select,
body.workspace-shell .workspace-header .workspace-site-control select{width:100%;min-height:36px;max-width:320px;margin:0;padding:6px 28px 6px 10px;border:1px solid #dce5e0;border-radius:8px;background-color:#fff;color:#243e33;font-size:14px;font-weight:600;text-overflow:ellipsis}
.workspace-practice-name{font-size:14px;font-weight:650;color:#243e33;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.places-workspace{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}
.places-section-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.places-section-heading h2{margin:0;font-size:18px}
.places-workspace .room{display:flex;justify-content:space-between;align-items:start;gap:12px;margin:8px 0;padding:16px;border:1px solid #e0e6e2;border-radius:12px;background:white}
.places-workspace .room h3{margin:0 0 6px;font-size:16px}.places-workspace .room p{margin:4px 0;font-size:13px}
.places-workspace .room>div{min-width:0;overflow-wrap:anywhere}.places-workspace .room>button{flex:none}
.places-workspace .panel{margin-top:16px}.place-form-actions{display:flex;gap:8px;flex-wrap:wrap}
@media(max-width:780px){
 body.workspace-shell .workspace-header:has(.has-practice-context) {gap:10px;align-items:center;padding:6px 12px}
 body.workspace-shell .workspace-header:has(.has-practice-context) .workspace-header__brand{display:none}
 body.workspace-shell .workspace-header__context.has-practice-context{gap:8px}
 body.workspace-shell .workspace-header .workspace-practice-control,
 body.workspace-shell .workspace-header .workspace-site-control{flex:1;max-width:none}
 body.workspace-shell .workspace-header .workspace-practice-control select,
 body.workspace-shell .workspace-header .workspace-site-control select{max-width:100%;font-size:16px;min-height:40px;padding:6px 22px 6px 8px}
 .workspace-practice-name{flex:1;font-size:14px}
 .places-workspace{grid-template-columns:minmax(0,1fr);gap:24px}.places-section-heading{flex-wrap:wrap}
}
