/* ========================================================================
   Nirwana Residence — Website Polish v9.4.19
   SCOPE TERKUNCI: browser/desktop website saja (>= 992px, non-standalone PWA).
   1) Kegiatan Aktif & Undangan Baru tanpa horizontal scroll.
   2) Dropdown profile desktop proporsional dan usable.
   ======================================================================== */

@media (min-width: 992px) {
  /* ---------------------------------------------------------------------
     WEBSITE — Kegiatan Aktif & Undangan Baru
     Root cause: wrapper responsive + width aksi 360px memaksa table melebihi
     container. Di desktop tabel sekarang selalu mengikuti lebar card.
     --------------------------------------------------------------------- */
  html:not(.pwa-standalone) .nr-activities-desktop .nr-activity-section-card.is-active-section {
    overflow: hidden !important;
    border-radius: 18px !important;
  }

  html:not(.pwa-standalone) .nr-activities-desktop .nr-activity-section-card.is-active-section > .card-header {
    padding: 18px 20px !important;
    border-bottom: 1px solid rgba(31, 41, 55, .07) !important;
  }

  html:not(.pwa-standalone) .nr-activities-desktop .nr-activity-section-card.is-active-section > .card-body.table-responsive {
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px 14px 14px !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
  }

  html:not(.pwa-standalone) .nr-activities-desktop .nr-activity-section-card.is-active-section table {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    border-collapse: separate !important;
    border-spacing: 0 8px !important;
    margin: 0 !important;
  }

  html:not(.pwa-standalone) .nr-activities-desktop .nr-activity-section-card.is-active-section thead th {
    padding: 8px 10px 6px !important;
    border: 0 !important;
    background: transparent !important;
    color: #8a817b !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    letter-spacing: .045em !important;
    text-transform: uppercase !important;
    white-space: normal !important;
  }

  html:not(.pwa-standalone) .nr-activities-desktop .nr-activity-section-card.is-active-section thead th:nth-child(1) { width: 15% !important; }
  html:not(.pwa-standalone) .nr-activities-desktop .nr-activity-section-card.is-active-section thead th:nth-child(2) { width: 27% !important; }
  html:not(.pwa-standalone) .nr-activities-desktop .nr-activity-section-card.is-active-section thead th:nth-child(3) { width: 17% !important; }
  html:not(.pwa-standalone) .nr-activities-desktop .nr-activity-section-card.is-active-section thead th:nth-child(4) { width: 18% !important; }
  html:not(.pwa-standalone) .nr-activities-desktop .nr-activity-section-card.is-active-section thead th:nth-child(5) { width: 23% !important; }

  html:not(.pwa-standalone) .nr-activities-desktop .nr-activity-section-card.is-active-section tbody tr.nr-activity-row > td {
    min-width: 0 !important;
    padding: 13px 10px !important;
    vertical-align: middle !important;
    border-top: 1px solid rgba(31, 41, 55, .065) !important;
    border-bottom: 1px solid rgba(31, 41, 55, .065) !important;
    background: #fff !important;
    color: #403a36 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  html:not(.pwa-standalone) .nr-activities-desktop .nr-activity-section-card.is-active-section tbody tr.nr-activity-row > td:first-child {
    border-left: 1px solid rgba(31, 41, 55, .065) !important;
    border-radius: 12px 0 0 12px !important;
    font-variant-numeric: tabular-nums !important;
  }

  html:not(.pwa-standalone) .nr-activities-desktop .nr-activity-section-card.is-active-section tbody tr.nr-activity-row > td:last-child {
    border-right: 1px solid rgba(31, 41, 55, .065) !important;
    border-radius: 0 12px 12px 0 !important;
  }

  html:not(.pwa-standalone) .nr-activities-desktop .nr-activity-section-card.is-active-section tbody tr.nr-activity-row:hover > td {
    background: #fffaf7 !important;
    border-top-color: rgba(238, 77, 45, .13) !important;
    border-bottom-color: rgba(238, 77, 45, .13) !important;
  }

  html:not(.pwa-standalone) .nr-activities-desktop .nr-activity-section-card.is-active-section .nr-activity-status-stack {
    min-width: 0 !important;
    max-width: 100% !important;
    align-items: flex-start !important;
  }

  html:not(.pwa-standalone) .nr-activities-desktop .nr-activity-section-card.is-active-section .nr-activity-status,
  html:not(.pwa-standalone) .nr-activities-desktop .nr-activity-section-card.is-active-section .nr-activity-recipient-count {
    max-width: 100% !important;
    white-space: normal !important;
    line-height: 1.25 !important;
  }

  html:not(.pwa-standalone) .nr-activities-desktop .nr-activity-section-card.is-active-section tbody tr.nr-activity-row > td:last-child > a,
  html:not(.pwa-standalone) .nr-activities-desktop .nr-activity-section-card.is-active-section tbody tr.nr-activity-row > td:last-child > form {
    margin: 2px 3px 2px 0 !important;
    vertical-align: middle !important;
  }

  html:not(.pwa-standalone) .nr-activities-desktop .nr-activity-section-card.is-active-section tbody tr.nr-activity-row > td:last-child .btn,
  html:not(.pwa-standalone) .nr-activities-desktop .nr-activity-section-card.is-active-section tbody tr.nr-activity-row > td:last-child > .btn {
    max-width: 100% !important;
    padding: .42rem .58rem !important;
    border-radius: 9px !important;
    line-height: 1.15 !important;
    white-space: normal !important;
  }

  /* ---------------------------------------------------------------------
     WEBSITE — Profile dropdown
     Root cause: summary avatar di dropdown tidak memiliki constraint desktop,
     sehingga foto memakai ukuran natural dan mendorong item Logout keluar.
     --------------------------------------------------------------------- */
  html:not(.pwa-standalone) #nr-pwa-profile-menu {
    position: relative !important;
  }

  html:not(.pwa-standalone) #nr-pwa-profile-menu > #nr-pwa-profile-panel {
    z-index: 2060 !important;
    top: calc(100% + 10px) !important;
    right: 0 !important;
    left: auto !important;
    width: 310px !important;
    min-width: 280px !important;
    max-width: calc(100vw - 32px) !important;
    margin: 0 !important;
    padding: 8px !important;
    overflow: hidden !important;
    border: 1px solid rgba(65, 52, 43, .10) !important;
    border-radius: 16px !important;
    background: #fff !important;
    box-shadow: 0 18px 44px rgba(43, 34, 29, .18) !important;
  }

  html:not(.pwa-standalone) #nr-pwa-profile-menu > #nr-pwa-profile-panel.show {
    display: block !important;
  }

  html:not(.pwa-standalone) #nr-pwa-profile-panel .nr-pwa-profile-summary {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 0 7px !important;
    padding: 12px !important;
    display: flex !important;
    align-items: center !important;
    gap: 11px !important;
    overflow: hidden !important;
    border: 1px solid rgba(238, 77, 45, .09) !important;
    border-radius: 13px !important;
    background: linear-gradient(135deg, #fffaf7 0%, #fff 72%) !important;
  }

  html:not(.pwa-standalone) #nr-pwa-profile-panel .nr-pwa-profile-summary > img {
    width: 50px !important;
    height: 50px !important;
    min-width: 50px !important;
    min-height: 50px !important;
    max-width: 50px !important;
    max-height: 50px !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 0 0 50px !important;
    display: block !important;
    border: 2px solid rgba(238, 77, 45, .22) !important;
    border-radius: 50% !important;
    background: #f8f5f2 !important;
    object-fit: cover !important;
    object-position: center !important;
  }

  html:not(.pwa-standalone) #nr-pwa-profile-panel .nr-pwa-profile-summary > div {
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  html:not(.pwa-standalone) #nr-pwa-profile-panel .nr-pwa-profile-summary strong,
  html:not(.pwa-standalone) #nr-pwa-profile-panel .nr-pwa-profile-summary small {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  html:not(.pwa-standalone) #nr-pwa-profile-panel .nr-pwa-profile-summary strong {
    color: #342d29 !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
  }

  html:not(.pwa-standalone) #nr-pwa-profile-panel .nr-pwa-profile-summary small {
    margin-top: 4px !important;
    color: #8a7c73 !important;
    font-size: 11px !important;
    line-height: 1.25 !important;
  }

  html:not(.pwa-standalone) #nr-pwa-profile-panel .dropdown-title {
    margin: 2px 2px 4px !important;
    padding: 7px 9px 5px !important;
    color: #9b8d84 !important;
    font-size: 9px !important;
    font-weight: 800 !important;
    letter-spacing: .08em !important;
    text-transform: uppercase !important;
    white-space: normal !important;
  }

  html:not(.pwa-standalone) #nr-pwa-profile-panel .dropdown-item {
    min-height: 42px !important;
    margin: 2px 0 !important;
    padding: 10px 11px !important;
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    border-radius: 10px !important;
    color: #514943 !important;
    font-size: 12px !important;
    font-weight: 650 !important;
    line-height: 1.2 !important;
    white-space: normal !important;
  }

  html:not(.pwa-standalone) #nr-pwa-profile-panel .dropdown-item i {
    width: 18px !important;
    min-width: 18px !important;
    margin: 0 !important;
    text-align: center !important;
  }

  html:not(.pwa-standalone) #nr-pwa-profile-panel .dropdown-item:hover,
  html:not(.pwa-standalone) #nr-pwa-profile-panel .dropdown-item:focus {
    background: #f8f5f2 !important;
    color: #332d29 !important;
  }

  html:not(.pwa-standalone) #nr-pwa-profile-panel .dropdown-item.text-danger:hover,
  html:not(.pwa-standalone) #nr-pwa-profile-panel .dropdown-item.text-danger:focus {
    background: #fff3f2 !important;
    color: #c93d34 !important;
  }

  html:not(.pwa-standalone) #nr-pwa-profile-panel .dropdown-divider {
    margin: 6px 4px !important;
    border-top-color: rgba(65, 52, 43, .08) !important;
  }
}

/* Website desktop sempit: tetap tanpa horizontal scroll. */
@media (min-width: 992px) and (max-width: 1199.98px) {
  html:not(.pwa-standalone) .nr-activities-desktop .nr-activity-section-card.is-active-section thead th:nth-child(1) { width: 16% !important; }
  html:not(.pwa-standalone) .nr-activities-desktop .nr-activity-section-card.is-active-section thead th:nth-child(2) { width: 26% !important; }
  html:not(.pwa-standalone) .nr-activities-desktop .nr-activity-section-card.is-active-section thead th:nth-child(3) { width: 16% !important; }
  html:not(.pwa-standalone) .nr-activities-desktop .nr-activity-section-card.is-active-section thead th:nth-child(4) { width: 18% !important; }
  html:not(.pwa-standalone) .nr-activities-desktop .nr-activity-section-card.is-active-section thead th:nth-child(5) { width: 24% !important; }

  html:not(.pwa-standalone) .nr-activities-desktop .nr-activity-section-card.is-active-section thead th,
  html:not(.pwa-standalone) .nr-activities-desktop .nr-activity-section-card.is-active-section tbody tr.nr-activity-row > td {
    padding-left: 7px !important;
    padding-right: 7px !important;
    font-size: 12px !important;
  }

  html:not(.pwa-standalone) .nr-activities-desktop .nr-activity-section-card.is-active-section tbody tr.nr-activity-row > td:last-child .btn,
  html:not(.pwa-standalone) .nr-activities-desktop .nr-activity-section-card.is-active-section tbody tr.nr-activity-row > td:last-child > .btn {
    font-size: 11px !important;
    padding: .38rem .48rem !important;
  }
}

