@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/variable/pretendardvariable.css");

:root {
  color: #0A1A33;
  background: #F2F1EC;
  font-family:
    "Pretendard Variable", "Pretendard", "Malgun Gothic", -apple-system,
    BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid #0E275033;
  border-radius: 6px;
  background: #FBFAF6;
  color: #0A1A33;
  font-weight: 750;
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: #0E2750;
  color: #0E2750;
}

button:disabled {
  cursor: wait;
  opacity: 0.58;
}

button.primary {
  border-color: #0E2750;
  background: #0E2750;
  color: #FBFAF6;
}

button.danger {
  border-color: #b42318;
  background: #FBFAF6;
  color: #b42318;
}

button.danger:hover:not(:disabled) {
  border-color: #B42318;
  color: #B42318;
}

.page {
  width: min(1360px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.app-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  padding-bottom: 18px;
  border-bottom: 1px solid #0E275021;
}

.eyebrow {
  margin: 0 0 6px;
  color: #6E7A8F;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 2rem;
  line-height: 1.15;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.header-actions,
.button-row,
.gmail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.badge,
.mini-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 850;
}

.badge.ok {
  background: #0E275014;
  color: #0E2750;
}

.badge.warn {
  background: #C9A86A33;
  color: #A8853F;
}

.mini-badge {
  margin-bottom: 8px;
  background: #0E275014;
  color: #0E2750;
}

.backend-notice,
.notice {
  display: grid;
  gap: 4px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  line-height: 1.45;
}

.backend-notice {
  border: 1px solid #C9A86A;
  background: #C9A86A33;
}

.backend-notice small {
  color: #A8853F;
}

.notice {
  border: 1px solid #0E275021;
  background: #FBFAF6;
  color: #0A1A33;
}

.notice.success {
  border-color: #0E275033;
  background: #0E275014;
  color: #0E2750;
}

.notice.error {
  border-color: #FEE4E2;
  background: #FEE4E2;
  color: #B42318;
}

.settings-panel,
.status-monitor {
  margin-top: 16px;
}

.settings-panel {
  padding: 16px;
  border: 1px solid #0E275033;
  border-radius: 8px;
  background: #FBFAF6;
}

.settings-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}

.settings-head p {
  margin-bottom: 0;
  color: #6E7A8F;
  line-height: 1.45;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settings-group {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #0E275021;
  border-radius: 8px;
  background: #FBFAF6;
}

.advanced-settings {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.status-monitor {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.monitor-item {
  min-height: 98px;
  padding: 12px;
  border: 1px solid #0E275033;
  border-radius: 8px;
  background: #FBFAF6;
}

.monitor-item.ok {
  border-color: #0E275033;
  background: #0E275014;
}

.monitor-item.warn {
  border-color: #C9A86A;
  background: #C9A86A33;
}

.monitor-item.focus {
  border-color: #0E275047;
  background: #0E275014;
}

.monitor-item.neutral {
  background: #FBFAF6;
}

.monitor-item span,
.monitor-item small {
  display: block;
}

.monitor-item span {
  color: #6E7A8F;
  font-size: 0.82rem;
  font-weight: 850;
}

.monitor-item strong {
  display: block;
  margin: 6px 0;
  font-size: 1.12rem;
}

.monitor-item small {
  color: #6E7A8F;
  line-height: 1.4;
}

.workflow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.workflow-card,
.work-panel,
.flow-step {
  border: 1px solid #0E275033;
  border-radius: 8px;
  background: #FBFAF6;
}

.workflow-card {
  display: grid;
  gap: 10px;
  min-height: 205px;
  padding: 14px;
}

.workflow-card.next {
  border-color: #0E2750;
  box-shadow: 0 0 0 2px rgba(49, 95, 157, 0.1);
}

.workflow-card p {
  min-height: 42px;
  margin-bottom: 0;
  color: #6E7A8F;
  line-height: 1.45;
}

.workflow-card strong {
  min-height: 22px;
  color: #0E2750;
  font-size: 0.9rem;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #0E2750;
  color: #FBFAF6;
  font-size: 0.86rem;
  font-weight: 850;
}

.layout {
  display: block;
}

.work-panel {
  padding: 18px;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: #6E7A8F;
  font-size: 0.86rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #0E275033;
  border-radius: 6px;
  background: #FBFAF6;
  color: #0A1A33;
}

input {
  min-height: 38px;
  padding: 0 10px;
}

select {
  min-height: 38px;
  padding: 0 34px 0 10px;
}

textarea {
  padding: 10px;
  line-height: 1.5;
  resize: vertical;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid #0E275021;
}

.tab.active {
  border-color: #0E2750;
  background: #0E275014;
  color: #0E2750;
}

.tab-panel {
  padding-top: 18px;
}

.panel-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.panel-title p {
  margin-bottom: 0;
  color: #6E7A8F;
  line-height: 1.45;
}

.summary-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.inline-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid #0E275033;
  border-radius: 8px;
  background: #0E275014;
  color: #0E2750;
}

.inline-status span {
  color: #0E2750;
}

.contact-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid #0E275033;
  border-radius: 8px;
  background: #FBFAF6;
}

.contact-actions strong,
.contact-actions span {
  display: block;
}

.contact-actions span {
  margin-top: 4px;
  color: #6E7A8F;
  font-size: 0.9rem;
}

.import-review {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid #0E275033;
  border-radius: 8px;
  background: #FBFAF6;
}

.import-review-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.import-review h3 {
  margin-bottom: 4px;
  font-size: 1.08rem;
}

.import-review p {
  margin-bottom: 0;
  color: #6E7A8F;
  line-height: 1.45;
}

.import-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.import-stats div {
  min-height: 70px;
  padding: 10px 12px;
  border: 1px solid #0E275033;
  border-radius: 8px;
  background: #FBFAF6;
}

.import-stats span,
.import-stats strong,
.import-field small {
  display: block;
}

.import-stats span {
  margin-bottom: 4px;
  color: #6E7A8F;
  font-size: 0.84rem;
  font-weight: 800;
}

.import-stats strong {
  color: #0A1A33;
  font-size: 1.25rem;
}

.mapping-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.import-field small {
  min-height: 20px;
  color: #6E7A8F;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.import-help {
  padding: 10px 12px;
  border: 1px solid #0E275033;
  border-radius: 8px;
  background: #FBFAF6;
}

.import-preview table {
  min-width: 680px;
}

.summary-item {
  min-height: 78px;
  padding: 12px;
  border: 1px solid #0E275033;
  border-radius: 8px;
  background: #FBFAF6;
}

.summary-item span {
  display: block;
  margin-bottom: 6px;
  color: #6E7A8F;
  font-size: 0.86rem;
  font-weight: 800;
}

.summary-item strong {
  font-size: 1.55rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid #0E275033;
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid #0E275014;
  text-align: left;
  vertical-align: top;
}

th {
  background: #F2F1EC;
  color: #6E7A8F;
  font-size: 0.84rem;
  font-weight: 850;
}

td {
  color: #0A1A33;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.select-col {
  width: 48px;
  text-align: center;
}

.select-col input {
  width: 18px;
  min-height: 18px;
  accent-color: #0E2750;
}

.selected-row td {
  background: #0E275014;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.empty,
.table-note {
  margin: 0;
  padding: 16px;
  border: 1px dashed #0E275033;
  border-radius: 8px;
  color: #6E7A8F;
  line-height: 1.5;
}

.table-note {
  border: 0;
}

.flow-list {
  display: grid;
  gap: 14px;
}

.flow-help {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid #0E275033;
  border-radius: 8px;
  background: #FBFAF6;
  color: #6E7A8F;
  line-height: 1.45;
}

.flow-help strong {
  color: #0A1A33;
}

.flow-step {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #0E275033;
  border-radius: 8px;
  background: #FBFAF6;
}

.flow-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.flow-head p {
  margin-bottom: 0;
  color: #6E7A8F;
  line-height: 1.45;
}

.flow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.schedule-grid {
  grid-template-columns: minmax(180px, 260px) minmax(180px, 1fr);
}

.file-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #0E275033;
  border-radius: 6px;
  background: #FBFAF6;
  font-weight: 750;
  cursor: pointer;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.gmail-actions {
  margin-bottom: 16px;
}

.checklist {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.checklist div {
  min-height: 96px;
  padding: 12px;
  border: 1px solid #C9A86A;
  border-radius: 8px;
  background: #C9A86A33;
}

.checklist div.done {
  border-color: #0E275033;
  background: #0E275014;
}

.checklist strong,
.checklist span {
  display: block;
}

.checklist strong {
  margin-bottom: 6px;
}

.checklist span {
  color: #6E7A8F;
  font-size: 0.9rem;
  line-height: 1.45;
}

@media (max-width: 1120px) {
  .status-monitor {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workflow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page {
    width: min(100% - 24px, 1360px);
    padding-top: 18px;
  }

  .app-header,
  .panel-title,
  .settings-head,
  .import-review-head,
  .flow-head,
  .contact-actions {
    grid-template-columns: 1fr;
  }

  .workflow,
  .status-monitor,
  .summary-row,
  .import-stats,
  .mapping-grid,
  .checklist,
  .flow-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 1.75rem;
  }
}
