/* ---------- Layout glue (matches inline-styled sidebar) ---------- */
html, body { height: 100%; margin: 0; }
body {
  background: #fafbfc;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* Sidebar (inline in PHP) + Main side-by-side */
.admin-cms-layout {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
  width: 100%;
}

/* Main content area */
.admin-main {
  flex: 1 1 auto;
  min-width: 0; /* prevent overflow from wide tables inside flex */
  display: flex;
  flex-direction: column;
  background: #fafbfc;
}

/* Top bar that complements the sidebar palette */
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 800;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}
.admin-topbar__title { font-weight: 700; font-size: 1rem; color:#111827; }
.admin-topbar__spacer { flex: 1; }
.admin-topbar__user { display:flex; align-items:center; gap:.6rem; }
.admin-topbar__avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background:#008040; color:#fff; display:flex; align-items:center; justify-content:center;
  font-size:.9rem; font-weight:700;
}
.admin-topbar__name { font-weight:600; font-size:.95rem; color:#111827; }

/* ---------- Page section ---------- */
.admin-cms-section { padding: 1.5rem; }

/* Header with action button */
.page-header {
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:1.25rem; padding-bottom:0.75rem; border-bottom:1px solid #e5e7eb;
}
.page-title { margin:0; font-size:1.5rem; font-weight:700; color:#111827; display:flex; gap:.6rem; align-items:center; }

/* Buttons */
.btn-primary {
  display:inline-flex; align-items:center; gap:.5rem; cursor:pointer;
  background:#008040; color:#fff; border:0; border-radius:8px; padding:.65rem 1.1rem;
  font-size:.9rem; font-weight:600; transition:.2s;
}
.btn-primary:hover { background:#006d37; transform: translateY(-1px); box-shadow:0 4px 12px rgba(0,128,64,.12); }

.btn-secondary {
  display:inline-flex; align-items:center; gap:.5rem; cursor:pointer;
  background:#f3f4f6; color:#374151; border:1px solid #d1d5db; border-radius:8px; padding:.6rem 1rem;
  font-size:.9rem; font-weight:500; transition:.2s;
}
.btn-secondary:hover { background:#e5e7eb; }

/* Small action button (delete) */
.btn-danger-sm {
  background:#dc2626; color:#fff; border:none; border-radius:6px; padding:.5rem .875rem;
  font-size:.75rem; font-weight:500; cursor:pointer; transition:.2s;
  display:inline-flex; align-items:center; gap:.25rem;
}
.btn-danger-sm:hover { background:#b91c1c; transform: translateY(-1px); box-shadow:0 2px 8px rgba(220,38,38,.15); }

/* Link-style small buttons */
.btn-link-sm {
  display:inline-flex; align-items:center; gap:.25rem; padding:.25rem .5rem;
  font-size:.75rem; border-radius:4px; text-decoration:none; transition:.2s;
}
.btn-pdf   { background:#fef2f2; color:#dc2626; border:1px solid #fecaca; }
.btn-pdf:hover { background:#fee2e2; color:#b91c1c; }
.btn-view  { background:#eff6ff; color:#2563eb; border:1px solid #bfdbfe; }
.btn-view:hover { background:#dbeafe; color:#1d4ed8; }

/* Chips / badges */
.category-tag, .type-badge, .status-badge {
  display:inline-flex; align-items:center; border-radius:999px; font-size:.75rem; font-weight:600;
  padding:.25rem .6rem;
}
.category-tag { background:#f3f4f6; color:#374151; }
.type-badge   { background:#e0f2fe; color:#0369a1; }
.status-badge { text-transform:capitalize; }
.status-draft { background:#f3f4f6; color:#6b7280; }
.status-submitted { background:#fef3c7; color:#b45309; }
.status-approved  { background:#d1fae5; color:#059669; }
.status-rejected  { background:#fee2e2; color:#dc2626; }
.status-under_review { background:#dbeafe; color:#1d4ed8; }

/* Cards */
.content-card {
  background:#fff; border:1px solid #e5e7eb; border-radius:12px; overflow:hidden;
  box-shadow:0 1px 3px rgba(0,0,0,.05); margin-bottom:2rem;
}
.card-header { padding:1rem 1.25rem; background:#f9fafb; border-bottom:1px solid #e5e7eb; }
.card-title { margin:0; display:flex; align-items:center; gap:.6rem; font-weight:700; color:#111827; font-size:1.05rem; }

/* Empty state */
.empty-state { text-align:center; padding:3rem 1rem; color:#6b7280; }
.empty-state i { font-size:2.25rem; color:#d1d5db; margin-bottom:.6rem; }
.empty-state h4 { margin:0 0 .25rem; font-size:1.05rem; font-weight:700; color:#374151; }

/* Tables */
.table-container { overflow-x:auto; }
.data-table { width:100%; min-width: 1000px; border-collapse: collapse; }
.data-table th {
  background:#f9fafb; padding:0.85rem 0.75rem; text-align:left;
  font-size:.75rem; font-weight:700; text-transform:uppercase; letter-spacing:.05em;
  color:#374151; border-bottom:1px solid #e5e7eb; white-space:nowrap;
}
.data-table td { padding:0.9rem 0.75rem; border-bottom:1px solid #f3f4f6; vertical-align:top; }
.data-table tbody tr:hover { background:#f9fafb; }

.item-title { font-weight:700; color:#111827; margin-bottom:.2rem; }
.item-subtitle, .item-preview { font-size:.9rem; color:#6b7280; line-height:1.45; }

.date-text { font-size:.9rem; color:#374151; font-weight:600; }
.date-sub { font-size:.75rem; color:#6b7280; margin-top:2px; }
.review-notes-full { font-size:.9rem; color:#374151; line-height:1.45; max-height:60px; overflow:auto; word-wrap:break-word; }
.no-notes { font-size:.9rem; color:#9ca3af; font-style:italic; }

/* Modal */
.modal-content { border:none; border-radius:12px; box-shadow:0 20px 25px -5px rgba(0,0,0,.1); }
.modal-header { padding:1rem 1.25rem; background:#f9fafb; border-bottom:1px solid #e5e7eb; }
.modal-body { padding:1.25rem; }
.modal-footer { padding:1rem 1.25rem; background:#f9fafb; border-top:1px solid #e5e7eb; gap:.6rem; }

/* Forms */
.form-grid { display:grid; gap:1rem; }
@media (min-width:640px){
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid .form-group:first-child,
  .form-grid .form-group:nth-child(6),
  .form-grid .form-group:nth-child(7) { grid-column: span 2; }
}
.form-group { display:flex; flex-direction:column; }
.form-label { margin-bottom:.4rem; font-size:.9rem; font-weight:600; color:#374151; }
.optional { color:#9ca3af; font-weight:400; }
.form-control, .form-select {
  padding:.75rem; border:1px solid #d1d5db; border-radius:8px; font-size:.9rem; background:#fff;
  transition:border-color .2s, box-shadow .2s;
}
.form-control:focus, .form-select:focus { outline:none; border-color:#008040; box-shadow: 0 0 0 3px rgba(0,128,64,.12); }

/* Alerts */
.alert { border-radius:10px; padding: .9rem 1rem; }
.alert-success { background:#d1fae5; color:#065f46; border:1px solid #a7f3d0; }
.alert-danger  { background:#fee2e2; color:#991b1b; border:1px solid #fecaca; }

/* Mobile tweaks */
@media (max-width: 768px){
  .admin-cms-section { padding: 1rem; }
  .page-header { flex-direction:column; align-items:stretch; gap:.75rem; }
}

/* Layout glue (matches sidebar) */
.admin-cms-layout { display: flex; min-height: 100vh; background:#fafbfc; }
.admin-main { flex: 1 1 auto; display:flex; flex-direction:column; min-width:0; }
.admin-topbar { display:flex; align-items:center; gap:1rem; padding:1rem 1.5rem; border-bottom:1px solid #e5e7eb; background:#fff; }
.admin-topbar__title { font-weight:700; font-size:1rem; }
.admin-topbar__spacer { flex:1; }
.admin-topbar__user { display:flex; align-items:center; gap:.6rem; }
.admin-topbar__avatar { width:34px; height:34px; border-radius:50%; background:#008040; color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; }
.admin-topbar__name { font-weight:600; }

/* Section container */
.admin-cms-section { padding:2rem 3rem; }

/* Page header */
.page-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:2rem; padding-bottom:1rem; border-bottom:1px solid #e5e7eb; }
.page-title { margin:0; font-size:1.875rem; font-weight:700; color:#111827; display:flex; align-items:center; gap:.5rem; }
.page-title__icon { color:#008040; }

/* Welcome text */
.welcome-text { margin:.5rem 0 0; color:#6b7280; line-height:1.6; }

/* Dashboard grid + cards */
.dashboard-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(320px,1fr)); gap:1.25rem; margin-top:1.25rem; }
.dash-card { background:#fff; border:1px solid #e5e7eb; border-radius:12px; padding:1.25rem 1.5rem; text-decoration:none; box-shadow:0 1px 3px rgba(0,0,0,.05); transition:all .18s ease; position:relative; overflow:hidden; }
.dash-card:hover { transform:translateY(-2px); box-shadow:0 10px 25px rgba(0,0,0,.08); border-color:#008040; }
.dash-card::before { content:""; position:absolute; inset:0 auto auto 0; height:4px; width:100%; background:linear-gradient(90deg,#008040,#006d37); transform:scaleX(0); transform-origin:left; transition:transform .18s ease; }
.dash-card:hover::before { transform:scaleX(1); }
.dash-card h2 { margin:0 0 .5rem; font-size:1.15rem; font-weight:700; color:#111827; display:flex; align-items:center; gap:.5rem; }
.dash-card h2 i { font-size:1.1rem; color:#008040; }
.dash-card p { margin:0; color:#6b7280; }

/* Buttons (shared) */
.btn-primary { display:inline-flex; align-items:center; gap:.5rem; background:#008040; color:#fff; border:none; border-radius:8px; padding:.7rem 1.2rem; font-weight:600; cursor:pointer; transition:all .18s ease; }
.btn-primary:hover { background:#006d37; transform:translateY(-1px); box-shadow:0 6px 18px rgba(0,128,64,.15); }
.btn-secondary { display:inline-flex; align-items:center; gap:.5rem; background:#f3f4f6; color:#374151; border:1px solid #d1d5db; border-radius:8px; padding:.7rem 1.2rem; font-weight:600; transition:all .18s ease; }
.btn-secondary:hover { background:#e5e7eb; color:#111827; }

/* Responsive */
@media (max-width: 992px){ .admin-cms-section { padding:1.25rem 1.25rem; } }
@media (max-width: 640px){ .dashboard-grid { grid-template-columns:1fr; } .page-title { font-size:1.5rem; } }

