
/* ======================================================
   PILLAR PWA SHELL / MOBILE POLISH
   ====================================================== */

#pillarSplash {
  position: fixed;
  inset: 0;
  z-index: 200000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #0f5132;
  transition:
    opacity .50s ease,
    visibility .50s ease;
}

#pillarSplash.pillar-splash-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.pillar-splash-inner {
  text-align: center;
  padding: 32px;
}

.pillar-splash-mark {
  width: 82px;
  height: 82px;
  margin: 0 auto 20px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background:
    rgba(255,255,255,.12);
  border:
    1px solid
    rgba(255,255,255,.20);
  font-size: 37px;
  font-weight: 900;
  letter-spacing: -2px;
}

.pillar-splash-name {
  font-size: 31px;
  font-weight: 900;
  letter-spacing: 3px;
}

.pillar-splash-subtitle {
  margin-top: 9px;
  font-size: 13px;
  opacity: .82;
}

@supports (
  padding-top:
    env(safe-area-inset-top)
) {

  .topbar {
    padding-top:
      env(safe-area-inset-top);
  }

  .sidebar {
    padding-top:
      calc(
        25px +
        env(safe-area-inset-top)
      );
  }

  .content {
    padding-bottom:
      calc(
        30px +
        env(safe-area-inset-bottom)
      );
  }
}

@media
(max-width: 650px) {

  .login-side {
    padding:
      max(
        22px,
        env(safe-area-inset-top)
      )
      20px
      max(
        24px,
        env(safe-area-inset-bottom)
      );
  }

  .login-box {
    width: 100%;
    max-width: 460px;
  }

  .language-switch {
    top:
      max(
        12px,
        env(safe-area-inset-top)
      );
    right: 12px;
  }

  html[dir="rtl"]
  .language-switch {
    right: auto;
    left: 12px;
  }

  .content {
    padding: 14px;
  }

  .topbar {
    min-height: 66px;
    height: auto;
    padding-left: 12px;
    padding-right: 12px;
  }

  .page-title {
    font-size: 18px;
  }

  .topbar-actions {
    gap: 8px;
  }

  .top-language,
  .logout-button {
    min-height: 38px;
  }

  .table-container {
    -webkit-overflow-scrolling:
      touch;
  }

  .data-table th,
  .data-table td {
    padding:
      12px 11px;
    font-size: 13px;
  }

  .customer-modal {
    max-height:
      calc(
        100dvh -
        24px
      );
    border-radius: 12px;
    padding: 18px;
  }

  .modal-overlay {
    align-items:
      flex-start;
    padding:
      max(
        12px,
        env(safe-area-inset-top)
      )
      12px
      max(
        12px,
        env(safe-area-inset-bottom)
      );
  }

  input,
  select,
  textarea,
  button {
    font-size: 16px;
  }
}


.pillar-splash-logo {
  display: block;
  width: min(82vw, 430px);
  height: auto;
  margin: 0 auto 14px;
  object-fit: contain;
}

.pillar-splash-inner {
  width: min(92vw, 520px);
}

.pillar-splash-subtitle {
  color: #5f6b65;
  font-size: 14px;
  letter-spacing: .2px;
}

.pillar-splash-mark,
.pillar-splash-name {
  display: none !important;
}


/* ======================================================
   PILLAR V9 - MOBILE NAVIGATION
   ====================================================== */

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mobile-menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid #dfe5e2;
  border-radius: 10px;
  background: #ffffff;
  color: #173f2f;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}

.mobile-sidebar-overlay {
  display: none;
}

@media (max-width: 850px) {

  .mobile-menu-toggle {
    display: inline-grid;
    place-items: center;
  }

  .sidebar {
    width: min(82vw, 300px) !important;
    transform: translateX(-105%);
    transition: transform .24s ease;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 16px 0 42px rgba(0,0,0,.18);
    z-index: 5000;
  }

  html[dir="rtl"] .sidebar {
    transform: translateX(105%);
    box-shadow: -16px 0 42px rgba(0,0,0,.18);
  }

  body.mobile-sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-logo {
    font-size: 27px !important;
    padding: 6px 14px 24px !important;
  }

  .menu-text {
    display: inline !important;
  }

  .menu-item {
    min-height: 48px;
    padding: 12px 14px;
    margin-bottom: 5px;
  }

  .menu-icon {
    flex: 0 0 25px;
  }

  .mobile-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 35, 28, .38);
    backdrop-filter: blur(2px);
    z-index: 4900;
  }

  body.mobile-sidebar-open .mobile-sidebar-overlay {
    display: block;
  }

  .main,
  html[dir="rtl"] .main {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
  }

  body.mobile-sidebar-open {
    overflow: hidden;
  }
}

@media (max-width: 650px) {

  .topbar {
    gap: 10px;
  }

  .topbar-left {
    flex: 1 1 auto;
  }

  .page-title {
    font-size: 18px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-actions {
    gap: 7px;
  }

  .top-language {
    padding: 7px 9px;
    min-width: 58px;
  }

  .logout-button {
    padding-left: 10px;
    padding-right: 10px;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
  }

  .card {
    padding: 15px !important;
    min-height: 116px;
  }

  .card-title {
    font-size: 13px;
    line-height: 1.35;
  }

  .card-value {
    font-size: 29px !important;
    margin-top: 8px;
  }

  .welcome-panel {
    padding: 18px !important;
    margin-bottom: 14px;
  }

  .welcome-panel h2 {
    font-size: 20px;
  }

  .welcome-panel p {
    font-size: 13px;
    line-height: 1.5;
  }

  .content {
    padding: 12px !important;
  }
}

@media (max-width: 360px) {

  .cards {
    grid-template-columns: 1fr !important;
  }

  .top-language {
    display: none;
  }
}
