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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f0f0f0;
  color: #333;
  line-height: 1.6;
}

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

/* ===== HEADER ===== */
header {
  background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 50%, #6D28D9 100%);
  color: white;
  padding: 25px 0;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

header .container {
  text-align: center;
}

.header-logo {
  display: block;
  margin: 0 auto 10px auto;
  max-height: 80px;
  width: auto;
}

header h1 {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 5px;
}

header .subtitle {
  text-align: center;
  font-size: 1rem;
  opacity: 0.9;
}

/* ===== TABS ===== */
.tabs {
  background-color: #6B7280;
  padding: 10px 0;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.tab-btn {
  padding: 12px 35px;
  border: none;
  border-radius: 25px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: #D4D4D8;
  color: #3F3F46;
}

.tab-btn.active {
  background-color: #FBBF24;
  color: #1C1917;
  box-shadow: 0 3px 10px rgba(251, 191, 36, 0.5);
}

.tab-btn:hover:not(.active) {
  background-color: #A1A1AA;
  color: white;
}

/* ===== MAIN ===== */
main {
  padding: 25px 0;
}

/* ===== FILTERS ===== */
.filters {
  background-color: white;
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  border: 2px solid #E5E7EB;
}

.filters h2 {
  color: #7C3AED;
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.filter-group {
  display: flex;
  flex-direction: column;
}

.filter-group label {
  font-weight: 600;
  margin-bottom: 5px;
  color: #4B5563;
  font-size: 0.9rem;
}

.filter-group input,
.filter-group select {
  padding: 10px 12px;
  border: 2px solid #D1D5DB;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: border-color 0.3s ease;
  background-color: #F9FAFB;
}

.filter-group input:focus,
.filter-group select:focus {
  outline: none;
  border-color: #8B5CF6;
  background-color: white;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.result-count {
  margin-top: 12px;
  color: #6B7280;
  font-style: italic;
}

/* ===== TABLE ===== */
.table-section {
  background-color: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  border: 2px solid #E5E7EB;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

thead {
  background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
  color: white;
}

thead th {
  padding: 14px 12px;
  text-align: left;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

thead th:first-child {
  border-top-left-radius: 0;
}

thead th:last-child {
  border-top-right-radius: 0;
}

tbody tr {
  border-bottom: 1px solid #E5E7EB;
  transition: background-color 0.2s ease;
}

tbody tr:nth-child(even) {
  background-color: #F9FAFB;
}

tbody tr:nth-child(odd) {
  background-color: #F3F4F6;
}

tbody tr:hover {
  background-color: #EDE9FE;
  transform: scale(1.005);
}

tbody td {
  padding: 10px 12px;
  font-size: 0.9rem;
}

tbody tr.selected-row {
  background-color: #FEF3C7 !important;
  border-left: 4px solid #F59E0B;
}

.pos-cell {
  font-weight: 700;
  color: #7C3AED;
  font-size: 1.1rem;
}

.pos-1 { color: #F59E0B; font-size: 1.2rem; }
.pos-2 { color: #9CA3AF; font-size: 1.2rem; }
.pos-3 { color: #D97706; font-size: 1.2rem; }

.action-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s ease;
  background-color: #8B5CF6;
  color: white;
}

.action-btn:hover {
  background-color: #7C3AED;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(139, 92, 246, 0.3);
}

/* ===== DIPLOMA SECTION ===== */
.diploma-section {
  margin-top: 25px;
  background-color: white;
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  border: 2px solid #E5E7EB;
}

.diploma-section h2 {
  color: #7C3AED;
  margin-bottom: 20px;
  text-align: center;
}

.diploma-container {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.diploma-certificate {
  width: 100%;
  max-width: 700px;
  border: 3px solid #8B5CF6;
  border-radius: 15px;
  padding: 35px;
  background: linear-gradient(135deg, #FAFAFA 0%, #F5F3FF 50%, #FAFAFA 100%);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.diploma-certificate::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  bottom: 10px;
  border: 2px solid #D8B4FE;
  border-radius: 10px;
  pointer-events: none;
}

.diploma-certificate::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #FBBF24, #8B5CF6, #FBBF24);
}

.diploma-title {
  font-size: 1.8rem;
  color: #7C3AED;
  font-weight: 800;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.diploma-name {
  font-size: 1.5rem;
  color: #1C1917;
  font-weight: 700;
  margin-bottom: 10px;
  text-decoration: underline;
  text-decoration-color: #FBBF24;
  text-decoration-thickness: 2px;
}

.diploma-category {
  font-size: 1.1rem;
  color: #6D28D9;
  font-weight: 600;
  margin-bottom: 5px;
}

.diploma-position {
  font-size: 1rem;
  color: #4B5563;
  margin-bottom: 5px;
}

.diploma-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 20px 0;
  text-align: left;
}

.diploma-detail-item {
  background-color: #F5F3FF;
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 3px solid #8B5CF6;
}

.diploma-detail-item .label {
  font-size: 0.8rem;
  color: #7C3AED;
  font-weight: 600;
  text-transform: uppercase;
}

.diploma-detail-item .value {
  font-size: 1.05rem;
  color: #1C1917;
  font-weight: 600;
}

.diploma-footer {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 2px solid #D8B4FE;
  font-size: 0.85rem;
  color: #6B7280;
}

.diploma-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.btn-print, .btn-download {
  background-color: #8B5CF6;
  color: white;
}

.btn-print:hover {
  background-color: #7C3AED;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.btn-download {
  background-color: #FBBF24;
  color: #1C1917;
}

.btn-download:hover {
  background-color: #F59E0B;
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
}

/* ===== FOOTER ===== */
footer {
  background-color: #3F3F46;
  color: #D4D4D8;
  text-align: center;
  padding: 20px 0;
  margin-top: 30px;
}

/* ===== HIDDEN ===== */
.hidden {
  display: none !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.4rem;
  }

  header .subtitle {
    font-size: 0.85rem;
  }

  .tab-btn {
    padding: 10px 20px;
    font-size: 0.95rem;
  }

  .filters {
    padding: 15px;
  }

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

  .diploma-certificate {
    padding: 20px;
  }

  .diploma-title {
    font-size: 1.3rem;
  }

  .diploma-name {
    font-size: 1.2rem;
  }

  .diploma-details {
    grid-template-columns: 1fr;
  }

  .diploma-actions {
    flex-direction: column;
    align-items: center;
  }

  .btn-print, .btn-download, }

@media (max-width: 480px) {
  .container {
    padding: 0 10px;
  }

  header {
    padding: 15px 0;
  }

  header h1 {
    font-size: 1.1rem;
  }

  .header-logo {
    max-height: 50px;
  }

  thead th {
    padding: 8px 6px;
    font-size: 0.75rem;
  }

  tbody td {
    padding: 6px;
    font-size: 0.8rem;
  }

  .action-btn {
    padding: 4px 8px;
    font-size: 0.75rem;
  }
}

@media print {
  header, .tabs, .filters, .diploma-actions, footer, .action-btn {
    display: none !important;
  }

  .diploma-section {
    box-shadow: none;
    border: none;
  }

  .diploma-certificate {
    border: 2px solid #000;
    page-break-inside: avoid;
  }
}
