* {
  box-sizing: border-box;
}

:root {
  font-family: "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #182129;
  background: #f3f7f6;
  font-synthesis: none;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: #f3f7f6;
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.center-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}

.auth-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid #d6e0de;
  border-radius: 18px;
  padding: 28px 26px;
  box-shadow: 0 14px 36px rgba(20, 44, 39, 0.08);
}

.auth-card h1 {
  margin: 0 0 14px;
  font-size: 24px;
  line-height: 1.35;
}

.auth-card p {
  margin: 0 0 20px;
  color: #5a6c69;
  line-height: 1.7;
}

.auth-card .subtle {
  margin-top: 22px;
  margin-bottom: 0;
  font-size: 13px;
}

.auth-card label,
.form-grid label {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 700;
  color: #455653;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfd9d7;
  border-radius: 10px;
  background: #fff;
  color: #182129;
  padding: 10px 12px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #668e85;
  box-shadow: 0 0 0 3px rgba(102, 142, 133, .13);
}

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

.btn {
  border: 1px solid #cfd9d7;
  border-radius: 9px;
  padding: 8px 12px;
  background: #fff;
  color: #263734;
  font-weight: 700;
  font-size: 13px;
}

.btn:hover {
  background: #f7faf9;
}

.btn.primary {
  background: #315f56;
  border-color: #315f56;
  color: #fff;
}

.btn.primary:hover {
  background: #284f48;
}

.btn.danger {
  border-color: #e8c9c9;
  color: #a53d3d;
  background: #fff7f7;
}

.btn.wide {
  width: 100%;
  margin-top: 18px;
  padding-block: 11px;
}

.btn:disabled,
.mini:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.error-text {
  min-height: 20px;
  color: #b33f3f !important;
  font-size: 13px;
  margin-top: 10px !important;
}

.app {
  min-height: 100vh;
}

header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid #dbe3e1;
  backdrop-filter: blur(10px);
}

.title h1 {
  margin: 0;
  font-size: 20px;
  white-space: nowrap;
}

.header-right {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.connection,
.user-badge {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.connection.pending {
  background: #f5efe2;
  color: #8c6a22;
}

.connection.online {
  background: #e5f4ec;
  color: #28704e;
}

.connection.offline {
  background: #f8e7e7;
  color: #a33f3f;
}

.user-badge {
  background: #edf2f1;
  color: #485b57;
}

.workspace {
  padding: 18px 22px 32px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 160px 160px auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.summary {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  font-size: 13px;
  color: #64736f;
  white-space: nowrap;
}

.summary strong {
  color: #1d2a27;
}

.panel {
  background: #fff;
  border: 1px solid #dbe3e1;
  border-radius: 14px;
  box-shadow: 0 5px 18px rgba(20, 44, 39, .04);
}

.pool-panel {
  padding: 14px;
  margin-bottom: 16px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.section-head h2 {
  margin: 0;
  font-size: 15px;
}

.count {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: #edf2f1;
  font-size: 12px;
  font-weight: 800;
}

.unassigned {
  min-height: 88px;
  display: flex;
  gap: 9px;
  overflow-x: auto;
  align-items: stretch;
}

.unassigned .task {
  min-width: 300px;
  max-width: 360px;
}

.board-wrap {
  overflow: auto;
  padding-bottom: 8px;
}

.designer-grid {
  display: grid;
  gap: 10px;
  align-items: start;
}

.designer-column {
  min-width: 176px;
  background: #fff;
  border: 1px solid #dbe3e1;
  border-radius: 13px;
  overflow: hidden;
}

.designer-head {
  padding: 11px;
  border-bottom: 1px solid #e1e8e6;
  background: #fbfcfc;
}

.designer-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #dfeae7;
  color: #2f5d54;
  font-weight: 900;
}

.designer-info {
  min-width: 0;
  flex: 1;
}

.designer-name {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-weight: 800;
  color: #1c2926;
}

.designer-name:focus {
  box-shadow: none;
  border: 0;
  outline: 1px solid #9db8b2;
}

.load {
  margin-top: 3px;
  color: #7a8985;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.load-status {
  display: inline-block;
  margin-top: 7px;
  font-size: 10px;
  font-weight: 700;
  color: #4d756b;
}

.load-status.over {
  color: #b24646;
}

.dropzone {
  min-height: 140px;
  padding: 8px;
  transition: background .15s ease, outline .15s ease;
}

.dropzone.over {
  background: #eef7f4;
  outline: 2px dashed #7da399;
  outline-offset: -4px;
}

.empty {
  padding: 20px 10px;
  text-align: center;
  color: #9aa6a3;
  font-size: 11px;
}

.task {
  position: relative;
  margin-bottom: 8px;
  padding: 10px;
  border: 1px solid #dfe6e4;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 7px rgba(21, 41, 36, .035);
  cursor: grab;
}

.task:last-child {
  margin-bottom: 0;
}

.task.dragging {
  opacity: .5;
}

.task.in-progress {
  border-color: #a7c9bd;
  box-shadow: 0 0 0 1px rgba(85, 144, 126, .08);
}

.progress-ribbon {
  margin: -10px -10px 8px;
  padding: 5px 8px;
  border-radius: 9px 9px 0 0;
  background: #e6f3ee;
  color: #2c725b;
  font-size: 10px;
  font-weight: 900;
}

.task-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 6px;
}

.order {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border-radius: 6px;
  background: #edf2f1;
  color: #596a66;
  font-size: 10px;
  font-weight: 900;
}

.task-title {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.priority {
  padding: 3px 5px;
  border-radius: 5px;
  background: #edf2f1;
  color: #667672;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}

.priority.high {
  background: #fff3dd;
  color: #9a6921;
}

.priority.urgent {
  background: #fee9e9;
  color: #b64242;
}

.meta {
  display: grid;
  gap: 3px;
  margin-top: 8px;
  color: #77847f;
  font-size: 9px;
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.mini {
  border: 1px solid #dce4e2;
  border-radius: 6px;
  padding: 4px 6px;
  background: #fbfcfc;
  color: #52635f;
  font-size: 9px;
  font-weight: 800;
}

.progress-btn.active {
  border-color: #9ec9b9;
  background: #e9f6f1;
  color: #2b6c57;
}

.complete-btn {
  margin-left: auto;
  border-color: #9fc8b9;
  background: #edf7f3;
  color: #276a55;
}

.complete-btn:hover:not(:disabled) {
  border-color: #79ad9a;
  background: #dff1ea;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(25, 36, 33, .42);
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  width: min(620px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 22px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(18, 29, 26, .24);
}

.email-modal {
  width: min(760px, 100%);
}

.modal h3 {
  margin: 0 0 16px;
  font-size: 20px;
}

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

.form-grid label {
  margin-top: 0;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.edit-meta {
  color: #81908c;
  font-size: 11px;
}

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

.right-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.email-options {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 4px;
}

.check-row {
  display: inline-flex !important;
  grid-template-columns: auto 1fr !important;
  align-items: center;
  gap: 7px !important;
  font-weight: 600 !important;
}

.check-row input {
  width: auto;
}

.preview-title {
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 800;
  color: #4e615c;
}

.email-preview {
  min-height: 120px;
  max-height: 240px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid #dce4e2;
  border-radius: 10px;
  background: #f8faf9;
  white-space: pre-wrap;
  word-break: break-word;
  font: 12px/1.65 "Noto Sans KR", sans-serif;
}

.email-status {
  min-height: 18px;
  margin: 0;
  color: #677773;
  font-size: 12px;
}

.email-status.error {
  color: #af3e3e;
}

.email-status.success {
  color: #24704e;
}

.toast {
  display: none;
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: min(520px, calc(100vw - 32px));
  padding: 10px 14px;
  border-radius: 10px;
  background: #22322e;
  color: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
  font-size: 12px;
}

@media (max-width: 980px) {
  header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-right,
  .actions {
    justify-content: flex-start;
  }

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

  .summary {
    justify-content: flex-start;
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .workspace {
    padding: 12px;
  }

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

  .summary {
    grid-column: auto;
  }

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

  .form-grid .full {
    grid-column: auto;
  }

  .modal-actions,
  .email-modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .right-actions {
    margin-left: 0;
  }

  .right-actions .btn,
  .modal-actions > .btn {
    flex: 1;
  }
}


.bulk-schedule-input {
  min-height: 300px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.bulk-help {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid #dce4e2;
  border-radius: 10px;
  background: #f8faf9;
  color: #5d6d69;
  font-size: 12px;
  line-height: 1.55;
}

.bulk-help strong {
  color: #2f423d;
}
