:root {
  --bg-start: #071529;
  --bg-mid: #102a4c;
  --bg-end: #1b4479;
  --primary: #122d52;
  --primary-hover: #1e467a;
  --accent: #0284c7;
  --gold: #d97706;
  --gold-light: #fef3c7;
  --success: #15803d;
  --success-bg: #dcfce7;
  --success-border: #86efac;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --danger-border: #fca5a5;
  --warning: #b45309;
  --warning-bg: #fef3c7;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;
  --border: #e2e8f0;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --shadow-lg: 0 24px 60px rgba(4, 12, 26, 0.38);
  --shadow-md: 0 10px 25px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.05);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: radial-gradient(circle at top right, #1e4b85 0%, var(--bg-mid) 45%, var(--bg-start) 100%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}

/* Header / Navbar */
.site-header {
  width: 100%;
  background: rgba(7, 21, 41, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 14px 24px;
}

.header-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: -0.01em;
}

.brand-link img {
  height: 38px;
  width: auto;
  object-fit: contain;
  background: #ffffff;
  padding: 4px 10px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

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

.site-nav a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
}

/* Main Content Layout */
.main-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 20px;
}

.main-wrapper.admin-layout {
  align-items: flex-start;
}

.card {
  background: var(--surface);
  width: 100%;
  max-width: 520px;
  padding: 40px 36px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.6);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 60%, #10b981 100%);
}

.card.card-wide {
  max-width: 720px;
  padding: 38px 40px;
}

.card.card-admin {
  max-width: 1160px;
  padding: 34px;
}

.card-header {
  text-align: center;
  margin-bottom: 26px;
}

.card-logo {
  max-width: 175px;
  height: auto;
  margin-bottom: 14px;
}

/* Official Credential Header inside Consulta */
.credential-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 22px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.credential-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.credential-brand img {
  height: 46px;
  width: auto;
  object-fit: contain;
}

.credential-brand-text {
  text-align: left;
}

.credential-brand-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.credential-brand-sub {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 500;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 7px 15px;
  border-radius: 999px;
}

.badge-info {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.card-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.card-subtitle {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Student Profile Credential Banner (Photo + Name + CPF) */
.student-profile-card {
  display: flex;
  align-items: center;
  gap: 22px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1.5px solid #cbd5e1;
  border-radius: 16px;
  padding: 22px 24px;
  margin-bottom: 20px;
  position: relative;
}

.student-photo-wrapper {
  position: relative;
  flex-shrink: 0;
}

.student-photo-frame {
  width: 112px;
  height: 112px;
  border-radius: 16px;
  background: linear-gradient(135deg, #122d52 0%, #1e467a 100%);
  border: 3px solid #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.16);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  position: relative;
}

.student-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.student-avatar-initials {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #ffffff;
  line-height: 1.1;
}

.student-avatar-caption {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 4px;
  font-weight: 600;
}

.student-verified-seal {
  position: absolute;
  bottom: -6px;
  right: -6px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #16a34a;
  color: #ffffff;
  border: 3px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(22, 163, 74, 0.35);
}

.student-info-col {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.student-role-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 4px;
}

.student-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 10px;
  word-break: break-word;
}

.student-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.student-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.student-meta-pill strong {
  color: var(--text-main);
}

.student-meta-pill.status-approved {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

/* Course Highlight Banner */
.course-highlight-box {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin-bottom: 20px;
  text-align: left;
  box-shadow: var(--shadow-sm);
}

.course-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.course-title-text {
  font-size: 17px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.4;
  margin-top: 4px;
}

.workload-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

/* Metadata Grid */
.cert-box {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 22px;
}

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

.cert-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.cert-item.full {
  grid-column: 1 / -1;
}

.cert-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
}

.cert-value {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
  word-break: break-word;
}

.cert-key-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Courier New', Courier, monospace;
  background: #e2e8f0;
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 800;
}

.authenticity-seal-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 12px;
  color: var(--text-light);
  text-align: left;
  margin-top: 22px;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 16px;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  font-size: 14.5px;
  color: var(--text-main);
  background: var(--surface-subtle);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  outline: none;
}

.form-control:focus {
  background: #ffffff;
  border-color: var(--primary-hover);
  box-shadow: 0 0 0 4px rgba(30, 70, 122, 0.13);
}

.form-hint {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 5px;
}

/* Photo Upload Preview Box in Admin */
.photo-upload-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #ffffff;
  border: 1.5px dashed #cbd5e1;
  border-radius: 12px;
  padding: 12px;
}

.photo-preview-thumb {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 18px;
  border: 2px solid #e2e8f0;
}

.photo-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Table Avatar Thumbnail */
.table-avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--primary);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
  vertical-align: middle;
  border: 1.5px solid #e2e8f0;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 11px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(18, 45, 82, 0.25);
}

.btn-success {
  background: var(--success);
  color: #ffffff;
}

.btn-success:hover {
  background: #166534;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(21, 128, 61, 0.22);
}

.btn-outline {
  background: #ffffff;
  color: var(--primary);
  border: 1.5px solid #cbd5e1;
}

.btn-outline:hover {
  background: var(--surface-subtle);
  border-color: var(--primary);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.btn-danger:hover {
  background: var(--danger);
  color: #ffffff;
}

.btn-sm {
  font-size: 12.5px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
}

.actions-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

/* Alerts */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

/* Admin Panel Grid & Table */
.admin-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.admin-grid {
  display: grid;
  grid-template-columns: 370px 1fr;
  gap: 28px;
  align-items: start;
}

.admin-panel-box {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
}

.admin-section-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

.data-table th {
  background: var(--surface-subtle);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11.5px;
  letter-spacing: 0.03em;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: #f8fafc;
}

/* Footer */
.site-footer {
  text-align: center;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  padding: 20px 24px 28px;
  line-height: 1.7;
}

.site-footer strong {
  color: #ffffff;
}

.site-footer a {
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 920px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .card,
  .card.card-wide {
    padding: 26px 20px;
  }
  .student-profile-card {
    flex-direction: column;
    text-align: center;
  }
  .student-info-col {
    text-align: center;
  }
  .student-meta-row {
    justify-content: center;
  }
  .cert-grid {
    grid-template-columns: 1fr;
  }
  .credential-topbar {
    justify-content: center;
    text-align: center;
  }
}

/* Print Layout */
@media print {
  body {
    background: #ffffff !important;
  }
  .site-header,
  .site-footer,
  .no-print {
    display: none !important;
  }
  .main-wrapper {
    padding: 0 !important;
  }
  .card {
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
    max-width: 100% !important;
  }
}
