/* assets/css/dashboard.css -------------------------------------------------
   Extra styling for the admin / student / coach dashboard pages.
   Consistent with the ChessKidoo Amber/Cream theme.
   --------------------------------------------------------------- */

/* Prevent horizontal scrolling */
html, body {
  overflow-x: hidden;
}

.dashboard-layout {
  display: flex;
  min-height: 100vh;
  background: var(--cream);
  width: 100%;
  max-width: 100%;
}

/* ---- Sidebar ------------------------------------------------------- */
.sidebar {
  width: 280px;
  background: var(--bg-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 32px 20px;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
  padding: 0 10px;
}

.sidebar-brand .logo-icon {
  width: 32px;
  height: 32px;
  background: var(--amber);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
}

.sidebar-brand span {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: 1px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-nav a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  padding: 14px 16px;
  border-radius: 12px;
  transition: all 0.3s ease;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-nav a:hover {
  background: rgba(217, 119, 6, 0.15);
  color: var(--amber-light);
}

.sidebar-nav a.active {
  background: var(--amber);
  color: #fff;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

/* ---- Main content ------------------------------------------------- */
.dashboard-main {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.dashboard-header h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  color: var(--ink);
}

.user-meta {
  font-weight: 600;
  color: var(--amber);
  background: var(--amber-pale);
  padding: 8px 16px;
  border-radius: 99px;
}

/* ---- Stats Grid --------------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.stat-card {
  background: #fff;
  padding: 30px;
  border-radius: 24px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.stat-card h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ink);
  opacity: 0.5;
  margin-bottom: 10px;
}

.stat-card p {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--amber);
  line-height: 1;
}

/* ---- Cards & Sections -------------------------------------------- */
.card {
  background: #fff;
  padding: 32px;
  border-radius: 24px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.card h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 900;
  margin-bottom: 20px;
  color: var(--ink);
}

/* ---- Tables -------------------------------------------------------- */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.table th {
  text-align: left;
  padding: 12px 20px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink);
  opacity: 0.5;
}

.table td {
  padding: 20px;
  background: var(--cream-dark);
  color: var(--ink);
  font-weight: 500;
}

.table tr td:first-child {
  border-radius: 12px 0 0 12px;
}

.table tr td:last-child {
  border-radius: 0 12px 12px 0;
}

/* ---- Chart -------------------------------------------------------- */
.chart-section {
  min-height: 400px;
}

/* ---- Responsive -------------------------------------------------- */
@media (max-width: 1024px) {
  .dashboard-layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    padding: 16px 20px;
    overflow-x: auto;
  }
  .sidebar-brand {
    margin-bottom: 0;
    margin-right: 20px;
    flex-shrink: 0;
  }
  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 4px;
  }
  .sidebar-nav a {
    white-space: nowrap;
    padding: 12px 16px;
    font-size: 0.9rem;
  }
  .dashboard-main {
    padding: 24px;
  }
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  .dashboard-header h2 {
    font-size: 1.75rem;
  }
  .sidebar {
    padding: 12px 16px;
  }
  .dashboard-main {
    padding: 16px;
  }
  .card {
    padding: 20px;
    border-radius: 12px;
  }
  .table {
    font-size: 0.85rem;
  }
  .table th, .table td {
    padding: 10px 12px;
  }
  .stat-card {
    padding: 20px;
  }
  .stat-card p {
    font-size: 1.8rem;
  }
}

@media (max-width: 480px) {
  .sidebar {
    padding: 10px 12px;
  }
  .sidebar-brand {
    margin-right: 10px;
  }
  .sidebar-brand span {
    font-size: 1rem;
  }
  .sidebar-nav a {
    padding: 10px 12px;
    font-size: 0.85rem;
    gap: 8px;
  }
  .dashboard-main {
    padding: 12px;
  }
  .card {
    padding: 16px;
    border-radius: 12px;
  }
  .dashboard-header h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 360px) {
  .sidebar-nav {
    gap: 2px;
  }
  .sidebar-nav a {
    padding: 8px 10px;
    font-size: 0.8rem;
    gap: 6px;
  }
  .dashboard-main {
    padding: 10px;
  }
  .stat-card p {
    font-size: 1.6rem;
  }
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
}

@media (max-width: 480px) {
  .sidebar {
    padding: 12px 16px;
  }
  .sidebar-brand {
    margin-right: 12px;
  }
  .sidebar-nav a {
    padding: 12px 14px;
    font-size: 0.9rem;
  }
  .dashboard-main {
    padding: 16px;
  }
  .card {
    padding: 24px;
    border-radius: 16px;
  }
  .table {
    font-size: 0.85rem;
  }
  .table th, .table td {
    padding: 10px 12px;
  }
  .stat-card {
    padding: 24px;
  }
  .stat-card p {
    font-size: 2rem;
  }
}

@media (max-width: 360px) {
  .sidebar-nav {
    gap: 4px;
  }
  .sidebar-nav a {
    padding: 10px 12px;
    font-size: 0.85rem;
    gap: 8px;
  }
}