:root {
  --panel-bg: #262c2f;
  --panel-rib: #202528;
  --row-bg: #2e3438;
  --row-border: #1a1e20;
  --dymo-black: #121415;
  --dymo-red: #b7322a;
  --btn-beige-top: #dcd2bc;
  --btn-beige-mid: #cbc1a9;
  --btn-beige-bot: #9b917a;
  --btn-off-top: #9d9684;
  --btn-off-mid: #8b8372;
  --btn-off-bot: #676153;
  --manila: #f3eee2;
  --manila-ink: #22201d;
  --manila-muted: #6c6559;
  --led-green: #7bd83e;
  --led-red: #e23c31;
  --font-condensed: "Arial Narrow", "Impact", "Helvetica Neue", system-ui, sans-serif;
  --font-mono: "Courier New", "Liberation Mono", ui-monospace, monospace;
  --font-ui: "Helvetica Neue", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #141716;
  color: #e6e2d8;
  font-family: var(--font-ui);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.app-shell {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: row;
  gap: 8px;
  padding: 8px;
  background: #131615;
}

/* Left Office & Shredder Canvas Pane */
.stage-pane {
  position: relative;
  flex: 1 1 58%;
  min-width: 0;
  min-height: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #1b1f1c;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 4px 16px rgba(0, 0, 0, 0.55);
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

#game-canvas.dragging {
  cursor: grabbing;
}

/* Right Riveted Steel Console Pane */
.console-pane {
  position: relative;
  flex: 0 0 41.5%;
  max-width: 520px;
  min-width: 280px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 5px;
  padding: 12px 12px 8px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.018) 0px,
      rgba(255, 255, 255, 0.018) 2px,
      rgba(0, 0, 0, 0.06) 2px,
      rgba(0, 0, 0, 0.06) 5px
    ),
    linear-gradient(180deg, #31383c 0%, #24292c 100%);
  border: 1px solid #41494d;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -2px 6px rgba(0, 0, 0, 0.5),
    0 6px 20px rgba(0, 0, 0, 0.55);
}

/* Corner Rivet Screws */
.screw {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #8b9498, #3d4448 65%, #1d2123 100%);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  z-index: 3;
}
.screw::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  top: 3px;
  height: 1px;
  background: rgba(15, 18, 20, 0.8);
  transform: rotate(-32deg);
}
.screw-tl { top: 6px; left: 6px; }
.screw-tr { top: 6px; right: 6px; }
.screw-bl { bottom: 6px; left: 6px; }
.screw-br { bottom: 6px; right: 6px; }

.console-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 6px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.45);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

.dymo-tag {
  display: inline-block;
  padding: 3px 10px 2px;
  background: linear-gradient(180deg, #24282b 0%, #111314 55%, #181b1d 100%);
  color: #f4f1e8;
  font-family: var(--font-ui);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 2px;
  border: 1px solid #090b0c;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 2px 4px rgba(0, 0, 0, 0.65);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.9);
}

.dymo-header {
  font-size: 13px;
  padding: 4px 11px 3px;
}

.dymo-row {
  font-size: 11px;
  letter-spacing: 0.11em;
  padding: 3px 8px 2px;
}

.dymo-red {
  background: linear-gradient(180deg, #cb4037 0%, #a52821 58%, #8f211b 100%);
  border-color: #5e130f;
}

.shift-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #b7c0c3;
  letter-spacing: 0.06em;
  background: rgba(0, 0, 0, 0.28);
  padding: 3px 7px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

/* Scrollable Requisitions List */
.requisitions-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 2px 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: #4f585d #1d2225;
}

.requisitions-list::-webkit-scrollbar {
  width: 6px;
}
.requisitions-list::-webkit-scrollbar-track {
  background: #1d2225;
  border-radius: 3px;
}
.requisitions-list::-webkit-scrollbar-thumb {
  background: #4f585d;
  border-radius: 3px;
}

.req-card {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(0, 0, 0, 0.08) 100%),
    var(--row-bg);
  border: 1px solid var(--row-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 2px 5px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.req-card.maxed {
  opacity: 0.72;
}

.req-info {
  flex: 1 1 auto;
  min-width: 0;
}

.req-desc {
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.3;
  color: #aeb7ba;
  font-weight: 500;
}

.req-pips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.pip {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #181c1e;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 255, 255, 0.08);
}

.pip.filled {
  background: radial-gradient(circle at 35% 35%, #b5f279, #63b52c 68%, #3c7516 100%);
  box-shadow: 0 0 4px rgba(123, 216, 62, 0.55);
}

/* Tactile Retro Beige Hardware Price Button */
.req-buy-btn {
  flex: 0 0 auto;
  min-width: 84px;
  height: 36px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  border-radius: 4px;
  border: 1px solid #1a1c19;
  background: linear-gradient(180deg, var(--btn-off-top) 0%, var(--btn-off-mid) 75%, var(--btn-off-bot) 100%);
  color: #46423a;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 13px;
  cursor: not-allowed;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 2px 0 #17191a,
    0 3px 6px rgba(0, 0, 0, 0.45);
  transition: transform 0.06s ease, filter 0.1s ease;
}

.req-buy-btn.affordable {
  background: linear-gradient(180deg, #ede4cf 0%, #d4cab2 72%, #a89e86 100%);
  color: #1d1b17;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 2px 0 #151718,
    0 4px 8px rgba(0, 0, 0, 0.5);
}

.req-buy-btn.affordable:hover {
  filter: brightness(1.05);
}

.req-buy-btn.affordable:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.25),
    0 0 0 #151718;
}

.req-buy-btn.maxed {
  background: linear-gradient(180deg, #52595c 0%, #3d4346 100%);
  color: #9ba5a8;
  cursor: default;
  justify-content: center;
}

.led-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: radial-gradient(circle at 35% 35%, #6d695e, #423f37 75%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.75);
}

.req-buy-btn.affordable .led-dot,
.led-dot.led-green {
  background: radial-gradient(circle at 35% 35%, #d6ff9c, #74d936 60%, #3d8714 100%);
  box-shadow: 0 0 7px rgba(123, 216, 62, 0.85), inset 0 1px 1px rgba(255, 255, 255, 0.6);
}

.led-dot.led-red {
  background: radial-gradient(circle at 35% 35%, #ff9b93, #e03c31 62%, #8a1610 100%);
  box-shadow: 0 0 7px rgba(224, 60, 49, 0.8);
}

/* Red Ink APPROVED Stamp Slam */
.approved-stamp {
  position: absolute;
  right: 98px;
  top: 50%;
  transform: translateY(-50%) rotate(-9deg) scale(1);
  padding: 2px 8px;
  border: 2.5px solid rgba(186, 46, 38, 0.82);
  border-radius: 3px;
  color: rgba(186, 46, 38, 0.85);
  font-family: var(--font-condensed);
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  pointer-events: none;
  animation: stampSlam 0.95s ease-out forwards;
}

@keyframes stampSlam {
  0%   { opacity: 0; transform: translateY(-50%) rotate(-14deg) scale(1.65); }
  18%  { opacity: 0.92; transform: translateY(-50%) rotate(-8deg) scale(0.96); }
  30%  { opacity: 0.88; transform: translateY(-50%) rotate(-9deg) scale(1.0); }
  75%  { opacity: 0.82; transform: translateY(-50%) rotate(-9deg) scale(1.0); }
  100% { opacity: 0; transform: translateY(-50%) rotate(-9deg) scale(1.0); }
}

/* Bottom Console Utility Bar */
.console-footer {
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.hw-mini-btn {
  padding: 5px 9px;
  border-radius: 3px;
  border: 1px solid #161817;
  background: linear-gradient(180deg, #ece3cf 0%, #cfc4ac 78%, #a69c84 100%);
  color: #1f1d19;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 2px 0 #141615;
}

.hw-mini-btn:hover {
  filter: brightness(1.05);
}

.hw-mini-btn:active {
  transform: translateY(1px);
  box-shadow: none;
}

.hw-mini-accent {
  background: linear-gradient(180deg, #f7d97a 0%, #d4a635 80%, #9b741c 100%);
  color: #1c1608;
}

.hw-mini-red {
  background: linear-gradient(180deg, #e05248 0%, #b52b23 80%, #7d1914 100%);
  color: #fff6f2;
  animation: pulseGlow 1.3s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(226, 60, 49, 0.55), 0 2px 0 #141615; }
  50%      { box-shadow: 0 0 10px 2px rgba(226, 60, 49, 0.75), 0 2px 0 #141615; }
}

.footer-note {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #7c8588;
  text-align: right;
  padding-right: 12px;
}

/* Manila Paper Modals (Commendations / Back Office / Audit) */
.paper-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 11, 0.74);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 20;
}

.paper-overlay.hidden,
.hidden {
  display: none !important;
}

.manila-sheet {
  width: 100%;
  max-width: 520px;
  max-height: 92%;
  display: flex;
  flex-direction: column;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(130, 115, 90, 0.025) 0px,
      rgba(130, 115, 90, 0.025) 1px,
      transparent 1px,
      transparent 4px
    ),
    var(--manila);
  color: var(--manila-ink);
  border-radius: 3px;
  padding: 16px 18px 14px;
  transform: rotate(-0.6deg);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.75), inset 0 0 0 1px rgba(140, 126, 102, 0.35);
}

.manila-sheet-compact {
  max-width: 420px;
}

.manila-org {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--manila-muted);
}

.manila-title {
  margin: 4px 0 6px;
  font-family: var(--font-condensed);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #191815;
  line-height: 1;
}

.manila-subtitle {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #4b463d;
  line-height: 1.4;
}

.manila-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 18px;
  padding: 9px 0;
  border-top: 1px dashed #bfb6a3;
  border-bottom: 1px dashed #bfb6a3;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #3f3b34;
}

.stat-row strong {
  color: #151412;
  font-weight: 800;
}

.manila-awards-list {
  flex: 1 1 auto;
  min-height: 110px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-right: 4px;
  margin-bottom: 12px;
}

.award-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border: 1px dashed #c4bba8;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.35);
}

.award-item.unlocked {
  border-style: solid;
  border-color: #a49477;
  background: rgba(255, 251, 240, 0.85);
}

.award-seal {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid #c6bda9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-condensed);
  font-weight: 900;
  font-size: 12px;
  color: transparent;
}

.award-item.unlocked .award-seal {
  border-color: #b7322a;
  background: radial-gradient(circle at 35% 35%, #d94c42, #a8251e);
  color: #fff6e8;
  box-shadow: 0 2px 4px rgba(183, 50, 42, 0.35);
}

.award-body {
  flex: 1 1 auto;
  min-width: 0;
}

.award-name {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #888071;
  text-transform: uppercase;
}

.award-item.unlocked .award-name {
  color: #191815;
}

.award-desc {
  font-size: 12px;
  color: #7c7466;
  margin-top: 2px;
}

.award-item.unlocked .award-desc {
  color: #3d3931;
}

.bo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #c4bba8;
  border-radius: 3px;
  background: rgba(255, 253, 246, 0.8);
}

.bo-buy-btn {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 3px;
  border: 1px solid #2a261f;
  background: linear-gradient(180deg, #e5dac0, #bfb399);
  color: #201e1a;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 11px;
  cursor: pointer;
}
.bo-buy-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.manila-footer {
  display: flex;
  justify-content: center;
}

.manila-footer-row {
  gap: 10px;
  justify-content: space-between;
}

.hw-btn {
  flex: 1 1 auto;
  height: 38px;
  padding: 0 14px;
  border-radius: 4px;
  border: 1px solid #494235;
  background: linear-gradient(180deg, #ede4cf 0%, #d2c8b0 74%, #ada28a 100%);
  color: #191714;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 2px 0 #5b5344;
}

.hw-btn-wide .led-dot {
  position: absolute;
  left: 12px;
}

.hw-btn-primary {
  background: linear-gradient(180deg, #f5dc82 0%, #d3a435 78%, #9c741a 100%);
}

.hw-btn-danger {
  background: linear-gradient(180deg, #e55b52 0%, #b7322a 78%, #821d17 100%);
  color: #fff6f2;
}

/* Mobile Portrait Stacked Layout (matching ref_12_mobile_view.png) */
@media (max-aspect-ratio: 11/10), (max-width: 720px) {
  .app-shell {
    flex-direction: column;
    padding: 5px;
    gap: 6px;
  }

  .stage-pane {
    flex: 1 1 56%;
  }

  .console-pane {
    flex: 0 0 44%;
    max-width: none;
    min-width: 0;
    padding: 9px 10px 6px;
  }

  .console-header {
    padding-bottom: 7px;
  }

  .req-card {
    padding: 7px 8px;
  }

  .req-desc {
    font-size: 11px;
  }

  .req-buy-btn {
    min-width: 74px;
    height: 32px;
    font-size: 12px;
  }

  .manila-sheet {
    padding: 12px 13px 10px;
  }

  .manila-title {
    font-size: 22px;
  }

  .manila-stats {
    font-size: 11px;
  }
}
