/* ============================================
   Admin Panel — study desk control surface
   ============================================ */

.admin-desk {
  --admin-accent: #1a7a4c;
  --admin-surface: #f7f8f6;
}

.admin-desk .dash-brand a span {
  color: var(--admin-accent, #1a7a4c);
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-stats-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-stat {
  padding: 1.15rem 1.25rem;
  border-radius: 14px;
  background: linear-gradient(165deg, #fff 0%, #f3f6f3 100%);
  border: 1px solid rgba(20, 40, 30, 0.08);
  box-shadow: 0 8px 24px rgba(15, 30, 20, 0.04);
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.admin-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 30, 20, 0.08);
}

.admin-stat::after {
  content: "";
  position: absolute;
  top: -20%;
  right: -10%;
  width: 90px;
  height: 90px;
  background: radial-gradient(circle, rgba(26, 122, 76, 0.12), transparent 70%);
  pointer-events: none;
}

.admin-stat .label {
  color: #5a6b60;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 0.35rem;
}

.admin-stat .value {
  font-family: Syne, system-ui, sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  color: #14201a;
}

.admin-desk .panel {
  background: #fff;
  border: 1px solid rgba(20, 40, 30, 0.08);
  border-radius: 16px;
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 10px 30px rgba(15, 30, 20, 0.04);
}

.admin-desk .panel-title {
  font-family: Syne, system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: #14201a;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-desk .panel-title i {
  color: var(--admin-accent, #1a7a4c);
}

.panel-lead {
  color: #5a6b60;
  font-size: 0.92rem;
  margin: -0.35rem 0 1rem;
}

.data-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(20, 40, 30, 0.06);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.data-table th,
.data-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(20, 40, 30, 0.06);
}

.data-table th {
  color: #1a7a4c;
  font-family: Syne, system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #f3f6f3;
}

.data-table tr:hover td {
  background: rgba(26, 122, 76, 0.04);
}

.data-table .actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(20, 40, 30, 0.12);
  background: #fff;
  color: #3d4f44;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.btn-icon:hover {
  border-color: #1a7a4c;
  color: #1a7a4c;
  background: #f0faf4;
}

.btn-icon.danger:hover {
  border-color: #c0392b;
  color: #c0392b;
  background: #fff5f4;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  height: 180px;
  padding: 1rem 0 1.75rem;
}

.chart-bar {
  flex: 1;
  background: linear-gradient(180deg, #2db87a, #1a7a4c);
  border-radius: 8px 8px 0 0;
  min-height: 8px;
  position: relative;
  transition: height 0.6s ease, filter 0.2s ease;
  opacity: 0.9;
}

.chart-bar:hover {
  opacity: 1;
  filter: brightness(1.08);
}

.chart-bar span {
  position: absolute;
  bottom: -1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: #5a6b60;
  white-space: nowrap;
}

.color-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  max-width: 360px;
}

.color-picker-row input[type="color"] {
  width: 48px;
  height: 36px;
  border: none;
  background: none;
  cursor: pointer;
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.health-item {
  padding: 1.25rem;
  text-align: center;
  border: 1px solid rgba(20, 40, 30, 0.08);
  border-radius: 14px;
  background: #f7faf8;
}

.health-item .status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  margin-bottom: 0.5rem;
  box-shadow: 0 0 8px currentColor;
}

.health-item.ok .status-dot { background: #1a7a4c; color: #1a7a4c; }
.health-item.warn .status-dot { background: #d4a017; color: #d4a017; }
.health-item.err .status-dot { background: #c0392b; color: #c0392b; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 15, 0.45);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: none;
  place-items: center;
  padding: 1rem;
}

.modal-overlay.show {
  display: grid;
}

.modal {
  width: min(520px, 100%);
  background: #fff;
  border: 1px solid rgba(20, 40, 30, 0.1);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: 0 24px 60px rgba(10, 20, 15, 0.18);
}

.modal h3 {
  margin-bottom: 1.25rem;
  font-family: Syne, system-ui, sans-serif;
  color: #14201a;
}

.modal-actions,
.form-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.modal-actions {
  justify-content: flex-end;
}

.search-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.search-bar input {
  flex: 1;
}

.admin-list-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(20, 40, 30, 0.06);
}

.admin-list-item:last-child {
  border-bottom: none;
}

.admin-list-item.is-new {
  background: linear-gradient(90deg, rgba(26, 122, 76, 0.06), transparent);
  margin: 0 -0.5rem;
  padding-inline: 0.5rem;
  border-radius: 10px;
}

.admin-list-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.admin-excerpt {
  margin: 0.4rem 0 0;
  color: #5a6b60;
  font-size: 0.9rem;
  line-height: 1.45;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
  font-size: 0.92rem;
  color: #3d4f44;
}

.form-control-sm {
  min-width: 110px;
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
}

.admin-desk .badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.admin-desk .badge-gold {
  background: rgba(212, 160, 23, 0.15);
  color: #9a6b00;
}

.admin-desk .badge-info {
  background: rgba(26, 122, 76, 0.12);
  color: #1a7a4c;
}

.admin-desk .badge-success {
  background: rgba(26, 122, 76, 0.15);
  color: #14633e;
}

.admin-desk .badge-danger {
  background: rgba(192, 57, 43, 0.12);
  color: #a93226;
}

.admin-desk .btn-metallic {
  background: linear-gradient(135deg, #1a7a4c, #14633e);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 0.65rem 1.15rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(26, 122, 76, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-desk .btn-metallic:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(26, 122, 76, 0.3);
}

.admin-desk .btn-outline {
  background: transparent;
  border: 1px solid rgba(20, 40, 30, 0.18);
  border-radius: 12px;
  padding: 0.6rem 1rem;
  color: #3d4f44;
  font-weight: 600;
  cursor: pointer;
}

.admin-desk .btn-outline:hover {
  border-color: #1a7a4c;
  color: #1a7a4c;
}

.admin-desk .empty-state {
  padding: 1.5rem 0.5rem;
  text-align: center;
  color: #5a6b60;
}

.admin-desk .activity-item {
  display: flex;
  gap: 0.85rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(20, 40, 30, 0.05);
}

.admin-desk .activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #eef6f1;
  color: #1a7a4c;
  flex-shrink: 0;
}

.admin-desk .activity-meta {
  color: #7a8a80;
  font-size: 0.82rem;
}

@media (max-width: 1100px) {
  .admin-stats,
  .admin-stats-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .health-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .admin-stats,
  .admin-stats-4 {
    grid-template-columns: 1fr;
  }
  .admin-list-item {
    flex-direction: column;
  }
}
