:root {
  --bg-darker: #090a0e;
  --bg-dark: #0d0e14;
  --bg-panel: #141620;
  --bg-card: #181922;
  --bg-hover: #1e2130;
  --bg-input: #111219;
  
  --emerald-primary: #26804a;
  --emerald-bright: #2ecc71;
  --emerald-hover: #216e3f;
  --emerald-glow: rgba(46, 204, 113, 0.25);
  --emerald-alpha: rgba(38, 128, 74, 0.15);

  --text-main: #e7edf8;
  --text-muted: #8b9bb8;
  --text-dim: #5c6b84;

  --border-color: rgba(255, 255, 255, 0.07);
  --border-glow: rgba(46, 204, 113, 0.3);

  --danger: #e74c3c;
  --danger-bg: rgba(231, 76, 60, 0.12);
  --warning: #f39c12;
  --warning-bg: rgba(243, 156, 18, 0.12);
  --info: #3498db;
  --info-bg: rgba(52, 152, 219, 0.12);
  --purple: #9b59b6;

  --font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-main: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 15px rgba(46, 204, 113, 0.2);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: #252838;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--emerald-primary);
}

/* Base Utility Classes */
.hidden {
  display: none !important;
}

.acp-app {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* LOGIN OVERLAY */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at center, #151824 0%, #08090d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-box {
  width: 100%;
  max-width: 440px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-main);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.login-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--emerald-primary), var(--emerald-bright), var(--emerald-primary));
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.login-logo {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, rgba(38,128,74,0.3), rgba(46,204,113,0.1));
  border: 1px solid var(--emerald-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: var(--shadow-glow);
}

.login-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.5px;
}

.login-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  text-align: left;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.form-input:focus {
  border-color: var(--emerald-bright);
  box-shadow: 0 0 0 3px var(--emerald-glow);
}

.btn-primary {
  width: 100%;
  padding: 0.9rem 1.5rem;
  background: linear-gradient(135deg, var(--emerald-primary), var(--emerald-hover));
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(38, 128, 74, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--emerald-hover), #17542c);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(38, 128, 74, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.login-footer {
  margin-top: 1.75rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.login-footer a {
  color: var(--emerald-bright);
  text-decoration: none;
  font-weight: 500;
}
.login-footer a:hover {
  text-decoration: underline;
}

/* LAYOUT SIDEBAR */
.sidebar {
  width: 260px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: var(--transition);
  z-index: 100;
}

.sidebar-brand {
  padding: 1.5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo-icon {
  width: 38px;
  height: 38px;
  background: var(--emerald-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #fff;
  font-weight: 800;
}

.sidebar-title-group {
  display: flex;
  flex-direction: column;
}

.sidebar-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.sidebar-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--emerald-bright);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-nav {
  padding: 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex-grow: 1;

  nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }
}

.nav-section-title {
  padding: 0.75rem 0.75rem 0.25rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
}

.nav-item i, .nav-item span.icon {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.nav-item.active {
  background: var(--emerald-alpha);
  color: var(--emerald-bright);
  border-left: 3px solid var(--emerald-bright);
  font-weight: 600;
}

.sidebar-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  background: var(--bg-dark);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.admin-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #2b3046;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--emerald-bright);
  border: 1px solid var(--emerald-primary);
}

.admin-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-name {
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-role {
  font-size: 0.75rem;
  color: var(--emerald-bright);
}

/* MAIN CONTENT AREA */
.main-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-dark);
}

.topbar {
  height: 70px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  position: sticky;
  top: 0;
  z-index: 90;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
}

.server-status-pill {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.4rem 0.9rem;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.pulse-dot {
  width: 9px;
  height: 9px;
  background-color: var(--emerald-bright);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
  animation: pulse-green 2s infinite;
}

.pulse-dot.offline {
  background-color: var(--danger);
  box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
  animation: pulse-red 2s infinite;
}

@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(46, 204, 113, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

@keyframes pulse-red {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(231, 76, 60, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-secondary {
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--text-dim);
}

.content-container {
  padding: 1.75rem;
  flex-grow: 1;
}

/* DASHBOARD CARDS & GRID */
.page-title-block {
  margin-bottom: 1.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
}

.page-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.metric-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
  box-shadow: var(--shadow-main);
}

.metric-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: var(--emerald-alpha);
  color: var(--emerald-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.metric-icon.red { background: var(--danger-bg); color: var(--danger); }
.metric-icon.orange { background: var(--warning-bg); color: var(--warning); }
.metric-icon.blue { background: var(--info-bg); color: var(--info); }

.metric-content {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.metric-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.metric-trend {
  font-size: 0.75rem;
  margin-top: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.metric-trend.up { color: var(--emerald-bright); }
.metric-trend.down { color: var(--danger); }

/* GRID PANELS */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.panel-box {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.panel-header-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* TABLES */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.acp-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.acp-table th {
  padding: 0.85rem 1rem;
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

.acp-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--text-main);
  vertical-align: middle;
}

.acp-table tbody tr {
  transition: var(--transition);
}

.acp-table tbody tr:hover {
  background: var(--bg-hover);
}

/* BADGES & PILLS */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success { background: var(--emerald-alpha); color: var(--emerald-bright); border: 1px solid rgba(46,204,113,0.3); }
.badge-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(231,76,60,0.3); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(243,156,18,0.3); }
.badge-info { background: var(--info-bg); color: var(--info); border: 1px solid rgba(52,152,219,0.3); }

.badge-staff {
  background: rgba(155, 89, 182, 0.2);
  color: var(--purple);
  border: 1px solid rgba(155, 89, 182, 0.4);
}

/* USER SEARCH & INSPECTOR MODULE */
.search-bar-container {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.search-input-wrapper {
  position: relative;
  flex-grow: 1;
}

.search-input-wrapper i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input-wrapper input {
  padding-left: 2.75rem;
}

.user-profile-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.user-header-info {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.user-skin-box {
  width: 70px;
  height: 70px;
  background: var(--bg-dark);
  border-radius: 50%;
  border: 2px solid var(--emerald-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.user-main-details {
  display: flex;
  flex-direction: column;
}

.user-name-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-sub-details {
  display: flex;
  gap: 1rem;
  margin-top: 0.3rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.user-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.stat-item {
  background: var(--bg-card);
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-val {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin-top: 0.2rem;
}

/* SANCTIONS TAB & MODALS */
.action-buttons-group {
  display: flex;
  gap: 0.5rem;
}

.btn-xs {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  border-radius: 4px;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}
.btn-danger:hover { background: #c0392b; }

.btn-warning {
  background: var(--warning);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}
.btn-warning:hover { background: #d35400; }

/* MODALS */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 9, 0.85);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-container {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-main);
  overflow: hidden;
  animation: modalIn 0.2s cubic-bezier(0,0,0.2,1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
}
.modal-close:hover { color: #fff; }

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* TOAST NOTIFICATIONS */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  min-width: 280px;
  max-width: 380px;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
  border-left: 4px solid var(--emerald-bright);
  color: #fff;
  box-shadow: var(--shadow-main);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: toastIn 0.3s ease;
}

.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* RESPONSIVE LAYOUT */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -260px;
  }

  .sidebar.active {
    left: 0;
    box-shadow: var(--shadow-main);
  }

  .mobile-toggle {
    display: block;
  }

  .topbar {
    padding: 0 1rem;
  }

  .content-container {
    padding: 1rem;
  }
}
