:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-muted: #eef2f5;
  --text: #1c232b;
  --muted: #66717f;
  --line: #d9e0e7;
  --primary: #176b5b;
  --primary-dark: #0f4f43;
  --danger: #b42318;
  --warning: #a15c07;
  --success: #157347;
  --shadow: 0 16px 40px rgba(28, 35, 43, 0.08);
}

body[data-page="piece-detail"] [hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

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

a:hover {
  text-decoration: underline;
}

button,
input,
select,
textarea {
  font: inherit;
  max-width: 100%;
}

img,
svg,
canvas {
  max-width: 100%;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 700;
  letter-spacing: 0;
}

.main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

@media (min-width: 1200px) {
  .app-shell > .main:not(.dashboard-main) {
    width: min(1440px, calc(100% - 96px));
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  margin: 0;
  font-size: 24px;
}

.panel-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
}

.panel-body {
  padding: 24px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

.action-card {
  display: block;
  min-height: 128px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.action-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

.action-card span {
  color: var(--muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--primary);
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
}

.button:hover {
  background: var(--primary-dark);
  text-decoration: none;
}

.button-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

.button-secondary:hover {
  background: var(--surface-muted);
}

.button-danger {
  background: var(--danger);
}

.button-danger:hover {
  background: #8f1c13;
}

.button-small {
  min-height: 34px;
  padding: 0 10px;
  font-size: 14px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 100%;
}

.branded-topbar {
  min-height: 72px;
  height: auto;
}

.partner-brand-lockup {
  min-width: 0;
}

.topbar-right-cluster {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-left: auto;
  min-width: 0;
}

.platform-logo-strip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(37, 40, 54, 0.06);
}

.platform-logo-strip img {
  display: block;
  object-fit: contain;
  border-radius: 4px;
  background: #080808;
}

.platform-logo-admin-link {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.platform-logo-merci {
  width: 112px;
  height: 34px;
}

.platform-logo-ferra {
  width: 164px;
  height: 40px;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 20px;
  align-items: start;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.input {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
}

.input:focus {
  outline: 3px solid rgba(23, 107, 91, 0.18);
  border-color: var(--primary);
}

.form-grid {
  display: grid;
  gap: 14px;
}

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

.field span {
  font-weight: 700;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.data-table small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

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

.empty-cell {
  color: var(--muted);
  text-align: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 14px;
}

.workmanship-chip,
.workmanship-panel {
  border: 1px solid #d7e0e3;
  border-left-width: 4px;
  border-radius: 8px;
  background: #f8fafc;
  color: #1f2933;
}

.workmanship-chip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  padding: 9px 10px;
}

.workmanship-chip small,
.workmanship-panel span {
  color: #66717f;
  font-size: 12px;
  font-weight: 800;
}

.workmanship-chip strong {
  color: inherit;
  line-height: 1.18;
}

.workmanship-chip em {
  align-self: center;
  grid-row: 1 / span 2;
  grid-column: 2;
  font-style: normal;
  font-weight: 900;
}

.workmanship-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  padding: 12px;
}

.workmanship-panel strong,
.workmanship-panel span {
  display: block;
}

.workmanship-panel p {
  grid-column: 1 / -1;
  margin: 0;
  color: #475467;
  font-size: 13px;
}

.workmanship-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  min-width: 64px;
  padding: 0 10px;
  border-radius: 999px;
  font-weight: 900;
}

.workmanship-basic {
  border-color: rgba(21, 115, 71, 0.35);
  background: rgba(21, 115, 71, 0.08);
  color: #126a43;
}

.workmanship-easy {
  border-color: rgba(23, 107, 91, 0.35);
  background: rgba(23, 107, 91, 0.08);
  color: #176b5b;
}

.workmanship-medium {
  border-color: rgba(161, 92, 7, 0.38);
  background: rgba(161, 92, 7, 0.10);
  color: #8a4f05;
}

.workmanship-hard {
  border-color: rgba(194, 88, 12, 0.42);
  background: rgba(194, 88, 12, 0.11);
  color: #a84b07;
}

.workmanship-very-hard {
  border-color: rgba(180, 35, 24, 0.42);
  background: rgba(180, 35, 24, 0.10);
  color: #a51d14;
}

.customer-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.customer-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.customer-card.is-selected {
  border-color: rgba(23, 107, 91, 0.34);
  box-shadow: 0 10px 24px rgba(23, 107, 91, 0.08);
}

.customer-inline-jobs {
  display: none;
}

.customer-inline-jobs:not([hidden]) {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.customer-inline-jobs-title {
  font-weight: 800;
  color: var(--text);
}

.customer-card-main h3 {
  margin: 0;
  font-size: 18px;
}

.customer-card-main p {
  margin: 6px 0 0;
  color: var(--text);
  font-weight: 700;
}

.customer-card-main small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.customer-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.customer-workspace {
  margin-top: 20px;
}

.customer-workspace-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(320px, 1.2fr);
  gap: 22px;
  align-items: start;
}

.related-jobs {
  min-height: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.related-jobs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.related-jobs-header h3 {
  margin: 0;
  font-size: 18px;
}

.related-jobs-list {
  display: grid;
  gap: 10px;
}

body[data-page="customers"] .related-jobs {
  display: none;
}

.mini-job-card,
.empty-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.mini-job-card strong,
.mini-job-card span,
.mini-job-card small {
  display: block;
}

.mini-job-card span,
.mini-job-card small,
.muted-text {
  color: var(--muted);
}

.accessory-chip-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.accessory-chip-list .rule-card {
  justify-content: center;
  min-height: 34px;
  padding: 6px 8px;
  gap: 7px;
  font-size: 14px;
  white-space: nowrap;
}

.accessory-chip-list .rule-card input {
  width: 15px;
  height: 15px;
}

.accessory-hole-row {
  display: grid;
  grid-template-columns: 120px repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  grid-column: 1 / -1;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.accessory-hole-row strong {
  align-self: center;
}

.cut-feature-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.cut-feature-list {
  display: grid;
  gap: 10px;
}

.cut-feature-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.cut-feature-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cut-feature-head strong {
  color: var(--text);
}

.custom-piece-context {
  justify-content: center;
}

.custom-piece-context strong {
  display: block;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong, var(--line));
  border-radius: 8px;
  background: rgba(23, 107, 91, 0.06);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.measure-pair {
  display: grid;
  grid-template-columns: minmax(108px, auto) minmax(72px, 1fr) auto minmax(72px, 1fr) auto;
  gap: 8px;
  align-items: center;
  grid-column: 1 / -1;
}

.measure-pair span {
  color: var(--muted);
  font-weight: 700;
}

.measure-pair small {
  color: var(--muted);
}

.measure-pair b {
  color: var(--muted);
}

.reference-check {
  display: block;
  margin-top: 2px;
  color: #176b5b;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.reference-check-row {
  grid-column: 1 / -1;
  margin-top: -2px;
  padding: 4px 8px;
  border: 1px dashed rgba(23, 107, 91, 0.26);
  border-radius: 4px;
  background: rgba(23, 107, 91, 0.06);
}

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

.square-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.square-preview-wrap {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.square-preview-wrap h3 {
  margin: 0 0 4px;
  font-size: 14px;
  letter-spacing: 0;
  color: var(--muted);
  font-weight: 800;
}

.square-preview-card {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: zoom-in;
}

.square-preview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.square-preview-head strong {
  font-size: 13px;
}

.square-preview-head span,
.square-preview-meta {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.square-preview-meta {
  margin-bottom: 6px;
}

.square-preview-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 6px;
}

.square-preview-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border: 1px solid #d7dde6;
  border-radius: 3px;
  background: #fff;
  color: #475467;
  font-size: 10px;
  font-weight: 700;
}

.square-preview-legend i {
  width: 11px;
  height: 7px;
  display: inline-block;
  border: 1px solid currentColor;
}

.square-preview-legend .legend-obstacle {
  background: rgba(245, 158, 11, 0.28);
  color: #b45309;
}

.square-preview-legend .legend-blue {
  background: repeating-linear-gradient(135deg, rgba(33, 150, 243, 0.2), rgba(33, 150, 243, 0.2) 3px, transparent 3px, transparent 6px);
  color: #1d72aa;
}

.square-preview-legend .legend-cut {
  background: transparent;
  color: #111827;
  border-width: 2px;
}

.square-preview-legend .legend-hole {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  color: #b42318;
}

.square-preview svg {
  width: 100%;
  height: auto;
  display: block;
  background:
    linear-gradient(#f1f5f9 1px, transparent 1px),
    linear-gradient(90deg, #f1f5f9 1px, transparent 1px),
    #fffdf8;
  background-size: 18px 18px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
}

.square-preview .stone-shape {
  fill: #f7f5f0;
  stroke: #1f2937;
  stroke-width: 0.75;
  shape-rendering: geometricPrecision;
}

.square-preview .stone-front {
  stroke: #176b5b;
  stroke-width: 1.1;
  shape-rendering: geometricPrecision;
}

.square-preview .stone-cut-sink {
  fill: rgba(33, 150, 243, 0.18);
  stroke: #1d72aa;
  stroke-width: 0.65;
  shape-rendering: crispEdges;
}

.square-preview .stone-cut-hob {
  fill: rgba(33, 150, 243, 0.18);
  stroke: #1d72aa;
  stroke-width: 0.65;
  shape-rendering: crispEdges;
}

.square-preview .stone-hole {
  fill: none;
  stroke: #b42318;
  stroke-width: 0.9;
}

.square-preview .stone-obstacle {
  fill: rgba(245, 158, 11, 0.24);
  stroke: #b45309;
  stroke-width: 0.75;
  stroke-dasharray: 3 2;
  shape-rendering: crispEdges;
}

.square-preview .stone-label-bg {
  fill: rgba(17, 24, 39, 0.92);
  stroke: rgba(255, 255, 255, 0.42);
  stroke-width: 0.12;
  rx: 0;
}

.square-preview .stone-label {
  fill: #fff;
  font-size: 4.2px;
  font-weight: 700;
  letter-spacing: 0;
}

.square-preview .stone-callout {
  stroke: #111827;
  stroke-width: 0.35;
  stroke-dasharray: 1.2 1;
}

.square-preview .stone-dimensions {
  stroke: #64748b;
  stroke-width: 0.38;
  fill: none;
  vector-effect: non-scaling-stroke;
}

.square-preview .stone-dimension-label-bg {
  fill: rgba(255, 253, 248, 0.92);
  stroke: #cbd5e1;
  stroke-width: 0.16;
}

.square-preview .stone-dimension-label {
  fill: #334155;
  stroke: none;
  font-size: 4px;
  font-weight: 700;
}

.preview-modal-card .stone-label {
  font-size: 3.4px;
}

.preview-modal-card .stone-label-bg {
  opacity: 0.86;
}

.preview-modal-open {
  overflow: hidden;
}

.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-rows: auto 1fr;
  background: rgba(17, 24, 39, 0.88);
}

.preview-modal[hidden] {
  display: none;
}

.preview-modal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  color: #fff;
  background: rgba(17, 24, 39, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.preview-modal-bar strong,
.preview-modal-bar span {
  display: block;
}

.preview-modal-bar strong {
  font-size: 15px;
}

.preview-modal-bar span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.preview-modal-close {
  flex: 0 0 auto;
}

.preview-modal-viewer {
  position: relative;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}

.preview-modal-viewer:active {
  cursor: grabbing;
}

.preview-modal-stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(1120px, calc(100vw - 40px));
  transform: translate(0, 0) scale(1);
  transform-origin: center center;
  will-change: transform;
}

.preview-modal-card {
  width: 100%;
  max-width: none;
  padding: 12px;
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  cursor: grab;
}

.preview-modal-card svg {
  max-height: calc(100vh - 140px);
}

@media (max-width: 720px) {
  .preview-modal-bar {
    align-items: flex-start;
    padding: 9px 10px;
  }

  .preview-modal-stage {
    width: calc(100vw - 20px);
  }

  .preview-modal-card {
    padding: 8px;
  }
}

@media (max-width: 720px) {
  .accessory-chip-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .accessory-hole-row {
    grid-template-columns: 1fr;
  }

  .cut-feature-toolbar {
    grid-template-columns: 1fr;
  }

  .cut-feature-head {
    align-items: stretch;
    flex-direction: column;
  }

  .measure-pair {
    grid-template-columns: minmax(84px, auto) minmax(64px, 1fr) auto minmax(64px, 1fr) auto;
  }

  .square-diagonal-grid,
  .square-preview {
    grid-template-columns: 1fr;
  }
}

.message {
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
}

.message-info {
  color: var(--text);
}

.message-success {
  border-color: rgba(21, 115, 71, 0.28);
  background: rgba(21, 115, 71, 0.08);
  color: var(--success);
}

.message-error {
  border-color: rgba(180, 35, 24, 0.28);
  background: rgba(180, 35, 24, 0.08);
  color: var(--danger);
}

@media (max-width: 1023px) {
  .mobile-technical-hidden {
    display: none !important;
  }
}

.technical-mobile-block {
  display: none;
}

.mobile-safe-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.stone-mobile-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.stone-mobile-summary div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.stone-mobile-summary span {
  color: var(--muted);
}

@media (max-width: 1023px) {
  .technical-desktop-content {
    display: none !important;
  }

  .technical-mobile-block {
    display: block;
  }

  body[data-page="workshop-report"] .topbar {
    display: none;
  }
}

@media (max-width: 640px) {
  .stone-mobile-summary {
    grid-template-columns: 1fr;
  }
}

.showroom-layout,
.showroom-section,
.showroom-summary-lines {
  display: grid;
  gap: 16px;
}

.showroom-section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.showroom-section-header,
.showroom-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.showroom-section-header h2 {
  margin: 0;
  font-size: 18px;
}

.showroom-section-header span,
.showroom-info-header span,
.showroom-summary-lines small {
  color: var(--muted);
}

.showroom-picker-section {
  background: #f5f8f7;
}

.showroom-catalog-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: linear-gradient(135deg, #f5fbf8, #ffffff);
}

.showroom-catalog-entry h2 {
  margin: 0;
  font-size: 18px;
}

.showroom-catalog-entry p {
  margin: 4px 0 0;
  color: var(--muted);
}

.showroom-picker-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.75fr) minmax(260px, 1.2fr) minmax(260px, 1.2fr) minmax(150px, 0.65fr);
  gap: 12px;
  align-items: end;
}

.showroom-picker-field {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.showroom-picker-field > span {
  font-weight: 700;
  color: var(--muted);
}

.showroom-picker-button {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.showroom-picker-button:hover {
  border-color: var(--primary);
}

.showroom-picker-field.is-locked {
  opacity: 0.72;
}

.showroom-picker-button:disabled,
.showroom-picker-field select:disabled {
  cursor: not-allowed;
}

.showroom-picker-button strong {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.showroom-picker-placeholder {
  color: var(--muted);
}

.showroom-picker-thumb {
  flex: 0 0 auto;
  display: block;
  border-radius: 5px;
  background: var(--surface-muted);
}

.showroom-picker-stone-thumb {
  width: 64px;
  height: 23px;
  object-fit: cover;
}

.showroom-picker-sink-thumb {
  width: auto;
  height: 28px;
  max-width: 68px;
  object-fit: contain;
}

.showroom-mini-list {
  position: absolute;
  z-index: 60;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 380px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 44px rgba(11, 24, 36, 0.18);
}

.showroom-mini-list[hidden] {
  display: none;
}

.showroom-mini-option {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.showroom-mini-option:hover,
.showroom-mini-option.is-selected {
  border-color: var(--primary);
  background: rgba(23, 107, 91, 0.06);
}

.showroom-mini-option strong,
.showroom-mini-option small,
.showroom-summary-lines strong,
.showroom-summary-lines span,
.showroom-summary-lines small {
  display: block;
}

.showroom-mini-option small {
  color: var(--muted);
  font-size: 12px;
}

.showroom-mini-stone {
  width: 90px;
  height: 32.5px;
  object-fit: cover;
  border-radius: 5px;
  background: var(--surface-muted);
}

.showroom-mini-sink {
  width: auto;
  height: 34px;
  max-width: 90px;
  object-fit: contain;
  justify-self: center;
  border-radius: 5px;
  background: var(--surface-muted);
}

.showroom-mini-empty {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 8px;
  color: var(--muted);
  text-align: center;
}

.showroom-summary {
  display: grid;
  gap: 14px;
}

.showroom-combo-section {
  background: linear-gradient(180deg, #fbfcfb 0%, #eef4f2 100%);
}

.showroom-combo-stage {
  display: grid;
  place-items: center;
}

.showroom-combo-canvas {
  display: grid;
  gap: 12px;
  width: 100%;
  justify-items: center;
}

.showroom-combo-media {
  position: relative;
  width: min(100%, 1800px);
  aspect-ratio: 1800 / 650;
  overflow: hidden;
  border: 1px solid rgba(23, 107, 91, 0.28);
  border-radius: 8px;
  background: #f4f1e8;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.55);
}

.showroom-combo-stone,
.showroom-combo-empty {
  width: 100%;
  height: 100%;
  display: block;
}

.showroom-combo-stone {
  object-fit: cover;
}

.showroom-combo-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  background: repeating-linear-gradient(135deg, #f0eadc 0 14px, #e8dfcd 14px 28px);
}

.showroom-combo-sink {
  position: absolute;
  left: 50%;
  top: 50%;
  height: 76.92%;
  width: auto;
  max-width: 72%;
  transform: translate(-50%, -50%);
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,0.22));
}

.showroom-mount-overlay {
  position: static;
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 6px;
  width: min(100%, 1800px);
  padding: 6px;
  border: 1px solid rgba(23, 107, 91, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(11, 24, 36, 0.14);
}

.showroom-mount-choice {
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.showroom-mount-choice.is-selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.showroom-mount-overlay.is-locked {
  pointer-events: none;
}

.showroom-mount-choice.is-locked {
  cursor: default;
}

.showroom-combo-caption {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  color: var(--muted);
}

.showroom-combo-caption strong {
  color: var(--text);
}

.showroom-info-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(23, 107, 91, 0.28);
  border-radius: 8px;
  background: rgba(23, 107, 91, 0.06);
}

.showroom-info-card[hidden] {
  display: none;
}

.showroom-info-body {
  display: grid;
  gap: 10px;
}

.showroom-info-body strong,
.showroom-info-body span,
.showroom-info-body small {
  display: block;
}

.showroom-info-body small {
  color: var(--muted);
}

@media (max-width: 900px) {
  .showroom-section {
    padding: 12px;
  }

  .showroom-catalog-entry {
    align-items: stretch;
    flex-direction: column;
  }

  .showroom-picker-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .showroom-picker-field > span {
    font-size: 11px;
  }

  .showroom-picker-field .input,
  .showroom-picker-button {
    min-height: 34px;
    height: 34px;
    padding: 6px 8px;
    font-size: 11px;
  }

  .showroom-picker-thumb {
    display: none;
  }

  .showroom-mini-list {
    position: fixed;
    top: 76px;
    left: 8px;
    right: 8px;
    max-height: calc(100vh - 100px);
  }

  .showroom-mini-option {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .showroom-mini-stone {
    width: 82px;
    height: 29.6px;
  }

  .showroom-mini-sink {
    height: 32px;
    max-width: 82px;
  }

  .showroom-mount-overlay {
    overflow-x: auto;
    padding: 5px;
  }

  .showroom-combo-caption {
    font-size: 12px;
  }
}

@media (max-width: 560px) {
  .showroom-picker-grid {
    gap: 6px;
  }

  .showroom-section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .showroom-picker-field .input,
  .showroom-picker-button {
    font-size: 11px;
  }

  .showroom-mount-choice {
    min-height: 30px;
    padding: 5px 7px;
    font-size: 11px;
  }
}

.measure-preview-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(31, 47, 42, 0.12);
  border-radius: 8px;
  background: var(--surface);
}

.measure-preview-list {
  display: grid;
  gap: 12px;
}

.measure-preview-item {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(170px, 0.34fr);
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.measure-preview-canvas {
  min-height: 250px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed rgba(31, 47, 42, 0.22);
  border-radius: 8px;
  background: #ffffff;
}

.measure-preview-shape {
  position: relative;
  width: min(var(--preview-width), 100%);
  height: var(--preview-height);
  min-height: 96px;
  display: grid;
  place-items: center;
  padding: 10px;
  border: 2px solid rgba(23, 107, 91, 0.72);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.24) 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(135deg, transparent 75%, rgba(31, 47, 42, 0.04) 75%) 0 0 / 18px 18px,
    rgba(23, 107, 91, 0.10);
  color: var(--primary-dark);
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.measure-preview-shape.has-risk-hatch::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 4px;
  background: repeating-linear-gradient(
    135deg,
    rgba(180, 35, 24, 0.18) 0 8px,
    rgba(180, 35, 24, 0.02) 8px 16px
  );
  pointer-events: none;
}

.measure-preview-label {
  position: relative;
  z-index: 2;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-weight: 700;
  font-size: 13px;
}

.measure-preview-cut {
  position: absolute;
  z-index: 3;
  min-width: 46px;
  min-height: 30px;
  display: grid;
  place-items: center;
  padding: 4px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
}

.measure-preview-cut-sink {
  border: 2px solid rgba(14, 116, 144, 0.72);
  background:
    repeating-linear-gradient(
      135deg,
      rgba(14, 116, 144, 0.22) 0 6px,
      rgba(14, 116, 144, 0.06) 6px 12px
    ),
    rgba(224, 247, 250, 0.88);
  color: #0e4f62;
}

.measure-preview-cut-hob {
  border: 2px solid rgba(14, 116, 144, 0.72);
  background:
    repeating-linear-gradient(
      135deg,
      rgba(14, 116, 144, 0.20) 0 6px,
      rgba(14, 116, 144, 0.05) 6px 12px
    ),
    rgba(237, 246, 249, 0.92);
  color: #1c232b;
}

.measure-preview-sink-basin {
  position: absolute;
  inset: 18% 18% 22% 18%;
  border: 1px solid rgba(14, 116, 144, 0.72);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.42);
}

.measure-preview-hob-inner {
  width: 82%;
  height: 72%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12%;
  padding: 8%;
  border: 1px solid rgba(31, 47, 42, 0.38);
  border-radius: 6px;
  background: rgba(31, 47, 42, 0.10);
}

.measure-preview-hob-inner i {
  display: block;
  border: 1px solid rgba(31, 47, 42, 0.55);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
}

.measure-preview-cut-label {
  position: relative;
  z-index: 2;
  align-self: end;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
}

.measure-preview-info {
  display: grid;
  gap: 3px;
}

.measure-preview-info strong,
.measure-preview-info span {
  display: block;
}

.measure-preview-info span {
  color: var(--muted);
  font-size: 14px;
}

.measure-preview-info small {
  color: var(--warning);
  font-size: 12px;
}

@media (max-width: 760px) {
  .topbar {
    height: auto;
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .topbar-right-cluster {
    width: 100%;
    justify-content: flex-start;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-left: 0;
  }

  .platform-logo-strip {
    min-height: 38px;
    padding: 5px 7px;
    gap: 8px;
  }

  .platform-logo-merci {
    width: 86px;
    height: 26px;
  }

  .platform-logo-ferra {
    width: 128px;
    height: 31px;
  }

  body[data-page="piece-detail"] .topbar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow-x: visible;
  }

  body[data-page="piece-detail"] .topbar-actions .button {
    width: 100%;
    min-height: 38px;
    padding: 0 10px;
    font-size: 14px;
    white-space: nowrap;
  }

  .main {
    width: min(100% - 24px, 1120px);
    padding: 20px 0;
  }

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

  .two-column {
    grid-template-columns: 1fr;
  }

  .toolbar {
    flex-direction: column;
  }

  .customer-workspace-grid {
    grid-template-columns: 1fr;
  }

  .measure-preview-item {
    grid-template-columns: 1fr;
  }

  .measure-preview-canvas {
    min-height: 180px;
  }

  .measure-preview-shape {
    width: min(var(--preview-width), 94vw);
  }
}

.dashboard-page {
  background:
    radial-gradient(circle at 14% 8%, rgba(194, 126, 62, 0.10), transparent 24%),
    linear-gradient(180deg, #f4efe6 0%, #f7f8f5 42%, #f4f6f4 100%);
}

.dashboard-topbar {
  min-height: 72px;
  height: auto;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-lockup.with-developer {
  flex-wrap: wrap;
  row-gap: 6px;
}

.brand-lockup img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.developer-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.developer-brand img,
.brand-lockup .developer-brand img {
  width: 96px;
  height: 28px;
  object-fit: contain;
  border-radius: 4px;
  background: #080808;
}

.topbar-subtitle {
  color: var(--muted);
  font-size: 14px;
}

.dashboard-main {
  width: min(1360px, calc(100% - 48px));
  padding: 30px 0 40px;
}

.office-ad-rail {
  display: none;
}

.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding: 24px;
  border: 1px solid rgba(23, 107, 91, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 34px rgba(28, 35, 43, 0.07);
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(194, 126, 62, 0.12);
  color: #8a4c15;
  font-weight: 700;
  font-size: 13px;
}

.dashboard-hero h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.12;
}

.dashboard-hero-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0 4px;
}

.dashboard-logout-small {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.dashboard-hero p {
  margin: 0;
  color: var(--muted);
}

.dashboard-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.office-omercim-panel {
  margin-bottom: 22px;
  border-color: rgba(23, 107, 91, 0.2);
  background: rgba(245, 250, 248, 0.92);
}

.office-omercim-panel[hidden] {
  display: none;
}

.office-omercim-panel.is-active {
  box-shadow: 0 14px 34px rgba(23, 107, 91, 0.1);
}

.office-omercim-panel .summary-header {
  align-items: flex-start;
}

.office-omercim-panel .summary-header p {
  margin: 6px 0 0;
  max-width: 720px;
  color: var(--muted);
}

.office-omercim-command {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.office-omercim-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.office-omercim-shortcuts .button {
  min-height: 38px;
  padding: 0 12px;
  font-size: 14px;
}

.office-omercim-reply {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px dashed rgba(23, 107, 91, 0.26);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  color: #39504b;
  font-weight: 700;
}

.office-omercim-reply[data-tone="error"] {
  border-color: rgba(189, 43, 31, 0.34);
  background: rgba(189, 43, 31, 0.08);
  color: #a02018;
}

.omercim-chat {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 3600;
  font-family: inherit;
}

.omercim-chat-launcher {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #176b5b;
  color: #fff;
  font-weight: 900;
  font-size: 14px;
  box-shadow: 0 16px 34px rgba(23, 107, 91, 0.24);
  cursor: pointer;
}

.omercim-chat.is-open .omercim-chat-launcher {
  display: none;
}

.omercim-chat-panel {
  width: min(360px, calc(100vw - 24px));
  max-height: min(560px, calc(100vh - 28px));
  display: grid;
  grid-template-rows: auto minmax(130px, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(23, 107, 91, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 26px 70px rgba(21, 31, 42, 0.22);
}

.omercim-chat-panel[hidden] {
  display: none;
}

.omercim-chat-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(31, 47, 42, 0.1);
  background: linear-gradient(135deg, rgba(245, 250, 248, 0.98), rgba(255, 255, 255, 0.98));
}

.omercim-chat-panel header strong {
  display: block;
  font-size: 15px;
}

.omercim-chat-panel header span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.omercim-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.omercim-chat-panel header button {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(31, 47, 42, 0.14);
  border-radius: 8px;
  background: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.omercim-chat-log {
  min-height: 150px;
  max-height: 330px;
  padding: 10px;
  overflow-y: auto;
  background: #f6f8f7;
}

.omercim-chat-message {
  display: grid;
  gap: 3px;
  margin-bottom: 8px;
}

.omercim-chat-message span {
  color: #64736f;
  font-size: 10px;
  font-weight: 800;
}

.omercim-chat-message p {
  width: fit-content;
  max-width: 92%;
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.32;
  border: 1px solid rgba(31, 47, 42, 0.1);
}

.omercim-chat-message.is-user {
  justify-items: end;
}

.omercim-chat-message.is-user span {
  text-align: right;
}

.omercim-chat-message.is-user p {
  background: #176b5b;
  color: #fff;
  border-color: #176b5b;
}

.omercim-chat-form {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid rgba(31, 47, 42, 0.1);
  background: #fff;
}

.omercim-chat-form textarea {
  width: 100%;
  min-height: 48px;
  resize: vertical;
  border: 1px solid rgba(31, 47, 42, 0.18);
  border-radius: 9px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
}

.omercim-chat-form textarea:focus {
  outline: 2px solid rgba(23, 107, 91, 0.22);
  border-color: #176b5b;
}

.omercim-chat-form > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.omercim-chat.is-listening .omercim-chat-panel header {
  box-shadow: inset 4px 0 0 #176b5b;
}

@media (max-width: 720px) {
  .omercim-chat {
    right: 10px;
    bottom: 10px;
  }

  .omercim-chat-panel {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.36fr);
  gap: 22px;
  align-items: start;
}

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

.dashboard-card {
  position: relative;
  min-height: 148px;
  display: grid;
  align-content: end;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(31, 47, 42, 0.12);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 10px 26px rgba(28, 35, 43, 0.06);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.dashboard-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: rgba(23, 107, 91, 0.34);
  box-shadow: 0 16px 36px rgba(28, 35, 43, 0.10);
}

.dashboard-card strong {
  font-size: 20px;
}

.dashboard-card small {
  color: var(--muted);
  font-size: 14px;
}

.dashboard-card-omercim {
  color: var(--text);
}

.dashboard-card-quick-start {
  border-color: rgba(23, 107, 91, 0.26);
  background: linear-gradient(135deg, rgba(23, 107, 91, 0.08), #ffffff 62%);
}

.dashboard-card-quick-start .card-mark {
  background: var(--primary);
}

.dashboard-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-card-title-row .button {
  min-width: 108px;
  white-space: nowrap;
}

.dashboard-card-passive {
  cursor: default;
}

.dashboard-card-passive strong,
.dashboard-card-passive small {
  opacity: 0.78;
}

.dashboard-card.is-pulsed {
  border-color: rgba(194, 126, 62, 0.55);
}

.card-mark {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 34px;
  height: 5px;
  border-radius: 999px;
  background: var(--primary);
}

.dashboard-card:nth-child(3n) .card-mark,
.dashboard-card:nth-child(4n) .card-mark {
  background: #c27e3e;
}

.dashboard-side {
  display: grid;
  gap: 14px;
  grid-auto-rows: minmax(148px, auto);
}

.summary-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(31, 47, 42, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 26px rgba(28, 35, 43, 0.06);
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.summary-header h2,
.omercim-mini h2 {
  margin: 0;
  font-size: 19px;
}

.summary-header span,
.omercim-mini p {
  color: var(--muted);
}

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

.summary-grid div {
  min-height: 78px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.summary-grid strong {
  font-size: 26px;
  color: var(--primary);
}

.summary-grid span {
  color: var(--muted);
  font-size: 13px;
}

.brand-settings-form {
  display: grid;
  gap: 10px;
}

.brand-settings-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.brand-settings-form .button {
  justify-self: start;
}

.brand-settings-form small {
  color: var(--muted);
  line-height: 1.45;
}

.compact-list {
  display: grid;
  gap: 8px;
}

.compact-item {
  display: grid;
  gap: 2px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
}

.compact-item:hover {
  text-decoration: none;
  border-color: rgba(23, 107, 91, 0.3);
}

.compact-item span {
  color: var(--muted);
  font-size: 13px;
}

.compact-item small {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-recent-panel {
  margin-top: 22px;
}

.dashboard-recent-list {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.omercim-mini p {
  margin: 5px 0 0;
}

.dashboard-showroom-open {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 22px;
  padding: 22px 24px;
  border: 1px solid rgba(23, 107, 91, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 26px rgba(28, 35, 43, 0.06);
}

.dashboard-showroom-open h2 {
  margin: 10px 0 4px;
  font-size: 24px;
}

.dashboard-showroom-open p {
  margin: 0;
  color: var(--muted);
}

@media (min-width: 1200px) {
  .office-ad-rail.has-ads {
    position: fixed;
    top: 96px;
    bottom: 28px;
    z-index: 0;
    display: block;
    width: clamp(88px, 9vw, 160px);
    overflow: hidden;
    border: 1px solid rgba(31, 47, 42, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 10px 26px rgba(28, 35, 43, 0.06);
  }

  .office-ad-left {
    left: 16px;
  }

  .office-ad-right {
    right: 16px;
  }

  .office-ad-rail img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: #ffffff;
  }

  .dashboard-page .dashboard-main {
    position: relative;
    z-index: 1;
    width: min(1088px, calc(100% - 392px));
  }
}

@media (min-width: 1560px) {
  .dashboard-page .dashboard-main {
    width: min(1088px, calc(100% - 420px));
  }
}

@media (max-width: 980px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .omercim-mini {
    grid-column: 1 / -1;
  }

  .dashboard-showroom-open {
    display: none;
  }
}

@media (max-width: 760px) {
  .dashboard-main {
    width: min(100% - 20px, 1360px);
    padding: 18px 0 28px;
  }

  .dashboard-hero {
    align-items: stretch;
    flex-direction: column;
    padding: 18px;
  }

  .dashboard-hero-actions {
    justify-content: stretch;
  }

  .dashboard-hero-actions .button {
    width: 100%;
  }

  .dashboard-hero-title-row {
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
  }

  .dashboard-logout-small {
    min-height: 28px;
    padding: 0 8px;
    font-size: 11px;
  }

  .office-omercim-command {
    grid-template-columns: 1fr 1fr;
  }

  .office-omercim-command .input {
    grid-column: 1 / -1;
  }

  .office-omercim-shortcuts .button {
    flex: 1 1 calc(50% - 8px);
  }

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

  .dashboard-card {
    min-height: 132px;
    padding: 14px;
  }

  .dashboard-card strong {
    font-size: 16px;
  }

  .dashboard-card small {
    font-size: 12px;
  }

  .dashboard-card-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .dashboard-side {
    grid-template-columns: 1fr;
  }

  .summary-panel:not(.omercim-mini) {
    display: none;
  }
}

@media (max-width: 380px) {
  .dashboard-card {
    min-height: 124px;
    padding: 12px;
  }
}

.dxf-review-main {
  width: min(1440px, calc(100% - 48px));
}

.dxf-review-shell {
  overflow: hidden;
}

.dxf-review-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.dxf-review-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.dxf-canvas-card,
.dxf-data-card,
.dxf-info-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.dxf-canvas-card,
.dxf-data-card {
  padding: 18px;
}

.dxf-review-summary-card {
  grid-column: 1 / -1;
}

.dxf-canvas-card,
.dxf-data-card:not(.dxf-review-summary-card) {
  grid-column: 1;
}

.dxf-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.dxf-section-heading h2,
.dxf-data-card h2,
.dxf-info-card h2 {
  margin: 0;
  font-size: 20px;
}

.dxf-section-heading span,
.dxf-export-card p {
  color: var(--muted);
}

.dxf-empty-canvas {
  display: block;
  width: 100%;
  min-height: 360px;
  border: 1px dashed #cbd6df;
  border-radius: 8px;
  background: #f8fafb;
}

.dxf-canvas-list {
  display: grid;
  gap: 14px;
}

.dxf-svg-card {
  display: grid;
  gap: 10px;
}

.dxf-cut-feature {
  pointer-events: none;
}

.dxf-tech-layer {
  pointer-events: none;
}

.dxf-editable {
  cursor: move;
  pointer-events: auto;
}

.dxf-editable > :not(.dxf-edit-handle) {
  pointer-events: none;
}

.dxf-editable.is-selected {
  filter: drop-shadow(0 0 4px rgba(23, 107, 91, 0.32));
}

.dxf-selection-ring {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2;
  stroke-dasharray: 6 4;
  pointer-events: none;
}

.dxf-edit-handle {
  fill: #fff;
  stroke: var(--primary);
  stroke-width: 2;
  pointer-events: auto;
}

.dxf-edit-handle[data-dxf-handle="e"] {
  cursor: ew-resize;
}

.dxf-edit-handle[data-dxf-handle="s"] {
  cursor: ns-resize;
}

.dxf-edit-handle[data-dxf-handle="se"] {
  cursor: nwse-resize;
}

.dxf-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.dxf-summary-grid.is-compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 10px;
}

.dxf-summary-grid div {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.dxf-summary-grid span {
  color: var(--muted);
  font-size: 13px;
}

.dxf-risk-summary {
  display: grid;
  gap: 3px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(23, 107, 91, 0.24);
  border-radius: 8px;
  background: rgba(23, 107, 91, 0.08);
  color: var(--primary-dark);
}

.dxf-risk-summary.risk-warning {
  border-color: rgba(161, 92, 7, 0.32);
  background: rgba(255, 246, 224, 0.88);
  color: var(--warning);
}

.dxf-risk-summary.risk-hard {
  border-color: rgba(180, 35, 24, 0.28);
  background: rgba(255, 235, 232, 0.8);
  color: var(--danger);
}

.dxf-risk-summary small {
  color: inherit;
}

.dxf-sheet-list,
.dxf-production-list,
.dxf-sheet-items,
.dxf-feature-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.dxf-sheet-card,
.dxf-production-card,
.dxf-sheet-item,
.dxf-feature-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.dxf-sheet-head,
.dxf-production-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dxf-sheet-head span,
.dxf-production-head span,
.dxf-sheet-item span,
.dxf-feature-item span,
.dxf-remaining-list span {
  color: var(--muted);
}

.dxf-remaining-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.dxf-remaining-list strong {
  flex-basis: 100%;
}

.dxf-remaining-list span {
  display: inline-flex;
  padding: 6px 9px;
  border: 1px dashed rgba(23, 107, 91, 0.32);
  border-radius: 8px;
  background: rgba(23, 107, 91, 0.06);
}

.dxf-feature-item {
  border-color: rgba(180, 83, 9, 0.28);
  background: rgba(255, 247, 237, 0.72);
}

.dxf-feature-item.is-missing {
  border-color: rgba(180, 35, 24, 0.22);
  background: rgba(255, 235, 232, 0.72);
}

.dxf-tech-list > strong {
  color: var(--primary-dark);
}

.dxf-feature-item em {
  color: var(--muted);
  font-style: normal;
}

.dxf-side-panel {
  display: grid;
  gap: 14px;
  grid-column: 2;
  grid-row: 2 / span 4;
}

.dxf-info-card {
  padding: 16px;
}

.dxf-layer-list,
.dxf-note-list {
  display: grid;
  gap: 9px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.dxf-layer-list li {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.dxf-layer-list li.is-filled {
  border-color: rgba(2, 132, 199, 0.38);
  background: rgba(14, 165, 233, 0.1);
}

[data-diagonal-mode].is-active {
  color: var(--primary-dark);
  font-weight: 700;
}

.dxf-layer-list strong {
  font-size: 13px;
  color: var(--primary-dark);
}

.dxf-layer-list span,
.dxf-note-list li {
  color: var(--muted);
}

.dxf-note-list {
  list-style: disc;
  padding-left: 20px;
}

.dxf-export-card {
  display: grid;
  gap: 10px;
}

.dxf-export-card .button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.dxf-editor-card {
  display: grid;
  gap: 10px;
}

.dxf-selected-title {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid rgba(23, 107, 91, 0.22);
  border-radius: 8px;
  background: rgba(23, 107, 91, 0.07);
}

.dxf-selected-title strong {
  color: var(--primary-dark);
}

.dxf-selected-title span,
.dxf-editor-muted {
  color: var(--muted);
}

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

.dxf-editor-grid label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dxf-editor-grid .input {
  min-height: 40px;
  padding: 8px 10px;
  font-size: 15px;
}

.dxf-editor-risk {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(23, 107, 91, 0.22);
  border-radius: 8px;
  background: rgba(23, 107, 91, 0.07);
  color: var(--primary-dark);
  font-weight: 800;
}

.dxf-editor-risk.is-hard {
  border-color: rgba(180, 35, 24, 0.32);
  background: rgba(255, 235, 232, 0.82);
  color: var(--danger);
}

.dxf-editor-risk ul {
  display: grid;
  gap: 3px;
  margin: 0;
  padding-left: 18px;
  font-weight: 700;
}

.dxf-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dxf-mobile-note,
.dxf-mobile-block {
  display: none;
}

.button.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

@media (max-width: 980px) {
  .dxf-review-main {
    width: min(100% - 24px, 1440px);
  }

  .dxf-review-header,
  .dxf-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .dxf-review-body {
    grid-template-columns: 1fr;
  }

  .dxf-canvas-card,
  .dxf-data-card:not(.dxf-review-summary-card),
  .dxf-side-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .dxf-summary-grid,
  .dxf-summary-grid.is-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dxf-empty-canvas {
    min-height: 300px;
  }
}

@media (max-width: 1023px) {
  .dxf-desktop-only {
    display: none !important;
  }

  .dxf-mobile-note {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid rgba(161, 92, 7, 0.25);
    border-radius: 8px;
    background: rgba(255, 246, 224, 0.88);
    color: var(--warning);
    font-weight: 700;
  }

  body[data-page="dxf-review"] .dxf-review-shell {
    display: none;
  }

  body[data-page="dxf-review"] .dxf-mobile-block {
    display: block;
  }
}

@media (min-width: 1024px) {
  .dxf-desktop-only {
    display: inline-flex;
  }
}

@media (max-width: 640px) {
  .dxf-canvas-card,
  .dxf-info-card {
    padding: 12px;
  }

  .dxf-layer-list li {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .dxf-summary-grid,
  .dxf-summary-grid.is-compact {
    grid-template-columns: 1fr;
  }
}

.stone-layout-main {
  width: min(1440px, calc(100% - 48px));
}

.stone-layout-shell {
  overflow: visible;
}

.stone-layout-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.stone-layout-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.stone-layout-body > .message {
  grid-column: 1 / -1;
}

.stone-top-summary {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stone-top-summary div {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid rgba(23, 107, 91, 0.18);
  border-radius: 8px;
  background: #f3faf7;
}

.stone-top-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stone-top-summary strong {
  color: #0f6b57;
  font-size: 20px;
}

.stone-layout-body > .message[data-status] {
  position: fixed;
  top: 84px;
  right: 16px;
  z-index: 1400;
  width: min(360px, calc(100vw - 32px));
  margin: 0;
  box-shadow: 0 18px 45px rgba(18, 32, 43, 0.18);
  pointer-events: none;
}

.stone-layout-body > .message[data-status][hidden] {
  display: none !important;
  height: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.stone-layout-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.stone-layout-card h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

.stone-settings-card,
.stone-job-card,
.stone-production-card,
.stone-selected-card {
  grid-column: 1 / -1;
}

.stone-save-row {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin: -6px 0 14px;
}

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

.stone-settings-grid .field {
  display: grid;
  gap: 6px;
}

.stone-settings-grid small {
  color: var(--muted);
}

.stone-job-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.stone-job-summary div,
.stone-piece-metrics div {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.stone-job-summary span,
.stone-piece-metrics span {
  color: var(--muted);
  font-size: 13px;
}

.stone-piece-list {
  display: grid;
  gap: 12px;
}

.stone-piece-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.stone-piece-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.stone-piece-head div {
  display: grid;
  gap: 2px;
}

.stone-piece-head span {
  color: var(--muted);
}

.stone-piece-metrics {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr 0.9fr;
  gap: 10px;
}

.stone-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stone-tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stone-tag.is-on {
  border-color: rgba(23, 107, 91, 0.28);
  background: rgba(23, 107, 91, 0.08);
  color: var(--primary-dark);
}

.stone-tag.is-estimated {
  border-color: rgba(161, 92, 7, 0.28);
  background: rgba(255, 246, 224, 0.88);
  color: var(--warning);
}

.stone-tag.is-warning {
  border-color: rgba(180, 35, 24, 0.22);
  background: rgba(255, 235, 232, 0.72);
  color: var(--danger);
}

.stone-preview-card {
  grid-column: 1 / -1;
  position: relative;
  margin-top: 24px;
}

.stone-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.stone-section-heading h2 {
  margin: 0;
}

.stone-section-heading span {
  color: var(--muted);
}

.stone-empty-canvas {
  display: block;
  width: 100%;
  min-height: 360px;
  border: 1px dashed #cbd6df;
  border-radius: 8px;
  background: #f8fafb;
}

.stone-slab-preview {
  display: grid;
  gap: 14px;
}

.stone-slab-card {
  display: grid;
  gap: 8px;
}

.stone-slab-card.has-floating-controls {
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: start;
  gap: 14px;
}

.stone-slab-card.has-floating-controls .stone-slab-title {
  grid-column: 1 / -1;
}

.stone-slab-card.has-floating-controls .stone-empty-canvas {
  grid-column: 1;
}

.stone-layout-item {
  cursor: grab;
  outline: none;
  touch-action: none;
  user-select: none;
}

.stone-layout-item:hover .stone-item-outer,
.stone-layout-item:focus .stone-item-outer {
  stroke: #176b5b;
  stroke-width: 2.5px;
}

.stone-layout-item.is-dragging {
  cursor: grabbing;
}

.stone-layout-item.is-dragging .stone-item-outer {
  stroke: #b42318;
  stroke-width: 2.5px;
}

.stone-cut-feature {
  pointer-events: none;
}

.stone-slab-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.stone-slab-title strong {
  color: var(--text);
}

.stone-layout-warning {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(161, 92, 7, 0.28);
  border-radius: 8px;
  background: rgba(255, 246, 224, 0.88);
  color: var(--warning);
  font-weight: 700;
}

.stone-layout-warning.is-hard {
  border-color: rgba(180, 35, 24, 0.32);
  background: rgba(180, 35, 24, 0.08);
  color: var(--danger);
}

.stone-leftover-list {
  display: grid;
  gap: 8px;
}

.stone-leftover-item {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px dashed rgba(23, 107, 91, 0.32);
  border-radius: 8px;
  background: rgba(23, 107, 91, 0.06);
}

.stone-leftover-item span {
  color: var(--muted);
}

.stone-selected-detail {
  display: grid;
  grid-template-columns: minmax(220px, 0.34fr) minmax(460px, 0.66fr);
  align-items: end;
  gap: 10px 12px;
}

.stone-selected-list {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.stone-selected-list div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.stone-selected-list dt {
  color: var(--muted);
}

.stone-selected-list dd {
  margin: 0;
  font-weight: 700;
}

.stone-position-grid,
.stone-nudge-grid {
  display: grid;
  gap: 8px;
}

.stone-position-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stone-nudge-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stone-nudge-grid .button {
  min-height: 40px;
  padding-inline: 10px;
}

.stone-selected-card {
  align-self: start;
  position: sticky;
  top: 0;
  z-index: 60;
  width: 100%;
  max-height: none;
  overflow: visible;
  border-color: rgba(23, 107, 91, 0.26);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 14px 36px rgba(18, 32, 43, 0.14);
}

.stone-selected-card h2 {
  margin-bottom: 10px;
  font-size: 18px;
}

.stone-selected-card .stone-layout-warning {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.stone-selected-card[hidden] {
  display: none !important;
}

.stone-side-panel .stone-selected-card {
  display: none !important;
}

.stone-side-panel {
  display: grid;
  gap: 14px;
  grid-column: 1 / -1;
  grid-row: auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.stone-summary-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.stone-summary-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.stone-summary-list dt {
  color: var(--muted);
}

.stone-summary-list dd {
  margin: 0;
  font-weight: 700;
}

.stone-note-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

@media (max-width: 980px) {
  .stone-layout-main {
    width: min(100% - 24px, 1440px);
  }

  .stone-layout-header,
  .stone-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .stone-layout-body {
    grid-template-columns: 1fr;
  }

  .stone-preview-card,
  .stone-side-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .stone-settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stone-job-summary,
  .stone-piece-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stone-empty-canvas {
    min-height: 300px;
  }

  .stone-selected-card {
    display: none !important;
  }

  .stone-layout-item {
    cursor: pointer;
    touch-action: auto;
  }
}

@media (max-width: 640px) {
  .stone-layout-card {
    padding: 12px;
  }

  .stone-settings-grid {
    grid-template-columns: 1fr;
  }

  .stone-job-summary,
  .stone-piece-metrics {
    grid-template-columns: 1fr;
  }
}

.admin-main {
  width: min(1480px, calc(100% - 48px));
}

.admin-hero-actions,
.admin-filter-row,
.admin-action-row,
.admin-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 16px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.admin-tab {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.admin-tab.is-active {
  border-color: rgba(23, 107, 91, 0.35);
  background: var(--primary);
  color: #ffffff;
}

.admin-section {
  display: none;
}

.admin-section.is-active {
  display: grid;
  gap: 16px;
}

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

.admin-stat-grid > div,
.admin-detail-card,
.admin-slot-card,
.admin-mini-card {
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.compact-item.admin-media-item {
  grid-template-columns: 32px 72px minmax(0, 1fr) auto;
  align-items: center;
}

.admin-product-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
}

.admin-product-select input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.admin-thumb {
  display: block;
  width: 64px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: contain;
  object-position: center;
  background: #f4f7f8;
}

.admin-empty-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px;
  border: 1px dashed rgba(95, 111, 128, 0.35);
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.admin-chip-row span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(23, 107, 91, 0.16);
  border-radius: 999px;
  background: rgba(23, 107, 91, 0.07);
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
}

.admin-marketplace-tools {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) minmax(140px, 0.8fr) minmax(140px, 0.8fr) minmax(110px, 0.5fr);
  gap: 8px;
  margin: 12px 0 10px;
}

.admin-marketplace-bulk {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto minmax(90px, 120px) auto auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247, 250, 249, 0.88);
}

.admin-marketplace-bulk [data-admin-marketplace-selected] {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.admin-marketplace-bulk .admin-check {
  grid-column: auto;
}

.admin-stat-grid span,
.admin-detail-card span,
.admin-slot-card span,
.admin-mini-card span {
  color: var(--muted);
  font-size: 13px;
}

.admin-stat-grid strong {
  font-size: 30px;
  color: var(--primary);
}

.admin-two-col {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 0.65fr);
  gap: 16px;
  align-items: start;
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  flex-wrap: wrap;
}

.admin-toolbar h2,
.admin-toolbar p {
  margin: 0;
}

.admin-toolbar p,
.admin-note {
  color: var(--muted);
}

.admin-search {
  display: flex;
  gap: 8px;
  min-width: min(560px, 100%);
}

.admin-search .input {
  min-width: 260px;
}

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

.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.admin-table th {
  text-align: left;
  padding: 0 10px 4px;
  color: var(--muted);
  font-size: 13px;
}

.admin-table td {
  padding: 12px 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  vertical-align: middle;
}

.admin-table td:first-child {
  border-left: 1px solid var(--line);
  border-radius: 8px 0 0 8px;
}

.admin-table td:last-child {
  border-right: 1px solid var(--line);
  border-radius: 0 8px 8px 0;
}

.admin-table small,
.admin-link-row a,
.admin-link-row button {
  display: inline-flex;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.admin-link-row button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
}

.admin-link-row button.admin-link-danger {
  color: var(--danger);
}

.admin-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(23, 107, 91, 0.22);
  background: rgba(23, 107, 91, 0.08);
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.admin-pill-pending {
  border-color: rgba(194, 126, 62, 0.32);
  background: rgba(194, 126, 62, 0.12);
  color: #8a4c15;
}

.admin-pill-suspended,
.admin-pill-passive,
.admin-pill-danger {
  border-color: rgba(190, 38, 25, 0.25);
  background: rgba(190, 38, 25, 0.10);
  color: #a52218;
}

.admin-detail-grid,
.admin-card-grid,
.admin-slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.admin-slot-card {
  align-content: start;
}

.admin-slot-drop {
  border-style: dashed;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.admin-slot-drop:hover,
.admin-slot-drop.is-dragging {
  border-color: rgba(23, 107, 91, 0.55);
  box-shadow: 0 12px 28px rgba(18, 32, 43, 0.08);
  transform: translateY(-1px);
}

.admin-slot-card em {
  color: var(--primary);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.admin-slot-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-slot-thumb-wrap {
  position: relative;
  display: inline-flex;
}

.admin-slot-thumb-wrap button {
  position: absolute;
  right: 3px;
  bottom: 3px;
  min-height: 18px;
  padding: 0 5px;
  border: 1px solid rgba(190, 38, 25, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--danger);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.admin-slot-thumbs .admin-thumb {
  width: 54px;
  height: 40px;
}

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

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

.admin-form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.admin-form-wide,
.admin-check {
  grid-column: 1 / -1;
}

.admin-dropzone {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 16px;
  border: 1px dashed rgba(23, 107, 91, 0.38);
  border-radius: 8px;
  background: rgba(23, 107, 91, 0.05);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.admin-dropzone:hover,
.admin-dropzone.is-dragging {
  border-color: var(--primary);
  background: rgba(23, 107, 91, 0.10);
  box-shadow: 0 12px 28px rgba(18, 32, 43, 0.08);
}

.admin-dropzone.is-uploading {
  opacity: 0.72;
}

.admin-dropzone strong {
  font-size: 15px;
}

.admin-dropzone span {
  color: var(--muted);
  font-size: 13px;
}

.admin-dropzone img {
  width: min(220px, 100%);
  max-height: 120px;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
  background: #ffffff;
}

.admin-check {
  display: flex !important;
  align-items: center;
  gap: 8px;
  min-height: 42px;
}

.admin-scroll-list {
  max-height: 560px;
  overflow-y: auto;
  padding-right: 4px;
}

.admin-lookup-results {
  display: grid;
  gap: 12px;
}

.admin-result-block {
  display: grid;
  gap: 8px;
}

.admin-result-block h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-result-block h3 span {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1023px) {
  .admin-main {
    width: min(100% - 20px, 720px);
  }

  .admin-stat-grid,
  .admin-two-col,
  .admin-columns,
  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .compact-item.admin-media-item {
    grid-template-columns: 28px 56px minmax(0, 1fr);
  }

  .compact-item.admin-media-item .admin-link-row {
    grid-column: 1 / -1;
  }

  .admin-marketplace-tools,
  .admin-marketplace-bulk {
    grid-template-columns: 1fr;
  }

  .admin-thumb {
    width: 52px;
    height: 42px;
  }

  .admin-search {
    width: 100%;
    flex-direction: column;
  }

  .admin-search .input {
    min-width: 0;
  }
}

@media (min-width: 1024px) {
  body {
    font-size: 14px;
  }

  .topbar {
    min-height: 56px;
    height: auto;
    gap: 12px;
    padding: 8px 18px;
  }

  .main {
    padding: 22px 0;
  }

  .panel-header {
    padding: 14px 18px;
  }

  .panel-title {
    font-size: 21px;
  }

  .panel-body {
    padding: 18px;
  }

  .grid,
  .form-grid {
    gap: 12px;
  }

  .button {
    min-height: 36px;
    padding: 0 12px;
    font-size: 14px;
  }

  .button-small {
    min-height: 30px;
    padding: 0 9px;
    font-size: 12px;
  }

  .input {
    min-height: 36px;
    padding: 7px 9px;
  }

  .field {
    gap: 4px;
  }

  .form-actions,
  .toolbar,
  .topbar-actions {
    gap: 8px;
  }

  .data-table th,
  .data-table td {
    padding: 9px 8px;
  }

  .action-card {
    min-height: 104px;
    padding: 14px;
  }

  .action-card strong {
    font-size: 16px;
  }

  .dashboard-topbar {
    min-height: 56px;
  }

  .brand-lockup img {
    width: 34px;
    height: 34px;
  }

  .developer-brand {
    padding-left: 9px;
  }

  .developer-brand span {
    display: none;
  }

  .developer-brand img,
  .brand-lockup .developer-brand img {
    width: 76px;
    height: 22px;
  }

  .dashboard-main {
    width: min(1280px, calc(100% - 40px));
    padding: 22px 0 30px;
  }

  .dashboard-hero {
    gap: 14px;
    margin-bottom: 16px;
    padding: 18px;
  }

  .dashboard-hero-title-row {
    margin: 8px 0 3px;
  }

  .dashboard-hero h1 {
    font-size: clamp(24px, 2.4vw, 34px);
  }

  .section-kicker {
    min-height: 24px;
    padding: 0 9px;
    font-size: 12px;
  }

  .dashboard-card {
    min-height: 118px;
    padding: 14px;
  }

  .dashboard-card strong,
  .dashboard-showroom-open h2 {
    font-size: 18px;
  }

  .dashboard-showroom-open {
    margin-top: 16px;
    padding: 16px 18px;
  }

  .office-omercim-panel {
    margin-bottom: 16px;
  }

  .office-omercim-command {
    gap: 8px;
    margin-top: 10px;
  }

  .office-omercim-shortcuts {
    gap: 7px;
    margin-top: 10px;
  }

  .office-omercim-shortcuts .button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 13px;
  }

  .office-omercim-reply {
    margin-top: 10px;
    padding: 10px 12px;
  }

  .omercim-chat-launcher {
    min-height: 40px;
    padding: 0 14px;
    font-size: 14px;
  }

  .omercim-chat-panel {
    width: min(360px, calc(100vw - 28px));
    max-height: min(560px, calc(100vh - 34px));
  }

  .omercim-chat-panel header {
    padding: 10px 12px;
  }

  .omercim-chat-panel header strong {
    font-size: 15px;
  }

  .omercim-chat-form textarea {
    min-height: 48px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .topbar {
    height: auto;
    min-height: 56px;
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 10px 12px;
  }

  .topbar-actions,
  .form-actions,
  .toolbar,
  .admin-filter-row,
  .admin-action-row,
  .admin-link-row {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 8px;
  }

  .topbar-actions .button,
  .form-actions .button,
  .toolbar .button,
  .admin-filter-row .button,
  .admin-action-row .button,
  .admin-link-row .button {
    width: 100%;
    min-height: 38px;
    padding: 0 10px;
    font-size: 13px;
    white-space: normal;
  }

  .main,
  .dashboard-main,
  .admin-main,
  .stone-layout-main {
    width: min(100% - 20px, 100%);
    padding: 14px 0 24px;
  }

  .panel-header,
  .panel-body,
  .summary-panel,
  .dashboard-card,
  .showroom-section {
    padding: 14px;
  }

  .panel-title,
  .dashboard-hero h1 {
    font-size: 24px;
    line-height: 1.12;
    overflow-wrap: anywhere;
  }

  .panel-subtitle,
  .topbar-subtitle,
  .muted-text {
    font-size: 13px;
  }

  .customer-card-grid,
  .dashboard-grid,
  .dashboard-menu,
  .admin-stat-grid,
  .admin-two-col,
  .customer-workspace-grid,
  .form-grid,
  .showroom-picker-grid {
    grid-template-columns: 1fr !important;
  }

  .customer-card,
  .mini-job-card,
  .dashboard-card,
  .summary-panel {
    min-width: 0;
  }

  body[data-page="office"] .dashboard-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
  }

  body[data-page="office"] .dashboard-card {
    min-height: 92px;
    align-content: center;
    gap: 5px;
    padding: 12px 10px;
  }

  body[data-page="office"] .dashboard-card .card-mark {
    top: 9px;
    left: 10px;
    width: 24px;
    height: 4px;
  }

  body[data-page="office"] .dashboard-card strong {
    font-size: 14px;
    line-height: 1.12;
  }

  body[data-page="office"] .dashboard-card small {
    display: -webkit-box;
    min-height: 28px;
    overflow: hidden;
    font-size: 10.5px;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .customer-card-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .customer-card-actions .button,
  .customer-card-actions a {
    width: 100%;
    text-align: center;
  }

  .admin-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px;
  }

  .admin-tab {
    min-height: 38px;
    padding: 0 8px;
    font-size: 13px;
  }

  .admin-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .omercim-chat-panel {
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
    max-height: min(560px, calc(100vh - 20px));
  }

  .omercim-chat-launcher {
    right: 10px;
    bottom: 10px;
  }
}
