* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: #f0f4f8;
  color: #333;
}

/* AUTH PAGES */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a73e8, #0d47a1);
}

.auth-box {
  background: white;
  padding: 40px;
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.auth-box .logo {
  text-align: center;
  margin-bottom: 24px;
}

.auth-box .logo span {
  font-size: 48px;
}

.auth-box h2 {
  text-align: center;
  color: #1a73e8;
  margin-bottom: 8px;
  font-size: 24px;
}

.auth-box p.subtitle {
  text-align: center;
  color: #888;
  margin-bottom: 28px;
  font-size: 14px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}

.form-group input, .form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  transition: border 0.2s;
  outline: none;
}

.form-group input:focus, .form-group select:focus {
  border-color: #1a73e8;
}

.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 44px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #888;
  padding: 0;
}

.toggle-password:hover {
  color: #1a73e8;
}

.btn-primary {
  width: 100%;
  padding: 13px;
  background: #1a73e8;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 4px;
}

.btn-primary:hover {
  background: #1558b0;
}

.auth-link {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: #888;
}

.auth-link a {
  color: #1a73e8;
  text-decoration: none;
  font-weight: 600;
}

.role-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.role-tab {
  flex: 1;
  padding: 10px;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #888;
  transition: all 0.2s;
  text-align: center;
}

.role-tab.active {
  border-color: #1a73e8;
  color: #1a73e8;
  background: #e8f0fe;
}

/* NAVBAR */
.navbar {
  background: white;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: #1a73e8;
}

.navbar .nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #555;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1a73e8;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.btn-logout {
  padding: 7px 16px;
  background: #fee2e2;
  color: #dc2626;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.btn-logout:hover {
  background: #fecaca;
}

/* LAYOUT */
.layout {
  display: flex;
  min-height: calc(100vh - 60px);
}

.sidebar {
  width: 220px;
  background: white;
  padding: 20px 0;
  box-shadow: 2px 0 8px rgba(0,0,0,0.05);
  flex-shrink: 0;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  text-decoration: none;
  color: #555;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar a:hover, .sidebar a.active {
  background: #e8f0fe;
  color: #1a73e8;
  border-left-color: #1a73e8;
}

.sidebar a span.icon {
  font-size: 18px;
}

.main-content {
  flex: 1;
  padding: 28px;
  overflow-y: auto;
}

/* DASHBOARD */
.page-title {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 6px;
}

.page-subtitle {
  color: #888;
  font-size: 14px;
  margin-bottom: 28px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-icon.blue { background: #e8f0fe; }
.stat-icon.green { background: #e6f4ea; }
.stat-icon.orange { background: #fef3e2; }
.stat-icon.purple { background: #f3e8fd; }

.stat-info h3 {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a2e;
}

.stat-info p {
  font-size: 12px;
  color: #888;
}

/* CARDS */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a2e;
}

.btn-add {
  padding: 8px 16px;
  background: #1a73e8;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-add:hover {
  background: #1558b0;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-icon {
  font-size: 32px;
}

.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-blue { background: #e8f0fe; color: #1a73e8; }
.badge-green { background: #e6f4ea; color: #1e8e3e; }
.badge-orange { background: #fef3e2; color: #e37400; }
.badge-red { background: #fce8e6; color: #d93025; }

.card h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #1a1a2e;
}

.card p {
  font-size: 13px;
  color: #888;
  line-height: 1.5;
  margin-bottom: 14px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #aaa;
  border-top: 1px solid #f0f0f0;
  padding-top: 12px;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.btn-sm {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.btn-edit { background: #e8f0fe; color: #1a73e8; }
.btn-delete { background: #fce8e6; color: #d93025; }
.btn-view { background: #e6f4ea; color: #1e8e3e; }

/* TABLE */
.table-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden;
  margin-bottom: 28px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: #f8f9fa;
}

th {
  padding: 14px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  padding: 14px 16px;
  font-size: 14px;
  border-top: 1px solid #f0f0f0;
  color: #444;
}

tr:hover td {
  background: #fafafa;
}

/* MODAL */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: white;
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  color: #1a1a2e;
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.btn-cancel {
  padding: 10px 20px;
  background: #f0f0f0;
  color: #555;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.btn-save {
  padding: 10px 20px;
  background: #1a73e8;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

/* QUIZ */
.quiz-question {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.quiz-question h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #1a1a2e;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.quiz-option:hover {
  border-color: #1a73e8;
  background: #e8f0fe;
}

.quiz-option.selected {
  border-color: #1a73e8;
  background: #e8f0fe;
  color: #1a73e8;
  font-weight: 600;
}

.quiz-option.correct {
  border-color: #1e8e3e;
  background: #e6f4ea;
  color: #1e8e3e;
}

.quiz-option.wrong {
  border-color: #d93025;
  background: #fce8e6;
  color: #d93025;
}

.progress-bar {
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  margin-bottom: 24px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #1a73e8;
  border-radius: 4px;
  transition: width 0.3s;
}

/* MATERI */
.materi-content {
  background: white;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  line-height: 1.8;
  font-size: 15px;
  color: #444;
}

.materi-content h3 {
  color: #1a73e8;
  margin: 20px 0 10px;
  font-size: 17px;
}

.materi-content ul {
  padding-left: 20px;
  margin: 10px 0;
}

/* ALERT */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

.alert.show { display: block; }
.alert-error { background: #fce8e6; color: #d93025; border: 1px solid #f5c6c2; }
.alert-success { background: #e6f4ea; color: #1e8e3e; border: 1px solid #b7dfbf; }

/* SCORE RESULT */
.score-result {
  text-align: center;
  padding: 40px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a73e8, #0d47a1);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 700;
  margin: 0 auto 20px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .main-content { padding: 16px; }
}
