/* ============================================================
   AULA VIRTUAL PRO — Global Stylesheet
   ============================================================ */

:root {
  --primary:        #4361ee;
  --primary-dark:   #3451d1;
  --primary-light:  #eef0fc;
  --secondary:      #7209b7;
  --success:        #00b09b;
  --warning:        #f6a828;
  --danger:         #e83a5d;
  --info:           #4cc9f0;

  --sidebar-bg:     #1e2139;
  --sidebar-hover:  #2d3154;
  --sidebar-active: #4361ee;
  --sidebar-text:   #a8adb7;
  --sidebar-width:  260px;

  --body-bg:        #f0f2f8;
  --card-bg:        #ffffff;
  --border-color:   #e9ecef;

  --font-main:      'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --shadow-sm:      0 2px 8px rgba(0,0,0,.06);
  --shadow-md:      0 4px 20px rgba(0,0,0,.10);
  --shadow-lg:      0 8px 40px rgba(0,0,0,.14);
  --radius:         12px;
  --radius-sm:      8px;
  --transition:     all .25s ease;
}

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

body {
  font-family: var(--font-main);
  background: var(--body-bg);
  color: #2d3154;
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c1c8d4; border-radius: 3px; }

/* ── LAYOUT ── */
.app-wrapper { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1000;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.sidebar-logo .logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: white; font-weight: 700;
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
}

.sidebar-logo .logo-sub {
  color: var(--sidebar-text);
  font-size: 11px;
  font-weight: 400;
}

.sidebar-user {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user .user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4361ee, #7209b7);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 13px;
  flex-shrink: 0; overflow: hidden;
}

.sidebar-user .user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-user .user-name { color: #fff; font-size: 13px; font-weight: 600; }
.sidebar-user .user-role { color: var(--sidebar-text); font-size: 11px; }

.sidebar-nav { padding: 12px 0; flex: 1; }

.nav-section-title {
  padding: 12px 20px 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(168,173,183,.5);
}

.sidebar-nav .nav-item { margin: 1px 10px; }

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.sidebar-nav .nav-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.sidebar-nav .nav-link.active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
}

.sidebar-nav .nav-link .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar-nav .nav-link .badge-count {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 700;
}

.sidebar-bottom {
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,.06);
}

/* ── MAIN CONTENT ── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── TOPBAR ── */
.topbar {
  background: var(--card-bg);
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: #1e2139;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--body-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #6b7280;
  transition: var(--transition);
  position: relative;
  text-decoration: none;
}

.topbar-btn:hover { background: var(--primary-light); color: var(--primary); }

.topbar-btn .badge-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid white;
}

.page-content { padding: 28px; flex: 1; }

/* ── CARDS ── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-header .card-title {
  font-size: 15px;
  font-weight: 700;
  color: #1e2139;
  margin: 0;
}

.card-body { padding: 22px; }

/* ── STAT CARDS ── */
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

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

.stat-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.blue   { background: rgba(67,97,238,.12);  color: var(--primary); }
.stat-icon.purple { background: rgba(114,9,183,.12);  color: var(--secondary); }
.stat-icon.green  { background: rgba(0,176,155,.12);  color: var(--success); }
.stat-icon.orange { background: rgba(246,168,40,.12); color: var(--warning); }
.stat-icon.red    { background: rgba(232,58,93,.12);  color: var(--danger); }
.stat-icon.cyan   { background: rgba(76,201,240,.12); color: var(--info); }

.stat-label { font-size: 12px; color: #9ca3af; font-weight: 500; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-size: 26px; font-weight: 800; color: #1e2139; line-height: 1; }
.stat-change { font-size: 12px; margin-top: 4px; }
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ── PAGE HEADER ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h1 {
  font-size: 22px;
  font-weight: 800;
  color: #1e2139;
  margin: 0;
}

.page-header .breadcrumb {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 2px;
}

/* ── TABLES ── */
.table-custom {
  width: 100%;
  border-collapse: collapse;
}

.table-custom thead tr {
  background: #f8f9fc;
}

.table-custom thead th {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: #6b7280;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.table-custom tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13.5px;
  color: #374151;
  vertical-align: middle;
}

.table-custom tbody tr:hover { background: #fafbff; }
.table-custom tbody tr:last-child td { border-bottom: none; }

/* ── BADGES ── */
.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  display: inline-block;
}

.badge-primary { background: rgba(67,97,238,.12); color: var(--primary); }
.badge-success { background: rgba(0,176,155,.12); color: var(--success); }
.badge-warning { background: rgba(246,168,40,.15); color: #d4820a; }
.badge-danger  { background: rgba(232,58,93,.12);  color: var(--danger); }
.badge-info    { background: rgba(76,201,240,.12); color: #0ea5e9; }
.badge-secondary { background: #f3f4f6; color: #6b7280; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary    { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); color: white; }
.btn-secondary  { background: #f3f4f6; color: #374151; }
.btn-secondary:hover { background: #e5e7eb; }
.btn-success    { background: var(--success); color: white; }
.btn-danger     { background: var(--danger); color: white; }
.btn-warning    { background: var(--warning); color: white; }
.btn-outline    { background: transparent; border: 1.5px solid var(--border-color); color: #374151; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm         { padding: 6px 12px; font-size: 12px; }
.btn-icon       { padding: 7px; }

/* ── FORMS ── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.form-label span.required { color: var(--danger); }

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  font-size: 13.5px;
  color: #374151;
  background: white;
  transition: var(--transition);
  font-family: var(--font-main);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67,97,238,.1);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%236b7280' d='M8 10L4 6h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 36px;
}

.form-control.is-invalid { border-color: var(--danger); }
.invalid-feedback { color: var(--danger); font-size: 12px; margin-top: 4px; }

/* ── ALERTS ── */
.alert {
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid transparent;
}

.alert-success { background: rgba(0,176,155,.08); border-color: rgba(0,176,155,.2); color: #047a6a; }
.alert-danger  { background: rgba(232,58,93,.08);  border-color: rgba(232,58,93,.2);  color: #c72048; }
.alert-warning { background: rgba(246,168,40,.10); border-color: rgba(246,168,40,.25); color: #b57209; }
.alert-info    { background: rgba(67,97,238,.08);  border-color: rgba(67,97,238,.2);  color: var(--primary); }

/* ── AVATAR ── */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 13px;
  flex-shrink: 0; overflow: hidden;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.avatar.xl { width: 80px; height: 80px; font-size: 28px; }

/* ── COURSE CARD ── */
.course-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

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

.course-card .course-header {
  padding: 22px 20px 16px;
  position: relative;
}

.course-card .course-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: white; margin-bottom: 12px;
}

.course-card .course-name { font-weight: 700; font-size: 15px; color: #1e2139; line-height: 1.3; }
.course-card .course-meta { font-size: 12px; color: #9ca3af; margin-top: 4px; }
.course-card .course-footer { padding: 12px 20px; border-top: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; }

/* ── MODALS ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(30,33,57,.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}

.modal-overlay.show { opacity: 1; pointer-events: all; }

.modal-box {
  background: white;
  border-radius: 16px;
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(.95);
  transition: transform .25s;
}

.modal-overlay.show .modal-box { transform: scale(1); }

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: space-between;
}

.modal-header h4 { font-size: 17px; font-weight: 700; color: #1e2139; margin: 0; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #9ca3af; line-height: 1; }
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border-color); display: flex; gap: 10px; justify-content: flex-end; }

/* ── PAGINATION ── */
.pagination { display: flex; gap: 4px; list-style: none; }
.pagination .page-item .page-link {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px;
  font-size: 13px; font-weight: 600; text-decoration: none; color: #6b7280;
  background: white; border: 1px solid var(--border-color);
  transition: var(--transition);
}

.pagination .page-item .page-link:hover { border-color: var(--primary); color: var(--primary); }
.pagination .page-item.active .page-link { background: var(--primary); border-color: var(--primary); color: white; }

/* ── GRADE INDICATORS ── */
.grade-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; padding: 4px 10px;
  border-radius: 20px; font-weight: 700; font-size: 13px;
}

.grade-approved { background: rgba(0,176,155,.12); color: var(--success); }
.grade-failed   { background: rgba(232,58,93,.12);  color: var(--danger); }
.grade-pending  { background: #f3f4f6; color: #9ca3af; }

/* ── PROGRESS BAR ── */
.progress-bar-custom {
  background: var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  height: 8px;
}

.progress-bar-custom .fill {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--primary) 0%, #7209b7 100%);
  transition: width .6s ease;
}

/* ── NOTIFICATION ITEM ── */
.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.notif-item:last-child { border-bottom: none; }
.notif-item .notif-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.notif-item .notif-text { font-size: 13px; color: #374151; }
.notif-item .notif-time { font-size: 11px; color: #9ca3af; margin-top: 2px; }
.notif-item.unread .notif-text { font-weight: 600; }

/* ── TIMELINE ── */
.timeline { position: relative; }
.timeline-item { display: flex; gap: 14px; padding-bottom: 20px; position: relative; }
.timeline-item::before { content: ''; position: absolute; left: 14px; top: 30px; bottom: 0; width: 2px; background: var(--border-color); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; z-index: 1; }
.timeline-content { flex: 1; }
.timeline-title { font-size: 13.5px; font-weight: 600; color: #1e2139; }
.timeline-sub { font-size: 12px; color: #9ca3af; }

/* ── LOGIN PAGE ── */
.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, #1e2139 0%, #2d3154 40%, #1a1c3a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.login-wrapper::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(67,97,238,.2) 0%, transparent 70%);
  top: -200px; right: -200px;
  border-radius: 50%;
}

.login-wrapper::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(114,9,183,.15) 0%, transparent 70%);
  bottom: -100px; left: -100px;
  border-radius: 50%;
}

.login-card {
  background: white;
  border-radius: 20px;
  padding: 44px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 25px 80px rgba(0,0,0,.3);
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .logo-circle {
  width: 70px; height: 70px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 30px; color: white; font-weight: 800;
  margin-bottom: 12px;
  box-shadow: 0 10px 30px rgba(67,97,238,.4);
}

.login-logo h2 { font-size: 22px; font-weight: 800; color: #1e2139; }
.login-logo p { color: #9ca3af; font-size: 13.5px; }

.login-tabs {
  display: flex;
  background: var(--body-bg);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 24px;
  gap: 4px;
}

.login-tab {
  flex: 1; text-align: center;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  color: #6b7280;
  border: none; background: transparent;
}

.login-tab.active { background: white; color: var(--primary); box-shadow: var(--shadow-sm); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .page-content { padding: 16px; }
  .stat-card { padding: 16px; }
  .stat-value { font-size: 22px; }
}

/* ── UTILITIES ── */
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.text-muted { color: #9ca3af; }
.text-small { font-size: 12px; }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-primary { color: var(--primary); }
.text-warning { color: var(--warning); }
.fw-bold { font-weight: 700; }
.w-100 { width: 100%; }

/* ── FADE IN ANIMATION ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-in { animation: fadeInUp .4s ease both; }
.delay-1 { animation-delay: .05s; }
.delay-2 { animation-delay: .10s; }
.delay-3 { animation-delay: .15s; }
.delay-4 { animation-delay: .20s; }
