:root {
  --bg: #f4f5f3;
  --card: #ffffff;
  --ink: #1c2321;
  --ink-dim: #6b7370;
  --line: #dde1dc;
  --accent: #2f6f5e;
  --accent-ink: #ffffff;
  --pending: #96631d;
  --pending-bg: #f7ecd8;
  --approved: #2f6f5e;
  --approved-bg: #e2efe9;
  --rejected: #8c2f3d;
  --rejected-bg: #f4e3e5;
  --completed: #3a4a63;
  --completed-bg: #e5e9f0;
  --printing: #3d5a8a;
  --printing-bg: #e4eaf5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "Apple SD Gothic Neo", "Pretendard Variable", Pretendard, "Malgun Gothic", sans-serif;
  line-height: 1.6;
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.page.wide { max-width: 880px; }

h1 {
  font-size: 1.5rem;
  margin: 0 0 0.3rem;
}

.subtitle {
  color: var(--ink-dim);
  font-size: 0.92rem;
  margin: 0 0 2rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
}

label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin: 1rem 0 0.4rem;
}
label:first-child { margin-top: 0; }

input[type="text"], textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--ink);
}

textarea { resize: vertical; min-height: 4.5rem; }

input[type="file"] {
  width: 100%;
  padding: 0.5rem 0;
  font-size: 0.9rem;
}

button {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1.1rem;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  width: 100%;
  margin-top: 1.3rem;
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-approve { background: var(--approved-bg); color: var(--approved); }
.btn-reject { background: var(--rejected-bg); color: var(--rejected); }
.btn-complete { background: var(--completed-bg); color: var(--completed); }

.status-msg {
  margin-top: 1rem;
  font-size: 0.9rem;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  display: none;
}
.status-msg.show { display: block; }
.status-msg.ok { background: var(--approved-bg); color: var(--approved); }
.status-msg.err { background: var(--rejected-bg); color: var(--rejected); }

.orders {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 1.5rem;
}

.order {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  display: flex;
  gap: 1rem;
}

.order img {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg);
  flex-shrink: 0;
}

.file-icon {
  width: 84px;
  height: 84px;
  border-radius: 8px;
  background: var(--completed-bg);
  color: var(--completed);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
  padding: 0.3rem;
  text-decoration: none;
}
.file-icon .ext { font-size: 1.3rem; }
.file-icon span.name {
  font-weight: 500;
  word-break: break-all;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.hint {
  font-size: 0.82rem;
  color: var(--ink-dim);
  margin-top: 0.4rem;
}

select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--ink);
}

.pickup-box {
  margin-top: 0.8rem;
  background: var(--bg);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
}
.pickup-label { font-size: 0.8rem; color: var(--ink-dim); margin-bottom: 0.4rem; }
.pickup-row { display: flex; gap: 0.5rem; }
.pickup-row input {
  flex: 1;
  min-width: 0;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.8rem;
  background: var(--card);
  color: var(--ink-dim);
}
.pickup-row button {
  background: var(--completed-bg);
  color: var(--completed);
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.printer-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 1.5rem;
}
.printer-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  text-decoration: none;
  color: var(--ink);
}
.printer-card:hover { border-color: var(--accent); }
.printer-name { font-weight: 700; }
.printer-location { font-size: 0.85rem; color: var(--ink-dim); }
.printer-arrow { color: var(--ink-dim); }

.pickup-page-name {
  font-size: 0.95rem;
  color: var(--ink-dim);
  margin-bottom: 0.2rem;
}

.order-body { flex: 1; min-width: 0; }

.order-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.order-requester { font-weight: 700; }

.order-time { font-size: 0.78rem; color: var(--ink-dim); white-space: nowrap; font-variant-numeric: tabular-nums; }

.order-note { color: var(--ink-dim); font-size: 0.88rem; margin: 0.25rem 0 0.6rem; }

.badge {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}
.badge.pending { background: var(--pending-bg); color: var(--pending); }
.badge.scheduled { background: var(--pending-bg); color: var(--pending); }
.badge.approved { background: var(--approved-bg); color: var(--approved); }
.badge.confirmed { background: var(--approved-bg); color: var(--approved); }
.badge.sent_to_printer { background: var(--approved-bg); color: var(--approved); }
.badge.rejected { background: var(--rejected-bg); color: var(--rejected); }
.badge.declined { background: var(--rejected-bg); color: var(--rejected); }
.badge.schedule_rejected { background: var(--rejected-bg); color: var(--rejected); }
.badge.printing { background: var(--printing-bg); color: var(--printing); }
.badge.completed { background: var(--completed-bg); color: var(--completed); }

.order-actions { display: flex; gap: 0.5rem; }

.empty {
  text-align: center;
  color: var(--ink-dim);
  padding: 2.5rem 1rem;
  font-size: 0.9rem;
}

.conn-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rejected);
  margin-right: 0.4rem;
}
.conn-dot.live { background: var(--approved); }

.conn-label {
  font-size: 0.8rem;
  color: var(--ink-dim);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
}

nav.top {
  max-width: 880px;
  margin: 0 auto;
  padding: 1rem 1.25rem 0;
  font-size: 0.85rem;
}
nav.top a { color: var(--ink-dim); text-decoration: none; }
nav.top a:hover { color: var(--accent); }
