/* ========== RESET SEDERHANA ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: "Inter", "Poppins", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #f3f4f6;
  color: #111827;
}

/* ========== ROOT LAYOUT ========== */

.dashboard-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ========== TOP NAVBAR ========== */

.top-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.top-nav-left {
  display: flex;
  align-items: center;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Logo tanpa border/background */
.brand-logo {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-text h1 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #111827;
}

.brand-text p {
  font-size: 0.75rem;
  color: #6b7280;
}

/* Right side of navbar */

.top-nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.user-greeting {
  font-size: 0.9rem;
  color: #111827;
}

#userName {
  font-weight: 600;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Badges per role */
.role-badge-official {
  background-color: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}

.role-badge-admin {
  background-color: rgba(251, 146, 60, 0.16);
  color: #c05621;
}

.role-badge-super {
  background-color: rgba(16, 185, 129, 0.14);
  color: #047857;
}

.role-simulator {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.role-simulator label {
  font-size: 0.75rem;
  color: #6b7280;
}

.role-simulator select {
  padding: 0.35rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  background-color: #ffffff;
  font-size: 0.85rem;
  cursor: pointer;
}

/* Logout button */

.btn {
  border: none;
  outline: none;
  cursor: pointer;
  border-radius: 0.5rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  font-family: inherit;
}

.btn-logout {
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 500;
  background-color: #ef4444;
  color: #f9fafb;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.35);
}

.btn-logout:hover {
  background-color: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(239, 68, 68, 0.45);
}

.btn-logout:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

/* ========== MAIN LAYOUT ========== */

.dashboard-layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ========== SIDEBAR ========== */

.sidebar {
  width: 260px;
  background: radial-gradient(circle at top left, #0f172a 0, #020617 40%, #020617 100%);
  color: #e5e7eb;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #1f2937;
}

.sidebar-header {
  padding: 1rem 1.25rem 0.5rem;
  border-bottom: 1px solid rgba(31, 41, 55, 0.9);
}

.sidebar-title {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
}

.sidebar-menu {
  list-style: none;
  padding: 0.75rem 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

/* Label pemisah section (Umum / Khusus Role) */
.sidebar-section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #6b7280;
  padding: 0.8rem 0.3rem 0.3rem;
}

.sidebar-section-divider {
  height: 1px;
  margin: 0.4rem 0.3rem 0.5rem;
  background: linear-gradient(to right, transparent, rgba(75, 85, 99, 0.7), transparent);
}

.sidebar-menu-item {
  width: 100%;
}

.sidebar-menu-button {
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.9rem;
  border-radius: 0.7rem;
  border: none;
  background: transparent;
  color: #e5e7eb;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  transition: background-color 0.15s ease, transform 0.12s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.sidebar-menu-button-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.sidebar-menu-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  background: rgba(148, 163, 184, 0.14);
}

.sidebar-menu-label {
  flex: 1;
}

.sidebar-menu-chevron {
  font-size: 0.9rem;
  opacity: 0.45;
}

/* Hover & Active */
.sidebar-menu-button:hover {
  background: rgba(31, 41, 55, 0.95);
  transform: translateX(2px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.6);
}

.sidebar-menu-button.active {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #f9fafb;
  box-shadow: 0 10px 24px rgba(30, 64, 175, 0.65);
}

.sidebar-menu-button.active .sidebar-menu-icon {
  background: rgba(15, 23, 42, 0.25);
}

/* ========== MAIN CONTENT ========== */

.main-content {
  flex: 1;
  padding: 1.5rem 1.75rem 1.75rem;
  min-width: 0;
}

.content-section {
  background-color: #ffffff;
  border-radius: 1rem;
  padding: 1.5rem 1.5rem 1.75rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  border: 1px solid #e5e7eb;
}

.content-section-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.content-section h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #111827;
}

.content-section p {
  font-size: 0.9rem;
  color: #4b5563;
  max-width: 70ch;
}

.content-section-meta {
  margin-top: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.75rem;
  background-color: #f9fafb;
  border: 1px dashed #e5e7eb;
  font-size: 0.8rem;
  color: #6b7280;
}

.content-section-meta strong {
  font-weight: 600;
}

/* ========== KONTEN DASHBOARD (PER MENU) ========== */

.content-body {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Kartu ringkasan di beranda */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: linear-gradient(135deg, #ffffff, #f9fafb);
  border-radius: 0.9rem;
  padding: 0.9rem 1rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-card-label {
  font-size: 0.8rem;
  color: #6b7280;
}

.stat-card-value {
  font-size: 1.3rem;
  font-weight: 600;
  color: #111827;
}

.stat-card-tag {
  align-self: flex-start;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background-color: #eff6ff;
  color: #1d4ed8;
}

/* Toolbar di atas tabel (tombol + filter) */
.content-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.content-toolbar-left,
.content-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Extra button styles */
.btn-primary {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 500;
  background-color: #2563eb;
  color: #f9fafb;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.4);
  transition: background-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.btn-primary:hover {
  background-color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.55);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.3);
}

.btn-ghost {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 0.55rem;
  border: 1px solid #d1d5db;
  background-color: transparent;
  color: #374151;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-ghost:hover {
  background-color: #f3f4f6;
  border-color: #9ca3af;
}

/* Input kecil di toolbar (misal: search/filter) */
.toolbar-input {
  padding: 0.4rem 0.6rem;
  border-radius: 0.55rem;
  border: 1px solid #d1d5db;
  font-size: 0.8rem;
  min-width: 160px;
}

/* Tabel data */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 600px;
}

.data-table thead {
  background-color: #f3f4f6;
}

.data-table th,
.data-table td {
  padding: 0.55rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.data-table th {
  font-weight: 600;
  color: #374151;
  font-size: 0.8rem;
}

.data-table tbody tr:nth-child(even) {
  background-color: #f9fafb;
}

.data-table tbody tr:hover {
  background-color: #eef2ff;
}

/* Badge status di tabel */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}

.badge-success {
  background-color: #dcfce7;
  color: #15803d;
}

.badge-warning {
  background-color: #fef9c3;
  color: #92400e;
}

.badge-info {
  background-color: #e0f2fe;
  color: #0369a1;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 960px) {
  .top-nav {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .top-nav-left {
    width: 100%;
  }

  .top-nav-right {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .user-info {
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .dashboard-layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    order: 2;
  }

  .main-content {
    order: 1;
    padding: 1rem 1rem 1.5rem;
  }

  .content-section {
    padding: 1.25rem 1.1rem 1.25rem;
  }

  .brand-text h1 {
    font-size: 0.95rem;
  }

  .brand-text p {
    font-size: 0.7rem;
  }

  .role-simulator {
    flex: 1;
  }
}

@media (max-width: 480px) {
  .top-nav {
    padding-inline: 1rem;
  }

  .brand-mark {
    gap: 0.5rem;
  }

  .brand-logo {
    width: 32px;
    height: 32px;
  }

  .sidebar-menu-button {
    font-size: 0.85rem;
    padding-block: 0.5rem;
  }

  .user-greeting {
    font-size: 0.8rem;
  }
}

/* ===== FORM & KARTU KHUSUS MENU ATLET ===== */

.content-atlet-form {
  margin-top: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid #e5e7eb;
  background-color: #f9fafb;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem 1rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-field label {
  font-size: 0.8rem;
  color: #4b5563;
}

.form-field input,
.form-field select {
  padding: 0.4rem 0.6rem;
  border-radius: 0.55rem;
  border: 1px solid #d1d5db;
  font-size: 0.8rem;
}

.form-field-full {
  grid-column: 1 / -1;
}

.content-atlet-form .form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

/* Kartu link pendaftaran atlet */

.atlet-link-card {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 0.9rem;
  border: 1px dashed #d1d5db;
  background-color: #f9fafb;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.atlet-link-card-title {
  font-weight: 600;
  color: #111827;
}

.atlet-link-card-desc {
  color: #6b7280;
  font-size: 0.8rem;
}

.atlet-link-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.atlet-link-input {
  flex: 1;
  min-width: 220px;
  padding: 0.4rem 0.6rem;
  border-radius: 0.55rem;
  border: 1px solid #d1d5db;
  font-size: 0.8rem;
  background-color: #ffffff;
}

/* ===== EVENT SELECTOR CARD ===== */

.event-selector-card {
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: 0.9rem;
  border: 1px solid #d1d5db;
  background: linear-gradient(135deg, #ffffff, #f9fafb);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.event-selector-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.event-selector-dropdown {
  padding: 0.6rem 0.85rem;
  border-radius: 0.6rem;
  border: 1.5px solid #2563eb;
  background-color: #ffffff;
  font-size: 0.9rem;
  font-weight: 500;
  color: #111827;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.event-selector-dropdown:hover {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.event-selector-dropdown:focus {
  outline: none;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.event-selector-dropdown option {
  padding: 0.5rem;
  background-color: #ffffff;
  color: #111827;
}

.event-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e5e7eb;
}

.event-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.event-info-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.event-info-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: #111827;
}

/* ===== ATLET PENDAFTARAN LIST (CHECKBOX) ===== */

.atlet-pendaftaran-list {
  margin-top: 1rem;
  border-radius: 0.9rem;
  border: 1px solid #e5e7eb;
  background-color: #ffffff;
  overflow: hidden;
}

.atlet-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background-color: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
}

.atlet-list-header h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
}

.atlet-list-count {
  font-size: 0.8rem;
  color: #6b7280;
  background-color: #e5e7eb;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.atlet-list-items {
  display: flex;
  flex-direction: column;
  max-height: 500px;
  overflow-y: auto;
}

.atlet-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  transition: background-color 0.15s ease;
}

.atlet-item:last-child {
  border-bottom: none;
}

.atlet-item:hover {
  background-color: #f9fafb;
}

.atlet-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.atlet-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin-top: 0.15rem;
  border: 1.5px solid #d1d5db;
  border-radius: 0.4rem;
  background-color: #ffffff;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.atlet-checkbox:hover {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.atlet-checkbox:checked {
  background-color: #2563eb;
  border-color: #2563eb;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="white"><path d="M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z"/></svg>');
  background-size: 100%;
  background-position: center;
  background-repeat: no-repeat;
}

.atlet-checkbox:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.atlet-checkbox-label .checkbox-custom {
  display: none;
}

.atlet-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.atlet-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: #111827;
}

.atlet-meta {
  font-size: 0.8rem;
  color: #6b7280;
}

.empty-state {
  padding: 2rem 1rem;
  text-align: center;
  color: #6b7280;
  font-size: 0.9rem;
  background-color: #f9fafb;
  border-radius: 0.9rem;
  border: 1px dashed #e5e7eb;
}
