/* 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.35rem;
  height: 2.35rem;
  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: absolute;
  right: 0;
  top: calc(100% + .35rem);
  z-index: 20;
  width: 17rem;
  max-width: calc(100vw - 2rem);
  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, 1fr);
  gap: .25rem;
  margin-top: .5rem;
}
.korean-date-weekdays span {
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 800;
}
.korean-date-picker button { min-height: 2.1rem; padding: .35rem .5rem; }
.korean-date-picker-header button { width: 2.1rem; padding: 0; }
.korean-date-days span { min-height: 2.1rem; }
.korean-date-days button {
  width: 100%;
  min-height: 2.1rem;
  padding: .25rem;
  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: block;
  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-job-pending::before               { content: "◷"; }
.badge-order-partially_completed::before,
.badge-job-in_progress::before           { content: "◐"; }
.badge-order-completed::before,
.badge-job-completed::before,
.badge-product-active::before            { content: "✓"; }
.badge-order-canceled::before            { content: "✕"; }
.badge-product-inactive::before          { content: "○"; }
.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             { background: #dcfae6; color: var(--ok);   border-color: #abefc6; }
.badge-product-inactive           { background: #e5e7eb; color: #374151;     border-color: #d1d5db; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge-order-requested            { background: #422006; color: #fcd34d; border-color: #78350f; }
  :root:not([data-theme="light"]) .badge-order-partially_completed  { background: #0c2a4d; color: #93c5fd; border-color: #1e3a8a; }
  :root:not([data-theme="light"]) .badge-order-completed            { background: #14352a; color: #86efac; border-color: #166534; }
  :root:not([data-theme="light"]) .badge-order-canceled             { background: #3f1d1c; color: #fca5a5; border-color: #7f1d1d; }
  :root:not([data-theme="light"]) .badge-job-pending                { background: #1f2937; color: #d1d5db; border-color: #374151; }
  :root:not([data-theme="light"]) .badge-job-in_progress            { background: #0c2a4d; color: #93c5fd; border-color: #1e3a8a; }
  :root:not([data-theme="light"]) .badge-job-completed              { background: #14352a; color: #86efac; border-color: #166534; }
  :root:not([data-theme="light"]) .badge-product-active             { background: #14352a; color: #86efac; border-color: #166534; }
  :root:not([data-theme="light"]) .badge-product-inactive           { background: #1f2937; color: #d1d5db; border-color: #374151; }
}
:root[data-theme="dark"] .badge-order-requested            { background: #422006; color: #fcd34d; border-color: #78350f; }
:root[data-theme="dark"] .badge-order-partially_completed  { background: #0c2a4d; color: #93c5fd; border-color: #1e3a8a; }
:root[data-theme="dark"] .badge-order-completed            { background: #14352a; color: #86efac; border-color: #166534; }
:root[data-theme="dark"] .badge-order-canceled             { background: #3f1d1c; color: #fca5a5; border-color: #7f1d1d; }
:root[data-theme="dark"] .badge-job-pending                { background: #1f2937; color: #d1d5db; border-color: #374151; }
:root[data-theme="dark"] .badge-job-in_progress            { background: #0c2a4d; color: #93c5fd; border-color: #1e3a8a; }
:root[data-theme="dark"] .badge-job-completed              { background: #14352a; color: #86efac; border-color: #166534; }
:root[data-theme="dark"] .badge-product-active             { background: #14352a; color: #86efac; border-color: #166534; }
:root[data-theme="dark"] .badge-product-inactive           { background: #1f2937; color: #d1d5db; border-color: #374151; }

/* 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(420px, 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;
}
.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
}
.confirm-dialog-actions button {
  padding: .55rem 1rem;
  min-height: 40px;
}
.confirm-dialog-actions button.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
