:root {
  --pknns-primary: #005b96;
  --pknns-primary-dark: #003b73;
  --pknns-primary-deep: #062b55;
  --pknns-yellow: #ffd21f;
  --pknns-yellow-dark: #f2b705;
  --pknns-red: #d71920;
  --pknns-ink: #1f2937;
  --pknns-muted: #6b7280;
  --pknns-bg: #f3f7fb;
  --pknns-line: #e5edf2;
}

body {
  color: var(--pknns-ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.95rem;
}

a {
  color: var(--pknns-primary);
}

.content-wrapper {
  background: var(--pknns-bg);
}

.content-header h1 {
  font-size: 1.45rem;
  font-weight: 700;
}

.main-header {
  border-bottom: 1px solid rgba(0, 59, 115, 0.08);
}

.main-sidebar {
  background: linear-gradient(180deg, var(--pknns-primary-deep), var(--pknns-primary-dark));
}

.brand-link {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.sidebar-brand {
  align-items: center;
  display: flex !important;
  gap: 10px;
  padding: 0.9rem 0.9rem !important;
  text-align: left;
}

.brand-image-wrap {
  align-items: center;
  background: #fff;
  border-radius: 8px;
  display: inline-flex;
  flex: 0 0 42px;
  height: 42px;
  justify-content: center;
  padding: 5px;
}

.brand-image-wrap img {
  display: block;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.brand-link .brand-text {
  font-weight: 700 !important;
  letter-spacing: 0;
  white-space: normal;
}

.nav-sidebar .nav-link {
  border-radius: 6px;
  margin: 0.18rem 0.65rem;
  padding: 0.72rem 0.9rem;
}

.nav-sidebar .nav-icon {
  color: rgba(255, 255, 255, 0.72);
}

.nav-sidebar .nav-link.active,
.nav-sidebar .nav-link:hover {
  background: rgba(255, 210, 31, 0.16) !important;
  color: #fff !important;
}

.nav-sidebar .nav-link.active .nav-icon,
.nav-sidebar .nav-link:hover .nav-icon {
  color: var(--pknns-yellow);
}

.card,
.info-box,
.small-box {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(0, 59, 115, 0.08);
}

.card-header {
  background: #fff;
  border-bottom: 1px solid var(--pknns-line);
  border-radius: 8px 8px 0 0 !important;
}

.card-title {
  font-weight: 700;
}

.card-primary.card-outline {
  border-top: 3px solid var(--pknns-primary);
}

.table td,
.table th {
  vertical-align: middle;
}

.table thead th {
  border-bottom: 0;
  color: #475569;
  font-size: 0.8rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.table-hover tbody tr:hover {
  background: #f8fbfc;
}

.btn {
  border-radius: 6px;
  font-weight: 600;
}

.btn-primary,
.bg-primary {
  background-color: var(--pknns-primary) !important;
  border-color: var(--pknns-primary) !important;
}

.btn-primary:hover {
  background-color: var(--pknns-primary-dark) !important;
  border-color: var(--pknns-primary-dark) !important;
}

.btn-warning {
  background-color: var(--pknns-yellow) !important;
  border-color: var(--pknns-yellow) !important;
  color: #111827 !important;
}

.btn-warning:hover {
  background-color: var(--pknns-yellow-dark) !important;
  border-color: var(--pknns-yellow-dark) !important;
  color: #111827 !important;
}

.btn-outline-primary {
  border-color: var(--pknns-primary);
  color: var(--pknns-primary);
}

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

.form-control,
.custom-file-label,
.input-group-text {
  border-radius: 6px;
}

.form-control:focus {
  border-color: rgba(0, 91, 150, 0.45);
  box-shadow: 0 0 0 0.2rem rgba(0, 91, 150, 0.12);
}

label {
  color: #334155;
  font-weight: 700;
}

.small-box .inner h3,
.info-box-number {
  font-weight: 800;
}

.small-box p,
.info-box-text {
  font-weight: 600;
}

.small-box:hover {
  text-decoration: none;
}

.bg-purple {
  background-color: #6f42c1 !important;
}

.dashboard-hero .card-body {
  padding: 1.35rem;
}

.dashboard-progress {
  background: #e8eef5;
  border-radius: 999px;
  height: 18px;
}

.dashboard-progress .progress-bar {
  font-size: 0.75rem;
  font-weight: 800;
}

.dashboard-kpi .info-box-icon {
  border-radius: 8px;
  margin: 0.5rem;
}

.dashboard-status {
  min-height: 118px;
}

.dashboard-status .inner h3 {
  font-size: 2rem;
}

.report-page {
  padding-bottom: 24px;
}

.report-filter-card {
  margin-bottom: 18px;
}

.report-document {
  background: #fff;
  border: 1px solid var(--pknns-line);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(0, 59, 115, 0.1);
  padding: clamp(18px, 3vw, 34px);
}

.report-document-header {
  align-items: center;
  border-bottom: 3px solid var(--pknns-primary);
  display: flex;
  gap: 18px;
  margin-bottom: 22px;
  padding-bottom: 18px;
}

.report-logo {
  background: #fff;
  border: 1px solid var(--pknns-line);
  border-radius: 8px;
  height: 74px;
  object-fit: contain;
  padding: 8px;
  width: 92px;
}

.report-agency {
  color: var(--pknns-primary-dark);
  font-weight: 700;
}

.report-document-header h2 {
  font-size: 1.45rem;
  font-weight: 800;
  margin: 0;
}

.report-summary .info-box {
  box-shadow: none;
  border: 1px solid var(--pknns-line);
}

.report-section {
  border: 1px solid var(--pknns-line);
  border-radius: 8px;
  margin-bottom: 18px;
  overflow: hidden;
}

.report-section h3 {
  background: #f8fbfc;
  border-bottom: 1px solid var(--pknns-line);
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
  padding: 12px 14px;
}

.auth-page {
  display: flex;
  min-height: 100vh;
  padding: 0;
  background: linear-gradient(135deg, var(--pknns-primary-deep) 0%, var(--pknns-primary-dark) 48%, var(--pknns-primary) 100%);
}

.auth-wrapper {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(360px, 1.1fr);
  min-height: 100vh;
  width: 100%;
}

.auth-info {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(6, 43, 85, 0.94), rgba(0, 91, 150, 0.86)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.13'%3E%3Cpath d='M0 45h180M0 90h180M0 135h180M45 0v180M90 0v180M135 0v180'/%3E%3Ccircle cx='90' cy='90' r='36'/%3E%3C/g%3E%3C/svg%3E");
  color: #fff;
  justify-content: center;
  padding: 48px;
}

.auth-info > div {
  max-width: 460px;
}

.auth-info h1 {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.15;
  margin: 1rem 0;
}

.auth-info p,
.auth-info li {
  color: rgba(255, 255, 255, 0.82);
  font-size: 1rem;
}

.auth-info li {
  margin-bottom: 0.75rem;
}

.auth-brand-mark {
  align-items: center;
  background: #fff;
  border-radius: 8px;
  color: var(--pknns-primary-dark);
  box-shadow: inset 0 -5px 0 rgba(215, 25, 32, 0.16);
  display: flex;
  font-size: 1.2rem;
  font-weight: 800;
  height: 56px;
  justify-content: center;
  width: 56px;
}

.auth-form-panel .text-white {
  color: var(--pknns-ink) !important;
}

.auth-form-panel .text-white-50 {
  color: var(--pknns-muted) !important;
}

.auth-form-panel {
  align-items: center;
  background: rgba(238, 243, 246, 0.9);
  display: flex;
  justify-content: center;
  padding: 32px;
}

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

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

.auth-card .card {
  border-radius: 8px;
  border: 0;
  box-shadow: 0 22px 55px rgba(0, 59, 115, 0.16);
  overflow: hidden;
}

.auth-logo {
  color: #fff;
  font-size: 1.9rem;
  font-weight: 800;
  margin-bottom: 1rem;
  text-align: center;
}

.auth-subtitle {
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 1.4rem;
  text-align: center;
}

.text-white-50 {
  color: rgba(255, 255, 255, 0.72) !important;
}

.d-none[aria-hidden="true"] {
  display: none !important;
}

.badge-status {
  border-radius: 999px;
  font-weight: 700;
  padding: 0.38rem 0.62rem;
  white-space: normal;
}

.aduan-detail-header {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.aduan-detail-title {
  min-width: 0;
}

.aduan-detail-title .card-title {
  float: none;
  font-size: 1.08rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.aduan-detail-actions {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}

.aduan-action-row {
  align-items: center;
  display: flex;
  gap: 10px;
}

.aduan-action-row > .btn,
.aduan-action-row > form {
  flex: 1 1 0;
}

.aduan-action-row .btn {
  width: 100%;
}

.aduan-delete-form {
  margin: 0;
}

.aduan-delete-form .btn {
  background: #fff;
}

.status-dihantar { background: #e0f2fe; color: #075985; }
.status-diterima { background: #dbeafe; color: #1e40af; }
.status-dalam-tindakan { background: #fef3c7; color: #92400e; }
.status-menunggu-maklumat { background: #ede9fe; color: #5b21b6; }
.status-selesai { background: #dcfce7; color: #166534; }
.status-ditutup { background: #e5e7eb; color: #374151; }
.status-ditolak { background: #fee2e2; color: #991b1b; }
.status-batal { background: #f3f4f6; color: #4b5563; }

.print-only {
  display: none;
}

/* Public Aduan Awam page */
.public-page {
  background: var(--pknns-primary-deep);
  color: var(--pknns-ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.public-site {
  background:
    linear-gradient(180deg, rgba(6, 43, 85, 0.9) 0%, rgba(0, 91, 150, 0.76) 42%, rgba(243, 247, 251, 0.88) 100%),
    var(--public-bg-image);
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  min-height: 100vh;
}

.public-hero {
  background:
    linear-gradient(135deg, rgba(6, 43, 85, 0.2), rgba(0, 91, 150, 0.08)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.12'%3E%3Cpath d='M0 45h180M0 90h180M0 135h180M45 0v180M90 0v180M135 0v180'/%3E%3Ccircle cx='90' cy='90' r='34'/%3E%3C/g%3E%3C/svg%3E");
  background-position: center, center;
  background-size: cover, 180px 180px;
  color: #fff;
  padding: 24px 0 96px;
}

.public-nav {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 72px;
}

.public-brand {
  align-items: center;
  color: #fff;
  display: inline-flex;
  gap: 12px;
}

.public-brand:hover {
  color: #fff;
  text-decoration: none;
}

.public-brand span {
  align-items: center;
  background: #fff;
  border-radius: 8px;
  box-shadow: inset 0 -5px 0 rgba(215, 25, 32, 0.16);
  display: inline-flex;
  height: 50px;
  justify-content: center;
  padding: 6px 8px;
  width: 58px;
}

.public-brand img {
  display: block;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.public-brand strong {
  font-size: 1.05rem;
}

.public-kicker {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 18px;
  padding: 8px 14px;
  text-transform: uppercase;
}

.public-hero h1 {
  font-size: clamp(2.1rem, 5vw, 4.2rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.05;
  margin-bottom: 20px;
}

.public-hero p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.08rem;
  line-height: 1.7;
}

.public-summary-card {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.12);
  padding: 28px;
}

.public-summary-card i {
  align-items: center;
  background: var(--pknns-yellow);
  border-radius: 8px;
  color: #111827;
  display: inline-flex;
  font-size: 1.6rem;
  height: 56px;
  justify-content: center;
  margin-bottom: 20px;
  width: 56px;
}

.public-summary-card h2 {
  color: #fff;
  font-size: 1.45rem;
  font-weight: 800;
}

.public-summary-card h2 span {
  color: var(--pknns-yellow);
}

.public-form-section {
  margin-top: -56px;
  padding-bottom: 64px;
}

.public-form-card {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 8px;
  backdrop-filter: blur(6px);
  box-shadow: 0 20px 60px rgba(0, 59, 115, 0.14);
  padding: clamp(24px, 4vw, 48px);
}

.public-intro {
  border-bottom: 1px solid var(--pknns-line);
  margin-bottom: 28px;
  padding-bottom: 24px;
}

.public-intro h2 {
  font-size: 1.8rem;
  font-weight: 800;
}

.public-form-logo {
  background: #fff;
  border: 1px solid var(--pknns-line);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(0, 59, 115, 0.08);
  display: block;
  height: 76px;
  margin: 0 auto 16px;
  object-fit: contain;
  padding: 8px 10px;
  width: 96px;
}

.public-intro p {
  color: #475569;
  line-height: 1.7;
  margin: 0 auto;
  max-width: 920px;
}

.public-form-card label {
  font-size: 1rem;
  padding-top: 10px;
}

.public-form-card label span {
  color: var(--pknns-red);
}

.public-form-card .form-control {
  background: #f3f4f6;
  border: 1px solid #eef2f7;
  min-height: 46px;
}

.public-form-card textarea.form-control {
  min-height: 150px;
}

.public-submit-btn {
  border: 0;
  border-radius: 999px;
  box-shadow: 0 10px 20px rgba(255, 210, 31, 0.3);
  font-weight: 800;
  min-width: 132px;
  padding: 12px 28px;
}

.public-captcha {
  align-items: center;
  display: flex;
  gap: 12px;
}

.public-captcha-question {
  align-items: center;
  background: #eaf2f8;
  border: 1px solid var(--pknns-line);
  border-radius: 8px;
  color: var(--pknns-primary-dark);
  display: inline-flex;
  font-size: 1.15rem;
  font-weight: 800;
  min-height: 46px;
  padding: 0 16px;
  white-space: nowrap;
}

.public-captcha .form-control {
  max-width: 180px;
}

.public-form-alert {
  border: 0;
  border-radius: 8px;
  font-weight: 700;
}

.public-submit-btn:disabled {
  cursor: wait;
  opacity: 0.82;
}

@media (max-width: 575.98px) {
  .auth-wrapper {
    display: block;
    min-height: 100vh;
  }

  .auth-form-panel {
    background: linear-gradient(180deg, var(--pknns-primary-dark) 0%, #f3f7fb 38%, #f3f7fb 100%);
    min-height: 100vh;
    padding: 28px 18px;
  }

  .auth-form-panel .text-white {
    color: #fff !important;
  }

  .auth-form-panel .text-white-50 {
    color: rgba(255, 255, 255, 0.78) !important;
  }

  .auth-card {
    width: 100%;
  }

  .auth-card .card {
    box-shadow: 0 18px 45px rgba(0, 59, 115, 0.18);
  }

  .content-header h1 {
    font-size: 1.2rem;
  }

  .report-document-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .report-logo {
    height: 64px;
    width: 82px;
  }

  .report-document {
    padding: 16px;
  }

  .aduan-detail-header,
  .aduan-detail-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .aduan-action-row {
    flex-direction: column;
  }

  .aduan-action-row > .btn,
  .aduan-action-row > form {
    width: 100%;
  }

  .table-responsive {
    border: 0;
  }

  .btn-group.btn-block .btn {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .public-hero {
    padding-bottom: 72px;
  }

  .public-site {
    background-attachment: scroll;
  }

  .public-nav {
    margin-bottom: 42px;
  }

  .public-brand strong {
    font-size: 0.95rem;
  }

  .public-form-section {
    margin-top: -40px;
  }

  .public-form-card {
    border-radius: 8px;
    padding: 22px;
  }

  .public-form-card label {
    padding-top: 0;
  }

  .public-captcha {
    align-items: stretch;
    flex-direction: column;
  }

  .public-captcha .form-control {
    max-width: none;
  }
}

@media print {
  .no-print,
  .main-sidebar,
  .main-header,
  .content-header {
    display: none !important;
  }

  .content-wrapper {
    background: #fff;
    margin: 0 !important;
  }

  .card,
  .info-box,
  .small-box {
    box-shadow: none;
  }

  .report-document {
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .report-section {
    break-inside: avoid;
  }

  .print-only {
    display: block;
  }
}
