/* Admin Pakta — gaya aplikasi di atas Bootstrap 5.3 (vendor). Mobile-first. */

:root {
  --pakta-navy: #0f1e3d;
  --pakta-navy-soft: #1b2f5b;
  --bs-primary: #2563eb;
  --bs-primary-rgb: 37, 99, 235;
  --bs-link-color: #2563eb;
  --bs-link-color-rgb: 37, 99, 235;
  --bs-link-hover-color: #1d4ed8;
  --bs-link-hover-color-rgb: 29, 78, 216;
}

.btn-primary {
  --bs-btn-bg: #2563eb;
  --bs-btn-border-color: #2563eb;
  --bs-btn-hover-bg: #1d4ed8;
  --bs-btn-hover-border-color: #1d4ed8;
  --bs-btn-active-bg: #1e40af;
  --bs-btn-active-border-color: #1e40af;
  --bs-btn-disabled-bg: #2563eb;
  --bs-btn-disabled-border-color: #2563eb;
  --bs-btn-focus-shadow-rgb: 37, 99, 235;
}

html,
body {
  min-height: 100%;
}

body {
  overflow-x: hidden;
}

:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

/* Area sentuh minimal 44px */
.btn,
.form-control {
  min-height: 44px;
}

.btn-lg,
.form-control-lg {
  min-height: 48px;
}

.btn-link-plain {
  background: none;
  border: 0;
  padding: 0.625rem 0;
  min-height: 44px;
  color: var(--bs-primary);
  font-weight: 500;
  text-decoration: none;
}

.btn-link-plain:hover {
  text-decoration: underline;
}

/* Merek */
.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand-logo .bi {
  color: #3b82f6;
}

.brand-badge {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.28);
  color: #dbe7ff;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0;
}

.app-sidebar .brand-logo {
  font-size: 1.5rem;
  color: var(--pakta-navy);
}

.app-sidebar .brand-badge {
  background: #dbe7ff;
  color: #1e40af;
}

/* Halaman masuk */
.auth-brand {
  position: relative;
  overflow: hidden;
  padding: 1.5rem 1.25rem 1.75rem;
  background: var(--pakta-navy);
  color: #fff;
}

.auth-brand::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -40px;
  width: 220px;
  height: 140px;
  background: repeating-linear-gradient(
    115deg,
    transparent 0 22px,
    rgba(96, 165, 250, 0.22) 22px 24px
  );
  pointer-events: none;
}

.auth-tagline {
  margin: 1.25rem 0 0;
  font-size: 1.125rem;
  font-weight: 500;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 2.5rem;
}

.auth-note {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin: 1.25rem 0 0;
  font-size: 0.875rem;
  color: var(--bs-secondary-color);
}

.auth-note .bi {
  margin-top: 0.1rem;
}

.overflow-anywhere {
  overflow-wrap: anywhere;
}

@media (min-width: 992px) {
  .auth-brand {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
  }

  .auth-brand .brand-logo {
    font-size: 2.25rem;
  }

  .auth-tagline {
    font-size: 1.375rem;
  }

  .auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
  }

  .auth-card {
    margin: 0;
  }
}

/* Input OTP: satu <input> transparan di atas enam kotak dekoratif */
.otp-field {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 52px));
  justify-content: start;
  gap: 8px;
  position: relative;
}

.otp-box {
  height: 52px;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.5rem;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 600;
  background: #fff;
}

.otp-field:focus-within .otp-box.is-active {
  outline: 2px solid var(--bs-primary);
  border-color: var(--bs-primary);
}

.otp-box.is-invalid {
  border-color: var(--bs-danger);
  outline: 2px solid var(--bs-danger);
  background: var(--bs-danger-bg-subtle);
}

.otp-field.is-disabled .otp-box {
  background: var(--bs-secondary-bg);
  color: var(--bs-secondary-color);
}

.otp-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  -webkit-text-fill-color: transparent;
  font-size: 1.5rem;
}

.otp-input::selection {
  background: transparent;
}

.otp-input:-webkit-autofill {
  -webkit-text-fill-color: transparent;
  transition: background-color 99999s ease-in-out 0s;
}

/* Kerangka dashboard */
.app-shell {
  min-height: 100vh;
  background: #f6f8fc;
}

.app-sidebar {
  --bs-offcanvas-width: 280px;
  display: flex;
  flex-direction: column;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1.25rem 1rem 1rem;
}

.sidebar-head .brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.sidebar-nav {
  flex: 1 1 auto;
  padding: 0.5rem 0.75rem;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  color: var(--pakta-navy);
}

.sidebar-nav .nav-link:hover:not(.disabled) {
  background: #eef3fd;
}

.sidebar-nav .nav-link.active {
  background: #e3ecff;
  color: var(--bs-primary);
  font-weight: 600;
}

.sidebar-nav .nav-link.disabled {
  color: #4b5568;
  cursor: default;
}

.sidebar-nav .nav-link.disabled .bi {
  opacity: 0.7;
}

.soon-badge {
  margin-left: auto;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: #eceff5;
  color: #4b5568;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.sidebar-foot {
  padding: 0.75rem;
  border-top: 1px solid var(--bs-border-color);
}

.sidebar-foot .btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  color: var(--pakta-navy);
  font-weight: 600;
}

.app-main {
  flex: 1 1 auto;
  min-width: 0;
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border-bottom: 1px solid var(--bs-border-color);
}

.btn-menu {
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 1.5rem;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: #dbe4f6;
  color: var(--pakta-navy);
  font-size: 0.875rem;
  font-weight: 700;
}

.app-content {
  padding: 1.5rem 1rem 2rem;
}

@media (min-width: 992px) {
  .app-shell {
    display: flex;
  }

  .app-sidebar {
    flex: 0 0 240px !important;
    width: 240px !important;
    position: sticky !important;
    top: 0;
    height: 100vh !important;
    background: #fff !important;
    border-right: 1px solid var(--bs-border-color) !important;
  }

  .app-topbar {
    padding: 0.75rem 2rem;
  }

  .app-content {
    padding: 2rem;
  }
}

.boot-state {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .offcanvas,
  .offcanvas-backdrop,
  .offcanvas-lg {
    transition: none !important;
  }
}

/* Pengaturan akses */
.access-tabs .nav-link,
#access-tabs .nav-link {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.access-card .avatar {
  flex: 0 0 auto;
}

.perm-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 0;
}

.perm-row + .perm-row {
  border-top: 1px solid var(--bs-border-color);
}

.perm-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
}

@media (min-width: 768px) {
  .perm-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* Footer modal: tombol penuh lebar di layar kecil */
@media (max-width: 575.98px) {
  .modal-footer .btn {
    width: 100%;
  }
}

.min-w-0 {
  min-width: 0;
}
