:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-soft: #f1f3f4;
  --hover: #f2f6fc;
  --active: #d3e3fd;
  --line: #e0e3e7;
  --text: #202124;
  --muted: #5f6368;
  --blue: #1a73e8;
  --red: #c5221f;
  --green: #188038;
  --yellow: #fbbc04;
  --shadow: 0 1px 2px rgba(60, 64, 67, 0.2), 0 1px 3px rgba(60, 64, 67, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Google Sans", Roboto, Arial, sans-serif;
  font-size: 14px;
}

body.admin-background {
  background:
    linear-gradient(90deg, rgba(246, 248, 252, 0.88), rgba(246, 248, 252, 0.74)),
    url("assets/login-background.jpg") center / cover fixed no-repeat;
}

.auth-loading .webmail-app {
  visibility: hidden;
}

.login-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at top left, #d8e7ff, transparent 34%), var(--bg);
}

.login-shell {
  width: min(100%, 440px);
}

.admin-login-shell {
  position: relative;
  display: grid;
  width: 100%;
  max-width: none;
  min-height: 100vh;
  place-items: center;
  margin: 0 auto;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(3, 12, 32, 0.2), rgba(3, 12, 32, 0.42)),
    url("assets/login-background.jpg") center / cover no-repeat;
}

.admin-login-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 72% 50%, rgba(3, 12, 32, 0.08), rgba(3, 12, 32, 0.42));
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 1;
  border-radius: 24px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(8px);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.login-brand.stacked {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}

.brand-logo {
  width: 74px;
  height: 74px;
  object-fit: contain;
}

.login-brand.stacked .brand-logo {
  width: 112px;
  height: 112px;
}

.login-brand.stacked .brand-logo.provida-logo {
  width: min(240px, 100%);
  height: 116px;
}

.login-brand.stacked h1 {
  font-size: 32px;
}

.brand-logo.small {
  width: 38px;
  height: 38px;
}

.brand-logo.small.provida-logo {
  width: 108px;
  height: 36px;
}

.login-brand h1 {
  margin: 0;
  font-size: 28px;
}

.login-brand p {
  margin: 4px 0 0;
  color: var(--muted);
}

.login-form,
.modal-card {
  display: grid;
  gap: 14px;
}

.login-form label,
.modal-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.login-form input,
.login-form select,
.modal-card input,
.modal-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: #fff;
  color: var(--text);
  outline: 0;
}

.modal-card textarea {
  min-height: 180px;
  resize: vertical;
}

.form-error {
  margin: 0;
  color: var(--red);
  font-size: 12px;
}

.form-success {
  margin: 12px 0 0;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.login-secondary-action {
  width: 100%;
  margin-top: 14px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 800;
}

.domain-hint {
  margin: -4px 0 0;
  border-radius: 10px;
  padding: 9px 11px;
  background: #eef6ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.login-note {
  margin-top: 18px;
  border-radius: 14px;
  padding: 12px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr) 300px;
  grid-template-rows: 64px minmax(0, 1fr);
  height: 100vh;
  min-width: 0;
}

.topbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 48px 240px 230px minmax(260px, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(246, 248, 252, 0.9);
  backdrop-filter: blur(10px);
}

.project-context {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: var(--muted);
}

.project-context span {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.project-context strong {
  overflow: hidden;
  color: #3c4043;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button,
.right-rail button,
.mail-actions button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
}

.icon-button:hover,
.right-rail button:hover,
.mail-actions button:hover {
  background: #e8eaed;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 22px;
  color: #3c4043;
}

.brand strong {
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 26px;
  place-items: center;
  border-radius: 6px;
  background: linear-gradient(135deg, #ea4335 0 32%, #fbbc04 32% 54%, #34a853 54% 76%, #4285f4 76%);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

.search {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 48px;
  border-radius: 24px;
  padding: 0 18px;
  background: #eaf1fb;
  color: var(--muted);
}

.tenant-switcher {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.tenant-switcher span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.tenant-switcher select {
  width: 100%;
  min-width: 0;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  outline: 0;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 6px;
}

.surface-link {
  border: 0;
  border-radius: 999px;
  padding: 9px 13px;
  background: #e8f0fe;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.role-pill,
.permission-chip {
  border-radius: 999px;
  padding: 7px 10px;
  background: #e6f4ea;
  color: #137333;
  font-size: 12px;
  font-weight: 800;
}

.avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
}

.sidebar {
  min-width: 0;
  overflow: auto;
  padding: 8px 12px 20px 0;
  background: rgba(246, 248, 252, 0.86);
  backdrop-filter: blur(10px);
}

.compose-button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 142px;
  height: 56px;
  margin: 0 0 16px 8px;
  border: 0;
  border-radius: 16px;
  padding: 0 24px;
  background: #c2e7ff;
  color: #001d35;
  box-shadow: var(--shadow);
  font-size: 15px;
  font-weight: 600;
}

.compose-button:hover {
  box-shadow: 0 2px 6px rgba(60, 64, 67, 0.28);
}

.product-nav {
  display: grid;
  gap: 1px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% - 12px);
  height: 32px;
  border: 0;
  border-radius: 0 16px 16px 0;
  padding: 0 12px 0 24px;
  background: transparent;
  color: #3c4043;
  text-align: left;
}

.nav-item.active {
  background: #fce8e6;
  color: var(--red);
  font-weight: 700;
}

.nav-item:hover {
  background: #e8eaed;
}

.main-area {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 0 14px 16px 0;
}

.hidden {
  display: none;
}

.dashboard-view {
  display: grid;
  gap: 14px;
}

.page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 18px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.eyebrow {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.page-title h1 {
  margin: 4px 0 0;
  font-size: 28px;
  font-weight: 500;
}

.primary-action {
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
}

.light-action {
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  background: #eef3fb;
  color: var(--text);
  font-weight: 800;
}

.form-actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric-grid article,
.panel {
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.metric-grid article {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
}

.metric-grid small,
.metric-grid span {
  color: var(--muted);
}

.metric-grid strong {
  font-size: 24px;
}

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

.panel {
  min-width: 0;
  padding: 12px;
}

.panel.wide {
  grid-column: 1 / -1;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.panel-head h2 {
  margin: 0;
  font-size: 14px;
}

.panel-head button {
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  background: #e8f0fe;
  color: var(--blue);
  font-weight: 700;
}

.domain-list,
.user-list {
  display: grid;
  gap: 8px;
}

.domain-row,
.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
}

.domain-row strong,
.domain-row span,
.user-row strong,
.user-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.domain-row span,
.user-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.server-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.server-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.server-form input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  color: var(--text);
}

.server-form .check-row {
  align-content: center;
  grid-template-columns: auto 1fr;
  color: var(--text);
}

.form-status {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.permission-presets {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.app-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 40;
  max-width: min(420px, calc(100vw - 32px));
  border-radius: 12px;
  padding: 14px 18px;
  background: #137333;
  color: #fff;
  box-shadow: 0 18px 50px rgba(19, 115, 51, 0.25);
  font-weight: 900;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.app-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.manager-notification-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.46);
}

.manager-notification-card {
  width: min(760px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.manager-notification-card p {
  margin: 0 0 14px;
  color: var(--muted);
}

.notification-update-row {
  align-items: flex-start;
}

.server-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.server-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
  font-size: 12px;
}

.server-row strong {
  display: block;
}

.server-row span {
  color: var(--muted);
}

.doctor-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.doctor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fbff;
}

.doctor-row strong,
.doctor-row span {
  display: block;
}

.doctor-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.doctor-table {
  display: grid;
  gap: 7px;
}

.doctor-table-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(110px, 0.7fr) minmax(180px, 1fr) 90px auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

.doctor-table-row.head {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.doctor-table-row span,
.doctor-table-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 8px;
}

.form-intro {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  color: var(--muted);
}

.form-intro strong {
  color: var(--ink);
  font-size: 15px;
}

.admin-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.admin-form input,
.admin-form select {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  color: var(--text);
  font-size: 12px;
}

.admin-form .check-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  color: var(--text);
}

.check-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.check-grid .check-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  background: #fff;
}

.data-entry-form,
.user-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compact-form-panel {
  max-width: 1180px;
  padding: 10px 12px 12px;
}

.compact-form-panel .data-entry-form {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
}

.compact-form-panel .admin-form .wide-field {
  grid-column: span 3;
}

.compact-form-panel .primary-action {
  min-height: 32px;
  padding: 8px 14px;
}

.admin-form .wide-field {
  grid-column: 1 / -1;
}

.data-pick-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.data-pick-row:hover {
  background: var(--hover);
}

.data-pick-row span {
  color: var(--muted);
  font-size: 12px;
}

.settings-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-form .primary-action,
.settings-form .form-status {
  grid-column: 1 / -1;
}

.admin-table {
  display: grid;
  gap: 8px;
}

.admin-table-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 12px;
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-table-row.head {
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.admin-table-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-table-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.admin-table-row button {
  width: fit-content;
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: #e8f0fe;
  color: var(--blue);
  font-weight: 800;
}

.admin-table-row .danger-action {
  background: #fce8e6;
  color: var(--red);
}

.status-pill {
  border-radius: 999px;
  padding: 5px 9px;
  background: #e6f4ea;
  color: #137333;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.warn {
  background: #fef7e0;
  color: #b06000;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.feature-grid div {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #f8fbff;
}

.feature-grid strong,
.feature-grid span {
  display: block;
}

.feature-grid span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.overbook-shell {
  display: grid;
  gap: 10px;
}

.overbook-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  align-items: end;
  gap: 12px;
  border: 1px solid #b7c9e8;
  border-radius: 8px;
  padding: 12px;
  background: #eaf2ff;
  box-shadow: var(--shadow);
}

.overbook-hero h1 {
  margin: 4px 0 0;
  color: #123b73;
  font-size: 23px;
  line-height: 1.15;
}

.overbook-select {
  display: grid;
  gap: 6px;
  color: #476282;
  font-size: 12px;
  font-weight: 800;
}

.overbook-select select {
  min-width: 0;
  border: 1px solid #92add4;
  border-radius: 6px;
  padding: 8px;
  background: #fff;
}

.overbook-hero-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.dashboard-widget {
  position: relative;
  cursor: grab;
  transition: box-shadow 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.dashboard-widget:active {
  cursor: grabbing;
}

.dashboard-widget:hover {
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2), var(--shadow);
}

.dashboard-widget.is-dragging {
  opacity: 0.55;
  transform: scale(0.995);
}

.dashboard-widget.is-drop-target {
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.24), var(--shadow);
}

.overbook-executive,
.overbook-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.overbook-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.overbook-executive article,
.overbook-summary div {
  border: 1px solid #a9bfdc;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.overbook-executive small,
.overbook-summary small,
.overbook-executive span,
.overbook-summary span {
  display: block;
  color: var(--muted);
}

.overbook-executive strong,
.overbook-summary strong {
  display: block;
  margin: 2px 0;
  color: #163f72;
  font-size: 23px;
}

.overbook-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.notification-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.notification-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.notification-card small,
.notification-card span {
  display: block;
  color: var(--muted);
}

.notification-card strong {
  display: block;
  margin: 2px 0;
  font-size: 23px;
}

.notification-card.success {
  border-color: #b7dfc0;
  background: #f1fbf3;
}

.notification-card.success strong {
  color: #137333;
}

.notification-card.warn {
  border-color: #ffe2a8;
  background: #fff9ed;
}

.notification-card.warn strong {
  color: #b06000;
}

.notification-card.danger {
  border-color: #f3b7b3;
  background: #fff5f4;
}

.notification-card.danger strong {
  color: #c5221f;
}

.daily-control-table {
  display: grid;
  gap: 6px;
  overflow-x: auto;
}

.daily-control-row {
  display: grid;
  grid-template-columns: 120px 100px minmax(180px, 1.4fr) repeat(4, minmax(82px, 0.7fr));
  align-items: center;
  min-width: 820px;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
}

.daily-control-row.head {
  border-color: #d3dce8;
  background: #f5f8fc;
  color: #39516d;
  font-size: 11px;
  text-transform: uppercase;
}

.daily-control-row span,
.daily-control-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-detail-table {
  display: grid;
  gap: 6px;
  overflow-x: auto;
}

.daily-detail-row {
  display: grid;
  grid-template-columns: 108px 90px minmax(180px, 1.2fr) minmax(220px, 1.2fr) minmax(130px, 0.8fr) repeat(4, minmax(58px, 0.4fr));
  align-items: center;
  min-width: 1080px;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  font-size: 12px;
}

.daily-detail-row.head {
  border-color: #d3dce8;
  background: #f5f8fc;
  color: #39516d;
  font-size: 11px;
  text-transform: uppercase;
}

.daily-detail-row span,
.daily-detail-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doctor-report-table {
  display: grid;
  gap: 6px;
  overflow-x: auto;
}

.doctor-report-row {
  display: grid;
  grid-template-columns: minmax(210px, 1.4fr) minmax(96px, 0.7fr) minmax(170px, 1fr) minmax(130px, 0.8fr) repeat(7, minmax(72px, 0.45fr));
  align-items: center;
  min-width: 1220px;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  font-size: 12px;
}

.doctor-report-row.head {
  border-color: #d3dce8;
  background: #f5f8fc;
  color: #39516d;
  font-size: 11px;
  text-transform: uppercase;
}

.doctor-report-row span,
.doctor-report-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.instruction-grid,
.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.instruction-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.instruction-grid strong,
.instruction-grid span {
  display: block;
}

.instruction-grid span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.chart-panel {
  min-height: 240px;
  overflow-x: auto;
}

.line-chart-wrap,
.live-evolution-chart {
  display: grid;
  gap: 8px;
}

.live-evolution-chart {
  min-width: 560px;
}

.live-chart-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.live-chart-title strong,
.live-chart-title span {
  display: block;
}

.live-chart-title strong {
  color: #2f3b4c;
  font-size: 16px;
}

.live-chart-title span {
  margin-top: 6px;
  color: #697386;
  font-size: 12px;
}

.live-chart-title button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: #f1f3f6;
  color: #5f6368;
  font-weight: 900;
}

.line-chart {
  width: 100%;
  height: auto;
  min-height: 230px;
}

.chart-grid-line {
  fill: none;
  stroke: #dfe3ea;
  stroke-dasharray: 3 5;
  stroke-width: 1.2;
}

.axis-label {
  fill: #6b7c93;
  font-size: 11px;
  font-weight: 800;
  text-anchor: end;
}

.axis-label.x-label {
  text-anchor: middle;
}

.line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line.scheduled,
.dot.scheduled {
  stroke: #1a73e8;
}

.line.attended,
.dot.attended {
  stroke: #16a34a;
}

.line.missing,
.dot.missing {
  stroke: #f07f4f;
}

.dot {
  fill: #fff;
  stroke-width: 2.6;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 700;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chart-legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.chart-legend .scheduled {
  background: #1a73e8;
}

.chart-legend .attended {
  background: #16a34a;
}

.chart-legend .missing {
  background: #f07f4f;
}

.single-evolution {
  display: grid;
  gap: 10px;
}

.single-evolution-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.single-evolution-head span {
  border-radius: 999px;
  padding: 6px 10px;
  background: #e8f0fe;
  color: var(--blue);
  font-weight: 900;
}

.single-evolution-head strong {
  color: #163f72;
}

.single-evolution-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.single-evolution-kpis article {
  border: 1px solid #d8e1ef;
  border-radius: 8px;
  padding: 9px 10px;
  background: #f8fbff;
}

.single-evolution-kpis small,
.single-evolution p,
.single-evolution-bars span {
  color: var(--muted);
}

.single-evolution-kpis strong {
  display: block;
  margin-top: 4px;
  color: #163f72;
  font-size: 26px;
}

.single-evolution-bars {
  display: grid;
  gap: 8px;
}

.single-evolution-bars label {
  display: grid;
  gap: 6px;
}

.single-evolution-bars i {
  display: block;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef7;
}

.single-evolution-bars b {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.single-evolution-bars .scheduled {
  background: #1a73e8;
}

.single-evolution-bars .attended {
  background: #16a34a;
}

.single-evolution p {
  margin: 0;
  line-height: 1.45;
}

.reports-shell {
  display: grid;
  gap: 12px;
}

.report-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr)) auto auto;
  align-items: end;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.report-filters label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.report-filters input,
.report-filters select {
  min-width: 0;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
}

.report-filters .primary-action,
.report-filters .light-action {
  height: 32px;
  padding: 0 12px;
}

.report-export-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.report-export-actions .primary-action,
.report-export-actions .light-action {
  min-height: 34px;
  padding: 8px 14px;
}

.report-print-header {
  display: none;
}

.report-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid rgba(210, 220, 232, 0.9);
  padding: 0 0 8px;
}

.report-tabs button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 13px;
  background: rgba(255, 255, 255, 0.88);
  color: #39516d;
  font-size: 12px;
  font-weight: 800;
}

.report-tabs button.active {
  border-color: #1a73e8;
  background: #1a73e8;
  color: #fff;
}

.report-content {
  display: grid;
  gap: 12px;
}

.report-panel {
  padding-top: 14px;
}

.report-kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.report-kpi-strip article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.report-kpi-strip small,
.report-kpi-strip strong {
  display: block;
}

.report-kpi-strip small {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
}

.report-kpi-strip strong {
  font-size: 22px;
}

.report-chart {
  display: grid;
  gap: 10px;
}

.report-chart h3 {
  margin: 0;
  color: #5b9bd5;
  font-size: 17px;
  font-weight: 800;
  text-transform: uppercase;
}

.report-table-wrap,
.division-table-wrap {
  overflow-x: auto;
  padding-bottom: 4px;
}

.report-table {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(6, minmax(90px, 1fr));
  min-width: 940px;
  border-top: 1px solid #cfd6df;
  border-left: 1px solid #cfd6df;
}

.report-table > strong,
.division-table > strong {
  background: #2f3b4c;
  color: #fff;
  font-size: 11px;
  text-transform: uppercase;
}

.report-table > span,
.report-table > strong,
.division-table > span,
.division-table > strong {
  border-right: 1px solid #cfd6df;
  border-bottom: 1px solid #cfd6df;
  padding: 6px 8px;
}

.report-table > span {
  background: #fff;
}

.report-table > span:nth-child(14n + 8),
.report-table > span:nth-child(14n + 9),
.report-table > span:nth-child(14n + 10),
.report-table > span:nth-child(14n + 11),
.report-table > span:nth-child(14n + 12),
.report-table > span:nth-child(14n + 13),
.report-table > span:nth-child(14n + 14) {
  background: #f2f2f2;
}

.report-table b {
  display: block;
  color: #2f3b4c;
  font-size: 10px;
  text-transform: uppercase;
}

.division-table {
  display: grid;
  min-width: 860px;
  border-top: 1px solid #cfd6df;
  border-left: 1px solid #cfd6df;
}

.division-table > span:first-of-type,
.division-table > span:nth-of-type(10) {
  background: #595959;
  color: #fff;
  text-transform: uppercase;
}

.division-table span {
  background: #fff;
  text-align: right;
}

.column-chart {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #f0f0f0;
}

.column-chart h3 {
  color: #566273;
  font-size: 16px;
  text-align: center;
}

.column-plot {
  display: grid;
  grid-template-columns: repeat(8, minmax(56px, 1fr));
  align-items: end;
  gap: 12px;
  min-height: 200px;
  border-left: 1px solid #d7d7d7;
  border-bottom: 1px solid #d7d7d7;
  padding: 12px 10px 0;
  background:
    repeating-linear-gradient(to top, transparent 0, transparent 47px, #d9d9d9 48px),
    #fff;
}

.column-item {
  display: grid;
  grid-template-rows: 20px minmax(0, 150px) 22px;
  align-items: end;
  justify-items: center;
  min-width: 0;
  height: 192px;
}

.column-item small {
  color: #4a5565;
  font-weight: 800;
}

.column-item i {
  display: block;
  width: min(58px, 72%);
  min-height: 4px;
}

.column-item span {
  width: 100%;
  overflow: hidden;
  color: #6b7280;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-list {
  display: grid;
  gap: 8px;
}

.alert-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

.alert-row.success {
  border-color: #b7dfc0;
  background: #f1fbf3;
}

.alert-row.warn {
  border-color: #ffe2a8;
  background: #fff9ed;
}

.alert-row.danger {
  border-color: #f3b7b3;
  background: #fff5f4;
}

.alert-row span {
  color: var(--muted);
}

.overbook-card {
  display: grid;
  gap: 7px;
  border: 1px solid #b6c6d9;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.overbook-card h2 {
  margin: 0;
  border-radius: 4px;
  padding: 6px;
  background: #1f5f9e;
  color: #fff;
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
}

.overbook-mini-table {
  display: grid;
  grid-template-columns: 1.2fr repeat(4, minmax(54px, 1fr));
  border: 1px solid #c6d3e4;
  font-size: 10px;
}

.overbook-mini-table strong,
.overbook-mini-table span {
  min-width: 0;
  border-right: 1px solid #c6d3e4;
  border-bottom: 1px solid #c6d3e4;
  padding: 4px;
  text-align: center;
}

.overbook-mini-table strong {
  background: #d9e8fb;
  color: #173b66;
}

.overbook-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.overbook-progress {
  overflow: hidden;
  height: 6px;
  border-radius: 999px;
  background: #e8eef7;
}

.overbook-progress span {
  display: block;
  height: 100%;
  background: #188038;
}

.overbook-table {
  display: grid;
  gap: 6px;
  overflow-x: auto;
}

.overbook-row {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) repeat(6, minmax(92px, 1fr));
  align-items: center;
  min-width: 920px;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
}

.overbook-row.head {
  background: #d9e8fb;
  color: #173b66;
  font-size: 12px;
  text-transform: uppercase;
}

.overbook-row span,
.overbook-row strong {
  min-width: 0;
}

.overbook-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.client-tools {
  margin: 22px 12px 0 16px;
  border-radius: 16px;
  padding: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.client-tools h2 {
  margin: 0 0 12px;
  color: #3c4043;
  font-size: 13px;
}

.client-tools button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 9px 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.client-tools button:hover {
  background: var(--hover);
}

.client-tools small {
  color: var(--muted);
  font-size: 11px;
}

.permission-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.permission-chip {
  background: #e8f0fe;
  color: var(--blue);
}

.locked {
  opacity: 0.42;
  cursor: not-allowed;
}

.locked::after {
  content: " bloqueado";
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.mail-shell {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: minmax(360px, 56%) minmax(260px, 1fr);
  gap: 14px;
  height: calc(100vh - 80px);
  padding: 0;
}

.inbox-panel,
.reader-panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 16px;
  background: var(--surface);
}

.inbox-panel {
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr);
}

.mail-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.mail-actions label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 4px;
}

.mail-actions .refresh-interval {
  margin-left: 6px;
  font-size: 12px;
  white-space: nowrap;
}

.mail-actions select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
  color: var(--text);
  background: var(--surface);
}

.mail-actions span {
  flex: 1;
}

.mail-actions small {
  color: var(--muted);
}

.category-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
}

.category-tabs button {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}

.category-tabs button.active {
  color: var(--blue);
}

.category-tabs button.active::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 0;
  left: 18px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--blue);
}

.category-tabs button:hover {
  background: var(--hover);
}

.message-list {
  min-height: 0;
  overflow: auto;
}

.empty-state {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.message-item {
  display: grid;
  grid-template-columns: 28px minmax(150px, 220px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 0 12px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.message-item:hover {
  position: relative;
  z-index: 1;
  box-shadow: inset 1px 0 0 #dadce0, inset -1px 0 0 #dadce0, 0 1px 2px rgba(60, 64, 67, 0.3);
}

.message-item.active {
  background: #eaf1fb;
}

.message-icon {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: #f4b400;
}

.message-icon::before {
  content: "☆";
  font-size: 18px;
}

.message-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.message-sender,
.message-title {
  min-width: 0;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-preview {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.reader-panel {
  overflow: auto;
}

.reader {
  margin: 0 auto;
  max-width: 980px;
  padding: 24px 38px 80px;
}

.date-line {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.reader h1 {
  margin: 10px 0 20px;
  font-size: 26px;
  font-weight: 400;
  line-height: 1.25;
}

.message-addresses {
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.message-addresses strong {
  display: inline-block;
  width: 48px;
  color: var(--text);
}

.reader-body {
  max-width: 720px;
  color: #303134;
  font-size: 14px;
  line-height: 1.7;
}

.reader-body p {
  margin: 0 0 14px;
}

.email-html-frame {
  width: min(100%, 900px);
  min-height: 620px;
  border: 0;
  background: #fff;
}

.client-action-card {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 22px;
}

.client-action-card button {
  border: 1px solid #d8e7ff;
  border-radius: 999px;
  padding: 9px 14px;
  background: #f8fbff;
  color: var(--blue);
  font-weight: 700;
}

.client-action-card button:hover {
  background: #e8f0fe;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(32, 33, 36, 0.36);
}

.modal[hidden] {
  display: none;
}

.modal-card {
  width: min(100%, 560px);
  border-radius: 18px;
  padding: 18px;
  background: var(--surface);
  box-shadow: 0 20px 60px rgba(32, 33, 36, 0.24);
}

.compose-card {
  width: min(100%, 720px);
}

.password-card {
  width: min(100%, 430px);
}

.password-card h2 {
  margin: 2px 0 0;
  font-size: 20px;
}

.modal-card header,
.modal-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-card footer {
  justify-content: flex-start;
}

.modal-card footer button:not(.primary-action),
.modal-close {
  border: 0;
  border-radius: 999px;
  padding: 9px 13px;
  background: #e8f0fe;
  color: var(--blue);
  font-weight: 800;
}

.right-rail {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 0 16px 16px 14px;
  border-left: 1px solid var(--line);
  background: rgba(246, 248, 252, 0.88);
}

.admin-app {
  grid-template-columns: 256px minmax(0, 1fr);
}

.admin-main {
  padding-right: 16px;
}

.webmail-app .tenant-switcher {
  display: none;
}

.webmail-app .topbar {
  grid-template-columns: 48px 190px minmax(260px, 720px) 1fr;
}

.plugin-card {
  border-radius: 18px;
  padding: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.plugin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.plugin-head button {
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  background: #e8f0fe;
  color: var(--blue);
  font-weight: 700;
}

.signature-preview {
  display: grid;
  gap: 3px;
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fbff;
}

.signature-preview span,
.signature-preview small,
.scheduled-item small {
  color: var(--muted);
}

.signature-swatches {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.signature-swatches span {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--blue);
}

.signature-swatches span:nth-child(2) {
  background: var(--green);
}

.signature-swatches span:nth-child(3) {
  background: var(--red);
}

.agenda-item,
.scheduled-item {
  display: grid;
  gap: 3px;
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.agenda-item:first-of-type,
.scheduled-item:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.agenda-item time {
  color: var(--blue);
  font-weight: 800;
}

.tv-body {
  min-height: 100vh;
  overflow: hidden;
  background: #07111f;
  color: #f8fbff;
}

.tv-dashboard {
  display: grid;
  gap: 18px;
  min-height: 100vh;
  padding: 24px;
  background: linear-gradient(140deg, rgba(26, 115, 232, 0.18), transparent 38%), #07111f;
}

.tv-loading {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  min-height: 100vh;
  text-align: center;
}

.tv-loading img {
  width: 190px;
  height: 96px;
  object-fit: contain;
}

.tv-loading strong {
  font-size: 30px;
}

.tv-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
}

.tv-header > div {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.tv-header img {
  width: 158px;
  height: 58px;
  object-fit: contain;
}

.tv-header span,
.tv-header aside span,
.tv-panel-head span,
.tv-kpis small {
  color: #a9bdd9;
  font-weight: 800;
  text-transform: uppercase;
}

.tv-header strong {
  display: block;
  overflow: hidden;
  font-size: clamp(28px, 3vw, 54px);
  line-height: 1.04;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-header aside {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.tv-header aside strong {
  color: #7dd3fc;
  font-size: 22px;
}

.tv-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.tv-kpis article,
.tv-panel {
  border: 1px solid rgba(169, 189, 217, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
}

.tv-kpis article {
  padding: 18px;
}

.tv-kpis span,
.tv-kpis small {
  display: block;
}

.tv-kpis strong {
  display: block;
  margin: 6px 0;
  color: #fff;
  font-size: clamp(34px, 4vw, 68px);
  line-height: 1;
}

.tv-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.55fr);
  gap: 18px;
}

.tv-panel {
  padding: 18px;
}

.tv-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.tv-panel-head h1 {
  margin: 0;
  font-size: clamp(22px, 2.1vw, 40px);
  line-height: 1.1;
}

.tv-line-chart {
  width: 100%;
  height: auto;
  min-height: 290px;
}

.tv-line-chart path {
  fill: none;
  stroke: rgba(169, 189, 217, 0.35);
  stroke-width: 2;
}

.tv-line-chart polyline {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tv-line-chart .scheduled {
  stroke: #60a5fa;
}

.tv-line-chart .attended {
  stroke: #22c55e;
}

.tv-line-chart circle {
  fill: #07111f;
  stroke-width: 4;
}

.tv-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: #dbeafe;
  font-size: 18px;
  font-weight: 800;
}

.tv-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tv-legend i {
  width: 14px;
  height: 14px;
  border-radius: 999px;
}

.tv-legend .scheduled {
  background: #60a5fa;
}

.tv-legend .attended {
  background: #22c55e;
}

.tv-alert-list {
  display: grid;
  gap: 10px;
}

.tv-alert {
  display: grid;
  gap: 4px;
  border-radius: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.1);
}

.tv-alert strong {
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-alert span {
  color: #cbd5e1;
  font-weight: 800;
}

.tv-alert.danger {
  border-left: 5px solid #f87171;
}

.tv-alert.ok {
  border-left: 5px solid #22c55e;
}

.tv-bars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
}

.tv-bar-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 1.2fr) 70px;
  align-items: center;
  gap: 10px;
}

.tv-bar-row strong {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-bar-row b {
  display: inline-grid;
  place-items: center;
  flex: 0 0 28px;
  height: 28px;
  border-radius: 999px;
  background: #1d4ed8;
  color: #fff;
  font-size: 13px;
}

.tv-bar-row div {
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.tv-bar-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa, #22c55e);
}

.tv-bar-row span {
  color: #e0f2fe;
  font-size: 18px;
  font-weight: 900;
  text-align: right;
}

.tv-bar-row small {
  grid-column: 1 / -1;
  color: #a9bdd9;
  font-weight: 800;
}

.tv-empty {
  display: grid;
  min-height: 270px;
  place-items: center;
  color: #a9bdd9;
  font-size: 22px;
  font-weight: 800;
}

.tv-single-evolution {
  display: grid;
  gap: 18px;
}

.tv-single-evolution article {
  display: grid;
  gap: 8px;
}

.tv-single-evolution span {
  color: #a9bdd9;
  font-weight: 900;
  text-transform: uppercase;
}

.tv-single-evolution strong {
  color: #fff;
  font-size: clamp(44px, 5vw, 88px);
  line-height: 1;
}

.tv-single-evolution i {
  display: block;
  height: 26px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.tv-single-evolution b {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.tv-single-evolution .scheduled {
  background: #60a5fa;
}

.tv-single-evolution .attended {
  background: #22c55e;
}

.tv-single-evolution p {
  margin: 0;
  color: #a9bdd9;
  font-size: 20px;
  font-weight: 800;
}

@media (max-width: 1100px) {
  .app {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .topbar {
    grid-template-columns: 48px 170px minmax(200px, 1fr) 1fr;
  }

  .tenant-switcher {
    display: none;
  }

  .right-rail {
    display: none;
  }

  .mail-shell {
    grid-template-rows: minmax(360px, 1fr);
    padding-right: 14px;
  }

  .reader-panel {
    display: none;
  }
}

@media (max-width: 760px) {
  .app {
    grid-template-columns: 1fr;
  }

  .topbar {
    grid-template-columns: 40px 1fr 48px;
  }

  .brand strong,
  .top-actions .icon-button,
  .sidebar {
    display: none;
  }

  .search {
    grid-column: 2;
  }

  .mail-shell {
    padding: 0;
  }

  .inbox-panel {
    border-radius: 0;
  }

  .main-area {
    padding: 0;
  }

  .metric-grid,
  .dashboard-grid,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .panel.wide {
    grid-column: auto;
  }
}

@media (max-width: 1280px) {
  .tv-body {
    overflow: auto;
  }

  .tv-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tv-main-grid,
  .tv-bars {
    grid-template-columns: 1fr;
  }

  .admin-app {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .admin-app .topbar {
    grid-template-columns: 44px minmax(210px, 240px) minmax(260px, 1fr) auto;
    grid-template-rows: auto auto;
  }

  .admin-app .tenant-switcher {
    grid-column: 3;
    grid-row: 1;
  }

  .admin-app .project-context {
    grid-column: 3 / 5;
    grid-row: 2;
  }

  .admin-app .top-actions {
    grid-column: 4;
    grid-row: 1;
  }

  .overbook-card-grid,
  .chart-grid,
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compact-form-panel .data-entry-form {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .report-filters {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .feature-grid,
  .metric-grid,
  .overbook-executive {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .admin-app {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(0, 1fr);
    height: auto;
    min-height: 100vh;
  }

  .topbar {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    row-gap: 8px;
    padding: 8px 12px;
  }

  .topbar .brand {
    min-width: 0;
  }

  .tenant-switcher,
  .project-context {
    grid-column: 2 / -1;
  }

  .top-actions {
    grid-column: 3;
    grid-row: 1;
  }

  .sidebar {
    display: block;
    grid-column: 1 / -1;
    overflow-x: auto;
    padding: 0 12px 10px;
    white-space: nowrap;
  }

  .product-nav {
    display: flex;
    gap: 8px;
  }

  .product-nav .nav-item {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 9px 12px;
  }

  .client-tools {
    display: none;
  }

  .main-area {
    padding: 0 12px 16px;
  }

  .admin-form,
  .data-entry-form,
  .user-form,
  .server-form,
  .settings-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-export-actions {
    justify-content: stretch;
  }

  .report-export-actions button {
    flex: 1;
  }

  .admin-form .primary-action,
  .admin-form .form-status {
    grid-column: 1 / -1;
  }

  .check-grid,
  .chart-grid,
  .instruction-grid,
  .notification-grid,
  .report-kpi-strip,
  .overbook-summary {
    grid-template-columns: 1fr;
  }

  .overbook-hero {
    grid-template-columns: 1fr;
  }

  .overbook-hero-actions {
    grid-template-columns: 1fr;
  }

  .doctor-table-row {
    grid-template-columns: 1fr 100px;
  }

  .doctor-table-row.head {
    display: none;
  }

  .doctor-table-row .row-actions {
    grid-column: 1 / -1;
  }
}

@media print {
  body.printing-report {
    background: #fff !important;
  }

  body.printing-report .report-print-header {
    display: block !important;
    margin: 0 0 14px !important;
  }

  body.printing-report .print-report-brand {
    display: grid;
    grid-template-columns: 160px 1fr 170px;
    align-items: center;
    gap: 18px;
    border: 1px solid #20324f;
    border-radius: 0;
    overflow: hidden;
    background: #fff;
    color: #20324f;
    break-inside: avoid;
  }

  body.printing-report .print-report-brand img {
    width: 138px;
    max-height: 64px;
    object-fit: contain;
    padding: 12px;
  }

  body.printing-report .print-report-brand > div {
    display: grid;
    gap: 3px;
    padding: 10px 0;
  }

  body.printing-report .print-report-brand strong {
    color: #20324f;
    font-size: 20px;
    line-height: 1.1;
  }

  body.printing-report .print-report-brand span {
    color: #1a73e8;
    font-size: 15px;
    font-weight: 800;
  }

  body.printing-report .print-report-brand small {
    color: #475569;
    font-size: 10px;
    font-weight: 700;
  }

  body.printing-report .print-report-brand em {
    align-self: stretch;
    display: grid;
    place-items: center;
    padding: 10px;
    background: #20324f;
    color: #fff;
    font-size: 10px;
    font-style: normal;
    font-weight: 800;
    text-align: center;
  }

  body.printing-report .topbar,
  body.printing-report .sidebar,
  body.printing-report .client-tools,
  body.printing-report .report-filters,
  body.printing-report .report-tabs,
  body.printing-report .report-export-actions,
  body.printing-report .page-title button {
    display: none !important;
  }

  body.printing-report .admin-app,
  body.printing-report .main-area,
  body.printing-report .dashboard-view,
  body.printing-report .reports-shell,
  body.printing-report .report-content {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    padding: 0 !important;
    background: #fff !important;
  }

  body.printing-report .page-title,
  body.printing-report .panel,
  body.printing-report .report-kpi-strip article,
  body.printing-report .notification-card {
    box-shadow: none !important;
    background: #fff !important;
    break-inside: avoid;
  }

  body.printing-report .panel.wide {
    border: 1px solid #d8dee8;
    padding: 10px !important;
  }

  body.printing-report .overbook-table,
  body.printing-report .report-table-wrap,
  body.printing-report .division-table-wrap,
  body.printing-report .daily-control-table,
  body.printing-report .daily-detail-table {
    overflow: visible !important;
  }

  body.printing-report svg,
  body.printing-report .report-chart,
  body.printing-report .column-chart {
    max-width: 100% !important;
    break-inside: avoid;
  }
}

@media (max-width: 1100px) {
  .admin-app .tenant-switcher {
    display: grid;
  }
}

@media (max-width: 640px) {
  .tv-dashboard {
    padding: 14px;
  }

  .tv-header,
  .tv-kpis,
  .tv-main-grid,
  .tv-bars {
    grid-template-columns: 1fr;
  }

  .tv-header strong {
    white-space: normal;
  }

  .tv-header aside {
    justify-items: start;
  }

  .tv-bar-row {
    grid-template-columns: 1fr;
  }

  .tv-bar-row span {
    text-align: left;
  }

  body {
    font-size: 13px;
  }

  .admin-login-shell {
    padding: 12px;
  }

  .login-card {
    border-radius: 16px;
    padding: 18px;
  }

  .login-brand.stacked .brand-logo {
    width: 82px;
    height: 82px;
  }

  .login-brand.stacked h1 {
    font-size: 24px;
  }

  .topbar {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .top-actions {
    grid-column: 1 / -1;
    grid-row: auto;
    justify-content: space-between;
  }

  .brand {
    font-size: 18px;
  }

  .project-context strong {
    white-space: normal;
  }

  .tenant-switcher,
  .project-context {
    grid-column: 1 / -1;
  }

  .tenant-switcher select {
    width: 100%;
    height: 38px;
    border-radius: 10px;
  }

  .page-title {
    align-items: flex-start;
    gap: 10px;
    flex-direction: column;
  }

  .page-title h1,
  .overbook-hero h1 {
    font-size: 22px;
  }

  .metric-grid,
  .dashboard-grid,
  .feature-grid,
  .overbook-executive,
  .overbook-card-grid,
  .chart-grid,
  .instruction-grid,
  .notification-grid,
  .overbook-summary,
  .admin-form,
  .data-entry-form,
  .user-form,
  .server-form,
  .settings-form,
  .check-grid {
    grid-template-columns: 1fr;
  }

  .panel,
  .metric-grid article,
  .overbook-hero,
  .overbook-card,
  .notification-card {
    border-radius: 10px;
    padding: 12px;
  }

  .overbook-executive strong,
  .overbook-summary strong,
  .notification-card strong,
  .metric-grid strong {
    font-size: 24px;
  }

  .overbook-table,
  .admin-table {
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .overbook-row {
    min-width: 760px;
    grid-template-columns: minmax(220px, 2fr) repeat(6, minmax(78px, 1fr));
  }

  .admin-table-row {
    min-width: 720px;
  }

  .column-chart {
    overflow-x: auto;
  }

  .column-plot {
    min-width: 720px;
  }

  .alert-row,
  .data-pick-row,
  .server-row,
  .domain-row,
  .user-row {
    grid-template-columns: 1fr;
    align-items: start;
    white-space: normal;
  }
}
