@charset "UTF-8";

:root {
  color-scheme: light;
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
  --font-ui: var(--font-sans);
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --canvas: #f3f4f1;
  --canvas-deep: #e8ebe6;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-muted: #f7f8f5;
  --surface-warm: #fbf8f2;
  --ink: #1a2523;
  --ink-soft: #52605d;
  --ink-faint: #7d8986;
  --line: #dfe4df;
  --line-strong: #cdd5cf;
  --brand: #153e3a;
  --brand-2: #235e55;
  --brand-3: #dcece8;
  --brand-soft: var(--brand-3);
  --brand-ink: #f6fbf9;
  --wood: #a76a36;
  --wood-deep: #7f4c25;
  --gold: #d8a75f;
  --gold-soft: #f7ead5;
  --blue: #376bd6;
  --blue-soft: #e9effe;
  --violet: #7757c7;
  --violet-soft: #f0ebff;
  --orange: #be641d;
  --orange-soft: #fdf0e5;
  --red: #b33d43;
  --red-soft: #fcebec;
  --green: #237058;
  --green-soft: #e3f2ec;
  --shadow-xs: 0 1px 2px rgba(21, 42, 37, 0.05);
  --shadow-sm: 0 5px 18px rgba(23, 43, 38, 0.06);
  --shadow-md: 0 18px 45px rgba(18, 36, 31, 0.1);
  --shadow-lg: 0 32px 80px rgba(9, 30, 25, 0.17);
  --radius-xs: 7px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --sidebar-width: 264px;
  --topbar-height: 72px;
  --page-gutter: clamp(18px, 2.3vw, 34px);
  --transition: 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #111816;
  --canvas-deep: #17211e;
  --surface: #192421;
  --surface-raised: #1e2b27;
  --surface-muted: #202d29;
  --surface-warm: #29251f;
  --ink: #eff5f2;
  --ink-soft: #aab8b3;
  --ink-faint: #7f918b;
  --line: #2d3b37;
  --line-strong: #40514b;
  --brand: #23665d;
  --brand-2: #3a8176;
  --brand-3: #203c36;
  --brand-ink: #f5fffb;
  --gold-soft: #443622;
  --blue-soft: #233153;
  --violet-soft: #34294f;
  --orange-soft: #472f20;
  --red-soft: #452629;
  --green-soft: #1d3c32;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 5px 20px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 18px 50px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--canvas);
  font-family: var(--font-sans);
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 95% 0%, color-mix(in srgb, var(--brand-3) 50%, transparent), transparent 30rem),
    var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body[data-modal-open="true"] {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

img {
  max-width: 100%;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--gold) 58%, transparent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  stroke-width: 1.8;
}

.icon-sm {
  width: 16px;
  height: 16px;
}

.icon-lg {
  width: 23px;
  height: 23px;
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  color: var(--ink-soft);
}

.boot-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 17px;
  color: #f2c47c;
  background: var(--brand);
  box-shadow: var(--shadow-md);
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
}

.boot-line {
  width: 142px;
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--line);
}

.boot-line span {
  display: block;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
  animation: boot-slide 1.1s ease-in-out infinite alternate;
}

.boot-screen p {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.05em;
}

@keyframes boot-slide {
  from { transform: translateX(-15%); }
  to { transform: translateX(140%); }
}

/* Authentication */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 0.88fr) minmax(520px, 1.12fr);
  background: var(--surface);
}

.auth-form-panel {
  display: grid;
  align-content: center;
  padding: clamp(34px, 7vw, 112px);
  position: relative;
  z-index: 1;
}

.auth-brand {
  position: absolute;
  top: 34px;
  left: clamp(34px, 7vw, 112px);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #f2c47c;
  background: var(--brand);
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(21, 62, 58, 0.2);
}

.brand-wording {
  display: grid;
  line-height: 1.1;
}

.brand-wording strong {
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: 0.015em;
}

.brand-wording small {
  margin-top: 4px;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-form {
  width: min(100%, 418px);
  margin-inline: auto;
}

.auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 17px;
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-kicker::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 3px;
  background: var(--gold);
}

.auth-form h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(36px, 4vw, 50px);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.auth-lead {
  max-width: 360px;
  margin: 16px 0 30px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.65;
}

.field {
  display: grid;
  gap: 8px;
}

.field + .field {
  margin-top: 17px;
}

.field-label,
.form-label {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 730;
  letter-spacing: 0.015em;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap > .icon {
  position: absolute;
  left: 15px;
  color: var(--ink-faint);
  pointer-events: none;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.input {
  padding: 0 14px;
}

.input-wrap .input {
  padding-left: 45px;
}

.input.has-trailing {
  padding-right: 45px;
}

.select {
  appearance: none;
  padding: 0 38px 0 13px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23717e7a' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.textarea {
  min-height: 88px;
  padding: 12px 14px;
  resize: vertical;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: color-mix(in srgb, var(--brand-2) 45%, var(--line-strong));
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-3) 80%, transparent);
}

.input-button {
  position: absolute;
  right: 6px;
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border: 0;
  border-radius: 8px;
  color: var(--ink-faint);
  background: transparent;
  cursor: pointer;
}

.input-button:hover {
  color: var(--ink);
  background: var(--surface-muted);
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 22px;
  color: var(--ink-soft);
  font-size: 12px;
}

.check-control {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.check-control input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--brand);
}

.auth-link {
  border: 0;
  padding: 0;
  color: var(--brand-2);
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-error {
  display: none;
  align-items: flex-start;
  gap: 9px;
  margin: -4px 0 16px;
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, var(--red) 30%, transparent);
  border-radius: var(--radius-sm);
  color: var(--red);
  background: var(--red-soft);
  font-size: 12px;
  line-height: 1.45;
}

.auth-error.visible {
  display: flex;
}

.auth-footnote {
  margin-top: 23px;
  color: var(--ink-faint);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.auth-art {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(48px, 7vw, 108px);
  color: #f4f8f6;
  background:
    radial-gradient(circle at 82% 11%, rgba(216, 167, 95, 0.24), transparent 22%),
    linear-gradient(145deg, #174d46, #0d2926 64%, #081c1a);
}

.auth-art::before,
.auth-art::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.auth-art::before {
  inset: 7% -18% auto auto;
  width: min(65vw, 700px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  box-shadow:
    0 0 0 84px rgba(255, 255, 255, 0.022),
    0 0 0 168px rgba(255, 255, 255, 0.018),
    0 0 0 252px rgba(255, 255, 255, 0.012);
}

.auth-art::after {
  inset: 0;
  opacity: 0.13;
  background-image:
    linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom right, transparent, #000 35%, transparent 92%);
}

.auth-window-mark {
  position: absolute;
  top: 12%;
  right: clamp(48px, 9vw, 148px);
  width: clamp(210px, 29vw, 410px);
  aspect-ratio: 0.82;
  border: 13px solid rgba(221, 172, 102, 0.9);
  border-radius: 3px;
  box-shadow:
    inset 0 0 0 5px rgba(255,255,255,.16),
    34px 38px 75px rgba(0, 0, 0, 0.24);
  transform: perspective(850px) rotateY(-7deg) rotateX(2deg);
  opacity: 0.83;
}

.auth-window-mark::before {
  content: "";
  position: absolute;
  inset: 50% -1px auto;
  height: 7px;
  background: rgba(221, 172, 102, 0.9);
  transform: translateY(-50%);
}

.auth-window-mark::after {
  content: "";
  position: absolute;
  inset: -1px auto -1px 50%;
  width: 7px;
  background: rgba(221, 172, 102, 0.9);
  transform: translateX(-50%);
}

.auth-art-content {
  position: relative;
  z-index: 1;
  max-width: 580px;
}

.auth-art-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: #efc887;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.auth-art-content blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.2vw, 47px);
  line-height: 1.14;
  letter-spacing: -0.025em;
}

.auth-art-content p {
  max-width: 480px;
  margin: 20px 0 0;
  color: rgba(238, 246, 242, 0.68);
  font-size: 14px;
  line-height: 1.7;
}

/* Core shell */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  transition: grid-template-columns var(--transition);
}

.app-shell.nav-collapsed {
  --sidebar-width: 82px;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: rgba(245, 251, 248, 0.76);
  background:
    radial-gradient(circle at 12% 0%, rgba(216, 167, 95, 0.13), transparent 18rem),
    linear-gradient(180deg, #153e3a 0%, #0f312e 60%, #0c2926 100%);
  box-shadow: 8px 0 35px rgba(12, 36, 32, 0.08);
}

.sidebar-head {
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar .brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.sidebar .brand-wording strong {
  color: #fff;
}

.sidebar .brand-wording small {
  color: rgba(255, 255, 255, 0.44);
}

.nav-collapsed .sidebar .brand-wording,
.nav-collapsed .sidebar .nav-label,
.nav-collapsed .sidebar .nav-section-title,
.nav-collapsed .sidebar .user-info,
.nav-collapsed .sidebar .sidebar-version,
.nav-collapsed .sidebar .nav-badge {
  opacity: 0;
  visibility: hidden;
  width: 0;
}

.sidebar-scroll {
  min-height: 0;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 15px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.nav-section + .nav-section {
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.nav-section-title {
  display: block;
  height: 27px;
  padding: 3px 12px 8px;
  color: rgba(255, 255, 255, 0.32);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: opacity var(--transition);
}

.nav-item {
  position: relative;
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0;
  padding: 0 11px;
  border: 0;
  border-radius: 10px;
  color: rgba(244, 251, 247, 0.69);
  background: transparent;
  font-size: 12px;
  font-weight: 620;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--transition), background var(--transition), transform var(--transition);
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.nav-item[aria-current="page"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.055);
}

.nav-item[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -10px;
  width: 3px;
  height: 20px;
  border-radius: 0 4px 4px 0;
  background: #e5b972;
}

.nav-item .icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity var(--transition);
}

.nav-badge {
  min-width: 20px;
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 99px;
  color: #f2d39d;
  background: rgba(216, 167, 95, 0.15);
  font-size: 9px;
  font-weight: 800;
  text-align: center;
}

.sidebar-foot {
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 7px 8px;
  border-radius: 12px;
}

.avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  overflow: hidden;
  border-radius: 50%;
  color: var(--brand);
  background: #e8c994;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.avatar.avatar-blue { color: #3157a6; background: #dae5ff; }
.avatar.avatar-violet { color: #6449a9; background: #e8e0ff; }
.avatar.avatar-green { color: #235e51; background: #cfe7df; }
.avatar.avatar-orange { color: #914a1b; background: #f9dfc8; }

.avatar-dot {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 9px;
  height: 9px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: #40a47b;
}

.user-info {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 3px;
  transition: opacity var(--transition);
}

.user-info strong {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.94);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-info small {
  color: rgba(255, 255, 255, 0.4);
  font-size: 9px;
}

.sidebar-version {
  display: block;
  padding: 0 10px 6px;
  color: rgba(255, 255, 255, 0.25);
  font-size: 8px;
  white-space: nowrap;
}

.app-main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 var(--page-gutter);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: blur(18px);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-left {
  min-width: 0;
  flex: 1;
}

.topbar-right {
  margin-left: auto;
}

.icon-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition), transform var(--transition);
}

.icon-button:hover {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.icon-button:active,
.btn:active {
  transform: translateY(1px);
}

.icon-button.has-alert::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border: 2px solid var(--canvas);
  border-radius: 50%;
  background: var(--orange);
}

.menu-toggle-mobile {
  display: none;
}

.topbar-divider {
  width: 1px;
  height: 24px;
  margin: 0 4px;
  background: var(--line);
}

.global-search {
  width: min(440px, 42vw);
  height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink-faint);
  background: color-mix(in srgb, var(--surface) 77%, transparent);
  cursor: text;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.global-search:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.global-search span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shortcut {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-bottom-color: var(--line-strong);
  border-radius: 5px;
  color: var(--ink-faint);
  background: var(--surface-muted);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

.environment-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 27px;
  padding: 0 9px;
  border: 1px solid color-mix(in srgb, var(--gold) 38%, transparent);
  border-radius: 99px;
  color: var(--wood-deep);
  background: var(--gold-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.environment-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

.quick-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 3px 4px 3px 7px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
}

.quick-user:hover {
  background: var(--surface);
}

.quick-user-text {
  display: grid;
  gap: 2px;
  text-align: right;
}

.quick-user-text strong {
  font-size: 10px;
}

.quick-user-text small {
  color: var(--ink-faint);
  font-size: 8px;
}

.page {
  width: 100%;
  max-width: 1760px;
  margin: 0 auto;
  padding: 27px var(--page-gutter) 56px;
  animation: page-in 260ms ease both;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.page-heading-copy {
  min-width: 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 8px;
  color: var(--brand-2);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.eyebrow .icon {
  width: 13px;
  height: 13px;
}

.page-heading h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(29px, 3vw, 40px);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.035em;
}

.page-heading p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

.page-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
}

.btn {
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 740;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.btn-primary {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 6px 16px rgba(21, 62, 58, 0.18);
}

.btn-primary:hover {
  background: var(--brand-2);
  box-shadow: 0 8px 22px rgba(21, 62, 58, 0.24);
}

.btn-secondary {
  border-color: var(--line);
  color: var(--ink-soft);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  color: var(--ink-soft);
  background: transparent;
}

.btn-ghost:hover {
  color: var(--ink);
  background: var(--surface-muted);
}

.btn-danger {
  border-color: color-mix(in srgb, var(--red) 24%, transparent);
  color: var(--red);
  background: var(--red-soft);
}

.btn-sm {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 10px;
}

.btn-lg {
  min-height: 47px;
  padding-inline: 19px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.52;
  pointer-events: none;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.card.hoverable {
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card.hoverable:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.card-head {
  min-height: 61px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.card-title {
  min-width: 0;
}

.card-title h2,
.card-title h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 760;
  letter-spacing: -0.01em;
}

.card-title p {
  margin: 4px 0 0;
  color: var(--ink-faint);
  font-size: 10px;
}

.card-body {
  padding: 18px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  position: relative;
  min-height: 130px;
  overflow: hidden;
  padding: 18px;
}

.stat-card::after {
  content: "";
  position: absolute;
  width: 88px;
  height: 88px;
  right: -34px;
  top: -36px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--stat-color, var(--brand)) 8%, transparent);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stat-label {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: var(--stat-color, var(--brand));
  background: color-mix(in srgb, var(--stat-color, var(--brand)) 10%, transparent);
}

.stat-value {
  margin-top: 9px;
  font-size: clamp(23px, 2.5vw, 30px);
  font-weight: 750;
  letter-spacing: -0.04em;
}

.stat-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  color: var(--ink-faint);
  font-size: 9px;
}

.trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--green);
  font-weight: 800;
}

.trend.down {
  color: var(--red);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.72fr) minmax(280px, 0.82fr);
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(0, 0.84fr);
  gap: 16px;
}

.chart-wrap {
  position: relative;
  height: 265px;
  padding: 10px 0 0;
}

.chart-wrap svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-grid-line {
  stroke: var(--line);
  stroke-width: 1;
  stroke-dasharray: 2 4;
}

.chart-line {
  fill: none;
  stroke: var(--brand-2);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-area {
  fill: url(#chartGradient);
}

.chart-dot {
  fill: var(--surface);
  stroke: var(--brand-2);
  stroke-width: 2;
}

.chart-axis-label {
  fill: var(--ink-faint);
  font-family: var(--font-sans);
  font-size: 9px;
}

.chart-summary {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.chart-summary strong {
  font-size: 22px;
  letter-spacing: -0.035em;
}

.donut-layout {
  display: grid;
  grid-template-columns: 136px 1fr;
  align-items: center;
  gap: 20px;
  min-height: 222px;
}

.donut {
  position: relative;
  width: 126px;
  height: 126px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--brand) 0 44%, var(--gold) 44% 70%, var(--blue) 70% 86%, var(--line) 86% 100%);
}

.donut::before {
  content: "";
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--surface);
}

.donut-center {
  position: absolute;
  display: grid;
  place-items: center;
  text-align: center;
}

.donut-center strong {
  font-size: 19px;
}

.donut-center small {
  color: var(--ink-faint);
  font-size: 8px;
}

.legend-list {
  display: grid;
  gap: 11px;
}

.legend-item {
  display: grid;
  grid-template-columns: 9px 1fr auto;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 10px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--dot-color);
}

.legend-item strong {
  color: var(--ink);
  font-size: 10px;
}

.activity-list,
.notification-list,
.compact-list {
  display: grid;
}

.activity-item {
  position: relative;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 11px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.activity-item:last-child {
  border-bottom: 0;
}

.activity-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 9px;
  color: var(--activity-color, var(--brand));
  background: color-mix(in srgb, var(--activity-color, var(--brand)) 10%, transparent);
}

.activity-copy {
  min-width: 0;
}

.activity-copy strong {
  display: block;
  margin-bottom: 3px;
  font-size: 10px;
}

.activity-copy p {
  margin: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.45;
  text-overflow: ellipsis;
}

.activity-time {
  color: var(--ink-faint);
  font-size: 8px;
  white-space: nowrap;
}

.progress-list {
  display: grid;
  gap: 17px;
}

.progress-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  font-size: 10px;
}

.progress-row-head span {
  color: var(--ink-soft);
}

.progress-row-head strong {
  font-size: 9px;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-muted);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--progress-color, var(--brand-2));
}

/* Data pages */
.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
}

.toolbar-search {
  width: min(350px, 100%);
}

.toolbar-search .input {
  min-height: 40px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 7px;
}

.filter-btn {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink-soft);
  background: var(--surface);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.filter-btn:hover,
.filter-btn.active {
  border-color: color-mix(in srgb, var(--brand) 33%, var(--line));
  color: var(--brand);
  background: var(--brand-3);
}

.toolbar-spacer {
  flex: 1;
}

.view-switcher {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.view-switcher button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  color: var(--ink-faint);
  background: transparent;
  cursor: pointer;
}

.view-switcher button.active {
  color: var(--ink);
  background: var(--surface-muted);
}

.table-card {
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 10px;
}

.data-table th {
  height: 43px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-faint);
  background: var(--surface-muted);
  font-size: 8px;
  font-weight: 820;
  letter-spacing: 0.07em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  height: 56px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--transition);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: color-mix(in srgb, var(--surface-muted) 68%, transparent);
}

.data-table .cell-primary {
  color: var(--ink);
  font-weight: 710;
}

.data-table .cell-number {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}

.table-entity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

.table-entity .avatar {
  width: 31px;
  height: 31px;
  flex-basis: 31px;
  font-size: 9px;
}

.entity-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.entity-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-copy small {
  color: var(--ink-faint);
  font-size: 8px;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.row-action {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  color: var(--ink-faint);
  background: transparent;
  cursor: pointer;
}

.row-action:hover {
  color: var(--ink);
  background: var(--surface-muted);
}

.status {
  --status-color: var(--ink-soft);
  --status-bg: var(--surface-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 23px;
  padding: 0 8px;
  border-radius: 99px;
  color: var(--status-color);
  background: var(--status-bg);
  font-size: 8px;
  font-weight: 790;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status-green { --status-color: var(--green); --status-bg: var(--green-soft); }
.status-blue { --status-color: var(--blue); --status-bg: var(--blue-soft); }
.status-gold { --status-color: var(--wood-deep); --status-bg: var(--gold-soft); }
.status-orange { --status-color: var(--orange); --status-bg: var(--orange-soft); }
.status-red { --status-color: var(--red); --status-bg: var(--red-soft); }
.status-violet { --status-color: var(--violet); --status-bg: var(--violet-soft); }

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-soft);
  background: var(--surface);
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.tag + .tag {
  margin-left: 4px;
}

.table-footer {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 9px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination button {
  display: grid;
  place-items: center;
  min-width: 29px;
  height: 29px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 9px;
  cursor: pointer;
}

.pagination button:hover,
.pagination button.active {
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface-muted);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
  overflow: hidden;
}

.summary-item {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 13px 18px;
  border-right: 1px solid var(--line);
}

.summary-item:last-child {
  border-right: 0;
}

.summary-item span {
  color: var(--ink-faint);
  font-size: 8px;
  font-weight: 770;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.summary-item strong {
  font-size: 17px;
  letter-spacing: -0.025em;
}

.empty-state {
  min-height: 280px;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 42px;
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  border-radius: 15px;
  color: var(--brand-2);
  background: var(--brand-3);
}

.empty-state h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
}

.empty-state p {
  max-width: 360px;
  margin: 8px 0 16px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.55;
}

.skeleton {
  overflow: hidden;
  position: relative;
  border-radius: 6px;
  color: transparent !important;
  background: var(--surface-muted);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
  animation: shimmer 1.25s infinite;
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

/* Cards and pipeline */
.entity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.entity-card {
  padding: 17px;
}

.entity-card-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

.entity-card-head .avatar {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
}

.entity-card-title {
  min-width: 0;
  flex: 1;
}

.entity-card-title h3 {
  margin: 0;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-card-title p {
  margin: 4px 0 0;
  color: var(--ink-faint);
  font-size: 9px;
}

.entity-card-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.entity-card-meta div {
  display: grid;
  gap: 4px;
}

.entity-card-meta span {
  color: var(--ink-faint);
  font-size: 8px;
}

.entity-card-meta strong {
  font-size: 9px;
}

.pipeline {
  display: grid;
  grid-auto-columns: minmax(268px, 1fr);
  grid-auto-flow: column;
  gap: 13px;
  overflow-x: auto;
  padding-bottom: 11px;
  scroll-snap-type: x proximity;
}

.pipeline-column {
  min-height: 480px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-muted) 72%, transparent);
  scroll-snap-align: start;
}

.pipeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
  padding: 0 4px 9px;
}

.pipeline-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 760;
}

.pipeline-title::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--column-color, var(--brand));
}

.pipeline-count {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  color: var(--ink-faint);
  background: var(--surface);
  font-size: 8px;
  font-weight: 800;
}

.pipeline-stack {
  display: grid;
  gap: 9px;
}

.work-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.work-card:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.work-card-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-faint);
  font-size: 8px;
  font-weight: 750;
}

.priority-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--priority, var(--line-strong));
}

.work-card h4 {
  margin: 9px 0 5px;
  font-size: 10px;
  line-height: 1.4;
}

.work-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 8px;
  line-height: 1.45;
}

.work-card-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 8px;
}

.work-card-foot .avatar {
  width: 23px;
  height: 23px;
  flex-basis: 23px;
  margin-left: auto;
  font-size: 7px;
}

/* Configurator */
.configurator-shell {
  height: calc(100vh - var(--topbar-height) - 55px);
  min-height: 650px;
  display: grid;
  grid-template-columns: minmax(260px, 310px) minmax(390px, 1fr) minmax(280px, 330px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.config-panel {
  min-width: 0;
  overflow-y: auto;
  background: var(--surface);
}

.config-panel-left {
  border-right: 1px solid var(--line);
}

.config-panel-right {
  border-left: 1px solid var(--line);
}

.config-panel-head {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px);
}

.config-panel-head h2 {
  margin: 0;
  font-size: 11px;
}

.config-panel-head p {
  margin: 4px 0 0;
  color: var(--ink-faint);
  font-size: 8px;
}

.config-sections {
  padding: 5px 15px 22px;
}

.config-section {
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.config-section:last-child {
  border-bottom: 0;
}

.config-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 9px;
  font-weight: 790;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.config-grid .field + .field {
  margin-top: 0;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(var(--segments, 2), minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-muted);
}

.segmented button {
  min-height: 31px;
  padding: 0 7px;
  border: 0;
  border-radius: 6px;
  color: var(--ink-faint);
  background: transparent;
  font-size: 8px;
  font-weight: 750;
  cursor: pointer;
}

.segmented button.active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.option-card {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.option-card:hover,
.option-card.selected {
  border-color: var(--brand-2);
  background: var(--brand-3);
}

.option-card .mini-window {
  width: 25px;
  height: 34px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  color: var(--wood);
}

.mini-window.two {
  position: relative;
  width: 36px;
}

.mini-window.two::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 50%;
  width: 2px;
  background: currentColor;
}

.option-card span {
  display: grid;
  gap: 3px;
  font-size: 8px;
  font-weight: 750;
}

.option-card small {
  color: var(--ink-faint);
  font-size: 7px;
  font-weight: 500;
}

.switch-row {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 9px;
}

.switch {
  position: relative;
  width: 35px;
  height: 20px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 99px;
  background: var(--line-strong);
  cursor: pointer;
  transition: background var(--transition);
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  transition: transform var(--transition);
}

.switch.on {
  background: var(--brand-2);
}

.switch.on::after {
  transform: translateX(15px);
}

.drawing-workspace {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-rows: 56px 1fr 46px;
  overflow: hidden;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    var(--surface-muted);
  background-size: 24px 24px;
}

.drawing-toolbar {
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 13px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(10px);
}

.drawing-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}

.drawing-tool {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
}

.drawing-tool:hover,
.drawing-tool.active {
  border-color: var(--line);
  color: var(--brand);
  background: var(--surface);
}

.drawing-canvas {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 70px;
}

.window-drawing-wrap {
  position: relative;
  width: clamp(270px, 39vw, 500px);
  aspect-ratio: 1.22;
}

.window-drawing {
  position: absolute;
  inset: 22px 20px 28px 35px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: clamp(10px, 1.15vw, 16px) solid #9b663c;
  background: #dce8e6;
  box-shadow:
    inset 0 0 0 3px rgba(255,255,255,.36),
    0 20px 40px rgba(41, 62, 55, 0.13);
}

.window-leaf {
  position: relative;
  border: clamp(5px, .65vw, 9px) solid #b27a4a;
  background: linear-gradient(145deg, #d6e7e6, #b8cfcd);
}

.window-leaf + .window-leaf {
  border-left-width: clamp(8px, 1vw, 13px);
}

.window-leaf::before,
.window-leaf::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.window-leaf::before {
  inset: 5px;
  border: 1px solid rgba(255,255,255,.55);
}

.window-leaf:first-child::after {
  left: 50%;
  top: 50%;
  width: 64%;
  height: 64%;
  border-left: 1px dashed rgba(33, 86, 78, .44);
  border-bottom: 1px dashed rgba(33, 86, 78, .44);
  transform: translate(-50%, -50%) rotate(45deg);
  transform-origin: center;
}

.window-handle {
  position: absolute;
  z-index: 1;
  top: 48%;
  width: 4px;
  height: 25px;
  border-radius: 4px;
  background: #59635f;
  box-shadow: 0 1px 2px rgba(0,0,0,.22);
}

.window-leaf:first-child .window-handle { right: 7px; }
.window-leaf:last-child .window-handle { left: 7px; }

.dimension-x,
.dimension-y {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 760;
}

.dimension-x {
  inset: auto 20px 0 35px;
  height: 18px;
  border-top: 1px solid var(--ink-faint);
}

.dimension-x::before,
.dimension-x::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 1px;
  height: 8px;
  background: var(--ink-faint);
}

.dimension-x::before { left: 0; }
.dimension-x::after { right: 0; }

.dimension-y {
  inset: 22px auto 28px 0;
  width: 24px;
  border-right: 1px solid var(--ink-faint);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.dimension-y::before,
.dimension-y::after {
  content: "";
  position: absolute;
  right: -4px;
  width: 8px;
  height: 1px;
  background: var(--ink-faint);
}

.dimension-y::before { top: 0; }
.dimension-y::after { bottom: 0; }

.drawing-statusbar {
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  background: color-mix(in srgb, var(--surface) 93%, transparent);
  font-size: 8px;
}

.config-price {
  padding: 17px 15px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-warm);
}

.config-price-label {
  color: var(--ink-faint);
  font-size: 8px;
  font-weight: 780;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.config-price-value {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 5px;
}

.config-price-value strong {
  font-size: 27px;
  letter-spacing: -0.04em;
}

.config-price-value small {
  color: var(--ink-faint);
  font-size: 8px;
}

.price-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--green);
  font-size: 8px;
  font-weight: 700;
}

.price-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.price-breakdown {
  padding: 5px 15px 15px;
}

.price-line {
  min-height: 37px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 8px;
}

.price-line strong {
  color: var(--ink);
  font-size: 9px;
}

.price-line.total {
  min-height: 45px;
  border-bottom: 0;
  color: var(--ink);
  font-weight: 760;
}

.price-line.total strong {
  font-size: 14px;
}

.config-warning {
  display: flex;
  gap: 8px;
  margin: 0 15px 14px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--gold) 32%, transparent);
  border-radius: 9px;
  color: var(--wood-deep);
  background: var(--gold-soft);
  font-size: 8px;
  line-height: 1.45;
}

.config-actions {
  display: grid;
  gap: 7px;
  padding: 0 15px 18px;
}

/* Scheduler */
.schedule-shell {
  overflow: hidden;
}

.schedule-head {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 15px;
  border-bottom: 1px solid var(--line);
}

.week-nav {
  display: flex;
  align-items: center;
  gap: 7px;
}

.week-nav strong {
  min-width: 150px;
  text-align: center;
  font-size: 11px;
}

.schedule-grid-wrap {
  overflow-x: auto;
}

.schedule-grid {
  min-width: 980px;
  display: grid;
  grid-template-columns: 180px repeat(5, minmax(150px, 1fr));
  background: var(--line);
  gap: 1px;
}

.schedule-corner,
.schedule-day,
.schedule-resource,
.schedule-cell {
  background: var(--surface);
}

.schedule-corner,
.schedule-day {
  min-height: 58px;
  display: grid;
  align-content: center;
  padding: 10px 13px;
  background: var(--surface-muted);
}

.schedule-day {
  justify-items: center;
  text-align: center;
}

.schedule-day span {
  color: var(--ink-faint);
  font-size: 8px;
  font-weight: 780;
  text-transform: uppercase;
}

.schedule-day strong {
  margin-top: 3px;
  font-size: 13px;
}

.schedule-day.today {
  color: var(--brand);
  background: var(--brand-3);
}

.schedule-resource,
.schedule-cell {
  min-height: 112px;
  padding: 10px;
}

.schedule-resource {
  display: grid;
  align-content: center;
  gap: 5px;
}

.schedule-resource strong {
  font-size: 10px;
}

.schedule-resource span {
  color: var(--ink-faint);
  font-size: 8px;
}

.schedule-cell {
  position: relative;
  background:
    linear-gradient(to bottom, transparent 49%, var(--line) 50%, transparent 51%),
    var(--surface);
}

.schedule-job {
  position: relative;
  min-height: 42px;
  padding: 8px 8px 7px 11px;
  border-left: 3px solid var(--job-color, var(--brand));
  border-radius: 7px;
  color: var(--ink);
  background: color-mix(in srgb, var(--job-color, var(--brand)) 10%, var(--surface));
  font-size: 8px;
  line-height: 1.35;
}

.schedule-job + .schedule-job {
  margin-top: 6px;
}

.schedule-job strong {
  display: block;
  margin-bottom: 2px;
  font-size: 8px;
}

.capacity-bar {
  height: 4px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--line);
}

.capacity-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--capacity-color, var(--green));
}

/* Reports */
.report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.report-card {
  min-height: 162px;
  display: flex;
  flex-direction: column;
  padding: 17px;
}

.report-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 14px;
  border-radius: 10px;
  color: var(--report-color, var(--brand));
  background: color-mix(in srgb, var(--report-color, var(--brand)) 10%, transparent);
}

.report-card h3 {
  margin: 0;
  font-size: 11px;
}

.report-card p {
  margin: 6px 0 14px;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.5;
}

.report-card .btn {
  align-self: flex-start;
  margin-top: auto;
}

/* Settings */
.settings-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 20px;
}

.settings-nav {
  align-self: start;
  padding: 8px;
  position: sticky;
  top: calc(var(--topbar-height) + 22px);
}

.settings-nav button {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.settings-nav button:hover,
.settings-nav button.active {
  color: var(--brand);
  background: var(--brand-3);
}

.settings-content {
  display: grid;
  gap: 14px;
}

.settings-card .card-body {
  display: grid;
  gap: 17px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.setting-row {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-copy strong {
  display: block;
  font-size: 14px;
}

.setting-copy p {
  margin: 4px 0 0;
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.45;
}

.theme-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.theme-choice {
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}

.theme-choice.active {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 2px var(--brand-3);
}

.theme-preview {
  height: 62px;
  display: grid;
  grid-template-columns: 18px 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f4f5f2;
}

.theme-preview.dark { background: #16201d; border-color: #33413d; }
.theme-preview.auto { background: linear-gradient(135deg, #f4f5f2 50%, #16201d 50%); }
.theme-preview::before { content: ""; background: #153e3a; }

.theme-choice span {
  display: block;
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.settings-label {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
}

.settings-save-bar {
  position: sticky;
  bottom: 14px;
  z-index: 4;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--brand-2) 35%, var(--line));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
}

.settings-save-bar p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.settings-updated {
  color: var(--ink-faint);
  font-size: 12px;
}

.settings-score {
  color: var(--brand);
  font-family: var(--font-display);
  font-size: 26px;
}

.settings-progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.settings-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.settings-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.settings-metrics article {
  min-height: 94px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 16px;
}

.settings-metrics article span {
  color: var(--ink-faint);
  font-size: 12px;
}

.settings-metrics article strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 24px;
}

.settings-metrics.inline {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.settings-metrics.inline article {
  min-height: 82px;
  border-right: 1px solid var(--line);
}

.settings-metrics.inline article:last-child { border-right: 0; }

.settings-module-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.settings-rule-row {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.settings-rule-row p {
  margin: 5px 0 0;
  color: var(--ink-faint);
  font-size: 12px;
}

.settings-empty { min-height: 230px; }

.settings-check-row {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.settings-check-row:last-child { border-bottom: 0; }
.settings-check-row strong { display: block; font-size: 14px; }
.settings-check-row small { display: block; margin-top: 4px; color: var(--ink-faint); font-size: 12px; line-height: 1.45; }
.settings-check-row input { width: 20px; height: 20px; accent-color: var(--brand); }

/* Dialogs, drawers, command palette */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 25, 22, 0.46);
  backdrop-filter: blur(5px);
  animation: fade-in 160ms ease both;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.dialog {
  width: min(620px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow-y: auto;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: dialog-in 210ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.dialog-head {
  min-height: 69px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.dialog-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 21px;
}

.dialog-head p {
  margin: 4px 0 0;
  color: var(--ink-faint);
  font-size: 9px;
}

.dialog-body {
  padding: 18px;
}

.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-muted);
}

.command-dialog {
  align-self: start;
  width: min(650px, 100%);
  margin-top: min(14vh, 110px);
  overflow: hidden;
}

.command-input-wrap {
  min-height: 61px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 17px;
  border-bottom: 1px solid var(--line);
}

.command-input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
}

.command-input::placeholder {
  color: var(--ink-faint);
}

.command-results {
  max-height: min(450px, 52vh);
  overflow-y: auto;
  padding: 9px;
}

.command-group-title {
  padding: 8px 9px 6px;
  color: var(--ink-faint);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.command-result {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px 9px;
  border: 0;
  border-radius: 9px;
  color: var(--ink-soft);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.command-result:hover,
.command-result.active {
  color: var(--ink);
  background: var(--surface-muted);
}

.command-result-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--brand);
  background: var(--brand-3);
}

.command-result-copy {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 3px;
}

.command-result-copy strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-result-copy small {
  color: var(--ink-faint);
  font-size: 8px;
}

.command-footer {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  background: var(--surface-muted);
  font-size: 8px;
}

.side-drawer-overlay {
  place-items: stretch end;
  padding: 0;
}

.side-drawer {
  width: min(410px, 94vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: drawer-in 240ms cubic-bezier(.2,.8,.2,1) both;
}

@keyframes drawer-in { from { transform: translateX(100%); } to { transform: translateX(0); } }

.drawer-head {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 17px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
}

.drawer-body {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 8px 17px 20px;
}

.notification-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.notification-item:last-child { border-bottom: 0; }
.notification-item.unread .notification-copy strong::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 7px;
  border-radius: 50%;
  background: var(--orange);
  vertical-align: 1px;
}

.notification-copy strong {
  font-size: 10px;
}

.notification-copy p {
  margin: 4px 0 6px;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.45;
}

.notification-copy time {
  color: var(--ink-faint);
  font-size: 8px;
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  width: min(360px, calc(100vw - 40px));
  display: grid;
  gap: 8px;
}

.toast {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-md);
  animation: toast-in 220ms ease both;
}

@keyframes toast-in { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }

.toast-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--toast-color, var(--green));
  background: color-mix(in srgb, var(--toast-color, var(--green)) 11%, transparent);
}

.toast strong {
  display: block;
  margin: 1px 0 3px;
  font-size: 10px;
}

.toast p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 8px;
  line-height: 1.45;
}

.toast button {
  border: 0;
  color: var(--ink-faint);
  background: transparent;
  cursor: pointer;
}

.offline-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 31px;
  padding: 6px 14px;
  color: var(--wood-deep);
  background: var(--gold-soft);
  font-size: 9px;
  font-weight: 650;
  text-align: center;
}

.offline-banner .icon { width: 14px; height: 14px; }

.mobile-backdrop {
  display: none;
}

/* Specialized utility components */
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--ink-faint); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-gold { color: var(--wood); }
.text-right { text-align: right !important; }
.nowrap { white-space: nowrap; }
.stack { display: grid; gap: 14px; }
.stack-sm { display: grid; gap: 8px; }
.inline { display: flex; align-items: center; gap: 8px; }
.divider { height: 1px; background: var(--line); }

.score-ring {
  --score: 78;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: conic-gradient(var(--green) calc(var(--score) * 1%), var(--line) 0);
}

.score-ring::before {
  content: attr(data-score);
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  color: var(--ink);
  background: var(--surface);
  font-size: 8px;
  font-weight: 800;
}

.document-type {
  display: grid;
  place-items: center;
  width: 31px;
  height: 36px;
  border-radius: 5px 5px 8px 5px;
  color: var(--doc-color, var(--red));
  background: color-mix(in srgb, var(--doc-color, var(--red)) 10%, transparent);
  font-size: 7px;
  font-weight: 850;
}

.alert-panel {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 15px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--orange) 26%, transparent);
  border-radius: 11px;
  color: var(--orange);
  background: var(--orange-soft);
  font-size: 9px;
  line-height: 1.5;
}

.alert-panel strong { color: var(--ink); }

.sparkline {
  width: 70px;
  height: 24px;
}

.sparkline path {
  fill: none;
  stroke: var(--spark-color, var(--green));
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.employee-status {
  display: flex;
  align-items: center;
  gap: 7px;
}

.employee-status .avatar { width: 30px; height: 30px; flex-basis: 30px; }

/* Density */
[data-density="compact"] .page { padding-top: 20px; }
[data-density="compact"] .data-table td { height: 46px; padding-block: 6px; }
[data-density="compact"] .card-body { padding: 14px; }
[data-density="compact"] .stat-card { min-height: 112px; padding: 14px; }

/* Responsive */
@media (max-width: 1280px) {
  :root { --sidebar-width: 238px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .configurator-shell { grid-template-columns: 275px minmax(370px, 1fr); }
  .config-panel-right { display: none; }
  .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1020px) {
  :root { --sidebar-width: 82px; }
  .sidebar .brand-wording,
  .sidebar .nav-label,
  .sidebar .nav-section-title,
  .sidebar .user-info,
  .sidebar .sidebar-version,
  .sidebar .nav-badge { opacity: 0; visibility: hidden; width: 0; }
  .nav-item { justify-content: center; padding-inline: 11px; }
  .nav-item[aria-current="page"]::before { left: -10px; }
  .sidebar-head { justify-content: center; }
  .dashboard-main-grid,
  .dashboard-lower-grid { grid-template-columns: 1fr; }
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-item:nth-child(2) { border-right: 0; }
  .summary-item:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .quick-user-text { display: none; }
}

@media (max-width: 820px) {
  :root { --topbar-height: 64px; }
  .app-shell,
  .app-shell.nav-collapsed { display: block; }
  .sidebar {
    position: fixed;
    left: 0;
    z-index: 70;
    width: min(284px, calc(100vw - 52px));
    transform: translateX(-102%);
    transition: transform var(--transition);
  }
  .app-shell.mobile-nav-open .sidebar { transform: translateX(0); }
  .app-shell.mobile-nav-open .sidebar .brand-wording,
  .app-shell.mobile-nav-open .sidebar .nav-label,
  .app-shell.mobile-nav-open .sidebar .nav-section-title,
  .app-shell.mobile-nav-open .sidebar .user-info,
  .app-shell.mobile-nav-open .sidebar .sidebar-version,
  .app-shell.mobile-nav-open .sidebar .nav-badge { opacity: 1; visibility: visible; width: auto; }
  .app-shell.mobile-nav-open .sidebar .nav-item { justify-content: flex-start; }
  .mobile-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: block;
    border: 0;
    background: rgba(5, 20, 17, 0.43);
    backdrop-filter: blur(3px);
  }
  .menu-toggle-desktop { display: none; }
  .menu-toggle-mobile { display: inline-grid; }
  .environment-pill { display: none; }
  .global-search { width: min(100%, 430px); }
  .topbar-divider { display: none; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-form-panel { min-height: 100vh; padding: 105px 25px 46px; }
  .auth-brand { left: 25px; top: 27px; }
  .configurator-shell {
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
    overflow: visible;
  }
  .config-panel-left { border-right: 0; border-bottom: 1px solid var(--line); }
  .drawing-workspace { min-height: 540px; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; display: flex; overflow-x: auto; }
  .settings-nav button { flex: 0 0 auto; width: auto; }
}

@media (max-width: 660px) {
  .topbar { gap: 5px; padding-inline: 13px; }
  .topbar-left { flex: 1; }
  .global-search { height: 38px; }
  .global-search .shortcut { display: none; }
  .global-search span { font-size: 10px; }
  .quick-user { display: none; }
  .topbar-right .icon-button:first-child { display: none; }
  .page { padding: 20px 14px 44px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 18px; }
  .page-heading h1 { font-size: 30px; }
  .page-actions { width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .stat-grid,
  .grid-2,
  .grid-3,
  .entity-grid,
  .report-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 112px; }
  .toolbar { align-items: stretch; flex-wrap: wrap; }
  .toolbar-search { width: 100%; }
  .toolbar-spacer { display: none; }
  .filter-group { width: 100%; overflow-x: auto; }
  .summary-strip { grid-template-columns: 1fr 1fr; }
  .summary-item { padding-inline: 12px; }
  .donut-layout { grid-template-columns: 112px 1fr; gap: 11px; }
  .donut { width: 105px; height: 105px; }
  .donut::before { width: 71px; height: 71px; }
  .table-footer { align-items: flex-start; flex-direction: column; }
  .form-row { grid-template-columns: 1fr; }
  .theme-choices { grid-template-columns: 1fr; }
  .settings-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-metrics.inline { grid-template-columns: 1fr; }
  .settings-metrics.inline article { border-right: 0; border-bottom: 1px solid var(--line); }
  .settings-metrics.inline article:last-child { border-bottom: 0; }
  .settings-save-bar { position: static; align-items: stretch; flex-direction: column; }
  .settings-save-bar .btn { width: 100%; }
  .settings-rule-row { align-items: flex-start; flex-direction: column; }
  .config-grid { grid-template-columns: 1fr; }
  .drawing-canvas { padding: 55px 28px; }
  .window-drawing-wrap { width: 280px; }
  .dialog { max-height: calc(100vh - 20px); border-radius: 16px; }
  .overlay { padding: 10px; }
  .command-dialog { margin-top: 30px; }
}

@media (max-width: 420px) {
  .topbar-right .icon-button { width: 36px; }
  .global-search { padding-inline: 9px; }
  .global-search span { max-width: 118px; }
  .page-heading h1 { font-size: 27px; }
  .page-actions .btn { flex: 1; }
  .summary-strip { grid-template-columns: 1fr; }
  .summary-item { border-right: 0; border-bottom: 1px solid var(--line); }
  .summary-item:nth-child(3) { border-bottom: 1px solid var(--line); }
  .summary-item:last-child { border-bottom: 0; }
}

@media print {
  .sidebar,
  .topbar,
  .page-actions,
  .toolbar,
  .row-actions,
  .toast-region { display: none !important; }
  .app-shell { display: block; }
  .page { max-width: none; padding: 0; }
  .card { break-inside: avoid; box-shadow: none; }
  body { background: #fff; }
}

/* Operational workflows -------------------------------------------------- */
.skip-link{position:fixed;z-index:10000;top:10px;left:12px;transform:translateY(-180%);padding:10px 14px;border-radius:8px;background:var(--ink);color:var(--surface);font:600 12px/1 var(--font-ui);box-shadow:var(--shadow-lg)}
.skip-link:focus{transform:translateY(0)}
:where(button,a,input,select,textarea,[tabindex]):focus-visible{outline:3px solid color-mix(in srgb,var(--blue) 65%,transparent);outline-offset:2px}
.dialog[role="dialog"],.side-drawer[role="dialog"]{outline:0}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.form-grid .field:has(textarea){grid-column:1/-1}
.field-error{display:block;min-height:14px;margin-top:4px;color:var(--red);font-size:10px}
.field.has-error :is(.input,.select,.textarea){border-color:var(--red);box-shadow:0 0 0 3px var(--red-soft)}
.optimistic-note{display:inline-flex;align-items:center;gap:6px;margin-right:auto}
.record-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.record-field{padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--surface-soft);min-width:0}
.record-field span{display:block;margin-bottom:6px;color:var(--ink-faint);font-size:9px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}
.record-field strong{display:block;overflow-wrap:anywhere;font-size:12px}
.record-tabs{display:flex;gap:4px;padding:0 22px;border-bottom:1px solid var(--line);overflow:auto}
.record-tabs button{padding:11px 10px;border:0;border-bottom:2px solid transparent;background:none;color:var(--ink-soft);font:600 11px var(--font-ui);white-space:nowrap}
.record-tabs button.active{border-color:var(--brand-2);color:var(--brand-2)}
.audit-list,.event-timeline{display:grid;gap:10px}
.audit-item,.event-item{display:grid;grid-template-columns:auto 1fr auto;gap:10px;align-items:start;padding:11px;border-left:2px solid var(--line-strong);background:var(--surface-soft);border-radius:0 8px 8px 0}
.audit-item time,.event-item time{color:var(--ink-faint);font-size:9px;white-space:nowrap}
.workflow-actions{display:flex;flex-wrap:wrap;gap:8px;padding:12px 22px;background:var(--surface-soft);border-bottom:1px solid var(--line)}
.workflow-actions .btn{min-height:34px}
.action-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.action-form-grid .span-all{grid-column:1/-1}
.line-editor{display:grid;gap:8px;margin-top:14px}
.line-editor-head,.line-editor-row{display:grid;grid-template-columns:minmax(130px,2fr) minmax(90px,1fr) minmax(90px,1fr) 34px;gap:8px;align-items:center}
.finance-line-editor .line-editor-row{grid-template-columns:minmax(150px,2fr) minmax(70px,.7fr) minmax(85px,1fr) minmax(75px,.8fr) minmax(65px,.7fr) 34px}
.line-editor-head{color:var(--ink-faint);font-size:9px;font-weight:700;text-transform:uppercase}
.progress-panel{padding:14px;border:1px solid var(--line);border-radius:10px;background:var(--surface-soft)}
.progress-panel [role="progressbar"]{height:8px;margin:9px 0;border-radius:999px;background:var(--line);overflow:hidden}
.progress-panel [role="progressbar"] span{display:block;height:100%;width:0;background:var(--brand-2);transition:width .15s ease}
.drop-zone{display:grid;place-items:center;gap:8px;min-height:160px;padding:22px;border:1.5px dashed var(--line-strong);border-radius:12px;background:var(--surface-soft);text-align:center;cursor:pointer}
.drop-zone.dragging{border-color:var(--brand-2);background:var(--brand-soft)}
.csv-preview{max-height:260px;overflow:auto;border:1px solid var(--line);border-radius:10px}
.csv-result{padding:12px;border-radius:10px;background:var(--surface-soft)}
.mobile-command-bar{display:flex;gap:8px;padding:12px;position:sticky;top:0;z-index:2;background:color-mix(in srgb,var(--surface) 94%,transparent);backdrop-filter:blur(10px)}
.shopfloor-grid{display:grid;grid-template-columns:minmax(260px,.85fr) minmax(0,1.6fr);gap:16px}
.shopfloor-orders{display:grid;gap:8px;align-content:start}
.shopfloor-order{width:100%;padding:13px;text-align:left;border:1px solid var(--line);border-radius:10px;background:var(--surface)}
.shopfloor-order.active{border-color:var(--brand-2);box-shadow:0 0 0 3px var(--brand-soft)}
.operation-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.operation-card{padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--surface-soft)}
.operation-card header{display:flex;justify-content:space-between;gap:8px;align-items:start;margin-bottom:10px}
.operation-card .row-actions{justify-content:flex-start}
.barcode-entry{font:700 20px/1.2 var(--font-mono);letter-spacing:.08em}
.user-role-grid{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(260px,.8fr);gap:16px}
.permission-cloud{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}
.invitation-box{padding:14px;border:1px solid var(--gold);border-radius:10px;background:var(--gold-soft)}
.secret-value{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:10px;padding:10px;border:1px dashed var(--line-strong);border-radius:8px;font:600 12px var(--font-mono)}
.task-board{display:grid;grid-template-columns:repeat(4,minmax(230px,1fr));gap:12px;overflow:auto}
.task-column{min-height:300px;padding:10px;border:1px solid var(--line);border-radius:12px;background:var(--surface-soft)}
.task-column>header{display:flex;justify-content:space-between;align-items:center;padding:5px 3px 12px}
.task-card{padding:12px;margin-bottom:8px;border:1px solid var(--line);border-radius:10px;background:var(--surface);box-shadow:var(--shadow-xs)}
.task-card p{margin:7px 0;color:var(--ink-soft);font-size:10px}
.config-data-tabs{display:flex;gap:6px;padding:10px;border-top:1px solid var(--line);overflow:auto}
.config-data-tabs button{white-space:nowrap}
.bom-table{font-size:10px}
.approval-metric{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.approval-metric>div{padding:10px;border-radius:9px;background:var(--surface-soft)}
.approval-metric span{display:block;color:var(--ink-faint);font-size:9px}.approval-metric strong{font-size:13px}
.print-only{display:none}

@media (max-width:900px){.form-grid,.record-summary,.shopfloor-grid,.user-role-grid,.action-form-grid{grid-template-columns:1fr}.record-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.operation-grid{grid-template-columns:1fr}.approval-metric{grid-template-columns:repeat(2,1fr)}.line-editor-head{display:none}.line-editor-row,.finance-line-editor .line-editor-row{grid-template-columns:1fr 1fr 34px}.line-editor-row>*:first-child{grid-column:1/-1}.optimistic-note{width:100%}}
@media (max-width:560px){.form-grid,.record-summary{grid-template-columns:1fr}.workflow-actions{padding:10px}.dialog-wide{width:min(100vw - 16px,960px)}.task-board{grid-template-columns:repeat(4,82vw)}.page-actions{width:100%}.page-actions .btn{flex:1}.shopfloor-order{min-height:64px}}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}
@media print{.skip-link,.workflow-actions,.record-tabs,.dialog-footer,.topbar,.sidebar,.offline-banner,.toolbar,.page-actions{display:none!important}.print-only{display:block}.app-main{margin:0!important}.page{max-width:none!important;padding:0!important}.card{box-shadow:none!important;break-inside:avoid}}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
