#dashboard-customise-toolbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid #dbe3e8;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 42, 68, 0.06);
}

@media (min-width: 768px) {
  #dashboard-customise-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.dashboard-customise-kicker {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #2d7d83;
}

#dashboard-customise-toolbar h2 {
  margin-top: .15rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: #111516;
}

.dashboard-customise-help {
  margin-top: .2rem;
  font-size: .8rem;
  color: #64748b;
}

.dashboard-customise-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.dashboard-customise-actions button,
.dashboard-widget-controls button {
  border: 1px solid #cbd5e1;
  border-radius: .65rem;
  background: #fff;
  padding: .5rem .75rem;
  font-size: .75rem;
  font-weight: 700;
  color: #334155;
}

.dashboard-customise-actions button:hover,
.dashboard-widget-controls button:hover {
  border-color: #2d7d83;
  color: #1c5c62;
}

.dashboard-customise-actions .primary {
  border-color: #2d7d83;
  background: #2d7d83;
  color: #fff;
}

.dashboard-customise-actions .primary:hover {
  background: #1c5c62;
  color: #fff;
}

.dashboard-customise-actions .hidden,
.dashboard-widget-manager.hidden {
  display: none;
}

.dashboard-widget-manager {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
  border: 1px dashed #94a3b8;
  border-radius: 1rem;
  background: #f8fafc;
}

.dashboard-widget-manager h3 {
  font-size: .9rem;
  font-weight: 800;
  color: #111516;
}

.dashboard-widget-manager p {
  margin-top: .15rem;
  font-size: .75rem;
  color: #64748b;
}

.dashboard-widget-options {
  display: grid;
  gap: .5rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.dashboard-widget-options label {
  display: flex;
  align-items: center;
  gap: .5rem;
  border: 1px solid #e2e8f0;
  border-radius: .75rem;
  background: #fff;
  padding: .65rem .75rem;
  font-size: .78rem;
  font-weight: 600;
  color: #334155;
}

.dashboard-widget-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}

@media (min-width: 1280px) {
  .dashboard-widget-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-widget-full {
    grid-column: span 2 / span 2;
  }

  .dashboard-widget-half {
    grid-column: span 1 / span 1;
  }
}

.dashboard-widget {
  position: relative;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.dashboard-widget > *,
.dashboard-widget article,
.dashboard-widget section,
.dashboard-widget div,
.dashboard-widget header,
.dashboard-widget footer,
.dashboard-widget main,
.dashboard-widget aside,
.dashboard-widget nav {
  min-width: 0;
  max-width: 100%;
}

.dashboard-widget h1,
.dashboard-widget h2,
.dashboard-widget h3,
.dashboard-widget h4,
.dashboard-widget h5,
.dashboard-widget h6,
.dashboard-widget p,
.dashboard-widget a,
.dashboard-widget span,
.dashboard-widget td,
.dashboard-widget th {
  overflow-wrap: anywhere;
  word-break: normal;
}

.dashboard-widget table {
  width: 100%;
  min-width: 36rem;
}

.dashboard-widget table:is(:only-child),
.dashboard-widget .overflow-auto,
.dashboard-widget .overflow-x-auto {
  max-width: 100%;
}

.dashboard-widget-hidden {
  display: none !important;
}

.dashboard-widget-controls {
  display: none;
}

.dashboard-editing .dashboard-widget-controls {
  display: flex;
  position: relative;
  z-index: 5;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin: -.1rem -.1rem .75rem;
  padding: .65rem .75rem;
  border: 1px dashed #2d7d83;
  border-radius: .75rem;
  background: #eef7f7;
}

.dashboard-widget-controls span {
  min-width: 8rem;
  flex: 1 1 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .75rem;
  font-weight: 800;
  color: #1c5c62;
}

.dashboard-widget-controls button {
  flex: 0 0 auto;
}

.dashboard-drag-handle {
  cursor: grab;
  letter-spacing: -.15em;
}

.dashboard-editing .dashboard-widget {
  outline: 2px solid transparent;
  outline-offset: 3px;
}

.dashboard-editing .dashboard-widget:hover {
  outline-color: rgba(45, 125, 131, .35);
}

.dashboard-widget-dragging {
  opacity: .45;
}

@media (min-width: 1280px) {
  .dashboard-widget-half > .grid,
  .dashboard-widget-half .grid[class*="grid-cols"],
  .dashboard-widget-half .grid[class*="md:grid-cols"],
  .dashboard-widget-half .grid[class*="lg:grid-cols"],
  .dashboard-widget-half .grid[class*="xl:grid-cols"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .dashboard-widget-half .flex {
    min-width: 0;
  }

  .dashboard-widget-half table {
    min-width: 34rem;
  }

  .dashboard-widget-half .overflow-auto,
  .dashboard-widget-half .overflow-x-auto,
  .dashboard-widget-half div:has(> table) {
    overflow-x: auto !important;
    max-width: 100%;
  }
}

/* Give dashboard cards and widgets a subtle surface contrast against the page. */
#dashboard-customise-toolbar,
.dashboard-widget-manager,
.dashboard-widget :is(article, section, details, a, div)[class~="bg-white"] {
  background-color: #f8fbfc !important;
}

.dashboard-widget :is(article, section, details, a, div)[class*="border-slate-200"] {
  border-color: #d7e2e7 !important;
}

.dashboard-widget :is(article, section, details)[class~="shadow-sm"] {
  box-shadow: 0 8px 22px rgba(15, 42, 68, 0.07) !important;
}

/* Use dashboard space more efficiently without changing content or behaviour. */
.dashboard-widget-grid {
  gap: 1rem;
}

.dashboard-widget :is(.grid)[class~="gap-5"] {
  gap: 1rem !important;
}

.dashboard-widget :is(.grid)[class~="gap-4"] {
  gap: .875rem !important;
}

.dashboard-widget :is(.grid)[class~="gap-3"] {
  gap: .625rem !important;
}

.dashboard-widget [class~="space-y-5"] > :not([hidden]) ~ :not([hidden]) {
  margin-top: 1rem !important;
}

.dashboard-widget [class~="space-y-4"] > :not([hidden]) ~ :not([hidden]) {
  margin-top: .75rem !important;
}

.dashboard-widget :is(article, section, details, a, div)[class~="px-5"] {
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}

.dashboard-widget :is(article, section, details, a, div)[class~="py-5"] {
  padding-top: 1rem !important;
  padding-bottom: 1rem !important;
}

.dashboard-widget :is(article, section, details, a, div)[class~="py-4"] {
  padding-top: .75rem !important;
  padding-bottom: .75rem !important;
}

.dashboard-widget :is(article, section, details, a, div)[class~="p-4"] {
  padding: .75rem !important;
}

.dashboard-widget :is(article, section, details, a, div)[class~="px-4"][class~="py-4"] {
  padding: .75rem .875rem !important;
}

.dashboard-widget :is(div, section)[class~="py-16"],
.dashboard-widget :is(div, section)[class~="py-12"],
.dashboard-widget :is(div, section)[class~="py-10"] {
  padding-top: 1.5rem !important;
  padding-bottom: 1.5rem !important;
}

@media (max-width: 767px) {
  .dashboard-widget-grid {
    gap: .75rem;
  }

  .dashboard-widget :is(article, section, details, a, div)[class~="px-5"] {
    padding-left: .875rem !important;
    padding-right: .875rem !important;
  }
}
