:root {
  --green: #10994c;
  --green-dark: #0a7a38;
  --green-light: #e3f7ea;
  --cream: #f7f6f3;
  --white: #ffffff;
  --charcoal: #1c1c1a;
  --gray: #6b6b65;
  --gray-line: #e5e3dd;
  --red: #c0392b;
  --font-body: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--charcoal);
}

a { color: var(--green); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius);
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary { background: var(--green); color: var(--white); }
.btn-primary:hover { background: var(--green-dark); }
.btn-secondary { background: var(--white); color: var(--charcoal); border: 1px solid var(--gray-line); }
.btn-secondary:hover { background: var(--green-light); }
.btn-danger { background: var(--white); color: var(--red); border: 1px solid var(--gray-line); }
.btn-danger:hover { background: #fbeceb; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---------- Layout dasar admin ---------- */
.admin-topbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-line);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.admin-topbar .brand {
  font-weight: 700;
  color: var(--green-dark);
  text-decoration: none;
  font-size: 1.05rem;
}

.admin-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

/* ---------- Login ---------- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: var(--white);
  border-radius: 16px;
  padding: 36px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 4px 24px rgba(28, 28, 26, 0.08);
}

.login-card h1 {
  font-size: 1.3rem;
  margin: 0 0 4px;
  color: var(--green-dark);
}

.login-card p.sub {
  color: var(--gray);
  margin: 0 0 24px;
  font-size: 0.9rem;
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.field input,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-line);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--green);
}

.error-text {
  color: var(--red);
  font-size: 0.85rem;
  margin: 8px 0 0;
}

/* ---------- Dashboard: tabel artikel ---------- */
.dash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.dash-head h1 {
  margin: 0;
  font-size: 1.4rem;
}

.status-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}

.status-tab {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--gray-line);
  background: var(--white);
  color: var(--gray);
}

.status-tab.active {
  background: var(--green-light);
  color: var(--green-dark);
  border-color: var(--green-light);
}

.article-list {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-line);
  overflow: hidden;
}

.article-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gray-line);
}

.article-row:last-child { border-bottom: none; }

.article-row .cover-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--gray-line);
  flex-shrink: 0;
}

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

.article-row .info h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.article-row .meta {
  font-size: 0.8rem;
  color: var(--gray);
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-draft { background: #f1efe8; color: #6b6b65; }
.badge-published { background: var(--green-light); color: var(--green-dark); }

.row-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--gray);
}

/* ---------- Editor "Tambah Artikel" ---------- */
.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.editor-head a { color: var(--gray); font-size: 0.85rem; text-decoration: none; }

.title-input {
  width: 100%;
  font-size: 1.6rem;
  font-weight: 700;
  padding: 10px 4px;
  border: none;
  border-bottom: 2px solid var(--gray-line);
  background: transparent;
  margin-bottom: 6px;
  font-family: inherit;
}

.title-input:focus { outline: none; border-color: var(--green); }

.permalink {
  font-size: 0.82rem;
  color: var(--gray);
  margin-bottom: 24px;
}

.permalink code { background: var(--green-light); padding: 2px 6px; border-radius: 4px; color: var(--green-dark); }

.editor-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 860px) {
  .editor-grid { grid-template-columns: 1fr 280px; }
}

.editor-main .field { margin-bottom: 20px; }

#quill-editor {
  background: var(--white);
  border-radius: 0 0 var(--radius) var(--radius);
  min-height: 320px;
}

.ql-toolbar { border-radius: var(--radius) var(--radius) 0 0 !important; background: var(--white); }
.ql-container { border-radius: 0 0 var(--radius) var(--radius) !important; font-size: 1rem; }

.side-panel {
  background: var(--white);
  border: 1px solid var(--gray-line);
  border-radius: var(--radius);
  padding: 18px;
  height: fit-content;
}

.side-panel h4 {
  margin: 0 0 12px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--gray);
}

.side-panel .status-line {
  font-size: 0.85rem;
  margin-bottom: 14px;
}

.side-panel .actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cover-upload {
  border: 1px dashed var(--gray-line);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  cursor: pointer;
  margin-top: 8px;
}

.cover-upload img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 8px;
  display: block;
}

.cover-upload .hint {
  font-size: 0.8rem;
  color: var(--gray);
}

.save-indicator {
  font-size: 0.8rem;
  color: var(--gray);
  margin-top: 8px;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--charcoal);
  color: var(--white);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  z-index: 50;
}
