/* src/styles/fonts.css */
/* Font paths resolve relative to dist/styles.css once built.
   Fonts are copied to dist/assets/fonts/ by scripts/bundle-styles.mjs. */

@font-face {
  font-family: 'KMR Apparat';
  src: url('./assets/fonts/KMR-Apparat-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('./assets/fonts/InterVariable.woff2') format('woff2') tech('variations'),
       url('./assets/fonts/InterVariable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}


/* src/tokens/colors.css */
/* Color tokens — base palette from Figma variables export.
   Naming: --eds-{family}-{step} */
:root {

  /* Base */
  --eds-black-100: #000000;
  --eds-white-100: #ffffff;

  /* Grey */
  --eds-grey-100:  #f5f5f5;
  --eds-grey-200:  #eaeaea;
  --eds-grey-300:  #dbdbdb;
  --eds-grey-400:  #b7b7b7;
  --eds-grey-500:  #9b9b9b;
  --eds-grey-600:  #8f8f8f;
  --eds-grey-700:  #686868;
  --eds-grey-800:  #555555;
  --eds-grey-900:  #454545;
  --eds-grey-1000: #373737;
  --eds-grey-1100: #2a2a2a;
  --eds-grey-1200: #151515;

  /* Red */
  --eds-red-100:  #fff5f5;
  --eds-red-200:  #ffe2e0;
  --eds-red-300:  #ffc7c2;
  --eds-red-400:  #ffafa3;
  --eds-red-500:  #f24822;
  --eds-red-600:  #dc3412;
  --eds-red-700:  #bd2915;
  --eds-red-800:  #9f1f18;
  --eds-red-900:  #771208;
  --eds-red-1000: #660e0b;

  /* Yellow */
  --eds-yellow-100:  #fff4e5;
  --eds-yellow-200:  #ffe0c2;
  --eds-yellow-300:  #fcd19c;
  --eds-yellow-400:  #ffc470;
  --eds-yellow-500:  #ffa629;
  --eds-yellow-600:  #fc9e24;
  --eds-yellow-700:  #f79722;
  --eds-yellow-800:  #dd7c0e;
  --eds-yellow-900:  #ce7012;
  --eds-yellow-1000: #8a480f;

  /* Green */
  --eds-green-100:  #ebffee;
  --eds-green-200:  #cff7d3;
  --eds-green-300:  #aff4c6;
  --eds-green-400:  #85e0a3;
  --eds-green-500:  #14ae5c;
  --eds-green-600:  #009951;
  --eds-green-700:  #008043;
  --eds-green-800:  #036838;
  --eds-green-900:  #024626;
  --eds-green-1000: #083a23;

  /* Blue */
  --eds-blue-100:  #f2f9ff;
  --eds-blue-200:  #e5f4ff;
  --eds-blue-300:  #bde3ff;
  --eds-blue-400:  #80caff;
  --eds-blue-500:  #0d99ff;
  --eds-blue-600:  #007be5;
  --eds-blue-700:  #0768cf;
  --eds-blue-800:  #034ac1;
  --eds-blue-900:  #093077;
  --eds-blue-1000: #0d193f;

  /* Purple */
  --eds-purple-100:  #f9f5ff;
  --eds-purple-200:  #f1e5ff;
  --eds-purple-300:  #e4ccff;
  --eds-purple-400:  #d9b8ff;
  --eds-purple-500:  #9747ff;
  --eds-purple-600:  #8638e5;
  --eds-purple-700:  #7c2bda;
  --eds-purple-800:  #681abb;
  --eds-purple-900:  #4b0d87;
  --eds-purple-1000: #2d0f46;

  /* Brand (opacity ramp of #74b0ca) */
  --eds-brand-100:  #74b0ca19;
  --eds-brand-200:  #74b0ca33;
  --eds-brand-300:  #74b0ca4c;
  --eds-brand-400:  #74b0ca66;
  --eds-brand-500:  #74b0ca7f;
  --eds-brand-600:  #74b0ca99;
  --eds-brand-700:  #74b0cab2;
  --eds-brand-800:  #74b0cacc;
  --eds-brand-900:  #74b0cae5;
  --eds-brand-1000: #74b0ca;

}

/* ─── Semantic colours (light default) ─────────────────────────────────────── */
/* References base palette vars above. Never use raw hex values here.
   Dark:  [data-theme="dark"] — programmatic
          @media (prefers-color-scheme: dark) — OS fallback               */

:root {

  /* Page */
  --page-bg-color-default:                        var(--eds-white-100);
  --page-bg-color-subtle:                         var(--eds-grey-200);

  /* Text */
  --text-primary:                                 var(--eds-grey-1000);
  --text-secondary:                               var(--eds-grey-800);
  --text-tertiary:                                var(--eds-grey-600);

  /* Borders */
  --border-primary:                               var(--eds-grey-300);
  --border-subtle:                                var(--eds-grey-200);

  /* Control — primary */
  --control-primary-background-rest:              var(--eds-grey-100);
  --control-primary-background-hover:             var(--eds-grey-200);
  --control-primary-background-focused:           var(--eds-grey-100);
  --control-primary-background-active:            var(--eds-grey-300);
  --control-primary-background-rest-emphasis:     var(--eds-white-100);
  --control-primary-background-active-emphasis:   var(--eds-white-100);
  --control-primary-stroke-active-emphasis:       var(--eds-grey-300);

  /* Control — secondary */
  --control-secondary-background-rest:            var(--eds-white-100);
  --control-secondary-background-hover:           var(--eds-grey-100);
  --control-secondary-background-focused:         var(--eds-grey-100);
  --control-secondary-background-active:          var(--eds-grey-200);
  --control-secondary-stroke-rest:                var(--eds-grey-200);
  --control-secondary-stroke-hover:               var(--eds-grey-200);
  --control-secondary-stroke-active:              var(--eds-grey-300);

  /* Control — ghost */
  --control-ghost-background-hover:               var(--eds-grey-100);
  --control-ghost-background-active:              var(--eds-grey-200);

  /* Control — action */
  --control-action-background-rest:               var(--eds-grey-900);
  --control-action-background-hover:              var(--eds-grey-1000);
  --control-action-background-focused:            var(--eds-grey-900);
  --control-action-background-active:             var(--eds-grey-1100);

  /* Control — brand */
  --control-brand-background-rest:                var(--eds-brand-1000);
  --control-brand-background-hover:               var(--eds-brand-900);
  --control-brand-background-focused:             var(--eds-brand-1000);
  --control-brand-background-active:              var(--eds-brand-700);

  /* Control — danger */
  --control-danger-background-rest:               var(--eds-red-200);
  --control-danger-background-hover:              var(--eds-red-300);
  --control-danger-background-focused:            var(--eds-red-200);
  --control-danger-background-active:             var(--eds-red-400);

  /* Control — disabled */
  --control-disabled-background:                  var(--eds-grey-200);
  --control-disabled-foreground:                  var(--eds-grey-500);

  /* Control — selected & focus */
  --control-selected-background:                  var(--eds-brand-1000);
  --control-focused-stroke:                       var(--eds-brand-1000);

  /* Control — text */
  --control-text-white:                           var(--eds-white-100);
  --control-text-dark:                            var(--eds-grey-1000);
  --control-text-light:                           var(--eds-grey-400);
  --control-text-placeholder:                     var(--eds-grey-400);
  --control-text-disabled:                        var(--eds-grey-400);
  --control-text-danger:                          var(--eds-red-600);

  /* Control — borders & strokes */
  --control-border-white:                         var(--eds-white-100);
  --control-border-dark:                          var(--eds-grey-1100);
  --control-border-light:                         var(--eds-grey-200);
  --control-error-stroke:                         var(--eds-red-500);

  /* Control — links */
  --control-link-rest:                            var(--eds-brand-1000);
  --control-link-hover:                           var(--eds-brand-900);

  /* Switch */
  --switch-base-off:                              var(--eds-grey-300);
  --switch-base-on:                               var(--eds-green-500);
  --switch-knob-off:                              var(--eds-white-100);
  --switch-knob-on:                               var(--eds-white-100);

  /* Tags */
  --tag-blue-text:                                var(--eds-blue-500);
  --tag-blue-stroke:                              var(--eds-blue-400);
  --tag-green-text:                               var(--eds-green-500);
  --tag-green-stroke:                             var(--eds-green-400);
  --tag-yellow-text:                              var(--eds-yellow-500);
  --tag-yellow-stroke:                            var(--eds-yellow-400);
  --tag-red-text:                                 var(--eds-red-500);
  --tag-red-stroke:                               var(--eds-red-400);
  --tag-purple-text:                              var(--eds-purple-500);
  --tag-purple-stroke:                            var(--eds-purple-400);
  --tag-grey-text:                                var(--eds-grey-500);
  --tag-grey-stroke:                              var(--eds-grey-400);

}

/* Dark via explicit data attribute */
[data-theme="dark"] {
  --page-bg-color-default:                        var(--eds-grey-1200);
  --page-bg-color-subtle:                         var(--eds-grey-900);
  --text-primary:                                 var(--eds-white-100);
  --text-secondary:                               var(--eds-grey-400);
  --text-tertiary:                                var(--eds-grey-600);
  --border-primary:                               var(--eds-grey-900);
  --border-subtle:                                var(--eds-grey-1000);
  --control-primary-background-rest:              var(--eds-grey-1100);
  --control-primary-background-hover:             var(--eds-grey-1000);
  --control-primary-background-focused:           var(--eds-grey-1100);
  --control-primary-background-active:            var(--eds-grey-900);
  --control-primary-background-rest-emphasis:     var(--eds-grey-1000);
  --control-primary-background-active-emphasis:   var(--eds-grey-800);
  --control-primary-stroke-active-emphasis:       var(--eds-grey-1000);
  --control-secondary-background-rest:            var(--eds-grey-1000);
  --control-secondary-background-hover:           var(--eds-grey-1000);
  --control-secondary-background-focused:         var(--eds-grey-1100);
  --control-secondary-background-active:          var(--eds-grey-900);
  --control-secondary-stroke-rest:                var(--eds-grey-900);
  --control-secondary-stroke-hover:               var(--eds-grey-800);
  --control-secondary-stroke-active:              var(--eds-grey-700);
  --control-ghost-background-hover:               var(--eds-grey-1100);
  --control-ghost-background-active:              var(--eds-grey-900);
  --control-action-background-rest:               var(--eds-white-100);
  --control-action-background-hover:              var(--eds-grey-100);
  --control-action-background-focused:            var(--eds-grey-100);
  --control-action-background-active:             var(--eds-white-100);
  --control-brand-background-rest:                var(--eds-brand-1000);
  --control-brand-background-hover:               var(--eds-brand-900);
  --control-brand-background-focused:             var(--eds-brand-1000);
  --control-brand-background-active:              var(--eds-brand-700);
  --control-danger-background-rest:               var(--eds-red-200);
  --control-danger-background-hover:              var(--eds-red-300);
  --control-danger-background-focused:            var(--eds-red-200);
  --control-danger-background-active:             var(--eds-red-400);
  --control-disabled-background:                  var(--eds-grey-1100);
  --control-disabled-foreground:                  var(--eds-grey-700);
  --control-selected-background:                  var(--eds-brand-1000);
  --control-focused-stroke:                       var(--eds-brand-1000);
  --control-text-white:                           var(--eds-white-100);
  --control-text-dark:                            var(--eds-white-100);
  --control-text-light:                           var(--eds-grey-400);
  --control-text-placeholder:                     var(--eds-grey-400);
  --control-text-disabled:                        var(--eds-grey-400);
  --control-text-danger:                          var(--eds-red-600);
  --control-border-white:                         var(--eds-white-100);
  --control-border-dark:                          var(--eds-white-100);
  --control-border-light:                         var(--eds-grey-1000);
  --control-error-stroke:                         var(--eds-red-500);
  --control-link-rest:                            var(--eds-brand-1000);
  --control-link-hover:                           var(--eds-brand-900);
  --switch-base-off:                              var(--eds-grey-1000);
  --switch-base-on:                               var(--eds-green-500);
  --switch-knob-off:                              var(--eds-white-100);
  --switch-knob-on:                               var(--eds-white-100);
  --tag-blue-text:                                var(--eds-blue-500);
  --tag-blue-stroke:                              var(--eds-blue-600);
  --tag-green-text:                               var(--eds-green-500);
  --tag-green-stroke:                             var(--eds-green-600);
  --tag-yellow-text:                              var(--eds-yellow-500);
  --tag-yellow-stroke:                            var(--eds-yellow-600);
  --tag-red-text:                                 var(--eds-red-500);
  --tag-red-stroke:                               var(--eds-red-600);
  --tag-purple-text:                              var(--eds-purple-500);
  --tag-purple-stroke:                            var(--eds-purple-600);
  --tag-grey-text:                                var(--eds-grey-500);
  --tag-grey-stroke:                              var(--eds-grey-600);
}

/* Dark via OS preference */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page-bg-color-default:                        var(--eds-grey-1200);
    --page-bg-color-subtle:                         var(--eds-grey-900);
    --text-primary:                                 var(--eds-white-100);
    --text-secondary:                               var(--eds-grey-400);
    --text-tertiary:                                var(--eds-grey-600);
    --border-primary:                               var(--eds-grey-900);
    --border-subtle:                                var(--eds-grey-1000);
    --control-primary-background-rest:              var(--eds-grey-1100);
    --control-primary-background-hover:             var(--eds-grey-1000);
    --control-primary-background-focused:           var(--eds-grey-1100);
    --control-primary-background-active:            var(--eds-grey-900);
    --control-primary-background-rest-emphasis:     var(--eds-grey-1000);
    --control-primary-background-active-emphasis:   var(--eds-grey-800);
    --control-primary-stroke-active-emphasis:       var(--eds-grey-1000);
    --control-secondary-background-rest:            var(--eds-grey-1000);
    --control-secondary-background-hover:           var(--eds-grey-1000);
    --control-secondary-background-focused:         var(--eds-grey-1100);
    --control-secondary-background-active:          var(--eds-grey-900);
    --control-secondary-stroke-rest:                var(--eds-grey-900);
    --control-secondary-stroke-hover:               var(--eds-grey-800);
    --control-secondary-stroke-active:              var(--eds-grey-700);
    --control-ghost-background-hover:               var(--eds-grey-1100);
    --control-ghost-background-active:              var(--eds-grey-900);
    --control-action-background-rest:               var(--eds-white-100);
    --control-action-background-hover:              var(--eds-grey-100);
    --control-action-background-focused:            var(--eds-grey-100);
    --control-action-background-active:             var(--eds-white-100);
    --control-brand-background-rest:                var(--eds-brand-1000);
    --control-brand-background-hover:               var(--eds-brand-900);
    --control-brand-background-focused:             var(--eds-brand-1000);
    --control-brand-background-active:              var(--eds-brand-700);
    --control-danger-background-rest:               var(--eds-red-200);
    --control-danger-background-hover:              var(--eds-red-300);
    --control-danger-background-focused:            var(--eds-red-200);
    --control-danger-background-active:             var(--eds-red-400);
    --control-disabled-background:                  var(--eds-grey-1100);
    --control-disabled-foreground:                  var(--eds-grey-700);
    --control-selected-background:                  var(--eds-brand-1000);
    --control-focused-stroke:                       var(--eds-brand-1000);
    --control-text-white:                           var(--eds-white-100);
    --control-text-dark:                            var(--eds-white-100);
    --control-text-light:                           var(--eds-grey-400);
    --control-text-placeholder:                     var(--eds-grey-400);
    --control-text-disabled:                        var(--eds-grey-400);
    --control-text-danger:                          var(--eds-red-600);
    --control-border-white:                         var(--eds-white-100);
    --control-border-dark:                          var(--eds-white-100);
    --control-border-light:                         var(--eds-grey-1000);
    --control-error-stroke:                         var(--eds-red-500);
    --control-link-rest:                            var(--eds-brand-1000);
    --control-link-hover:                           var(--eds-brand-900);
    --switch-base-off:                              var(--eds-grey-1000);
    --switch-base-on:                               var(--eds-green-500);
    --switch-knob-off:                              var(--eds-white-100);
    --switch-knob-on:                               var(--eds-white-100);
    --tag-blue-text:                                var(--eds-blue-500);
    --tag-blue-stroke:                              var(--eds-blue-600);
    --tag-green-text:                               var(--eds-green-500);
    --tag-green-stroke:                             var(--eds-green-600);
    --tag-yellow-text:                              var(--eds-yellow-500);
    --tag-yellow-stroke:                            var(--eds-yellow-600);
    --tag-red-text:                                 var(--eds-red-500);
    --tag-red-stroke:                               var(--eds-red-600);
    --tag-purple-text:                              var(--eds-purple-500);
    --tag-purple-stroke:                            var(--eds-purple-600);
    --tag-grey-text:                                var(--eds-grey-500);
    --tag-grey-stroke:                              var(--eds-grey-600);
  }
}


/* src/tokens/typography.css */
/* Typography tokens — populated from Figma variables JSON export */
:root {
  /* Brand font — display headings, brand moments */
  --font-family-heading: 'KMR Apparat', system-ui, sans-serif;

  /* UI font — body copy, labels, inputs */
  --font-family-ui: 'Inter', system-ui, sans-serif;

  /* Weights (from Figma) — 450 is a variable-font-only weight, requires Inter Variable */
  --font-weight-default: 450;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
}


/* src/tokens/spacing.css */
/* Spacing / sizing tokens — base unit scale used across spacing, layout, and sizing */
:root {
  --sizing-0:  0px;
  --sizing-4:  4px;
  --sizing-6:  6px;
  --sizing-8:  8px;
  --sizing-10: 10px;
  --sizing-12: 12px;
  --sizing-14: 14px;
  --sizing-16: 16px;
  --sizing-20: 20px;
  --sizing-24: 24px;
  --sizing-28: 28px;
  --sizing-32: 32px;
  --sizing-36: 36px;
  --sizing-40: 40px;
  --sizing-44: 44px;
  --sizing-48: 48px;
  --sizing-52: 52px;
  --sizing-56: 56px;
  --sizing-64: 64px;
  --sizing-72: 72px;
  --sizing-80: 80px;
}


/* src/tokens/platform.css */
/* Platform tokens — semantic sizing values for radius, icons, and stroke.
   Use these in components, never raw px values. */
:root {

  /* Border radius */
  --radius-none:     var(--sizing-0);
  --radius-small:    var(--sizing-4);
  --radius-medium:   var(--sizing-8);
  --radius-large:    var(--sizing-12);
  --radius-infinite: 9999px;

  /* Icon sizes */
  --icon-size-16: var(--sizing-16);
  --icon-size-20: var(--sizing-20);
  --icon-size-28: var(--sizing-28);

  /* Stroke */
  --stroke-default: 1px;

  /* Control font sizes (confirmed from Figma) */
  --font-size-control-sm: 13px; /* Control/SM — line-height: 18px */
  --font-size-control-md: 14px; /* Control/MD — line-height: 18px */
  --font-size-control-lg: 15px; /* Control/LG — line-height: 22px */

  /* Heading font sizes (KMR Apparat) */
  --font-size-heading-h1: 32px; /* H1 — line-height: 38px, letter-spacing: -0.02em */

}


/* src/styles/global.css */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-family-ui, sans-serif);
  font-size: var(--font-size-base, 16px);
  line-height: var(--line-height-base, 1.5);
  color: var(--color-text, #111);
  background-color: var(--color-bg, #fff);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* src/components/Button/Button.css */
/* ── Base ──────────────────────────────────────────────────── */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sizing-8);
  border: var(--stroke-default) solid transparent;
  border-radius: var(--radius-medium);
  cursor: pointer;
  font-family: var(--font-family-ui);
  font-weight: var(--font-weight-medium);
  font-feature-settings: 'cv01';
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.button:focus-visible {
  outline: 2px solid var(--control-focused-stroke);
  outline-offset: 2px;
}

.button:disabled {
  cursor: not-allowed;
  background: var(--control-disabled-background) !important;
  color: var(--control-disabled-foreground) !important;
  border-color: transparent !important;
}

/* ── Sizes ─────────────────────────────────────────────────── */
.button--sm {
  height: var(--sizing-32);
  padding: 0 var(--sizing-12);
  font-size: var(--font-size-control-sm);
  line-height: 18px;
}

.button--md {
  height: var(--sizing-40);
  padding: 0 var(--sizing-16);
  font-size: var(--font-size-control-lg);
  line-height: 22px;
}

.button--lg {
  height: var(--sizing-48);
  padding: 0 var(--sizing-20);
  font-size: var(--font-size-control-lg);
  line-height: 22px;
}

/* Icon-only: narrower horizontal padding so the button stays compact */
.button--icon-only.button--sm { padding: 0 var(--sizing-10); }
.button--icon-only.button--md { padding: 0 var(--sizing-12); }
.button--icon-only.button--lg { padding: 0 var(--sizing-14); }

/* ── Variant: action ───────────────────────────────────────── */
.button--action {
  background: var(--control-action-background-rest);
  color: var(--control-text-white);
}
.button--action:hover:not(:disabled)  { background: var(--control-action-background-hover); }
.button--action:focus-visible         { background: var(--control-action-background-focused); }
.button--action:active:not(:disabled) { background: var(--control-action-background-active); }

/* ── Variant: brand ────────────────────────────────────────── */
.button--brand {
  background: var(--control-brand-background-rest);
  color: var(--control-text-white);
}
.button--brand:hover:not(:disabled)  { background: var(--control-brand-background-hover); }
.button--brand:focus-visible         { background: var(--control-brand-background-focused); }
.button--brand:active:not(:disabled) { background: var(--control-brand-background-active); }

/* ── Variant: primary ──────────────────────────────────────── */
.button--primary {
  background: var(--control-primary-background-rest);
  color: var(--control-text-dark);
}
.button--primary:hover:not(:disabled)  { background: var(--control-primary-background-hover); }
.button--primary:focus-visible         { background: var(--control-primary-background-focused); }
.button--primary:active:not(:disabled) { background: var(--control-primary-background-active); }

/* ── Variant: secondary ────────────────────────────────────── */
.button--secondary {
  background: var(--control-secondary-background-rest);
  color: var(--control-text-dark);
  border-color: var(--control-secondary-stroke-rest);
}
.button--secondary:hover:not(:disabled) {
  background: var(--control-secondary-background-hover);
  border-color: var(--control-secondary-stroke-hover);
}
.button--secondary:focus-visible {
  background: var(--control-secondary-background-focused);
}
.button--secondary:active:not(:disabled) {
  background: var(--control-secondary-background-active);
  border-color: var(--control-secondary-stroke-active);
}

/* ── Variant: ghost ────────────────────────────────────────── */
.button--ghost {
  background: transparent;
  color: var(--control-text-dark);
}
.button--ghost:hover:not(:disabled)  { background: var(--control-ghost-background-hover); }
.button--ghost:active:not(:disabled) { background: var(--control-ghost-background-active); }


/* src/components/Icon/Icon.css */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: currentColor;
}

.icon--16 {
  width: var(--icon-size-16);
  height: var(--icon-size-16);
}

.icon--20 {
  width: var(--icon-size-20);
  height: var(--icon-size-20);
}

.icon--28 {
  width: var(--icon-size-28);
  height: var(--icon-size-28);
}

/* Inner SVG fills the wrapper so CSS tokens control the final size */
.icon svg {
  width: 100%;
  height: 100%;
  display: block;
}


/* src/components/Nav/Nav.css */
/* ── Container ─────────────────────────────────────────────── */
.nav {
  display: flex;
  flex-direction: column;
  width: 250px;
  height: 100%;
  min-height: 600px;
  padding: var(--sizing-24) var(--sizing-16) var(--sizing-20) var(--sizing-16);
  background: var(--page-bg-color-default);
  box-sizing: border-box;
  font-family: var(--font-family-ui);
}

.nav--collapsed {
  width: 68px;
}

/* ── Top section: account selector + collapse toggle ───────── */
.nav__top {
  display: flex;
  align-items: center;
  gap: var(--sizing-6);
  width: 100%;
}

.nav--collapsed .nav__top {
  flex-direction: column;
  gap: var(--sizing-4);
}

/* ── Middle: scrollable items list ─────────────────────────── */
.nav__items {
  display: flex;
  flex-direction: column;
  gap: var(--sizing-4);
  padding-top: var(--sizing-72);
  flex: 1 1 0;
  min-height: 0;
}

/* ── Footer: logo + kebab ──────────────────────────────────── */
.nav__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-left: var(--sizing-10);
}

.nav--collapsed .nav__footer {
  justify-content: center;
  padding-left: 0;
}

.nav__logo {
  display: block;
  flex-shrink: 0;
  color: var(--text-primary);
}

/* ── Shared icon-button (top-section buttons + kebab) ──────── */
/* 36×32 ghost-style button that renders a 20px Icon (or 3 dots
   for the kebab). Used instead of <Button size="sm"> because the
   small Button forces a 16px icon, which would mismatch the 20px
   icons used everywhere else in the Nav. */
.nav__icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--sizing-36);
  height: var(--sizing-32);
  border: none;
  background: transparent;
  border-radius: var(--radius-medium);
  cursor: pointer;
  color: var(--control-text-dark);
  padding: 0;
  flex-shrink: 0;
  transition: background-color 120ms ease;
}

.nav__icon-button:hover  { background: var(--control-ghost-background-hover); }
.nav__icon-button:active { background: var(--control-ghost-background-active); }

.nav__icon-button:focus-visible {
  outline: 2px solid var(--control-focused-stroke);
  outline-offset: 2px;
}

/* Kebab variant: render three small dots instead of an icon */
.nav__icon-button--kebab {
  gap: 3px;
}

.nav__icon-button--kebab > span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}


/* src/components/NavItem/NavItem.css */
/* ── Shared interactive base ──────────────────────────────── */
.nav-item {
  display: inline-flex;
  align-items: center;
  border: none;
  border-radius: var(--radius-medium);
  cursor: pointer;
  font-family: var(--font-family-ui);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-control-md);
  line-height: 18px;
  font-feature-settings: 'cv01';
  color: var(--control-text-dark);
  white-space: nowrap;
  background: transparent;
  text-align: left;
  transition: background-color 120ms ease;
}

.nav-item:hover     { background: var(--control-ghost-background-hover); }
.nav-item--selected { background: var(--control-ghost-background-hover); }
.nav-item:active    { background: var(--control-ghost-background-active); }

.nav-item:focus-visible {
  outline: 2px solid var(--control-focused-stroke);
  outline-offset: 2px;
}

/* ── Root level ───────────────────────────────────────────── */
.nav-item--root {
  width: 100%;
  height: var(--sizing-32);
  gap: var(--sizing-8);
  padding: 0 var(--sizing-12) 0 var(--sizing-8);
}

/* Chevron variant: equal padding both sides */
.nav-item--root.nav-item--has-chevron {
  padding-right: var(--sizing-8);
}

/* Collapsed: icon-only, fixed width, centred */
.nav-item--root.nav-item--collapsed {
  width: var(--sizing-36);
  padding: 0;
  justify-content: center;
  gap: 0;
}

/* ── Child level ──────────────────────────────────────────── */

/* Outer indent container — background stays outside the highlight area */
.nav-item-child-wrap {
  display: flex;
  align-items: center;
  padding-left: var(--sizing-24);
}

/* Inner button — only this part gets the hover/selected background */
.nav-item--child {
  flex: 1;
  height: var(--sizing-32);
  padding: 0 var(--sizing-12);
}

/* ── Label ────────────────────────────────────────────────── */
.nav-item__label {
  flex: 1;
}


/* src/components/Page/Page.css */
/* ── Page shell ────────────────────────────────────────────── */
/* Fluid horizontal layout. Fills the available width of its parent
   and stretches to the parent's height. The sidebar keeps its
   intrinsic width; the content area fills the rest.
   For a full-viewport app shell, wrap in a 100vh container. */
.page {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 100%;
  min-height: 100%;
  background: var(--page-bg-color-default);
  font-family: var(--font-family-ui);
  color: var(--text-primary);
}

.page__sidebar {
  flex-shrink: 0;
}

.page__content {
  flex: 1 1 0;
  min-width: 0;
  /* Content padding (from Figma 1885:8072): pl 32, pr 24, pt 24, pb 0 */
  padding: var(--sizing-24) var(--sizing-24) 0 var(--sizing-32);
  display: flex;
  flex-direction: column;
  gap: var(--sizing-32);
  box-sizing: border-box;
}

/* Header stack — PageActionBar on top, PageTitle below, 72px gap. */
.page__header {
  display: flex;
  flex-direction: column;
  gap: var(--sizing-72);
  width: 100%;
}


/* src/components/PageActionBar/PageActionBar.css */
/* ── PageActionBar layout ──────────────────────────────────── */
.page-action-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  gap: var(--sizing-16);
}

/* Each group flows its contents horizontally with a small gap. */
.page-action-bar__group {
  display: flex;
  align-items: center;
  gap: var(--sizing-6);
  min-width: 0;
}

/* Keep the right group's contents pinned to the end when it isn't
   completely filling the row (matches the Figma "justify-end" intent). */
.page-action-bar__group--right {
  justify-content: flex-end;
}


/* src/components/PageTitle/PageTitle.css */
/* ── PageTitle layout ──────────────────────────────────────── */
.page-title {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.page-title__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sizing-16);
  width: 100%;
}

/* Shared heading typography for title + subtitle (KMR Apparat H1). */
.page-title__heading,
.page-title__subtitle {
  margin: 0;
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-default);
  font-size: var(--font-size-heading-h1);
  line-height: 38px;
  letter-spacing: -0.02em;
  font-feature-settings: 'zero';
}

.page-title__heading {
  flex: 1 1 0;
  min-width: 0;
  color: var(--text-primary);
}

.page-title__subtitle {
  width: 100%;
  color: var(--text-tertiary);
}

.page-title__actions {
  display: flex;
  align-items: center;
  gap: var(--sizing-6);
  flex-shrink: 0;
}


/* src/components/Select/Select.css */
/* ── Base ──────────────────────────────────────────────────── */
.select {
  display: inline-flex;
  align-items: stretch;
  width: 100%;
  border: var(--stroke-default) solid transparent;
  border-radius: var(--radius-medium);
  cursor: pointer;
  font-family: var(--font-family-ui);
  font-weight: var(--font-weight-default);
  font-feature-settings: 'cv01';
  color: var(--control-text-dark);
  text-align: left;
  padding: 0;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.select:focus-visible {
  outline: 2px solid var(--control-focused-stroke);
  outline-offset: 2px;
}

.select:disabled {
  cursor: not-allowed;
  background: var(--control-disabled-background) !important;
  color: var(--control-disabled-foreground) !important;
  border-color: transparent !important;
}

/* ── Variant: primary (filled) ─────────────────────────────── */
.select--primary {
  background: var(--control-primary-background-rest);
}
.select--primary:hover:not(:disabled)  { background: var(--control-primary-background-hover); }
.select--primary:active:not(:disabled) { background: var(--control-primary-background-active); }

/* ── Variant: secondary (outlined) ─────────────────────────── */
.select--secondary {
  background: transparent;
  border-color: var(--control-secondary-stroke-rest);
}
.select--secondary:hover:not(:disabled)  { border-color: var(--control-secondary-stroke-hover); }
.select--secondary:active:not(:disabled) { border-color: var(--control-secondary-stroke-active); }

/* ── Error state (wins over hover/rest borders) ────────────── */
.select--error {
  border-color: var(--control-error-stroke);
}
.select--error:hover:not(:disabled),
.select--error:active:not(:disabled) {
  border-color: var(--control-error-stroke);
}

/* ── Sizes ─────────────────────────────────────────────────── */
.select--sm {
  height: var(--sizing-32);
  font-size: var(--font-size-control-sm);
  line-height: 18px;
}
.select--md {
  height: var(--sizing-40);
  font-size: var(--font-size-control-lg);
  line-height: 22px;
}
.select--lg {
  height: var(--sizing-48);
  font-size: var(--font-size-control-lg);
  line-height: 22px;
}

/* Chevron-area width tracks the size */
.select--sm .select__chevron { width: var(--sizing-32); }
.select--md .select__chevron,
.select--lg .select__chevron { width: var(--sizing-36); }

/* ── Inner: content (left) ─────────────────────────────────── */
.select__content {
  display: inline-flex;
  align-items: center;
  flex: 1 1 0;
  min-width: 0;
  gap: var(--sizing-8);
  padding: 0 var(--sizing-12);
}

.select__leading {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.select__text,
.select__placeholder {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

/* ── Inner: chevron (right) ────────────────────────────────── */
.select__chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--control-text-dark);
}
