/* ============================================
   SING & LEARN - ADMIN PORTAL
   ============================================ */

/* ============================================
   LAYOUT GERAL
   ============================================ */
.portal-admin {
  display: flex;
  min-height: 100vh;
  background: var(--bg-light);
  font-family: var(--font-admin);
}

/* ============================================
   SIDEBAR
   ============================================ */
.admin-sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--navy);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1000;
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.admin-sidebar .sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-sidebar .sidebar-brand img {
  height: 32px;
}

.admin-sidebar .sidebar-brand span {
  font-weight: 700;
  font-size: 18px;
  font-family: var(--font-kids);
}

.admin-sidebar .sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.admin-sidebar .sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  transition: all 0.25s ease;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.admin-sidebar .sidebar-nav .nav-item i {
  width: 20px;
  font-size: 16px;
  text-align: center;
}

.admin-sidebar .sidebar-nav .nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: white;
}

.admin-sidebar .sidebar-nav .nav-item.active {
  background: var(--blue-electric);
  color: white;
  box-shadow: 0 4px 15px rgba(7, 87, 245, 0.3);
}

.admin-sidebar .sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-sidebar .sidebar-footer .user-info {
  display: flex;
  flex-direction: column;
}

.admin-sidebar .sidebar-footer .user-name {
  font-weight: 600;
  font-size: 14px;
}

.admin-sidebar .sidebar-footer .user-role {
  font-size: 12px;
  opacity: 0.6;
}

.admin-sidebar .sidebar-footer .btn-logout {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.25s ease;
}

.admin-sidebar .sidebar-footer .btn-logout:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

/* ============================================
   CONTEÚDO PRINCIPAL
   ============================================ */
.admin-content {
  flex: 1;
  margin-left: 260px;
  padding: 24px 32px;
  min-height: 100vh;
  overflow-y: auto;
}

/* ============================================
   HEADER ADMIN
   ============================================ */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.admin-header .header-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ============================================
   CARDS ADMIN
   ============================================ */
.stat-card-admin {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.stat-card-admin .stat-number {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  display: block;
  line-height: 1.2;
}

.stat-card-admin .stat-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.stat-card-admin .stat-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  flex-shrink: 0;
}

/* ============================================
   KPI CARDS (Diretor)
   ============================================ */
.kpi-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 16px;
}

.kpi-card .kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  flex-shrink: 0;
}

.kpi-card .kpi-content {
  flex: 1;
}

.kpi-card .kpi-content .kpi-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  display: block;
  line-height: 1.2;
}

.kpi-card .kpi-content .kpi-label {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ============================================
   TABELAS ADMIN
   ============================================ */
.table-admin {
  width: 100%;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.table-admin thead {
  background: var(--bg-light);
}

.table-admin thead th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.table-admin tbody td {
  padding: 12px 16px;
  border-top: 1px solid #f0f0f0;
  vertical-align: middle;
}

.table-admin .student-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-admin .student-info .student-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.table-admin .student-info .student-name {
  font-weight: 600;
}

/* ============================================
   BADGES
   ============================================ */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-status.success {
  background: #e8f5e9;
  color: var(--green-success);
}

.badge-status.info {
  background: #e3f2fd;
  color: var(--blue-electric);
}

.badge-status.warning {
  background: #fff3e0;
  color: var(--orange-energy);
}

.badge-status.danger {
  background: #ffebee;
  color: #e53935;
}

.badge-status.primary {
  background: #e8eaf6;
  color: var(--purple);
}

/* ============================================
   BOTÕES ADMIN
   ============================================ */
.btn-primary-sm {
  padding: 8px 20px;
  font-size: 14px;
  background: var(--gradient-primary);
  border: none;
  border-radius: 50px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-admin);
}

.btn-primary-sm:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(7, 87, 245, 0.3);
}

.btn-primary-sm:active {
  transform: scale(0.97);
}

.btn-outline-sm {
  padding: 8px 20px;
  font-size: 14px;
  background: transparent;
  border: 2px solid var(--blue-electric);
  border-radius: 50px;
  color: var(--blue-electric);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-admin);
}

.btn-outline-sm:hover {
  background: var(--blue-electric);
  color: white;
}

.btn-icon {
  border: none;
  background: none;
  color: var(--text-secondary);
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: var(--bg-light);
  color: var(--blue-electric);
}

.btn-icon.danger:hover {
  color: #e53935;
}

/* ============================================
   CARDS DE CONTEÚDO
   ============================================ */
.content-card {
  border: 1px solid #e0e0e0;
  border-radius: var(--radius-md);
  padding: 16px;
  transition: all 0.3s ease;
  background: var(--bg-white);
}

.content-card:hover {
  box-shadow: var(--shadow-card);
  border-color: transparent;
}

.content-card .content-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  flex-shrink: 0;
}

.content-card .content-actions {
  display: flex;
  gap: 4px;
  margin-top: 12px;
}

/* ============================================
   FORMULÁRIOS ADMIN
   ============================================ */
.form-admin .form-control {
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  border: 2px solid #e0e0e0;
  font-size: 14px;
  transition: border-color 0.3s ease;
  font-family: var(--font-admin);
}

.form-admin .form-control:focus {
  border-color: var(--blue-electric);
  box-shadow: 0 0 0 3px rgba(7, 87, 245, 0.1);
}

.form-admin .form-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

/* Tablets */
@media (max-width: 1024px) {
  .admin-sidebar {
    width: 220px;
  }
  
  .admin-content {
    margin-left: 220px;
    padding: 20px 24px;
  }
  
  .stat-card-admin .stat-number {
    font-size: 24px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .portal-admin {
    flex-direction: column;
  }
  
  .admin-sidebar {
    position: fixed;
    bottom: 0;
    top: auto;
    left: 0;
    right: 0;
    width: 100%;
    min-height: auto;
    height: auto;
    flex-direction: row;
    padding: 8px 0 env(safe-area-inset-bottom);
    background: var(--bg-white);
    border-top: 1px solid rgba(0,0,0,0.05);
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    overflow-y: visible;
    transform: none;
  }
  
  .admin-sidebar .sidebar-brand {
    display: none;
  }
  
  .admin-sidebar .sidebar-nav {
    display: flex;
    flex: 1;
    padding: 0 8px;
    overflow-x: auto;
    gap: 4px;
    -webkit-overflow-scrolling: touch;
  }
  
  .admin-sidebar .sidebar-nav .nav-item {
    flex-direction: column;
    padding: 8px 12px;
    font-size: 11px;
    gap: 4px;
    min-width: 60px;
    white-space: nowrap;
  }
  
  .admin-sidebar .sidebar-nav .nav-item i {
    font-size: 18px;
    width: auto;
  }
  
  .admin-sidebar .sidebar-nav .nav-item span {
    font-size: 10px;
  }
  
  .admin-sidebar .sidebar-footer {
    display: none;
  }
  
  .admin-content {
    margin-left: 0;
    padding: 16px;
    padding-bottom: 80px;
  }
  
  .admin-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .admin-header h2 {
    font-size: 20px;
  }
  
  .admin-header .header-actions {
    flex-wrap: wrap;
  }
  
  .admin-header .header-actions button {
    flex: 1;
    min-width: 120px;
    justify-content: center;
    font-size: 13px;
    padding: 10px 16px;
  }
  
  .stat-card-admin .stat-number {
    font-size: 22px;
  }
  
  .table-admin {
    font-size: 13px;
  }
  
  .table-admin thead th,
  .table-admin tbody td {
    padding: 8px 12px;
  }
  
  .kpi-card .kpi-content .kpi-value {
    font-size: 20px;
  }
}

/* Mobile pequeno */
@media (max-width: 400px) {
  .admin-sidebar .sidebar-nav .nav-item {
    padding: 6px 8px;
    font-size: 10px;
    min-width: 50px;
  }
  
  .admin-sidebar .sidebar-nav .nav-item i {
    font-size: 16px;
  }
  
  .admin-content {
    padding: 12px;
    padding-bottom: 72px;
  }
  
  .admin-header h2 {
    font-size: 18px;
  }
  
  .stat-card-admin {
    padding: 12px 16px;
  }
  
  .stat-card-admin .stat-number {
    font-size: 18px;
  }
}

/* Tablet horizontal */
@media (min-width: 768px) and (orientation: landscape) {
  .admin-sidebar {
    width: 200px;
  }
  
  .admin-content {
    margin-left: 200px;
    padding: 20px 28px;
  }
  
  .admin-sidebar .sidebar-nav .nav-item {
    padding: 10px 14px;
    font-size: 13px;
  }
}