/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f7;
  color: #1d1d1f;
  line-height: 1.5;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navbar */
.navbar {
  background: #fff;
  border-bottom: 1px solid #e5e5e7;
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 20px;
  font-weight: 600;
  color: #1d1d1f;
  text-decoration: none;
}

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

/* Main Content */
.main-content {
  padding: 32px 20px;
}

.page-header {
  margin-bottom: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-header h1 {
  font-size: 32px;
  font-weight: 600;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-primary {
  background: #0066cc;
  color: #fff;
}

.btn-primary:hover {
  background: #0055b3;
}

.btn-outline {
  background: transparent;
  border: 1px solid #d2d2d7;
  color: #1d1d1f;
}

.btn-outline:hover {
  background: #f5f5f7;
}

.btn-outline.active {
  background: #0066cc;
  border-color: #0066cc;
  color: #fff;
}

.btn-danger {
  background: #ff3b30;
  color: #fff;
}

/* Forms */
.form-card {
  background: #fff;
  border-radius: 12px;
  padding: 32px;
  max-width: 600px;
}

.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row .form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  border: 1px solid #d2d2d7;
  border-radius: 8px;
}

.form-group input:focus {
  outline: none;
  border-color: #0066cc;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* Alerts */
.alert {
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.alert-error {
  background: #fff2f2;
  color: #ff3b30;
  border: 1px solid #ffcdd2;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 20px;
}

.badge-success {
  background: #e8f5e9;
  color: #2e7d32;
}

.badge-gray {
  background: #f5f5f7;
  color: #86868b;
}

.badge-warning {
  background: #fff3e0;
  color: #e65100;
}

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

.badge-primary {
  background: #e3f2fd;
  color: #0066cc;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  border: 1px solid #e5e5e7;
}

.stat-value {
  font-size: 36px;
  font-weight: 600;
  color: #1d1d1f;
}

.stat-label {
  font-size: 13px;
  color: #86868b;
  margin-top: 4px;
}

/* Table */
.table-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e5e7;
  overflow: hidden;
}

.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid #e5e5e7;
}

.data-table th {
  background: #f5f5f7;
  font-weight: 500;
  font-size: 12px;
  color: #86868b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  font-size: 14px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 64px 32px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e5e7;
}

.empty-state h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

.empty-state p {
  color: #86868b;
  margin-bottom: 24px;
}

/* Info Card */
.info-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid #e5e5e7;
}

.info-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.details-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 20px;
  font-size: 14px;
}

.details-grid dt {
  color: #86868b;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: #fff;
  max-width: 400px;
  width: 90%;
  padding: 32px;
  border-radius: 16px;
  transform: scale(0.9);
  transition: transform 0.2s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

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

.modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.modal-icon.warning {
  background: #fff3e0;
  color: #ff9500;
}

.modal-icon.danger {
  background: #ffebee;
  color: #ff3b30;
}

.modal-icon.info {
  background: #e3f2fd;
  color: #0066cc;
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 8px;
}

.modal-text {
  font-size: 14px;
  color: #86868b;
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.modal-actions .btn {
  flex: 1;
  text-align: center;
  padding: 12px 20px;
}

.modal-content input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 16px;
}

/* Danger Zone */
.danger-zone {
  margin-top: 48px;
  padding: 24px;
  border: 1px solid #ffcdd2;
  border-radius: 12px;
  max-width: 500px;
}

.danger-zone h3 {
  color: #ff3b30;
  font-size: 14px;
  margin-bottom: 12px;
}

/* Back Link */
.back-link {
  color: #0066cc;
  text-decoration: none;
  font-size: 14px;
  display: inline-block;
  margin-bottom: 16px;
}

.back-link:hover {
  text-decoration: underline;
}

/* Profile */
.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.profile-header h1 {
  font-size: 28px;
  margin-bottom: 4px;
}

.profile-header .position {
  color: #86868b;
  font-size: 16px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.profile-section {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  border: 1px solid #e5e5e7;
}

.profile-section h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #86868b;
  margin-bottom: 16px;
}

.profile-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

.profile-item:last-child {
  border-bottom: none;
}

.profile-item-label {
  color: #86868b;
  font-size: 14px;
}

.profile-item-value {
  font-weight: 500;
  font-size: 14px;
}

/* Audit Log / History */
.history-list {
  max-height: 400px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}

.history-item:last-child {
  border-bottom: none;
}

.history-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f5f5f7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.history-content {
  flex: 1;
}

.history-action {
  font-weight: 500;
  margin-bottom: 2px;
}

.history-meta {
  font-size: 12px;
  color: #86868b;
}

.history-changes {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
}

/* Grade Progress */
.grade-progress-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
  border: 1px solid #e5e5e7;
}

.grade-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.grade-progress-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.grade-progress-subtitle {
  font-size: 14px;
  color: #86868b;
}

.grade-progress-actions {
  display: flex;
  gap: 8px;
}

.grade-requirements {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.grade-req-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: #f9f9f9;
  border-radius: 8px;
}

.grade-req-item.met {
  background: #e8f5e9;
}

.grade-req-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e5e5e7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.grade-req-item.met .grade-req-icon {
  background: #34c759;
  color: #fff;
}

.grade-req-title {
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 2px;
}

.grade-req-value {
  font-size: 13px;
  color: #86868b;
}

.grade-req-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.grade-skill-badge {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  background: #f0f0f0;
}

.grade-skill-badge.met {
  background: #e8f5e9;
  color: #2e7d32;
}

.grade-skill-badge.not-met {
  background: #fff3e0;
  color: #e65100;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.skill-item {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 12px 16px;
}

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

.skill-name {
  font-weight: 500;
  font-size: 14px;
}

.skill-level-label {
  font-size: 12px;
  color: #86868b;
}

.skill-bars {
  display: flex;
  gap: 4px;
}

.skill-bar {
  flex: 1;
  height: 24px;
  background: #e5e5e7;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.skill-bar:hover {
  background: #d2d2d7;
}

.skill-bar.filled {
  background: #0066cc;
}

.skill-bar.filled:hover {
  background: #0055b3;
}

/* Badge count (notification badge) */
.btn-with-badge {
  position: relative;
}

.badge-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ff3b30;
  color: white;
  font-size: 10px;
  font-weight: 600;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Responsive */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-right {
    flex-wrap: wrap;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .profile-header {
    flex-direction: column;
    gap: 16px;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }
}
