/* ARTEMIS shared page language · v9.0.0.
 * Single-source stylesheet: mianniello22/artemis-design-system.
 * Apply explicitly with artemis-ds-page / its semantic primitives.
 * No CRM route names or business workflow semantics belong here.
 */
html.artemis-ui .artemis-ds-page {
  --artemis-ds-page-content-width: none;
  background: var(--artemis-ds-canvas);
  color: var(--artemis-ds-text);
  font-family: var(--artemis-ds-font);
  min-width: 0;
  max-width: none;
  width: 100%;
  margin-inline: 0;
  overflow-wrap: anywhere;
}
/* Width is owned by the workspace, never by a particular page or route. */
html.artemis-ui .artemis-ds-workspace > .artemis-ds-page:not(.artemis-ds-page--auth) {
  padding-inline: 0;
  padding-block: 0;
}
html.artemis-ui .artemis-ds-page--auth {
  --artemis-ds-page-content-width: none;
  max-width: none;
  min-height: 100vh;
  background: radial-gradient(ellipse 75% 48% at 55% -8%,rgba(111,44,255,.15),transparent 78%),var(--artemis-ds-canvas);
}
html.artemis-ui .artemis-ds-page__header {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--artemis-ds-border);
  border-radius: var(--artemis-ds-radius-lg);
  background: linear-gradient(120deg,rgba(7,168,255,.075),rgba(111,44,255,.085) 54%,rgba(10,18,52,.86)),var(--artemis-ds-surface);
  color: var(--artemis-ds-text);
  box-shadow: var(--artemis-ds-shadow);
  padding: clamp(16px,2vw,26px);
}
html.artemis-ui .artemis-ds-page__header::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 1px auto 1px 1px;
  width: 3px;
  border-radius: var(--artemis-ds-radius-lg) 0 0 var(--artemis-ds-radius-lg);
  background: var(--artemis-ds-gradient);
}
/* Visible page title begins the header, without an upper pre-title eyebrow. */
html.artemis-ui .artemis-ds-page__header :is(h1,h2) {
  margin-block: .4rem .6rem;
  color: var(--artemis-ds-text);
  font-size: clamp(1.4rem,2vw,1.9rem);
  line-height: 1.18;
  font-weight: 750;
  letter-spacing: -.025em;
}
html.artemis-ui .artemis-ds-page__header p {
  color: var(--artemis-ds-text-secondary);
  line-height: 1.55;
}
html.artemis-ui .artemis-ds-page__header :is(.artemis-ds-eyebrow,[data-artemis-eyebrow]) {
  color: var(--artemis-ds-cyan);
  font-size: .73rem;
  font-weight: 750;
  letter-spacing: .11em;
  text-transform: uppercase;
}
html.artemis-ui .artemis-ds-page__panel {
  color: var(--artemis-ds-text);
  background: var(--artemis-ds-surface);
  border: 1px solid var(--artemis-ds-border);
  border-radius: var(--artemis-ds-radius-lg);
  box-shadow: 0 10px 28px rgba(0,0,0,.11);
  min-width: 0;
}
html.artemis-ui .artemis-ds-page__panel :is(h2,h3) {
  color: var(--artemis-ds-text);
  font-weight: 700;
  line-height: 1.32;
}
html.artemis-ui .artemis-ds-page__panel :is(label,legend) {
  color: var(--artemis-ds-text-secondary);
}
/* v7: generic field tokens use :where() (zero specificity).
 * The old :is() included six input :not() clauses, so its background:
 * shorthand outranked the later native select background-image arrow.
 * Select v6 skin now wins and remains identical across form locations. */
html.artemis-ui .artemis-ds-page :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="hidden"]),textarea,select) {
  max-width: 100%;
  min-width: 0;
  color: var(--artemis-ds-text);
  background: var(--artemis-ds-canvas-raised);
  border-color: var(--artemis-ds-border);
  border-radius: var(--artemis-ds-radius-sm);
  font-family: var(--artemis-ds-font);
}
html.artemis-ui .artemis-ds-page :is(input,textarea,select)::placeholder {
  color: var(--artemis-ds-muted);
  opacity: 1;
}
html.artemis-ui .artemis-ds-page :is(input,textarea,select,button,a):focus-visible {
  outline: 2px solid var(--artemis-ds-cyan);
  outline-offset: 2px;
  box-shadow: var(--artemis-ds-focus-ring);
}
html.artemis-ui .artemis-ds-page :is(input,textarea,select,button):disabled {
  cursor: not-allowed;
  opacity: .58;
}
html.artemis-ui .artemis-ds-page :is(table,[role="table"]) {
  border-color: var(--artemis-ds-border);
}
html.artemis-ui .artemis-ds-page :is(th,[role="columnheader"]) {
  color: var(--artemis-ds-muted);
  font-weight: 750;
  letter-spacing: .035em;
}
html.artemis-ui .artemis-ds-page :is(tr,[role="row"]) {
  border-color: var(--artemis-ds-border-soft);
}
html.artemis-ui .artemis-ds-page__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 40px;
  border: 1px solid var(--artemis-ds-violet);
  border-radius: var(--artemis-ds-radius-sm);
  padding: .6rem 1rem;
  background: var(--artemis-ds-gradient);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: filter .15s ease, box-shadow .15s ease;
}
html.artemis-ui .artemis-ds-page__action:not(:disabled):hover {
  filter: brightness(1.12);
}
html.artemis-ui .artemis-ds-page__muted {
  color: var(--artemis-ds-text-secondary);
}
html.artemis-ui .artemis-ds-page__eyebrow {
  color: var(--artemis-ds-cyan);
  text-transform: uppercase;
  letter-spacing: .11em;
  font-size: .73rem;
  font-weight: 750;
}
html.artemis-ui .artemis-ds-page__subtle {
  color: var(--artemis-ds-muted);
}
html.artemis-ui .artemis-ds-page__notice {
  border-radius: var(--artemis-ds-radius-md);
  border: 1px solid var(--artemis-ds-border);
  padding: .8rem 1rem;
  background: var(--artemis-ds-surface-raised);
  color: var(--artemis-ds-text-secondary);
}
html.artemis-ui .artemis-ds-page__empty {
  border: 1px dashed var(--artemis-ds-border);
  border-radius: var(--artemis-ds-radius-md);
  color: var(--artemis-ds-text-secondary);
  padding: 1.4rem;
  background: var(--artemis-ds-canvas-raised);
}
html.artemis-ui .artemis-ds-page__stat {
  border: 1px solid var(--artemis-ds-border);
  border-radius: var(--artemis-ds-radius-md);
  background: var(--artemis-ds-surface-raised);
  color: var(--artemis-ds-text);
}
html.artemis-ui .artemis-ds-page__status--ok { color: var(--artemis-ds-success); }
html.artemis-ui .artemis-ds-page__status--danger { color: var(--artemis-ds-danger); }
html.artemis-ui .artemis-ds-page__status--warning { color: var(--artemis-ds-warning); }
@media (max-width: 640px) {
  html.artemis-ui .artemis-ds-page__header { padding: 1rem 1.1rem; }
  html.artemis-ui .artemis-ds-page__header :is(h1,h2) { font-size: 1.4rem; }
  html.artemis-ui .artemis-ds-page__action { width: auto; max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html.artemis-ui .artemis-ds-page__action { transition: none; }
}

/* ARTEMIS v4 semantic surfaces: author once, opt in from each product.
 * Shared presentation only; product-specific data/behavior stays local.
 */
html.artemis-ui .artemis-ds-page :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="hidden"]),select) {
  min-height: 40px;
}
html.artemis-ui .artemis-ds-page__metric {
  min-width: 0;
  border: 1px solid var(--artemis-ds-border);
  border-radius: var(--artemis-ds-radius-lg);
  padding: 1.25rem;
  background: var(--artemis-ds-surface);
  color: var(--artemis-ds-text);
  box-shadow: var(--artemis-ds-shadow);
}
html.artemis-ui .artemis-ds-page__table-wrap {
  overflow-x: auto;
  border: 1px solid var(--artemis-ds-border);
  border-radius: var(--artemis-ds-radius-md);
}
html.artemis-ui .artemis-ds-page__table {
  width: 100%;
  border-collapse: collapse;
  color: var(--artemis-ds-text-secondary);
}
html.artemis-ui .artemis-ds-page__table thead {
  background: var(--artemis-ds-surface-raised);
}
html.artemis-ui .artemis-ds-page__table tbody tr {
  border-top: 1px solid var(--artemis-ds-border-soft);
}
html.artemis-ui .artemis-ds-page__table tbody tr:hover {
  background: var(--artemis-ds-surface-raised);
}
html.artemis-ui .artemis-ds-page__field {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--artemis-ds-border);
  border-radius: var(--artemis-ds-radius-sm);
  background: var(--artemis-ds-canvas-raised);
  color: var(--artemis-ds-text);
}
html.artemis-ui .artemis-ds-page__button--secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 40px;
  border: 1px solid var(--artemis-ds-border);
  border-radius: var(--artemis-ds-radius-sm);
  background: var(--artemis-ds-surface-raised);
  color: var(--artemis-ds-text-secondary);
  font-weight: 650;
  text-decoration: none;
}
html.artemis-ui .artemis-ds-page__button--secondary:not(:disabled):hover {
  border-color: var(--artemis-ds-blue);
  color: var(--artemis-ds-text);
}
/* A long text editor must grow with its containing panel; never inherit
 * the minimum 40px height intended for ordinary one-line fields. */
html.artemis-ui .artemis-ds-page textarea.artemis-ds-page__editor {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  height: auto;
  min-height: clamp(360px,48dvh,860px);
  padding: 1rem;
  border: 1px solid var(--artemis-ds-border);
  border-radius: var(--artemis-ds-radius-sm);
  color: var(--artemis-ds-text);
  background: var(--artemis-ds-canvas-raised);
  font-family: ui-monospace,SFMono-Regular,Consolas,monospace;
  line-height: 1.5;
  resize: vertical;
}
@media (max-width: 640px) {
  html.artemis-ui .artemis-ds-page textarea.artemis-ds-page__editor {
    min-height: max(320px,44dvh);
  }
}

/* v5: the document must never pan sideways on mobile. Wide tables and long
 * datasets keep their OWN scrollable surface; never globally shrink table
 * contents or turn the workspace into a horizontal scroller. */
@media (max-width: 767px) {
  html.artemis-ui,
  html.artemis-ui body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-x: clip;
  }
  html.artemis-ui #app {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  html.artemis-ui .artemis-ds-workspace,
  html.artemis-ui .artemis-ds-page,
  html.artemis-ui .artemis-admin-page {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  html.artemis-ui .artemis-ds-page > *,
  html.artemis-ui .artemis-ds-page__panel,
  html.artemis-ui .artemis-ds-page__header {
    min-width: 0;
    max-width: 100%;
  }
  html.artemis-ui .artemis-ds-page__table-wrap {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }
}

/* v6: unified native single-select visual language.
 * Keep source/keyboard behavior native, with an accessible CSS-only arrow.
 * No consumer-specific styling or hard-coded brand colors. */
html.artemis-ui .artemis-ds-page select:not([multiple]):not([size]) {
  -webkit-appearance: none;
  appearance: none;
  min-height: 40px;
  padding-inline: 12px 40px;
  border: 1px solid var(--artemis-ds-border);
  border-radius: var(--artemis-ds-radius-sm);
  background-color: var(--artemis-ds-canvas-raised);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--artemis-ds-cyan) 50%),
    linear-gradient(135deg, var(--artemis-ds-cyan) 50%, transparent 50%);
  background-position:
    calc(100% - 21px) calc(50% - 1px),
    calc(100% - 15px) calc(50% - 1px);
  background-size: 6px 6px;
  background-repeat: no-repeat;
  color: var(--artemis-ds-text);
  color-scheme: dark;
  font-family: var(--artemis-ds-font);
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
}
html.artemis-ui .artemis-ds-page select:not([multiple]):not([size]):hover:not(:disabled) {
  border-color: var(--artemis-ds-blue);
}
html.artemis-ui .artemis-ds-page select option,
html.artemis-ui .artemis-ds-page select optgroup {
  background: var(--artemis-ds-surface-raised);
  color: var(--artemis-ds-text);
}


/* v8: compact text labels in shared page actions across ARTEMIS products.
 * Scoping to page content leaves icon-only controls (which require an
 * accessible aria-label) and the independent sidebar's typography intact.
 * Keep button geometry, focus states, backgrounds, and icons unchanged. */
html.artemis-ui .artemis-ds-page :is(
  button:not([aria-label]),
  a.artemis-ds-page__action,
  a.artemis-ds-page__button--secondary
) {
  font-size: 14px;
  line-height: 1.25;
  text-wrap: balance;
}
@media (min-width: 768px) {
  html.artemis-ui .artemis-ds-page :is(
    button:not([aria-label]),
    a.artemis-ds-page__action,
    a.artemis-ds-page__button--secondary
  ) {
    font-size: 15px;
  }
}

/* v9: consistent compact text on shared page buttons.
 * Product-specific button styles still own dimensions, colors and behavior.
 * Exclude accessible icon-only controls and leave sidebar typography alone.
 * Retain touch-target dimensions for mobile accessibility. */
html.artemis-ui .artemis-ds-page :is(
  button:not([aria-label]),
  a.artemis-ds-page__action,
  a.artemis-ds-page__button--secondary
) {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.25;
}
