:root {
  --bg: #f5f7fb;
  --bg-soft: #eef2f9;
  --panel: #ffffff;
  --line: #d8dee9;
  --ink: #1a2433;
  --muted: #5a6779;
  --accent: #0f5ed9;
  --accent-hover: #0c4bb0;
  --sidebar: #13233d;
  --sidebar-text: #dfe8f5;
  --success: #2ca06b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: linear-gradient(180deg, var(--bg-soft) 0%, #f8faff 100%);
  color: var(--ink);
}

.dashboard {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
}

.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 24px 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  color: #ffffff;
  letter-spacing: 0.3px;
}

.logo strong {
  display: block;
  font-size: 17px;
}

.logo p {
  margin: 3px 0 0;
  font-size: 12px;
  color: rgba(223, 232, 245, 0.8);
}

.logo-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #ffffff;
  font-size: 26px;
  font-weight: 800;
  color: #12c24a;
  padding-bottom: 2px;
}

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

.menu li {
  padding: 10px 12px;
  cursor: pointer;
  border-radius: 10px;
  transition: background-color 0.2s ease;
}

.menu li:hover,
.menu li.active {
  background: rgba(255, 255, 255, 0.16);
}

.sidebar-cta {
  margin-top: 14px;
}

.sidebar-action {
  width: 100%;
  margin-top: 0;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--success);
  color: #ffffff;
  cursor: pointer;
  font-weight: 600;
}

.sidebar-action:hover {
  background: #227e54;
}

.content {
  padding: 28px;
}

.content-frame {
  width: 100%;
  height: calc(100vh - 56px);
  border: 0;
  background: transparent;
  border-radius: 14px;
}

.page {
  padding: 28px;
}

h2 {
  margin-bottom: 20px;
}

.overview-page {
  min-height: 100%;
  background: linear-gradient(180deg, var(--bg-soft) 0%, #f8faff 100%);
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  max-width: 760px;
  margin: 0 auto;
}

.overview-license-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f1f6ff 100%);
}

.overview-banner-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.overview-license-meta {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.overview-license-version {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.overview-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.overview-eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.overview-title {
  margin: 0 0 24px;
  font-size: 34px;
  line-height: 1.15;
}

.overview-subtitle {
  max-width: 720px;
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}

.overview-badge {
  padding: 10px 14px;
  border: 1px solid rgba(15, 94, 217, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.overview-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.summary-card {
  background: #f7f9fd;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}

.summary-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.summary-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
}

.overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
  gap: 24px;
}

.overview-main,
.overview-side {
  display: grid;
  gap: 20px;
}

.overview-card,
.overview-side-card,
.panel,
.card {
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.status-card {
  display: grid;
  gap: 12px;
}

.overview-form-card {
  grid-column: auto;
  width: 100%;
  max-width: none;
}

.overview-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.overview-chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: #f0f5ff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.overview-card-title {
  margin: 0 0 10px;
  font-size: 22px;
}

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

.overview-section-head .overview-card-title {
  margin-bottom: 0;
}

.connection-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.connection-badge.is-idle {
  background: #eef2f7;
  color: var(--muted);
}

.connection-badge.is-loading {
  background: rgba(15, 94, 217, 0.12);
  color: var(--accent);
}

.connection-badge.is-success {
  background: rgba(44, 160, 107, 0.12);
  color: var(--success);
}

.connection-badge.is-error {
  background: rgba(193, 63, 63, 0.12);
  color: #c13f3f;
}

.overview-card-copy {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
}

.overview-field,
.field {
  margin-bottom: 18px;
}

.overview-field label,
.field label,
.field h3 {
  display: block;
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.overview-field input,
.overview-field select,
.field input,
.field select,
.field textarea,
.row input {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.overview-field select,
.field select {
  min-height: 46px;
  appearance: none;
}

.field textarea {
  resize: vertical;
}

.overview-help,
#loginStatus {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.field-help {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.file-picker-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.field .file-picker-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 132px;
  min-width: 132px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  margin: 0;
  text-align: center;
  box-shadow: none;
}

#addTaskBtn {
  width: 132px;
  min-width: 132px;
  justify-content: center;
  text-align: center;
}

.file-picker-selected {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.visually-hidden-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.image-folder-preview {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f9fd;
}

.image-folder-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.image-folder-preview-head strong {
  font-size: 14px;
}

.image-folder-preview-head span {
  color: var(--muted);
  font-size: 12px;
}

.image-folder-preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.image-preview-card {
  display: grid;
  gap: 8px;
}

.image-preview-thumb,
.image-preview-more {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.image-preview-thumb {
  object-fit: cover;
}

.image-preview-name {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  word-break: break-all;
}

.image-preview-more {
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #edf3ff 0%, #f8fbff 100%);
  color: var(--accent);
  font-weight: 700;
}

.image-preview-more-count {
  font-size: 26px;
  line-height: 1;
}

.overview-actions,
.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.settings-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.settings-meta-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f9fd;
}

.settings-meta-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.settings-divider {
  margin: 24px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.settings-license-status {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f9fd;
}

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

.settings-license-status p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.6;
}

.settings-license-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.settings-license-detail-grid strong {
  display: block;
  font-size: 14px;
  word-break: break-word;
}

.operator-board-card {
  display: grid;
  gap: 14px;
}

.operator-message-list {
  display: grid;
  gap: 12px;
}

.operator-message-item {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f9fd;
}

.operator-message-item strong {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
}

.operator-message-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
  white-space: pre-wrap;
}

.operator-message-tag {
  display: inline-flex;
  align-items: center;
  margin-bottom: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(15, 94, 217, 0.12);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.operator-message-tag-reply {
  background: rgba(44, 160, 107, 0.12);
  color: var(--success);
}

.admin-page {
  max-width: 1400px;
  margin: 0 auto;
}

.admin-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.admin-title {
  margin-bottom: 8px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  gap: 20px;
}

.checkbox-field {
  margin-top: -4px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.admin-user-table-wrap {
  overflow-x: auto;
}

.admin-user-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-user-table th,
.admin-user-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
  vertical-align: top;
}

.admin-user-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-user-table tbody tr {
  cursor: pointer;
}

.admin-user-table tbody tr:hover {
  background: #f7f9fd;
}

@media (max-width: 980px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-hero {
    flex-direction: column;
  }
}

.post-type-segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.post-type-option {
  display: block;
  cursor: pointer;
}

.post-type-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.post-type-card {
  display: grid;
  gap: 6px;
  min-height: 78px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.post-type-card strong {
  font-size: 15px;
  color: var(--ink);
}

.post-type-card small {
  color: var(--muted);
  line-height: 1.5;
}

.post-type-option:hover .post-type-card {
  border-color: rgba(15, 94, 217, 0.28);
  transform: translateY(-1px);
}

.post-type-option input:checked + .post-type-card {
  border-color: var(--accent);
  background: #f3f7ff;
  box-shadow: 0 10px 24px rgba(15, 94, 217, 0.12);
}

.overview-action-row {
  display: grid;
  gap: 12px;
  align-items: end;
}

.overview-user-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.overview-naver-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

.overview-action-row .field {
  margin-bottom: 0;
}

.overview-steps {
  margin: 0;
  padding-left: 20px;
  color: var(--ink);
  line-height: 2;
}

.overview-status-list {
  display: grid;
  gap: 12px;
}

.overview-status-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #f7f9fd;
  border: 1px solid var(--line);
}

.overview-status-item span {
  color: var(--muted);
}

.overview-status-item strong {
  color: var(--ink);
}

.overview-table {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.overview-table-row {
  display: grid;
  grid-template-columns: 56px minmax(280px, 1.9fr) 120px 100px 232px;
  gap: 18px;
  align-items: center;
  padding: 14px 18px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.task-actions-cell {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}

.task-delete-btn {
  min-width: 64px;
  padding: 8px 10px;
  white-space: nowrap;
  flex: 0 0 auto;
  font-size: 14px;
}

.task-generate-btn {
  width: 156px;
  min-width: 156px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  flex: 0 0 auto;
  padding: 10px 12px;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.2;
}

.overview-table-row:last-child {
  border-bottom: 0;
}

.overview-table-head {
  background: #f7f9fd;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.success {
  background: rgba(44, 160, 107, 0.12);
  color: var(--success);
}

.status-pill.pending {
  background: rgba(15, 94, 217, 0.12);
  color: var(--accent);
}

.status-pill.idle {
  background: #eef2f7;
  color: var(--muted);
}

.overview-log {
  padding: 12px;
  border-radius: 10px;
  background: #0f1726;
  color: #dbe7ff;
  font-family: Consolas, monospace;
  font-size: 12px;
  line-height: 1.7;
}

.overview-log p {
  margin: 0;
}

.panel {
  max-width: 1040px;
}

.section-block {
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid #e5e7eb;
}

.section-block:last-of-type {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}

.section-title {
  margin: 0 0 16px;
  font-size: 18px;
}

.guide-page {
  line-height: 1.65;
}

.guide-subtitle {
  margin: 20px 0 10px;
  font-size: 16px;
}

.guide-list {
  margin: 0;
  padding-left: 20px;
}

.guide-list li + li {
  margin-top: 8px;
}

.guide-list-ordered {
  padding-left: 22px;
}

.guide-chip,
.guide-button-chip,
.guide-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  min-height: 26px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.guide-chip {
  border: 1px solid #d6dbe4;
  background: #f8fafc;
  color: #1f2937;
}

.guide-button-chip {
  border: 1px solid transparent;
  background: linear-gradient(180deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.guide-status-chip {
  border: 1px solid transparent;
}

.guide-status-chip.is-idle {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}

.guide-status-chip.is-running {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.guide-status-chip.is-success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.guide-status-chip.is-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.task-list-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.task-list-header-copy {
  min-width: 0;
}

.task-list-description {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.task-status-banner {
  min-height: 20px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.task-status-banner.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.task-status-banner.is-error {
  color: #c13f3f;
}

.task-status-banner.is-progress {
  color: var(--accent);
}

.task-list-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.task-queue-summary {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7f9fd;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.primary-button,
.secondary-button,
button {
  padding: 10px 18px;
  font: inherit;
  border-radius: 8px;
  cursor: pointer;
}

.primary-button,
button {
  border: 0;
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

.primary-button:hover,
button:hover {
  background: var(--accent-hover);
}

.primary-button.is-loading {
  background: #7ea8eb;
  cursor: wait;
}

.primary-button.is-success {
  background: var(--success);
}

.primary-button.is-error {
  background: #c13f3f;
}

.secondary-button {
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
}

.secondary-button:hover {
  background: #f7f9fd;
}

.row {
  display: flex;
  align-items: center;
  margin-bottom: 18px;
}

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

.overview-inline-fields .field {
  margin-bottom: 18px;
}

.row label {
  width: 120px;
  font-weight: 600;
}

#loginBtn,
#emailLoginBtn,
#googleLoginBtn {
  min-width: 180px;
}

#loginStatus {
  max-width: 760px;
  margin: 16px auto 0;
}

@media (max-width: 960px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 16px;
  }

  .content {
    padding: 14px;
  }

  .content-frame {
    height: calc(100vh - 28px);
  }

  .overview-layout {
    grid-template-columns: 1fr;
  }

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

  .overview-inline-fields {
    grid-template-columns: 1fr;
  }

  .post-type-segmented {
    grid-template-columns: 1fr;
  }

  .overview-user-row,
  .overview-naver-row {
    grid-template-columns: 1fr;
  }

  .overview-hero {
    flex-direction: column;
  }

  .task-list-header {
    flex-direction: column;
    align-items: stretch;
  }

  .task-list-header-actions {
    justify-content: flex-start;
  }

  .overview-table-row {
    grid-template-columns: 1fr;
  }
}
