:root {
  --canvas: #070b14;
  --sidebar: #080f1d;
  --surface: #0c1424;
  --surface-2: #101a2d;
  --surface-3: #14243a;
  --surface-hover: #182b44;
  --border: #22324c;
  --border-strong: #355072;
  --text: #f4f8ff;
  --text-2: #afc1d8;
  --muted: #7187a6;
  --accent: #7fb0ff;
  --accent-soft: rgba(90, 151, 255, 0.14);
  --blue: #4f8dff;
  --blue-soft: rgba(79, 141, 255, 0.14);
  --warning: #f3bd55;
  --danger: #ff6f86;
  --violet: #b49aff;
  --cyan: #63d6ff;
  --radius: 16px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 73% -12%, rgba(48, 96, 180, 0.18), transparent 30%),
    var(--canvas);
  color: var(--text);
  font-family: var(--font-geist-sans), Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
}

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

button,
select {
  cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

button {
  border: 0;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

::selection {
  background: rgba(90, 151, 255, 0.22);
  color: white;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #273640;
  border: 2px solid transparent;
  background-clip: content-box;
  border-radius: 10px;
}

.mono {
  font-family: var(--font-geist-mono), ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 60;
  inset: 0 auto 0 0;
  width: 264px;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 18px;
  background:
    linear-gradient(180deg, rgba(90, 151, 255, 0.025), transparent 25%),
    var(--sidebar);
  border-right: 1px solid rgba(116, 147, 163, 0.14);
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(84, 119, 134, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(84, 119, 134, 0.12) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, black, transparent 42%);
}

.brand-block,
.workspace-pill,
.primary-nav,
.sidebar-insight,
.sidebar-profile {
  position: relative;
  z-index: 1;
}

.brand-block {
  display: grid;
  grid-template-columns: 42px minmax(62px, 1fr) 118px;
  align-items: center;
  gap: 7px;
  padding: 0 0 22px;
}

.brand-mark {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(126, 176, 255, 0.42);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(90, 151, 255, 0.18), rgba(77, 163, 255, 0.08));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03), 0 0 28px rgba(90, 151, 255, 0.08);
  color: white;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  background: linear-gradient(var(--accent), var(--blue));
  opacity: 0.65;
}

.brand-mark::before {
  width: 1px;
  height: 100%;
  left: 8px;
}

.brand-mark::after {
  width: 100%;
  height: 1px;
  bottom: 8px;
}

.brand-mark span {
  position: relative;
  z-index: 1;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.04em;
}

.brand-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand-copy strong {
  font-size: 12px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand-copy span {
  color: var(--muted);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.brand-logo {
  width: 118px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: url("/logo/logosvg.svg") center / contain no-repeat;
  filter: drop-shadow(0 0 18px rgba(114, 255, 151, .22));
}

.mobile-close,
.menu-button {
  display: none !important;
}

.workspace-pill {
  display: grid;
  grid-template-columns: 34px 1fr 16px;
  align-items: center;
  gap: 9px;
  margin: 0 0 25px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(18, 25, 32, 0.7);
  color: var(--muted);
}

.workspace-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
}

.workspace-pill > div:nth-child(2) {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.workspace-pill span {
  color: var(--muted);
  font-size: 10px;
}

.workspace-pill strong {
  overflow: hidden;
  color: var(--text-2);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-section-label {
  padding: 0 12px 8px;
  color: #596a74;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.nav-item {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 38px 1fr 10px;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--text-2);
  text-align: left;
  transition: 180ms cubic-bezier(.2,.8,.2,1);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(109, 142, 156, 0.12);
  color: var(--text);
}

.nav-item-active {
  background: linear-gradient(90deg, rgba(90, 151, 255, 0.105), rgba(90, 151, 255, 0.02));
  border-color: rgba(90, 151, 255, 0.14);
  color: var(--text);
}

.nav-item-active::before {
  content: "";
  position: absolute;
  left: -17px;
  width: 3px;
  height: 28px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(var(--accent), var(--blue));
  box-shadow: 0 0 16px rgba(90, 151, 255, 0.32);
}

.nav-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #82939c;
  transition: 180ms ease;
}

.nav-item-active .nav-icon {
  background: rgba(90, 151, 255, 0.1);
  color: var(--accent);
}

.nav-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-copy strong {
  font-size: 12.5px;
  font-weight: 650;
}

.nav-copy small {
  color: #64747e;
  font-size: 9.5px;
}

.nav-active-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.sidebar-insight {
  margin-top: auto;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(13, 19, 24, 0.72);
}

.insight-top,
.insight-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.insight-top {
  justify-content: flex-start;
  color: var(--accent);
  font-size: 10px;
  font-weight: 650;
}

.insight-meter {
  height: 3px;
  margin: 11px 0 9px;
  border-radius: 10px;
  background: #1c2930;
  overflow: hidden;
}

.insight-meter i {
  display: block;
  width: 94%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--blue));
}

.insight-bottom {
  color: var(--muted);
  font-size: 9px;
}

.insight-bottom strong {
  color: var(--text-2);
  font-size: 9px;
}

.sidebar-profile {
  display: grid;
  grid-template-columns: 34px 1fr 18px;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  padding: 10px 4px 0;
  color: var(--muted);
}

.sidebar-profile > div:nth-child(2) {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-profile strong {
  color: var(--text-2);
  font-size: 11px;
}

.sidebar-profile span {
  font-size: 9px;
}

.avatar {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #385262;
  border-radius: 11px;
  background: linear-gradient(145deg, #243744, #17242c);
  color: #dceaf0;
  font-size: 11px;
  font-weight: 750;
}

.avatar i {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
}

.avatar-admin {
  width: 34px;
  height: 34px;
  border-color: rgba(90, 151, 255, .28);
  background: var(--accent-soft);
  color: var(--accent);
}

.avatar-muted {
  filter: grayscale(.7);
  opacity: .65;
}

.avatar-muted i {
  background: var(--muted);
}

.avatar-sm {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 9px;
}

.avatar-xl {
  width: 62px;
  height: 62px;
  border-radius: 17px;
  font-size: 17px;
}

.main-shell {
  min-height: 100vh;
  margin-left: 264px;
}

.topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 30px;
  border-bottom: 1px solid rgba(99, 130, 144, 0.14);
  background: rgba(7, 10, 13, 0.8);
  backdrop-filter: blur(18px);
}

.topbar-left,
.topbar-actions,
.breadcrumb,
.sync-state {
  display: flex;
  align-items: center;
}

.breadcrumb {
  gap: 8px;
  color: #60717b;
  font-size: 11px;
}

.breadcrumb strong {
  color: var(--text-2);
  font-weight: 600;
}

.topbar-actions {
  gap: 12px;
}

.command-search {
  width: 270px;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 9px 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 21, 27, .72);
  color: var(--muted);
  text-align: left;
  transition: 180ms ease;
}

.command-search:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  color: var(--text-2);
}

.command-search span {
  flex: 1;
  font-size: 11px;
}

kbd {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 0 6px;
  border: 1px solid #2b3942;
  border-bottom-color: #3d4d57;
  border-radius: 5px;
  background: #11181e;
  color: #7e8f98;
  font-family: var(--font-geist-sans), sans-serif;
  font-size: 8px;
  font-weight: 650;
}

.sync-state {
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.sync-dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(90, 151, 255, .6);
}

.sync-dot-saving {
  background: var(--warning);
  animation: pulse 1s infinite;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  transition: 160ms ease;
}

.icon-button:hover {
  border-color: var(--border);
  background: var(--surface-3);
  color: var(--text);
}

.icon-button.subtle {
  width: 32px;
  height: 32px;
  color: var(--muted);
}

.icon-button.bordered {
  border-color: var(--border);
  background: var(--surface-2);
}

.notification-button {
  position: relative;
  border-color: var(--border);
  background: var(--surface);
}

.notification-button i {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 5px;
  height: 5px;
  border: 1px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
}

.page-wrap {
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 30px 30px 60px;
}

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

.eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  color: #748791;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(90,151,255,.68);
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(26px, 2.2vw, 34px);
  font-weight: 700;
  letter-spacing: -.038em;
}

.page-heading p {
  max-width: 690px;
  margin: 8px 0 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.55;
}

.heading-date {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: fit-content;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(14,20,25,.68);
  color: var(--muted);
}

.heading-date span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--text-2);
  font-size: 10px;
  font-weight: 600;
}

.heading-date small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 500;
}

.view-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(18, 25, 32, .94), rgba(12, 18, 23, .96));
  box-shadow: 0 14px 45px rgba(0,0,0,.14);
}

.section-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.section-header h2,
.section-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -.015em;
}

.section-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10.5px;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  transition: 170ms cubic-bezier(.2,.8,.2,1);
}

.primary-button {
  border: 1px solid rgba(126, 176, 255, .6);
  background: linear-gradient(135deg, #6ea6ff, #4f8dff);
  box-shadow: 0 8px 24px rgba(90,151,255,.12), inset 0 1px rgba(255,255,255,.28);
  color: #061021;
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #86b9ff;
  box-shadow: 0 10px 28px rgba(90,151,255,.18);
}

.secondary-button {
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-2);
}

.secondary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #415562;
  background: var(--surface-3);
  color: var(--text);
}

.secondary-button.compact {
  min-height: 36px;
  padding: 0 11px;
  font-size: 10px;
}

.danger-button {
  border: 1px solid rgba(255,101,119,.28);
  background: rgba(255,101,119,.08);
  color: #ff8593;
}

.danger-button:hover:not(:disabled) {
  background: rgba(255,101,119,.14);
}

.danger-button.solid {
  background: #e95065;
  color: white;
}

.danger-button.compact {
  min-height: 36px;
  padding: 0 11px;
  font-size: 10px;
}

.danger-ghost {
  color: var(--danger) !important;
}

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

.metric-card {
  position: relative;
  min-height: 130px;
  overflow: hidden;
  padding: 17px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    radial-gradient(circle at 105% -10%, rgba(103,133,148,.08), transparent 45%),
    linear-gradient(145deg, #111820, #0c1217);
}

.metric-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  opacity: .35;
  background: linear-gradient(90deg, transparent, #526a76, transparent);
}

.metric-primary::after { background: linear-gradient(90deg, transparent, var(--accent), transparent); }
.metric-blue::after { background: linear-gradient(90deg, transparent, var(--blue), transparent); }
.metric-warning::after { background: linear-gradient(90deg, transparent, var(--warning), transparent); }
.metric-violet::after { background: linear-gradient(90deg, transparent, var(--violet), transparent); }

.metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-2);
  font-size: 10px;
}

.metric-icon {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255,255,255,.02);
  color: #82959f;
}

.metric-primary .metric-icon { border-color: rgba(90,151,255,.16); background: var(--accent-soft); color: var(--accent); }
.metric-blue .metric-icon { border-color: rgba(77,163,255,.16); background: var(--blue-soft); color: var(--blue); }
.metric-warning .metric-icon { border-color: rgba(244,183,64,.16); background: rgba(244,183,64,.1); color: var(--warning); }
.metric-violet .metric-icon { border-color: rgba(170,139,255,.16); background: rgba(170,139,255,.1); color: var(--violet); }

.metric-card > strong {
  display: block;
  margin: 5px 0 8px;
  font-size: clamp(21px, 2vw, 28px);
  font-weight: 680;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}

.metric-detail {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 9.5px;
}

.metric-detail i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #526671;
}

.metric-primary .metric-detail i { background: var(--accent); }
.metric-blue .metric-detail i { background: var(--blue); }
.metric-warning .metric-detail i { background: var(--warning); }
.metric-violet .metric-detail i { background: var(--violet); }

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 11, 14, .22);
}

.search-field,
.select-field {
  min-height: 37px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #0b1015;
  color: var(--muted);
  transition: 160ms ease;
}

.search-field:focus-within,
.select-field:focus-within {
  border-color: rgba(77,163,255,.55);
  box-shadow: 0 0 0 3px rgba(77,163,255,.07);
}

.search-field {
  width: min(420px, 100%);
  padding: 0 11px;
}

.search-field.small {
  width: 100%;
  min-height: 36px;
}

.search-field input,
.select-field select {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 10.5px;
}

.search-field input::placeholder {
  color: #53636d;
}

.search-field > button {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--muted);
}

.select-field {
  position: relative;
  min-width: 180px;
  padding: 0 9px 0 11px;
}

.select-field select {
  appearance: none;
  padding-right: 18px;
}

.select-field > svg:last-child {
  pointer-events: none;
  margin-left: -22px;
}

.themed-select {
  position: relative;
  min-width: 190px;
  color: var(--text-2);
}

.themed-select-trigger {
  width: 100%;
  min-height: 37px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: linear-gradient(180deg, #0d1419, #090e12);
  color: var(--text-2);
  font-size: 10.5px;
  text-align: left;
  transition: 160ms ease;
}

.themed-select-trigger > span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.themed-select-trigger > svg:first-child { flex: 0 0 auto; color: #80939d; }
.themed-select-trigger:hover:not(:disabled),
.themed-select-open .themed-select-trigger { border-color: rgba(77,163,255,.55); box-shadow: 0 0 0 3px rgba(77,163,255,.07); }
.themed-select-chevron { flex: 0 0 auto; color: #71858f; transition: transform 160ms ease; }
.themed-select-open .themed-select-chevron { transform: rotate(180deg); }

.themed-select-menu {
  position: absolute;
  z-index: 120;
  top: calc(100% + 6px);
  left: 0;
  width: max(100%, 235px);
  max-height: var(--select-menu-max-height, 290px);
  overflow: auto;
  padding: 5px;
  border: 1px solid #253743;
  border-radius: 10px;
  background: rgba(10,16,21,.98);
  box-shadow: 0 18px 50px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.02) inset;
  backdrop-filter: blur(18px);
}

.themed-select-top .themed-select-menu {
  top: auto;
  bottom: calc(100% + 6px);
}

.themed-select-menu > button {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 9px;
  border-radius: 7px;
  background: transparent;
  color: #9caeb7;
  text-align: left;
}

.themed-select-menu > button:hover,
.themed-select-menu > button:focus-visible { outline: 0; background: rgba(77,163,255,.09); color: var(--text); }
.themed-select-menu > button.selected { background: rgba(90,151,255,.09); color: #e2eeff; }
.themed-select-menu > button > span { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.themed-select-menu strong { overflow: hidden; font-size: 10px; font-weight: 570; text-overflow: ellipsis; white-space: nowrap; }
.themed-select-menu small { color: var(--muted); font-size: 8px; }
.themed-select-menu > button > svg { color: var(--accent); }
.form-field > .themed-select { width: 100%; }
.form-field > .themed-select .themed-select-trigger { min-height: 41px; }

.line-vat-select {
  min-width: 0;
  width: 100%;
}

.line-vat-select .themed-select-trigger {
  min-height: 28px;
  gap: 5px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 8.5px;
}

.line-vat-select .themed-select-menu {
  width: max(100%, 118px);
}

.segmented-control,
.view-switch {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0a0f13;
}

.segmented-control button,
.view-switch button {
  min-height: 30px;
  padding: 0 11px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 650;
}

.view-switch button {
  display: flex;
  align-items: center;
  gap: 6px;
}

.segmented-control button.active,
.view-switch button.active {
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
  color: var(--text);
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  white-space: nowrap;
}

.data-table th {
  height: 38px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(10,15,19,.7);
  color: #657780;
  font-size: 8.5px;
  font-weight: 750;
  letter-spacing: .09em;
  text-align: left;
  text-transform: uppercase;
}

.data-table td {
  height: 65px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(37, 50, 59, .72);
  color: var(--text-2);
  transition: 160ms ease;
}

.data-table tbody tr {
  cursor: pointer;
  transition: 160ms ease;
}

.data-table tbody tr:hover td,
.data-table tbody tr.row-selected td {
  background: rgba(90,151,255,.025);
}

.data-table tbody tr.row-selected td:first-child {
  box-shadow: inset 2px 0 var(--accent);
}

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

.table-primary,
.person-cell,
.tech-snapshot {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-primary > div:last-child,
.person-cell > div:last-child,
.tech-snapshot > div:last-child,
.equipment-cell,
.line-count-cell,
.activity-cell,
.line-name-cell > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.table-primary strong,
.person-cell strong,
.tech-snapshot strong,
.equipment-cell strong,
.activity-cell > span {
  max-width: 280px;
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  font-weight: 620;
  text-overflow: ellipsis;
}

.table-primary span,
.person-cell span,
.tech-snapshot span,
.equipment-cell span,
.line-count-cell small,
.activity-cell small,
.line-name-cell small {
  max-width: 300px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
}

.doc-icon,
.mini-doc-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(90,151,255,.13);
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
}

.money-cell,
.line-total {
  color: var(--text) !important;
  font-family: var(--font-geist-mono), monospace;
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.muted-cell {
  color: var(--muted);
  font-size: 9.5px;
}

.line-count-cell > span {
  width: fit-content;
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--text-2);
  font-family: var(--font-geist-mono), monospace;
  font-size: 9px;
}

.status-badge {
  min-height: 24px;
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.025);
  color: var(--text-2);
  font-size: 8.5px;
  font-weight: 680;
  white-space: nowrap;
}

.badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 7px currentColor;
}

.status-success,
.template-published,
.tech-active {
  border-color: rgba(90,151,255,.16);
  background: rgba(90,151,255,.08);
  color: var(--accent);
}

.status-warning,
.template-draft {
  border-color: rgba(244,183,64,.17);
  background: rgba(244,183,64,.08);
  color: var(--warning);
}

.status-info {
  border-color: rgba(77,163,255,.17);
  background: rgba(77,163,255,.08);
  color: #75b8ff;
}

.status-violet {
  border-color: rgba(170,139,255,.17);
  background: rgba(170,139,255,.08);
  color: var(--violet);
}

.status-cyan {
  border-color: rgba(86,216,231,.17);
  background: rgba(86,216,231,.08);
  color: var(--cyan);
}

.template-archived,
.tech-inactive {
  border-color: rgba(130,148,158,.15);
  background: rgba(130,148,158,.07);
  color: #84959e;
}

.identifier-pill,
.category-pill,
.count-pill {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #10171d;
  color: #91a3ac;
  font-size: 8.5px;
}

.quote-count {
  min-width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  font-family: var(--font-geist-mono), monospace;
  font-size: 10px;
}

.empty-state {
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.empty-state > div {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 5px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  color: #70838e;
}

.empty-state strong {
  color: var(--text-2);
  font-size: 12px;
}

.empty-state span {
  max-width: 320px;
  font-size: 10px;
  line-height: 1.45;
}

@keyframes pulse {
  50% { opacity: .35; transform: scale(.82); }
}

.loading-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.loading-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 13px;
}

.loading-kpis i,
.loading-panel span {
  border-radius: 14px;
  background: linear-gradient(90deg, #0e151a 20%, #162028 45%, #0e151a 70%);
  background-size: 240% 100%;
  animation: shimmer 1.8s infinite;
}

.loading-kpis i { height: 130px; }
.loading-panel { height: 420px; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.loading-panel span { display: block; height: 54px; margin-bottom: 12px; }

@keyframes shimmer {
  to { background-position: -240% 0; }
}

/* Devis types */
.library-layout {
  display: grid;
  grid-template-columns: minmax(700px, 1fr) 350px;
  min-height: 470px;
}

.library-layout > .table-wrap {
  border-right: 1px solid var(--border);
}

.template-preview {
  position: relative;
  min-width: 0;
  padding: 20px;
  background:
    radial-gradient(circle at 100% 0, rgba(90,151,255,.07), transparent 32%),
    rgba(8,13,17,.34);
}

.preview-accent {
  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--blue), transparent);
  opacity: .7;
}

.preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.preview-head > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preview-head span,
.preview-meta-grid span,
.preview-lines-head,
.preview-total span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.preview-head h3 {
  max-width: 210px;
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
}

.preview-meta-grid {
  display: grid;
  grid-template-columns: 1.2fr .7fr 1fr;
  gap: 10px;
  padding: 15px 0;
}

.preview-meta-grid > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.preview-meta-grid strong {
  color: var(--text-2);
  font-size: 9px;
}

.preview-description {
  margin: 0 0 14px;
  color: var(--text-2);
  font-size: 9.5px;
  line-height: 1.55;
}

.preview-lines {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(7,11,14,.42);
}

.preview-lines-head,
.preview-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--border);
}

.preview-line:last-child {
  border-bottom: 0;
}

.preview-line > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.preview-line strong {
  overflow: hidden;
  color: var(--text-2);
  font-size: 9px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-line span {
  color: var(--muted);
  font-size: 8px;
}

.preview-line b {
  color: var(--text);
  font-family: var(--font-geist-mono), monospace;
  font-size: 8.5px;
  white-space: nowrap;
}

.preview-total {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 15px 0;
  padding: 13px 0;
  border-top: 1px dashed var(--border-strong);
  border-bottom: 1px dashed var(--border-strong);
}

.preview-total strong {
  font-family: var(--font-geist-mono), monospace;
  font-size: 17px;
  letter-spacing: -.04em;
}

.preview-actions {
  display: flex;
  gap: 8px;
}

.preview-actions .secondary-button {
  flex: 1;
}

/* Forms, modals and drawers */
.modal-layer,
.drawer-layer {
  position: fixed;
  z-index: 100;
  inset: 0;
  pointer-events: none;
}

.modal-layer {
  display: grid;
  place-items: center;
  padding: 22px;
  pointer-events: auto;
}

.modal-backdrop,
.drawer-backdrop {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 5, 7, .76);
  backdrop-filter: blur(8px);
}

.modal-card {
  width: min(520px, 100%);
  max-height: calc(100vh - 44px);
  overflow: visible;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: linear-gradient(165deg, #141c23, #0b1015);
  box-shadow: 0 30px 100px rgba(0,0,0,.55);
  animation: modal-in 180ms cubic-bezier(.2,.8,.2,1);
}

.modal-wide {
  width: min(760px, 100%);
}

.modal-card:not(.alp-line-modal) {
  overflow-y: auto;
}

.alp-line-modal {
  width: min(880px, calc(100vw - 36px));
  max-height: calc(100vh - 42px);
}

.alp-line-modal .modal-body {
  gap: 16px;
  padding: 22px;
}

.alp-line-modal .alp-brand-row {
  grid-template-columns: minmax(0, 1fr);
}

.alp-line-modal .modal-footer {
  margin: 6px -22px -22px;
  padding-inline: 22px;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
}

.modal-header,
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header > div,
.drawer-header > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-header span,
.drawer-header span {
  color: var(--accent);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.modal-header h3,
.drawer-header h3 {
  margin: 0;
  font-size: 16px;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-field > span,
.inline-field > span {
  color: #83949d;
  font-size: 9px;
  font-weight: 620;
}

.form-field input,
.form-field textarea,
.form-field select,
.inline-field input {
  width: 100%;
  min-height: 41px;
  padding: 0 11px;
  border: 1px solid var(--border);
  outline: 0;
  border-radius: 9px;
  background: #090e12;
  color: var(--text);
  font-size: 10.5px;
  transition: 160ms ease;
}

.form-field textarea {
  min-height: 82px;
  padding-top: 10px;
  line-height: 1.5;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus,
.inline-field input:focus {
  border-color: rgba(77,163,255,.55);
  box-shadow: 0 0 0 3px rgba(77,163,255,.07);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin: 5px -20px -20px;
  padding: 15px 20px;
  border-top: 1px solid var(--border);
  background: rgba(7,11,14,.4);
}

.info-callout,
.warning-callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(77,163,255,.17);
  border-radius: 9px;
  background: rgba(77,163,255,.07);
  color: #8bbffd;
  font-size: 9.5px;
  line-height: 1.45;
}

.warning-callout {
  border-color: rgba(255,101,119,.2);
  background: rgba(255,101,119,.07);
  color: #ff8997;
}

.warning-callout > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.warning-callout span {
  color: #bd8991;
}

.confirmation-status {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  color: var(--muted);
  font-size: 9px;
}

.drawer-layer {
  visibility: hidden;
  transition: visibility 240ms;
}

.drawer-layer-open {
  visibility: visible;
  pointer-events: auto;
}

.drawer-backdrop {
  z-index: 0;
  opacity: 0;
  transition: 220ms ease;
}

.drawer-layer-open .drawer-backdrop {
  opacity: 1;
}

.drawer {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  width: min(480px, 96vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border-strong);
  background: linear-gradient(155deg, #131b22, #090e12 75%);
  box-shadow: -30px 0 90px rgba(0,0,0,.45);
  transform: translateX(102%);
  transition: 260ms cubic-bezier(.2,.8,.2,1);
}

.drawer-wide {
  width: min(640px, 96vw);
}

.drawer-layer-open .drawer {
  transform: translateX(0);
}

.drawer-header {
  min-height: 70px;
  flex: 0 0 auto;
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.toast-stack {
  position: fixed;
  z-index: 160;
  right: 22px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  width: min(350px, calc(100vw - 44px));
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid rgba(90,151,255,.22);
  border-radius: 12px;
  background: rgba(15, 23, 28, .96);
  box-shadow: var(--shadow);
  animation: toast-in 240ms cubic-bezier(.2,.8,.2,1);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(24px); }
}

.toast-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
}

.toast > div:last-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.toast strong {
  font-size: 10.5px;
}

.toast span {
  color: var(--muted);
  font-size: 9px;
}

.toast-error {
  border-color: rgba(255,101,119,.25);
}

.toast-error .toast-icon {
  background: rgba(255,101,119,.1);
  color: var(--danger);
}

/* Technicians */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: radial-gradient(circle at 0 0, rgba(90,151,255,.09), transparent 55%), var(--surface-2);
}

.profile-hero > div:last-child {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.profile-hero > div:last-child > strong {
  margin-top: 3px;
  font-size: 16px;
}

.profile-hero > div:last-child > span:last-child {
  color: var(--muted);
  font-size: 9px;
}

.profile-contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--border);
}

.profile-contact-grid > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: #0c1217;
}

.profile-contact-grid span {
  color: var(--muted);
  font-size: 8px;
}

.profile-contact-grid strong {
  overflow: hidden;
  color: var(--text-2);
  font-size: 9.5px;
  text-overflow: ellipsis;
}

.drawer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0 20px;
}

.drawer-section {
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.drawer-section-title,
.detail-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 12px;
}

.drawer-section-title > div,
.detail-section-title > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-section-title span,
.detail-section-title span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.drawer-section-title h4,
.detail-section-title h4 {
  margin: 0;
  font-size: 13px;
}

.mini-quote-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.mini-quote {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(14,20,25,.7);
}

.mini-doc-icon {
  width: 32px;
  height: 32px;
}

.mini-quote > div:nth-child(2) {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mini-quote strong {
  font-family: var(--font-geist-mono), monospace;
  font-size: 9px;
}

.mini-quote > div:nth-child(2) span {
  color: var(--muted);
  font-size: 8px;
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 20px;
  padding: 13px;
  border: 1px solid rgba(255,101,119,.18);
  border-radius: 11px;
  background: rgba(255,101,119,.045);
}

.danger-zone > div {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--danger);
}

.danger-zone > div > span {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.danger-zone strong {
  font-size: 9.5px;
}

.danger-zone small {
  color: #9f757b;
  font-size: 8px;
}

/* Config ALP */
.config-overview {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 17px 20px;
  overflow: hidden;
  border: 1px solid rgba(90,151,255,.17);
  border-radius: 15px;
  background:
    radial-gradient(circle at 78% 20%, rgba(77,163,255,.08), transparent 25%),
    linear-gradient(115deg, rgba(90,151,255,.07), rgba(14,21,27,.92) 36%, rgba(14,21,27,.92));
}

.config-overview-copy,
.config-flow {
  display: flex;
  align-items: center;
}

.config-overview-copy {
  gap: 13px;
}

.config-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(90,151,255,.2);
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
}

.config-overview-copy > div:last-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.config-overview-copy span {
  color: var(--accent);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.config-overview-copy h2 {
  margin: 0;
  font-size: 16px;
}

.config-overview-copy p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 9.5px;
}

.config-flow {
  gap: 8px;
  color: #61737d;
}

.config-flow span {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(8,13,17,.56);
  color: #83959e;
  font-size: 9px;
  font-weight: 600;
}

.config-flow .flow-active {
  border-color: rgba(90,151,255,.23);
  background: var(--accent-soft);
  color: var(--accent);
}

.config-tabs {
  display: flex;
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(10,15,19,.68);
}

.config-tabs button {
  min-height: 46px;
  display: grid;
  grid-template-columns: 24px auto auto;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.config-tabs button:hover {
  color: var(--text-2);
}

.config-tabs button.active {
  border-color: var(--border-strong);
  background: var(--surface-3);
  box-shadow: 0 4px 18px rgba(0,0,0,.16);
  color: var(--text);
}

.config-tabs button.active svg {
  color: var(--accent);
}

.config-tabs small {
  margin-left: 6px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  color: #667882;
  font-size: 7.5px;
}

.builder-shell {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  gap: 13px;
  align-items: start;
}

.builder-catalog,
.builder-editor {
  min-width: 0;
  overflow: hidden;
}

.builder-catalog {
  position: sticky;
  top: 84px;
}

.builder-panel-head {
  min-height: 67px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
}

.builder-panel-head > div:first-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.builder-panel-head span {
  color: var(--accent);
  font-size: 7.5px;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.builder-panel-head h3 {
  margin: 0;
  font-size: 12.5px;
}

.builder-catalog > .search-field {
  width: calc(100% - 24px);
  margin: 12px;
}

.catalog-filter-chips {
  display: flex;
  gap: 5px;
  padding: 0 12px 10px;
  overflow-x: auto;
}

.catalog-filter-chips button {
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 7.5px;
  white-space: nowrap;
}

.catalog-filter-chips button.active {
  border-color: rgba(90,151,255,.2);
  background: var(--accent-soft);
  color: var(--accent);
}

.catalog-list {
  max-height: 640px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow-y: auto;
  padding: 0 10px 12px;
}

.catalog-line {
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(8,13,17,.54);
  color: var(--text-2);
  text-align: left;
  transition: 150ms ease;
}

.catalog-line:hover:not(:disabled) {
  z-index: 1;
  border-color: rgba(90,151,255,.28);
  background: rgba(90,151,255,.035);
}

.catalog-line-added {
  border-color: rgba(90,151,255,.14);
  background: rgba(90,151,255,.04);
}

.catalog-line-top,
.catalog-line > div:last-child {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.catalog-line-top span {
  min-width: 0;
  overflow: hidden;
  color: #647782;
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-line-top strong {
  color: var(--text);
  font-family: var(--font-geist-mono), monospace;
  font-size: 8.5px;
}

.catalog-line > b {
  display: block;
  min-width: 0;
  overflow: hidden;
  font-size: 9.5px;
  font-weight: 620;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.catalog-line > div:last-child {
  color: var(--muted);
  font-size: 7.5px;
}

.catalog-line > div:last-child span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-line > div:last-child svg {
  color: var(--accent);
}

.builder-editor-head {
  min-height: 73px;
}

.builder-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}

.form-field-span {
  grid-column: 1 / -1;
}

.builder-lines-head {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
}

.builder-lines-head > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.builder-lines-head strong {
  font-size: 10px;
}

.builder-lines-head span,
.builder-lines-head small {
  color: var(--muted);
  font-size: 8px;
}

.builder-total-ttc {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 36px;
  padding: 0 15px;
  border: 1px solid rgba(93, 255, 133, .46);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(74, 255, 122, .15), rgba(74, 255, 122, .06));
  color: #84ff9a;
  font-family: var(--font-geist-mono), monospace;
  font-size: 13px !important;
  font-weight: 850;
  text-shadow: 0 0 12px rgba(104, 255, 143, .42);
  white-space: nowrap;
  box-shadow: 0 0 0 3px rgba(76, 255, 123, .05), inset 0 1px 0 rgba(255,255,255,.06);
}

.builder-lines {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px;
  background: rgba(7,11,14,.2);
}

.builder-line {
  display: grid;
  grid-template-columns: 14px 27px minmax(160px, 1fr) 108px 94px 82px 82px 78px;
  align-items: center;
  gap: 7px;
  min-height: 61px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #10171d;
  transition: 150ms ease;
}

.builder-line:hover {
  border-color: #31434e;
  background: #121b22;
}

.drag-handle {
  width: 11px;
  display: grid;
  grid-template-columns: repeat(2, 3px);
  gap: 2px;
  cursor: grab;
}

.drag-handle span {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #53656f;
}

.builder-line-index {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: #687b85;
  font-family: var(--font-geist-mono), monospace;
  font-size: 7.5px;
}

.builder-line-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.builder-line-copy strong {
  overflow: hidden;
  font-size: 9px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.builder-line-copy span {
  color: var(--muted);
  font-size: 7.5px;
}

.inline-field {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.inline-field input {
  min-height: 28px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 8.5px;
}

.quantity-stepper {
  min-height: 30px;
  display: grid;
  grid-template-columns: 28px minmax(34px, 1fr) 28px;
  align-items: center;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, #0b1117, #070c10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

.quantity-stepper:focus-within {
  border-color: rgba(77,163,255,.55);
  box-shadow: 0 0 0 3px rgba(77,163,255,.07);
}

.quantity-stepper button {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  justify-self: center;
  border: 1px solid rgba(90,151,255,.18);
  border-radius: 7px;
  background: rgba(90,151,255,.07);
  color: #93bbff;
  transition: 150ms ease;
}

.quantity-stepper button:hover {
  border-color: rgba(90,151,255,.36);
  background: rgba(90,151,255,.15);
  color: var(--text);
}

.quantity-stepper input {
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
  font-weight: 720;
}

.quantity-stepper input:focus {
  border-color: var(--border);
  box-shadow: none;
}

.price-inline input {
  padding-right: 20px;
}

.price-inline input,
.quantity-stepper input,
.form-field input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.price-inline input::-webkit-inner-spin-button,
.price-inline input::-webkit-outer-spin-button,
.quantity-stepper input::-webkit-inner-spin-button,
.quantity-stepper input::-webkit-outer-spin-button,
.form-field input[type="number"]::-webkit-inner-spin-button,
.form-field input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

.price-inline i {
  position: absolute;
  right: 7px;
  bottom: 7px;
  color: var(--muted);
  font-size: 8px;
  font-style: normal;
}

.line-total {
  text-align: right;
  font-size: 8.5px !important;
}

.line-controls {
  display: flex;
  justify-content: flex-end;
}

.line-controls .icon-button {
  width: 24px;
  height: 26px;
  border-radius: 6px;
}

.builder-savebar {
  position: sticky;
  z-index: 3;
  bottom: 0;
  min-height: 67px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-top: 1px solid var(--border-strong);
  background: rgba(12,18,23,.94);
  backdrop-filter: blur(12px);
}

.builder-savebar > div:last-child,
.autosave-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.autosave-indicator > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.autosave-indicator strong {
  font-size: 9px;
}

.autosave-indicator small {
  color: var(--muted);
  font-size: 7.5px;
}

.catalog-panel {
  overflow: hidden;
}

.catalog-summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  color: var(--muted);
  font-size: 9px;
}

.line-category-filter {
  flex-wrap: wrap;
}

.line-category-filter button {
  white-space: nowrap;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.row-actions > .icon-button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

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

.equipment-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(9,14,18,.52);
  transition: 160ms ease;
}

.equipment-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: rgba(16,24,30,.8);
}

.equipment-card-head,
.equipment-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.equipment-symbol {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(77,163,255,.15);
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue);
}

.equipment-card > span {
  display: block;
  margin-top: 12px;
  color: var(--accent);
  font-size: 7.5px;
}

.equipment-card h3 {
  margin: 5px 0;
  font-size: 13px;
}

.equipment-card p {
  min-height: 30px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.equipment-price {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 11px;
}

.equipment-price small { color: #8da0aa; font-size: 8px; }
.equipment-price strong { color: var(--accent); font-size: 11px; }

.equipment-card-bottom {
  padding-top: 11px;
  border-top: 1px solid var(--border);
  color: var(--text-2);
  font-size: 8.5px;
}

.catalog-kind-pill {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid rgba(77,163,255,.18);
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 7.5px;
  font-weight: 720;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.delete-countdown {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  white-space: nowrap;
}

.delete-countdown span,
.delete-countdown button {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 700;
}

.delete-countdown span {
  padding: 0 8px;
  border: 1px solid rgba(255,111,134,.22);
  background: rgba(255,111,134,.08);
  color: #ff9baa;
}

.delete-countdown button {
  padding: 0 9px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-2);
}

.delete-countdown button:hover {
  border-color: #49658c;
  background: var(--surface-3);
  color: var(--text);
}

.action-cell {
  min-width: 150px;
  text-align: right;
}

.line-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.line-name-cell > span {
  min-width: 72px;
  color: var(--accent);
  font-size: 8px;
}

.line-name-cell strong {
  color: var(--text);
  font-size: 10px;
}

/* Returns and quote details */
.responsible-banner {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid rgba(77,163,255,.17);
  border-radius: 13px;
  background:
    linear-gradient(90deg, rgba(77,163,255,.08), transparent 38%),
    rgba(14,20,26,.82);
}

.responsible-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(77,163,255,.2);
  border-radius: 11px;
  background: var(--blue-soft);
  color: var(--blue);
}

.responsible-banner > div:nth-child(2) {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.responsible-banner > div:nth-child(2) > span {
  color: var(--blue);
  font-size: 7.5px;
  font-weight: 750;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.responsible-banner strong {
  font-size: 11px;
}

.responsible-banner p {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 8.5px;
}

.connection-badge {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(8,13,17,.6);
  color: #7f919b;
  font-size: 8px;
  white-space: nowrap;
}

.connection-badge span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 8px rgba(244,183,64,.5);
}

.tech-snapshot .avatar {
  background: #17252c;
}

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(190px,1fr));
  gap: 9px;
  overflow-x: auto;
  padding: 12px;
  background: rgba(6,10,13,.25);
}

.pipeline-column {
  min-height: 390px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(13,19,24,.72);
}

.pipeline-title {
  min-height: 31px;
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: center;
  gap: 7px;
  padding: 0 3px 8px;
  color: var(--text-2);
}

.pipeline-title strong {
  font-size: 8.5px;
}

.pipeline-title > span:last-child {
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--muted);
  font-family: var(--font-geist-mono), monospace;
  font-size: 7px;
}

.pipeline-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pipeline-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.pipeline-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #10171d;
  color: var(--text-2);
  text-align: left;
  transition: 150ms ease;
}

.pipeline-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.pipeline-card > div:first-child,
.pipeline-card > div:last-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pipeline-card > div:first-child span {
  color: var(--accent);
  font-size: 7px;
}

.pipeline-card > div:first-child strong {
  font-family: var(--font-geist-mono), monospace;
  font-size: 8px;
}

.pipeline-card h4 {
  margin: 0;
  overflow: hidden;
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pipeline-card p {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 7.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pipeline-card > div:last-child {
  padding-top: 7px;
  border-top: 1px solid var(--border);
  color: #80919a;
  font-size: 7px;
}

.pipeline-card small {
  color: #5e7079;
  font-size: 6.5px;
}

.pipeline-empty {
  display: grid;
  place-items: center;
  min-height: 90px;
  border: 1px dashed var(--border);
  border-radius: 9px;
  color: #52636d;
  font-size: 8px;
}

.quote-detail {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quote-detail-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 16px;
  border: 1px solid rgba(90,151,255,.16);
  border-radius: 13px;
  background:
    radial-gradient(circle at 100% 0, rgba(77,163,255,.1), transparent 44%),
    linear-gradient(120deg, rgba(90,151,255,.08), rgba(12,18,23,.8));
}

.quote-detail-hero > div:first-child {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.quote-detail-hero h4 {
  margin: 3px 0 0;
  font-size: 17px;
}

.quote-detail-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.quote-detail-hero > div:last-child {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.quote-detail-hero > div:last-child span {
  color: var(--muted);
  font-size: 8px;
}

.quote-detail-hero > div:last-child strong {
  color: var(--accent);
  font-family: var(--font-geist-mono), monospace;
  font-size: 21px;
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--border);
}

.detail-meta-grid > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 11px;
  background: #0b1116;
}

.detail-meta-grid span,
.detail-meta-grid small {
  color: var(--muted);
  font-size: 7.5px;
}

.detail-meta-grid strong {
  overflow: hidden;
  color: var(--text-2);
  font-size: 9px;
  text-overflow: ellipsis;
}

.progress-track,
.detail-section {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(11,17,22,.62);
}

.progress-track-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.progress-track-head strong {
  font-size: 10px;
}

.progress-track-head span {
  color: var(--muted);
  font-size: 8px;
}

.progress-steps {
  display: flex;
  align-items: flex-start;
}

.progress-step {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 6px;
  color: #53646d;
  font-size: 6.8px;
  text-align: center;
}

.progress-step::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 11px;
  left: calc(50% + 11px);
  width: calc(100% - 22px);
  height: 1px;
  background: #26343d;
}

.progress-step:last-child::after { display: none; }

.progress-step i {
  position: relative;
  z-index: 1;
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border: 1px solid #2b3942;
  border-radius: 50%;
  background: #10171d;
  font-family: var(--font-geist-mono), monospace;
  font-size: 7px;
  font-style: normal;
}

.progress-step.done,
.progress-step.current { color: var(--accent); }
.progress-step.done::after { background: rgba(90,151,255,.48); }
.progress-step.done i { border-color: rgba(90,151,255,.44); background: rgba(90,151,255,.12); }
.progress-step.current i { box-shadow: 0 0 0 4px rgba(90,151,255,.07), 0 0 16px rgba(90,151,255,.12); }

.quote-detail-lines {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 9px;
}

.quote-detail-lines > div {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 9px;
  min-height: 45px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--border);
}

.quote-detail-lines > div:last-child { border-bottom: 0; }
.quote-detail-lines > div > span { color: #5f717b; font-family: var(--font-geist-mono), monospace; font-size: 7px; }
.quote-detail-lines > div > div { display: flex; flex-direction: column; gap: 3px; }
.quote-detail-lines strong { font-size: 8.5px; font-weight: 600; }
.quote-detail-lines small { color: var(--muted); font-size: 7px; }
.quote-detail-lines b { font-family: var(--font-geist-mono), monospace; font-size: 8px; }

.detail-totals {
  width: 54%;
  min-width: 260px;
  margin: 10px 0 0 auto;
}

.detail-totals > div {
  display: flex;
  justify-content: space-between;
  padding: 5px 2px;
  color: var(--muted);
  font-size: 8px;
}

.detail-totals strong { color: var(--text-2); font-family: var(--font-geist-mono), monospace; }
.detail-totals > div:last-child { margin-top: 4px; padding: 9px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); }
.detail-totals > div:last-child strong { color: var(--accent); font-size: 10px; }

.timeline {
  display: flex;
  flex-direction: column;
}

.timeline-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  min-height: 62px;
}

.timeline-marker {
  position: relative;
  display: flex;
  justify-content: center;
}

.timeline-marker i {
  position: relative;
  z-index: 1;
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border: 2px solid #0d1419;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(90,151,255,.4);
}

.timeline-marker span {
  position: absolute;
  top: 15px;
  bottom: -7px;
  width: 1px;
  background: #273640;
}

.timeline-item > div:last-child {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.timeline-item > div:last-child > div {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.timeline-item time { color: var(--muted); font-size: 7.5px; }
.timeline-item strong { color: var(--text-2); font-size: 8.5px; font-weight: 580; }
.timeline-item p { margin: 0; color: var(--muted); font-size: 7.5px; line-height: 1.4; }

.status-action-box {
  position: sticky;
  bottom: -20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin: 0 -20px -20px;
  padding: 13px 20px;
  border-top: 1px solid var(--border-strong);
  background: rgba(12,18,23,.96);
  backdrop-filter: blur(12px);
}

.status-action-box > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.status-action-box span { color: var(--muted); font-size: 7.5px; }
.status-action-box strong { font-size: 9.5px; }

/* Universal search */
.search-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-hero {
  position: relative;
  overflow: hidden;
  padding: 31px clamp(20px, 5vw, 70px) 26px;
  border: 1px solid rgba(90,151,255,.18);
  border-radius: 18px;
  background:
    radial-gradient(circle at 25% 0, rgba(90,151,255,.1), transparent 35%),
    radial-gradient(circle at 78% 120%, rgba(77,163,255,.1), transparent 37%),
    linear-gradient(145deg, #101820, #090e12);
  text-align: center;
}

.search-grid-glow {
  position: absolute;
  inset: 0;
  opacity: .22;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(88,118,131,.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88,118,131,.12) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 50%, black, transparent 72%);
}

.search-hero-icon {
  position: relative;
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  margin: 0 auto 10px;
  border: 1px solid rgba(90,151,255,.24);
  border-radius: 13px;
  background: var(--accent-soft);
  box-shadow: 0 0 35px rgba(90,151,255,.08);
  color: var(--accent);
}

.search-hero > span {
  position: relative;
  color: var(--accent);
  font-size: 7.5px;
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.search-hero h2 {
  position: relative;
  margin: 7px 0 6px;
  font-size: clamp(21px, 2.4vw, 31px);
  letter-spacing: -.045em;
}

.search-hero p {
  position: relative;
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
}

.mega-search {
  position: relative;
  width: min(760px, 100%);
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px auto 12px;
  padding: 0 13px 0 17px;
  border: 1px solid #344751;
  border-radius: 14px;
  background: rgba(7,12,15,.86);
  box-shadow: 0 16px 45px rgba(0,0,0,.28);
  color: var(--accent);
  transition: 170ms ease;
}

.mega-search:focus-within {
  border-color: rgba(90,151,255,.52);
  box-shadow: 0 0 0 4px rgba(90,151,255,.07), 0 18px 50px rgba(0,0,0,.3);
}

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

.mega-search input::placeholder { color: #566872; }
.mega-search button { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-3); color: var(--muted); }

.search-suggestions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.search-suggestions span { color: #5c6e77; font-size: 7.5px; }
.search-suggestions button { min-height: 24px; padding: 0 8px; border: 1px solid var(--border); border-radius: 999px; background: rgba(255,255,255,.02); color: #7f919a; font-size: 7.5px; }
.search-suggestions button:hover { border-color: var(--border-strong); color: var(--text-2); }

.search-results-panel {
  overflow: hidden;
}

.search-result-head {
  min-height: 77px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 19px;
  border-bottom: 1px solid var(--border);
}

.search-result-head .eyebrow { margin-bottom: 5px; }
.search-result-head h3 { margin: 0; font-size: 15px; }
.search-filters { display: flex; gap: 8px; }

.search-result-list {
  display: flex;
  flex-direction: column;
}

.search-result {
  width: 100%;
  min-height: 83px;
  display: grid;
  grid-template-columns: 42px minmax(230px, 1.4fr) minmax(180px, 1fr) 120px 22px;
  align-items: center;
  gap: 13px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  text-align: left;
  transition: 150ms ease;
}

.search-result:hover {
  background: rgba(90,151,255,.025);
}

.search-result:last-child { border-bottom: 0; }

.search-result-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(90,151,255,.15);
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
}

.search-result-main,
.search-result-model,
.search-result-price {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-result-main > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-result-main > div > span:first-child { color: var(--accent); font-size: 8px; }
.search-result-main h4 { margin: 0; font-size: 11px; }
.search-result-main p { margin: 0; overflow: hidden; color: var(--muted); font-size: 8.5px; text-overflow: ellipsis; white-space: nowrap; }
.search-result-model span { color: var(--muted); font-size: 7px; }
.search-result-model strong { overflow: hidden; font-size: 9px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.search-result-model small { color: #6d7f89; font-size: 7.5px; }
.search-result-price { align-items: flex-end; }
.search-result-price strong { color: var(--text); font-family: var(--font-geist-mono), monospace; font-size: 11px; }
.search-result-price span { color: var(--muted); font-size: 7.5px; }

/* Responsive */
@media (max-width: 1500px) {
  .builder-shell { grid-template-columns: minmax(245px, 290px) minmax(0, 1fr); }
  .equipment-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 1260px) {
  .sidebar { width: 84px; padding-inline: 12px; }
  .main-shell { margin-left: 84px; }
  .brand-copy, .brand-logo, .workspace-pill > div:nth-child(2), .workspace-pill > svg, .nav-copy, .nav-active-dot, .sidebar-insight, .sidebar-profile > div:nth-child(2), .sidebar-profile > svg, .nav-section-label { display: none; }
  .brand-block { grid-template-columns: 42px; justify-content: center; padding-inline: 0; }
  .workspace-pill { display: flex; justify-content: center; padding: 8px; }
  .nav-item { display: flex; justify-content: center; padding: 7px; }
  .nav-item-active::before { left: -13px; }
  .sidebar-profile { display: flex; justify-content: center; padding: 8px 0 0; }
  .library-layout { grid-template-columns: minmax(620px,1fr) 330px; }
  .config-flow { display: none; }
}

@media (max-width: 1050px) {
  .metrics-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .library-layout { grid-template-columns: 1fr; }
  .library-layout > .table-wrap { border-right: 0; border-bottom: 1px solid var(--border); }
  .template-preview { min-height: 430px; }
  .preview-lines { max-width: 700px; }
  .builder-shell { grid-template-columns: 220px minmax(500px,1fr); overflow-x: auto; }
  .page-wrap { padding-inline: 22px; }
  .topbar { padding-inline: 22px; }
  .command-search { width: 220px; }
  .sync-state { display: none; }
  .search-result { grid-template-columns: 42px minmax(220px,1.4fr) minmax(150px,1fr) 110px 18px; }
}

@media (max-width: 820px) {
  .sidebar { width: 264px; padding: 22px 16px 18px; transform: translateX(-102%); transition: 240ms cubic-bezier(.2,.8,.2,1); box-shadow: 25px 0 70px rgba(0,0,0,.45); }
  .sidebar-open { transform: translateX(0); }
  .sidebar-open .brand-copy, .sidebar-open .workspace-pill > div:nth-child(2), .sidebar-open .workspace-pill > svg, .sidebar-open .nav-copy, .sidebar-open .nav-active-dot, .sidebar-open .sidebar-insight, .sidebar-open .sidebar-profile > div:nth-child(2), .sidebar-open .sidebar-profile > svg, .sidebar-open .nav-section-label { display: flex; }
  .sidebar-open .brand-logo { display: block; }
  .sidebar-open .nav-section-label { display: block; }
  .sidebar-open .brand-block { grid-template-columns: 42px minmax(62px, 1fr) 118px; justify-content: flex-start; }
  .sidebar-open .workspace-pill { display: grid; justify-content: initial; }
  .sidebar-open .nav-item { display: grid; justify-content: initial; }
  .sidebar-open .sidebar-profile { display: grid; justify-content: initial; }
  .mobile-close { display: inline-grid !important; margin-left: auto; }
  .sidebar-backdrop { position: fixed; z-index: 55; inset: 0; width: 100%; height: 100%; background: rgba(2,5,7,.72); backdrop-filter: blur(5px); }
  .main-shell { margin-left: 0; }
  .menu-button { display: inline-grid !important; margin-right: 8px; }
  .command-search span { display: none; }
  .command-search { width: auto; }
  .command-search kbd { display: none; }
  .page-heading { align-items: flex-start; }
  .heading-date { display: none; }
  .builder-shell { display: flex; flex-direction: column; overflow: visible; }
  .builder-catalog, .builder-editor { position: static; width: 100%; }
  .catalog-list { max-height: 310px; }
  .equipment-grid { grid-template-columns: 1fr 1fr; }
  .config-overview { align-items: flex-start; }
  .search-result { grid-template-columns: 42px minmax(0,1fr) 110px 18px; }
  .search-result-model { display: none; }
  .search-result-head { align-items: flex-start; flex-direction: column; }
  .search-filters { width: 100%; }
  .search-filters .select-field,
  .search-filters .themed-select { flex: 1; }
}

@media (max-width: 640px) {
  .topbar { height: 58px; padding-inline: 14px; }
  .breadcrumb span, .breadcrumb svg { display: none; }
  .page-wrap { padding: 21px 13px 44px; }
  .page-heading { margin-bottom: 18px; }
  .page-heading h1 { font-size: 25px; }
  .page-heading p { font-size: 11.5px; }
  .metrics-grid, .loading-kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric-card { min-height: 116px; padding: 13px; }
  .metric-card > strong { font-size: 21px; }
  .section-header { min-height: 72px; align-items: flex-start; flex-direction: column; }
  .section-header .primary-button, .section-header .view-switch { width: 100%; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-field, .select-field, .themed-select { width: 100%; min-width: 0; }
  .segmented-control { width: 100%; }
  .segmented-control button { flex: 1; }
  .library-layout { display: flex; flex-direction: column; }
  .template-preview { min-height: 0; }
  .data-table { min-width: 760px; }
  .technician-table { min-width: 820px; }
  .return-table { min-width: 930px; }
  .drawer { width: 100%; }
  .drawer-content { padding: 15px; }
  .profile-contact-grid, .detail-meta-grid { grid-template-columns: 1fr; }
  .drawer-actions { grid-template-columns: 1fr; }
  .danger-zone { align-items: stretch; flex-direction: column; }
  .form-grid, .form-grid-3, .builder-form-grid { grid-template-columns: 1fr; }
  .form-field-span { grid-column: auto; }
  .config-overview-copy p { display: none; }
  .config-tabs { overflow-x: auto; }
  .config-tabs button { min-width: 180px; }
  .builder-editor-head { align-items: stretch; flex-direction: column; }
  .builder-line { grid-template-columns: 14px 25px minmax(0, 1fr) 94px; padding: 9px 7px; }
  .builder-line .price-inline, .builder-line .vat-inline { grid-row: 2; }
  .builder-line .price-inline { grid-column: 3; }
  .builder-line .vat-inline { grid-column: 4; }
  .builder-line .line-total { grid-column: 3 / 5; grid-row: 3; }
  .builder-line .line-controls { grid-column: 3 / 5; grid-row: 4; justify-content: flex-end; }
  .builder-savebar { position: static; align-items: stretch; flex-direction: column; }
  .builder-savebar > div:last-child { flex-direction: column; }
  .builder-savebar button { width: 100%; }
  .equipment-grid { grid-template-columns: 1fr; }
  .responsible-banner { align-items: flex-start; }
  .connection-badge { display: none; }
  .pipeline-board { grid-template-columns: repeat(5, 210px); }
  .quote-detail-hero { align-items: flex-start; flex-direction: column; }
  .quote-detail-hero > div:last-child { align-items: flex-start; }
  .progress-step span { display: none; }
  .detail-totals { width: 100%; min-width: 0; }
  .status-action-box { align-items: stretch; flex-direction: column; }
  .status-action-box .select-field,
  .status-action-box .themed-select { width: 100%; }
  .search-hero { padding-inline: 14px; }
  .mega-search { min-height: 52px; }
  .mega-search input { font-size: 11px; }
  .search-filters { flex-direction: column; }
  .search-result { min-height: 93px; grid-template-columns: 38px minmax(0,1fr) 18px; padding: 10px; }
  .search-result-price { grid-column: 2; align-items: flex-start; }
  .search-result > svg { grid-column: 3; grid-row: 1 / 3; }
  .search-result-icon { width: 36px; height: 36px; }
  .modal-layer { padding: 10px; }
  .modal-card { max-height: calc(100vh - 20px); }
  .toast-stack { right: 12px; bottom: 12px; }
}

@media (max-width: 430px) {
  .metrics-grid, .loading-kpis { grid-template-columns: 1fr; }
  .metric-card { min-height: 110px; }
  .topbar-actions .notification-button { display: none; }
  .config-overview-copy { align-items: flex-start; }
  .config-icon { width: 42px; height: 42px; }
  .preview-meta-grid { grid-template-columns: 1fr 1fr; }
  .danger-zone button { width: 100%; }
}

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