*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --black:   #111111;
  --charcoal:#2C2C2C;
  --gray:    #6B6B6B;
  --border:  #E8E8E8;
  --bg:      #F7F7F7;
  --white:   #FFFFFF;
  --red:     #C00000;
  --sidebar: 228px;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--black);
  font-size: 13.5px;
  line-height: 1.5;
}

/* ══════════════════════════════════════
   LOGIN SCREEN
══════════════════════════════════════ */
/* ══════════════════════════════════════
   INIT / LOADING SCREEN
══════════════════════════════════════ */
#initScreen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  background: var(--white);
  z-index: 9999;
}
.init-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--black);
}
.init-brand span {
  font-weight: 300;
  font-size: 0.75em;
  letter-spacing: 3px;
  color: var(--gray);
  margin-left: 5px;
}
.init-spinner {
  width: 18px; height: 18px;
  border: 1.5px solid rgba(0,0,0,.12);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

#loginScreen,
#accessDenied {
  min-height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 2rem 1rem;
}

.login-modal {
  position: relative;
  z-index: 2;
  display: flex;
  width: calc(100% - 2rem);
  max-width: 760px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.06);
  animation: modalPop 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes modalPop {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* Left form panel */
.login-modal-left {
  flex: 1;
  background: var(--white);
  padding: 2.75rem 2.5rem 2.25rem;
}

.login-modal-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--black);
  margin-bottom: 1.75rem;
}
.login-modal-logo span {
  font-weight: 300;
  font-size: 0.78em;
  letter-spacing: 3px;
  color: var(--gray);
  margin-left: 4px;
}

.login-modal-heading {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 0.85rem;
}

.login-desc {
  font-size: 0.82rem;
  color: var(--gray);
  margin-bottom: 1.5rem;
  line-height: 1.65;
}

.login-modal-note {
  font-size: 0.72rem;
  color: var(--gray);
  margin-top: 1.25rem;
  opacity: 0.7;
}

/* Right editorial panel */
.login-modal-right {
  width: 260px;
  background: #F4F3F0;
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.lmr-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--black);
  letter-spacing: -0.03em;
  line-height: 1;
}

.lmr-sub {
  font-size: 0.6rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--gray);
  margin-top: 0.4rem;
}

.lmr-rule {
  width: 28px;
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0 1rem;
}

.lmr-tagline {
  font-size: 0.78rem;
  color: var(--gray);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.lmr-issue {
  font-size: 0.6rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(0,0,0,.3);
}

@media (max-width: 620px) {
  .login-modal-right { display: none; }
  .login-modal { max-width: 420px; }
}

.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 0.85rem 1.5rem;
  background: var(--white); border: 1.5px solid var(--border);
  font-family: 'Inter', sans-serif; font-size: 0.82rem; font-weight: 600;
  color: var(--black); cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.btn-google:hover { border-color: var(--black); box-shadow: 0 2px 14px rgba(0,0,0,.12); }
.btn-google:disabled { opacity: 0.5; cursor: not-allowed; }

.login-error { font-size: 0.78rem; color: var(--red); margin-top: 0.75rem; }

.btn-spinner {
  width: 14px; height: 14px;
  border: 1.5px solid rgba(0,0,0,.15);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════
   ADMIN SHELL
══════════════════════════════════════ */
#adminShell { display: none; min-height: 100vh; }
.shell-wrap { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar);
  background: var(--black);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 50;
}
.sb-brand {
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sb-brand-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em;
}
.sb-brand-sub {
  font-size: 0.58rem; letter-spacing: 3px;
  text-transform: uppercase; color: rgba(255,255,255,.35); margin-top: 2px;
}
.sb-nav { flex: 1; padding: 0.75rem 0; }
.sb-section-label {
  font-size: 0.58rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 2px;
  color: rgba(255,255,255,.25);
  padding: 1rem 1.25rem 0.5rem;
}
.nav-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 0.7rem 1.25rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px;
  color: rgba(255,255,255,.5);
  background: none; border: none; width: 100%; text-align: left;
  cursor: pointer; transition: color 0.15s, background 0.15s;
  text-decoration: none;
}
.nav-btn:hover { color: white; background: rgba(255,255,255,.06); }
.nav-btn.active { color: white; background: rgba(255,255,255,.1); border-left: 3px solid white; padding-left: calc(1.25rem - 3px); }
.nav-btn svg { flex-shrink: 0; opacity: 0.7; }
.nav-btn.active svg { opacity: 1; }
.sb-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sb-user {
  display: flex; align-items: center; gap: 8px; margin-bottom: 0.75rem;
}
.sb-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  object-fit: cover; background: rgba(255,255,255,.1);
}
.sb-uname {
  font-size: 0.75rem; color: rgba(255,255,255,.75); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px;
}
.btn-signout {
  width: 100%; padding: 0.55rem;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.6); font-family: 'Inter', sans-serif;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-signout:hover { background: rgba(255,255,255,.14); color: white; }

/* ── Main content ── */
.main {
  margin-left: var(--sidebar);
  flex: 1; min-height: 100vh;
  display: flex; flex-direction: column;
}
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 56px;
  display: flex; align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 40;
}
.topbar-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem; font-weight: 600;
}
.content { padding: 2rem; flex: 1; }

/* ══════════════════════════════════════
   SECTION VISIBILITY
══════════════════════════════════════ */
.sec { display: none; }
.sec.active { display: block; }

/* ══════════════════════════════════════
   COMMON COMPONENTS
══════════════════════════════════════ */
.toolbar {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap;
}
.tab-group { display: flex; gap: 4px; flex-wrap: wrap; }
.tab-btn {
  padding: 6px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  border: 1.5px solid var(--border);
  background: var(--white); color: var(--gray);
  cursor: pointer; transition: 0.15s;
}
.tab-btn:hover { border-color: var(--black); color: var(--black); }
.tab-btn.active { background: var(--black); border-color: var(--black); color: white; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0.58rem 1.25rem;
  background: var(--black); color: white; border: none;
  font-family: 'Inter', sans-serif; font-size: 0.68rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  cursor: pointer; transition: background 0.15s; white-space: nowrap;
}
.btn-primary:hover { background: var(--charcoal); }
.btn-primary:disabled { background: #ccc; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0.58rem 1.25rem;
  background: white; color: var(--black);
  border: 1.5px solid var(--border);
  font-family: 'Inter', sans-serif; font-size: 0.68rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  cursor: pointer; transition: border-color 0.15s;
}
.btn-secondary:hover { border-color: var(--black); }

.icon-btn {
  width: 30px; height: 30px;
  border: 1px solid var(--border); background: white;
  color: var(--gray); display: flex; align-items: center;
  justify-content: center; cursor: pointer; transition: 0.15s;
}
.icon-btn:hover { border-color: var(--black); color: var(--black); }
.icon-btn.del:hover { border-color: var(--red); color: var(--red); }
.icon-btn.star:hover { border-color: #f59e0b; color: #f59e0b; }
.icon-btn.star.active { border-color: #f59e0b; color: #f59e0b; background: #fffbeb; }

.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block; font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--gray); margin-bottom: 0.4rem;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%; padding: 0.58rem 0.75rem;
  border: 1.5px solid var(--border);
  font-family: 'Inter', sans-serif; font-size: 0.88rem;
  color: var(--black); background: white;
  outline: none; transition: border-color 0.15s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: var(--black); }
.form-group textarea { resize: vertical; min-height: 80px; line-height: 1.6; }

.toggle-row { display: flex; align-items: center; gap: 10px; margin-top: 0.25rem; }
.toggle { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0; cursor: pointer;
  background: #ddd; transition: 0.2s;
}
.toggle-track::before {
  content: ''; position: absolute;
  width: 16px; height: 16px; left: 3px; bottom: 3px;
  background: white; transition: 0.2s;
}
.toggle input:checked + .toggle-track { background: var(--black); }
.toggle input:checked + .toggle-track::before { transform: translateX(18px); }
.toggle-label { font-size: 0.82rem; font-weight: 500; }

.img-upload-area { margin-top: 0.5rem; }
.btn-upload {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0.45rem 0.9rem;
  border: 1.5px solid var(--black); background: white;
  font-family: 'Inter', sans-serif; font-size: 0.65rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: var(--black); cursor: pointer; transition: 0.15s; white-space: nowrap;
}
.btn-upload:hover { background: var(--black); color: white; }
.upload-hint { font-size: 0.7rem; color: var(--gray); }
.progress-wrap { width: 100%; height: 3px; background: var(--border); display: none; margin-top: 6px; }
.progress-fill { height: 100%; background: var(--black); width: 0%; transition: width 0.2s; }
.img-preview {
  width: 100%; height: 170px; object-fit: cover;
  border: 1px solid var(--border); display: none; margin-top: 8px;
  filter: grayscale(25%);
}
.img-placeholder {
  width: 100%; height: 170px;
  background: #EBEBEB; border: 1px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 1.5px; margin-top: 8px;
}

/* ══════════════════════════════════════
   DASHBOARD
══════════════════════════════════════ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem; margin-bottom: 2rem;
}
.stat-card {
  background: var(--white); border: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
}
.stat-label {
  font-size: 0.62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 2px;
  color: var(--gray); margin-bottom: 0.4rem;
}
.stat-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.6rem; font-weight: 600; line-height: 1;
}
.dash-section-title {
  font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 2px;
  color: var(--gray); padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border); margin-bottom: 1.25rem;
}

/* ══════════════════════════════════════
   ARTICLES GRID
══════════════════════════════════════ */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.25rem;
}
.art-card {
  background: var(--white); border: 1px solid var(--border);
  transition: box-shadow 0.2s;
}
.art-card:hover { box-shadow: 0 4px 18px rgba(0,0,0,.08); }
.art-thumb {
  width: 100%; height: 155px;
  object-fit: cover; display: block;
  filter: grayscale(35%); transition: filter 0.3s;
}
.art-card:hover .art-thumb { filter: grayscale(0%); }
.art-thumb-ph {
  width: 100%; height: 155px;
  background: #EBEBEB;
  display: flex; align-items: center; justify-content: center;
  color: #bbb; font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 1px;
}
.art-body { padding: 0.9rem 1rem 0.75rem; }
.art-cat {
  font-size: 0.6rem; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--gray); margin-bottom: 0.3rem;
}
.art-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem; font-weight: 600;
  line-height: 1.3; margin-bottom: 0.35rem;
}
.art-desc {
  font-size: 0.78rem; color: var(--gray); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 0.75rem;
}
.art-footer {
  display: flex; align-items: center;
  justify-content: space-between;
  padding-top: 0.65rem; border-top: 1px solid var(--border);
}
.status-pill {
  font-size: 0.6rem; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; padding: 2px 8px;
}
.status-pill.pub { background: var(--black); color: white; }
.status-pill.draft { background: var(--bg); color: var(--gray); border: 1px solid var(--border); }
.art-reads-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.6rem; color: var(--gray); letter-spacing: 0.5px;
}
.art-actions { display: flex; gap: 5px; }

/* Author email field with avatar preview */
.ed-author-email-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ed-author-email-wrap input { flex: 1; min-width: 0; }
.ed-author-avatar-preview {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  display: none;
}

.empty-state {
  text-align: center; padding: 3.5rem 1rem; color: var(--gray);
}
.empty-state p { font-size: 0.85rem; margin-top: 0.75rem; }
.loading-state {
  display: flex; align-items: center; gap: 10px;
  padding: 2.5rem; color: var(--gray); font-size: 0.85rem;
}

/* ══════════════════════════════════════
   HERO EDITOR
══════════════════════════════════════ */
.editor-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
}
.editor-panel {
  background: var(--white); border: 1px solid var(--border); padding: 1.5rem;
}
.editor-panel-title {
  font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 2px; color: var(--gray);
  padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem;
}
@media (max-width: 960px) { .editor-grid { grid-template-columns: 1fr; } }

/* ══════════════════════════════════════
   MODAL
══════════════════════════════════════ */
.overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55); z-index: 9999;
  align-items: flex-start; justify-content: center;
  padding: 2rem 1rem; overflow-y: auto;
}
.overlay.open { display: flex; }
.modal {
  background: white; width: 100%; max-width: 560px;
  border: 1px solid var(--border);
  animation: mslide 0.2s ease; margin: auto;
}
@keyframes mslide {
  from { opacity:0; transform: translateY(-16px); }
  to   { opacity:1; transform: translateY(0); }
}
.modal-head {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem; font-weight: 600;
}
.modal-x {
  background: none; border: none; cursor: pointer;
  color: var(--gray); font-size: 1.3rem; line-height: 1;
  padding: 4px 6px; transition: color 0.15s;
}
.modal-x:hover { color: var(--black); }
.modal-body { padding: 1.5rem; }
.modal-foot {
  padding: 1rem 1.5rem; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
}

/* ══════════════════════════════════════
   TOAST
══════════════════════════════════════ */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: var(--black); color: white;
  padding: 0.7rem 1.2rem; font-size: 0.8rem; font-weight: 500;
  z-index: 99999; opacity: 0; transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.err { background: var(--red); }

@keyframes spin { to { transform: rotate(360deg); } }
.spin {
  width: 16px; height: 16px;
  border: 2px solid var(--border); border-top-color: var(--black);
  border-radius: 50%; animation: spin 0.6s linear infinite; display: inline-block;
}
.divider { height: 1px; background: var(--border); margin: 1.25rem 0; }

/* ══════════════════════════════════════
   ARTICLE EDITOR
══════════════════════════════════════ */
.visually-hidden { display: none; }
.ed-meta-group { margin-bottom: 0; }
.ed-feat-upload-btn { align-self: flex-end; margin-bottom: 1rem; }

.ed-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 2rem;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  margin: -2rem -2rem 2rem;
}
.ed-topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.ed-meta {
  display: grid;
  grid-template-columns: 1fr 1fr 110px;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.ed-title-input {
  width: 100%;
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.2rem;
  font-weight: 600;
  border: none;
  border-bottom: 2px solid var(--border);
  padding: 0.4rem 0 0.6rem;
  color: var(--black);
  background: transparent;
  outline: none;
  margin-bottom: 1.25rem;
  transition: border-color 0.2s;
  line-height: 1.2;
}
.ed-title-input:focus { border-bottom-color: var(--black); }
.ed-title-input::placeholder { color: #CCCCCC; }
.ed-feat-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 0.5rem;
}
.ed-feat-row .form-group { flex: 1; margin-bottom: 0; }
.ed-feat-preview {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  display: none;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  filter: grayscale(15%);
}
.ed-feat-placeholder {
  width: 100%;
  height: 110px;
  background: #EBEBEB;
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 1rem;
}
.ed-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gray);
  margin-bottom: 0.5rem;
}
.ed-inline-prog {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 0.5rem 0;
  font-size: 0.75rem;
  color: var(--gray);
  margin-bottom: 0.5rem;
}
.ed-inline-prog .progress-wrap { flex: 1; display: block; }
.ed-save-bottom {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  gap: 8px;
}
@media (max-width: 700px) {
  .ed-meta { grid-template-columns: 1fr; }
  .ed-topbar { flex-direction: column; align-items: flex-start; }
}

/* ══════════════════════════════════════
   QUILL OVERRIDES — MAGAZINE STYLE
══════════════════════════════════════ */
.ql-toolbar.ql-snow {
  border: 1.5px solid var(--border);
  border-bottom: none;
  font-family: 'Inter', sans-serif;
  background: #FAFAFA;
  padding: 10px 14px;
  border-radius: 0;
}
.ql-container.ql-snow {
  border: 1.5px solid var(--border);
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  min-height: 520px;
  background: var(--white);
}
.ql-editor {
  padding: 2rem 2.5rem;
  min-height: 520px;
  font-size: 1.05rem;
  color: #1a1a1a;
  line-height: 1.9;
}
.ql-editor.ql-blank::before {
  font-style: normal;
  color: #BBBBBB;
  font-size: 1rem;
  left: 2.5rem;
}
.ql-editor h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.6rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 1.2rem 0 0.5rem;
  color: var(--black);
}
.ql-editor h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 1.5rem 0 0.5rem;
  color: var(--black);
}
.ql-editor h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 600;
  margin: 1.2rem 0 0.4rem;
  color: var(--black);
}
.ql-editor p { margin-bottom: 1rem; }
.ql-editor blockquote {
  border-left: 4px solid var(--black);
  border-right: none;
  padding: 0.75rem 0 0.75rem 1.5rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.45rem;
  font-style: italic;
  color: var(--charcoal);
  margin: 1.75rem 0;
  background: #F9F9F9;
}
.ql-editor img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2rem auto;
  filter: grayscale(15%);
  transition: filter 0.3s;
}
.ql-editor img:hover { filter: grayscale(0%); }
.ql-editor a { color: var(--black); text-decoration: underline; }
.ql-editor ul, .ql-editor ol { padding-left: 1.75rem; margin-bottom: 1rem; }
.ql-editor li { margin-bottom: 0.35rem; }
.ql-editor hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.ql-editor .ql-align-center  { text-align: center; }
.ql-editor .ql-align-right   { text-align: right; }
.ql-editor .ql-align-justify { text-align: justify; }
.ql-toolbar .ql-stroke { stroke: var(--charcoal); }
.ql-toolbar .ql-fill { fill: var(--charcoal); }
.ql-toolbar button:hover .ql-stroke,
.ql-toolbar button.ql-active .ql-stroke { stroke: var(--black); }
.ql-toolbar button:hover .ql-fill,
.ql-toolbar button.ql-active .ql-fill { fill: var(--black); }
.ql-toolbar .ql-picker-label { color: var(--charcoal); }
.ql-toolbar .ql-picker-label:hover,
.ql-toolbar .ql-picker-label.ql-active { color: var(--black); }

/* ══════════════════════════════════════
   ACCESS DENIED
══════════════════════════════════════ */
#accessDenied { display: none; }
.access-lock {
  width: 52px; height: 52px;
  margin: 0 auto 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
}
.access-email {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--black);
  margin: 0.5rem 0;
  word-break: break-all;
}
.access-contact { margin-top: 0.4rem; }
.access-signout-btn { margin-top: 1.5rem; }

/* ══════════════════════════════════════
   SETTINGS
══════════════════════════════════════ */
.settings-panel {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 1.75rem;
  max-width: 640px;
}
.settings-panel-gap { margin-top: 2rem; }
.settings-panel-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gray);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}
.settings-desc {
  font-size: 0.82rem;
  color: var(--gray);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}
.admin-users-list {
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.admin-user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.admin-user-row:last-child { border-bottom: none; }
.admin-user-photo {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.admin-user-photo-ph {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.admin-user-info { flex: 1; min-width: 0; }
.admin-user-name {
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.admin-user-email { font-size: 0.72rem; color: var(--gray); margin-top: 1px; }
.admin-role-badge {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--black);
  color: var(--white);
  padding: 1px 6px;
}
.admin-you-badge {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray);
  border: 1px solid var(--border);
  padding: 2px 8px;
  white-space: nowrap;
}
.admin-user-empty {
  padding: 1rem;
  font-size: 0.82rem;
  color: var(--gray);
}
.add-admin-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.add-admin-row .form-group {
  flex: 1;
  margin: 0;
}

/* sidebar utilities */
.sb-section-gap { margin-top: 0.75rem; }
.nav-btn-link { text-decoration: none; }

/* ══════════════════════════════════════
   ROLE-BASED VISIBILITY
══════════════════════════════════════ */
.writer-mode .admin-only { display: none !important; }
.writer-only { display: none !important; }
.writer-mode .writer-only { display: flex !important; }

/* ══════════════════════════════════════
   PENDING BADGE
══════════════════════════════════════ */
.pending-badge {
  margin-left: auto;
  background: #ef4444;
  color: white;
  font-size: 0.52rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* ══════════════════════════════════════
   STATUS PILLS – extra states
══════════════════════════════════════ */
.status-pill.pending  { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.status-pill.rejected { background: #fee2e2; color: #991b1b; }

/* ══════════════════════════════════════
   PENDING SECTION
══════════════════════════════════════ */
#pendingGrid { display: flex; flex-direction: column; gap: 1rem; }
.pending-card {
  background: var(--white);
  border: 1px solid var(--border);
  display: flex;
  transition: box-shadow 0.2s;
}
.pending-card:hover { box-shadow: 0 4px 18px rgba(0,0,0,.08); }
.pending-thumb {
  width: 140px;
  flex-shrink: 0;
  object-fit: cover;
  filter: grayscale(30%);
  display: block;
}
.pending-thumb-ph {
  width: 140px;
  flex-shrink: 0;
  background: #EBEBEB;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.pending-info { flex: 1; padding: 1rem 1.25rem; min-width: 0; }
.pending-cat {
  font-size: 0.58rem; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--gray); margin-bottom: 0.25rem;
}
.pending-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem; font-weight: 600;
  line-height: 1.3; margin-bottom: 0.3rem;
}
.pending-desc {
  font-size: 0.76rem; color: var(--gray); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 0.6rem;
}
.pending-meta { font-size: 0.68rem; color: var(--gray); margin-bottom: 0.75rem; }
.pending-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-approve {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 0.45rem 1rem;
  background: #166534; color: white; border: none;
  font-family: 'Inter', sans-serif; font-size: 0.65rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  cursor: pointer; transition: background 0.15s;
}
.btn-approve:hover { background: #14532d; }
.btn-approve:disabled { background: #ccc; cursor: not-allowed; }
.btn-reject {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 0.45rem 1rem;
  background: white; color: var(--red);
  border: 1.5px solid var(--red);
  font-family: 'Inter', sans-serif; font-size: 0.65rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  cursor: pointer; transition: 0.15s;
}
.btn-reject:hover { background: var(--red); color: white; }
.btn-reject:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-edit-pending {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 0.45rem 1rem;
  background: white; color: var(--black);
  border: 1.5px solid var(--border);
  font-family: 'Inter', sans-serif; font-size: 0.65rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  cursor: pointer; transition: border-color 0.15s;
}
.btn-edit-pending:hover { border-color: var(--black); }

/* ══════════════════════════════════════
   SETTINGS ROLE BADGES
══════════════════════════════════════ */
.admin-role-badge.writer { background: #4f46e5; }
.admin-role-badge.admin  { background: var(--black); }
.admin-role-badge.owner  { background: #92400e; }
.add-admin-row .role-select-wrap { width: 130px; flex-shrink: 0; }

/* ══════════════════════════════════════
   ADMIN NOTE / EDITORIAL FEEDBACK
══════════════════════════════════════ */
.admin-note-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 3px solid #f59e0b;
  padding: 0.65rem 0.9rem;
  margin-bottom: 0.75rem;
}
.admin-note-label {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #92400e;
  margin-bottom: 0.25rem;
}
.admin-note-text {
  font-size: 0.82rem;
  color: #78350f;
  line-height: 1.55;
}
.pending-note-preview {
  font-size: 0.72rem;
  color: var(--gray);
  font-style: italic;
  margin-bottom: 0.6rem;
  padding: 0.4rem 0.75rem;
  background: var(--bg);
  border-left: 2px solid var(--border);
}
.pending-note-label {
  font-style: normal;
  font-weight: 700;
  color: var(--charcoal);
  margin-right: 4px;
}

/* ══════════════════════════════════════
   PAYMENT MODAL
══════════════════════════════════════ */
.payment-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
.payment-currency {
  padding: 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--charcoal);
  background: var(--bg);
  border-right: 1px solid var(--border);
  line-height: 2.6rem;
  -webkit-user-select: none;
  user-select: none;
}
.payment-amount-input {
  border: none !important;
  outline: none !important;
  padding: 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--charcoal);
  width: 100%;
  height: 2.6rem;
  background: transparent;
}
.payment-amount-input::-webkit-inner-spin-button,
.payment-amount-input::-webkit-outer-spin-button { opacity: 1; }
.payment-min-note {
  font-size: 0.73rem;
  color: var(--gray);
  margin-top: 0.4rem;
}
.payment-error {
  font-size: 0.8rem;
  color: var(--red);
  margin-top: 0.5rem;
  min-height: 1.1rem;
}

/* ══════════════════════════════════════
   WRITER EARNINGS SUMMARY
══════════════════════════════════════ */
.writer-earnings-summary {
  display: flex;
  align-items: center;
  gap: 0;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.earnings-col {
  flex: 1;
  padding: 1rem 1.25rem;
  text-align: center;
}
.earnings-divider {
  width: 1px;
  align-self: stretch;
  background: #bbf7d0;
}
.earnings-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: #166534;
  margin-bottom: 0.3rem;
}
.earnings-amount {
  font-size: 1.35rem;
  font-weight: 700;
  color: #15803d;
  font-family: var(--font-sans);
}

/* ══════════════════════════════════════
   PAYMENT BADGE (writer article card)
══════════════════════════════════════ */
.payment-badge {
  display: inline-block;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.55rem;
  letter-spacing: 0.4px;
  vertical-align: middle;
}

/* ══════════════════════════════════════
   WRITER APPLICATIONS
══════════════════════════════════════ */
.app-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}
.app-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
}
.app-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--charcoal);
}
.app-email {
  font-size: 0.8rem;
  color: var(--gray);
  margin-top: 0.1rem;
}
.app-date {
  font-size: 0.72rem;
  color: var(--gray);
  margin-top: 0.1rem;
}
.app-message {
  font-size: 0.83rem;
  color: #555;
  line-height: 1.6;
  background: var(--bg);
  border-left: 3px solid var(--border);
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.85rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  white-space: pre-wrap;
}
.app-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}
.app-action-note {
  font-size: 0.75rem;
  color: #16a34a;
  font-weight: 600;
}
.app-status {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 0.18rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
}
.app-status.pending  { background: #fef3c7; color: #b45309; border: 1px solid #fcd34d; }
.app-status.approved { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.app-status.rejected { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }

/* ══════════════════════════════════════
   BILLING PAGE
══════════════════════════════════════ */
.billing-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.billing-summary-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  text-align: center;
}
.billing-summary-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--gray);
  margin-bottom: 0.35rem;
}
.billing-summary-amount {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--charcoal);
  font-family: var(--font-sans);
  line-height: 1.1;
}
.billing-summary-amount.red   { color: #dc2626; }
.billing-summary-amount.green { color: #16a34a; }
.billing-summary-sub {
  font-size: 0.72rem;
  color: var(--gray);
  margin-top: 0.2rem;
}

.billing-table {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.billing-row {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.billing-row-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
}
.billing-row-left { flex: 1; min-width: 0; }
.billing-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.billing-writer {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--charcoal);
}
.billing-email,
.billing-approved {
  font-size: 0.72rem;
  color: var(--gray);
  margin-top: 0.1rem;
}
.billing-row-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
  flex-shrink: 0;
}
.billing-amount {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--charcoal);
  font-family: var(--font-sans);
  white-space: nowrap;
}
.billing-status {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 0.18rem 0.65rem;
  border-radius: 999px;
}
.billing-status.unpaid { background: #fef3c7; color: #b45309; border: 1px solid #fcd34d; }
.billing-status.paid   { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }

.billing-row-details {
  padding: 0.7rem 1.25rem;
  background: #f9fafb;
  border-top: 1px solid var(--border);
}
.billing-paid-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}
.billing-method-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}
.billing-method-tag.gcash {
  background: #ede9fe;
  color: #5b21b6;
  border-color: #c4b5fd;
}
.billing-txn,
.billing-paid-date,
.billing-pay-notes {
  font-size: 0.77rem;
  color: var(--gray);
}
.billing-txn     { font-family: monospace; font-size: 0.8rem; color: var(--charcoal); }
.billing-pay-notes { font-style: italic; }

/* ══════════════════════════════════════
   RECORD PAYMENT MODAL
══════════════════════════════════════ */
.pay-record-article-info {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--charcoal);
}
.pay-record-amount {
  font-size: 1.1rem;
  font-weight: 700;
  color: #15803d;
}
.pay-record-writer {
  font-size: 0.78rem;
  color: var(--gray);
  font-weight: 400;
}
.pay-method-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.4rem;
}
.pay-method-option {
  flex: 1;
  cursor: pointer;
}
.pay-method-option input[type="radio"] { display: none; }
.pay-method-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--charcoal);
  background: #fff;
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}
.pay-method-option input[type="radio"]:checked + .pay-method-label {
  border-color: var(--black);
  background: var(--black);
  color: #fff;
}
