/* Brand colors: #f5821f (orange), #f3f3f3 (light gray), #ffffff (white) */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: #333;
}

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

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #ffffff;
  padding: 1.5rem 0;
  box-shadow: 1px 0 0 rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  display: block;
  padding: 0 1.5rem 1.5rem;
  border-bottom: 1px solid #f3f3f3;
  margin-bottom: 1rem;
}

.sidebar-logo img {
  display: block;
  max-width: 100%;
  height: auto;
}

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-nav a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: #333;
  text-decoration: none;
  font-weight: 500;
}

.sidebar-nav a:hover {
  background: #f3f3f3;
}

.sidebar-nav a.active {
  background: #f5821f;
  color: #ffffff;
}

.sidebar-user {
  margin-top: auto;
  padding: 1rem 1.5rem;
  border-top: 1px solid #f3f3f3;
}

.sidebar-user-email {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  color: #666;
  word-break: break-all;
}

.sidebar-logout-form {
  margin: 0;
}

.sidebar-logout-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: #f5821f;
  cursor: pointer;
  text-decoration: underline;
}

.sidebar-logout-btn:hover {
  color: #e07318;
}

.main {
  flex: 1;
  background: #f3f3f3;
  padding: 2rem;
  min-width: 0;
}

.page-title {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}

.template-card {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.template-card-image {
  aspect-ratio: 1;
  background: #f3f3f3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 0.875rem;
}

.template-card-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.template-card-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
}

.template-card-actions {
  display: flex;
  gap: 0.5rem;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.15s, color 0.15s;
}

.btn-primary {
  background: #f5821f;
  color: #ffffff;
  border-color: #f5821f;
  flex: 1;
}

.btn-primary:hover {
  background: #e07318;
  border-color: #e07318;
  color: #ffffff;
}

.btn-secondary {
  background: #ffffff;
  color: #f5821f;
  border-color: #f5821f;
  flex: 1;
}

.btn-secondary:hover {
  background: #fff8f3;
  color: #e07318;
  border-color: #e07318;
}

/* Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.drawer-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: #ffffff;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
  z-index: 101;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

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

.drawer-header {
  background: #f5821f;
  color: #ffffff;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.drawer-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.drawer-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
  margin: -0.25rem 0 -0.25rem 0.5rem;
}

.drawer-close:hover {
  opacity: 0.9;
}

.drawer-body {
  padding: 1.25rem;
  flex: 1;
}

.drawer-image {
  background: #f3f3f3;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
  min-height: 180px;
  overflow: hidden;
}

.drawer-specs {
  margin: 0;
  font-size: 0.9375rem;
}

.drawer-specs dt {
  font-weight: 600;
  color: #333;
  margin-top: 0.75rem;
}

.drawer-specs dt:first-child {
  margin-top: 0;
}

.drawer-specs dd {
  margin: 0.25rem 0 0;
  color: #555;
}

.drawer-winding-icon {
  display: inline-block;
  margin-right: 0.25rem;
}

.drawer-actions {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-shrink: 0;
  border-top: 1px solid #f3f3f3;
}

.drawer-actions .btn {
  width: 100%;
}

.drawer-pdf-link {
  color: #0066cc;
  text-decoration: underline;
  font-size: 0.875rem;
  text-align: center;
}

.drawer-pdf-link:hover {
  color: #004499;
}

/* Login / landing page */
.login-page {
  min-height: 100vh;
  background: #f3f3f3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-main {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.login-card {
  width: 100%;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  padding: 2rem;
}

.login-card-logo {
  display: block;
  height: auto;
  max-width: 180px;
  margin: 0 auto 1.5rem;
}

.login-title {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
}

.login-lead {
  margin: 0 0 1.5rem;
  font-size: 0.9375rem;
  color: #555;
}

.login-errors {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-size: 0.875rem;
  color: #b91c1c;
}

.login-errors li {
  margin: 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.login-page .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.login-page label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #333;
}

.login-page input[type="email"],
.login-page input[type="password"] {
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #333;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  transition: border-color 0.15s;
}

.login-page input[type="email"]:focus,
.login-page input[type="password"]:focus {
  outline: none;
  border-color: #f5821f;
  box-shadow: 0 0 0 3px rgba(245, 130, 31, 0.2);
}

.login-page input[type="email"]::placeholder,
.login-page input[type="password"]::placeholder {
  color: #9ca3af;
}

.login-page .field-error {
  font-size: 0.8125rem;
  color: #b91c1c;
}

.login-submit {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  margin-top: 0.25rem;
}

/* Dashboard (synced data) */
.dashboard-notice {
  background: #fff8f0;
  border: 1px solid #f5821f;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  max-width: 40rem;
}

.dashboard-notice--info {
  background: #f0f7ff;
  border-color: #93c5fd;
}

.dashboard-summary {
  background: #ffffff;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.dashboard-section-title {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #333;
}

.dashboard-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1.25rem;
  margin: 0 0 1rem;
  font-size: 0.875rem;
}

.dashboard-dl dt {
  margin: 0;
  color: #666;
  font-weight: 500;
}

.dashboard-dl dd {
  margin: 0;
  color: #333;
}

.dashboard-error-preview {
  color: #b91c1c;
  word-break: break-word;
}

.dashboard-orders {
  margin-bottom: 2rem;
}

.dashboard-table-wrap {
  overflow-x: auto;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.dashboard-table th,
.dashboard-table td {
  text-align: left;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #f3f3f3;
}

.dashboard-table th {
  font-weight: 600;
  color: #555;
  background: #fafafa;
}

.dashboard-table tbody tr:last-child td {
  border-bottom: none;
}

.dashboard-product-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.dashboard-product-meta {
  margin: 0;
  font-size: 0.75rem;
  color: #666;
}

.dashboard-products .template-card {
  cursor: default;
}

/* Product cards (My Products page) */
#product-grid .template-card-image {
  min-width: 0;
  min-height: 0;
}

#product-grid .product-card-img {
  min-width: 0;
  min-height: 0;
}

#product-grid .product-card-img:not(.product-card-img--revealed) {
  opacity: 0;
  transform: translateY(10px);
}

#product-grid .product-card-img--revealed {
  opacity: 1;
  transform: none;
  transition: opacity 0.18s ease-out, transform 0.18s ease-out;
}

.product-card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (prefers-reduced-motion: reduce) {
  #product-grid .product-card-img:not(.product-card-img--revealed) {
    opacity: 0;
    transform: none;
  }

  #product-grid .product-card-img--revealed {
    opacity: 1;
    transition: none;
  }
}

.product-card-placeholder {
  font-size: 0.8125rem;
  color: #aaa;
}

.product-card-meta {
  margin: 0;
  font-size: 0.75rem;
  color: #888;
  background: #f9f9f9;
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
}

.drawer-product-img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
}

.drawer-product-thumb-btn {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: zoom-in;
  font: inherit;
  color: inherit;
  text-align: center;
}

.drawer-product-thumb-btn:focus {
  outline: none;
}

.drawer-product-thumb-btn:focus-visible {
  outline: 2px solid #f5821f;
  outline-offset: 2px;
}

.product-image-viewer {
  position: relative;
  margin: 0;
  padding: 0;
  border: none;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  background: transparent;
  overflow: hidden;
  box-sizing: border-box;
}

.product-image-viewer::backdrop {
  background: rgba(0, 0, 0, 0.82);
}

.product-image-viewer-scrim {
  position: absolute;
  inset: 0;
  z-index: 0;
  cursor: pointer;
}

.product-image-viewer-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 100%;
  box-sizing: border-box;
  padding: 2.75rem 1rem 1.5rem;
  pointer-events: none;
}

.product-image-viewer-img {
  max-width: 90vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  pointer-events: auto;
}

.product-image-viewer-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  margin: 0;
  padding: 0.35rem 0.65rem;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.product-image-viewer-close:hover {
  background: #ffffff;
}

.product-image-viewer-close:focus {
  outline: none;
}

.product-image-viewer-close:focus-visible {
  outline: 2px solid #f5821f;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .product-image-viewer-close {
    box-shadow: none;
  }
}

/* My Products search & sort toolbar */
.my-products-catalog {
  margin-bottom: 0.5rem;
}

.my-products-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.5rem;
  margin-bottom: 1.25rem;
}

.my-products-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 0.35rem;
}

.my-products-search-field {
  flex: 1 1 220px;
  min-width: 0;
  max-width: 28rem;
}

.my-products-search-inner {
  position: relative;
}

.my-products-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9375rem;
}

.my-products-search-input:focus {
  outline: none;
  border-color: #f5821f;
  box-shadow: 0 0 0 2px rgba(245, 130, 31, 0.25);
}

.my-products-search-input:focus-visible {
  outline: 2px solid #f5821f;
  outline-offset: 2px;
}

.my-products-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 20;
  margin: 0.2rem 0 0;
  padding: 0.25rem 0;
  list-style: none;
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  max-height: 14rem;
  overflow-y: auto;
}

.my-products-suggestion-item {
  padding: 0.45rem 0.75rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.my-products-suggestion-item:hover,
.my-products-suggestion-item.is-active {
  background: #f3f3f3;
}

.my-products-sort-field {
  flex: 0 1 auto;
}

.my-products-sort-select {
  min-width: 14rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.875rem;
  background: #ffffff;
}

.my-products-sort-select:focus-visible {
  outline: 2px solid #f5821f;
  outline-offset: 2px;
}

.my-products-card-fields {
  flex: 0 1 100%;
  min-width: 0;
}

.my-products-card-fields-summary {
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  color: #333;
  list-style: none;
}

.my-products-card-fields-summary::-webkit-details-marker {
  display: none;
}

.my-products-card-fields-summary::before {
  content: "";
  display: inline-block;
  width: 0.35rem;
  height: 0.35rem;
  margin-right: 0.35rem;
  border-right: 2px solid #666;
  border-bottom: 2px solid #666;
  transform: rotate(-45deg);
  vertical-align: 0.15rem;
  transition: transform 0.15s ease;
}

.my-products-card-fields[open] .my-products-card-fields-summary::before {
  transform: rotate(45deg);
  vertical-align: 0.05rem;
}

.my-products-card-fields-panel {
  margin-top: 0.65rem;
  padding: 0.75rem 1rem;
  background: #fafafa;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  max-width: 36rem;
}

.my-products-card-fields-fieldset {
  margin: 0 0 0.75rem;
  padding: 0;
  border: none;
}

.my-products-card-fields-option {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 0.875rem;
  color: #444;
  cursor: pointer;
}

.my-products-card-fields-option:last-of-type {
  margin-bottom: 0;
}

.my-products-card-fields-option input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.my-products-card-fields-error {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  color: #a94442;
}

@media (prefers-reduced-motion: reduce) {
  .my-products-card-fields-summary::before {
    transition: none;
  }
}

.product-card-attr .product-card-attr-label {
  font-weight: 600;
}

.my-products-no-matches .my-products-clear-search {
  margin-left: 0.75rem;
  vertical-align: middle;
}

/* My Products grid summary & infinite scroll */
.products-scroll-footer,
.products-scroll-sentinel {
  overflow-anchor: none;
}

.products-grid-summary {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: #666;
}

.products-scroll-hint {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  color: #888;
}

.products-scroll-footer {
  margin-top: 0.5rem;
}

.products-scroll-status {
  padding: 1rem 0 1.25rem;
}

.products-scroll-status-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: #666;
  font-size: 0.875rem;
}

.products-scroll-primary {
  text-align: left;
}

.products-scroll-spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid #e8e8e8;
  border-top-color: #f5821f;
  border-radius: 50%;
  flex-shrink: 0;
  animation: products-scroll-spin 0.7s linear infinite;
}

@keyframes products-scroll-spin {
  to {
    transform: rotate(360deg);
  }
}

.products-scroll-error {
  text-align: center;
  padding: 0.5rem 0;
}

.products-scroll-error-msg {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: #a94442;
}

.products-scroll-end {
  margin: 0;
  padding: 1rem 0 0.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: #888;
}

/* Skeleton placeholders (infinite scroll loading) */
.product-card-skeleton {
  pointer-events: none;
  cursor: default;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  overflow-anchor: none;
}

.product-card-skeleton--leaving {
  transition: opacity 0.28s ease-out;
  opacity: 0;
}

.product-card-skeleton-image {
  background: linear-gradient(90deg, #ececec 0%, #f5f5f5 50%, #ececec 100%);
  background-size: 200% 100%;
  animation: product-skeleton-shimmer 1.2s ease-in-out infinite;
}

.product-card-skeleton-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.product-card-skeleton-line {
  height: 0.65rem;
  border-radius: 4px;
  background: linear-gradient(90deg, #ececec 0%, #f5f5f5 50%, #ececec 100%);
  background-size: 200% 100%;
  animation: product-skeleton-shimmer 1.2s ease-in-out infinite;
}

.product-card-skeleton-line--short {
  width: 55%;
}

@keyframes product-skeleton-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.products-scroll-sentinel {
  height: 1px;
}

@media (prefers-reduced-motion: no-preference) {
  #product-grid article.product-card.product-card--scroll-enter {
    opacity: 0;
    transform: translateY(12px);
    animation: product-card-scroll-enter 0.58s ease-out forwards;
    animation-delay: var(--product-card-scroll-enter-delay, 0ms);
  }
}

@keyframes product-card-scroll-enter {
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .products-scroll-spinner {
    animation: none;
    border-top-color: #ccc;
  }

  .product-card-skeleton-image,
  .product-card-skeleton-line {
    animation: none;
    background: #ececec;
  }

  .product-card-skeleton--leaving {
    transition: none;
  }
}

/* Drawer specification sub-section */
.drawer-spec-section-title {
  margin: 1.5rem 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Staff tools (/staff/) */
.staff-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  padding: 0.75rem 0 1.25rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.staff-subnav a {
  font-weight: 600;
  color: #f5821f;
  text-decoration: none;
}

.staff-subnav a:hover {
  text-decoration: underline;
}

.staff-link-list {
  margin: 1rem 0;
  padding-left: 1.25rem;
}

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

.staff-attr-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  margin: 1rem 0 0;
}

.staff-attr-toolbar label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #555;
}

.staff-attr-search {
  min-width: 10rem;
  flex: 1;
  max-width: 22rem;
  padding: 0.4rem 0.5rem;
  font: inherit;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.staff-attr-filter {
  padding: 0.4rem 0.5rem;
  font: inherit;
  border: 1px solid #ccc;
  border-radius: 4px;
  min-width: 10rem;
}

.staff-attr-count {
  font-size: 0.875rem;
  color: #666;
  margin-left: auto;
}

.staff-table-wrap {
  overflow: auto;
  max-height: min(70vh, 32rem);
  margin: 0.75rem 0 1rem;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  background: #fff;
}

.staff-table-wrap .staff-table {
  margin: 0;
}

.staff-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.staff-table th,
.staff-table td {
  border: 1px solid #e8e8e8;
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: middle;
}

.staff-table th {
  background: #f9f9f9;
}

.staff-table-wrap .staff-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f9f9f9;
  box-shadow: 0 1px 0 #e8e8e8;
}

.staff-drag-cell {
  width: 2.75rem;
  text-align: center;
  vertical-align: middle;
}

.staff-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  min-height: 2rem;
  padding: 0;
  margin: 0;
  border: 1px solid #ccc;
  background: #fafafa;
  border-radius: 4px;
  cursor: grab;
  font-size: 1rem;
  line-height: 1;
  color: #555;
}

.staff-drag-handle:hover {
  background: #eee;
}

.staff-drag-handle:focus-visible {
  outline: 2px solid #f5821f;
  outline-offset: 1px;
}

.staff-drag-handle:active {
  cursor: grabbing;
}

tr.staff-attr-row-dragging > td {
  opacity: 0.65;
}

tr.staff-attr-row-drag-over > td {
  box-shadow: inset 0 3px 0 #f5821f;
}

.staff-order-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.staff-sort-order {
  max-width: 5.5rem;
  width: 5rem;
  min-width: 0;
  padding: 0.25rem 0.35rem;
  font: inherit;
}

.staff-order-actions {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.staff-move-btn {
  padding: 0.25rem 0.35rem;
  min-width: 7.5rem;
  font-size: 0.65rem;
  line-height: 1.15;
  white-space: normal;
  text-align: center;
  border: 1px solid #ccc;
  background: #fafafa;
  border-radius: 4px;
  cursor: pointer;
  color: #333;
}

.staff-move-btn:hover {
  background: #eee;
}

.staff-move-btn:focus-visible {
  outline: 2px solid #f5821f;
  outline-offset: 1px;
}

.staff-attr-id-cell .staff-attr-slug {
  font-size: 0.8125rem;
  word-break: break-word;
}

.staff-attr-duomuo {
  font-size: 0.75rem;
  color: #666;
  margin-top: 0.2rem;
}

.staff-table abbr[title] {
  text-decoration: underline dotted;
  cursor: help;
}

.staff-import-form {
  margin: 0.5rem 0 1rem;
}

.staff-hint {
  color: #666;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.staff-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.staff-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.staff-modal-panel {
  position: relative;
  background: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  max-width: 32rem;
  width: calc(100% - 2rem);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.staff-modal-panel h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.staff-modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}
