:root {
  color-scheme: light;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --text: #182033;
  --muted: #788299;
  --line: #e7eaf0;
  --primary: #5578ea;
  --primary-dark: #3f5fd0;
  --violet: #8c74e8;
  --green: #2fb67c;
  --shadow: 0 24px 70px rgba(38, 51, 85, 0.12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Pretendard, "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.auth-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 20px;
  background:
    radial-gradient(circle at 15% 15%, rgba(85, 120, 234, 0.14), transparent 28%),
    radial-gradient(circle at 85% 80%, rgba(140, 116, 232, 0.13), transparent 30%),
    #f5f7fb;
}
.auth-card {
  width: min(100%, 430px);
  padding: 58px 52px 34px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 34px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow);
  text-align: center;
}
.company-logo {
  width: 74px;
  height: 74px;
  margin: 0 auto 32px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(145deg, #4f6fe1, #9b7bea);
  box-shadow: 0 14px 30px rgba(85,120,234,.28);
  font-size: 31px;
  font-weight: 900;
}
.auth-heading h1 { margin: 0; font-size: 25px; letter-spacing: -.04em; }
.auth-heading > p:last-child { margin: 10px 0 30px; color: var(--muted); font-size: 14px; }
.auth-form { display: grid; gap: 12px; text-align: left; }
label span { display: block; margin: 0 0 8px; color: #4f586d; font-size: 13px; font-weight: 700; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: #fafbfc;
  color: var(--text);
  transition: .2s border-color, .2s box-shadow, .2s background;
}
input, select { height: 50px; padding: 0 16px; }
textarea { padding: 14px 16px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: #8aa1ed;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(85,120,234,.11);
}
.primary-button, .secondary-button {
  min-height: 50px;
  border: 0;
  border-radius: 15px;
  padding: 0 22px;
  font-weight: 800;
}
.primary-button {
  color: #fff;
  background: linear-gradient(110deg, var(--primary), #9077eb);
  box-shadow: 0 10px 24px rgba(85,120,234,.22);
}
.primary-button:hover { filter: brightness(.97); transform: translateY(-1px); }
.auth-form .primary-button { margin-top: 7px; width: 100%; }
.compact { min-height: 46px; }
.secondary-button { color: #596277; background: #eef1f6; }
.auth-links { margin: 18px 0 0; }
.text-button { border: 0; padding: 8px; color: var(--muted); background: transparent; font-size: 13px; }
.text-button strong { color: var(--primary); }
.demo-note {
  display: inline-block;
  margin: 22px 0 0;
  padding: 8px 12px;
  border-radius: 10px;
  color: #8a92a5;
  background: #f5f6f9;
  font-size: 11px;
}
.form-error { min-height: 18px; margin: 2px 0 0; color: #e05161; font-size: 12px; text-align: left; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 250px;
  display: flex;
  flex-direction: column;
  padding: 30px 20px 20px;
  border-right: 1px solid var(--line);
  background: #fff;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 32px; }
.sidebar-brand-text { min-width: 0; }
.mini-logo {
  width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto;
  border-radius: 14px; color: #fff; background: linear-gradient(145deg, #4f6fe1, #9b7bea); font-weight: 900;
}
.brand-mark { border-radius: 0; background: transparent; object-fit: contain; }
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand strong { max-width: 155px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.sidebar-brand span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.side-nav { flex: 1; }
.nav-item {
  width: 100%; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 13px;
  padding: 13px 14px; color: #6f788d; background: transparent; font-weight: 700; text-align: left;
}
.nav-item.active { color: var(--primary); background: #eef2ff; }
.nav-item svg, .icon-button svg, .search-box svg {
  width: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.sidebar-user {
  display: grid; grid-template-columns: 38px 1fr 34px; align-items: center; gap: 10px;
  padding: 15px 10px 0; border-top: 1px solid var(--line);
}
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: var(--primary); background: #edf1ff; font-weight: 800; }
.sidebar-user strong, .sidebar-user span { display: block; }
.sidebar-user strong { font-size: 13px; }
.sidebar-user span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; border: 0; color: #8992a6; background: transparent; }
.content { grid-column: 2; padding: 46px clamp(24px, 4vw, 64px) 60px; overflow: hidden; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 30px; }
.topbar h1 { margin: 0; font-size: 30px; letter-spacing: -.04em; }
.topbar > div > p:last-child { margin: 9px 0 0; color: var(--muted); font-size: 14px; }
.header-button { min-height: 44px; }
.page-view { animation: page-in .22s ease-out; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } }
.order-create-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.order-form-card, .order-guide {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
}
.order-form-card { padding: 30px; }
.form-card-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.form-card-icon {
  width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto;
  border-radius: 15px; color: var(--primary); background: #eef2ff; font-size: 25px; font-weight: 700;
}
.form-card-heading h2, .order-guide h2 { margin: 0; font-size: 19px; letter-spacing: -.03em; }
.form-card-heading p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.order-fields { gap: 20px 16px; }
.unit-input { position: relative; }
.unit-input input { padding-right: 42px; }
.unit-input b {
  position: absolute; top: 16px; right: 16px;
  color: #7d8699; font-size: 13px;
}
.order-submit-row {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  margin-top: 6px; padding-top: 20px; border-top: 1px solid var(--line);
}
.order-submit-row p { margin: 0; color: var(--muted); font-size: 11px; }
.order-guide { padding: 28px 24px; }
.order-guide ol { list-style: none; counter-reset: guide; margin: 25px 0 0; padding: 0; }
.order-guide li {
  position: relative; counter-increment: guide; padding: 0 0 25px 42px;
  border-left: 1px solid #dfe4f1;
}
.order-guide li:last-child { padding-bottom: 0; border-left-color: transparent; }
.order-guide li::before {
  content: counter(guide); position: absolute; top: -4px; left: -15px;
  width: 29px; height: 29px; display: grid; place-items: center;
  border-radius: 10px; color: var(--primary); background: #eef2ff; font-size: 11px; font-weight: 900;
}
.order-guide li b, .order-guide li span { display: block; }
.order-guide li b { margin-bottom: 6px; font-size: 13px; }
.order-guide li span { color: var(--muted); font-size: 11px; line-height: 1.65; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 16px; margin-bottom: 20px; }
.summary-card { display: flex; align-items: center; gap: 15px; min-height: 112px; padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.summary-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; color: #657084; background: #eef0f4; font-size: 20px; font-weight: 800; }
.summary-icon.blue { color: var(--primary); background: #eef2ff; }
.summary-icon.violet { color: var(--violet); background: #f2efff; }
.summary-icon.green { color: var(--green); background: #eaf9f3; }
.summary-card span, .summary-card strong { display: block; }
.summary-card span { margin-bottom: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
.summary-card strong { font-size: 26px; letter-spacing: -.03em; }
.orders-panel { border: 1px solid var(--line); border-radius: 22px; background: #fff; overflow: hidden; }
.vendors-panel {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  overflow: hidden;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 25px 20px;
  border-bottom: 1px solid var(--line);
}
.section-heading h2 { margin: 0; font-size: 18px; letter-spacing: -.03em; }
.section-heading > div > p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.count-chip {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--primary);
  background: #eef2ff;
  font-size: 11px;
  font-weight: 800;
}
.vendor-heading-actions { display: flex; align-items: center; gap: 9px; }
.search-toggle {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 12px;
  color: #667084; background: #fff;
}
.search-toggle svg, .vendor-search-box svg {
  width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.vendor-search-panel { padding: 14px 20px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.vendor-search-box { position: relative; max-width: 470px; }
.vendor-search-box > svg { position: absolute; top: 14px; left: 15px; color: #929aab; }
.vendor-search-box input { height: 46px; padding: 0 75px 0 43px; background: #fff; }
.vendor-search-box button {
  position: absolute; top: 7px; right: 7px; height: 32px; padding: 0 10px;
  border: 0; border-radius: 9px; color: #6c7588; background: #eef1f6;
  font-size: 10px; font-weight: 800;
}
.vendor-table-wrap { overflow-x: auto; }
.vendor-table td strong { color: var(--text); }
.vendor-name-button {
  border: 0; padding: 0; color: var(--text); background: transparent;
  font-weight: 800; text-align: left;
}
.vendor-name-button:hover { color: var(--primary); }
.vendor-mobile-list { display: none; }
.vendor-pagination {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 15px 20px; border-top: 1px solid var(--line);
}
.vendor-pagination button {
  width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px;
  color: #667084; background: #fff; font-size: 20px;
}
.vendor-pagination button:disabled { opacity: .35; cursor: default; }
.vendor-pagination span { min-width: 52px; color: #70798c; font-size: 11px; font-weight: 800; text-align: center; }
.compact-empty { padding: 40px 20px; color: var(--muted); font-size: 13px; text-align: center; }
.panel-toolbar { display: flex; gap: 12px; padding: 20px; border-bottom: 1px solid var(--line); }
.history-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto 150px auto;
  gap: 10px;
  align-items: end;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}
.history-search { position: relative; }
.history-search svg {
  position: absolute; top: 14px; left: 15px; width: 19px;
  fill: none; stroke: #929aab; stroke-width: 1.8; stroke-linecap: round;
}
.history-search input { height: 46px; padding-left: 43px; background: #fff; }
.period-filter { display: flex; align-items: flex-end; gap: 7px; }
.period-filter label span {
  margin-bottom: 5px;
  color: #8b93a4;
  font-size: 10px;
}
.period-filter input { width: 137px; height: 46px; background: #fff; }
.period-filter i { padding-bottom: 14px; color: #a0a7b5; font-style: normal; }
.history-filters > select { width: 150px; height: 46px; background: #fff; }
.filter-reset {
  height: 46px; padding: 0 14px; border: 1px solid var(--line);
  border-radius: 14px; color: #687286; background: #fff; font-size: 12px; font-weight: 800;
}
.staff-orders-list { display: grid; gap: 12px; padding: 18px; background: #f6f7fa; }
.staff-order-card {
  position: relative;
  width: 100%;
  padding: 20px 48px 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--text);
  background: #fff;
  box-shadow: 0 8px 24px rgba(38,51,85,.04);
  text-align: left;
  transition: .2s border-color, .2s transform, .2s box-shadow;
}
.staff-order-card:hover {
  border-color: #cfd8f3; transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(38,51,85,.08);
}
.order-card-top { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.order-card-date { display: block; margin-bottom: 5px; color: var(--primary); font-size: 11px; font-weight: 800; }
.order-card-top strong { font-size: 16px; }
.order-card-body { margin-top: 15px; }
.order-card-address { margin: 0 0 13px; color: #505a6f; font-size: 13px; }
.order-card-meta, .order-card-contact {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.order-card-meta { padding-top: 13px; border-top: 1px solid #f0f2f6; }
.order-card-meta span { color: #606a7f; font-size: 12px; }
.order-card-meta b { font-size: 15px; }
.order-card-contact { margin-top: 8px; color: #9aa1af; font-size: 10px; }
.order-card-arrow {
  position: absolute; top: 50%; right: 18px; transform: translateY(-50%);
  color: #a6aebe; font-size: 27px;
}
.order-detail-dialog { width: min(calc(100% - 32px), 680px); }
.order-detail-content { padding: 30px; }
.order-detail-head {
  display: flex; justify-content: space-between; align-items: center; gap: 18px;
  padding: 18px; border-radius: 16px; background: #f6f8fc;
}
.order-detail-head span:first-child { display: block; margin-bottom: 5px; color: #8a93a6; font-size: 11px; }
.order-detail-head strong { font-size: 16px; }
.order-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  margin: 22px 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.order-detail-grid > div {
  min-height: 78px; padding: 15px 16px;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.order-detail-grid > div.wide { grid-column: 1 / -1; }
.order-detail-grid dt { margin-bottom: 7px; color: #8b93a4; font-size: 10px; font-weight: 800; }
.order-detail-grid dd { margin: 0; color: #465066; font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
.detail-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.detail-actions p { margin: 0; color: var(--muted); font-size: 11px; }
.danger-button {
  min-height: 44px; padding: 0 18px; border: 0; border-radius: 13px;
  color: #fff; background: #df5265; font-weight: 800;
}
.danger-button:hover { background: #cf4559; transform: translateY(-1px); }
.danger-button:disabled { opacity: .6; cursor: wait; transform: none; }
.confirm-dialog { width: min(calc(100% - 36px), 420px); text-align: center; }
.confirm-content { padding: 38px 32px 30px; }
.confirm-icon {
  width: 62px; height: 62px; display: grid; place-items: center;
  margin: 0 auto 20px; border-radius: 20px; color: #fff;
  background: linear-gradient(145deg, #ed6576, #db4d63);
  box-shadow: 0 13px 26px rgba(219,77,99,.2);
  font-size: 27px; font-weight: 900;
}
.confirm-content h2 { margin: 0; font-size: 21px; letter-spacing: -.03em; }
.confirm-content > p:not(.eyebrow) {
  margin: 10px 0 25px; color: var(--muted); font-size: 13px; line-height: 1.65;
}
.confirm-content > p strong { color: #555f73; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.confirm-actions .secondary-button, .confirm-actions .danger-button { min-height: 50px; }
.date-filter { width: 154px; flex: 0 0 auto; }
.date-filter span {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.date-filter input { height: 46px; background: #fff; }
.approval-card {
  max-width: 560px;
  margin: 70px auto 0;
  padding: 48px 38px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(38,51,85,.08);
  text-align: center;
}
.approval-icon {
  width: 68px; height: 68px; display: grid; place-items: center;
  margin: 0 auto 22px; border-radius: 22px; color: #6c57c9;
  background: #f1edff; font-size: 28px; font-weight: 900;
}
.approval-icon.rejected { color: #c14f5e; background: #fff0f2; }
.approval-card h2 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.approval-card > p:not(.eyebrow) {
  margin: 12px auto 24px; color: var(--muted); font-size: 13px; line-height: 1.7;
}
.approval-badge {
  display: inline-flex; min-width: 72px; justify-content: center;
  padding: 7px 10px; border-radius: 999px; font-size: 11px; font-weight: 800;
}
.approval-pending { color: #866b18; background: #fff7d8; }
.approval-approved { color: #23845f; background: #e8f8f1; }
.approval-rejected { color: #c14f5e; background: #fff0f2; }
.table-action {
  height: 34px; padding: 0 13px; border: 1px solid #dce2f2;
  border-radius: 10px; color: var(--primary); background: #f7f9ff;
  font-size: 11px; font-weight: 800;
}
.table-action:hover { border-color: #aebdeb; background: #eef2ff; }
.table-actions { display: flex; align-items: center; gap: 6px; }
.table-action.approve { border-color: #b9e4d3; color: #23845f; background: #eefaf5; }
.table-action.reject { border-color: #f0c6cc; color: #c14f5e; background: #fff5f6; }
.vendor-dialog { width: min(calc(100% - 32px), 620px); }
.vendor-dialog .dialog-actions { margin-top: 6px; }
.history-summary {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px;
}
.history-period-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 12px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 18px; background: #fff;
}
.history-period-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 13px; background: #f1f3f7; }
.history-period-tabs button {
  min-width: 64px; padding: 9px 13px; border: 0; border-radius: 10px;
  color: #7a8497; background: transparent; font-size: 12px; font-weight: 800; cursor: pointer;
}
.history-period-tabs button.active { color: #fff; background: var(--primary); box-shadow: 0 5px 12px rgba(75, 105, 220, .2); }
.history-period-navigator { display: flex; align-items: center; gap: 8px; }
.history-period-navigator > button:not(.history-today-button):not(.history-period-label) {
  width: 38px; height: 38px; border: 1px solid #e1e5ed; border-radius: 11px;
  color: #6d778b; background: #fff; font-size: 23px; line-height: 1; cursor: pointer;
}
.history-period-label {
  min-width: 150px; padding: 9px 12px; border: 0; border-radius: 10px;
  color: var(--text); background: transparent; font-size: 15px; font-weight: 800;
  text-align: center; cursor: pointer;
}
.history-period-label:hover, .history-period-label:focus-visible { color: var(--primary); background: #f3f5ff; outline: none; }
.history-native-period {
  position: fixed; top: 0; left: 0; width: 1px; height: 1px;
  overflow: hidden; opacity: 0; pointer-events: none;
}
.history-native-period label, .history-native-period input, .history-native-period select {
  display: block !important; width: 1px; height: 1px; padding: 0; border: 0;
}
.history-period-dialog { width: min(calc(100% - 28px), 430px); }
.history-picker-content { padding: 28px; }
.history-period-dialog .dialog-header { margin-bottom: 18px; }
.history-picker-heading { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 8px; }
.history-picker-heading button {
  width: 40px; height: 40px; border: 1px solid #e1e5ed; border-radius: 11px;
  color: #69748a; background: #fff; font-size: 23px; cursor: pointer;
}
.history-picker-heading strong { font-size: 16px; text-align: center; }
.history-picker-weekdays, .history-picker-grid.day {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
}
.history-picker-weekdays { margin-top: 16px; }
.history-picker-weekdays span { padding: 7px 0; color: #99a1b0; font-size: 10px; font-weight: 800; text-align: center; }
.history-picker-grid { margin-top: 6px; }
.history-picker-grid.month, .history-picker-grid.year {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px;
}
.history-picker-grid button {
  min-width: 0; height: 42px; border: 0; border-radius: 11px;
  color: #566176; background: #f6f7fa; font-size: 12px; font-weight: 800; cursor: pointer;
}
.history-picker-grid.day button { height: 38px; background: transparent; }
.history-picker-grid.day button.outside { color: #c4c9d3; }
.history-picker-grid button.selected { color: #fff; background: var(--primary); box-shadow: 0 5px 12px rgba(75, 105, 220, .2); }
.history-picker-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 20px; }
.history-picker-actions button { width: 100%; min-height: 46px; }
.history-today-button {
  height: 38px; padding: 0 14px; border: 1px solid #dbe2f8; border-radius: 11px;
  color: var(--primary); background: #f4f6ff; font-size: 11px; font-weight: 800; cursor: pointer;
}
.history-summary article {
  padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: #fff;
}
.history-summary span, .history-summary strong { display: block; }
.history-summary span { margin-bottom: 7px; color: var(--muted); font-size: 11px; font-weight: 800; }
.history-summary span small { font-weight: 500; }
.history-summary strong { font-size: 25px; letter-spacing: -.03em; }
.history-summary .money strong { color: var(--primary); }
.admin-history-panel { border: 1px solid var(--line); border-radius: 22px; background: #fff; overflow: hidden; }
.admin-history-filters {
  display: grid; grid-template-columns: minmax(240px, 1fr) 135px auto;
  gap: 10px; align-items: end; padding: 18px 20px; border-bottom: 1px solid var(--line);
  background: #fafbfc;
}
.admin-history-filters > label span { margin-bottom: 5px; color: #8b93a4; font-size: 10px; }
.admin-history-filters input, .admin-history-filters select { height: 46px; background: #fff; }
.period-value { min-width: 0; }
.period-value input, .period-value select { width: 100%; }
.vendor-order-groups { display: grid; gap: 10px; padding: 16px 20px 20px; background: #f6f7fa; }
.vendor-order-group { overflow: hidden; border: 1px solid #e5e8ef; border-radius: 17px; background: #fff; }
.vendor-order-summary {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 20px; border: 0; background: #fff; color: var(--text); text-align: left; cursor: pointer;
}
.vendor-order-summary > strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.vendor-order-summary > span { display: flex; align-items: center; gap: 13px; white-space: nowrap; }
.vendor-order-summary b { color: var(--primary); font-size: 15px; }
.vendor-order-summary i { color: #9ba3b3; font-size: 19px; font-style: normal; transition: transform .2s ease; }
.vendor-order-group.open .vendor-order-summary i { transform: rotate(180deg); }
.vendor-order-details { padding: 0 14px 14px; border-top: 1px solid #eff1f5; background: #fbfcfe; }
.vendor-order-card-list { display: grid; gap: 8px; padding-top: 12px; }
.vendor-order-mini-card {
  display: grid; grid-template-columns: minmax(130px, .8fr) minmax(180px, 1fr) auto;
  align-items: center; gap: 18px; padding: 14px 16px; border: 1px solid #e8ebf2;
  border-radius: 13px; background: #fff;
}
.vendor-order-mini-card strong { color: #63708a; font-size: 12px; }
.vendor-order-mini-card span { color: var(--muted); font-size: 12px; }
.vendor-order-mini-card b { color: var(--text); font-size: 13px; white-space: nowrap; }
.group-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding-top: 13px; }
.group-pagination button {
  min-width: 62px; padding: 8px 12px; border: 1px solid #dfe3eb; border-radius: 10px;
  background: #fff; color: #59647a; font-size: 11px; font-weight: 800; cursor: pointer;
}
.group-pagination button:disabled { opacity: .4; cursor: default; }
.group-pagination span { color: #8d96a8; font-size: 11px; font-weight: 800; }
.search-box { position: relative; flex: 1; max-width: 480px; }
.search-box svg { position: absolute; top: 14px; left: 15px; width: 19px; color: #929aab; }
.search-box input { height: 46px; padding-left: 44px; }
.panel-toolbar select { width: 140px; height: 46px; background: #fff; }
.table-wrap { min-height: 360px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 16px 18px; border-bottom: 1px solid #eff1f5; text-align: left; white-space: nowrap; }
th { color: #8b93a4; background: #fafbfc; font-size: 11px; letter-spacing: .02em; }
td { color: #555f73; font-size: 13px; }
td:first-child { color: var(--text); font-weight: 800; }
.address-cell { max-width: 230px; overflow: hidden; text-overflow: ellipsis; }
.status-badge {
  display: inline-flex; align-items: center; min-width: 62px; justify-content: center;
  padding: 7px 10px; border-radius: 999px; color: #526078; background: #eef1f5;
  font-size: 11px; font-weight: 800;
}
.status-select { width: 94px; height: 34px; padding: 0 10px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.accept-order-button {
  height: 36px; padding: 0 14px; border: 0; border-radius: 11px;
  color: #fff; background: linear-gradient(110deg, var(--primary), #9077eb);
  box-shadow: 0 7px 16px rgba(85,120,234,.2); font-size: 11px; font-weight: 800;
}
.accept-order-button:hover { filter: brightness(.97); transform: translateY(-1px); }
.accept-order-button:disabled { opacity: .6; cursor: wait; transform: none; }
.status-신규-주문 { color: #d26519; background: #fff1e6; }
.status-접수 { color: #4669d7; background: #edf2ff; }
.status-준비중 { color: #745bc4; background: #f1edff; }
.status-배송중 { color: #187aa0; background: #e7f6fb; }
.status-완료 { color: #23845f; background: #e8f8f1; }
.status-취소 { color: #c14f5e; background: #fff0f2; }
.empty-state { min-height: 330px; display: grid; place-content: center; justify-items: center; color: var(--muted); text-align: center; }
.empty-state > div { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; color: var(--primary); background: #eef2ff; font-size: 25px; }
.empty-state h2 { margin: 15px 0 6px; color: #4d566a; font-size: 16px; }
.empty-state p { margin: 0; font-size: 13px; }

.dialog {
  width: min(calc(100% - 32px), 560px);
  border: 0;
  border-radius: 24px;
  padding: 0;
  color: var(--text);
  box-shadow: 0 30px 90px rgba(22,31,54,.22);
}
.dialog::backdrop { background: rgba(21, 28, 45, .48); backdrop-filter: blur(3px); }
.dialog form { padding: 30px; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
.dialog-header h2 { margin: 0; font-size: 23px; }
.close-button { width: 36px; height: 36px; border: 0; border-radius: 10px; color: #788196; background: #f1f3f7; font-size: 22px; line-height: 1; }
.dialog-description { margin: -12px 0 22px; color: var(--muted); font-size: 13px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px 14px; }
.form-grid.single { grid-template-columns: 1fr; }
.form-grid .wide { grid-column: 1 / -1; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.register-dialog { width: min(calc(100% - 32px), 620px); }
.register-dialog form { padding: 34px 38px 28px; }
.register-dialog .dialog-header { margin-bottom: 12px; }
.register-dialog .dialog-description {
  margin: 0 0 26px;
  padding: 12px 14px;
  border-radius: 12px;
  color: #657084;
  background: #f5f7fb;
}
.register-section {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.section-label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  color: #465168;
  font-size: 13px;
  font-weight: 800;
}
.section-label b {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--primary);
  background: #eef2ff;
  font-size: 10px;
}
.optional-label {
  display: inline-flex;
  margin-left: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  color: #8b93a4;
  background: #f0f2f6;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  vertical-align: 1px;
}
.username-check-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 122px;
  gap: 12px;
  align-items: center;
  width: 100%;
}
.register-dialog .username-check-row > input {
  width: 100%;
  min-width: 0;
}
.register-dialog .check-button {
  width: 122px;
  height: 50px;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(110deg, var(--primary), #9077eb);
  box-shadow: 0 8px 18px rgba(85,120,234,.18);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: .2s filter, .2s transform, .2s box-shadow;
}
.register-dialog .check-button:hover {
  filter: brightness(.97);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(85,120,234,.24);
}
.register-dialog .check-button:active { transform: translateY(0); }
.register-dialog .check-button:disabled { opacity: .6; cursor: wait; transform: none; }
.password-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-message {
  display: block;
  min-height: 17px;
  margin-top: 7px;
  color: #949cad;
  font-size: 11px;
}
.field-message.success { color: #249568; }
.field-message.error { color: #e05161; }
.register-dialog .form-error { margin: 0 0 4px; }
.register-dialog .primary-button, #register-form > .primary-button { width: 100%; margin-top: 4px; }
.privacy-note {
  margin: 13px 0 0;
  color: #a0a7b5;
  font-size: 10px;
  text-align: center;
}
.notice-dialog { width: min(calc(100% - 36px), 390px); text-align: center; }
.notice-content { padding: 38px 32px 30px; }
.notice-icon {
  width: 62px; height: 62px; display: grid; place-items: center; margin: 0 auto 20px;
  border-radius: 20px; font-size: 27px; font-weight: 900;
}
.notice-icon.success { color: #fff; background: linear-gradient(145deg, #5578ea, #8c74e8); box-shadow: 0 13px 26px rgba(85,120,234,.24); }
.notice-icon.error { color: #fff; background: linear-gradient(145deg, #ed6576, #db4d63); box-shadow: 0 13px 26px rgba(219,77,99,.2); }
.notice-content h2 { margin: 0; font-size: 21px; letter-spacing: -.03em; }
.notice-content > p:not(.eyebrow) { margin: 10px 0 24px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.notice-content .primary-button { width: 100%; }
.toast {
  position: fixed; z-index: 10; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  padding: 13px 18px; border-radius: 12px; color: #fff; background: #273047;
  box-shadow: 0 12px 30px rgba(22,31,54,.22); font-size: 13px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.mobile-nav { display: none; }

@media (max-width: 1050px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .order-create-layout { grid-template-columns: 1fr; }
  .order-guide { display: none; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; flex-direction: row; align-items: center; padding: 14px 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-brand { flex: 1; padding: 0; }
  .sidebar-brand strong { max-width: min(155px, 42vw); }
  .side-nav { display: none; }
  .sidebar-user { display: flex; padding: 0; border: 0; }
  .sidebar-user .avatar, .sidebar-user > div:nth-child(2) { display: none; }
  .content { padding: 28px 16px 104px; }
  .topbar { align-items: center; }
  .topbar > div > p:last-child { display: none; }
  .topbar h1 { font-size: 25px; }
  .primary-button.compact { padding: 0 15px; }
  .summary-grid { gap: 10px; }
  .summary-card { min-height: 92px; padding: 15px; }
  .summary-icon { width: 40px; height: 40px; }
  .summary-card strong { font-size: 22px; }
  .panel-toolbar { padding: 14px; }
  .search-box { max-width: none; }
  .panel-toolbar select { width: 112px; }
  .history-filters { grid-template-columns: 1fr 1fr; }
  .history-search { grid-column: 1 / -1; }
  .period-filter { grid-column: 1 / -1; }
  .period-filter label { flex: 1; }
  .period-filter input { width: 100%; }
  .history-filters > select { width: 100%; }
  .order-form-card { padding: 22px 18px; }
  .vendors-panel { margin-top: 0; border-radius: 18px; }
  .section-heading { padding: 19px 17px 16px; }
  .section-heading > div > p:last-child { display: none; }
  .count-chip { display: none; }
  .vendor-search-panel { padding: 12px 14px; }
  .vendor-search-box { max-width: none; }
  .vendor-table-wrap { display: none; }
  .vendor-mobile-list { display: grid; gap: 10px; padding: 13px; background: #f6f7fa; }
  .vendor-mobile-card {
    position: relative; width: 100%; padding: 17px 42px 15px 17px;
    border: 1px solid var(--line); border-radius: 16px;
    color: var(--text); background: #fff; text-align: left;
  }
  .vendor-mobile-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .vendor-mobile-top strong { font-size: 15px; }
  .vendor-mobile-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 0; }
  .vendor-mobile-card dl div { min-width: 0; }
  .vendor-mobile-card dt { margin-bottom: 5px; color: #969eae; font-size: 9px; font-weight: 800; }
  .vendor-mobile-card dd { margin: 0; overflow: hidden; color: #5c6679; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
  .vendor-mobile-arrow { position: absolute; top: 50%; right: 16px; transform: translateY(-50%); color: #a6aebe; font-size: 24px; }
  .history-summary { grid-template-columns: 1fr 1fr; gap: 9px; }
  .history-period-card { display: block; padding: 12px; }
  .history-period-tabs { display: grid; grid-template-columns: repeat(3, 1fr); }
  .history-period-tabs button { min-width: 0; }
  .history-period-navigator { justify-content: space-between; margin-top: 11px; }
  .history-period-label { min-width: 0; flex: 1; font-size: 14px; }
  .history-picker-content { padding: 24px 18px 20px; }
  .history-picker-grid.day { gap: 2px; }
  .history-picker-grid.day button { height: 40px; }
  .history-summary article { padding: 17px 15px; }
  .history-summary strong { font-size: 19px; }
  .admin-history-filters { grid-template-columns: minmax(0, 1fr); padding: 13px; }
  .admin-history-filters .history-search,
  .admin-history-filters > select,
  .admin-history-filters .period-value,
  .admin-history-filters .filter-reset { grid-column: 1 / -1; width: 100%; min-width: 0; }
  .vendor-order-groups { padding: 12px 13px 13px; }
  .vendor-order-summary { padding: 17px 15px; }
  .vendor-order-summary > span { gap: 9px; }
  .vendor-order-summary b { font-size: 14px; }
  .vendor-order-mini-card { grid-template-columns: 1fr auto; gap: 7px 12px; padding: 13px 14px; }
  .vendor-order-mini-card span { grid-column: 1 / -1; }
  .mobile-nav {
    position: fixed;
    z-index: 20;
    right: 14px;
    bottom: 14px;
    left: 14px;
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(222,226,236,.9);
    border-radius: 20px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 15px 40px rgba(31,42,68,.18);
    backdrop-filter: blur(14px);
  }
  .mobile-nav-item {
    min-width: 0;
    flex: 1;
    display: grid;
    justify-items: center;
    gap: 4px;
    padding: 8px 10px 7px;
    border: 0;
    border-radius: 14px;
    color: #8a93a6;
    background: transparent;
    font-size: 10px;
    font-weight: 800;
  }
  .mobile-nav-item svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .mobile-nav-item.active { color: var(--primary); background: #eef2ff; }
}
@media (max-width: 520px) {
  .auth-view { padding: 0; background: #fff; }
  .auth-card { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 44px 25px 30px; border: 0; border-radius: 0; box-shadow: none; }
  .company-logo { width: 66px; height: 66px; margin-bottom: 30px; border-radius: 21px; }
  .auth-heading h1 { font-size: 23px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-card { gap: 10px; }
  .summary-icon { display: none; }
  .panel-toolbar { display: grid; grid-template-columns: 1fr 105px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .password-grid { grid-template-columns: 1fr; }
  .username-check-row { grid-template-columns: minmax(0, 1fr) 108px; gap: 8px; }
  .register-dialog .check-button { width: 108px; }
  .order-submit-row { align-items: stretch; flex-direction: column; }
  .order-submit-row .primary-button { width: 100%; }
  .order-detail-content { padding: 24px 18px; }
  .order-detail-grid { grid-template-columns: 1fr; }
  .order-detail-grid > div.wide { grid-column: auto; }
  .detail-actions { align-items: stretch; flex-direction: column; }
  .danger-button { width: 100%; }
  .dialog form { padding: 24px 20px; }
  .order-dialog { max-height: 90vh; overflow-y: auto; }
}

/* 날짜/월 입력칸 모바일 보정 */
input[type="date"],
input[type="month"] {
  display: block;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 46px;
  box-sizing: border-box;
  padding: 0 42px 0 14px !important;
  line-height: 46px;
  text-align: left;
  text-align-last: left;
  appearance: none;
  -webkit-appearance: none;
  position: relative;
}

input[type="date"]::-webkit-date-and-time-value,
input[type="month"]::-webkit-date-and-time-value {
  margin: 0;
  min-height: 1.4em;
  text-align: left;
}

input[type="date"]::-webkit-datetime-edit,
input[type="date"]::-webkit-datetime-edit-fields-wrapper,
input[type="date"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit-year-field,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="month"]::-webkit-datetime-edit,
input[type="month"]::-webkit-datetime-edit-fields-wrapper,
input[type="month"]::-webkit-datetime-edit-text,
input[type="month"]::-webkit-datetime-edit-year-field,
input[type="month"]::-webkit-datetime-edit-month-field {
  padding: 0;
  text-align: left;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator {
  position: absolute;
  right: 12px;
  top: 50%;
  width: 20px;
  height: 20px;
  margin: 0;
  padding: 0;
  transform: translateY(-50%);
  opacity: 0.75;
  cursor: pointer;
}

.period-filter,
.history-native-period,
.admin-history-filters,
.history-filters {
  min-width: 0;
}

.period-filter label,
.date-filter,
.period-value {
  min-width: 0 !important;
  max-width: 100% !important;
}

.date-filter,
.date-filter input,
.period-value,
.period-value input,
.period-filter input {
  width: 100% !important;
}

@media (max-width: 760px) {
  .history-filters {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .period-filter {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
    width: 100% !important;
    min-width: 0 !important;
    align-items: end;
  }

  .period-filter label {
    width: 100% !important;
    min-width: 0 !important;
  }

  .history-filters > select,
  .history-filters .filter-reset,
  .history-search {
    width: 100% !important;
    min-width: 0 !important;
  }
}

@media (max-width: 430px) {
  .period-filter {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .period-filter i {
    display: none;
  }
}
