body,
h1,
h2,
h3,
p,
input,
button {
  font-family: 'Montserrat', sans-serif;
}

:root {
  --navy: #0b1e3d;
  --navy-2: #133162;
  --white: #ffffff;
  --gray: #e9eef7;
  --accent: #0d6efd;
}

* {
  box-sizing: border-box
}

body {
  margin: 0;
  font-family: Inter, system-ui, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--gray);
  color: #0f172a;
}


body.scrollable {
  overflow-y: auto !important;
}

@media (max-width: 900px) {
  body {
    overflow-y: auto;
  }
}

.void {
  color: var(--gray);
}

.grid {
  display: grid;
  gap: 16px;
  margin-top: 20px;
  justify-content: center;
}

/* Default mobile: 1 kolom */
.grid {
  grid-template-columns: 1fr;
}

/* Desktop rules */
@media (min-width: 900px) {
  .grid.kandidat-1 {
    grid-template-columns: repeat(1, 1fr);
  }

  .grid.kandidat-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid.kandidat-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid.kandidat-4 {
    grid-template-columns: repeat(4, 1fr);
  }

  .grid.kandidat-5 {
    grid-template-columns: repeat(5, 1fr);
  }

  .grid.kandidat-6 {
    grid-template-columns: repeat(3, 1fr);
  }

  /* 3+3 */
  .grid.kandidat-7 {
    grid-template-columns: repeat(4, 1fr);
  }

  /* 3+4 */
  .grid.kandidat-8 {
    grid-template-columns: repeat(4, 1fr);
  }

  /* 4+4 */
  .grid.kandidat-9 {
    grid-template-columns: repeat(5, 1fr);
  }

  /* 4+5 */
  .grid.kandidat-10 {
    grid-template-columns: repeat(5, 1fr);
  }

  /* 5+5 */

  /* jika lebih dari 10 → tetap max 5 kolom */
  .grid[class*="kandidat-"]:not(.kandidat-1):not(.kandidat-2):not(.kandidat-3):not(.kandidat-4):not(.kandidat-5) :not(.kandidat-6):not(.kandidat-7):not(.kandidat-8):not(.kandidat-9):not(.kandidat-10) {
    grid-template-columns: repeat(5, 1fr);
  }
}

.header {
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  color: var(--white);
  padding: 6px 6px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
}

.header .brand {
  font-size: 16px;
}

.header p {
  font-size: 12px;
  margin-top: 1px;
}

#sidebar {
  position: fixed;
  top: 0;
  left: -260px;
  width: 250px;
  height: 100vh;
  /* penuh setinggi layar */
  background: #003366;
  color: white;
  transition: 0.3s;
  padding: 20px;
  z-index: 1050;

  overflow-y: auto;
  /* aktifkan scroll */
  scrollbar-width: thin;
  /* untuk Firefox */
  scrollbar-color: #1a5276 #003366;
}

/* untuk Chrome, Edge, dll */
#sidebar::-webkit-scrollbar {
  width: 6px;
}

#sidebar::-webkit-scrollbar-track {
  background: #003366;
}

#sidebar::-webkit-scrollbar-thumb {
  background-color: #1a5276;
  border-radius: 3px;
}

.sidebar-header {
  text-align: center;
  margin-bottom: 20px;
}

.sidebar-header .profile-pic {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 10px;
}

.sidebar-header h3 {
  margin: 5px 0;
}

.sidebar-header p {
  margin: 0;
  font-size: 14px;
}

.status.online {
  color: #2ecc71;
  font-weight: bold;
}

.sidebar-nav a {
  display: block;
  color: white;
  padding: 10px;
  text-decoration: none;
  border-radius: 5px;
  margin-bottom: 8px;
}

.sidebar-nav a:hover {
  background: #1a5276;
}

.sidebar-nav img.icon {
  width: 20px;
  vertical-align: middle;
  margin-right: 8px;
}

.submenu-items {
  display: none;
  flex-direction: column;
  margin-left: 32px;
}

.submenu-items.show {
  display: flex;
}

.submenu-items a {
  font-size: 14px;
}

.header-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 15px;
}

.logo-header {
  height: 60px;
  width: auto;
}

.headerl {
  background: linear-gradient(135deg, rgba(11, 30, 61, 0.8), rgba(19, 49, 98, 0.8)),
    url("/static/gedung-pi.jpg") no-repeat center center;
  background-size: cover;
  padding: 22px 15px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  color: var(--white);
}



.headerlll {
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  color: var(--white);
  padding: 22px 15px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
}

.container {
  max-width: 1400px;
  margin: 24px auto;
  padding: 20px;
}

.container-login {
  margin-bottom: 60px;
  margin-top: 15px;
}

.card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(11, 30, 61, .15);
  padding: 24px;
}

.nama-kandidat {
  font-size: 15px;
  font-weight: 700;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  max-width: none;
  margin: 0 auto 4px auto;
}

.title {
  font-size: 26px;
  margin: 0 0 8px
}

.subtitle {
  opacity: .9;
  margin: 0 0 16px
}

.input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  outline: none;
  font-size: 16px
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(13, 110, 253, .15)
}

.btn {
  appearance: none;
  border: none;
  background: var(--accent);
  color: var(--white);
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.5s ease;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(0deg,
      transparent,
      transparent 30%,
      rgba(0, 255, 255, 0.3));
  transform: rotate(-45deg);
  transition: all 0.5s ease;
  opacity: 0;
  pointer-events: none;
}

.btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.btn:hover::before {
  opacity: 1;
  transform: rotate(-45deg) translateY(100%);
}

.btn:active {
  transform: scale(1);
}

.kartu-kandidat {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  text-align: center;
  background: var(--white);
}

.kandidat-foto {
  width: 110px;
  height: 110px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 800;
  font-size: 20px;
  box-shadow: 0 6px 16px rgba(11, 30, 61, .25);
}

.badge {
  font-size: 12px;
  background: #eef2ff;
  color: #22314d;
  padding: 4px 8px;
  border-radius: 999px
}

.alert {
  color: #b91c1c;
  background: #fee2e2;
  border: 1px solid #fecaca;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px
}

.footer {
  opacity: .8;
  font-size: 13px;
  text-align: center;
  margin-top: 12px
}

.footer2 {
  opacity: .8;
  font-size: 13px;
  text-align: center;
  margin-top: 2px
}

.inforekap {
  opacity: .8;
  font-size: 13px;
  margin-top: 12px
}

.smk {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
}

.pi {
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
}

.periode-text {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  font-size: 0.95em;
  margin-top: 20px;
  /* ✅ tambahkan jarak di sini */
  letter-spacing: 0.5px;
}

.credits {
  opacity: .8;
  font-size: 13px;
  text-align: center;
  margin-top: 0px;
  margin-bottom: 5px;
  line-height: 1.2;
}

.brand {
  margin-bottom: 7px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: .3px;
  font-size: 40px;
}

.brandt {
  margin-bottom: 7px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .3px;
  font-size: 40px;
}

.brandp {
  margin-bottom: 7px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .3px;
  font-size: 40px;
}


.sub {
  margin-top: 0;
  line-height: 1.2;

}

@media (max-width: 900px) {
  .container {
    max-width: 100vw;
    padding: 8px;
  }

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

@media (max-width: 900px) {
  .header .brand {
    font-size: 10px;
  }

  .brand {
    margin-bottom: 7px;
    line-height: 1;
    font-size: 25px;
    font-weight: 800;
    letter-spacing: .3px
  }

  .brandt {
    margin-bottom: 7px;
    line-height: 1;
    font-size: 25px;
    font-weight: 800;
    letter-spacing: .3px
  }

  .brandp {
    margin-bottom: 7px;
    line-height: 1;
    font-size: 50px;
    font-weight: 800;
    letter-spacing: .3px
  }

  .credits {
    opacity: .8;
    font-size: 10px;
    text-align: center;
    margin-top: 0px;
    margin-bottom: 3px;
    line-height: 1.2;
  }

}

@keyframes shake {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }

  20% {
    transform: translate(-8px, 2px) rotate(-2deg);
  }

  40% {
    transform: translate(8px, -2px) rotate(2deg);
  }

  60% {
    transform: translate(-6px, 2px) rotate(-1deg);
  }

  80% {
    transform: translate(6px, -2px) rotate(1deg);
  }

  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}

.shake {
  animation: shake 0.6s cubic-bezier(.36, .07, .19, .97) both;
}

.kartu-kandidat {
  text-align: center;
  border: 1px solid #ccc;
  padding: 12px;
  border-radius: 12px;
  background: #fff;
}

.nomor {
  font-size: 20px;
  font-weight: bold;
  background: #a9caf8;
  color: #000000;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  line-height: 40px;
  margin: 0 auto 8px auto;
}

.foto-kandidat {
  --b: 8px;
  /* the border thickness*/
  --g: 7px;
  /* the gap */
  --c: #eeff00;
  /* the color */

  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  outline-offset: calc(var(--s)/-1);
  cursor: pointer;
  transition: .3s;
}

.foto-kandidat:hover {
  outline: var(--b) solid var(--c);
  outline-offset: var(--g);
}

.foto-kandidat+foto-kandidat {
  border-radius: 50%;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  background: #22314d;
  color: #fff;
  font-size: 14px;
  margin-top: 4px;
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  margin-top: 10px;
  color: #fff;
  background: #22314d;
}

.btn:hover {
  background: #22314d;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-adm {
  display: inline-block;
  padding: 1px 1px;
  border: none;
  font-size: 1px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  margin-top: 1px;
  color: #fff;
  background: #ffffff;
}

.btn-adm:hover {
  background: #ffffff;
  transform: translateY(-2px);
}

#toggleNis {
  background: #e9eef7;
  color: #222;
  border-radius: 8px;
  padding: 4px 12px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid #cbd5e1;
  transition: background 0.2s;
  user-select: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

#toggleNis:hover {
  background: #dbe5f3;
}

#showAdminPass {
  background: #e9eef7;
  color: #222;
  border-radius: 8px;
  padding: 4px 12px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid #cbd5e1;
  user-select: none;
  cursor: not-allowed;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.admin-page .admin-password {
  color: #ffffff !important;
  text-shadow: 0 0 0 #ffffff;
  caret-color: #ffffff;
}

.admin-page .input[type="password"] {
  color: #ffffff !important;
  text-shadow: 0 0 0 #0f172a;
  caret-color: #ffffff;
}

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

.btn-danger-adm:hover {
  background: #c0392b;
}

.btn-primary-adm {
  background: #3498db;
  color: #fff;
}

.btn-primary-adm:hover {
  background: #2980b9;
}

.modal-adm {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
}

.modal-adm.show {
  display: flex !important;
}

.modal-content-adm {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 95vw;
  max-height: 90vh;
  position: relative;
  overflow-y: scroll;

  &::-webkit-scrollbar {
    width: 0;
    height: 0;
  }
}



.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-success {
  position: sticky;
  background: #27ae60;
}

.btn-success:hover {
  background: #1e8449;
}

.btn-danger {
  background: #e74c3c;
  display: inline-block;
  /* supaya animasi bisa diterapkan */
}

.btn-danger:hover {
  background: #b91c1c;
  animation: rotate 0.7s ease-in-out both;
}

.btn-danger:hover {
  animation: storm 0.7s ease-in-out both;
  animation-delay: 0.06s;
}

@keyframes rotate {
  0% {
    transform: rotate(0deg) translate3d(0, 0, 0);
  }

  25% {
    transform: rotate(3deg) translate3d(0, 0, 0);
  }

  50% {
    transform: rotate(-3deg) translate3d(0, 0, 0);
  }

  75% {
    transform: rotate(1deg) translate3d(0, 0, 0);
  }

  100% {
    transform: rotate(0deg) translate3d(0, 0, 0);
  }
}

@keyframes storm {
  0% {
    transform: translate3d(0, 0, 0);
  }

  25% {
    transform: translate3d(4px, 0, 0);
  }

  50% {
    transform: translate3d(-3px, 0, 0);
  }

  75% {
    transform: translate3d(2px, 0, 0);
  }

  100% {
    transform: translate3d(0, 0, 0);
  }
}





/* Modal + Animasi + Efek Kaca */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.modal.show {
  display: block;
  opacity: 1;
}

.modal-s {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-s.show {
  opacity: 1;
  pointer-events: auto;
}

.modal.hide {
  opacity: 0;
  pointer-events: none;
}

.modal-content {
  display: flex;
  flex-direction: row;
  gap: 32px;
  align-items: flex-start;
  background: #fff;
  margin: auto;
  border-radius: 12px;
  padding: 24px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  position: relative;
}

.modal-content .foto-full {
  max-width: 290px;
  width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 0;
  object-fit: cover;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.modal-info {
  flex: 1;
  min-width: 200px;
}

/* Scrollbar untuk browser berbasis WebKit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 0px;
  /* Lebar scrollbar */
  height: 0px;
  /* Tinggi scrollbar (untuk scrollbar horizontal) */
}

::-webkit-scrollbar-track {
  background: white;
  /* Warna latar track scrollbar */
}

::-webkit-scrollbar-thumb {
  background-color: #007BFF;
  /* Warna biru */
  border-radius: 3px;
  /* Membuat ujung scrollbar membulat */
  border: 1px solid white;
  /* Memberi border putih agar kontras */
}

@media (max-width: 700px) {
  .modal-content {
    flex-direction: column;
    gap: 16px;
    align-items: center;
  }

  .modal-content .foto-full {
    margin-bottom: 12px;
    max-width: 70vw;
  }

}



.welcome-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 999;
  color: white;
  background-color: rgba(0, 0, 0, 0.3);
  opacity: 1;
}

.welcome-logo {
  width: 100px;
  height: auto;
  margin-bottom: 15px;
}

.welcome-text {
  font-size: 32px;
  font-weight: bold;
  margin: 0;
}

.login-container {
  position: relative;
  z-index: 10;
  margin-top: 250px;
}

.modal-info h2 {
  margin-bottom: 5px;
  margin-top: 0px;
}

.modal-info p {
  margin-top: 0;
  margin-bottom: 10px;
}

.menu-btn {
  position: fixed;
  top: 15px;
  left: 15px;
  font-size: 26px;
  cursor: pointer;
  color: white;
  background: var(--navy);
  padding: 8px 10px;
  border-radius: 6px;
  z-index: 1300;
}

#sidebar {
  left: 0;
  width: 250px;
  position: fixed;
  top: 0;
  height: 100vh;
  background: #003366;
  color: white;
  transition: left 0.3s ease;
  z-index: 1200;
}

#sidebar.show {
  left: 0;
}

.sidebar-header {
  text-align: center;
}

.sidebar-header .profile-pic {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid white;
  margin-bottom: 8px;
}

.sidebar-header h3 {
  margin: 0;
  font-size: 18px;
}

.sidebar-header p {
  margin: 2px 0;
  font-size: 14px;
}

.status.online {
  color: #2ecc71;
  font-size: 13px;
}

.sidebar-nav {
  flex: 1;
  margin-top: 20px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  text-decoration: none;
  color: white;
  margin-bottom: 8px;
  transition: background 0.2s;
}

.sidebar-nav a:hover {
  background: #1a5276;
}


.sidebar-nav .icon,
.sidebar-footer .icon {
  width: 24px;
  height: 24px;
}

.sidebar-footer {
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  text-decoration: none;
}

.hover-underline {
  color: #ffffff;
  position: relative;
  display: inline-block;
  width: 100%;
}

.hover-underline::after,
.hover-underline::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, #ffffff, #0004ff);
  bottom: -5px;
  left: 0;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s ease-out;
}

.hover-underline::before {
  top: -5px;
  transform-origin: left;
}

.hover-underline:hover::after,
.hover-underline:hover::before {
  transform: scaleX(1);
}

/* ----- Logout button di sidebar-footer ----- */
.sidebar-footer a.logout-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  transition: background 0.25s ease, transform 0.18s ease;
  text-decoration: none;
  color: white;
  cursor: pointer;
}

/* Hover: warna + efek shake */
.sidebar-footer a.logout-btn:hover {
  background: #1a5276;
  /* sama dengan hover menu lain */
  color: #fff;
  animation: gentle-shake 0.4s ease-in-out;
}

.btn-logout {
  background-color: #c62828;
  color: var(--white);
  border: none;
  padding: 12px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 1rem;
  text-align: center;
  display: block;
  /* biar gampang dihover */
  transition: background 0.3s, transform 0.3s;
}

.btn-logout:hover {
  background: var(--primary);
  transform: translateY(-3px);
}

/* Animasi shake */
@keyframes gentle-shake {
  0% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-4px);
  }

  50% {
    transform: translateX(4px);
  }

  75% {
    transform: translateX(-2px);
  }

  100% {
    transform: translateX(0);
  }
}