:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #263348;
  --border: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
  --font: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.header {
  margin-bottom: 24px;
}

.header h1 {
  margin: 0 0 6px;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.banner {
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #dbeafe;
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  font-size: 0.92rem;
}

.banner.warn {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fef3c7;
}

.hidden {
  display: none !important;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.tab-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  padding: 9px 16px;
  border-radius: 9px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
}

.card h2 {
  margin: 0 0 14px;
  font-size: 1.12rem;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #e2e8f0;
}

.field-hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 5px;
}

select,
input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px 13px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--primary);
}

.site-search-input {
  margin-bottom: 8px;
}

textarea {
  min-height: 150px;
  resize: vertical;
}

.dropzone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  background: rgba(15, 23, 42, 0.45);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone.dragover {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.12);
}

.dropzone p {
  margin: 0 0 6px;
  font-size: 0.93rem;
}

.dropzone small {
  color: var(--muted);
  font-size: 0.8rem;
}

.file-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.88rem;
}

.file-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 9px;
  padding: 10px 18px;
  font-size: 0.94rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, opacity 0.15s;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: #334155;
}

.btn-danger-sm {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 4px 10px;
  font-size: 0.8rem;
  border-radius: 6px;
  cursor: pointer;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.alert {
  padding: 12px 15px;
  border-radius: 9px;
  margin-top: 14px;
  font-size: 0.9rem;
}

.alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fecaca;
}

.alert-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #d1fae5;
}

.receipt-box {
  margin-top: 16px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: var(--radius);
  padding: 18px;
}

.receipt-code-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.receipt-code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: var(--bg);
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: #6ee7b7;
}

.lookup-row {
  display: flex;
  gap: 10px;
}

.lookup-row input {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  text-transform: uppercase;
}

.inquiry-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inquiry-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.inquiry-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.inquiry-site {
  font-size: 0.8rem;
  color: #93c5fd;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.inquiry-title {
  margin: 4px 0 6px;
  font-size: 1.04rem;
  font-weight: 700;
}

.inquiry-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-pending {
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-answered {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.inquiry-body {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.93rem;
}

.reply-box {
  margin-top: 14px;
  background: rgba(59, 130, 246, 0.1);
  border-left: 3px solid var(--primary);
  border-radius: 6px;
  padding: 12px 14px;
}

.reply-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #93c5fd;
  margin-bottom: 6px;
}

.reply-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.93rem;
}

.att-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.att-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 11px;
  font-size: 0.83rem;
  color: var(--text);
  text-decoration: none;
}

.att-chip:hover {
  border-color: var(--primary);
}

.att-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px;
  font-size: 0.92rem;
}

@media (max-width: 640px) {
  .lookup-row {
    flex-direction: column;
  }
}
