/* Doctorsig shell on top of Bulma — layout, nav, topbar; theme tokens from existing theme sheets */
@import url("ds-theme-paper.css");
@import url("ds-theme-ink.css");

:root {
  --ds-nav-width: 240px;
  --ds-topbar-height: 64px;
  --ds-accent: oklch(58% 0.18 220);
  --ds-sidebar-border: var(--hs-border, #e8e8e8);
  /* Bulma 1.x primary / link (teal-blue, design parity) */
  --bulma-primary-h: 197deg;
  --bulma-primary-l: 42%;
  --bulma-link-h: 197deg;
  --bulma-link-l: 42%;
  /* Bulma border radius scale (controls, boxes, inputs, tags, etc.) */
  --bulma-radius-small: 2px;
  --bulma-radius: 2px;
  --bulma-radius-medium: 2px;
  --bulma-radius-large: 2px;
}

/* App shell typography (prototype: Lexend body) */
html.ds-theme.ds-theme--paper #ds-app-shell {
  font-family: var(--ds-font-stack, "Lexend Deca", system-ui, sans-serif);
}

/* Semantic page surfaces (Bulma box + prototype shadow) */
html.ds-theme.ds-theme--paper .ds-page-surface,
html.ds-theme.ds-theme--paper .ds-data-table-card.box {
  border-radius: 8px;
  box-shadow: var(--ds-design-shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.04), 0 0 0 1px var(--ds-sidebar-border));
}

/* Tables — doctorsig-new-design.html layout (thead tint, 12/16 padding, row hover) */
html.ds-theme.ds-theme--paper #ds-main-content .box .table-container {
  overflow: hidden;
  background: var(--ds-design-surface, #fff);
}

html.ds-theme.ds-theme--paper #ds-main-content .box .table-container > table.table {
  --bulma-table-cell-border-color: var(--ds-design-border, var(--hs-border));
  --bulma-table-head-cell-border-width: 0 0 1px;
  background-color: transparent;
}

html.ds-theme.ds-theme--paper #ds-main-content .box .table-container > table.table thead {
  background: var(--ds-table-header-bg, var(--ds-design-bg));
  border-bottom: 1px solid var(--ds-design-border, var(--hs-border));
}

html.ds-theme.ds-theme--paper #ds-main-content .box .table-container > table.table thead th {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ds-design-muted, var(--color-base-content-muted));
  border-color: transparent;
  border-bottom: 1px solid var(--ds-design-border, var(--hs-border));
  vertical-align: middle;
}

html.ds-theme.ds-theme--paper #ds-main-content .box .table-container > table.table tbody td {
  padding: 12px 16px;
  font-size: 14px;
  vertical-align: middle;
  border-color: var(--ds-design-border, var(--hs-border));
}

html.ds-theme.ds-theme--paper #ds-main-content .box .table-container > table.table tbody tr:last-child td {
  border-bottom-width: 0;
}

html.ds-theme.ds-theme--paper #ds-main-content .box .table-container > table.table.is-hoverable tbody tr:hover {
  background: var(--ds-design-bg, var(--hs-canvas)) !important;
}

/* Prototype tables are flat (no zebra); keep Bulma striped class from adding tint */
html.ds-theme.ds-theme--paper #ds-main-content .box .table-container > table.table.is-striped tbody tr:nth-child(odd),
html.ds-theme.ds-theme--paper #ds-main-content .box .table-container > table.table.is-striped tbody tr:nth-child(even) {
  background-color: transparent !important;
}

.ds-mono,
.ds-data-table-card .ds-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8125rem;
}

/* List page toolbar (issued documents, design parity) */
.ds-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.ds-list-toolbar__left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.ds-list-toolbar__search {
  flex: 1 1 200px;
  max-width: 320px;
  min-width: 0;
}

.ds-list-toolbar__search .input {
  font-size: 0.875rem;
}

.ds-list-toolbar__filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ds-list-toolbar__filters .select select {
  font-size: 0.875rem;
  min-width: 10rem;
}

.ds-list-toolbar__actions {
  flex-shrink: 0;
}

/* New document page toolbar */
.ds-fill-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.ds-fill-toolbar__left {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.ds-fill-toolbar__left .field {
  min-width: 0;
}

#ds-fill-form-type-field {
  flex: 0 1 200px;
  min-width: 160px;
}

#ds-fill-preset-field {
  flex: 0 1 280px;
  min-width: 220px;
}

.ds-fill-preset-status {
  color: var(--ds-muted, #64748b);
}

/* New Document data-source pickers + field badges */
.ds-source-picker {
  border-left: 3px solid #cbd5e1;
}

.ds-source-picker--patient {
  border-left-color: #8b5cf6;
}

.ds-source-picker--medication {
  border-left-color: #16a34a;
}

.ds-source-tag {
  margin-left: 0.4rem;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  vertical-align: middle;
}

.ds-source-tag--patient {
  background-color: #8b5cf6;
}

.ds-source-tag--medication {
  background-color: #16a34a;
}

.ds-source-tag--system {
  background-color: #6b7280;
}

.ds-fill-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Saved preset searchable combobox (New document toolbar) */
#ds-fill-toolbar .ds-fill-preset-combobox,
#ds-fill-preset-wrap.ds-fill-preset-combobox {
  position: relative;
}

#ds-fill-toolbar .ds-fill-preset-combobox .input,
#ds-fill-preset-wrap.ds-fill-preset-combobox .input {
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364748b'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.17l3.71-3.94a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 1.1rem;
  font-size: 0.875rem;
  cursor: pointer;
}

#ds-fill-toolbar .ds-fill-preset-combobox .input.is-open,
#ds-fill-preset-wrap.ds-fill-preset-combobox .input.is-open {
  border-color: var(--ds-accent, #3b82f6);
  box-shadow: 0 0 0 1px var(--ds-accent, #3b82f6);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%233b82f6'%3E%3Cpath fill-rule='evenodd' d='M14.77 12.79a.75.75 0 01-1.06-.02L10 8.83l-3.71 3.94a.75.75 0 11-1.08-1.04l4.25-4.5a.75.75 0 011.08 0l4.25 4.5a.75.75 0 01-.02 1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

/* Stat KPI numbers (design: accent / warning / success / muted) */
.ds-stat-value--accent {
  color: var(--ds-accent) !important;
}

.ds-stat-value--warning {
  color: oklch(64% 0.15 70) !important;
}

.ds-stat-value--success {
  color: oklch(58% 0.14 145) !important;
}

.ds-stat-value--muted {
  color: var(--color-base-content-muted, #6b7280) !important;
}

/* Status pill with dot (Bulma tag + design) */
.ds-status-pill.tag {
  font-weight: 600;
  font-size: 0.75rem;
  gap: 0.35rem;
}

.ds-status-pill .ds-status-pill__dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  flex-shrink: 0;
}

.ds-status-pill--draft {
  background: oklch(96% 0.03 70) !important;
  color: oklch(42% 0.12 55) !important;
}

.ds-status-pill--draft .ds-status-pill__dot {
  background: oklch(55% 0.14 55);
}

.ds-status-pill--issued {
  background: oklch(96% 0.03 145) !important;
  color: oklch(38% 0.12 145) !important;
}

.ds-status-pill--issued .ds-status-pill__dot {
  background: oklch(52% 0.14 145);
}

.ds-status-pill--void,
.ds-status-pill--cancelled {
  background: oklch(96% 0.04 25) !important;
  color: oklch(40% 0.14 25) !important;
}

.ds-status-pill--void .ds-status-pill__dot,
.ds-status-pill--cancelled .ds-status-pill__dot {
  background: oklch(55% 0.16 25);
}

.ds-status-pill--neutral {
  background: var(--bulma-grey-lighter, #ededed) !important;
  color: var(--bulma-grey-dark, #4a4a4a) !important;
}

.ds-status-pill--neutral .ds-status-pill__dot {
  background: var(--bulma-grey, #7a7a7a);
}

/* Live preview / draft sheet */
.ds-prescription-sheet-wrap {
  background: var(--hs-canvas, #f5f5f5);
  border-radius: 8px;
}

.ds-prescription-sheet {
  position: relative;
}

.ds-prescription-sheet--draft::after {
  content: "DRAFT";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(0, 0, 0, 0.06);
  transform: rotate(-18deg);
  pointer-events: none;
  z-index: 2;
}

html.ds-theme {
  background-color: var(--hs-canvas, #fafafa);
  color: var(--color-base-content, #1a1a1a);
}

#ds-app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background: var(--hs-canvas, #fafafa);
}

/* Mobile drawer */
#ds_mobile_nav {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.ds-mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1090;
  background: rgba(0, 0, 0, 0.35);
}

@media screen and (max-width: 1023px) {
  #ds_mobile_nav:checked ~ .ds-mobile-nav-overlay {
    display: block;
  }

  .ds-mobile-nav-open {
    display: inline-flex !important;
  }
}

@media screen and (min-width: 1024px) {
  .ds-mobile-nav-open {
    display: none !important;
  }
}

@media screen and (max-width: 1023px) {
  #ds-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1092;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.12);
  }

  #ds_mobile_nav:checked ~ #ds-sidebar {
    transform: translateX(0);
  }
}

#ds-sidebar {
  width: var(--ds-nav-width);
  flex-shrink: 0;
  background: var(--hs-shell, #fff);
  border-right: 1px solid var(--ds-sidebar-border);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#ds-sidebar-header {
  padding: 10px;
  border-bottom: 1px solid var(--ds-sidebar-border);
}

.ds-logo {
  display: flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
}

.ds-logo-full {
  display: block;
  width: auto;
  height: 42px;
  max-width: 100%;
  object-fit: contain;
}

.ds-logo-icon {
  display: none;
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.ds-nav-section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-base-content-muted, #6b7280);
  padding: 0 0.75rem;
}

.ds-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ds-nav-item {
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 2px;
  border-radius: 6px;
  color: var(--color-base-content-muted, #6b7280);
  text-decoration: none !important;
  font-weight: 500;
  font-size: 0.875rem;
  transition: background 0.15s, color 0.15s;
}

.ds-nav-item:hover {
  background: var(--hs-canvas, #f5f5f5);
  color: var(--color-base-content, #111);
}

.ds-nav-item--active {
  background: oklch(96% 0.01 220);
  color: var(--ds-accent);
  border-left: 3px solid var(--ds-accent);
  padding-left: calc(0.75rem - 3px);
}

.ds-nav-icon {
  flex-shrink: 0;
  color: inherit;
}

.ds-nav-item-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#ds-main-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

#ds-topbar {
  height: var(--ds-topbar-height);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  background: var(--hs-shell, #fff);
  border-bottom: 1px solid var(--ds-sidebar-border);
}

.ds-topbar-org {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-base-content, #111);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ds-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.ds-lang-switch {
  display: flex;
  gap: 4px;
}

.ds-lang-dropdown > summary {
  list-style: none;
  min-width: 2.75rem;
  font-weight: 600;
}

.ds-lang-dropdown > summary::-webkit-details-marker {
  display: none;
}

.ds-lang-dropdown[open] > summary {
  background: var(--hs-canvas, #f5f5f5);
}

/* Bulma .box sets display:block and overrides the native closed <dialog> hiding. */
dialog.box:not([open]) {
  display: none !important;
}

.ds-document-types-modal {
  border: none;
  border-radius: 8px;
  max-width: 32rem;
  width: calc(100% - 2rem);
  padding: 0;
}

.ds-document-types-modal::backdrop {
  background: rgba(0, 0, 0, 0.35);
}

.ds-issued-document-modal {
  border: none;
  border-radius: 8px;
  max-width: 42rem;
  width: calc(100% - 2rem);
  padding: 0;
}

.ds-issued-document-modal::backdrop {
  background: rgba(0, 0, 0, 0.35);
}

.ds-issued-share-modal {
  max-width: 32rem;
}

.ds-issued-document-preview-wrap {
  max-height: min(70vh, 820px);
  overflow: auto;
}

.ds-team-avatar {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff !important;
}

.ds-fill-preset-dropdown {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  border: 1px solid var(--ds-dropdown-border, rgb(15 23 42 / 0.12));
  border-radius: 8px;
  background: var(--ds-dropdown-bg, #fff);
  color: var(--ds-dropdown-text, #0f172a);
  box-shadow: 0 4px 16px rgb(15 23 42 / 0.1);
  overflow: hidden;
}

.ds-fill-preset-dropdown.is-hidden {
  display: none;
}

.ds-fill-preset-listbox {
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  max-height: 11rem;
  overflow-y: auto;
}

.ds-fill-preset-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.ds-fill-preset-option__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ds-fill-preset-option__end {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  min-width: 2.75rem;
  justify-content: flex-end;
}

.ds-fill-preset-option__check {
  width: 1rem;
  height: 1rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%233b82f6'%3E%3Cpath fill-rule='evenodd' d='M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0;
}

.ds-fill-preset-option.is-selected .ds-fill-preset-option__check {
  opacity: 1;
}

.ds-fill-preset-option__actions {
  display: none;
  align-items: center;
  gap: 0.15rem;
}

.ds-fill-preset-option.is-saved:hover .ds-fill-preset-option__actions,
.ds-fill-preset-option.is-saved:focus-within .ds-fill-preset-option__actions {
  display: inline-flex;
}

.ds-fill-preset-option.is-saved:hover .ds-fill-preset-option__check,
.ds-fill-preset-option.is-saved:focus-within .ds-fill-preset-option__check {
  opacity: 0;
}

.ds-fill-preset-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
}

.ds-fill-preset-icon-btn svg {
  width: 0.95rem;
  height: 0.95rem;
}

.ds-fill-preset-icon-btn:hover {
  background: rgb(59 130 246 / 0.12);
  color: var(--ds-accent, #2563eb);
}

.ds-fill-preset-icon-btn--danger:hover {
  background: rgb(220 38 38 / 0.1);
  color: #dc2626;
}

/* Unified icon-only actions (edit/remove/duplicate across modules) */
.ds-icon-action-btn {
  min-width: 2rem;
  width: 2rem;
  height: 2rem;
  padding: 0 !important;
}

.ds-icon-action-btn .icon {
  margin: 0 !important;
}

.ds-icon-action-btn--danger:hover,
.ds-icon-action-btn--danger:focus-visible {
  color: #dc2626 !important;
  background: rgb(220 38 38 / 0.1) !important;
}

.ds-fill-preset-option.is-hidden {
  display: none;
}

.ds-fill-preset-option:hover,
.ds-fill-preset-option.is-active {
  background: rgb(59 130 246 / 0.08);
}

.ds-fill-preset-footer {
  border-top: 1px solid var(--ds-dropdown-border, rgb(15 23 42 / 0.1));
  padding: 0.25rem 0;
}

.ds-fill-preset-action {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.6rem 0.85rem;
  border: none;
  background: transparent;
  color: var(--ds-accent, #2563eb);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  line-height: 1.35;
}

.ds-fill-preset-action:hover:not(:disabled) {
  background: rgb(59 130 246 / 0.1);
}

.ds-fill-preset-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ds-fill-preset-action.is-hidden {
  display: none;
}

.ds-fill-preset-action--danger {
  color: #dc2626;
  font-weight: 400;
}

.ds-fill-preset-action--danger:hover:not(:disabled) {
  background: rgb(220 38 38 / 0.08);
}

#ds-fill-pdf-frame-wrap {
  opacity: 0.72;
}

.ds-fill-field-wrap {
  position: relative;
}

.ds-fill-field-wrap .input.align-left,
.ds-fill-field-wrap .textarea.align-left {
  text-align: left;
}

.ds-fill-field-wrap .input.align-center,
.ds-fill-field-wrap .textarea.align-center {
  text-align: center;
}

.ds-fill-field-wrap .input.align-right,
.ds-fill-field-wrap .textarea.align-right {
  text-align: right;
}

.ds-user-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: none;
  background: var(--ds-accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.ds-user-menu .dropdown-trigger {
  display: inline-block;
}

.ds-user-menu .dropdown-menu {
  min-width: 12rem;
}

.ds-user-menu > summary {
  list-style: none;
}

.ds-user-menu > summary::-webkit-details-marker {
  display: none;
}

#ds-main-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

#ds-main-content {
  flex: 1;
  padding: 1.5rem 1.25rem 2rem;
}

@media screen and (min-width: 640px) {
  #ds-main-content {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media screen and (min-width: 1024px) {
  #ds-main-content {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }
}

.ds-max-w-content {
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
}

/* Wireframe subsection tabs (legacy hs-tablist) */
.ds-shell-tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--ds-sidebar-border);
  padding-bottom: 0.5rem;
}

.ds-shell-tab {
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  text-decoration: none !important;
  color: var(--color-base-content-muted, #6b7280);
}

.ds-shell-tab:hover {
  background: var(--hs-canvas, #f5f5f5);
  color: var(--color-base-content, #111);
}

.ds-shell-tab--active {
  background: #fff;
  color: var(--ds-accent);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.ds-shell-tab--disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

#ds-app-footer {
  padding: 0.65rem 1.25rem 1rem;
  font-size: 0.75rem;
  color: var(--color-base-content-muted, #6b7280);
  border-top: 1px solid var(--ds-sidebar-border);
  background: var(--hs-shell, #fff);
}

#ds-sidebar-footer {
  margin-top: auto;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--ds-sidebar-border);
}

.ds-sidebar-collapse-btn {
  border: none;
  background: transparent;
  color: var(--color-base-content-muted, #6b7280);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
}

.ds-sidebar-collapse-btn:hover {
  background: var(--hs-canvas, #f5f5f5);
  color: var(--color-base-content, #111);
}

/* Collapsed sidebar (optional) */
#ds-app-shell.ds-shell--nav-collapsed #ds-sidebar {
  width: 72px;
}

#ds-app-shell.ds-shell--nav-collapsed .ds-nav-section-title,
#ds-app-shell.ds-shell--nav-collapsed .ds-nav-item-label,
#ds-app-shell.ds-shell--nav-collapsed #ds-sidebar-footer p {
  display: none;
}

#ds-app-shell.ds-shell--nav-collapsed .ds-logo-full {
  display: none;
}

#ds-app-shell.ds-shell--nav-collapsed .ds-logo-icon {
  display: block;
}

#ds-app-shell.ds-shell--nav-collapsed #ds-sidebar-header {
  display: flex;
  justify-content: center;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

#ds-app-shell.ds-shell--nav-collapsed .ds-nav-item {
  justify-content: center;
}

/* Bulma + Bootstrap-ish inner page coexistence */
#ds-main-content .button.ds-is-compact {
  padding-left: 0.65em;
  padding-right: 0.65em;
}

/* Reduce Bulma title margin when stacked with tablist */
#ds-main-content .title.is-spaced {
  margin-bottom: 0.5rem;
}

/* Contacts module */
.contact-detail-tabs.tabs {
  margin-bottom: 1rem;
}

.contact-tab-panel.is-hidden {
  display: none;
}

html.ds-theme.ds-theme--paper .contact-detail-page .contact-record-surface.ds-page-surface {
  border-radius: 0;
}

.contact-detail-page .contact-record-section + .contact-record-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--ds-design-border, var(--hs-border, #e8e8e8));
}

.contact-detail-page .contact-record-surface .input,
.contact-detail-page .contact-record-surface .select select,
.contact-detail-page .contact-record-surface .textarea {
  border-radius: 0;
}

.contact-detail-page .contact-record-surface .select:not(.is-multiple):not(.is-loading)::after {
  border-radius: 0;
}

.contact-detail-page .contact-consultation-table.table-container {
  border: 1px solid var(--ds-design-border, var(--hs-border, #e8e8e8));
}

html.ds-theme.ds-theme--paper .contact-detail-page .contact-consultation-table > table.table thead {
  background: var(--ds-table-header-bg, var(--ds-design-bg, #fafafa));
}

.contact-toggle input[type="checkbox"] {
  width: 2.75rem;
  height: 1.35rem;
  accent-color: var(--ds-primary, #3273dc);
}

.tag.contact-status-completed {
  background-color: #e8f5e9;
  color: #2e7d32;
}

.tag.contact-status-followup {
  background-color: #e3f2fd;
  color: #1565c0;
}

.tag.contact-status-archived {
  background-color: #f5f5f5;
  color: #616161;
}
