/* Korean date picker */
.korean-date { position: relative; display: block; }
.korean-date input { width: 100%; min-width: 0; padding-right: 3.2rem; }

.korean-date-toggle {
  position: absolute;
  right: .35rem;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0;
  line-height: 1;
}
.korean-date-toggle::before {
  content: "";
  width: 1.05rem;
  height: 1.05rem;
  border: 2px solid currentColor;
  border-radius: .22rem;
  background: linear-gradient(currentColor 0 0) 0 .25rem / 100% 2px no-repeat;
}
.korean-date-toggle::after {
  content: "";
  position: absolute;
  top: .63rem;
  left: .78rem;
  width: .18rem;
  height: .18rem;
  border-radius: 999px;
  background: currentColor;
  box-shadow: .43rem 0 0 currentColor;
}
.korean-date-toggle:hover,
.korean-date-toggle:focus {
  background: #eff4ff;
  color: var(--primary);
}

.korean-date-picker[hidden] { display: none; }
.korean-date-picker {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 20;
  width: min(17rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  overflow-x: hidden;
  padding: .7rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: .8rem;
  box-shadow: 0 12px 30px #1118272e;
}
.korean-date-picker-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .5rem;
  align-items: center;
}
.korean-date-picker-title { text-align: center; font-weight: 800; }
.korean-date-weekdays,
.korean-date-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .25rem;
  margin-top: .5rem;
}
.korean-date-weekdays span {
  min-width: 0;
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 800;
}
.korean-date-picker button { min-height: var(--touch-target); padding: .45rem .55rem; }
.korean-date-picker-header button { width: var(--touch-target); padding: 0; }
.korean-date-days span { min-width: 0; min-height: var(--touch-target); }
.korean-date-days button {
  width: 100%;
  min-width: 0;
  min-height: var(--touch-target);
  padding: .35rem .2rem;
  border: 1px solid transparent;
  background: var(--row-stripe);
  border-radius: .5rem;
}
.korean-date-days button:hover,
.korean-date-days button:focus { border-color: var(--primary); }
.korean-date-days button[aria-current="date"] {
  background: #dbeafe;
  color: #1e40af;
  font-weight: 800;
}
.korean-date-days button[aria-pressed="true"] {
  background: var(--primary);
  color: #fff;
}
.korean-date-picker-footer {
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
  margin-top: .75rem;
}

/* Supplier picker */
.supplier-picker { position: relative; display: block; }
.supplier-picker [data-supplier-search] { width: 100%; }
.supplier-options[hidden],
.supplier-options [hidden] { display: none; }
.supplier-options {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + .35rem);
  z-index: 25;
  max-height: 16rem;
  overflow: auto;
  padding: .35rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: .8rem;
  box-shadow: 0 12px 30px #1118272e;
}
.supplier-options button {
  display: flex;
  justify-content: flex-start;
  width: 100%;
  border: 0;
  background: var(--card);
  color: var(--text);
  text-align: left;
  border-radius: .55rem;
  padding: .6rem .65rem;
  font-weight: 650;
}
.supplier-options button:hover,
.supplier-options button:focus { background: #eff4ff; }

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .65rem;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.2;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge::before {
  font-size: .85em;
  line-height: 1;
}
.badge-order-requested::before,
.badge-inbound-requested::before,
.badge-inbound-ordered::before,
.badge-inbound-shipping::before,
.badge-job-pending::before               { content: "◷"; }
.badge-inbound-partially_received::before,
.badge-order-partially_completed::before,
.badge-job-in_progress::before           { content: "◐"; }
.badge-order-completed::before,
.badge-inbound-received::before,
.badge-job-completed::before,
.badge-product-active::before,
.badge-active::before                    { content: "✓"; }
.badge-order-canceled::before            { content: "✕"; }
.badge-product-inactive::before,
.badge-inactive::before                  { content: "○"; }
.badge-inbound-requested          { background: #fef3c7; color: #92400e;     border-color: #fde68a; }
.badge-inbound-ordered            { background: #e0f2fe; color: #075985;     border-color: #7dd3fc; }
.badge-inbound-shipping           { background: #dbeafe; color: #1e40af;     border-color: #93c5fd; }
.badge-inbound-partially_received { background: #dbeafe; color: #1e40af;     border-color: #93c5fd; }
.badge-inbound-received           { background: #dcfae6; color: var(--ok);   border-color: #abefc6; }
.badge-order-requested            { background: #fef3c7; color: #92400e;     border-color: #fde68a; }
.badge-order-partially_completed  { background: #dbeafe; color: #1e40af;     border-color: #93c5fd; }
.badge-order-completed            { background: #dcfae6; color: var(--ok);   border-color: #abefc6; }
.badge-order-canceled             { background: #fee4e2; color: var(--danger); border-color: #fecdca; }
.badge-job-pending                { background: #e5e7eb; color: #374151;     border-color: #d1d5db; }
.badge-job-in_progress            { background: #dbeafe; color: #1e40af;     border-color: #93c5fd; }
.badge-job-completed              { background: #dcfae6; color: var(--ok);   border-color: #abefc6; }
.badge-product-active,
.badge-active                     { background: #dcfae6; color: var(--ok);   border-color: #abefc6; }
.badge-product-inactive,
.badge-inactive                   { background: #e5e7eb; color: #374151;     border-color: #d1d5db; }
.badge-manufacturing-in_progress,
.badge-step-current               { background: #dbeafe; color: #1e40af;     border-color: #93c5fd; }
.badge-manufacturing-completed,
.badge-step-confirmed             { background: #dcfae6; color: var(--ok);   border-color: #abefc6; }
.badge-manufacturing-canceled,
.badge-step-pending               { background: #e5e7eb; color: #374151;     border-color: #d1d5db; }
.badge-step-canceled              { background: #e5e7eb; color: #374151;     border-color: #d1d5db; }
.badge-production-order-draft::before,
.badge-production-order-in_progress::before,
.badge-production-order-production-running::before { content: "◐"; }
.badge-production-order-ready::before,
.badge-production-order-production-waiting::before,
.badge-production-order-inspection-waiting::before,
.badge-production-order-packaging-waiting::before,
.badge-production-order-final-packaging-waiting::before,
.badge-production-order-sterilization-waiting::before { content: "◷"; }
.badge-production-order-completed::before { content: "✓"; }
.badge-production-order-draft,
.badge-production-order-production-waiting { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.badge-production-order-in_progress,
.badge-production-order-production-running { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.badge-production-order-ready,
.badge-production-order-inspection-waiting { background: #e0f2fe; color: #075985; border-color: #7dd3fc; }
.badge-production-order-packaging-waiting { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.badge-production-order-final-packaging-waiting { background: #fdf2f8; color: #9d174d; border-color: #fbcfe8; }
.badge-production-order-sterilization-waiting { background: #ede9fe; color: #5b21b6; border-color: #c4b5fd; }
.badge-production-order-completed { background: #dcfae6; color: var(--ok); border-color: #abefc6; }
.badge-manufacturing-draft::before { content: "◌"; }
.badge-manufacturing-draft { background: #f3f4f6; color: #4b5563; border-color: #d1d5db; }

/* Login hint */
.login-hint {
  margin: -.4rem 0 .8rem;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.5;
}

/* Confirm dialog */
.confirm-dialog {
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0;
  max-width: min(520px, calc(100vw - 2rem));
  width: 100%;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 24px 60px #00000040;
}
.confirm-dialog::backdrop {
  background: #0007;
  backdrop-filter: blur(2px);
}
.confirm-dialog-form {
  margin: 0;
  padding: 1.2rem 1.3rem 1rem;
  display: grid;
  gap: 1rem;
}
.confirm-dialog-form p {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.5;
  white-space: pre-line;
}
.confirm-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .5rem;
}
.confirm-dialog-actions button {
  flex: 1 1 9rem;
  padding: .7rem 1rem;
  min-height: var(--touch-target);
}
.confirm-dialog-actions button.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

/* Inventory bot prompt examples */
.inventory-bot-help {
  display: grid;
  gap: .65rem;
  border-color: #b7c7e8;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
}
.inventory-bot-help-summary {
  display: flex;
  gap: .75rem;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
}
.inventory-bot-help-summary::-webkit-details-marker {
  display: none;
}
.inventory-bot-help-summary div {
  display: grid;
  gap: .15rem;
  min-width: 0;
}
.inventory-bot-help-summary h2,
.inventory-bot-help-summary small {
  min-width: 0;
  margin: 0;
}
.inventory-bot-help-summary small {
  color: var(--muted);
  font-weight: 700;
}
.inventory-bot-help-summary::after {
  content: "예시 보기";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-compact);
  padding: .45rem .75rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: var(--card);
  color: var(--primary-strong);
  font-weight: 900;
  white-space: nowrap;
}
.inventory-bot-help[open] > .inventory-bot-help-summary::after {
  content: "접기";
}
.inventory-bot-help-head {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  justify-content: flex-end;
}
.inventory-bot-help-head h2 {
  margin: .15rem 0 0;
}
.inventory-bot-help-eyebrow {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-height: 1.7rem;
  padding: .18rem .55rem;
  border: 1px solid #b7c7e8;
  border-radius: .5rem;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: .86rem;
  font-weight: 850;
  line-height: 1.2;
}
.inventory-bot-help-chat {
  flex: 0 0 auto;
}
.inventory-bot-prompt-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem;
  padding: 0;
  margin: 0;
  list-style: none;
}
.inventory-bot-prompt-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .5rem;
  align-items: center;
  min-width: 0;
  padding: .65rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: var(--card);
}
.inventory-bot-prompt-list code {
  min-width: 0;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}
.inventory-bot-prompt-list button {
  min-height: var(--control-compact);
  padding: .45rem .75rem;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .inventory-bot-prompt-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .inventory-bot-help-summary {
    display: grid;
  }
  .inventory-bot-help-summary::after {
    justify-self: start;
  }
  .inventory-bot-help-head {
    display: grid;
  }
  .inventory-bot-help-chat {
    justify-self: start;
  }
  .inventory-bot-prompt-list li {
    grid-template-columns: 1fr;
  }
  .inventory-bot-prompt-list button {
    justify-self: start;
  }
}
