/* =========================================================
   HealthyLife Remedy — Admin Panel Styles
   Extends style.css design tokens (emerald palette)
   ========================================================= */

body.admin-body {
  background: var(--off-white);
  color: var(--text-on-light);
  min-height: 100vh;
}

/* =========================================================
   Layout shell
   ========================================================= */
.admin-shell {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.admin-sidebar {
  width: 264px;
  flex-shrink: 0;
  background: var(--emerald-deep);
  color: var(--text-on-dark-dim);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.admin-sidebar-brand {
  padding: 1.4rem 1.5rem;
  border-bottom: 1px solid var(--emerald-line);
}

.admin-sidebar-brand svg { height: 30px; }

.admin-nav {
  flex: 1;
  padding: 1.2rem 0.9rem;
  overflow-y: auto;
}

.admin-nav-label {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-on-dark-faint);
  font-weight: 700;
  padding: 1.1rem 0.7rem 0.5rem;
}

.admin-nav-label:first-child { padding-top: 0.2rem; }

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-on-dark-dim);
  margin-bottom: 0.15rem;
}

.admin-nav a i { font-size: 1.05rem; width: 20px; text-align: center; color: var(--text-on-dark-faint); }

.admin-nav a:hover { background: var(--emerald-pill); color: var(--white); }
.admin-nav a:hover i { color: var(--emerald-bright); }

.admin-nav a.active { background: var(--emerald-brand); color: var(--white); }
.admin-nav a.active i { color: var(--white); }

.admin-nav .badge-count {
  margin-left: auto;
  background: rgba(255,255,255,0.12);
  color: var(--text-on-dark-dim);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-pill);
}

.admin-nav a.active .badge-count { background: rgba(255,255,255,0.25); color: #fff; }

.admin-sidebar-footer {
  padding: 1.1rem 1.5rem;
  border-top: 1px solid var(--emerald-line);
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.admin-user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--emerald-brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.82rem; flex-shrink: 0;
}

.admin-sidebar-footer .user-name { font-size: 0.85rem; font-weight: 700; color: #fff; }
.admin-sidebar-footer .user-role { font-size: 0.74rem; color: var(--text-on-dark-faint); }

/* ---- Main column ---- */
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.admin-topbar {
  background: var(--white);
  border-bottom: 1px solid #E2E8E3;
  padding: 1rem 1.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
}

.admin-topbar h1 { font-size: 1.3rem; margin-bottom: 0; color: var(--text-on-light); }
.admin-topbar p.subtitle { font-size: 0.85rem; color: var(--text-on-light-dim); margin-bottom: 0; }

.admin-search-box {
  background: var(--off-white);
  border: 1px solid #E2E8E3;
  border-radius: var(--radius-pill);
  padding: 0.5rem 1rem;
  font-size: 0.88rem;
  min-width: 240px;
}

.admin-content { padding: 1.8rem; flex: 1; }

.sidebar-toggle-btn {
  display: none;
  background: var(--emerald-pill);
  border: 1px solid var(--emerald-line);
  color: #fff;
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
}

@media (max-width: 991px) {
  .admin-sidebar { position: fixed; left: -280px; z-index: 1050; transition: left 0.2s ease; }
  .admin-sidebar.open { left: 0; }
  .sidebar-toggle-btn { display: flex; }
  .admin-search-box { display: none; }
}

/* =========================================================
   Cards / Stat tiles
   ========================================================= */
.admin-card {
  background: var(--white);
  border: 1px solid #E2E8E3;
  border-radius: var(--radius-card);
  padding: 1.5rem;
}

.admin-stat-tile {
  background: var(--white);
  border: 1px solid #E2E8E3;
  border-radius: var(--radius-card);
  padding: 1.4rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  height: 100%;
}

.admin-stat-tile .stat-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.stat-icon.bg-emerald { background: rgba(40,98,58,0.1); color: var(--emerald-brand); }
.stat-icon.bg-blue { background: #E8F0FB; color: #2B5FA3; }
.stat-icon.bg-amber { background: #FBF1E7; color: #C4622D; }
.stat-icon.bg-rose { background: #FBE9EE; color: #C23A5C; }

.admin-stat-tile .stat-value { font-size: 1.7rem; font-weight: 800; color: var(--text-on-light); display: block; margin-top: 0.7rem; }
.admin-stat-tile .stat-label { font-size: 0.82rem; color: var(--text-on-light-dim); }
.admin-stat-tile .stat-delta { font-size: 0.76rem; font-weight: 700; margin-top: 0.3rem; display: inline-flex; align-items: center; gap: 0.25rem; }
.stat-delta.up { color: #1f8a4c; }
.stat-delta.down { color: #c23a5c; }

/* =========================================================
   Tables
   ========================================================= */
.admin-table-wrap {
  background: var(--white);
  border: 1px solid #E2E8E3;
  border-radius: var(--radius-card);
  overflow: hidden;
}

table.admin-table { width: 100%; border-collapse: collapse; font-size: 0.89rem; }

table.admin-table thead th {
  background: var(--off-white);
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-on-light-dim);
  font-weight: 700;
  padding: 0.85rem 1.2rem;
  border-bottom: 1px solid #E2E8E3;
}

table.admin-table tbody td {
  padding: 0.95rem 1.2rem;
  border-bottom: 1px solid #EEF2EE;
  color: var(--text-on-light);
  vertical-align: middle;
}

table.admin-table tbody tr:last-child td { border-bottom: none; }
table.admin-table tbody tr:hover { background: var(--off-white); }

.table-thumb {
  width: 46px; height: 46px; border-radius: 8px;
  background-size: cover; background-position: center;
  flex-shrink: 0;
}

.table-row-title { font-weight: 700; color: var(--text-on-light); font-size: 0.92rem; }
.table-row-sub { font-size: 0.78rem; color: var(--text-on-light-dim); }

.status-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.74rem; font-weight: 700;
  padding: 0.28rem 0.7rem;
  border-radius: var(--radius-pill);
}
.status-badge.published { background: #E6F4EE; color: #1f6e4f; }
.status-badge.draft { background: #F3F0E7; color: #92742c; }
.status-badge.scheduled { background: #EAF1FB; color: #2b5fa3; }
.status-badge.archived { background: #F1F1F1; color: #6b6b6b; }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.row-action-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid #E2E8E3;
  background: var(--white);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-on-light-dim);
}
.row-action-btn:hover { border-color: var(--emerald-brand); color: var(--emerald-brand); }
.row-action-btn.danger:hover { border-color: #c23a5c; color: #c23a5c; }

/* =========================================================
   Buttons
   ========================================================= */
.btn-admin-primary {
  background: var(--emerald-brand);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.3rem;
  font-weight: 700;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-admin-primary:hover { background: #1e4d2e; color: #fff; }

.btn-admin-outline {
  background: var(--white);
  color: var(--text-on-light);
  border: 1px solid #D6DED8;
  border-radius: var(--radius-sm);
  padding: 0.62rem 1.25rem;
  font-weight: 600;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-admin-outline:hover { border-color: var(--emerald-brand); color: var(--emerald-brand); }

.btn-admin-ghost {
  background: transparent;
  color: var(--text-on-light-dim);
  border: none;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.6rem 1rem;
}
.btn-admin-ghost:hover { color: var(--text-on-light); }

/* =========================================================
   Filters / pills
   ========================================================= */
.admin-filter-pill {
  border: 1px solid #E2E8E3;
  border-radius: var(--radius-pill);
  padding: 0.45rem 1rem;
  font-size: 0.83rem;
  font-weight: 600;
  background: var(--white);
  color: var(--text-on-light-dim);
}
.admin-filter-pill.active { background: var(--emerald-brand); border-color: var(--emerald-brand); color: #fff; }

/* =========================================================
   Forms (article editor etc.)
   ========================================================= */
.admin-form-label {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-on-light);
  margin-bottom: 0.4rem;
  display: block;
}

.admin-form-hint { font-size: 0.78rem; color: var(--text-on-light-dim); margin-top: 0.35rem; }

.admin-input, .admin-select, .admin-textarea, .admin-search-input {
  width: 100%;
  border: 1px solid #D6DED8;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  font-size: 0.92rem;
  color: var(--text-on-light);
  background: var(--white);
}

.admin-input:focus, .admin-select:focus, .admin-textarea:focus, .admin-search-input:focus {
  outline: none;
  border-color: var(--emerald-brand);
  box-shadow: 0 0 0 3px rgba(40,98,58,0.1);
}

.admin-form-section {
  background: var(--white);
  border: 1px solid #E2E8E3;
  border-radius: var(--radius-card);
  padding: 1.6rem;
  margin-bottom: 1.5rem;
}

.admin-form-section h3 {
  font-size: 1.02rem;
  color: var(--text-on-light);
  margin-bottom: 1.2rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid #EEF2EE;
}

.image-upload-zone {
  border: 2px dashed #D6DED8;
  border-radius: var(--radius-card);
  padding: 2.2rem;
  text-align: center;
  color: var(--text-on-light-dim);
  background: var(--off-white);
}

.image-upload-zone i { font-size: 1.8rem; color: var(--emerald-brand); margin-bottom: 0.6rem; display: block; }
.image-upload-zone .upload-link { color: var(--emerald-brand); font-weight: 700; }

.tag-pill-input {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: rgba(40,98,58,0.08);
  color: var(--emerald-brand);
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.4rem 0.3rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 600;
}
.tag-pill-input i { cursor: pointer; font-size: 0.8rem; }

/* Quill editor theming */
.ql-toolbar.ql-snow {
  border: 1px solid #D6DED8;
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--off-white);
}
.ql-container.ql-snow {
  border: 1px solid #D6DED8;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  min-height: 320px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  background: #fff;
}
.ql-editor { min-height: 320px; }

/* =========================================================
   Sticky save bar
   ========================================================= */
.admin-save-bar {
  position: sticky;
  bottom: 0;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-top: 1px solid #E2E8E3;
  padding: 1rem 1.8rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
  margin: 0 -1.8rem -1.8rem;
}

/* =========================================================
   Pagination
   ========================================================= */
.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-top: 1px solid #E2E8E3;
  font-size: 0.85rem;
  color: var(--text-on-light-dim);
}
.admin-pagination .page-btns { display: flex; gap: 0.4rem; }
.admin-pagination .page-btn {
  width: 32px; height: 32px;
  border: 1px solid #E2E8E3;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  color: var(--text-on-light-dim);
}
.admin-pagination .page-btn.active { background: var(--emerald-brand); color: #fff; border-color: var(--emerald-brand); }

/* Bootstrap 5 paginator ({{ $items->links() }}) — match admin look */
.pagination { margin-bottom: 0; gap: 0.35rem; flex-wrap: wrap; }
.pagination .page-link {
  min-width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 0.55rem;
  border: 1px solid #E2E8E3;
  border-radius: 8px !important;
  font-size: 0.85rem; font-weight: 600;
  color: var(--text-on-light-dim);
  background: #fff;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pagination .page-link:hover {
  background: #EEF5EE;
  border-color: var(--emerald-brand);
  color: var(--emerald-brand);
}
.pagination .page-link:focus { box-shadow: 0 0 0 3px rgba(40,98,58,0.15); }
.pagination .page-item.active .page-link {
  background: var(--emerald-brand);
  border-color: var(--emerald-brand);
  color: #fff;
}
.pagination .page-item.disabled .page-link { color: #B7C4BA; background: #F7FAF7; }

/* =========================================================
   Login screen
   ========================================================= */
.admin-login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--emerald-deep);
  background-image: radial-gradient(ellipse 700px 400px at 50% 0%, rgba(40,98,58,0.35), transparent 70%);
  padding: 2rem;
}

.admin-login-card {
  background: var(--emerald-pill);
  border: 1px solid var(--emerald-line);
  border-radius: var(--radius-card);
  padding: 2.6rem;
  width: 100%;
  max-width: 420px;
}

.admin-login-card label { color: var(--text-on-dark-dim); font-weight: 700; font-size: 0.85rem; margin-bottom: 0.4rem; display: block; }

.admin-login-card .admin-input {
  background: var(--emerald-deep);
  border: 1px solid var(--emerald-line);
  color: #fff;
  margin-bottom: 1.1rem;
}

/* =========================================================
   Empty states
   ========================================================= */
.admin-empty-state {
  text-align: center;
  padding: 3.5rem 2rem;
  color: var(--text-on-light-dim);
}
.admin-empty-state i { font-size: 2.4rem; color: #D6DED8; margin-bottom: 1rem; display: block; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 767px) {
  .admin-content { padding: 1.1rem; }
  .admin-topbar { padding: 0.9rem 1.1rem; }
}
