/* Base typography and form styling aligned with Visma Universal Design. Bootstrap still provides
   layout utilities and the dropdown behaviour; these rules re-point its visual defaults at the
   VUD tokens in vud-tokens.css so the two do not disagree. */

html {
  font-size: 16px;
  position: relative;
  min-height: 100%;
}

body {
  margin: 0;
  background-color: var(--surface-background-20);
  color: var(--text-idle);
  font-family: var(--font-family-primary-fallback);
  font-size: 0.875rem;
  line-height: 1.5715;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-idle);
  font-weight: var(--font-weight-semi-bold);
}

h1 {
  font-size: 1.5rem;
}

a {
  color: var(--text-link);
  text-decoration: none;
}

a:hover {
  color: var(--secondary-80);
  text-decoration: underline;
}

/* VUD inputs: 32px tall, 4px radius, neutral-60 border that turns secondary on focus. */
.form-control,
.form-select {
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text-idle);
  background-color: #fff;
  border: 1px solid var(--border-default-idle);
  border-radius: var(--radius-xs);
  padding: 0.25rem 0.75rem;
  height: var(--height-7);
}

.form-control::placeholder {
  color: var(--text-placeholder);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--secondary-10);
}

/* VUD buttons are 8px-radius pills with a neutral outline; the primary action fills in
   secondary-70. */
.btn {
  font-family: inherit;
  font-size: 0.875rem;
  border-radius: var(--rounded-sm);
  padding: 0.25rem 1rem;
  min-height: var(--height-7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.btn-outline-secondary {
  color: var(--text-idle);
  background-color: var(--surface-default-idle);
  border-color: var(--border-default-disabled);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  color: var(--text-emphasis);
  background-color: var(--surface-secondary-muted);
  border-color: var(--border-default-hover);
}

.btn-primary {
  color: var(--text-inverse);
  background-color: var(--surface-secondary-idle);
  border-color: var(--surface-secondary-idle);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--surface-secondary-hover);
  border-color: var(--surface-secondary-hover);
}

.btn:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 1px;
  box-shadow: none;
}

.dropdown-menu {
  font-size: 0.875rem;
  border: 1px solid var(--divider-muted);
  border-radius: var(--radius-xs);
  box-shadow: 0 2px 8px var(--shade-muted);
}

/* ---- Card ----
   The library wraps tables and detail views in a panel with a muted header strip. Kept global
   rather than in a scoped .cshtml.css because more than one page uses it. */

.vud-card {
  background-color: var(--surface-default-idle);
  border: 1px solid var(--divider-muted);
  /* 8px with a soft shadow, measured off .ant-table-wrapper in the sample app. The library can
     clip its wrapper with overflow:hidden because its filter dropdowns are portalled to body;
     ours are positioned inside the header cells, so the card must not clip - the header and
     footer carry matching corner radii instead, which rounds the card visually all the same. */
  border-radius: var(--rounded-sm);
  box-shadow: 0 2px 4px 0 rgba(48, 48, 49, 0.08);
  overflow: visible;
}

.vud-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-1) var(--space-4);
  background-color: var(--surface-default-muted);
  border-bottom: 1px solid var(--divider-muted);
  border-radius: var(--rounded-sm) var(--rounded-sm) 0 0;
}

.vud-card-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: var(--font-weight-semi-bold);
  color: var(--text-idle);
}

.vud-card-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.vud-card-body-empty {
  padding: var(--space-6);
  text-align: center;
  color: var(--text-secondary);
}

.vud-search {
  width: 220px;
}

.vud-icon {
  vertical-align: -0.125em;
}

/* ---- Pagination ----
   Global, not scoped to the page: these buttons are created by edge-table.js at runtime, so
   they never carry the b-xxxxx attribute that CSS isolation appends to every scoped selector,
   and a rule in Edge.cshtml.css would silently never match them. */

.vud-pagination {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
  margin: 0;
  padding: 0;
}

/* 32px squares with 8px corners. A page number sits on neutral-05 behind a neutral-60 border;
   the current page swaps to secondary-05 behind secondary-60 and goes medium weight. Values
   read off .ant-pagination-item / -item-active in the sample app. */
.vud-pagination button {
  min-width: var(--height-7);
  height: var(--height-7);
  padding: 0 0.4rem;
  background-color: var(--neutral-05);
  border: 1px solid var(--neutral-60);
  border-radius: var(--rounded-sm);
  color: var(--text-idle);
  font-size: 0.875rem;
  cursor: pointer;
}

/* Previous/next are quieter than the numbers. */
.vud-pagination li:first-child button,
.vud-pagination li:last-child button {
  border-color: var(--neutral-30);
}

.vud-pagination button:hover:not(:disabled):not(.is-current) {
  border-color: var(--secondary-60);
  color: var(--text-emphasis);
}

.vud-pagination button.is-current {
  background-color: var(--secondary-05);
  border-color: var(--secondary-60);
  color: var(--text-idle);
  font-weight: var(--font-weight-medium);
}

.vud-pagination button:disabled {
  color: var(--text-disabled);
  border-color: var(--border-default-disabled);
  cursor: default;
}

.vud-pagination .vud-ellipsis {
  padding: 0 0.25rem;
  color: var(--text-secondary);
}


/* ---- Unavailable / error state ----
   Shared by the release notes pages when the database cannot be read and by the generic error
   page. Global rather than page-scoped because more than one page uses it. */

.vud-unavailable {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  max-width: 52ch;
  margin: 0 auto;
  color: var(--text-idle);
}

.vud-unavailable svg {
  color: var(--icon-disabled);
  margin-bottom: var(--space-1);
}

.vud-unavailable h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: var(--font-weight-semi-bold);
}

.vud-unavailable p {
  margin: 0;
  color: var(--text-secondary);
}

.vud-unavailable-meta {
  font-size: 0.8125rem;
}

.vud-unavailable code {
  color: var(--text-idle);
}
