/* Desktop shell refinements for TPP eKey. Mobile styles remain driven by style.css. */
:root {
  --desktop-sidebar: 292px;
  --desktop-topbar: 76px;
  --desktop-orange: #f38220;
  --desktop-ink: #18202d;
  --desktop-muted: #6d7582;
  --desktop-line: rgba(24, 32, 45, 0.09);
  --desktop-panel: rgba(255, 255, 255, 0.92);
}

body.theme-light {
  background:
    radial-gradient(circle at top left, rgba(243, 130, 32, 0.11), transparent 30rem),
    linear-gradient(135deg, #f7f8fb 0%, #eef1f6 100%);
}

.desktop-topbar-title {
  display: none;
}

.desktop-icon-neutral {
  background: #545454 !important;
}

.desktop-dashboard {
  animation: desktopEnter 420ms ease both;
}

.desktop-page-loading {
  cursor: progress;
}

.desktop-page-transition {
  opacity: 0;
  transform: translateY(10px);
}

.desktop-ajax-progress {
  position: fixed;
  top: 0;
  left: var(--desktop-sidebar);
  right: 0;
  height: 3px;
  z-index: 1100;
  background: linear-gradient(90deg, var(--desktop-orange), #ffbf75);
  transform: scaleX(0);
  transform-origin: left;
  opacity: 0;
  transition: transform 320ms ease, opacity 160ms ease;
}

.desktop-page-loading .desktop-ajax-progress {
  opacity: 1;
  transform: scaleX(0.78);
}

.desktop-skeleton {
  animation: desktopEnter 180ms ease both;
}

.desktop-skeleton-line,
.desktop-skeleton-block,
.desktop-skeleton-card {
  position: relative;
  overflow: hidden;
  background: #e9edf3;
  border-radius: 8px;
}

.desktop-skeleton-line::after,
.desktop-skeleton-block::after,
.desktop-skeleton-card::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  animation: desktopSkeleton 1.1s infinite;
}

.desktop-skeleton-line {
  height: 14px;
}

.desktop-skeleton-block {
  height: 220px;
}

.desktop-skeleton-card {
  min-height: 150px;
}

.login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 15%, rgba(243, 130, 32, 0.12), transparent 28rem),
    linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
}

.login-page .page-content {
  margin-left: 0 !important;
  padding: 0 !important;
  overflow-x: hidden;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.05fr);
}

.login-story {
  position: relative;
  min-height: 100vh;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  background-image:
    linear-gradient(135deg, rgba(17, 24, 39, 0.92), rgba(17, 24, 39, 0.62)),
    url("../net_img/home2.jpg");
  background-position: center;
  background-size: cover;
}

.login-story-mark {
  width: 86px;
  height: 86px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.login-story h1 {
  max-width: 560px;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: 0;
}

.login-story p {
  max-width: 520px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 16px;
}

.login-story-list {
  display: grid;
  gap: 14px;
  max-width: 520px;
}

.login-story-list span {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 700;
}

.login-story-list i {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--desktop-orange);
  background: rgba(255, 255, 255, 0.12);
}

.login-form-panel {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px;
}

.login-card {
  width: min(100%, 540px);
  padding: 42px;
  border: 1px solid rgba(24, 32, 45, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 24px 80px rgba(20, 27, 38, 0.12);
  animation: desktopEnter 420ms ease both;
}

.login-card .form-control {
  height: 56px !important;
  border-radius: 8px !important;
  border-color: rgba(24, 32, 45, 0.12);
  background-color: #fff;
}

.login-card .form-custom i:first-child {
  top: 17px;
}

.login-card .login-password-toggle {
  position: absolute;
  right: 12px;
  top: 7px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.login-card .login-button {
  height: 56px;
  border-radius: 8px !important;
}

.login-footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.modal {
  z-index: 1090 !important;
}

.modal.show {
  pointer-events: auto !important;
}

.modal-backdrop {
  z-index: 1080 !important;
  background-color: #111827 !important;
  opacity: 0 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  pointer-events: auto !important;
}

.modal-backdrop.show {
  opacity: 0.22 !important;
}

.offcanvas-backdrop {
  background-color: #111827 !important;
  opacity: 0 !important;
  pointer-events: auto !important;
}

.offcanvas-backdrop.show {
  opacity: 0.14 !important;
}

.run_noti.notification-bar {
  left: auto !important;
  right: 18px !important;
  top: 18px !important;
  width: min(330px, calc(100vw - 36px)) !important;
  border-radius: 8px !important;
  transform: translate3d(0, -120%, 0) !important;
  z-index: 2200 !important;
  box-shadow: 0 18px 46px rgba(20, 27, 38, 0.16) !important;
}

.run_noti.notification-bar.show {
  transform: translate3d(0, 0, 0) !important;
}

.run_noti .toast-header {
  min-height: 0 !important;
  padding: 10px 12px !important;
  border-bottom: 1px solid rgba(24, 32, 45, 0.08) !important;
}

.run_noti .toast-header strong {
  font-size: 13px !important;
}

.run_noti .toast-header small {
  display: none !important;
}

.run_noti .toast-body {
  padding: 10px 12px 12px !important;
}

.run_noti .toast-body p {
  font-size: 12px !important;
  line-height: 1.45 !important;
}

.run_noti .btn-close {
  width: 10px !important;
  height: 10px !important;
  padding: 6px !important;
  margin: 0 0 0 8px !important;
}

.app-lock-blur #page {
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
}

.lock-screen-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(17, 24, 39, 0.46);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.lock-screen-overlay.show {
  display: flex;
}

.lock-screen-card {
  width: min(420px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  padding: 34px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 90px rgba(17, 24, 39, 0.24);
  text-align: center;
  animation: desktopEnter 220ms ease both;
  filter: none !important;
  transform: translateZ(0);
  isolation: isolate;
}

.lock-avatar {
  width: 84px;
  height: 84px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  border: 4px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: linear-gradient(145deg, #f38220, #ffb36b);
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 14px 34px rgba(243, 130, 32, 0.28);
}

.lock-muted {
  color: #6d7582;
  font-size: 14px;
}

.lock-field {
  position: relative;
  margin-top: 18px;
}

.lock-field i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #72706f;
}

.lock-field input {
  width: 100%;
  height: 52px;
  padding: 0 52px 0 44px;
  border: 1px solid rgba(24, 32, 45, 0.14);
  border-radius: 12px;
  background: #fff;
  font-size: 15px !important;
}

.lock-password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #72706f;
}

.lock-password-toggle:hover,
.lock-password-toggle:focus {
  background: rgba(243, 130, 32, 0.1);
  color: #f38220;
  outline: none;
}

.lock-error {
  min-height: 20px;
  margin: 8px 0 0;
  color: #d84558;
  font-size: 12px;
}

.lock-unlock-btn {
  width: 100%;
  height: 50px;
  margin-top: 8px;
  border-radius: 12px !important;
  color: #fff !important;
  font-weight: 800;
}

.lock-switch {
  display: inline-block;
  margin-top: 16px;
  color: #6d7582;
  font-weight: 700;
  font-size: 13px;
}

.lock-switch:hover {
  color: #f38220;
}

.dataTables_wrapper {
  width: 100%;
}

.dataTables_wrapper .row {
  align-items: center;
  gap: 8px 0;
}

.dataTables_wrapper .dataTables_filter {
  text-align: right;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  min-height: 38px;
  border: 1px solid rgba(24, 32, 45, 0.14) !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: var(--desktop-ink);
}

.dataTables_wrapper .dataTables_filter input {
  width: min(260px, 100%);
  margin-left: 8px;
  padding: 0 12px !important;
}

.dataTables_wrapper .dataTables_info {
  color: var(--desktop-muted);
  font-size: 12px;
  padding-top: 10px;
}

.dataTables_wrapper .pagination {
  justify-content: flex-end;
  margin: 10px 0 0;
}

.dataTables_wrapper .page-link {
  min-width: 36px;
  border-radius: 8px !important;
  margin-left: 4px;
  color: var(--desktop-ink);
}

.dataTables_wrapper .page-item.active .page-link {
  background: #f38220;
  border-color: #f38220;
  color: #fff;
}

.desktop-hero {
  min-height: 260px;
  background-image:
    linear-gradient(90deg, rgba(20, 27, 38, 0.88), rgba(20, 27, 38, 0.55), rgba(20, 27, 38, 0.15)),
    url("../net_img/home1.jpg");
  background-position: center;
  background-size: cover;
  border-radius: 8px;
  overflow: hidden;
}

.desktop-hero h1 {
  font-size: clamp(30px, 4vw, 54px);
  letter-spacing: 0;
}

.desktop-stat,
.desktop-action,
.desktop-panel-card {
  border: 1px solid var(--desktop-line);
  border-radius: 8px !important;
  background: var(--desktop-panel);
  box-shadow: 0 16px 45px rgba(20, 27, 38, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.desktop-stat:hover,
.desktop-action:hover {
  transform: translateY(-3px);
  border-color: rgba(243, 130, 32, 0.25);
  box-shadow: 0 20px 55px rgba(20, 27, 38, 0.13);
}

.desktop-stat .desktop-stat-icon,
.desktop-action .desktop-action-icon {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(243, 130, 32, 0.12);
  color: var(--desktop-orange);
  font-size: 24px;
}

.desktop-muted {
  color: var(--desktop-muted);
}

.desktop-access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.desktop-access-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  min-height: 76px;
  border: 1px solid var(--desktop-line);
  border-radius: 8px;
  background: #fff;
}

.desktop-access-item input {
  width: 20px;
  height: 20px;
  accent-color: var(--desktop-orange);
}

@keyframes desktopEnter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes desktopSkeleton {
  to {
    transform: translateX(100%);
  }
}

@media (min-width: 992px) {
  body {
    overflow-x: hidden;
  }

  #page {
    min-height: 100vh;
  }

  .header-bar.desktop-topbar {
    left: calc(var(--desktop-sidebar) + 24px) !important;
    right: 24px !important;
    top: 16px !important;
    width: auto !important;
    height: var(--desktop-topbar) !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid var(--desktop-line);
    box-shadow: 0 14px 40px rgba(20, 27, 38, 0.08) !important;
    backdrop-filter: blur(14px);
    display: grid !important;
    grid-template-columns: 170px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 0 18px !important;
    z-index: 1040;
  }

  .header-bar.desktop-topbar * {
    line-height: 1.2 !important;
    align-self: center;
  }

  .header-bar.desktop-topbar > a:not(.header-title),
  .desktop-topbar-actions > a {
    min-width: 44px !important;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(243, 130, 32, 0.08);
    margin: 0 !important;
    transition: background 160ms ease, transform 160ms ease;
  }

  .header-bar.desktop-topbar > a:not(.header-title):hover,
  .desktop-topbar-actions > a:hover {
    background: rgba(243, 130, 32, 0.15);
    transform: translateY(-1px);
  }

  .desktop-topbar .header-title {
    display: none !important;
  }

  .desktop-topbar-logo {
    width: auto !important;
    min-width: 0 !important;
    height: 48px !important;
    background: transparent !important;
    justify-content: flex-start !important;
  }

  .desktop-topbar-logo img {
    max-width: 142px;
    max-height: 42px;
    object-fit: contain;
  }

  .desktop-topbar-title {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-left: 0;
    line-height: 1.2;
  }

  .desktop-topbar-title strong {
    color: var(--desktop-ink);
    font-size: 16px;
  }

  .desktop-topbar-title span {
    color: var(--desktop-muted);
    font-size: 12px;
    margin-top: 4px;
  }

  .desktop-topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
  }

  .desktop-topbar-actions .dropdown-menu {
    left: auto !important;
    right: 54px !important;
    transform: translate3d(0, 58px, 0) !important;
  }

  .desktop-profile-menu {
    width: 238px !important;
    padding: 0 !important;
    border-radius: 8px !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .desktop-profile-menu .card {
    background: #fff !important;
    border: 1px solid var(--desktop-line);
    box-shadow: 0 18px 50px rgba(20, 27, 38, 0.14) !important;
  }

  .desktop-profile-item {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px;
    height: auto !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px;
    padding: 10px 12px !important;
    border-radius: 8px;
    color: var(--desktop-ink) !important;
    background: transparent !important;
    line-height: 1.2 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-align: left !important;
    text-decoration: none !important;
  }

  .desktop-profile-item:hover,
  .desktop-profile-item:focus {
    background: rgba(243, 130, 32, 0.1) !important;
    outline: none;
    transform: none !important;
  }

  .desktop-profile-item span {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
    white-space: nowrap;
    text-align: left !important;
  }

  .desktop-profile-item span i {
    position: static !important;
    inset: auto !important;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #f38220;
    background: rgba(243, 130, 32, 0.1);
    font-size: 14px;
    line-height: 28px !important;
    margin: 0 !important;
    transform: none !important;
  }

  .desktop-profile-item > i {
    position: static !important;
    inset: auto !important;
    flex: 0 0 auto;
    color: #a0a6af;
    font-size: 12px;
    line-height: 1 !important;
    margin-left: auto !important;
    transform: none !important;
  }

  #menu-main.offcanvas {
    visibility: visible !important;
    transform: none !important;
    position: fixed !important;
    top: 16px !important;
    left: 16px !important;
    bottom: 16px !important;
    width: calc(var(--desktop-sidebar) - 32px) !important;
    height: auto !important;
    border-radius: 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.65) !important;
    background: rgba(255, 255, 255, 0.88) !important;
    box-shadow: 0 18px 60px rgba(20, 27, 38, 0.13) !important;
    backdrop-filter: blur(16px);
    overflow: hidden;
    overflow-x: hidden;
    overscroll-behavior: contain;
    pointer-events: auto !important;
    z-index: 1030;
  }

  #menu-main .desktop-sidebar-shell {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #menu-main .desktop-sidebar-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 16px 16px;
  }

  #menu-main .desktop-sidebar-scroll::-webkit-scrollbar {
    width: 8px;
  }

  #menu-main .desktop-sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(24, 32, 45, 0.18);
    border-radius: 999px;
  }

  #menu-main .desktop-sidebar-scroll::-webkit-scrollbar-track {
    background: transparent;
  }

  .offcanvas-backdrop {
    display: none !important;
  }

  #menu-main .card-style {
    box-shadow: none !important;
    border-radius: 8px !important;
    background: transparent !important;
  }

  #menu-main .desktop-sidebar-brand {
    flex: 0 0 auto;
    z-index: 2;
    margin: 16px 16px 8px !important;
    border: 0;
    overflow: hidden;
  }

  #menu-main .menu-list {
    margin-bottom: 12px;
  }

  #menu-main .menu-list > .card {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  #menu-main .menu-list a {
    min-height: 54px;
    padding: 8px 10px 8px 4px;
    border-radius: 8px;
    margin-bottom: 6px;
    transition: background 160ms ease, transform 160ms ease;
  }

  #menu-main .menu-list a:hover,
  #menu-main .menu-list a:focus,
  #menu-main .menu-list a:active,
  #menu-main .menu-list .active-item {
    background: rgba(243, 130, 32, 0.1);
    transform: translateX(2px);
    outline: none !important;
  }

  #menu-main .menu-list a span {
    font-size: 13px;
    font-weight: 700;
    color: var(--desktop-ink);
  }

  #menu-main .menu-list a:focus span,
  #menu-main .menu-list a:active span,
  #menu-main .menu-list .active-item span {
    color: var(--desktop-ink) !important;
  }

  #menu-main .menu-list a:focus i.menu-icon,
  #menu-main .menu-list a:active i.menu-icon,
  #menu-main .menu-list .active-item i.menu-icon {
    color: #fff !important;
  }

  .page-content a:focus,
  .page-content button:focus,
  .page-content .btn:focus,
  .page-content a:active,
  .page-content button:active,
  .page-content .btn:active {
    outline: none !important;
    box-shadow: none;
  }

  .page-content .gradient-highlight:focus,
  .page-content .gradient-highlight:active,
  .page-content .gradient-orange:focus,
  .page-content .gradient-orange:active {
    color: #fff !important;
    background-image: linear-gradient(to bottom, #E46D16, #EB863B) !important;
  }

  .page-content {
    margin-left: var(--desktop-sidebar);
    padding: calc(var(--desktop-topbar) + 34px) 24px 34px !important;
    max-width: 1560px;
    transition: opacity 220ms ease, transform 220ms ease;
  }

  .page-content.header-clear-medium {
    padding-top: calc(var(--desktop-topbar) + 34px) !important;
  }

  #footer-bar {
    display: none !important;
  }

  .container,
  .container-sm,
  .container-md,
  .container-lg,
  .container-xl {
    max-width: 1240px;
  }

  .card,
  .card-style,
  .card-style1,
  .rounded-m,
  .rounded-s,
  .rounded-xs {
    border-radius: 8px !important;
  }
}

@media (max-width: 991.98px) {
  html,
  body {
    min-height: 100vh !important;
    overflow: hidden !important;
  }

  body {
    background:
      radial-gradient(circle at top left, rgba(243, 130, 32, 0.14), transparent 24rem),
      linear-gradient(135deg, #f7f8fb 0%, #eef2f7 100%) !important;
  }

  #page,
  #preloader,
  .desktop-ajax-progress,
  #footer-bar,
  .offcanvas,
  .modal-backdrop {
    display: none !important;
  }

  body::before {
    content: "Desktop View Required";
    position: fixed;
    left: 20px;
    right: 20px;
    top: 50%;
    transform: translateY(-78px);
    display: block;
    padding: 28px 24px 6px;
    border-radius: 8px 8px 0 0;
    background: #fff;
    color: var(--desktop-ink);
    font-family: "Inter", sans-serif;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    box-shadow: 0 24px 70px rgba(20, 27, 38, 0.14);
    z-index: 999999;
  }

  body::after {
    content: "This application is optimized for desktop screens. Please enlarge your browser window or use a desktop computer to continue.";
    position: fixed;
    left: 20px;
    right: 20px;
    top: 50%;
    transform: translateY(-6px);
    display: block;
    padding: 4px 24px 28px;
    border-radius: 0 0 8px 8px;
    background: #fff;
    color: #6d7582;
    font-family: "Roboto", sans-serif;
    font-size: 15px;
    line-height: 1.55;
    text-align: center;
    box-shadow: 0 24px 70px rgba(20, 27, 38, 0.14);
    z-index: 999999;
  }

  .desktop-dashboard .desktop-only {
    display: none !important;
  }

}
