:root {
  --bg: #eef2f6;
  --panel: #ffffff;
  --line: #d9e2ec;
  --text: #16263e;
  --muted: #6d7f95;
  --blue: #2a63ff;
  --blue-soft: #e8efff;
  --green: #16a34a;
  --red: #e24b4b;
  --shadow: 0 10px 26px rgba(22, 38, 62, 0.08);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Noto Sans KR", sans-serif;
}

.kcp-page {
  max-width: 1820px;
  margin: 0 auto;
  padding: 18px 22px 24px;
}

.kcp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.kcp-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px;
}

.kcp-title {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.kcp-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.date-box,
.btn-ghost,
.btn-primary,
.btn-danger,
.quick-row button,
.field-block input {
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 13px;
}

.date-box {
  padding: 8px 10px;
  background: #fff;
}

.btn-ghost {
  background: #fff;
  padding: 8px 12px;
  cursor: pointer;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  padding: 8px 12px;
  cursor: pointer;
}

.btn-danger {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  padding: 8px 12px;
  cursor: pointer;
}

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

.summary-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.summary-card.current {
  background: var(--blue-soft);
}

.summary-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.summary-value {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

.summary-value.positive { color: var(--green); }
.summary-value.negative { color: var(--red); }

.status-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
  font-size: 14px;
  margin-bottom: 12px;
}

.dot { color: var(--muted); }

.board-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 14px;
}

.board-head {
  margin-bottom: 12px;
}

.board-head h2 {
  margin: 0 0 4px 0;
  font-size: 22px;
}

.board-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.pallet-grid-page {
  display: grid;
  grid-template-columns: repeat(13, minmax(120px, 1fr));
  gap: 8px;
  align-items: start;
}

.pallet-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px 8px 10px;
  min-height: 520px;
}

.pallet-full { background: #fff; }
.pallet-partial { background: #fff7e1; box-shadow: 0 0 0 2px rgba(245, 191, 50, 0.22); }
.pallet-empty { background: #f8fafc; }

.pallet-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.pallet-code {
  font-weight: 800;
  font-size: 14px;
}

.pallet-state {
  font-size: 10px;
  color: #5f738b;
}

.stack-frame {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  align-items: end;
  justify-items: center;
  min-height: 452px;
  padding: 6px 2px 0;
  background: linear-gradient(180deg, #f6f9fc 0%, #edf2f7 100%);
  border-radius: 14px;
  overflow: hidden;
}

.stack-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.stack-slot.overlap {
  margin-top: -5px;
}

.kcp-box-img {
    display: none;
}

.stack-column {
    display: flex;
    flex-direction: column-reverse;
    gap: 0;
    align-items: center;
}

.stack-slot {
    height: 27px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.kcp-box-tile {
    width: 46px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -1px;
    border: 1px solid #c88d00;
    border-radius: 4px 4px 6px 6px;
    background: linear-gradient(180deg, #ffd84d 0%, #e0a400 100%);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.45),
        inset 0 -1px 0 rgba(120,80,0,0.25),
        0 1px 2px rgba(0,0,0,0.10);
    color: #1f2937;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.4px;
    line-height: 1;
    box-sizing: border-box;
}

.empty-box-shadow {
    width: 40px;
    height: 4px;
    border-radius: 999px;
    background: #d9e1ea;
    opacity: 0.55;
}

.pallet-card {
    padding: 18px 14px 18px;
    border-radius: 20px;
}

.pallet-top {
    margin-bottom: 14px;
}

.pallet-code {
    font-size: 22px;
    font-weight: 900;
}

.pallet-state {
    font-size: 14px;
    font-weight: 800;
}

.pallet-bottom {
    margin-top: 16px;
    padding-top: 14px;
    font-size: 17px;
    line-height: 1.3;
}

.pallet-bottom strong {
    font-size: 19px;
    font-weight: 900;
}

.pallet-grid-page {
    gap: 14px;
}

/* 입고/출고 작업 카드 크게 */
.work-panel,
.work-card,
.stock-action-card {
    padding: 22px 24px !important;
    border-radius: 18px !important;
    min-width: 420px;
}

.work-panel h3,
.work-card h3,
.stock-action-card h3 {
    font-size: 30px !important;
    font-weight: 900 !important;
    margin-bottom: 18px !important;
}

.work-panel label,
.work-card label,
.stock-action-card label {
    font-size: 18px !important;
    font-weight: 700 !important;
    display: block;
    margin-bottom: 8px !important;
}

.work-panel input,
.work-card input,
.stock-action-card input,
.work-panel textarea,
.work-card textarea,
.stock-action-card textarea {
    height: 46px !important;
    font-size: 20px !important;
    padding: 10px 14px !important;
    border-radius: 10px !important;
}

.work-panel textarea,
.work-card textarea,
.stock-action-card textarea {
    min-height: 82px !important;
}

.work-panel button,
.work-card button,
.stock-action-card button {
    min-width: 110px !important;
    height: 44px !important;
    font-size: 17px !important;
    font-weight: 800 !important;
    border-radius: 10px !important;
    margin-right: 8px !important;
    margin-top: 8px !important;
}

.work-panel .quick-btn,
.work-card .quick-btn,
.stock-action-card .quick-btn {
    min-width: 76px !important;
    height: 36px !important;
    font-size: 15px !important;
}

.work-panel .form-row,
.work-card .form-row,
.stock-action-card .form-row {
    margin-bottom: 16px !important;
}


.stock-action-card,
.work-panel,
.work-card {
    width: 100%;
    max-width: 1180px;
    padding: 28px 32px !important;
    margin: 0 0 22px 0 !important;
    border-radius: 20px !important;
}

.stock-action-card h3,
.work-panel h3,
.work-card h3 {
    font-size: 34px !important;
    font-weight: 900 !important;
    margin-bottom: 20px !important;
}

.stock-action-card label,
.work-panel label,
.work-card label {
    display: block;
    font-size: 19px !important;
    font-weight: 800 !important;
    margin-bottom: 8px !important;
}

.stock-action-card input,
.work-panel input,
.work-card input,
.stock-action-card textarea,
.work-panel textarea,
.work-card textarea {
    width: 100%;
    max-width: 420px;
    height: 52px !important;
    font-size: 22px !important;
    padding: 10px 16px !important;
    border-radius: 12px !important;
}

.stock-action-card textarea,
.work-panel textarea,
.work-card textarea {
    min-height: 90px !important;
}

.stock-action-card button,
.work-panel button,
.work-card button {
    min-width: 118px !important;
    height: 46px !important;
    font-size: 17px !important;
    font-weight: 800 !important;
    border-radius: 10px !important;
    margin-right: 8px !important;
    margin-top: 10px !important;
}

.stock-action-card .quick-btn,
.work-panel .quick-btn,
.work-card .quick-btn {
    min-width: 70px !important;
    height: 34px !important;
    font-size: 14px !important;
}

.lower-grid {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 22px;
    align-items: start;
    margin-bottom: 22px;
}

.work-card {
    padding: 24px 26px !important;
    border-radius: 20px !important;
}

.work-card h3 {
    font-size: 30px !important;
    font-weight: 900 !important;
    margin-bottom: 18px !important;
}

.work-card label {
    display: block;
    font-size: 18px !important;
    font-weight: 800 !important;
    margin-bottom: 8px !important;
}

.work-card .text-input,
.work-card input {
    width: 100%;
    height: 48px !important;
    font-size: 20px !important;
    padding: 10px 14px !important;
    border-radius: 10px !important;
}

.work-card .action-row {
    margin-top: 14px !important;
}

.work-card .action-row button {
    min-width: 116px !important;
    height: 44px !important;
    font-size: 17px !important;
    font-weight: 800 !important;
}

.history-card {
    min-height: 100%;
    padding: 24px 26px !important;
    border-radius: 20px !important;
}

.history-card h3 {
    font-size: 28px !important;
    font-weight: 900 !important;
    margin-bottom: 18px !important;
}

.work-top-wrap {
    margin: 18px 0 22px;
}

.work-top-wrap .work-card {
    max-width: 460px;
    padding: 24px 26px !important;
    border-radius: 20px !important;
}

.history-wrap {
    margin-top: 22px;
}

.history-wrap .history-card {
    width: 100%;
    padding: 24px 26px !important;
    border-radius: 20px !important;
}

.board-wrap {
    margin-top: 18px;
}

.work-top-wrap {
    margin: 18px 0 22px;
}

.work-top-wrap .work-card {
    max-width: 460px;
    padding: 24px 26px !important;
    border-radius: 20px !important;
}

.history-link-btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.history-wrap {
    margin-top: 22px;
}

.history-wrap .history-card {
    width: 100%;
    padding: 24px 26px !important;
    border-radius: 20px !important;
}

.board-wrap {
    margin-top: 18px;
}

/* 상단 입고/출고 작업영역 가로형 재정렬 */
.work-top-wrap {
    margin: 18px 0 22px;
}

.work-top-wrap .work-card {
    max-width: 100% !important;
    width: 100% !important;
    padding: 24px 26px !important;
    border-radius: 20px !important;
    display: grid !important;
    grid-template-columns: 240px 240px 1fr;
    gap: 18px 20px;
    align-items: start;
}

.work-top-wrap .work-card h3 {
    grid-column: 1 / -1;
    font-size: 30px !important;
    font-weight: 900 !important;
    margin: 0 0 8px 0 !important;
}

.work-top-wrap .field-block {
    margin: 0 !important;
}

.work-top-wrap .field-block label {
    display: block;
    font-size: 18px !important;
    font-weight: 800 !important;
    margin-bottom: 8px !important;
}

.work-top-wrap .text-input,
.work-top-wrap input {
    width: 100% !important;
    height: 50px !important;
    font-size: 21px !important;
    padding: 10px 14px !important;
    border-radius: 10px !important;
    box-sizing: border-box;
}

.work-top-wrap .quick-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.work-top-wrap .quick-row button,
.work-top-wrap .quick-btn {
    min-width: 64px !important;
    height: 34px !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    border-radius: 9px !important;
}

.work-top-wrap .action-row {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 2px !important;
}

.work-top-wrap .action-row button,
.work-top-wrap .action-row a {
    min-width: 120px !important;
    height: 44px !important;
    font-size: 17px !important;
    font-weight: 800 !important;
    border-radius: 10px !important;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.work-top-wrap .autosave {
    grid-column: 1 / -1;
    font-size: 15px;
    margin-top: -4px;
}

/* 화면이 좁아지면 다시 세로로 */
@media (max-width: 1100px) {
    .work-top-wrap .work-card {
        grid-template-columns: 1fr;
    }

    .work-top-wrap .action-row,
    .work-top-wrap .autosave,
    .work-top-wrap .work-card h3 {
        grid-column: auto;
    }
}
