/* Basic reset */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #050816;
  color: #f5f5f5;
}

/* Auth */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card {
  background: #0f172a;
  padding: 32px;
  border-radius: 18px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0,0,0,0.45);
}
.auth-card h1 { margin-bottom: 8px; }

/* Layout */
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 8px;
}
.topbar-left { display:flex; align-items:center; gap:8px; }
.logo-dot {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(135deg,#7c3aed,#ec4899);
}
.topbar-title {
  font-weight: 600;
  letter-spacing: .02em;
}
.topbar-right { display:flex; align-items:center; gap:10px; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr);
  gap: 16px;
}
.single-layout {
  max-width: 1000px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .page { padding: 8px; }
}

/* Cards */
.card {
  background: radial-gradient(circle at top, #111827, #020617);
  border-radius: 20px;
  padding: 20px 18px;
  border: 1px solid rgba(148,163,184,0.25);
}
.card-title {
  font-size: 20px;
  margin-bottom: 4px;
}
.card-subtitle {
  font-size: 13px;
  color: #9ca3af;
  margin-bottom: 16px;
}

/* Form */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
  gap: 12px 16px;
}
.field { display:flex; flex-direction:column; gap:4px; }
.field.full { grid-column: 1 / -1; }
label {
  font-size: 13px;
  color: #cbd5f5;
}
input[type="text"],
input[type="number"],
input[type="password"],
textarea,
select {
  background: #020617;
  border-radius: 10px;
  border: 1px solid #1f2937;
  padding: 8px 10px;
  color: #e5e7eb;
  font-size: 14px;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #6366f1;
}

/* Buttons */
.btn {
  border-radius: 999px;
  padding: 7px 14px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn.primary {
  background: linear-gradient(135deg,#6366f1,#ec4899);
  color: #fff;
}
.btn.secondary {
  background: #0f172a;
  color: #e5e7eb;
  border: 1px solid #4b5563;
}
.btn.danger {
  background: #b91c1c;
  color: #fee2e2;
}
.btn.small {
  padding: 4px 10px;
  font-size: 12px;
}
.btn.loading {
  opacity: 0.6;
  pointer-events: none;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

/* Table */
.table-wrapper {
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 13px;
}
.table th,
.table td {
  padding: 6px 8px;
  border-bottom: 1px solid #111827;
}
.table th {
  text-align: left;
  font-weight: 500;
  color: #9ca3af;
}
.truncate {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.table-actions {
  white-space: nowrap;
}

/* Badges */
.badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
}
.badge-draft     { background: rgba(59,130,246,0.15); color: #93c5fd; }
.badge-sent_wp   { background: rgba(34,197,94,0.15); color: #bbf7d0; }
.badge-deleted   { background: rgba(248,113,113,0.15); color: #fecaca; }

/* Status text */
.status-text {
  font-size: 13px;
  color: #e5e7eb;
}
.status-text.error { color: #fecaca; }
.status-text.success { color: #bbf7d0; }

.muted {
  color: #9ca3af;
}
.small { font-size: 12px; }

.link-small {
  color: #93c5fd;
  text-decoration: none;
}
.link-small:hover { text-decoration: underline; }

/* Inline images */
.ssstoks-inline-image {
  margin: 14px 0;
  text-align: center;
}
.ssstoks-inline-image img {
  max-width: 100%;
  border-radius: 14px;
}
.ssstoks-inline-image figcaption {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 4px;
}
.ai-image-block {
  margin: 14px 0;
  text-align: center;
}
.ai-image-block img {
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.ai-image-block figcaption {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

/* editor previews */
.ai-image-preview img {
  max-width: 260px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.inline-image-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.inline-image-item {
  width: 140px;
}
.inline-image-item img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.inline-image-caption {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
