/* ===========================================================================
   Green Peace — Admin panel theme (ia-Academy style, purple)
   =========================================================================== */
:root {
  --gp-green: #7c5cfc;          /* primary (kept name for compatibility) */
  --gp-green-dark: #6a43f0;     /* primary dark */
  --gp-green-50: #f1edff;       /* primary tint */
  --gp-ink: #2b2f48;            /* headings / strong text */
  --gp-text: #4a4f6a;           /* body text */
  --gp-muted: #9095ad;          /* muted text */
  --gp-line: #ececf4;           /* borders */
  --gp-bg: #f5f4fb;             /* page background */
  --gp-card: #ffffff;
  --gp-sidebar: #ffffff;
  --gp-radius: 16px;
  --gp-shadow: 0 14px 40px -22px rgba(80, 60, 180, 0.45);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--gp-bg);
  color: var(--gp-text);
  font-size: 14px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
.gp-ic { width: 20px; height: 20px; flex-shrink: 0; }

/* ---- Layout ---- */
.gp-admin { display: flex; min-height: 100vh; }
.gp-sidebar {
  position: fixed; inset: 0 auto 0 0; width: 256px; z-index: 50;
  background: var(--gp-sidebar); border-right: 1px solid var(--gp-line);
  display: flex; flex-direction: column; transition: transform .3s ease;
}
.gp-main { flex: 1; margin-left: 256px; min-width: 0; display: flex; flex-direction: column; }
.gp-content { padding: 24px clamp(14px, 2.5vw, 30px) 50px; }

/* ---- Sidebar ---- */
.gp-brand { display: flex; align-items: center; gap: 10px; padding: 22px 22px 18px; }
.gp-brand .logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #8b6dff, #6a43f0); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; }
.gp-brand .logo-img { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; }
.gp-brand b { color: var(--gp-ink); font-size: 17px; font-weight: 800; letter-spacing: -.2px; }
.gp-brand span { display: none; }
.gp-nav { padding: 6px 14px 20px; flex: 1; overflow-y: auto; }
.gp-nav .group-label { color: #aeb2c6; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; padding: 16px 12px 7px; }
.gp-nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 13px; border-radius: 11px;
  color: var(--gp-text); font-weight: 500; margin-bottom: 2px; transition: background .16s, color .16s;
}
.gp-nav a .gp-ic { color: #a3a8bd; transition: color .16s; }
.gp-nav a:hover { background: #f6f5fd; color: var(--gp-ink); }
.gp-nav a:hover .gp-ic { color: var(--gp-green); }
.gp-nav a.active { background: var(--gp-green-50); color: var(--gp-green-dark); font-weight: 600; }
.gp-nav a.active .gp-ic { color: var(--gp-green-dark); }
.gp-nav a.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--gp-green); }
.gp-nav a .badge-count { margin-left: auto; background: #ef4d6b; color: #fff; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }

/* ---- Topbar ---- */
.gp-topbar {
  position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gp-line); display: flex; align-items: center; gap: 14px;
  padding: 12px clamp(14px, 2.5vw, 30px);
}
.gp-topbar h1 { display: none; }
.gp-topbar .spacer { flex: 1; }
.gp-search { flex: 1; max-width: 420px; position: relative; }
.gp-search input { width: 100%; height: 42px; border: 1px solid var(--gp-line); background: #faf9ff; border-radius: 999px; padding: 0 44px 0 18px; font: inherit; color: var(--gp-ink); outline: none; transition: border-color .15s, box-shadow .15s; }
.gp-search input:focus { border-color: var(--gp-green); box-shadow: 0 0 0 3px rgba(124,92,252,.12); background: #fff; }
.gp-search .mag { position: absolute; right: 6px; top: 5px; width: 32px; height: 32px; border-radius: 50%; background: var(--gp-green); color: #fff; display: grid; place-items: center; }
.gp-search .mag .gp-ic { width: 16px; height: 16px; }
.gp-hamb { display: none; background: var(--gp-green-50); color: var(--gp-green-dark); border: 0; border-radius: 11px; width: 42px; height: 42px; cursor: pointer; align-items: center; justify-content: center; }
.gp-topbtn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--gp-line); background: #fff; color: #6b7090; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: .15s; }
.gp-topbtn:hover { background: var(--gp-green-50); color: var(--gp-green-dark); border-color: transparent; }
.gp-user { display: flex; align-items: center; gap: 10px; padding-left: 6px; position: relative; cursor: pointer; user-select: none; border-radius: 12px; padding: 4px 6px; transition: background .15s; }
.gp-user:hover { background: var(--gp-green-50); }
.gp-user .av { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #8b6dff, #6a43f0); color: #fff; display: grid; place-items: center; font-weight: 700; }
.gp-user b { font-size: 13.5px; color: var(--gp-ink); display: block; line-height: 1.2; }
.gp-user small { color: var(--gp-muted); display: block; font-size: 12px; }
.gp-user-caret { transition: transform .2s ease; }
.gp-user.open .gp-user-caret { transform: rotate(180deg); }
/* Administrator dropdown menu */
.gp-user-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 230px;
  max-width: calc(100vw - 24px);
  background: #fff; border: 1px solid var(--gp-line); border-radius: 14px;
  box-shadow: 0 18px 44px -14px rgba(20, 20, 50, .25);
  padding: 7px; z-index: 1200; display: none;
}
.gp-user.open .gp-user-menu { display: block; animation: gp-um-in .14s ease; }
@keyframes gp-um-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.gp-um-head { padding: 8px 11px 11px; border-bottom: 1px solid var(--gp-line); margin-bottom: 6px; }
.gp-um-name { display: block; font-size: 13.5px; font-weight: 700; color: var(--gp-ink); line-height: 1.3; }
.gp-um-email { display: block; font-size: 12px; color: var(--gp-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gp-user-menu a, .gp-user-menu button {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 11px; border-radius: 10px; font-size: 13.5px; font-weight: 500;
  color: var(--gp-ink); background: none; border: 0; cursor: pointer;
  text-align: left; text-decoration: none; transition: background .15s, color .15s;
}
.gp-user-menu a:hover { background: var(--gp-green-50); color: var(--gp-green-dark); }
.gp-user-menu .gp-ic { width: 17px; height: 17px; flex-shrink: 0; }
.gp-user-menu #gp-user-logout { color: #c02a44; }
.gp-user-menu #gp-user-logout:hover { background: #fdecee; color: #a91d39; }

/* ---- Cards / panels ---- */
.gp-card { background: var(--gp-card); border: 1px solid var(--gp-line); border-radius: var(--gp-radius); box-shadow: 0 10px 30px -26px rgba(80,60,180,.5); }
.gp-card .hd { display: flex; align-items: center; gap: 11px; padding: 17px 22px; border-bottom: 1px solid var(--gp-line); }
.gp-card .hd h2 { font-size: 16px; font-weight: 700; color: var(--gp-ink); margin: 0; }
.gp-card .hd .gp-ic { color: var(--gp-green); }
.gp-card .bd { padding: 20px 22px; }

/* ---- Stat cards (reference style: label+number left, icon right) ---- */
.gp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.gp-stat { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff; border: 1px solid var(--gp-line); border-radius: 16px; padding: 18px 20px; }
.gp-stat .info .lbl { color: var(--gp-muted); font-size: 13.5px; font-weight: 500; }
.gp-stat .info .num { font-size: 25px; font-weight: 800; color: var(--gp-ink); margin-top: 6px; line-height: 1; }
.gp-stat .ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; }
.gp-stat .ic .gp-ic { width: 26px; height: 26px; }
.gp-stat.s-purple { background: #efeafe; border-color: #e6dffb; } .gp-stat.s-purple .ic { background: #ddd2fb; color: #6a43f0; }
.gp-stat.s-blue   { background: #e6f1fe; border-color: #d9e9fc; } .gp-stat.s-blue .ic   { background: #cfe3fb; color: #2f7fe0; }
.gp-stat.s-peach  { background: #fff0e2; border-color: #fde6d2; } .gp-stat.s-peach .ic  { background: #ffe0c2; color: #e3852b; }
.gp-stat.s-green  { background: #e4f7ec; border-color: #d3f0de; } .gp-stat.s-green .ic  { background: #c9eed6; color: #1f9d57; }
.gp-stat .badge-new { background: #fff; color: var(--gp-green-dark); font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }

/* ---- Buttons ---- */
.gp-btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid transparent; border-radius: 11px; padding: 9px 16px; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: .16s; background: #f0eefb; color: var(--gp-text); }
.gp-btn:hover { filter: brightness(.98); }
.gp-btn--primary { background: var(--gp-green); color: #fff; box-shadow: 0 10px 22px -10px rgba(124,92,252,.7); }
.gp-btn--primary:hover { background: var(--gp-green-dark); }
.gp-btn--light { background: #fff; border-color: var(--gp-line); color: var(--gp-text); }
.gp-btn--light:hover { background: var(--gp-green-50); color: var(--gp-green-dark); }
.gp-btn--danger { background: #fef2f4; color: #d4334f; }
.gp-btn--sm { padding: 6px 12px; font-size: 12.5px; }
.gp-icbtn { width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: 9px; background: #faf9ff; border: 1px solid var(--gp-line); cursor: pointer; color: var(--gp-text); display: inline-flex; align-items: center; }
.gp-icbtn:hover { background: var(--gp-green-50); color: var(--gp-green-dark); border-color: transparent; }
.gp-icbtn.del:hover { background: #fef2f4; color: #d4334f; }
.gp-icbtn .gp-ic { width: 17px; height: 17px; }

/* ---- Table ---- */
.gp-tablewrap { overflow-x: auto; }
table.gp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 520px; }
.gp-table th { text-align: left; color: var(--gp-muted); font-weight: 600; font-size: 12px; padding: 13px 16px; border-bottom: 1px solid var(--gp-line); white-space: nowrap; }
.gp-table td { padding: 13px 16px; border-bottom: 1px solid var(--gp-line); vertical-align: middle; }
.gp-table tr:last-child td { border-bottom: 0; }
.gp-table tr:hover td { background: #faf9ff; }
.gp-table .muted { color: var(--gp-muted); }
.gp-thumb { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; background: #efeefb; }
.gp-avatar { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; }
.gp-check-box { width: 18px; height: 18px; accent-color: var(--gp-green); }

/* ---- Badges ---- */
.gp-badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 11px; border-radius: 999px; text-transform: capitalize; }
.gp-badge.news, .gp-badge.new { background: #ede9ff; color: #6a43f0; }
.gp-badge.event, .gp-badge.contacted, .gp-badge.read { background: #fff0e2; color: #d8791f; }
.gp-badge.public, .gp-badge.closed { background: #eef0f6; color: #6a7088; }
.gp-badge.on { background: #e4f7ec; color: #1f9d57; }
.gp-badge.off { background: #fdecee; color: #d4334f; }

/* ---- Forms ---- */
.gp-field { margin-bottom: 15px; }
.gp-field label { display: block; font-weight: 600; color: var(--gp-ink); margin-bottom: 6px; font-size: 13px; }
.gp-field input[type=text], .gp-field input[type=email], .gp-field input[type=tel], .gp-field input[type=date], .gp-field input[type=number], .gp-field input[type=password], .gp-field input[type=file], .gp-field select, .gp-field textarea {
  width: 100%; border: 1px solid var(--gp-line); border-radius: 11px; padding: 10px 13px; font: inherit; color: var(--gp-ink); background: #faf9ff; outline: none; transition: border-color .15s, box-shadow .15s;
}
.gp-field input:focus, .gp-field select:focus, .gp-field textarea:focus { border-color: var(--gp-green); box-shadow: 0 0 0 3px rgba(124,92,252,.12); background: #fff; }
.gp-field textarea { min-height: 96px; resize: vertical; }
.gp-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.gp-check { display: flex; align-items: center; gap: 9px; }
.gp-check input { width: 18px; height: 18px; accent-color: var(--gp-green); }

/* ---- Modal ---- */
.gp-modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: flex-start; justify-content: center; padding: 40px 16px; background: rgba(43,47,72,.45); backdrop-filter: blur(3px); overflow-y: auto; }
.gp-modal.open { display: flex; }
.gp-modal .box { background: #fff; border-radius: 20px; width: 100%; max-width: 560px; box-shadow: 0 30px 80px -20px rgba(43,47,72,.5); animation: gpPop .2s ease; }
@keyframes gpPop { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.gp-modal .mh { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--gp-line); }
.gp-modal .mh h3 { margin: 0; font-size: 16px; color: var(--gp-ink); }
.gp-modal .mb { padding: 20px 22px; }
.gp-modal .mf { padding: 15px 22px; border-top: 1px solid var(--gp-line); display: flex; justify-content: flex-end; gap: 10px; }

/* ---- Toast ---- */
.gp-toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.gp-toast { background: var(--gp-ink); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: 0 14px 30px -10px rgba(0,0,0,.4); font-size: 13.5px; display: flex; align-items: center; gap: 9px; animation: gpPop .2s ease; }
.gp-toast.ok { background: var(--gp-green-dark); }
.gp-toast.err { background: #d4334f; }

.gp-empty { text-align: center; color: var(--gp-muted); padding: 40px 20px; }
.gp-page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.gp-page-head p { margin: 4px 0 0; color: var(--gp-muted); }

/* ---- Dashboard widgets ---- */
.gp-section-title { font-size: 15px; color: var(--gp-ink); font-weight: 700; margin: 4px 0 14px; }
.gp-quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.gp-quick-card { display: flex; align-items: center; gap: 13px; background: var(--gp-card); border: 1px solid var(--gp-line); border-radius: 14px; padding: 15px 16px; transition: transform .16s, box-shadow .16s, border-color .16s; }
.gp-quick-card:hover { border-color: var(--gp-green); box-shadow: var(--gp-shadow); transform: translateY(-2px); }
.gp-quick-card .qc-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--gp-green-50); color: var(--gp-green-dark); display: grid; place-items: center; flex-shrink: 0; }
.gp-quick-card .qc-txt { display: flex; flex-direction: column; line-height: 1.3; }
.gp-quick-card .qc-txt b { color: var(--gp-ink); font-size: 14px; }
.gp-quick-card .qc-txt small { color: var(--gp-muted); font-size: 12px; }

.gp-dash-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 18px; margin-bottom: 18px; }
.gp-dash-grid.even { grid-template-columns: 1fr 1fr; }

/* Bar chart */
.gp-chart { width: 100%; }
.gp-legend { display: flex; align-items: center; gap: 16px; }
.gp-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--gp-muted); }
.gp-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* Donut */
.gp-donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 8px 0; }
.gp-donut { position: relative; width: 200px; height: 200px; }
.gp-donut .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.gp-donut .center small { color: var(--gp-muted); font-size: 13px; display: block; }
.gp-donut .center b { font-size: 26px; color: var(--gp-ink); }
.gp-donut-legend { display: flex; gap: 22px; }
.gp-donut-legend span { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--gp-text); }
.gp-donut-legend i { width: 10px; height: 10px; border-radius: 50%; }

/* Activity feed */
.gp-activity { display: flex; flex-direction: column; }
.gp-activity .row { display: flex; align-items: center; gap: 13px; padding: 13px 0; border-bottom: 1px solid var(--gp-line); }
.gp-activity .row:last-child { border-bottom: 0; }
.gp-activity .aic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.gp-activity .aic.blue { background: #e6f1fe; color: #2f7fe0; }
.gp-activity .aic.red { background: #fdecee; color: #d4334f; }
.gp-activity .aic.purple { background: #efeafe; color: #6a43f0; }
.gp-activity .atx { flex: 1; min-width: 0; }
.gp-activity .atx b { color: var(--gp-ink); font-size: 13.5px; display: block; }
.gp-activity .atx small { color: var(--gp-muted); font-size: 12.5px; }
.gp-activity .atime { color: var(--gp-muted); font-size: 12px; white-space: nowrap; }

/* ---- Login ---- */
.gp-login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(130% 130% at 0% 0%, #ece7ff 0%, var(--gp-bg) 50%); }
.gp-login .card { background: #fff; width: 100%; max-width: 410px; border-radius: 22px; padding: 34px 32px; box-shadow: 0 34px 80px -34px rgba(106,67,240,.5); border: 1px solid var(--gp-line); }
.gp-login .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.gp-login .brand .logo { width: 46px; height: 46px; border-radius: 13px; background: linear-gradient(135deg, #8b6dff, #6a43f0); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.gp-login h1 { font-size: 20px; color: var(--gp-ink); margin: 0 0 4px; }
.gp-login .err { background: #fdecee; color: #c02a44; border: 1px solid #f7c9d1; padding: 10px 13px; border-radius: 11px; margin-bottom: 16px; font-size: 13px; }
.gp-login .hint { margin-top: 18px; text-align: center; color: var(--gp-muted); font-size: 12.5px; }

/* ===========================================================================
   Responsive
   =========================================================================== */
@media (max-width: 1100px) {
  .gp-stats { grid-template-columns: repeat(2, 1fr); }
  .gp-dash-grid, .gp-dash-grid.even { grid-template-columns: 1fr; }
}
.gp-drawer-close { display: none; margin-left: auto; width: 36px; height: 36px; border: 0; border-radius: 9px; background: #f0eefb; color: var(--gp-text); cursor: pointer; align-items: center; justify-content: center; }
.gp-drawer-close .gp-ic { width: 18px; height: 18px; }
@media (max-width: 1024px) {
  .gp-sidebar { transform: translateX(-100%); box-shadow: 0 0 60px rgba(0,0,0,.18); }
  .gp-sidebar.open { transform: none; }
  .gp-main { margin-left: 0; }
  .gp-hamb { display: inline-flex; }
  .gp-drawer-close { display: inline-flex; }
  .gp-backdrop { display: none; position: fixed; inset: 0; background: rgba(20,20,40,.45); z-index: 45; }
  .gp-backdrop.show { display: block; }
  .gp-nav { -webkit-overflow-scrolling: touch; }
}
@media (max-width: 720px) {
  .gp-search { max-width: none; }
  .gp-topbar .spacer { display: none; }
  .gp-user b, .gp-user small { display: none; }
  .gp-user > .gp-ic { display: none; }
  .gp-user { padding-left: 0; }
}
@media (max-width: 560px) {
  .gp-stats { grid-template-columns: 1fr; }
  .gp-grid2 { grid-template-columns: 1fr; }
  .gp-content { padding: 18px 13px 44px; }
  .gp-topbar { gap: 9px; padding: 10px 13px; }
  .gp-topbtn.hide-xs { display: none; }
  .gp-search { display: none; } /* the sidebar it filters is off-canvas on phones */
  .gp-card .bd { padding: 16px; }
}

/* ---- Rich text editor ---- */
.gp-rte { border: 1px solid var(--gp-line); border-radius: 10px; overflow: hidden; background: #fff; }
.gp-rte-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; padding: 7px 8px; background: #f2f8f4; border-bottom: 1px solid var(--gp-line); }
.gp-rte-b { min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--gp-ink); font-size: 13px; font-weight: 600; cursor: pointer; line-height: 1; }
.gp-rte-b:hover { background: #fff; border-color: var(--gp-line); }
.gp-rte-sep { width: 1px; height: 20px; background: var(--gp-line); margin: 0 4px; }
.gp-rte-area { min-height: 240px; max-height: 460px; overflow-y: auto; padding: 14px 16px; font-size: 14.5px; line-height: 1.7; color: var(--gp-ink); outline: none; }
.gp-rte-area:focus { box-shadow: inset 0 0 0 2px rgba(21,163,80,0.25); }
.gp-rte-area:empty:before { content: 'Write your blog content here…'; color: var(--gp-muted); }
.gp-rte-area h2 { font-size: 22px; font-weight: 700; margin: 18px 0 8px; }
.gp-rte-area h3 { font-size: 18px; font-weight: 700; margin: 16px 0 6px; }
.gp-rte-area p { margin: 0 0 12px; }
.gp-rte-area ul, .gp-rte-area ol { margin: 0 0 12px; padding-left: 24px; }
.gp-rte-area ul { list-style: disc; }
.gp-rte-area ol { list-style: decimal; }
.gp-rte-area blockquote { margin: 0 0 12px; padding: 6px 16px; border-left: 3px solid #15a350; color: var(--gp-muted); font-style: italic; }
.gp-rte-area a { color: #0f5c39; text-decoration: underline; }
.gp-rte-area img { max-width: 100%; border-radius: 8px; }
