:root {
  --vgec-back: #ffffff;
  --vgec-primary: #d91215;
  --vgec-secondary: #f4dea5;
  --vgec-text: #000000;
  --vgec-gray: #e8e7e7;
  --vgec-blue: #003975;
  --danger: #a11d2b;
  --success: #0a7a43;
}

* {
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  margin: 0 !important;
  padding: 0 !important;
  color: var(--vgec-text);
  background-color: var(--vgec-back);
}

a {
  text-decoration: none !important;
}

/* ========================================
   PROFESSIONAL ADMIN HEADER STYLES
   ======================================== */

.admin-header {
  background-color: #d91215;
  padding: 12px 40px;
  margin: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  max-width: 100%;
}

/* Left Section - Logo + Text */
.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 320px;
}

.header-logo {
  height: 56px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
  flex-shrink: 0;
}

.header-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.header-title {
  font-family: "Poppins", sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: white;
  margin: 0;
  padding: 0;
  line-height: 1.4;
  letter-spacing: 0.3px;
}

.header-subtitle {
  font-family: "Poppins", sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  padding: 0;
  line-height: 1.3;
  letter-spacing: 0.2px;
}

/* Right Section - Navigation */
.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link {
  font-family: "Poppins", sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: white;
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
  position: relative;
  white-space: nowrap;
}

.nav-link:hover {
  color: #f4dea5;
  border-bottom-color: #f4dea5;
}

.nav-link.logout {
  color: #ffcccc;
}

.nav-link.logout:hover {
  color: #fff;
  border-bottom-color: #fff;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .admin-header {
    padding: 10px 24px;
  }

  .header-container {
    gap: 24px;
  }

  .header-left {
    gap: 12px;
    min-width: 280px;
  }

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

  .header-title {
    font-size: 1rem;
  }

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

  .header-nav {
    gap: 16px;
  }

  .nav-link {
    font-size: 0.8rem;
  }
}

@media (max-width: 768px) {
  .admin-header {
    padding: 10px 16px;
  }

  .header-container {
    gap: 16px;
    flex-direction: column;
    align-items: flex-start;
  }

  .header-left {
    width: 100%;
    min-width: auto;
  }

  .header-nav {
    width: 100%;
    justify-content: flex-start;
    gap: 12px;
  }

  .nav-link {
    font-size: 0.75rem;
  }

  .header-title {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .admin-header {
    padding: 8px 12px;
  }

  .header-left {
    gap: 10px;
  }

  .header-logo {
    height: 44px;
    max-width: 110px;
  }

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

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

  .header-nav {
    gap: 8px;
  }

  .nav-link {
    font-size: 0.7rem;
    padding: 4px 0;
  }
}


.bg-vgec {
  background-color: var(--vgec-primary);
}

.text-vgec-back {
  color: var(--vgec-back);
}

.header-padding {
  padding-top: 1.15rem;
}

.page-heading {
  color: var(--vgec-primary) !important;
  font-family: Arial, Helvetica, sans-serif !important;
  text-transform: uppercase !important;
  font-weight: 600 !important;
  margin-bottom: 0;
}

.auth-shell {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 0;
}

.auth-card {
  width: min(100%, 520px);
}

.section-box {
  border: 1px solid #000000;
  background: #ffffff;
  padding-bottom: 1.35rem !important;
}

.dept-title {
  color: var(--vgec-primary) !important;
  font-family: Arial, Helvetica, sans-serif !important;
  text-transform: uppercase !important;
  font-weight: 600 !important;
}

.stat {
  width: 100%;
  font-family: "Montserrat", sans-serif;
  color: #101010;
  border-collapse: collapse;
}

.stat thead {
  border: 1px solid #101010;
  background-color: var(--vgec-primary);
  color: var(--vgec-back);
}

.stat tr:nth-child(even) {
  background: var(--vgec-gray);
}

.stat tbody tr:hover {
  color: var(--vgec-primary);
  background-color: var(--vgec-gray);
}

.stat td,
.stat th {
  padding: 0.75rem;
  vertical-align: middle !important;
  border: 1px solid #101010;
  text-align: center;
}

.btn-vgec {
  background-color: var(--vgec-primary);
  border-color: var(--vgec-primary);
  color: #fff;
}

.btn-vgec:hover,
.btn-vgec:focus {
  background-color: #b90f12;
  border-color: #b90f12;
  color: #fff;
}

.exam-actions-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem;
  padding-bottom: 0.25rem;
}

.exam-toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 2.25rem;
  padding: 0.45rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.exam-toolbar-btn i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  min-width: 1rem;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1;
  flex-shrink: 0;
}

.exam-toolbar-btn span {
  display: inline-block;
  line-height: 1.2;
}

.exam-toolbar-btn-primary {
  background-color: var(--vgec-primary);
  border-color: var(--vgec-primary);
  color: #fff;
}

.exam-toolbar-btn-primary:hover,
.exam-toolbar-btn-primary:focus {
  background-color: #b90f12;
  border-color: #b90f12;
  color: #fff;
}

.exam-toolbar-btn-danger {
  background-color: #dc3545;
  border-color: #dc3545;
  color: #fff;
}

.exam-toolbar-btn-danger:hover,
.exam-toolbar-btn-danger:focus {
  background-color: #bb2d3b;
  border-color: #b02a37;
  color: #fff;
}

.exam-toolbar-btn:disabled,
.exam-toolbar-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.exam-toolbar-mail-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.exam-toolbar-mail-form,
.exam-toolbar-delete-form {
  margin: 0;
  display: inline-flex;
}

.exam-mail-status {
  margin: 0;
  padding: 0;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
  color: #dc3545 !important;
  text-align: center;
  letter-spacing: 0.01em;
}

.exam-timeline-option {
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.candidate-section-notice {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  padding: 0.85rem 1rem;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 0.375rem;
  color: #5c636a;
  font-size: 0.95rem;
  line-height: 1.4;
}

.candidate-section-notice i {
  color: var(--vgec-primary);
  font-size: 1rem;
  flex-shrink: 0;
}

.candidate-answer-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.candidate-answer-key-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 2.25rem;
  padding: 0.45rem 1rem;
  border: 1px solid var(--vgec-primary);
  border-radius: 0.375rem;
  background-color: var(--vgec-primary);
  color: #fff !important;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.candidate-answer-key-btn:hover,
.candidate-answer-key-btn:focus {
  background-color: #b90f12;
  border-color: #b90f12;
  color: #fff !important;
}

.candidate-answer-key-btn i {
  font-size: 0.9rem;
  line-height: 1;
}

.candidate-guide-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 2.25rem;
  padding: 0.45rem 1rem;
  border: 1px solid var(--vgec-primary);
  border-radius: 0.375rem;
  background-color: var(--vgec-primary);
  color: #fff !important;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.candidate-guide-btn:hover,
.candidate-guide-btn:focus {
  background-color: #b90f12;
  border-color: #b90f12;
  color: #fff !important;
}

.candidate-guide-btn i {
  font-size: 0.9rem;
  line-height: 1;
}

.candidate-omr-image-wrap {
  margin-bottom: 0.25rem;
  text-align: center;
}

.candidate-omr-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.candidate-omr-frame {
  margin-bottom: 0.25rem;
}

a.theme-link,
a.theme-link:link,
a.theme-link:visited,
a.theme-link:active {
  color: var(--vgec-primary) !important;
  font-weight: 600;
  transition: color 0.2s ease;
}

a.theme-link:hover,
a.theme-link:focus {
  color: #b90f12 !important;
}

.alert {
  border-radius: 6px;
  padding: 0.7rem 0.85rem;
  margin: 0.8rem 0;
}

.alert.error {
  background: #fdecef;
  color: #7d1621;
  border: 1px solid #f9ccd2;
}

.alert.success {
  background: #e9f8f1;
  color: #0c5e35;
  border: 1px solid #cbeedc;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.dashboard-kpis {
  margin-top: 0.25rem;
}

.dashboard-tile {
  display: block;
  height: 100%;
  padding: 1.15rem 1.1rem;
  border: 1px solid #111111;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #fff7f7 100%);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  color: var(--vgec-text) !important;
  text-decoration: none !important;
}

.dashboard-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.12);
  border-color: var(--vgec-primary);
}

.tile-static {
  cursor: default;
}

.tile-link {
  position: relative;
}

.dashboard-tile-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  background: rgba(217, 18, 21, 0.12);
  color: var(--vgec-primary);
  font-size: 1.15rem;
}

.dashboard-tile-foot {
  margin-top: 0.7rem;
  font-size: 0.82rem;
  color: var(--vgec-primary);
  font-weight: 600;
  text-transform: uppercase;
}

.kpi {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--vgec-primary);
}

.small,
.meta {
  font-size: 0.86rem;
  color: #4a4a4a;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--vgec-primary) !important;
  color: #fff !important;
  border: 1px solid var(--vgec-primary) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: #b90f12 !important;
  color: #fff !important;
  border: 1px solid #b90f12 !important;
}

.action-btn-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}

.action-btn {
  border: 1px solid transparent;
  border-radius: 999px;
  min-width: 40px;
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.action-btn i {
  margin-right: 0;
  font-size: 0.92rem;
}

.action-btn-primary {
  background-color: var(--vgec-primary) !important;
  color: #ffffff !important;
  border-color: var(--vgec-primary) !important;
}

.action-btn-primary:hover {
  background-color: #b90f12 !important;
  border-color: #b90f12 !important;
}

.action-btn-danger {
  background-color: #8c0d0f !important;
  color: #ffffff !important;
  border-color: #8c0d0f !important;
}

.action-btn-danger:hover {
  background-color: #70090b !important;
  border-color: #70090b !important;
}

.action-btn[disabled],
.action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.icon-only {
  min-width: 40px;
}

.modal-actions {
  display: flex !important;
  justify-content: flex-end;
  gap: 0.6rem;
  background: #ffffff;
  border-top: 1px solid #dee2e6;
}

.modal-actions .btn {
  min-width: 100px;
}

/* Bootstrap scrollable modal expects modal-body as a direct child of modal-content.
   Our form wrapper sits between them, so enforce proper flex layout manually. */
.modal-dialog-scrollable .modal-content > form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100vh - 3.5rem);
}

.modal-dialog-scrollable .modal-content > form .modal-body {
  overflow-y: auto;
  min-height: 0;
}

.modal-dialog-scrollable .modal-content > form .modal-footer {
  flex-shrink: 0;
}

.upload-loader {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.upload-loader.active {
  display: flex;
}

.upload-loader-card {
  background: var(--vgec-primary);
  color: #fff;
  border-radius: 10px;
  padding: 1rem 1.2rem;
  min-width: 320px;
  max-width: min(92vw, 520px);
  text-align: center;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.upload-loader-text {
  margin-top: 0.7rem;
  font-size: 0.95rem;
  font-weight: 500;
}
