/* RAPI glass interface: preserves the navy, blue, white and gold brand palette. */
:root {
  --rapi-navy: #0f3d56;
  --rapi-navy-deep: #082f45;
  --rapi-blue: #1b6f92;
  --rapi-sky: #55b7d7;
  --rapi-gold: #d6a33a;
  --rapi-ink: #153c52;
  --rapi-muted: #698092;
  --rapi-line: rgba(30, 87, 115, .12);
  --rapi-glass: rgba(255, 255, 255, .72);
  --rapi-glass-strong: rgba(255, 255, 255, .86);
  --rapi-shadow: 0 18px 48px rgba(10, 52, 75, .10), 0 2px 8px rgba(10, 52, 75, .04);
}

html { color-scheme: light; }
body {
  color: var(--rapi-ink) !important;
  background:
    radial-gradient(ellipse at 82% 5%, rgba(85, 183, 215, .12), transparent 36%),
    linear-gradient(145deg, #f5f8fa 0%, #edf3f7 52%, #f7f9fa 100%) !important;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important;
  letter-spacing: .005em;
}

/* Login */
#rapiLoginPage {
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 18% 16%, rgba(85, 183, 215, .20), transparent 35%),
    radial-gradient(ellipse at 85% 84%, rgba(214, 163, 58, .13), transparent 30%),
    linear-gradient(135deg, #0b344b 0%, #0f4964 52%, #dce8ee 100%) !important;
}
#rapiLoginPage::before,
#rapiLoginPage::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: min(42vw, 540px);
  aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,.20);
  border-radius: 50%;
  background: linear-gradient(140deg, rgba(255,255,255,.10), rgba(255,255,255,.015));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16);
  pointer-events: none;
}
#rapiLoginPage::before { left: -15vw; top: -22vw; }
#rapiLoginPage::after { right: -14vw; bottom: -27vw; width: min(52vw, 680px); }
#rapiLoginPage > div {
  position: relative;
  z-index: 1;
  width: min(100%, 460px) !important;
  padding: clamp(28px, 4vw, 42px) !important;
  border: 1px solid rgba(255,255,255,.78) !important;
  border-radius: 28px !important;
  background: var(--rapi-glass-strong) !important;
  box-shadow: 0 28px 80px rgba(4, 35, 52, .25), inset 0 1px 0 rgba(255,255,255,.9) !important;
  backdrop-filter: blur(28px) saturate(155%);
  -webkit-backdrop-filter: blur(28px) saturate(155%);
}
#rapiLoginPage .dashboard-welcome-mark {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: auto;
  margin: 0 auto 4px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
#rapiLoginPage .dashboard-welcome-mark img {
  display: block;
  width: min(100%, 280px);
  height: auto;
  max-height: 108px;
  object-fit: contain;
}
#rapiLoginPage p { color: #627b8d !important; }
#rapiLoginPage label { color: var(--rapi-ink) !important; font-weight: 650 !important; }
#rapiLoginPage input {
  min-height: 48px;
  border: 1px solid rgba(36, 91, 119, .17) !important;
  border-radius: 14px !important;
  background: rgba(255,255,255,.75) !important;
  color: #173f56 !important;
  box-shadow: inset 0 1px 2px rgba(15,61,86,.035);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
#rapiLoginPage input:focus {
  outline: none;
  border-color: rgba(27,111,146,.56) !important;
  background: #fff !important;
  box-shadow: 0 0 0 4px rgba(85,183,215,.16), 0 4px 14px rgba(15,61,86,.06) !important;
}
#rapiLoginPage button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 49px;
  border-radius: 14px !important;
  background: linear-gradient(135deg, #155774, #0f3d56) !important;
  box-shadow: 0 8px 18px rgba(15,61,86,.18), inset 0 1px 0 rgba(255,255,255,.14);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
#rapiLoginPage button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 12px 24px rgba(15,61,86,.22), inset 0 1px 0 rgba(255,255,255,.16);
}
#rapiLoginPage #rapiBackEmailButton {
  min-height: 40px;
  color: #1b607d !important;
  background: rgba(255,255,255,.34) !important;
  box-shadow: none;
}
#rapiLoginPage #rapiLoginLoading {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #517084 !important;
}
#rapiLoginMessage { border-radius: 14px !important; }
#rapiLoginPage > div > div:last-child {
  border-color: rgba(30,87,115,.12) !important;
  color: #6e8391 !important;
}
.ui-icon, .nav-icon, .section-icon, .metric-icon svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.login-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(27,111,146,.18);
  border-top-color: var(--rapi-blue);
  border-radius: 50%;
  animation: rapi-spin .75s linear infinite;
}
@keyframes rapi-spin { to { transform: rotate(360deg); } }

/* Sidebar and navigation */
.sidebar {
  width: 252px !important;
  padding: 24px 14px 22px !important;
  border-right: 1px solid rgba(255,255,255,.10);
  background:
    radial-gradient(ellipse at 0 0, rgba(85,183,215,.16), transparent 40%),
    linear-gradient(180deg, rgba(15,61,86,.97), rgba(8,47,69,.98)) !important;
  box-shadow: 8px 0 28px rgba(7,38,55,.12) !important;
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
}
.brand { padding-bottom: 19px !important; margin-bottom: 16px !important; }
.logo-badung { width: 40px !important; height: 40px !important; filter: drop-shadow(0 3px 7px rgba(0,0,0,.16)); }
.brand-title { font-size: 22px !important; letter-spacing: .3px; }
.brand-subtitle { max-width: 180px; color: rgba(255,255,255,.78) !important; font-size: 10.5px !important; }
.access-user {
  border-color: rgba(255,255,255,.13) !important;
  border-radius: 14px !important;
  background: rgba(255,255,255,.075) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.055);
  backdrop-filter: blur(16px);
}
.sidebar-menu { gap: 5px !important; }
.menu {
  display: flex !important;
  align-items: center;
  gap: 11px;
  min-height: 43px !important;
  padding: 10px 13px !important;
  border: 1px solid transparent;
  border-radius: 13px !important;
  color: rgba(255,255,255,.86) !important;
  font-size: 12.5px !important;
  transition: background .2s ease, border-color .2s ease, transform .2s ease, color .2s ease;
}
.menu:hover {
  background: rgba(255,255,255,.095) !important;
  border-color: rgba(255,255,255,.07);
  color: #fff !important;
  transform: translateX(2px) !important;
}
.menu.active {
  border-color: rgba(255,255,255,.12);
  background: linear-gradient(105deg, rgba(47,143,178,.48), rgba(31,105,139,.35)) !important;
  color: #fff !important;
  box-shadow: inset 3px 0 0 #e6b74f, inset 0 1px 0 rgba(255,255,255,.08), 0 6px 16px rgba(0,0,0,.10) !important;
}
.nav-icon { width: 17px; height: 17px; color: #9ed9ec; stroke-width: 1.7; }
.menu.active .nav-icon { color: #fff; }

/* Main surface, header, cards and dashboard sections */
.main { margin-left: 252px !important; padding: 30px clamp(22px, 3vw, 52px) 44px !important; }
.header { margin-bottom: 22px !important; }
.header h1 { color: #163e55 !important; font-size: 26px !important; letter-spacing: -.035em; }
.header > button {
  min-height: 42px !important;
  padding: 0 16px !important;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 14px !important;
  background: linear-gradient(135deg, #155774, #0f3d56) !important;
  box-shadow: 0 7px 16px rgba(15,61,86,.16) !important;
}
.header > button:hover { transform: translateY(-1px); }
#dashboardPage .dashboard-welcome {
  min-height: 142px !important;
  padding: 24px 28px !important;
  border: 1px solid rgba(255,255,255,.88) !important;
  border-radius: 24px !important;
  background: linear-gradient(118deg, rgba(255,255,255,.83), rgba(240,248,251,.70)) !important;
  box-shadow: var(--rapi-shadow), inset 0 1px 0 rgba(255,255,255,.92) !important;
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
}
#dashboardPage .dashboard-welcome::before {
  right: -45px; top: -98px; width: 270px; height: 270px;
  border: 1px solid rgba(85,183,215,.14);
  background: radial-gradient(circle at 35% 35%, rgba(85,183,215,.12), rgba(27,111,146,.025) 68%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
}
#dashboardPage .dashboard-welcome::after {
  right: 112px; bottom: -110px; width: 205px; height: 205px;
  border: 1px solid rgba(214,163,58,.10);
  background: rgba(214,163,58,.045);
}
#dashboardPage > .dashboard-welcome .dashboard-welcome-mark {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 0 0 220px;
  align-items: center;
  justify-content: center;
  width: 220px;
  min-height: 76px;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.84);
  border-radius: 18px;
  background: rgba(255,255,255,.66);
  box-shadow: 0 7px 18px rgba(15,61,86,.06), inset 0 1px 0 rgba(255,255,255,.9);
  backdrop-filter: blur(16px);
}
#dashboardPage > .dashboard-welcome .dashboard-welcome-mark img { width: 100%; height: auto; max-height: 70px; object-fit: contain; }
#dashboardPage .welcome-eyebrow { color: #688496 !important; letter-spacing: .11em !important; font-size: 9px !important; }
#dashboardPage .dashboard-welcome h2 { color: var(--rapi-ink) !important; font-size: 27px !important; letter-spacing: -.035em; }
#dashboardPage .welcome-tagline { color: #236783 !important; font-size: 13px !important; }
#dashboardPage .welcome-info { color: #687e8c !important; font-size: 12px !important; }
#dashboardPage #dashboardCards { gap: 16px !important; }
#dashboardPage #dashboardCards .card {
  min-height: 122px !important;
  padding: 20px 22px !important;
  border: 1px solid rgba(255,255,255,.78) !important;
  border-radius: 20px !important;
  background: linear-gradient(135deg, rgba(255,255,255,.58) 0%, rgba(240,248,252,.38) 100%) !important;
  box-shadow: 0 10px 30px rgba(15,61,86,.06), inset 0 1px 0 rgba(255,255,255,.85) !important;
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}
#dashboardPage #dashboardCards .card::before { width: 3px; opacity: .85; }
#dashboardPage #dashboardCards .card::after { content: none !important; }
.metric-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(27,111,146,.10);
  border-radius: 13px;
  background: rgba(85,183,215,.09);
  color: #3a87a4;
}
.metric-icon svg { width: 19px; height: 19px; }
#dashboardPage #dashboardCards .card:nth-child(3) .metric-icon { color: #a77d2c; background: rgba(214,163,58,.10); border-color: rgba(214,163,58,.13); }
#dashboardPage #dashboardCards .card:nth-child(4) .metric-icon { color: #397a66; background: rgba(65,146,116,.09); border-color: rgba(65,146,116,.12); }
#dashboardPage #dashboardCards .card-title { color: #718796 !important; font-size: 11px !important; letter-spacing: .015em; }
#dashboardPage #dashboardCards .card-number { color: #153f57 !important; font-size: 36px !important; letter-spacing: -.045em; }
#dashboardPage .dashboard-summary { gap: 16px !important; }
#dashboardPage .dashboard-section {
  border: 1px solid rgba(255,255,255,.72) !important;
  border-radius: 20px !important;
  background: linear-gradient(135deg, rgba(255,255,255,.55) 0%, rgba(240,248,252,.36) 100%) !important;
  box-shadow: 0 10px 30px rgba(15,61,86,.06), inset 0 1px 0 rgba(255,255,255,.85) !important;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}
#dashboardPage .dashboard-section-header {
  min-height: 64px !important;
  padding: 14px 18px !important;
  background: linear-gradient(120deg, rgba(255,255,255,.45), rgba(240,247,250,.25)) !important;
  border-bottom: 1px solid rgba(30,87,115,.08) !important;
}
#dashboardPage .dashboard-section-header::before { width: 3px; opacity: .8; }
#dashboardPage .dashboard-section-header h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #173f56 !important;
  font-size: 14px !important;
  letter-spacing: -.01em;
}
.section-icon { width: 18px; height: 18px; color: #3986a1; stroke-width: 1.8; }
#dashboardPage .dashboard-section:nth-child(2) .section-icon { color: #ad812d; }
#dashboardPage .dashboard-section:nth-child(3) .section-icon { color: #39816c; }
#dashboardPage .dashboard-section-header p { color: #758998 !important; font-size: 10.5px !important; }
#dashboardPage .dashboard-section-header button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 90px !important;
  min-height: 34px;
  border: 1px solid rgba(27,111,146,.14) !important;
  border-radius: 11px !important;
  background: rgba(255,255,255,.66) !important;
  color: #1d617e !important;
  box-shadow: 0 2px 8px rgba(15,61,86,.04) !important;
}
#dashboardPage .dashboard-section-header button .ui-icon { width: 14px; height: 14px; }
#dashboardPage .dashboard-section-header button:hover { background: #fff !important; box-shadow: 0 5px 12px rgba(15,61,86,.08) !important; }
#dashboardPage .dashboard-section-body { background: transparent !important; }
#dashboardPage .dashboard-row { border-bottom-color: rgba(30,87,115,.09) !important; }
#dashboardPage .dashboard-row strong { color: #21485d !important; }

/* =====================================================
   GLASSY CARDS & RESPONSIVE ARCHITECTURE (NO WHITE BOX)
   ===================================================== */

/* Reset outer wrapper to prevent double-boxed white containers */
.page-section {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  padding: 0 !important;
  margin-bottom: 22px !important;
  width: 100% !important;
}

/* Glassy Cards: Translucent, airy, no solid/opaque white background */
.content, .form-card, .samsat-form-card, .samsat-history-card,
.approval-card, .pmh-card, .modal-content, .table-card, .filter-card,
.card, .rapi-glass-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.58) 0%, rgba(240, 248, 252, 0.38) 100%) !important;
  backdrop-filter: blur(22px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(160%) !important;
  border: 1px solid rgba(255, 255, 255, 0.75) !important;
  border-radius: 20px !important;
  box-shadow: 0 12px 36px rgba(15, 61, 86, 0.06), 0 2px 6px rgba(15, 61, 86, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.85) !important;
  padding: clamp(18px, 3vw, 28px) !important;
  color: var(--rapi-ink) !important;
  margin-bottom: 20px !important;
  box-sizing: border-box !important;
}

.section-header {
  border-bottom: 1px solid rgba(30, 87, 115, 0.10) !important;
  padding-bottom: 14px !important;
  margin-bottom: 18px !important;
}
.section-header h2 {
  font-size: 22px !important;
  font-weight: 800 !important;
  color: #133c53 !important;
  margin: 0 0 4px !important;
  letter-spacing: -0.02em !important;
}
.section-header p {
  font-size: 13px !important;
  color: #647d8f !important;
  margin: 0 !important;
}

/* Form Controls with subtle glassy background */
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  background: rgba(255, 255, 255, 0.62) !important;
  border: 1px solid rgba(27, 111, 146, 0.18) !important;
  border-radius: 12px !important;
  color: #123e54 !important;
  font-size: 13.5px !important;
  padding: 10px 14px !important;
  min-height: 44px;
  box-shadow: inset 0 1px 2px rgba(15, 61, 86, 0.03) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus {
  outline: none !important;
  background: rgba(255, 255, 255, 0.94) !important;
  border-color: #1b6f92 !important;
  box-shadow: 0 0 0 3px rgba(85, 183, 215, 0.25), 0 2px 8px rgba(15, 61, 86, 0.08) !important;
}
label {
  font-size: 12.5px !important;
  font-weight: 650 !important;
  color: #173f56 !important;
  letter-spacing: 0.01em !important;
  margin-bottom: 5px !important;
}

/* Modern Form Grid: Airy Spacing */
.form-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 18px 20px !important;
  margin-top: 18px !important;
}
.form-group {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  min-width: 0 !important;
}
.form-group.full, .form-group.full-width {
  grid-column: 1 / -1 !important;
}

/* Glassy Tables without chalky white borders */
.table-wrap, .table-container, .table-responsive, div[style*="overflow-x"] {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  border-radius: 16px !important;
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.55) !important;
  box-shadow: 0 4px 16px rgba(15, 61, 86, 0.04) !important;
  margin-bottom: 18px !important;
}
table, .data-table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  background: transparent !important;
  border: none !important;
}
table th, .data-table th, th {
  background: rgba(15, 61, 86, 0.07) !important;
  color: #0f3d56 !important;
  font-weight: 700 !important;
  font-size: 11.5px !important;
  letter-spacing: 0.03em !important;
  text-transform: uppercase !important;
  padding: 12px 14px !important;
  border-bottom: 2px solid rgba(15, 61, 86, 0.12) !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  white-space: nowrap !important;
}
table td, .data-table td, td {
  background: transparent !important;
  border-bottom: 1px solid rgba(30, 87, 115, 0.08) !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  padding: 12px 14px !important;
  color: #173f56 !important;
  font-size: 13px !important;
}
table tbody tr:nth-child(even) td, .data-table tbody tr:nth-child(even) td, tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.22) !important;
}
table tbody tr:hover td, .data-table tbody tr:hover td, tbody tr:hover td {
  background: rgba(85, 183, 215, 0.12) !important;
}

/* Global anti-overflow & buttons */
html, body {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
}
*, *::before, *::after {
  box-sizing: border-box !important;
}

button {
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
button:focus-visible, .menu:focus-visible, a:focus-visible {
  outline: 3px solid rgba(85,183,215,.55) !important;
  outline-offset: 2px;
}

/* Mobile Topbar & Sidebar Drawer */
.mobile-topbar {
  display: none;
}
.sidebar-backdrop {
  display: none;
}
.sidebar-close-btn {
  display: none;
}

@media (max-width: 1100px) {
  .main { padding-inline: 22px !important; }
  #dashboardPage > .dashboard-welcome .dashboard-welcome-mark { flex-basis: 190px; width: 190px; }
}

@media (max-width: 820px) {
  .mobile-topbar {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 990;
    margin: -18px -14px 18px -14px !important;
    padding: 11px 16px !important;
    background: rgba(15, 61, 86, 0.94) !important;
    backdrop-filter: blur(18px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(150%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 4px 20px rgba(5, 25, 38, 0.18) !important;
  }
  .mobile-menu-toggle, .mobile-refresh-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.20) !important;
    background: rgba(255, 255, 255, 0.10) !important;
    color: #fff !important;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease !important;
  }
  .mobile-menu-toggle:active, .mobile-refresh-btn:active {
    transform: scale(0.94) !important;
    background: rgba(255, 255, 255, 0.22) !important;
  }
  .mobile-topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .mobile-brand-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
  }
  .mobile-brand-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
  .mobile-brand-name {
    color: #fff;
    font-weight: 800;
    font-size: 16px;
    letter-spacing: 0.5px;
    line-height: 1.1;
  }
  .mobile-page-badge {
    color: #9ed9ec;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
  }
  .sidebar-close-btn {
    display: inline-flex !important;
    position: absolute;
    top: 18px;
    right: 14px;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.20);
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    cursor: pointer;
  }
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 280px !important;
    max-width: 86vw !important;
    height: 100vh !important;
    z-index: 99999 !important;
    transform: translateX(-105%) !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease !important;
    box-shadow: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-right: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-bottom: none !important;
  }
  .sidebar.open {
    transform: translateX(0) !important;
    box-shadow: 14px 0 50px rgba(4, 24, 36, 0.55) !important;
  }
  .sidebar-backdrop {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 99998 !important;
    background: rgba(6, 26, 38, 0.60) !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.26s ease !important;
  }
  .sidebar-backdrop.active {
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  body.sidebar-open {
    overflow: hidden !important;
  }
  .main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    padding: 16px 14px 36px !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
  .header {
    display: none !important;
  }
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .form-group.full, .form-group.full-width {
    grid-column: auto !important;
  }
  #dashboardPage #dashboardCards {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }
  #dashboardPage #dashboardCards .card {
    min-height: 108px !important;
    padding: 16px 14px !important;
  }
  #dashboardPage #dashboardCards .card-number {
    font-size: 28px !important;
  }
  #dashboardPage .dashboard-summary {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .content, .form-card, .samsat-form-card, .samsat-history-card,
  .approval-card, .pmh-card, .table-card, #dashboardPage .dashboard-section {
    padding: 18px 15px !important;
    border-radius: 17px !important;
  }
  #dashboardPage .dashboard-welcome {
    gap: 16px !important;
    padding: 18px !important;
    border-radius: 20px !important;
  }
  #dashboardPage > .dashboard-welcome .dashboard-welcome-mark {
    flex: 0 1 auto;
    width: min(100%, 230px);
    min-height: 64px;
  }
  #dashboardPage .dashboard-welcome h2 {
    font-size: 22px !important;
  }
  #rapiLoginPage {
    padding: 16px !important;
  }
  #rapiLoginPage > div {
    border-radius: 24px !important;
  }
}

@media (max-width: 480px) {
  #dashboardPage #dashboardCards {
    grid-template-columns: 1fr !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* In-page replacement for browser alert() dialogs */
.rapi-alert-dialog {
  width: min(500px, calc(100vw - 32px));
  max-width: none;
  max-height: min(82vh, 680px);
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 26px;
  background: transparent;
  color: var(--rapi-ink);
  box-shadow: none;
}
.rapi-alert-dialog::backdrop {
  background: rgba(5, 27, 40, .34);
  backdrop-filter: blur(6px) saturate(115%);
  -webkit-backdrop-filter: blur(6px) saturate(115%);
  animation: rapi-backdrop-in .18s ease-out both;
}
.rapi-alert-dialog[open] { animation: rapi-dialog-in .22s cubic-bezier(.2,.8,.2,1) both; }
.rapi-alert-card {
  position: relative;
  padding: 30px 32px 26px;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(255,255,255,.89), rgba(236,246,250,.80));
  box-shadow: 0 28px 80px rgba(4,35,52,.28), inset 0 1px 0 rgba(255,255,255,.92);
  backdrop-filter: blur(24px) saturate(155%);
  -webkit-backdrop-filter: blur(24px) saturate(155%);
}
.rapi-alert-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(30,87,115,.10);
  border-radius: 11px;
  background: rgba(255,255,255,.52);
  color: #617c8d;
  cursor: pointer;
}
.rapi-alert-close:hover { background: rgba(255,255,255,.86); color: var(--rapi-navy); }
.rapi-alert-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.rapi-alert-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  margin-bottom: 18px;
  border: 1px solid rgba(27,111,146,.12);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(85,183,215,.20), rgba(27,111,146,.08));
  color: #246e8a;
}
.rapi-alert-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rapi-alert-kicker { margin-bottom: 7px; color: #718899; font-size: 10px; font-weight: 750; letter-spacing: .12em; }
.rapi-alert-kicker span { padding: 0 3px; color: var(--rapi-gold); }
.rapi-alert-dialog h2 { margin: 0 0 12px; color: #123c54; font-size: 22px; font-weight: 720; letter-spacing: -.025em; }
.rapi-alert-message {
  max-height: min(45vh, 380px);
  overflow: auto;
  color: #526e80;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.rapi-dialog-input {
  display: block;
  width: 100%;
  min-height: 104px;
  margin-top: 17px;
  padding: 13px 14px;
  resize: vertical;
  border: 1px solid rgba(30,87,115,.18);
  border-radius: 14px;
  background: rgba(255,255,255,.62);
  color: #234f66;
  font: inherit;
  font-size: 14px;
  line-height: 1.55;
  box-shadow: inset 0 1px 2px rgba(15,61,86,.035);
}
.rapi-dialog-input[hidden] { display: none; }
.rapi-dialog-input:focus { outline: none; border-color: rgba(27,111,146,.55); box-shadow: 0 0 0 4px rgba(85,183,215,.14); }
.rapi-alert-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.rapi-alert-cancel {
  min-width: 94px;
  min-height: 43px;
  padding: 0 18px;
  border: 1px solid rgba(30,87,115,.15);
  border-radius: 13px;
  background: rgba(255,255,255,.56);
  color: #446779;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.rapi-alert-cancel:hover { background: rgba(255,255,255,.9); }
.rapi-alert-cancel[hidden] { display: none; }
.rapi-alert-ok {
  min-width: 112px;
  min-height: 43px;
  padding: 0 20px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 13px;
  background: linear-gradient(135deg, #155774, #0f3d56);
  box-shadow: 0 7px 16px rgba(15,61,86,.17);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.rapi-alert-ok:hover { transform: translateY(-1px); box-shadow: 0 10px 20px rgba(15,61,86,.22); }
.rapi-alert-dialog.is-success .rapi-alert-icon {
  border-color: rgba(53,131,103,.15);
  background: linear-gradient(145deg, rgba(89,166,128,.20), rgba(53,131,103,.08));
  color: #367d61;
}
.rapi-alert-dialog.is-warning .rapi-alert-icon {
  border-color: rgba(214,163,58,.20);
  background: linear-gradient(145deg, rgba(214,163,58,.22), rgba(214,163,58,.08));
  color: #9a7327;
}
@keyframes rapi-dialog-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes rapi-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 560px) {
  .rapi-alert-card { padding: 26px 22px 22px; border-radius: 23px; }
  .rapi-alert-dialog h2 { font-size: 20px; }
  .rapi-alert-message { font-size: 13px; }
  .rapi-alert-actions { margin-top: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .rapi-alert-dialog[open], .rapi-alert-dialog::backdrop { animation: none; }
}
