/* ============================================================
   e-Cuti Responsive UI Enhancements
   Scope: presentation and responsive behaviour only.
   This file is loaded after the existing page stylesheet.
   ============================================================ */

html {
  width: 100%;
  max-width: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  max-width: 100%;
  font: inherit;
}

button,
input[type="button"],
input[type="submit"],
input[type="reset"],
a.btn,
.btn-batal {
  min-height: 44px;
  touch-action: manipulation;
}

/* Keep the shared side navigation usable when the menu is long. */
.navigation {
  z-index: 1100;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.navigation ul {
  position: relative;
  min-height: 100%;
}

.navigation ul li:first-child .icon {
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: normal;
  padding: 0 8px;
}

.navigation img[alt="ITP Logo"] {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 68px;
  object-fit: contain;
}

/* Preserve the original desktop content width and position. */
.main {
  width: calc(100% - 340px);
  left: 320px;
  max-width: none;
}

/* Preserve the original collapsed content width and position. */
.main.active {
  width: calc(100% - 120px);
  left: 100px;
}

/* Extend only the header from the navigation edge to the screen edge. */
.topbar {
  position: relative;
  z-index: 30;
  width: calc(100% + 40px);
  margin-left: -20px;
  margin-bottom: 20px;
}

.toggle {
  flex: 0 0 60px;
  border-radius: 10px;
  touch-action: manipulation;
}

.cardBox {
  max-width: 100%;
}

.cardBox .card {
  min-width: 0;
}

.cardBox .card .numbers,
.cardBox .card .cardName,
.cardHeader h2,
.box .title {
  overflow-wrap: anywhere;
}

.details,
.box,
.content,
.recentOrders,
.recentCustomers {
  min-width: 0;
  max-width: 100%;
}

.details .recentOrders,
.recentOrders,
.recentCustomers {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.details table,
.recentOrders table,
.recentCustomers table {
  width: 100%;
}

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

.details table form,
.recentOrders table form {
  margin: 0;
}

.details table button,
.details table input[type="submit"],
.details table a,
.recentOrders table button,
.recentOrders table input[type="submit"],
.recentOrders table a {
  white-space: nowrap;
}

.content form .user-details {
  max-height: none;
  overflow: visible;
}

.user-details .input-box input,
.user-details .input-box select,
.user-details .input-box textarea,
.form-control {
  max-width: 100%;
}

select.form-control,
textarea.form-control,
.user-details .input-box select,
.user-details .input-box textarea {
  width: 100%;
  min-height: 45px;
  border: 1px solid #1538d7;
  border-radius: 5px;
  padding: 10px 15px;
  background: #fff;
}

form .button {
  min-height: 45px;
}

form .button input {
  max-width: 360px;
}

/* Generic protection for existing or future dialogs/pop-ups. */
.modal,
.dialog,
.popup {
  max-width: 100vw;
  max-height: 100vh;
}

.modal-content,
.dialog-content,
.popup-content {
  width: min(92vw, 720px);
  max-height: 88vh;
  overflow-y: auto;
  margin-inline: auto;
}

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1050;
  border: 0;
  background: rgba(0, 0, 0, 0.42);
  padding: 0;
  min-height: 0;
  cursor: pointer;
}

/* Login/register page */
.auth-page {
  overflow-y: auto;
}

@media (max-width: 1199px) {
  .cardBox {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
  }

  .cardBox .card {
    padding: 22px;
  }

  .cardBox .card .numbers {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
  }
}

@media (max-width: 991px) {
  body.menu-open {
    overflow: hidden;
  }

  .navigation {
    width: min(320px, 86vw);
    height: 100dvh;
    left: 0;
    transform: translateX(-105%);
    box-shadow: none;
  }

  .navigation.active {
    width: min(320px, 86vw);
    left: 0;
    transform: translateX(0);
    box-shadow: 8px 0 28px rgba(0, 0, 0, 0.28);
  }

  .main,
  .main.active {
    position: relative;
    width: 100%;
    left: 0;
    min-height: 100vh;
  }

  .nav-overlay.active {
    display: block;
  }

  .topbar {
    width: 100%;
    min-height: 60px;
    height: auto;
    margin-left: 0;
    margin-bottom: 16px;
    padding-inline: 8px;
  }

  .toggle {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
    font-size: 2rem;
  }

  .cardBox {
    padding: 16px;
  }

  .details,
  .main > .box {
    width: auto;
    margin-inline: 16px;
  }

  .details .recentOrders,
  .recentOrders,
  .recentCustomers,
  .box {
    min-height: auto;
  }

  .cardHeader {
    gap: 12px;
    flex-wrap: wrap;
  }

  .cardHeader .btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  form .user-details .input-box {
    width: 100%;
    margin-right: 0;
  }

  .content form .user-details {
    margin-right: 0;
  }

  form .category {
    width: 100%;
    gap: 12px 20px;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  form .button {
    height: auto;
    margin-block: 24px;
  }

  form .button input {
    width: min(100%, 360px);
    min-height: 48px;
    height: auto;
    padding: 14px 24px;
  }
}

@media (max-width: 768px) {
  .details,
  .main > .box {
    margin-inline: 12px;
  }

  .details .recentOrders,
  .recentOrders,
  .recentCustomers,
  .box {
    padding: 16px;
    border-radius: 14px;
  }

  .details table,
  .recentOrders table {
    min-width: 680px;
  }

  .details table td,
  .details table th,
  .recentOrders table td,
  .recentOrders table th {
    padding: 10px 8px;
  }

  .cardBox {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 12px 0;
  }

  .cardBox .card {
    padding: 18px;
    border-radius: 14px;
  }

  .box .title,
  .cardHeader h2 {
    font-size: clamp(1.15rem, 5vw, 1.5rem);
    line-height: 1.3;
  }

  .user-details .input-box input,
  .user-details .input-box select,
  .user-details .input-box textarea,
  .form-control {
    font-size: 16px;
  }

  .modal-content,
  .dialog-content,
  .popup-content {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
  }
}

@media (max-width: 584px) {
  .content form .user-details {
    max-height: none !important;
    overflow-y: visible !important;
  }

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

  .cardHeader {
    align-items: stretch;
  }

  .cardHeader .btn {
    width: 100%;
  }

  form .category {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .navigation,
  .navigation.active {
    width: min(340px, 90vw);
  }

  .navigation ul li a .title {
    white-space: normal;
    line-height: 1.25;
    height: auto;
    min-height: 60px;
    display: flex;
    align-items: center;
  }

  .details,
  .main > .box {
    margin-inline: 8px;
  }

  .details .recentOrders,
  .recentOrders,
  .recentCustomers,
  .box {
    padding: 13px;
    border-radius: 12px;
  }

  .topbar {
    margin-bottom: 12px;
    padding-inline: 4px;
  }

  .cardBox .card {
    padding: 16px;
  }

  .details table,
  .recentOrders table {
    min-width: 620px;
  }

  form .button input,
  input[type="submit"],
  button,
  .btn-batal {
    width: 100%;
  }
}

/* Authentication screen breakpoints */
@media (max-width: 892px) {
  .auth-page {
    align-items: flex-start;
    min-height: 100vh;
    padding: 12px;
  }

  .auth-page .form-container {
    width: min(100%, 480px);
    height: 680px;
    min-height: 680px;
    border-radius: 22px;
  }

  .auth-page .col-2 {
    width: 100%;
    padding: 14px;
  }

  .auth-page .login-form,
  .auth-page .register-form {
    padding-inline: 20px;
  }

  .auth-page .form-title {
    margin: 30px 0 24px;
    font-size: clamp(1.75rem, 8vw, 2.2rem);
    text-align: center;
  }

  .auth-page .register-form .form-title {
    margin-block: 18px 8px;
  }
}

@media (max-width: 420px) {
  .auth-page {
    padding: 8px;
  }

  .auth-page .form-container {
    width: 100%;
    border-width: 2px;
    border-radius: 18px;
  }

  .auth-page .col-2 {
    padding: 10px;
  }

  .auth-page .login-form,
  .auth-page .register-form {
    padding-inline: 10px;
  }

  .auth-page .btn-box {
    gap: 6px;
  }

  .auth-page .btn {
    padding-inline: 18px;
  }
}

/* ============================================================
   Login page: keep ITP branding visible on tablet and mobile
   ============================================================ */
@media (max-width: 892px) {
  .auth-page {
    align-items: center;
    justify-content: center;
    padding: 16px;
  }

  .auth-page .form-container {
    display: flex;
    flex-direction: column;
    width: min(100%, 520px);
    height: auto;
    min-height: 720px;
    overflow: hidden;
  }

  .auth-page .col-1 {
    display: flex;
    flex: 0 0 auto;
    width: 100%;
    min-height: 270px;
    padding: 24px 20px 20px;
    border-radius: 0 0 24% 24%;
  }

  .auth-page .image-layer {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
  }

  .auth-page .form-image-main {
    display: block;
    width: min(78%, 340px);
    max-width: 100%;
    height: auto;
  }

  .auth-page .featured-words {
    width: 100%;
    max-width: 420px;
    margin-top: 8px;
    font-size: clamp(1.15rem, 4.5vw, 1.55rem);
    line-height: 1.25;
    animation: auth-welcome-pulse 3s ease-in-out alternate infinite;
  }

  .auth-page .featured-words span {
    display: block;
    margin-top: 2px;
    font-size: clamp(2rem, 8vw, 3.2rem);
    line-height: 1.08;
  }

  .auth-page .col-2 {
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    min-height: 410px;
    padding: 10px 24px 24px;
    overflow: hidden;
  }

  .auth-page .login-form,
  .auth-page .register-form {
    padding-inline: clamp(8px, 4vw, 28px);
  }

  .auth-page .form-title {
    margin: 22px 0 18px;
  }
}

@media (max-width: 480px) {
  .auth-page {
    align-items: flex-start;
    padding: 8px;
  }

  .auth-page .form-container {
    min-height: 680px;
    border-radius: 18px;
  }

  .auth-page .col-1 {
    min-height: 235px;
    padding: 18px 14px 14px;
    border-radius: 0 0 20% 20%;
  }

  .auth-page .form-image-main {
    width: min(84%, 285px);
  }

  .auth-page .featured-words {
    margin-top: 4px;
    font-size: clamp(1rem, 5vw, 1.25rem);
  }

  .auth-page .featured-words span {
    font-size: clamp(1.75rem, 10vw, 2.65rem);
  }

  .auth-page .col-2 {
    min-height: 390px;
    padding: 8px 14px 20px;
  }

  .auth-page .form-title {
    margin: 18px 0 14px;
    font-size: clamp(1.65rem, 9vw, 2rem);
  }
}

@keyframes auth-welcome-pulse {
  from {
    opacity: 0.86;
    transform: translateY(2px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(-2px) scale(1.02);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-page .featured-words {
    animation: none;
  }
}

/* ============================================================
   Shared notification header and dropdown
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 900;
  min-height: 64px;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid rgba(42, 33, 133, 0.12);
  box-shadow: 0 4px 18px rgba(34, 34, 34, 0.07);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.notification-center {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
}

.notification-toggle {
  position: relative;
  width: 46px;
  min-width: 46px;
  height: 46px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(42, 33, 133, 0.2);
  border-radius: 50%;
  background: var(--white, #fff);
  color: var(--blue, #2a2185);
  box-shadow: 0 5px 15px rgba(42, 33, 133, 0.12);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  touch-action: manipulation;
}

.notification-toggle ion-icon {
  font-size: 1.55rem;
  pointer-events: none;
}

.notification-toggle:hover,
.notification-toggle:focus-visible,
.notification-toggle.active {
  background: var(--blue, #2a2185);
  color: var(--white, #fff);
  box-shadow: 0 7px 20px rgba(42, 33, 133, 0.25);
  transform: translateY(-1px);
  outline: none;
}

.notification-toggle:focus-visible {
  outline: 3px solid rgba(42, 33, 133, 0.2);
  outline-offset: 3px;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -3px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}

.notification-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(380px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 92px));
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top right;
  border: 1px solid rgba(42, 33, 133, 0.14);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(20, 20, 45, 0.2);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.notification-dropdown.active {
  visibility: visible;
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.notification-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #2a2185, #4439a8);
  color: #fff;
}

.notification-dropdown-header h2 {
  margin: 0;
  color: #fff;
  font-size: 1.18rem;
  line-height: 1.2;
}

.notification-dropdown-header p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.82rem;
}

.notification-dropdown-header > ion-icon {
  flex: 0 0 auto;
  font-size: 2rem;
}

.notification-list {
  max-height: 440px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.notification-item {
  display: flex;
  gap: 13px;
  padding: 16px 18px;
  border-bottom: 1px solid #ececf4;
  background: #fff;
  transition: background-color 0.2s ease;
}

.notification-item:last-child {
  border-bottom: 0;
}

.notification-item:hover {
  background: #f7f7fc;
}

.notification-item-icon {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(42, 33, 133, 0.1);
  color: var(--blue, #2a2185);
}

.notification-item-icon ion-icon {
  font-size: 1.35rem;
}

.notification-item-content {
  min-width: 0;
  flex: 1 1 auto;
}

.notification-item-content h3 {
  margin: 0 0 5px;
  color: #222;
  font-size: 0.93rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.notification-item-content p {
  margin: 0;
  color: #606070;
  font-size: 0.82rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.notification-item-content time {
  display: block;
  margin-top: 7px;
  color: #8b8b99;
  font-size: 0.72rem;
}

.notification-empty {
  padding: 36px 24px;
  text-align: center;
  color: #737382;
}

.notification-empty ion-icon {
  font-size: 3rem;
  color: #aaaabd;
}

.notification-empty h3 {
  margin: 10px 0 6px;
  color: #333342;
  font-size: 1rem;
}

.notification-empty p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
}

@media (max-width: 991px) {
  .topbar {
    padding-inline: 10px 14px;
  }

  .notification-dropdown {
    right: 0;
  }
}

@media (max-width: 480px) {
  .topbar {
    min-height: 60px;
    padding-inline: 4px 8px;
  }

  .notification-toggle {
    width: 42px;
    min-width: 42px;
    height: 42px;
  }

  .notification-toggle ion-icon {
    font-size: 1.4rem;
  }

  .notification-dropdown {
    position: fixed;
    top: 68px;
    left: 8px;
    right: 8px;
    width: auto;
    max-height: calc(100vh - 80px);
    transform-origin: top center;
  }

  .notification-dropdown-header {
    padding: 15px 16px;
  }

  .notification-list {
    max-height: calc(100vh - 160px);
  }

  .notification-item {
    gap: 11px;
    padding: 14px;
  }

  .notification-item-icon {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .notification-toggle,
  .notification-dropdown,
  .notification-item {
    transition: none;
  }
}

/* Align the desktop notification control with the content box right edge. */
@media (min-width: 992px) {
  .topbar .notification-center {
    margin-right: 10px;
  }
}


/* Database-backed notification states (v3.2). */
.notification-item-form { margin: 0; }
.notification-item { width: 100%; border: 0; text-align: left; cursor: pointer; font: inherit; }
.notification-item.unread { background: #f1f0ff; box-shadow: inset 4px 0 0 var(--blue, #2a2185); }
.notification-item.read { background: #fff; }
.notification-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.notification-title-row h3 { flex: 1 1 auto; }
.notification-title-row small { flex: 0 0 auto; padding: 2px 7px; border-radius: 999px; background: #fff3cd; color: #7a5700; font-size: .65rem; font-weight: 700; }


/* Header notification + profile controls (v3.3). */
.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.header-actions .notification-center,
.profile-center {
  position: relative;
  flex: 0 0 auto;
}

.header-actions .notification-center {
  margin-left: 0;
}

/* Keep the profile trigger visually identical to the notification bell. */
.profile-toggle {
  position: relative;
  width: 46px;
  min-width: 46px;
  height: 46px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(42, 33, 133, 0.2);
  border-radius: 50%;
  background: var(--white, #fff);
  color: var(--blue, #2a2185);
  box-shadow: 0 5px 15px rgba(42, 33, 133, 0.12);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  touch-action: manipulation;
}

.profile-toggle ion-icon {
  font-size: 1.55rem;
  pointer-events: none;
}

.profile-toggle:hover,
.profile-toggle:focus-visible,
.profile-toggle.active {
  background: var(--blue, #2a2185);
  color: var(--white, #fff);
  box-shadow: 0 7px 20px rgba(42, 33, 133, 0.25);
  transform: translateY(-1px);
  outline: none;
}

.profile-toggle:focus-visible {
  outline: 3px solid rgba(42, 33, 133, 0.2);
  outline-offset: 3px;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(340px, calc(100vw - 32px));
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top right;
  border: 1px solid rgba(42, 33, 133, 0.13);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(20, 20, 45, 0.22);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 1001;
}

.profile-dropdown.active {
  visibility: visible;
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.profile-dropdown-header {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #2a2185, #4439a8);
  color: #fff;
}

.profile-avatar {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.profile-avatar ion-icon {
  font-size: 1.5rem;
}

.profile-heading {
  min-width: 0;
}

.profile-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-heading h2 {
  margin: 0;
  color: #fff;
  font-size: 1.05rem;
  line-height: 1.25;
}

.profile-dropdown-content {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  background: #fff;
}

.profile-detail-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
}

.profile-detail-row + .profile-detail-row {
  border-top: 1px solid #ececf4;
}

.profile-detail-icon {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: rgba(42, 33, 133, 0.09);
  color: var(--blue, #2a2185);
}

.profile-detail-icon ion-icon {
  font-size: 1.15rem;
}

.profile-detail-copy {
  min-width: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.profile-detail-label {
  color: #8a8a98;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.profile-detail-copy strong {
  max-width: 100%;
  color: #252535;
  font-size: 0.94rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.profile-role-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(42, 33, 133, 0.09);
  color: var(--blue, #2a2185);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

@media (max-width: 480px) {
  .header-actions {
    gap: 4px;
  }

  .profile-toggle {
    width: 42px;
    min-width: 42px;
    height: 42px;
  }

  .profile-toggle ion-icon {
    font-size: 1.4rem;
  }

  .profile-dropdown {
    position: fixed;
    top: 68px;
    left: 8px;
    right: 8px;
    width: auto;
    transform-origin: top center;
  }

  .profile-dropdown-header {
    padding: 16px;
  }

  .profile-detail-row {
    padding: 13px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-toggle,
  .profile-dropdown {
    transition: none;
  }
}

@media (min-width: 992px) {
  .topbar .header-actions {
    margin-right: 10px;
  }

  .topbar .header-actions .notification-center {
    margin-right: 0;
  }
}


/* v3.3 cancellation action buttons: slightly more compact without changing behavior */
.btn-batal-lulus,
.btn-batal-tolak {
  min-height: 40px;
  padding: 8px 16px;
  font-size: 14px;
}

/* Profile account actions: account-related navigation lives in the header dropdown. */
.profile-dropdown-actions {
  padding: 8px;
  border-top: 1px solid #ececf4;
  background: #fafafe;
}

.profile-action-link {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 11px;
  border-radius: 12px;
  color: #29293a;
  text-decoration: none;
  transition: background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.profile-action-link + .profile-action-link {
  margin-top: 4px;
}

.profile-action-link:hover,
.profile-action-link:focus-visible {
  background: #fff;
  box-shadow: 0 7px 18px rgba(32, 29, 82, .08);
  transform: translateY(-1px);
  outline: none;
}

.profile-action-link:focus-visible {
  box-shadow: 0 0 0 3px rgba(42, 33, 133, .15), 0 7px 18px rgba(32, 29, 82, .08);
}

.profile-action-icon {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: rgba(42, 33, 133, .09);
  color: var(--blue, #2a2185);
}

.profile-action-icon ion-icon {
  font-size: 1.15rem;
}

.profile-action-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-action-copy strong {
  color: inherit;
  font-size: .88rem;
  line-height: 1.25;
}

.profile-action-copy small {
  color: #858594;
  font-size: .7rem;
  line-height: 1.3;
}

.profile-action-chevron {
  flex: 0 0 auto;
  color: #aaaab7;
  font-size: 1rem;
}

.profile-action-logout {
  color: #b42318;
}

.profile-action-logout .profile-action-icon {
  background: #fff0ef;
  color: #c92a24;
}

.profile-action-logout:hover,
.profile-action-logout:focus-visible {
  background: #fff6f5;
}

@media (max-width: 480px) {
  .profile-dropdown-actions {
    padding: 7px;
  }

  .profile-action-link {
    min-height: 56px;
    padding: 9px 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-action-link {
    transition: none;
  }
}


/* =========================================================
   Shared searchable/paginated table UX
   ========================================================= */
.ec-list-filters {
    margin: 18px 0 20px;
    padding: 18px;
    border: 1px solid #e5e7ef;
    border-radius: 14px;
    background: linear-gradient(135deg, #ffffff 0%, #fafaff 100%);
    box-shadow: 0 8px 24px rgba(35, 28, 112, 0.06);
}
.ec-list-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 14px;
}
.ec-list-filter-field { min-width: 0; }
.ec-list-filter-field label {
    display: block;
    margin: 0 0 7px;
    color: #27233f;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .035em;
    text-transform: uppercase;
}
.ec-list-filter-field input,
.ec-list-filter-field select {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid #d9dbea;
    border-radius: 9px;
    outline: none;
    background: #fff;
    color: #242238;
    font: inherit;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.ec-list-filter-field input:focus,
.ec-list-filter-field select:focus {
    border-color: #2f268b;
    box-shadow: 0 0 0 3px rgba(47,38,139,.10);
}
.ec-list-select-wrap { position: relative; }
.ec-list-select-wrap select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 36px;
}
.ec-list-select-wrap ion-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #625e7d;
    font-size: 16px;
}
.ec-list-filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}
.ec-list-search-btn,
.ec-list-reset-btn {
    min-height: 40px;
    padding: 9px 16px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.ec-list-search-btn {
    border: 1px solid #2f268b;
    background: #2f268b;
    color: #fff;
    box-shadow: 0 6px 14px rgba(47,38,139,.18);
}
.ec-list-reset-btn {
    border: 1px solid #d9dbea;
    background: #fff;
    color: #4c4864;
}
.ec-list-search-btn:hover,
.ec-list-reset-btn:hover { transform: translateY(-1px); }
.ec-list-search-btn:hover { background: #241b75; }
.ec-list-reset-btn:hover { background: #f7f7fb; }

/* Existing table cards become safe horizontal scroll containers on smaller screens. */
.recentOrders { overflow: visible; }
.recentOrders > .cardHeader,
.recentOrders > .ec-list-filters,
.recentOrders > .ec-list-pagination,
.recentOrders > .daftar-staf-container { min-width: 0; }

/* Dedicated table viewport supports both horizontal scrolling and a reliable sticky header. */
.ec-table-scroll {
    width: 100%;
    max-height: 62vh;
    overflow: auto;
    overscroll-behavior: contain;
    border-radius: 10px;
    scrollbar-gutter: stable;
}
.ec-table-scroll table { margin-top: 0; }
.ec-table-scroll table thead td,
.ec-table-scroll table thead th {
    position: sticky;
    top: 0;
    z-index: 6;
    background: #fff;
    box-shadow: inset 0 -1px 0 #e6e6ed, 0 5px 10px rgba(30, 27, 70, .035);
}

.ec-list-pagination {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #ececf2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.ec-list-count {
    color: #6a667e;
    font-size: 13px;
}
.ec-list-count strong { color: #292543; }
.ec-pagination-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.ec-page-link,
.ec-page-ellipsis {
    min-width: 34px;
    height: 34px;
    padding: 0 9px;
    border: 1px solid #dedfeb;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    background: #fff;
    color: #3b3658;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}
.ec-page-link:hover { border-color: #aaa6d0; background: #f7f6ff; }
.ec-page-link.is-active {
    border-color: #2f268b;
    background: #2f268b;
    color: #fff;
    box-shadow: 0 5px 12px rgba(47,38,139,.18);
}
.ec-page-link.is-disabled { opacity: .42; cursor: not-allowed; }
.ec-page-direction { gap: 4px; }
.ec-page-ellipsis { border-color: transparent; background: transparent; }

@media (max-width: 1100px) {
    .ec-list-filter-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
}
@media (max-width: 600px) {
    .ec-list-filters { padding: 14px; border-radius: 12px; }
    .ec-list-filter-grid { grid-template-columns: 1fr; gap: 11px; }
    .ec-list-filter-actions { justify-content: stretch; }
    .ec-list-search-btn,
    .ec-list-reset-btn { flex: 1 1 0; }
    .ec-list-pagination { align-items: stretch; }
    .ec-list-count { width: 100%; text-align: center; }
    .ec-pagination-nav { width: 100%; justify-content: center; }
    .ec-page-direction span { display: none; }
}

@media (max-width: 768px) {
    .ec-table-scroll { max-height: 58vh; }
}
