/* ============================================
   KALIXRP — PANEL STYLES
   ============================================ */

/* ── Panel Layout ──────────────────────────── */
.panel-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-base);
}

/* ── Sidebar ───────────────────────────────── */
.sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--bg-void);
  border-right: 1px solid var(--bg-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition-base);
}

.sidebar-header {
  padding: var(--space-6) var(--space-5);
  border-bottom: 1px solid var(--bg-border);
}

.sidebar-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.sidebar-logo .kalix { color: var(--red-primary); }
.sidebar-logo .rp    { color: var(--white); }

.sidebar-logo .panel-tag {
  font-size: 0.65rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: var(--space-2);
  font-family: var(--font-body);
}

/* ── User Profile in Sidebar ───────────────── */
.sidebar-user {
  padding: var(--space-5);
  border-bottom: 1px solid var(--bg-border);
}

.user-avatar-container {
  position: relative;
  display: inline-block;
  margin-bottom: var(--space-3);
}

.user-avatar {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 2px solid rgba(232, 55, 46, 0.3);
}

.user-avatar-placeholder {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--red-dark), var(--bg-elevated));
  border: 2px solid rgba(232, 55, 46, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--white);
}

.user-online-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  background: var(--success);
  border-radius: 50%;
  border: 2px solid var(--bg-void);
}

.sidebar-user .user-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.sidebar-user .user-rank {
  font-size: 0.75rem;
  color: var(--red-primary);
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ── Sidebar Nav ───────────────────────────── */
.sidebar-nav {
  flex: 1;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-group-label {
  font-size: 0.65rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  padding: var(--space-3) var(--space-2) var(--space-1);
  margin-top: var(--space-3);
}

.nav-group-label:first-child {
  margin-top: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  border: 1px solid transparent;
}

.sidebar-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.sidebar-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--bg-border);
}

.sidebar-link:hover svg { opacity: 1; }

.sidebar-link.active {
  background: rgba(232, 55, 46, 0.1);
  color: var(--red-vivid);
  border-color: rgba(232, 55, 46, 0.2);
}

.sidebar-link.active svg { opacity: 1; }

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--red-primary);
  border-radius: var(--radius-full);
}

.sidebar-link .badge-count {
  margin-left: auto;
  background: var(--red-primary);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
}

/* ── Sidebar Footer ────────────────────────── */
.sidebar-footer {
  padding: var(--space-5);
  border-top: 1px solid var(--bg-border);
}

/* ── Panel Main ────────────────────────────── */
.panel-main {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.panel-topbar {
  height: 64px;
  background: rgba(13, 13, 13, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--bg-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.topbar-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.topbar-icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.12);
}

.topbar-icon-btn .notification-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background: var(--red-primary);
  border-radius: 50%;
  border: 2px solid var(--bg-elevated);
}

.panel-content {
  flex: 1;
  padding: var(--space-7) var(--space-6);
}

/* ── Stats Grid ────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--red-primary), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.stat-card:hover {
  border-color: rgba(232, 55, 46, 0.25);
  box-shadow: var(--shadow-red-sm);
}

.stat-card:hover::after {
  opacity: 1;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(232, 55, 46, 0.1);
  border: 1px solid rgba(232, 55, 46, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  color: var(--red-primary);
}

.stat-icon svg {
  width: 20px;
  height: 20px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: var(--space-1);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-change {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: var(--space-2);
}

.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ── Panel Sections ────────────────────────── */
.panel-section {
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-5);
}

.panel-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--bg-border);
}

.panel-section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.panel-section-title svg {
  width: 18px;
  height: 18px;
  color: var(--red-primary);
}

.panel-section-body {
  padding: var(--space-5) var(--space-6);
}

/* ── Table ─────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--bg-border);
}

.data-table td {
  padding: var(--space-4);
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  vertical-align: middle;
}

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

.data-table tr:hover td {
  background: var(--bg-hover);
}

/* ── Activity Timeline ─────────────────────── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--bg-border);
}

.timeline-item {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  position: relative;
}

.timeline-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--bg-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.timeline-dot.red {
  background: rgba(232, 55, 46, 0.15);
  border-color: rgba(232, 55, 46, 0.4);
  color: var(--red-primary);
}

.timeline-dot.green {
  background: rgba(46, 204, 113, 0.15);
  border-color: rgba(46, 204, 113, 0.4);
  color: var(--success);
}

.timeline-dot.orange {
  background: rgba(243, 156, 18, 0.15);
  border-color: rgba(243, 156, 18, 0.4);
  color: var(--warning);
}

.timeline-dot svg {
  width: 14px;
  height: 14px;
}

.timeline-content {
  flex: 1;
  padding-top: 6px;
}

.timeline-content .action {
  font-size: 0.88rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.timeline-content .time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Inventory Grid ────────────────────────── */
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: var(--space-3);
}

.inv-slot {
  aspect-ratio: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: var(--space-2);
  position: relative;
}

.inv-slot:hover {
  border-color: rgba(232, 55, 46, 0.4);
  background: rgba(232, 55, 46, 0.05);
}

.inv-slot .item-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.inv-slot .item-name {
  font-size: 0.62rem;
  color: var(--text-secondary);
  text-align: center;
  font-weight: 500;
  line-height: 1.2;
}

.inv-slot .item-count {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--red-primary);
  color: var(--white);
  font-size: 0.6rem;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inv-slot.empty {
  opacity: 0.2;
  cursor: default;
}

.inv-slot.empty:hover {
  border-color: var(--bg-border);
  background: var(--bg-elevated);
}

/* ── Panel Two-Col ─────────────────────────── */
.panel-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

/* ── Sanction Item ─────────────────────────── */
.sanction-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--bg-border);
  margin-bottom: var(--space-3);
  transition: border-color var(--transition-fast);
}

.sanction-item:hover {
  border-color: rgba(255,255,255,0.1);
}

.sanction-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.sanction-icon.ban   { background: rgba(231, 76, 60, 0.15); }
.sanction-icon.warn  { background: rgba(243, 156, 18, 0.15); }
.sanction-icon.mute  { background: rgba(52, 152, 219, 0.15); }

.sanction-info {
  flex: 1;
}

.sanction-reason {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.sanction-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Settings Form ─────────────────────────── */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
}

.form-input {
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-md);
  padding: 10px var(--space-4);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.form-input:focus {
  border-color: var(--red-primary);
  box-shadow: 0 0 0 3px rgba(232, 55, 46, 0.1);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-md);
}

.toggle-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-info .label {
  font-size: 0.88rem;
  font-weight: 600;
}

.toggle-info .desc {
  font-size: 0.77rem;
  color: var(--text-muted);
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition-base);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: var(--white);
  border-radius: 50%;
  transition: transform var(--transition-spring);
}

.toggle input:checked + .toggle-slider {
  background: var(--red-primary);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ── Panel Mobile ──────────────────────────── */
.sidebar-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 99;
}

@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .panel-two-col { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

  .sidebar-mobile-overlay {
    display: block;
  }

  .panel-main {
    margin-left: 0;
  }

  .stats-grid { grid-template-columns: 1fr 1fr; }

  .panel-content {
    padding: var(--space-5) var(--space-4);
  }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .panel-content { padding: var(--space-4) var(--space-3); }
}
