:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --sidebar-bg: #0f172a;
  --sidebar-text: #e2e8f0;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* Login Screen */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.brand-header img {
  width: 44px;
  height: 44px;
}

.brand-header h1 {
  font-size: 1.35rem;
  font-weight: 700;
}

.brand-header p {
  font-size: 0.85rem;
  color: var(--muted);
}

.demo-accounts {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.demo-accounts p {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.demo-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.demo-chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  font-size: 0.78rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

.demo-chip:hover {
  border-color: var(--primary);
  background: #eff6ff;
}

/* App Shell */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1rem;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1rem;
}

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

.sidebar-brand span {
  font-weight: 700;
  font-size: 1.1rem;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #cbd5e1;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

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

.nav-btn.active {
  background: var(--primary);
  color: #fff;
}

.sidebar-footer {
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-badge {
  font-size: 0.85rem;
  margin-bottom: 0.65rem;
}

.user-badge strong {
  display: block;
  color: #fff;
}

.role-pill {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
  margin-top: 0.2rem;
}

.main-content {
  flex: 1;
  padding: 1.5rem;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

.mobile-topbar {
  display: none;
  background: var(--sidebar-bg);
  color: #fff;
  padding: 0.75rem 1rem;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
}

.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 30;
  justify-content: space-around;
  padding: 0.35rem 0.25rem;
}

.mobile-nav .nav-btn {
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.4rem 0.25rem;
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
  justify-content: center;
}

.mobile-nav .nav-btn.active {
  background: transparent;
  color: var(--primary);
  font-weight: 700;
}

/* Cards & Layout */
.page-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.page-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
}

.page-header p {
  font-size: 0.9rem;
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow);
}

.kpi-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 800;
  margin-top: 0.2rem;
  color: var(--text);
}

/* Forms & Buttons */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
}

input, select, textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.92rem;
  font-family: inherit;
  background: #fff;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(37, 99, 235, 0.25);
  border-color: var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-outline {
  background: #fff;
  color: var(--text);
  border: 1px solid #cbd5e1;
}

.btn-outline:hover {
  background: var(--surface-2);
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

/* Warehouse Map */
.warehouse-section {
  margin-bottom: 1.5rem;
}

.zone-group {
  margin-top: 0.85rem;
}

.zone-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
  letter-spacing: 0.04em;
}

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

.location-cell {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem;
  background: var(--surface-2);
}

.location-cell.occupied {
  border-color: #93c5fd;
  background: #eff6ff;
}

.location-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.location-code {
  font-weight: 700;
  font-size: 0.88rem;
  color: #1e3a8a;
}

.lot-mini {
  background: #fff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 0.45rem 0.55rem;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.lot-mini:hover {
  border-color: var(--primary);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th, td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

th {
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-green { background: #dcfce7; color: #166534; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-gray { background: #e2e8f0; color: #334155; }

/* Scanner */
.scanner-box {
  border: 2px dashed #94a3b8;
  border-radius: 12px;
  padding: 1rem;
  background: #f8fafc;
  text-align: center;
  margin-bottom: 1rem;
}

#qr-reader {
  width: 100%;
  max-width: 420px;
  margin: 0.75rem auto;
}

.scan-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.scan-bar input {
  flex: 1;
  min-width: 200px;
}

/* Modal & Label Print */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 50;
}

.modal-card {
  background: #fff;
  border-radius: 14px;
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
}

.label-sheet {
  border: 2px solid #0f172a;
  border-radius: 10px;
  padding: 1rem;
  background: #fff;
  text-align: center;
}

.label-codes {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin: 0.85rem 0;
}

.label-meta {
  text-align: left;
  font-size: 0.82rem;
  border-top: 1px dashed #cbd5e1;
  padding-top: 0.65rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.75rem;
}

.toast {
  position: fixed;
  bottom: 4.5rem;
  right: 1.25rem;
  background: #0f172a;
  color: #fff;
  padding: 0.75rem 1.1rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  z-index: 100;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.mobile-drawer-close {
  display: none;
}

.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(2px);
  z-index: 1150;
}

@media (max-width: 820px) {
  .sidebar {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 270px;
    max-width: 84vw;
    height: 100vh;
    z-index: 1200;
    transform: translateX(-105%);
    transition: transform 0.24s ease;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.45);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .mobile-drawer-close {
    display: inline-flex;
    margin-left: auto;
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.2rem 0.45rem;
  }
  .mobile-topbar { display: flex; }
  .mobile-nav { display: flex; }
  .main-content { padding: 1rem 0.85rem 5rem; }
}

@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  body * { visibility: hidden; }
  .modal-backdrop:not(.hidden),
  .modal-backdrop:not(.hidden) .print-target,
  .modal-backdrop:not(.hidden) .print-target * {
    visibility: visible;
  }
  .modal-backdrop:not(.hidden) {
    position: static !important;
    background: none !important;
    padding: 0 !important;
    display: block !important;
  }
  .modal-backdrop:not(.hidden) .modal-card {
    max-height: none !important;
    overflow: visible !important;
    box-shadow: none !important;
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
  }
  .modal-backdrop:not(.hidden) .card-title {
    display: none !important;
  }
  .print-target {
    position: static !important;
    width: 100% !important;
    border: none !important;
  }
}

/* Warehouse PDF Report */
.report-header {
  border-bottom: 2px solid #0f172a;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.report-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.report-kpi {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  background: #f8fafc;
}

.report-kpi small {
  color: #64748b;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.report-kpi strong {
  display: block;
  font-size: 1.25rem;
  color: #0f172a;
}

.report-occ-bars {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.report-bar-item {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  font-size: 0.78rem;
}

.report-bar-track {
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.3rem;
}

.report-bar-fill {
  height: 100%;
  background: #2563eb;
  border-radius: 999px;
}

/* Physical Industrial Warehouse Map */
.wh-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.wh-tab {
  padding: 0.5rem 0.95rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}

.wh-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.wh-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.wh-legend {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--muted);
}

.legend-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: 0.25rem;
  vertical-align: middle;
}

.wh-layout-split {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(260px, 0.9fr);
  gap: 1rem;
  align-items: start;
}

.floorplan-wrap {
  background: #1e293b;
  border-radius: 12px;
  padding: 0.75rem;
  overflow-x: auto;
  border: 2px solid #334155;
  min-width: 0;
}

.floorplan-grid {
  display: flex;
  gap: 0.45rem;
  min-width: 560px;
}

.hilera-col {
  flex: 1;
  min-width: 56px;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.hilera-col.aisle-after {
  margin-right: 0.85rem;
  position: relative;
}

.hilera-col.aisle-after::after {
  content: "";
  position: absolute;
  top: 26px;
  bottom: 0;
  right: -0.55rem;
  border-right: 2px dashed rgba(250, 204, 21, 0.35);
}

.hilera-header {
  text-align: center;
  font-size: 0.76rem;
  font-weight: 800;
  color: #f8fafc;
  background: #0f172a;
  padding: 0.25rem 0.2rem;
  border-radius: 5px;
  letter-spacing: 0.04em;
}

.bay-cell {
  background: #334155;
  border: 1.5px solid #475569;
  border-radius: 6px;
  padding: 0.28rem 0.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  transition: transform 0.1s, border-color 0.15s, background 0.15s;
  color: #cbd5e1;
  font-size: 0.7rem;
}

.bay-cell:hover {
  border-color: #60a5fa;
  transform: scale(1.03);
}

.bay-cell.partial {
  background: #1d4ed8;
  border-color: #60a5fa;
  color: #fff;
}

.bay-cell.full {
  background: #d97706;
  border-color: #fbbf24;
  color: #fff;
}

.bay-cell.selected {
  outline: 2.5px solid #38bdf8;
  outline-offset: 1px;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.55);
}

@keyframes pulseMatch {
  0%, 100% {
    box-shadow: 0 0 0 2px #22c55e, 0 0 12px rgba(34, 197, 94, 0.95);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 4px #4ade80, 0 0 20px rgba(74, 222, 128, 1);
    transform: scale(1.06);
  }
}

.bay-cell.match-highlight {
  background: #15803d !important;
  color: #ffffff !important;
  border-color: #86efac !important;
  outline: 2.5px solid #22c55e;
  animation: pulseMatch 1.1s infinite;
  z-index: 5;
}

.bay-label {
  font-weight: 700;
  font-size: 0.68rem;
}

.pallet-bars {
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  width: 14px;
}

.pallet-bar {
  height: 4px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.2);
}

.pallet-bar.filled {
  background: #fde047;
}

/* Industrial Rack Inspector */
.rack-inspector {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 1rem;
}

.rack-frame {
  border-left: 6px solid #ea580c;
  border-right: 6px solid #ea580c;
  background: #f8fafc;
  padding: 0.65rem;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.rack-shelf {
  border-bottom: 5px solid #1e3a8a;
  background: #fff;
  border-radius: 6px 6px 2px 2px;
  padding: 0.65rem 0.75rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.shelf-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.pallet-card {
  background: #eff6ff;
  border: 1.5px solid #93c5fd;
  border-left: 5px solid #2563eb;
  border-radius: 6px;
  padding: 0.55rem 0.65rem;
  font-size: 0.82rem;
}

.pallet-empty {
  border: 1.5px dashed #cbd5e1;
  border-radius: 6px;
  padding: 0.55rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

@media (max-width: 980px) {
  .wh-layout-split {
    grid-template-columns: 1fr;
  }
  .rack-inspector {
    position: static;
  }
}

.hilera-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.2rem;
  padding: 0.28rem 0.35rem;
}

.hilera-title-btn {
  background: transparent;
  border: none;
  color: #f8fafc;
  font-weight: 800;
  font-size: 0.74rem;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  text-align: left;
}

.hilera-title-btn:hover {
  color: #60a5fa;
  text-decoration: underline;
}

.mini-icon-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.72rem;
  padding: 0 0.15rem;
  line-height: 1;
}

.mini-icon-btn:hover {
  color: #f87171;
}

.add-bay-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed #64748b;
  border-radius: 6px;
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem;
  cursor: pointer;
  text-align: center;
}

.add-bay-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: #60a5fa;
  color: #fff;
}

/* Croquis 2D Físico (20m x 60m) */
.croquis-canvas {
  position: relative;
  width: 100%;
  min-width: 520px;
  aspect-ratio: 20 / 28;
  background: #9ca3af;
  border: 2.5px solid #0f172a;
  border-radius: 8px;
  overflow: hidden;
}

.croquis-static-zone {
  position: absolute;
  border: 1px solid rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.25rem;
  line-height: 1.2;
  pointer-events: none;
}

.croquis-rack-block {
  position: absolute;
  border: 1.5px solid rgba(15, 23, 42, 0.55);
  border-radius: 4px;
  padding: 2px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.croquis-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.66rem;
  font-weight: 800;
  padding: 1px 3px;
  background: rgba(15, 23, 42, 0.14);
  border-radius: 3px;
}

.croquis-block-cells {
  flex: 1;
  display: flex;
  gap: 2px;
  min-height: 0;
}

.croquis-rack-block.vertical .croquis-block-cells {
  flex-direction: column;
}

.croquis-rack-block.horizontal .croquis-block-cells {
  flex-direction: row;
}

.croquis-rack-block .bay-cell {
  flex: 1;
  min-height: 18px;
  padding: 2px 4px;
  font-size: 0.65rem;
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(255, 255, 255, 0.25);
}

.croquis-rack-block .bay-cell.partial {
  background: #1d4ed8;
}

.croquis-rack-block .bay-cell.full {
  background: #d97706;
}

/* Uniform Tetris Snap-Grid Warehouse Board */
.tetris-board {
  display: grid;
  gap: 2px;
  background: #334155;
  padding: 6px;
  border-radius: 10px;
  border: 2px solid #0f172a;
  width: 100%;
  min-width: 0;
  position: relative;
}

.tetris-bg-cell {
  border: 1px dashed rgba(203, 213, 225, 0.22);
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.25);
  min-height: 30px;
  min-width: 0;
  transition: background 0.12s, border-color 0.12s;
}

.tetris-bg-cell.drop-hover {
  background: rgba(34, 197, 94, 0.42);
  border-color: #4ade80;
}

.tetris-bg-cell.drop-invalid {
  background: rgba(239, 68, 68, 0.42);
  border-color: #f87171;
}

.tetris-static-zone {
  border: 1.5px solid rgba(15, 23, 42, 0.55);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.25rem;
  line-height: 1.2;
  z-index: 2;
  pointer-events: none;
}

.tetris-rack-block {
  border: 1.5px solid rgba(15, 23, 42, 0.7);
  border-radius: 5px;
  padding: 2px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 3;
  min-width: 0;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  transition: opacity 0.15s;
}

.tetris-rack-block .croquis-block-header {
  flex-wrap: wrap;
  gap: 1px;
  font-size: 0.6rem;
  padding: 1px 2px;
}

.tetris-rack-block.draggable {
  cursor: grab;
}

.tetris-rack-block.dragging {
  opacity: 0.45;
}

.tetris-rack-block.block-selected {
  outline: 2.5px solid #38bdf8;
  outline-offset: 1px;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.65);
}

.tetris-board.is-dragging .tetris-rack-block {
  pointer-events: none;
}

.tetris-rack-block.horizontal {
  flex-direction: row;
  align-items: stretch;
}

.tetris-rack-block.horizontal .croquis-block-header {
  writing-mode: horizontal-tb;
  min-width: 58px;
  flex-direction: column;
  justify-content: center;
}

.tetris-rack-block .croquis-block-cells {
  flex: 1;
  display: grid;
  gap: 2px;
}

.tetris-rack-block.vertical .croquis-block-cells {
  grid-auto-flow: row;
  grid-auto-rows: 1fr;
}

.tetris-rack-block.horizontal .croquis-block-cells {
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
}

.tetris-rack-block .bay-cell {
  min-height: 26px;
  padding: 2px 4px;
  font-size: 0.66rem;
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(255, 255, 255, 0.25);
}

.tetris-rack-block .bay-cell.partial {
  background: #1d4ed8;
}

.tetris-rack-block .bay-cell.full {
  background: #d97706;
}
