/* =====================================================================
   BOACSDHR — Admin panel stylesheet
   ---------------------------------------------------------------------
   Clean dashboard UI for content management. Same color palette as the
   public site (green + gold), but a more dense, form-friendly layout.
   ===================================================================== */

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

body.admin-body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px; line-height: 1.6;
  color: #2A3A40;
  background: #F4F7F6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: #0F2417; margin: 0 0 0.5em; line-height: 1.25;
}
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.0625rem; }
a { color: #1B5E20; text-decoration: none; }
a:hover { color: #0F3B14; }

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

/* Sidebar */
.admin-sidebar {
  width: 260px; flex-shrink: 0;
  background: #0F2417; color: #D7E5DA;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
.admin-sidebar__brand {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.admin-sidebar__brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.admin-sidebar__brand-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800; font-size: 20px; color: #fff;
}
.admin-sidebar__brand-sub {
  font-size: 11px; color: #8FA898;
  text-transform: uppercase; letter-spacing: 0.12em;
}

.admin-nav {
  flex: 1; padding: 18px 14px;
  display: flex; flex-direction: column; gap: 2px;
}
.admin-nav__group {
  font-size: 11px; font-weight: 600;
  color: #6B8175; letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 18px 12px 6px;
}
.admin-nav__item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 8px;
  color: #D7E5DA; font-size: 14px; font-weight: 500;
  position: relative;
}
.admin-nav__item i { font-size: 16px; width: 18px; text-align: center; flex-shrink: 0; }
.admin-nav__item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.admin-nav__item.is-active {
  background: rgba(212,160,23,0.12); color: #D4A017;
  font-weight: 600;
}
.admin-nav__item.is-active::before {
  content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px;
  width: 3px; background: #D4A017; border-radius: 0 3px 3px 0;
}
.admin-nav__badge {
  margin-left: auto;
  background: #D4A017; color: #0F2417;
  font-size: 11px; font-weight: 700;
  padding: 1px 7px; border-radius: 999px;
  min-width: 22px; text-align: center;
}
.admin-nav__badge--accent { background: #C53030; color: #fff; }

.admin-sidebar__footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 14px;
  display: flex; flex-direction: column; gap: 2px;
}
.admin-sidebar__footer .admin-nav__item { font-size: 13px; padding: 8px 12px; }

/* Main area */
.admin-main {
  flex: 1; display: flex; flex-direction: column;
  min-width: 0;
}
.admin-topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 28px;
  background: #fff; border-bottom: 1px solid #E2E8E5;
  position: sticky; top: 0; z-index: 50;
}
.admin-sidebar-toggle {
  display: none; width: 40px; height: 40px;
  background: transparent; border: 1px solid #E2E8E5;
  border-radius: 8px; cursor: pointer;
  flex-direction: column; gap: 4px;
  align-items: center; justify-content: center; padding: 0;
}
.admin-sidebar-toggle span {
  width: 16px; height: 2px; background: #0F2417; border-radius: 2px;
}
.admin-topbar__title { flex: 1; }
.admin-topbar__title h1 { margin: 0; font-size: 1.25rem; color: #0F2417; }
.admin-topbar__title p { margin: 2px 0 0; font-size: 13px; color: #5C6E73; }

.admin-topbar__user { display: flex; align-items: center; gap: 14px; }
.admin-user-card {
  display: flex; align-items: center; gap: 10px;
}
.admin-user-card__avatar {
  width: 38px; height: 38px;
  background: #1B5E20; color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700; font-size: 16px;
}
.admin-user-card__info { display: flex; flex-direction: column; line-height: 1.1; }
.admin-user-card__name { font-size: 13px; font-weight: 600; color: #0F2417; }
.admin-user-card__role { font-size: 11px; color: #5C6E73; text-transform: uppercase; letter-spacing: 0.05em; }

.admin-content {
  padding: 28px;
  flex: 1;
  max-width: 1400px;
  width: 100%;
}

.admin-footer {
  padding: 18px 28px;
  background: #fff; border-top: 1px solid #E2E8E5;
  font-size: 12px; color: #5C6E73;
}
.admin-footer__inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.admin-footer a { color: #1B5E20; }

/* ============= BUTTONS ============= */
.admin-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
  font-family: inherit;
}
.admin-btn:hover { transform: translateY(-1px); }
.admin-btn--primary { background: #1B5E20; color: #fff; }
.admin-btn--primary:hover { background: #0F3B14; color: #fff; }
.admin-btn--accent { background: #D4A017; color: #0F2417; }
.admin-btn--accent:hover { background: #C19114; color: #0F2417; }
.admin-btn--ghost { background: transparent; color: #1B5E20; border-color: #C5D5C9; }
.admin-btn--ghost:hover { background: #F2F5F4; }
.admin-btn--danger { background: #C53030; color: #fff; }
.admin-btn--danger:hover { background: #A02626; color: #fff; }
.admin-btn--sm { padding: 5px 10px; font-size: 12px; }
.admin-btn--lg { padding: 10px 20px; font-size: 14px; }
.admin-btn--block { width: 100%; justify-content: center; }

/* ============= CARDS ============= */
.admin-card {
  background: #fff; border: 1px solid #E2E8E5;
  border-radius: 12px; padding: 24px;
  margin-bottom: 20px;
}
.admin-card__header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px;
  padding-bottom: 14px; border-bottom: 1px solid #F0F4F2;
}
.admin-card__title { margin: 0; font-size: 1.0625rem; color: #0F2417; }
.admin-card__actions { display: flex; gap: 8px; }

/* Stat cards (dashboard) */
.admin-stat-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  margin-bottom: 24px;
}
.admin-stat {
  background: #fff; border: 1px solid #E2E8E5;
  border-radius: 12px; padding: 20px;
  display: flex; align-items: flex-start; gap: 14px;
  transition: box-shadow .2s, transform .15s;
}
.admin-stat:hover { box-shadow: 0 6px 18px rgba(15,36,23,0.06); transform: translateY(-2px); }
.admin-stat__icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.admin-stat__icon--green  { background: #EAF2EC; color: #1B5E20; }
.admin-stat__icon--gold   { background: #FBF1D9; color: #D4A017; }
.admin-stat__icon--blue   { background: #E8F2F6; color: #1B5E78; }
.admin-stat__icon--red    { background: #FBEAEA; color: #C53030; }
.admin-stat__icon--purple { background: #F0EAF6; color: #6B3FA0; }
.admin-stat__info { flex: 1; }
.admin-stat__value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.75rem; font-weight: 800; color: #0F2417;
  line-height: 1;
}
.admin-stat__label {
  font-size: 12px; color: #5C6E73;
  text-transform: uppercase; letter-spacing: 0.06em;
  margin: 6px 0 0;
}
.admin-stat__delta {
  font-size: 11px; margin-top: 8px;
  color: #1B5E20;
}
.admin-stat__delta--neg { color: #C53030; }

/* ============= TABLE ============= */
.admin-table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid #E2E8E5; background: #fff; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table thead { background: #F7F9F8; }
.admin-table th {
  text-align: left; padding: 12px 16px;
  font-weight: 600; color: #5C6E73;
  text-transform: uppercase; font-size: 11px;
  letter-spacing: 0.06em;
  border-bottom: 1px solid #E2E8E5;
  white-space: nowrap;
}
.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #F0F4F2;
  vertical-align: middle;
  color: #2A3A40;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: #FAFCFB; }
.admin-table__primary { font-weight: 600; color: #0F2417; }
.admin-table__thumb {
  width: 40px; height: 40px; border-radius: 6px;
  object-fit: cover; background: #F2F5F4;
  display: inline-block; vertical-align: middle;
}
.admin-table__actions { display: flex; gap: 6px; }
.admin-table__actions a, .admin-table__actions button {
  padding: 6px 10px; font-size: 12px;
  border-radius: 6px;
  background: #F2F5F4; color: #5C6E73;
  border: 1px solid transparent;
  text-decoration: none; cursor: pointer;
  font-family: inherit; font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px;
  transition: background .15s, color .15s;
}
.admin-table__actions a:hover { background: #1B5E20; color: #fff; }
.admin-table__actions .action-delete:hover { background: #C53030; color: #fff; }

/* ============= FORMS ============= */
.admin-form .form-group { margin-bottom: 18px; }
.admin-form label {
  display: block; margin-bottom: 6px;
  font-weight: 500; font-size: 13px; color: #0F2417;
}
.admin-form label .req { color: #C53030; }
.admin-form .help { font-size: 12px; color: #5C6E73; margin-top: 4px; }

.admin-form input[type=text],
.admin-form input[type=email],
.admin-form input[type=password],
.admin-form input[type=tel],
.admin-form input[type=url],
.admin-form input[type=date],
.admin-form input[type=datetime-local],
.admin-form input[type=number],
.admin-form select,
.admin-form textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #C5D5C9;
  border-radius: 8px;
  font-family: inherit; font-size: 14px;
  background: #fff; color: #0F2417;
  transition: border-color .15s, box-shadow .15s;
}
.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  outline: none; border-color: #1B5E20;
  box-shadow: 0 0 0 3px rgba(27,94,32,0.15);
}
.admin-form textarea { min-height: 130px; resize: vertical; }
.admin-form .row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.admin-form .row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .admin-form .row-2, .admin-form .row-3 { grid-template-columns: 1fr; } }

.admin-form__actions {
  display: flex; gap: 10px; justify-content: flex-end;
  padding-top: 18px; border-top: 1px solid #F0F4F2;
  margin-top: 24px;
}

/* Image preview */
.image-preview {
  margin-top: 10px;
  border: 1px dashed #C5D5C9; border-radius: 8px;
  padding: 14px; text-align: center;
  background: #FAFCFB;
  display: none;
}
.image-preview.is-visible { display: block; }
.image-preview img { max-width: 280px; max-height: 200px; border-radius: 6px; margin: 0 auto; }
.image-preview__current { margin-top: 8px; font-size: 12px; color: #5C6E73; }

/* Toggle switch */
.toggle {
  position: relative; display: inline-block;
  width: 44px; height: 22px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle__slider {
  position: absolute; cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #C5D5C9;
  border-radius: 999px; transition: background .2s;
}
.toggle__slider::before {
  content: ""; position: absolute;
  height: 16px; width: 16px;
  left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: transform .2s;
}
.toggle input:checked + .toggle__slider { background: #1B5E20; }
.toggle input:checked + .toggle__slider::before { transform: translateX(22px); }

/* ============= ALERTS ============= */
.admin-alert {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 10px;
  margin-bottom: 18px; font-size: 14px;
  border-left: 4px solid;
}
.admin-alert--success { background: #EAF2EC; color: #1B5E20; border-color: #1B5E20; }
.admin-alert--error   { background: #FBEAEA; color: #C53030; border-color: #C53030; }
.admin-alert--warning { background: #FDF6E3; color: #8A6D1F; border-color: #D4A017; }
.admin-alert--info    { background: #E8F2F6; color: #1B5E78; border-color: #1B5E78; }
.admin-alert i { font-size: 18px; }

/* ============= BADGES (shared with public) ============= */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.badge-published  { background: #EAF2EC; color: #1B5E20; }
.badge-draft      { background: #F2F5F4; color: #5C6E73; }
.badge-archived   { background: #ECEFF1; color: #607D8B; }
.badge-upcoming   { background: #E8F2F6; color: #1B5E78; }
.badge-completed  { background: #EAF2EC; color: #1B5E20; }
.badge-cancelled  { background: #FBEAEA; color: #C53030; }
.badge-pending    { background: #FDF6E3; color: #8A6D1F; }
.badge-approved   { background: #EAF2EC; color: #1B5E20; }
.badge-rejected   { background: #FBEAEA; color: #C53030; }
.badge-suspended  { background: #ECEFF1; color: #607D8B; }
.badge-active     { background: #EAF2EC; color: #1B5E20; }
.badge-new        { background: #D4A017; color: #0F2417; }
.badge-read       { background: #F2F5F4; color: #5C6E73; }
.badge-replied    { background: #E8F2F6; color: #1B5E78; }
.badge-default    { background: #F2F5F4; color: #5C6E73; }

/* ============= LOGIN ============= */
.admin-login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1B5E20 0%, #0F3B14 60%, #0A2A0E 100%);
  padding: 24px;
  position: relative;
}
.admin-login::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
}
.admin-login__card {
  background: #fff; border-radius: 18px;
  width: 100%; max-width: 420px;
  padding: 40px 36px;
  box-shadow: 0 24px 60px rgba(15,36,23,0.3);
  position: relative; z-index: 1;
}
.admin-login__brand { text-align: center; margin-bottom: 28px; }
.admin-login__brand .brand__logo { display: inline-flex; }
.admin-login__brand h1 { margin: 14px 0 4px; font-size: 1.5rem; }
.admin-login__brand p { margin: 0; font-size: 13px; color: #5C6E73; }

.admin-login__form .form-group { margin-bottom: 16px; }
.admin-login__form label {
  display: block; margin-bottom: 6px; font-size: 13px;
  font-weight: 600; color: #0F2417;
}
.admin-login__form input {
  width: 100%; padding: 11px 14px;
  border: 1px solid #C5D5C9; border-radius: 8px;
  font-family: inherit; font-size: 14px;
}
.admin-login__form input:focus {
  outline: none; border-color: #1B5E20;
  box-shadow: 0 0 0 3px rgba(27,94,32,0.15);
}
.admin-login__submit {
  width: 100%; padding: 12px;
  background: #1B5E20; color: #fff;
  border: none; border-radius: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700; font-size: 14px;
  cursor: pointer; transition: background .15s;
  margin-top: 6px;
}
.admin-login__submit:hover { background: #0F3B14; }
.admin-login__hint {
  margin-top: 22px; padding: 14px 16px;
  background: #F7F9F8; border-radius: 8px;
  font-size: 12px; color: #5C6E73; line-height: 1.6;
}
.admin-login__hint strong { color: #0F2417; }
.admin-login__footer { text-align: center; margin-top: 18px; font-size: 12px; }
.admin-login__footer a { color: #1B5E20; }

/* ============= DASHBOARD RECENT LIST ============= */
.recent-list { list-style: none; padding: 0; margin: 0; }
.recent-list li {
  display: flex; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid #F0F4F2;
}
.recent-list li:last-child { border-bottom: none; }
.recent-list__icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: #F2F5F4; color: #1B5E20;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 16px;
}
.recent-list__body { flex: 1; min-width: 0; }
.recent-list__title { margin: 0; font-size: 13px; font-weight: 600; color: #0F2417; }
.recent-list__meta { margin: 2px 0 0; font-size: 12px; color: #5C6E73; }

/* ============= FILTER BAR ============= */
.admin-filter-bar {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  margin-bottom: 18px;
  padding: 14px 16px;
  background: #fff; border: 1px solid #E2E8E5;
  border-radius: 12px;
}
.admin-filter-bar input, .admin-filter-bar select {
  padding: 8px 12px;
  border: 1px solid #C5D5C9; border-radius: 8px;
  font-family: inherit; font-size: 13px;
  background: #fff; color: #0F2417;
  min-width: 160px;
}
.admin-filter-bar .search-input { flex: 1; min-width: 200px; }
.admin-filter-bar input:focus, .admin-filter-bar select:focus {
  outline: none; border-color: #1B5E20;
  box-shadow: 0 0 0 3px rgba(27,94,32,0.15);
}
.admin-filter-bar__results {
  margin-left: auto; font-size: 12px; color: #5C6E73;
}

/* ============= EMPTY / PAGINATION ============= */
.admin-empty {
  text-align: center; padding: 60px 20px;
  color: #5C6E73;
}
.admin-empty i { font-size: 40px; color: #C5D5C9; margin-bottom: 12px; }
.admin-empty h3 { margin: 0 0 6px; color: #0F2417; }
.admin-empty p { margin: 0; }

.admin-pagination {
  display: flex; gap: 4px; justify-content: center;
  margin-top: 24px; flex-wrap: wrap;
}
.admin-pagination a, .admin-pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 10px;
  border: 1px solid #E2E8E5; border-radius: 6px;
  font-size: 13px; color: #0F2417;
}
.admin-pagination a:hover { background: #F2F5F4; border-color: #1B5E20; color: #1B5E20; }
.admin-pagination .current { background: #1B5E20; color: #fff; border-color: #1B5E20; }

/* ============= DETAIL VIEW (messages / partner-apps) ============= */
.detail-card {
  background: #fff; border: 1px solid #E2E8E5;
  border-radius: 12px; padding: 24px;
  margin-bottom: 20px;
}
.detail-card__head {
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 12px; margin-bottom: 16px;
  padding-bottom: 14px; border-bottom: 1px solid #F0F4F2;
}
.detail-card__title { margin: 0; font-size: 1.25rem; color: #0F2417; }
.detail-meta {
  display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px;
  font-size: 14px;
}
.detail-meta__label { color: #5C6E73; font-weight: 500; }
.detail-meta__value { color: #0F2417; }

.message-box {
  background: #F7F9F8; border-radius: 8px;
  padding: 18px; margin: 14px 0;
  border-left: 3px solid #1B5E20;
  font-size: 14px; line-height: 1.65; color: #2A3A40;
}

/* ============= RESPONSIVE ============= */
@media (max-width: 980px) {
  .admin-sidebar {
    position: fixed; top: 0; bottom: 0; left: 0;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform .25s;
  }
  .admin-sidebar.is-open { transform: translateX(0); }
  .admin-sidebar-toggle { display: inline-flex; }
  .admin-content { padding: 20px; }
  .admin-topbar { padding: 14px 20px; }
}

@media (max-width: 580px) {
  .admin-topbar__user .admin-user-card__info { display: none; }
  .admin-stat-grid { grid-template-columns: 1fr; }
  .admin-form__actions { flex-direction: column; }
  .admin-form__actions .admin-btn { width: 100%; justify-content: center; }
  .detail-meta { grid-template-columns: 1fr; gap: 4px; }
  .detail-meta__label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
}
