/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:  #cfa451;
  --dark:     #2b2b2b;
  --gray:     #777777;
  --bg:       #f9f6f2;
  --border:   #ece2d5;
  --white:    #ffffff;
  --red:      #ef4444;
  --green:    #077d1e;
  --content-bg: #fdfdfc;
}

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--white);
  display: flex;
  height: 100vh;
  overflow: hidden;
  color: var(--dark);
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: 250px;
  min-width: 250px;
  height: 100vh;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

/* Logo */
.logo-wrap {
  height: 120px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-img {
  width: 210px;
  max-width: 100%;
  height: auto;
}

/* Nav */
.nav-section {
  padding: 20px 5px;
  border-bottom: 1px solid var(--border);
  flex: 1;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-radius: 6px;
  text-decoration: none;
  color: #505050;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  white-space: nowrap;
}

.nav-link:hover { background: #efe7da; color: #505050; }

.nav-link.active {
  background: var(--primary);
  color: var(--white);
}

/* Inline SVG nav icons (Publications / Announcement / Slider) */
.nav-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* Asset-file nav icons (Home, Log out) */
.nav-icon-img {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  /* Gold → grey for inactive state */
  filter: grayscale(1) brightness(0.72);
  transition: filter 0.15s;
}

.nav-link.active .nav-icon-img,
.logout-btn:hover .nav-icon-img {
  /* Gold → white for active / hover */
  filter: brightness(0) invert(1);
}

/* Logout */
.logout-section { padding: 18px 16px 20px; }

.logout-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-radius: 6px;
  background: none;
  border: none;
  color: #505050;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s;
  white-space: nowrap;
}

.logout-btn:hover { background: #ede2d4; }

/* ── Main column ──────────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  min-width: 0;
}

/* Header */
.header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: 120px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  flex-shrink: 0;
}

.header-title {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.1;
  color: var(--dark);
}

/* Content */
.content {
  flex: 1;
  background: var(--content-bg);
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ── Service Status cards ─────────────────────────────────── */
.status-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.status-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
}

.status-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-icon-box {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.status-icon-box.red   { background: rgba(239, 68, 68, 0.08); }
.status-icon-box.green { background: rgba(7, 125, 30, 0.08); }

.status-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--dark);
}

.badge {
  padding: 9px 22px;
  border-radius: 40px;
  font-size: 14px;
  font-weight: 500;
  color: var(--white);
}

.badge.inactive { background: var(--red); }
.badge.active   { background: var(--green); }

/* ── Quick Statistics panel ───────────────────────────────── */
.stats-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.stats-head {
  padding: 0 32px;
  height: 80px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.stats-head h2 {
  font-size: 20px;
  font-weight: 500;
  color: var(--dark);
}

.stats-grid {
  padding: 28px 32px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.stat-tile {
  background: #fdfdfb;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-icon-box {
  width: 58px;
  height: 58px;
  background: var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-texts { display: flex; flex-direction: column; gap: 10px; }

.stat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray);
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
}

/* Asset icons inside status cards */
.status-icon-img {
  width: 26px;
  height: 26px;
  display: block;
}

/* Tint the gold SVG icons to match card colour */
.status-icon-red   { filter: invert(36%) sepia(80%) saturate(700%) hue-rotate(330deg) brightness(110%) contrast(100%); }
.status-icon-green { filter: invert(32%) sepia(70%) saturate(600%) hue-rotate(100deg) brightness(80%)  contrast(110%); }

/* Asset icons inside stat tiles (keep native gold colour) */
.stat-icon-img {
  width: 24px;
  height: 24px;
  display: block;
}

/* ── Publications page (scoped) ───────────────────────────── */
.publication-page {
  --off: #d5cbbd;
  --on: #077d1e;
}

.publication-page .content {
  padding: 16px;
  gap: 0;
}

.publication-page .publications-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  max-width: 1280px;
}

.publication-page .publications-toolbar {
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.publication-page .tabs {
  display: flex;
  align-items: center;
  gap: 22px;
}

.publication-page .tab {
  border: 0;
  background: transparent;
  padding: 11px 0 13px;
  cursor: pointer;
  color: var(--dark);
  text-decoration: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  position: relative;
}

.publication-page .publication-message {
  margin: 12px 16px 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
}

.publication-page .publication-message-success {
  color: #0f5132;
  background: #d1e7dd;
}

.publication-page .publication-message-error {
  color: #842029;
  background: #f8d7da;
}

.publication-page .publication-message-info {
  color: #084298;
  background: #cfe2ff;
}

/* Apply publication-style flash messages on sliders page as well */
.slider-page .publication-message {
  margin: 12px 16px 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
}

.slider-page .publication-message-success {
  color: #0f5132;
  background: #d1e7dd;
}

.slider-page .publication-message-error {
  color: #842029;
  background: #f8d7da;
}

.slider-page .publication-message-info {
  color: #084298;
  background: #cfe2ff;
}

.publication-page .tab.active {
  color: var(--primary);
}

.publication-page .tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--primary);
}

.publication-page .toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.publication-page .btn {
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
}

.btn-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}


.publication-page .btn-secondary {
  background: #f8f3ec;
  border: 1px solid #efe6d8;
  color: #1f1f1f;
}

.publication-page .btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.publication-page .publication-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.publication-page .publication-modal.is-open {
  display: flex;
}

.publication-page .publication-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 12, 12, 0.36);
}

.publication-page .publication-modal-panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 28px);
}

.publication-page .publication-modal-head {
  min-height: 70px;
  padding: 18px 20px;
  border-bottom: 1px solid #ece2d5;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.publication-page .publication-modal-head h2 {
  font-size: 32px;
  font-weight: 600;
  color: var(--dark);
  line-height: 1;
}

.publication-page .publication-modal-close {
  border: 0;
  background: #f8f3ec;
  color: var(--primary);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  width: 34px;
  height: 34px;
  cursor: pointer;
  border-radius: 50%;
}

.publication-page .publication-modal-form {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

.publication-page .publication-modal-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.publication-page .publication-modal-field span {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.2px;
  color: #777777;
  line-height: 1.5;
}

.publication-page .publication-modal-field input,
.publication-page .publication-modal-field select,
.publication-page .publication-modal-field textarea {
  height: 40px;
  border: 1px solid #ece2d5;
  border-radius: 9px;
  padding: 0 11px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  color: var(--dark);
  background: #ffffff;
}

.publication-page .publication-modal-field textarea {
  min-height: 80px;
  height: 80px;
  resize: vertical;
  padding: 9px 11px;
}

.publication-page .publication-modal-field input::placeholder,
.publication-page .publication-modal-field textarea::placeholder {
  color: #2b2b2b;
  opacity: 0.65;
}

.publication-page .publication-modal-field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M3.5 5.25L7 8.75L10.5 5.25' stroke='%236E655A' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}

.publication-page .publication-modal-field input:focus,
.publication-page .publication-modal-field select:focus,
.publication-page .publication-modal-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(207, 164, 81, 0.12);
}

.publication-page .publication-modal-file-input {
  display: none;
}

.publication-page .publication-modal-upload-box {
  height: 140px;
  border: 1px dashed #ece2d5;
  border-radius: 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  color: #2b2b2b;
  user-select: none;
}

.publication-page .publication-modal-upload-icon {
  width: 22px;
  height: 22px;
  color: var(--primary);
}

.publication-page .publication-modal-upload-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.publication-page .publication-modal-upload-title {
  font-size: 14px;
  font-weight: 400;
  color: #2b2b2b;
}

.publication-page .publication-modal-upload-note {
  font-size: 12px;
  font-weight: 400;
  color: #2b2b2b;
  opacity: 0.72;
}

.publication-page .publication-modal-qr-image {
  width: 144px;
  height: 144px;
  display: block;
  object-fit: contain;
}

.publication-page .publication-modal-upload-box.has-preview {
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.publication-page .publication-modal-cover-preview {
  width: 140px;
  max-height: 124px;
  object-fit: contain;
  display: block;
}

.publication-page .publication-modal-actions {
  margin: 0 -20px -20px;
  border-top: 1px solid #ece2d5;
  padding: 14px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.publication-page .publication-modal-actions .btn {
  min-height: 44px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 22px;
}

.publication-page .publication-modal-actions .btn-secondary {
  background: #f9f6f2;
  border: 1px solid #ece2d5;
  color: #2b2b2b;
}

.publication-page .publication-modal-actions .btn-primary {
  background: #cfa451;
}

.publication-page .sync-modal-head h2 {
  font-size: 16px;
}

.publication-page .sync-modal-form {
  gap: 20px;
}

.publication-page .sync-modal-intro {
  font-size: 16px;
  line-height: 1.35;
  color: #777777;
  letter-spacing: 0.2px;
}

.publication-page .sync-option {
  border: 1px solid #ece2d5;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  gap: 17px;
  align-items: flex-start;
  cursor: pointer;
  background: #ffffff;
}

.publication-page .sync-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.publication-page .sync-option-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid #777777;
  margin-top: 5px;
  position: relative;
  flex-shrink: 0;
  background: #ffffff;
}

.publication-page .sync-option.is-selected {
  border-color: #cfa451;
  background: #f9f6f2;
}

.publication-page .sync-option.is-selected .sync-option-dot {
  border-color: #cfa451;
}

.publication-page .sync-option.is-selected .sync-option-dot::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: #cfa451;
}

.publication-page .sync-option-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.publication-page .sync-option-title {
  font-size: 16px;
  line-height: 1.5;
  font-weight: 600;
  color: #2b2b2b;
}

.publication-page .sync-option-desc {
  font-size: 15px;
  line-height: 1.5;
  color: #777777;
  letter-spacing: 0.2px;
}

.publication-page .sync-modal-actions {
  margin-top: auto;
}

.publication-page .sync-success {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.publication-page .sync-success h3 {
  font-size: 16px;
  line-height: 1.5;
  font-weight: 600;
  color: #2b2b2b;
}

.publication-page .sync-success p {
  font-size: 15px;
  line-height: 1.5;
  color: #777777;
  letter-spacing: 0.2px;
}

.publication-page .sync-modal-intro-confirm {
  font-size: 14px;
  line-height: 1.5;
  color: #cfa451;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.publication-page .sync-modal-actions.is-success {
  margin-top: 0;
}

.publication-page .sync-success-modal-panel {
  padding: 18px 20px 20px;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.publication-page .sync-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #96be9f;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.publication-page .sync-success-icon span {
  font-size: 30px;
  line-height: 1;
  font-weight: 500;
}

.publication-page .sync-success-content {
  margin-top: 20px;
  width: 100%;
  max-width: 350px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.publication-page .sync-success-content h3 {
  font-size: 16px;
  line-height: 1.5;
  font-weight: 600;
  color: #2b2b2b;
  letter-spacing: 0.2px;
}

.publication-page .sync-success-content p {
  font-size: 15px;
  line-height: 1.5;
  color: #777777;
  letter-spacing: 0.2px;
}

.publication-page .sync-success-content p.is-hidden {
  display: none;
}

.publication-page .sync-success-actions {
  margin-top: 20px;
}

.publication-page .sync-success-actions .btn {
  min-height: 44px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 24px;
}

/* ── Sign-in page (scoped) ───────────────────────────────── */
body.signin { justify-content: center; align-items: center; background: #f7f3ef; overflow: auto; }
.signin-page { width: 100%; display: flex; align-items: center; justify-content: center; padding: 40px 20px; min-height: 100vh; }
.signin-card {
  width: 540px;
  max-width: 96%;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  text-align: center;
}
.logo-wrap-center { margin-bottom: 6px; }
.signin-logo { height: 72px; width: auto; margin: 0 auto 14px; display: block; }
.signin-title { font-size: 18px; font-weight: 700; margin: 8px 0 20px; color: var(--dark); }
.signin-form { display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
.form-group { text-align: left; }
.label { font-size: 13px; color: var(--dark); display: block; margin-bottom: 6px; }
.input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 14px;
  background: #fff;
  color: var(--dark);
}
.input::placeholder { color: #c6bfb5; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(207,164,81,0.10); }
.btn-primary {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:hover { opacity: 0.96; }

@media (max-width: 480px) {
  .signin-card { padding: 20px; }
  .signin-logo { height: 48px; }
  .signin-title { font-size: 16px; }
}

.publication-page .btn-icon {
  font-size: 13px;
  line-height: 1;
}

.publication-page .table-shell,
.users-page .table-shell {
  padding: 16px;
  overflow-x: auto;
}

.publication-page .publications-table {
  width: 100%;
  min-width: 890px;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.publication-page .publications-table thead th {
  text-align: left;
  padding: 11px 16px;
  font-size: 12px;
  font-weight: 600;
  color: #6d6d6d;
  background: #f8f4ee;
  white-space: nowrap;
}

.publication-page .publications-table tbody td {
  padding: 10px 16px;
  border-top: 1px solid #efe6d8;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.publication-page .publications-table tbody tr:first-child td {
  border-top: 1px solid #e8dece;
}

.publication-page .order-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.publication-page .drag-handle {
  color: #9a9081;
  font-size: 14px;
  letter-spacing: 1px;
}

.publication-page .year-pill {
  background: #ece8e1;
  border-radius: 999px;
  padding: 4px 9px;
  display: inline-block;
  font-size: 12px;
  line-height: 1;
}

.publication-page .url-cell {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.publication-page .status-switch {
  border: 0;
  width: 33px;
  height: 18px;
  border-radius: 999px;
  background: var(--off);
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.publication-page .status-switch::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  position: absolute;
  top: 2px;
  left: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.publication-page .status-switch.on {
  background: var(--on);
}

.publication-page .status-switch.on::after {
  left: 17px;
}

.publication-page .publication-inline-form {
  margin: 0;
}

/* ── Slider Images / Upload UI (scoped to sliders page) ───────────────── */
.slider-page .slider-v2-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: 1280px;
}

.slider-page .slider-v2-head {
  padding: 0 32px;
  height: 80px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.slider-page .slider-v2-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--dark);
}

.slider-page .slider-v2-body {
  padding: 28px 32px;
}

.slider-page .slider-v2-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
}

.slider-page .slider-v2-slot {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 207px; /* 140px preview + 67px controls */
}

.slider-page .slider-v2-preview {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.slider-page .slider-v2-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slider-page .slider-v2-controls {
  background: var(--white);
  border-top: 1px solid var(--border);
  height: 67px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.slider-page .slider-v2-toggle {
  width: 44px;
  height: 24px;
  background: var(--green);
  border-radius: 12px;
  border: none;
  position: relative;
  cursor: pointer;
}

.slider-page .slider-v2-toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.slider-page .slider-v2-remove {
  background: var(--red);
  border: none;
  color: var(--white);
  padding: 8px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.slider-page .slider-v2-slot-empty {
  border-style: dashed;
  background: transparent;
  align-items: center;
  justify-content: center;
  padding: 16px;
  display: flex;
}

.slider-page .slider-v2-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--dark);
}

.slider-page .slider-v2-upload-icon {
  width: 36px;
  height: 36px;
  display: block;
  opacity: 0.85;
}

.slider-page .slider-v2-upload-text {
  font-size: 16px;
}

/* Responsive: collapse columns on smaller screens */
@media (max-width: 1100px) {
  .slider-page .slider-v2-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 700px) {
  .slider-page .slider-v2-grid { grid-template-columns: repeat(2, 1fr); }
}


.publication-page .edit-btn {
  border: 1px solid var(--primary);
  background: transparent;
  color: var(--dark);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  height: 26px;
  padding: 0 12px;
  cursor: pointer;
}

/* ── Users page (scoped) ─────────────────────────────────── */
.users-page .content {
  padding: 16px;
  gap: 0;
}

.users-page .publications-panel {
  width: 100%;
  max-width: 1280px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 18px 38px rgba(43, 43, 43, 0.05);
}

.users-page .publications-toolbar {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
.users-page .publications-toolbar .toolbar-actions{
  padding-top: unset;
}
.users-page .table-shell {
  padding: 20px;
  overflow-x: auto;
}

.users-page .publications-table {
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #efe6d8;
  border-radius: 12px;
  overflow: hidden;
  background: #fffdfa;
}

.users-page .publications-table thead th {
  text-align: left;
  padding: 14px 18px;
  background: #f8f4ee;
  color: #6e655a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.users-page .publications-table tbody td {
  padding: 16px 18px;
  border-top: 1px solid #efe6d8;
  color: var(--dark);
  font-size: 14px;
  font-weight: 500;
  vertical-align: middle;
}

.users-page .publications-table tbody tr:hover {
  background: #fcf8f2;
}

.users-page .publications-table tbody td:last-child {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.users-page .toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 15px;
}

.users-page .btn,
.users-page .edit-btn {
  border-radius: 10px;
  min-height: 40px;
  padding: 10px 16px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.users-page .btn:focus-visible,
.users-page .edit-btn:focus-visible,
.users-page .form-row input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(207, 164, 81, 0.16);
}

.users-page .btn-primary {
  background: linear-gradient(135deg, #d8b46a 0%, #cfa451 100%);
  color: var(--white);
  box-shadow: 0 10px 22px rgba(207, 164, 81, 0.22);
}

.users-page .btn-primary:hover {
  background: linear-gradient(135deg, #cfa451 0%, #bb8f3a 100%);
}

.users-page .btn-secondary,
.users-page .edit-btn {
  background: #fffaf3;
  border-color: #e9dcc8;
  color: #5f5140;
}

.users-page td form {
  margin: 0;
}

.users-page td form .edit-btn {
  background: #fff6f5;
  border-color: rgba(239, 68, 68, 0.24);
  color: #c24141;
}

.users-page .btn:hover,
.users-page .edit-btn:hover {
  border-color: rgba(207, 164, 81, 0.55);
  color: var(--dark);
}

.users-page .btn-primary:hover {
  color: var(--white);
}

.users-page .alert {
  margin: 20px 20px 0;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid transparent;
}

.users-page .alert ul {
  margin: 0;
  padding-left: 18px;
}

.users-page .alert.success {
  background: #e8f6ec;
  border-color: #bfe4c8;
  color: #14532d;
}

.users-page .alert.error {
  background: #fff1f0;
  border-color: #f2c7c4;
  color: #9f2d2d;
}

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

.users-page .form-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.users-page .form-row label {
  font-size: 13px;
  font-weight: 600;
  color: #6e655a;
}

.users-page .form-row input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid #e7dccd;
  border-radius: 10px;
  background: #fffdfa;
  color: var(--dark);
  font-family: inherit;
  font-size: 14px;
}

.users-page .form-row input::placeholder {
  color: #b4aa9d;
}

.users-page .field-error {
  color: #c24141;
  font-size: 12px;
  font-weight: 500;
}

.users-page .mt-4 {
  padding: 0 20px 20px;
}

.users-page .mt-4 nav,
.users-page .mt-4 > div,
.users-page .mt-4 span,
.users-page .mt-4 a {
  font-size: 13px;
}

.users-page .mt-4 nav > div:first-child {
  display: none;
}

.users-page .mt-4 nav > div:last-child {
  display: flex;
  justify-content: flex-end;
}

.users-page .mt-4 nav > div:last-child > span {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.users-page .mt-4 a,
.users-page .mt-4 span[aria-current="page"] > span,
.users-page .mt-4 span[aria-disabled="true"] > span {
  min-width: 38px;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #e7dccd;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fffdfa;
  color: #6e655a;
  text-decoration: none;
}

.users-page .mt-4 span[aria-current="page"] > span {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.users-page .mt-4 span[aria-disabled="true"] > span {
  opacity: 0.55;
}

@media (max-width: 980px) {
  body {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .sidebar {
    width: 100%;
    min-width: 0;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .logo-wrap,
  .header {
    height: 84px;
  }

  .nav-section {
    padding: 12px;
  }

  .nav-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .nav-link,
  .logout-btn {
    font-size: 14px;
    padding: 10px 14px;
    gap: 12px;
  }

  .nav-icon-img {
    width: 18px;
    height: 18px;
  }

  .main {
    height: auto;
    overflow: visible;
  }

  .header-title {
    font-size: 24px;
  }

  .publication-page .publications-toolbar {
    align-items: flex-start;
  }

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

  .users-page .publications-table tbody td:last-child {
    min-width: 180px;
  }

  .publication-page .tabs {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .content {
    padding: 10px;
  }

  .nav-list {
    grid-template-columns: 1fr;
  }

  .publication-page .toolbar-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .users-page .publications-toolbar,
  .users-page .table-shell,
  .users-page .mt-4 {
    padding-left: 14px;
    padding-right: 14px;
  }

  .users-page .toolbar-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .users-page .btn,
  .users-page .edit-btn {
    width: 100%;
  }

  .publication-page .publication-modal {
    align-items: flex-end;
    padding: 0;
  }

  .publication-page .publication-modal-panel {
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: calc(100vh - 6px);
  }

  .publication-page .publication-modal-form {
    padding: 16px;
    gap: 16px;
  }

  .publication-page .publication-modal-head h2 {
    font-size: 28px;
  }

  .publication-page .sync-modal-intro,
  .publication-page .sync-option-title,
  .publication-page .sync-success h3 {
    font-size: 16px;
  }

  .publication-page .sync-option-desc,
  .publication-page .sync-success p,
  .publication-page .sync-modal-intro-confirm {
    font-size: 14px;
  }

  .publication-page .publication-modal-actions {
    margin: 0 -16px -16px;
    padding: 12px 16px;
  }

  .publication-page .btn {
    width: 100%;
  }

  .header-title {
    font-size: 20px;
  }
}

/* ── Announcement page v2 (scoped, new classes) ─────────── */
.announcement-page .content {
  padding: 16px;
  gap: 0;
}

.announcement-page .announcement-v2-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 100%;
  max-width: 1280px;
  overflow: hidden;
}

.announcement-page .announcement-v2-head {
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 8px 16px;
  flex-wrap: wrap;
}

.announcement-page .announcement-v2-tab {
  border: 0;
  background: transparent;
  color: var(--dark);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  padding: 11px 0 13px;
  position: relative;
  text-decoration: none;
}

.announcement-page .announcement-v2-tab-active {
  color: var(--primary);
}

.announcement-page .announcement-v2-tab-active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--primary);
}

.announcement-page .announcement-v2-switch {
  margin-left: auto;
  width: 33px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  background: #077d1e;
  position: relative;
  cursor: pointer;
}

/* Ensure the switch form itself is pushed to the right (languages remain left) */
.announcement-page .announcement-v2-switch-form {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.announcement-page .announcement-v2-switch-knob {
  position: absolute;
  right: 2px;
  top: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* On / Off states */
.announcement-page .announcement-v2-switch-on {
  background: #077d1e;
}

.announcement-page .announcement-v2-switch-off {
  background: #e9ecef;
}

.announcement-page .announcement-v2-switch-on .announcement-v2-switch-knob {
  right: 2px;
  left: auto;
}

.announcement-page .announcement-v2-switch-off .announcement-v2-switch-knob {
  left: 2px;
  right: auto;
}

.announcement-page .announcement-v2-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.announcement-page .announcement-v2-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.announcement-page .announcement-v2-label {
  color: var(--dark);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.announcement-page .announcement-v2-input,
.announcement-page .announcement-v2-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--dark);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
}

.announcement-page .announcement-v2-input {
  height: 34px;
  padding: 0 10px;
}

.announcement-page .announcement-v2-textarea {
  min-height: 120px;
  resize: vertical;
  padding: 10px;
}

.announcement-page .announcement-v2-foot {
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  justify-content: flex-end;
}

.announcement-page .announcement-v2-save {
  border: 0;
  border-radius: 6px;
  background: var(--primary);
  color: #ffffff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  min-height: 34px;
  padding: 10px 14px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 980px) {
  .announcement-page .announcement-v2-head {
    gap: 16px;
    padding: 8px 14px;
  }

  .announcement-page .announcement-v2-tab {
    font-size: 15px;
  }

  .announcement-page .announcement-v2-body {
    padding: 14px;
  }

  .announcement-page .announcement-v2-foot {
    padding: 10px 14px;
  }
}

@media (max-width: 640px) {
  .announcement-page .announcement-v2-head {
    flex-wrap: wrap;
    row-gap: 8px;
    padding: 8px 10px;
  }

  .announcement-page .announcement-v2-tab {
    font-size: 14px;
  }

  .announcement-page .announcement-v2-save {
    width: 100%;
  }
}

/* ── Slider page v2 (scoped, new classes) ──────────────── */
.slider-page .content {
  padding: 16px;
  gap: 0;
}

.slider-page .slider-v2-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 100%;
  max-width: 1280px;
  overflow: hidden;
}

.slider-page .slider-v2-head {
  min-height: 80px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
}

.slider-page .slider-v2-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--dark);
  margin: 0;
}

.slider-page .slider-v2-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.slider-page .slider-v2-grid {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.slider-page .slider-v2-slot {
  flex: 1 1 calc(20% - 20px);
  min-width: 180px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.slider-page .slider-v2-slot-filled {
  min-height: 207px;
}

.slider-page .slider-v2-preview {
  height: 140px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
}

.slider-page .slider-v2-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slider-page .slider-v2-controls {
  height: 67px;
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-radius: 0 0 8px 8px;
}

.slider-page .slider-v2-toggle {
  width: 44px;
  height: 24px;
  border: 0;
  border-radius: 12px;
  background: #077d1e;
  position: relative;
  cursor: pointer;
}

.slider-page .slider-v2-toggle-off {
  width: 44px;
  height: 24px;
  border: 0;
  border-radius: 12px;
  background: #afafaf;
  position: relative;
  cursor: pointer;
}

.slider-page .slider-v2-toggle-off::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.slider-page .slider-v2-toggle::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.slider-page .slider-v2-remove {
  border: 0;
  border-radius: 8px;
  background: #ef4444;
  color: #ffffff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  height: 32px;
  padding: 0 20px;
  cursor: pointer;
  line-height: 1;
}

.slider-page .slider-v2-slot-empty {
  border: 2px dashed var(--border);
  background: transparent;
  min-height: 207px;
  justify-content: center;
}

.slider-page .slider-v2-upload {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.slider-page .slider-v2-upload-icon {
  width: 24px;
  height: 24px;
  color: var(--dark);
  stroke-width: 2;
}

.slider-page .slider-v2-upload-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--dark);
}

@media (max-width: 1024px) {
  .slider-page .slider-v2-slot {
    flex: 1 1 calc(33.33% - 16px);
    min-width: 160px;
  }
}

@media (max-width: 768px) {
  .slider-page .slider-v2-body {
    padding: 14px;
  }

  .slider-page .slider-v2-grid {
    gap: 16px;
  }

  .slider-page .slider-v2-slot {
    flex: 1 1 calc(50% - 8px);
    min-width: 140px;
  }

  .slider-page .slider-v2-preview {
    height: 120px;
  }

  .slider-page .slider-v2-controls {
    height: 60px;
    padding: 0 12px;
  }
}

@media (max-width: 640px) {
  .slider-page .content {
    padding: 10px;
  }

  .slider-page .slider-v2-head {
    padding: 0 12px;
    min-height: 72px;
  }

  .slider-page .slider-v2-title {
    font-size: 11px;
  }

  .slider-page .slider-v2-body {
    padding: 10px;
  }

  .slider-page .slider-v2-grid {
    gap: 12px;
  }

  .slider-page .slider-v2-slot {
    flex: 1 1 100%;
    min-width: 100%;
  }

  .slider-page .slider-v2-remove {
    font-size: 11px;
    height: 28px;
    padding: 0 16px;
  }
}

/* ── Global responsive improvements ─────────────────────── */
img {
  max-width: 100%;
  height: auto;
}

.sidebar-backdrop {
  display: none;
}

.header-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fffdf9;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  margin-right: 10px;
}

.header-menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: #6a5f50;
  border-radius: 2px;
}

@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 20px;
  }

  .status-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

@media (max-width: 980px) {
  body {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(82vw, 280px);
    height: 100dvh;
    z-index: 1002;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
  }

  body.admin-nav-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1001;
    border: 0;
    background: rgba(32, 26, 20, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  body.admin-nav-open .sidebar-backdrop {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .main {
    min-height: 100vh;
  }

  .header {
    height: auto;
    min-height: 76px;
    padding: 14px;
    gap: 6px;
  }

  .header-menu-btn {
    display: inline-flex;
    flex-shrink: 0;
  }

  .header-title {
    font-size: 20px;
  }

  .nav-section {
    padding: 12px;
  }

  .nav-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .publication-page .publications-table,
  .users-page .publications-table {
    min-width: 660px;
  }

  .announcement-page .announcement-v2-head {
    align-items: flex-start;
  }

  .announcement-page .announcement-v2-switch-form {
    margin-left: 0;
    width: 100%;
    display: flex;
    justify-content: flex-end;
  }
}

@media (max-width: 768px) {
  .content,
  .publication-page .content,
  .announcement-page .content,
  .slider-page .content,
  .users-page .content {
    padding: 12px;
  }

  .stats-head {
    height: auto;
    min-height: 64px;
    padding: 14px;
  }

  .stats-head h2 {
    font-size: 18px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .status-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
  }

  .status-title {
    font-size: 16px;
  }

  .badge {
    padding: 7px 16px;
    font-size: 12px;
  }

  .publication-page .table-shell,
  .users-page .table-shell,
  .slider-page .slider-v2-body,
  .announcement-page .announcement-v2-body {
    padding: 12px;
  }

  .publication-page .publications-table,
  .users-page .publications-table {
    min-width: 600px;
  }
}

@media (max-width: 640px) {
  .header {
    min-height: 68px;
    padding: 12px;
  }

  .header-title {
    font-size: 18px;
  }

  .content,
  .publication-page .content,
  .announcement-page .content,
  .slider-page .content,
  .users-page .content {
    padding: 10px;
  }

  .publication-page .publications-panel,
  .users-page .publications-panel,
  .announcement-page .announcement-v2-card,
  .slider-page .slider-v2-card,
  .stats-panel {
    border-radius: 10px;
  }

  .users-page .form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .users-page .publications-table,
  .publication-page .publications-table {
    min-width: 540px;
  }

  .announcement-page .announcement-v2-foot {
    padding: 10px;
  }

  .announcement-page .announcement-v2-save {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .slider-page .slider-v2-slot {
    flex: 1 1 100%;
  }
}
