/* Admin Styles */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  list-style: none;
  text-decoration: none;
  font-family: "Poppins", sans-serif;
}

:root {
  --main-color: #359381;
  --dark-main-color: #003329;
  --grey: #333;
  --body-bg: #f4f6f5;
  --border: #e8eeec;
  --text-dark: #0d1f1c;
  --text-body: #3d5450;
}

body {
  background: #ffffff;
  min-height: 100vh;
  overflow-x: hidden;
}

.layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 240px;
  background: #003329;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  z-index: 200;
  transition: transform 0.3s ease;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 12px;
  overflow-y: auto;
}

.nav-label {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  padding: 0 12px;
  margin-bottom: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.65);
  font-size: 14px;
  font-weight: 400;
  transition: all 0.18s ease;
  margin-bottom: 2px;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.nav-item.active {
  background: rgba(53, 147, 129, 0.12);
  color: #359381;
  border: 1px solid rgba(53, 147, 129, 0.18);
}

.nav-item .nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
}

.nav-item .nav-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.8;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.65);
  font-size: 14px;
  font-weight: 400;
  transition: all 0.18s ease;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}

.logout-btn:hover {
  background: #ff2b2b;
  color: #ffffff;
}
.logout-btn .nav-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.8;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.header {
  height: 64px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
  margin-right: 8px;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-body);
  border-radius: 2px;
  transition: all 0.3s;
}

.page-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-dark);
  letter-spacing: -0.01em;
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--body-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.18s;
}

.icon-btn:hover {
  background: #ffffff;
  border-color: #359381;
}
.icon-btn svg {
  width: 17px;
  height: 17px;
  stroke: var(--text-body);
  stroke-width: 1.8;
}

.icon-btn .dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #359381;
  border: 1.5px solid #ffffff;
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 22px 20px;
  box-shadow: 0 2px 16px rgba(0, 51, 41, 0.07);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 24px rgba(0, 51, 41, 0.11);
}

.stat-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-body);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 32px;
  font-weight: 600;
  color: var(--text-dark);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 10px;
}

.stat-footer {
  font-size: 12px;
  color: var(--text-body);
  display: flex;
  align-items: center;
  gap: 5px;
}

.stat-change {
  font-weight: 600;
}
.stat-change.up {
  color: #359381;
}
.stat-change.down {
  color: #e05555;
}

.stat-bar {
  height: 3px;
  background: var(--border);
  border-radius: 3px;
  margin-bottom: 12px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: #359381;
}

.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.chart-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 16px rgba(0, 51, 41, 0.07);
}

.chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.chart-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  letter-spacing: -0.01em;
}

.chart-subtitle {
  font-size: 12px;
  color: var(--text-body);
  margin-top: 2px;
}

/* Bar Graph */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 140px;
}

.bar-group {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}

.bar-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
}

.bar {
  width: 100%;
  border-radius: 6px 6px 0 0;
  background: #359381;
  opacity: 0.85;
  cursor: pointer;
  transform-origin: bottom;
  animation: growUp 0.8s ease forwards;
  transition:
    opacity 0.2s,
    transform 0.2s;
}

.bar:hover {
  opacity: 1;
  transform: scaleY(1.05);
}

@keyframes growUp {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

.bar-label {
  margin-top: 6px;
  font-size: 10px;
  color: var(--text-body);
  font-weight: 500;
}

/* Line Graph SVG */
.line-chart-wrap {
  width: 100%;
}
.line-chart-wrap svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

/* Bottom Row */
.bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Pie Chart Layout */
.pie-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  margin-top: 4px;
}

/* Chart - Made bigger */
.pie-svg {
  width: 200px;
  height: 200px;
  flex-shrink: 0;
}

/* Legend - Centered below the pie chart */
.pie-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 20px;
  width: 100%;
}

.pie-item {
  display: flex;
  align-items: center;
  gap: 8px 12px;
  min-width: 110px;
}

.pie-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.pie-item-label {
  font-size: 12.5px;
  color: #3d5450;
}

.pie-item-val {
  font-size: 12.5px;
  font-weight: 600;
  color: #0d1f1c;
}

/* Table Styles */ 
.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #e8eeec;
  background: white;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 650px;
}

th {
  font-size: 11px;
  font-weight: 600;
  color: #3d5450;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: left;
  padding: 16px 16px 12px;
  background: #f8fafa;
  border-bottom: 1px solid #e8eeec;
}

td {
  padding: 16px;
  font-size: 13px;
  color: #0d1f1c;
  border-bottom: 1px solid #e8eeec;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background-color: #f8fafa;
  cursor: pointer;
}

.post-title {
  font-weight: 500;
  color: #0d1f1c;
}

.author-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #3d5450;
}

.author-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #e8eeec;
  color: #359381;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

.date-cell {
  color: #3d5450;
  font-size: 12px;
}

/* Status Pills */
.published {
  color: #359381;
}

.draft {
  color: #666676;
}

.deleted {
  color: #d94040;
}

/* Table Footer */
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding: 0 4px;
}

.showing-info {
  font-size: 12px;
  color: #3d5450;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination-btn {
  min-width: 32px;
  height: 32px;
  border: 1px solid #e8eeec;
  background: white;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #3d5450;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pagination-btn:hover {
  border-color: #359381;
  color: #359381;
}

.pagination-btn.active {
  background: #359381;
  border-color: #359381;
  color: white;
}

.pagination-ellipsis {
  color: #3d5450;
  font-size: 12px;
  padding: 0 4px;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 150;
}

/* Responsive */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .charts-row,
  .bottom-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    z-index: 200;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .overlay.open {
    display: block;
  }

  .hamburger {
    display: flex;
  }

  .content {
    padding: 18px;
  }

  .charts-row,
  .bottom-row {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stat-value {
    font-size: 26px;
  }

  .layout {
    height: auto;
    min-height: 100vh;
  }

  .main {
    width: 100%;
    overflow: visible;
  }

  .content {
    overflow-y: visible;
  }

  table {
    min-width: 500px;
  }

  .pie-svg {
    width: 160px;
    height: 160px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .header {
    padding: 0 16px;
  }
  .content {
    padding: 14px;
  }

  .chart-card {
    padding: 16px;
  }

  .bar-chart {
    gap: 6px;
  }

  .bar-label {
    font-size: 8px;
  }

  .pie-svg {
    width: 140px;
    height: 140px;
  }

  .pie-item {
    min-width: 90px;
  }

  .pie-item-label,
  .pie-item-val {
    font-size: 11px;
  }

  table {
    min-width: 420px;
  }

  th, td {
    padding: 10px 10px;
    font-size: 11px;
  }
}