/* Magento 2 Admin–inspired styles — Catalog product demo */
:root {
  --m2-orange: #eb5202;
  --m2-orange-hover: #d24902;
  --m2-sidebar: #303030;
  --m2-sidebar-hover: #3d3d3d;
  --m2-sidebar-active: #252525;
  --m2-header: #ffffff;
  --m2-bg: #f8f8f8;
  --m2-border: #e3e3e3;
  --m2-text: #303030;
  --m2-muted: #666;
  --m2-link: #1979c3;
  --m2-success: #006400;
  --m2-purple: #6b21a8;
  --sidebar-w: 240px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--m2-text);
  background: var(--m2-bg);
  min-height: 100vh;
}

a { color: var(--m2-link); text-decoration: none; }
a:hover { text-decoration: underline; }

.admin-app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--m2-sidebar);
  color: #fff;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  padding: 16px 20px;
  background: #1a1a1a;
  border-bottom: 1px solid #444;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo .mark {
  width: 32px; height: 32px;
  background: var(--m2-orange);
  border-radius: 4px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 12px;
}
.sidebar-logo strong { font-size: 13px; line-height: 1.3; }
.sidebar-logo span { display: block; font-size: 10px; color: #aaa; font-weight: 400; }

.nav-section { padding: 12px 0 4px; }
.nav-section-title {
  padding: 8px 20px 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: #ccc;
  cursor: pointer;
  border-left: 3px solid transparent;
  font-size: 13px;
}
.nav-item:hover { background: var(--m2-sidebar-hover); color: #fff; text-decoration: none; }
.nav-item.active {
  background: var(--m2-sidebar-active);
  color: #fff;
  border-left-color: var(--m2-orange);
}

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--m2-header);
  border-bottom: 1px solid var(--m2-border);
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar h1 { font-size: 18px; font-weight: 600; }
.topbar-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.demo-badge {
  background: #fff3e6;
  color: var(--m2-orange);
  border: 1px solid #ffd6b3;
  padding: 4px 10px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
}

.content { padding: 24px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 3px;
  border: 1px solid transparent;
  cursor: pointer;
  line-height: 1.4;
  font-family: inherit;
}
.btn-primary { background: var(--m2-orange); color: #fff; border-color: var(--m2-orange); }
.btn-primary:hover { background: var(--m2-orange-hover); }
.btn-secondary { background: #fff; color: #333; border-color: #adadad; }
.btn-secondary:hover { background: #f1f1f1; }
.btn-danger { background: #e22626; color: #fff; border-color: #e22626; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled, .btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  color: #666;
  font-size: 16px;
  line-height: 1;
}
.btn-icon:hover { color: var(--m2-orange); }
.btn-icon.danger:hover { color: #e22626; }

.panel {
  background: #fff;
  border: 1px solid var(--m2-border);
  border-radius: 2px;
  margin-bottom: 20px;
}
.panel-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--m2-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafafa;
  gap: 12px;
  flex-wrap: wrap;
}
.panel-header h2 { font-size: 16px; font-weight: 600; }
.panel-body { padding: 20px; }
.panel-body.flush { padding: 0; }

.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data th {
  text-align: left;
  padding: 10px 12px;
  background: #f5f5f5;
  border-bottom: 1px solid var(--m2-border);
  font-weight: 600;
  white-space: nowrap;
}
table.data td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--m2-border);
  vertical-align: middle;
}
table.data tr:hover td { background: #fafafa; }
table.data a.row-link { font-weight: 600; color: var(--m2-link); cursor: pointer; }

.status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}
.status.enabled { background: #e5f2e5; color: var(--m2-success); }
.status.disabled { background: #f5f5f5; color: #999; }

.form-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 14px 16px;
  align-items: start;
  max-width: 860px;
}
.form-grid label {
  padding-top: 8px;
  font-weight: 600;
  font-size: 13px;
}
.form-grid .hint {
  font-size: 12px;
  color: var(--m2-muted);
  font-weight: 400;
  margin-top: 4px;
}
.hint {
  font-size: 12px;
  color: var(--m2-muted);
}
.form-control {
  width: 100%;
  max-width: 420px;
  padding: 7px 10px;
  border: 1px solid #adadad;
  border-radius: 2px;
  font-size: 14px;
  font-family: inherit;
}
.form-control.sm { max-width: 140px; }
.form-control.xs { max-width: 90px; }
.form-control:focus {
  border-color: var(--m2-orange);
  outline: none;
  box-shadow: 0 0 0 1px var(--m2-orange);
}
textarea.form-control { min-height: 90px; max-width: 560px; resize: vertical; }
select.form-control { max-width: 420px; }
.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  font-weight: 400;
}

.fieldset {
  border: 1px solid var(--m2-border);
  margin-bottom: 16px;
  background: #fff;
}
.fieldset > .legend {
  padding: 12px 16px;
  width: 100%;
  background: #f5f5f5;
  border-bottom: 1px solid var(--m2-border);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.fieldset .inner { padding: 16px 20px; }
.fieldset.collapsed .inner { display: none; }

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--m2-border);
  margin-bottom: 0;
  background: #fff;
  padding: 0 8px;
}
.tab {
  padding: 12px 18px;
  cursor: pointer;
  border: 1px solid transparent;
  border-bottom: none;
  margin-bottom: -1px;
  font-weight: 600;
  font-size: 13px;
  color: var(--m2-muted);
  background: transparent;
  font-family: inherit;
}
.tab.active {
  background: #fff;
  color: var(--m2-text);
  border-color: var(--m2-border);
  border-bottom-color: #fff;
}
.tab-panel { display: none; padding: 20px; background: #fff; border: 1px solid var(--m2-border); border-top: none; }
.tab-panel.active { display: block; }

.page-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.toolbar .spacer { flex: 1; }
.search-box {
  padding: 7px 12px;
  border: 1px solid #adadad;
  border-radius: 2px;
  min-width: 220px;
  font-family: inherit;
  font-size: 14px;
}

/* Custom option blocks (screenshot-style) */
.opt-intro {
  color: var(--m2-muted);
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.5;
  max-width: 720px;
}
.opt-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.option-block {
  border: 1px solid var(--m2-border);
  margin-bottom: 14px;
  background: #fff;
  border-radius: 2px;
  transition: border-color 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.option-block.drag-over {
  border-color: var(--m2-orange);
  box-shadow: 0 0 0 2px rgba(235, 82, 2, 0.12);
}
.option-block.is-dragging {
  opacity: 0.55;
}
.option-block-header {
  padding: 10px 14px;
  background: #f8f8f8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--m2-border);
  gap: 10px;
}
.option-block-header .left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.option-block-header h4 {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.option-block-header .drag { color: #999; cursor: grab; font-size: 14px; user-select: none; }
.option-block-body { padding: 16px; }

.opt-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px 16px;
  margin-bottom: 16px;
}
.opt-fields-compact {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  max-width: none;
}
.opt-fields .field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}
.opt-fields .field .form-control { max-width: none; }
.opt-fields .field.check {
  display: flex;
  align-items: flex-end;
  padding-bottom: 8px;
}

.values-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 10px;
}
.values-table th {
  text-align: left;
  padding: 8px 8px;
  background: #f5f5f5;
  border: 1px solid var(--m2-border);
  font-weight: 600;
  font-size: 12px;
}
.values-table td {
  padding: 6px 8px;
  border: 1px solid var(--m2-border);
  vertical-align: middle;
}
.values-table input.form-control,
.values-table select.form-control {
  max-width: none;
  width: 100%;
  padding: 5px 8px;
  font-size: 13px;
}
.values-table .swatch-cell {
  width: 56px;
  position: relative;
  overflow: visible;
}
.values-table .swatch-picker {
  position: relative;
  display: inline-flex;
}
.values-table .swatch-preview {
  width: 28px;
  height: 28px;
  border: 1px solid #ccc;
  border-radius: 2px;
  flex-shrink: 0;
  padding: 0;
  cursor: pointer;
  background: #fff;
  background-repeat: no-repeat;
}
.values-table .swatch-preview.is-empty {
  background:
    linear-gradient(to top right, transparent calc(50% - 1px), #e11d48 calc(50% - 1px), #e11d48 calc(50% + 1px), transparent calc(50% + 1px)),
    #fff;
}
.values-table .swatch-picker input[type="color"],
.values-table .swatch-picker input[type="file"] {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}
.values-table .swatch-menu {
  position: absolute;
  top: 32px;
  left: 0;
  z-index: 40;
  min-width: 140px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  padding: 4px 0;
}
.values-table .swatch-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
  color: #1f2937;
}
.values-table .swatch-menu button:hover {
  background: #f3f4f6;
}
.values-table .drag-cell { width: 28px; text-align: center; color: #999; cursor: grab; }
.values-table .center-cell { text-align: center; }
.values-table th[title] { cursor: help; white-space: nowrap; }

.depends-box {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--m2-border);
}
.depends-box h5 {
  font-size: 13px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dep-row {
  margin-bottom: 12px;
  padding: 12px;
  background: #fafafa;
  border: 1px solid var(--m2-border);
  border-radius: 2px;
}
.dep-main {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.dep-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  flex: 1;
  min-width: 0;
}
.dep-fields .field {
  min-width: 160px;
}
.dep-fields .field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 4px;
}
.dep-field-grow {
  flex: 1;
  min-width: 220px;
}
.dep-del {
  flex-shrink: 0;
  margin-bottom: 1px;
}
.dep-value-map {
  margin-top: 12px;
}
.value-map-table {
  overflow: visible;
}
.value-map-table th,
.value-map-table td {
  vertical-align: top;
  overflow: visible;
}
.value-map-table .map-parent-cell {
  min-width: 260px;
  max-width: 360px;
  position: relative;
  overflow: visible;
}
.value-map-table .map-parent-cell .form-control,
.value-map-table .map-parent-cell .ms-wrap {
  width: 100%;
  max-width: none;
}
.value-map-table .map-parent-cell .ms-dropdown {
  z-index: 50;
}
.map-actions {
  margin-top: 10px;
}
.dep-row .form-control { max-width: none; }

/* Multi-select dependency values */
.ms-wrap { position: relative; }
.ms-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
  text-align: left;
  cursor: pointer;
  background: #fff;
  max-width: none !important;
  height: auto;
  padding: 6px 10px;
}
.ms-trigger:disabled { opacity: 0.55; cursor: not-allowed; }
.ms-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.ms-placeholder { color: #999; font-weight: 400; }
.ms-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #e8e8e8;
  border: 1px solid #ccc;
  border-radius: 2px;
  padding: 2px 6px;
  font-size: 12px;
  font-weight: 600;
  color: #333;
}
.ms-tag-x {
  display: inline-block;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: #666;
  padding: 0 2px;
  user-select: none;
}
.ms-tag-x:hover { color: #e22626; }
.ms-caret { color: #666; flex-shrink: 0; }
.ms-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  z-index: 40;
  background: #fff;
  border: 1px solid #adadad;
  border-radius: 2px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}
.ms-list {
  max-height: 200px;
  overflow-y: auto;
  padding: 6px 0;
}
.ms-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
}
.ms-item:hover { background: #f5f5f5; }
.ms-empty { padding: 12px; color: #999; font-size: 12px; }
.ms-footer {
  border-top: 1px solid var(--m2-border);
  padding: 8px 10px;
  display: flex;
  justify-content: flex-end;
  background: #fafafa;
}

/* Price matrix */
.matrix-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 16px;
}
.matrix-toolbar .field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}
.matrix-table-wrap {
  overflow: auto;
  max-height: 520px;
  border: 1px solid var(--m2-border);
}
table.matrix {
  border-collapse: collapse;
  font-size: 12px;
  min-width: 100%;
}
table.matrix th,
table.matrix td {
  border: 1px solid var(--m2-border);
  padding: 4px;
  text-align: center;
  white-space: nowrap;
}
table.matrix th {
  background: #f5f5f5;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 2;
}
table.matrix th.corner {
  left: 0;
  z-index: 3;
  background: #eee;
}
table.matrix td.row-head {
  background: #fafafa;
  font-weight: 600;
  text-align: left;
  padding: 6px 10px;
  position: sticky;
  left: 0;
  z-index: 1;
}
table.matrix input.cell {
  width: 68px;
  padding: 4px 6px;
  border: 1px solid #ccc;
  border-radius: 2px;
  font-size: 12px;
  text-align: right;
  font-family: inherit;
}
table.matrix input.cell:focus {
  border-color: var(--m2-orange);
  outline: none;
}
table.matrix input.axis {
  width: 90px;
  text-align: left;
  font-weight: 600;
  background: #fff;
  padding: 4px 6px;
  border: 1px solid #ccc;
  border-radius: 2px;
  font-size: 12px;
  font-family: inherit;
}
.matrix-col-head {
  min-width: 100px;
  vertical-align: bottom;
  padding: 8px 6px !important;
}
.matrix-col-title {
  font-weight: 700;
  font-size: 12px;
  line-height: 1.3;
}
.matrix-col-sub {
  font-size: 10px;
  color: var(--m2-muted);
  font-weight: 400;
  margin-top: 2px;
  line-height: 1.2;
}
.matrix-col-code {
  font-size: 9px;
  color: #999;
  margin-top: 1px;
}
.matrix-footer-actions {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--m2-border);
}

/* Design tool canvas grid */
.dt-option-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.dt-grid-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--m2-border);
  background: #fafafa;
}
.dt-toolbar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.dt-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
}
.dt-pager-count {
  font-size: 13px;
  color: var(--m2-muted);
  font-weight: 600;
}
.dt-pager-size {
  font-size: 12px;
  color: var(--m2-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dt-pager-size select {
  padding: 4px 8px;
  border: 1px solid #adadad;
  border-radius: 2px;
  font-family: inherit;
}
.dt-pager-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.dt-grid-table td {
  vertical-align: top;
}
.dt-qty-size {
  min-width: 220px;
  max-width: 360px;
  font-size: 12px;
  word-break: break-word;
}
.dt-size-cell {
  min-width: 200px;
}
.dt-size-part {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--m2-border);
}
.dt-size-part:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.dt-size-main {
  font-weight: 600;
  font-size: 13px;
}
.dt-size-sub {
  font-size: 10px;
  color: var(--m2-muted);
  margin-top: 2px;
}
.dt-upload-cell {
  min-width: 220px;
}
.dt-area-cell {
  min-width: 240px;
  white-space: nowrap;
}
.dt-area-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.dt-area-wrap label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--m2-muted);
}
.dt-area-wrap input.form-control {
  width: 72px;
}
.dt-area-x {
  color: var(--m2-muted);
  font-weight: 700;
}
.dt-actions-cell {
  width: 52px;
  text-align: center;
  vertical-align: middle !important;
}
.dt-add-modal {
  max-width: 560px;
}
.dt-add-field {
  margin-bottom: 14px;
}
.dt-add-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}
.dt-add-field .hint {
  margin: 0 0 6px;
}
.dt-add-preview {
  margin-top: 8px;
  padding: 10px 12px;
  background: #fafafa;
  border: 1px solid var(--m2-border);
  font-size: 13px;
  word-break: break-word;
}
.dt-upload-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dt-file-input {
  font-size: 12px;
  max-width: 100%;
}
.dt-preview {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dt-preview-img {
  max-width: 80px;
  max-height: 48px;
  border: 1px solid var(--m2-border);
  border-radius: 2px;
  object-fit: contain;
}

.lc-product-name {
  margin: 0;
  font-size: 14px;
}
.lc-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px 20px;
}
.lc-image-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}
.lc-image-card {
  width: 160px;
  border: 1px solid var(--m2-border);
  background: #fafafa;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lc-image-card img {
  width: 100%;
  height: 110px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--m2-border);
}
.lc-image-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  font-weight: 600;
}
.lc-add-modal {
  max-width: 560px;
}
.lc-add-list {
  margin-top: 8px;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--m2-border);
  background: #fff;
}
.lc-add-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid var(--m2-border);
  background: #fff;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.lc-add-option:last-child { border-bottom: 0; }
.lc-add-option:hover { background: #f5f5f5; }
.lc-add-option.active {
  background: #fff3e6;
  box-shadow: inset 3px 0 0 var(--m2-orange);
}
.lc-add-option-name {
  font-weight: 600;
  font-size: 13px;
}
.lc-add-selected {
  margin: 10px 0 0;
  font-size: 13px;
}
.lc-actions {
  white-space: nowrap;
}
.lc-actions .btn {
  margin: 0 2px 4px 0;
}
.lc-row-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.lc-row-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border: 1px solid var(--m2-border);
  background: #fff;
}
.lc-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.lc-row-thumb .btn-icon {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  line-height: 16px;
  padding: 0;
  border-radius: 50%;
  font-size: 12px;
}

.empty {
  padding: 40px;
  text-align: center;
  color: var(--m2-muted);
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #333;
  color: #fff;
  padding: 12px 18px;
  border-radius: 3px;
  z-index: 300;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 20px;
  overflow-y: auto;
}
.modal {
  background: #fff;
  width: 100%;
  max-width: 480px;
  border-radius: 2px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}
.modal-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--m2-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 { font-size: 16px; }
.modal-body { padding: 20px; }
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--m2-border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: #fafafa;
}
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: #666; }

.stat-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--m2-muted);
}
.chip {
  background: #f0f0f0;
  padding: 2px 8px;
  border-radius: 2px;
}
.chip-dep {
  background: #fff3e6;
  border: 1px solid #ffd6b3;
}

@media (max-width: 900px) {
  .sidebar { width: 56px; }
  .sidebar-logo strong, .nav-section-title, .nav-item span.label { display: none; }
  .main { margin-left: 56px; }
  .nav-item { justify-content: center; padding: 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .dep-main, .dep-fields { flex-direction: column; }
  .dep-field-grow, .dep-fields .field { min-width: 0; width: 100%; }
}
