html, body {
  height: 100%;
}

body{
  font-family: 'Bai Jamjuree', sans-serif;
  color: var(--app-text);
  background-color: #f3f7fd;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(241,247,255,.96) 100%),
    radial-gradient(560px 360px at 12% 0%, rgba(147,197,253,.34), transparent 60%),
    radial-gradient(560px 360px at 88% 10%, rgba(61,183,235,.18), transparent 60%);
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.app-page{
  padding-bottom: 4rem;
}

body.app-page .container,
body.app-page .container-fluid{
  padding-bottom: 2rem;
}

/* Page polish for list-style pages ---------------------------------------- */
.page-hero{
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148,163,184,.16);
  border-radius: 24px;
  background:
    radial-gradient(780px 240px at 0% 0%, rgba(59,130,246,.16), transparent 55%),
    radial-gradient(520px 220px at 100% 0%, rgba(61,183,235,.14), transparent 55%),
    rgba(255,255,255,.68);
  box-shadow: var(--app-shadow-sm);
  padding: 1.25rem 1.35rem;
  backdrop-filter: blur(12px);
}

.page-hero::after{
  content: "";
  position: absolute;
  inset: auto -24px -48px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(61,183,235,.16), transparent 70%);
  pointer-events: none;
}

.page-hero h1{
  margin-bottom: .35rem;
  letter-spacing: -.03em;
}

.page-hero p{
  max-width: 70ch;
  color: var(--app-muted);
  margin-bottom: 0;
}

.app-card{
  border-radius: 22px;
}

.app-card > .card-header{
  background:
    linear-gradient(90deg, rgba(17,78,136,.08), rgba(61,183,235,.08)),
    rgba(255,255,255,.72);
}

/* Equipment page ----------------------------------------------------------- */
.equipment-page-wrap{
  max-width: 1120px;
}

.equipment-page-wrap .page-hero{
  margin-bottom: 1rem !important;
}

.equipment-page-wrap .app-card{
  overflow: hidden;
}

.equipment-page-wrap .card-header{
  border-bottom: 1px solid rgba(148,163,184,.14);
}

.equipment-page-wrap .table-responsive{
  border-top: 1px solid rgba(148,163,184,.08);
}

.equipment-page-wrap .equip-table thead th{
  background: rgba(241,247,255,.96);
  text-transform: none;
  letter-spacing: 0;
  font-size: .93rem;
}

.equipment-page-wrap .equip-table tbody tr:hover{
  background: rgba(59,130,246,.04);
}

.equipment-page-wrap .equip-group-toggle,
.equipment-page-wrap .equip-model-toggle{
  transition: transform .16s ease, opacity .16s ease;
}

.equipment-page-wrap .equip-group-toggle:hover,
.equipment-page-wrap .equip-model-toggle:hover{
  opacity: .92;
  transform: translateX(1px);
}

.equipment-page-wrap .equip-detail-panel{
  background:
    linear-gradient(180deg, rgba(248,251,255,.92), rgba(241,247,255,.96));
}

.equipment-page-wrap .equip-model-item{
  box-shadow: 0 1px 0 rgba(15,23,42,.02);
}

/* User management page ----------------------------------------------------- */
.user-management-layout{
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 1.25rem;
}

.user-management-layout > .col-md-4,
.user-management-layout > .col-md-8{
  width: auto;
  float: none;
}

.user-management-layout #createUserCard,
.user-management-layout #changePasswordCard{
  position: relative;
  overflow: hidden;
  border-radius: 22px;
}

.user-management-layout #createUserCard::before,
.user-management-layout #changePasswordCard::before{
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--app-primary), var(--app-primary-3));
}

.user-management-layout #adminPanel .card{
  border-radius: 22px;
  overflow: hidden;
}

.user-management-layout #adminPanel .table thead th{
  background: rgba(241,247,255,.96);
}

.user-management-layout #userTableBody tr{
  transition: background-color .16s ease, transform .16s ease;
}

.user-management-layout #userTableBody tr:hover{
  background: rgba(59,130,246,.04);
}

.app-permission-item{
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .72rem .85rem;
  border: 1px solid rgba(148,163,184,.16);
  border-radius: 14px;
  background: rgba(255,255,255,.72);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
  margin-bottom: .6rem;
}

.app-permission-item:hover{
  border-color: rgba(59,130,246,.28);
  box-shadow: 0 10px 22px rgba(2,6,23,.06);
}

.app-permission-item.is-selected{
  background: rgba(59,130,246,.07);
}

.app-permission-item.is-dragging{
  opacity: .55;
  transform: scale(.99);
}

.app-permission-item.is-locked{
  cursor: not-allowed;
  opacity: .72;
}

.app-permission-drag{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--app-muted);
  font-size: 1.05rem;
  flex: 0 0 auto;
  cursor: grab;
}

.app-permission-drag:active{
  cursor: grabbing;
}

html.theme-dark .app-permission-item{
  background: rgba(12,19,36,.72);
  border-color: rgba(148,163,184,.18);
}

html.theme-dark .app-permission-item.is-selected{
  background: rgba(59,130,246,.14);
}

@media (max-width: 991.98px){
  .user-management-layout{
    grid-template-columns: 1fr;
  }
}

/* Keep cursor neutral across the app, except text-entry fields */
*, *::before, *::after {
  cursor: default;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="time"],
input[type="week"],
textarea,
[contenteditable="true"] {
  cursor: text;
}

button:not(:disabled),
a[href],
select:not(:disabled),
input[type="checkbox"]:not(:disabled),
input[type="radio"]:not(:disabled),
[role="button"],
[data-action],
[data-view-row],
[data-view-sn],
[data-delete-group] {
  cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled {
  cursor: not-allowed;
}

/* Dark mode ---------------------------------------------------------------- */
html.theme-dark{
  color-scheme: dark;
}

html.theme-dark body{
  color: #e5e7eb;
  background-color: #09101f;
  background-image:
    linear-gradient(180deg, rgba(9,13,25,.96) 0%, rgba(8,12,24,.99) 100%),
    radial-gradient(560px 360px at 12% 0%, rgba(61,183,235,.22), transparent 60%),
    radial-gradient(560px 360px at 88% 10%, rgba(37,99,235,.20), transparent 60%);
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
}

html.theme-dark .app-navbar{
  background:
    linear-gradient(90deg, rgba(56,189,248,.18), rgba(37,99,235,.16), rgba(14,165,233,.12)),
    rgba(10,16,32,.72) !important;
  border-bottom: 1px solid rgba(148,163,184,.16) !important;
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
}

html.theme-dark .app-card{
  background: rgba(12,19,36,.72);
  border-color: rgba(148,163,184,.18);
  box-shadow: 0 20px 44px rgba(0,0,0,.26);
  backdrop-filter: blur(14px);
}

html.theme-dark .text-muted{
  color: #94a3b8 !important;
}

html.theme-dark .text-dark{
  color: #f1f5f9 !important;
}

html.theme-dark .app-card .card-header{
  background:
    linear-gradient(90deg, rgba(56,189,248,.16), rgba(37,99,235,.14), rgba(14,165,233,.10)),
    rgba(12,19,36,.80);
  border-bottom-color: rgba(148,163,184,.14);
}

html.theme-dark .app-card .card-header.bg-white{
  background:
    linear-gradient(90deg, rgba(56,189,248,.16), rgba(37,99,235,.14), rgba(14,165,233,.10)),
    rgba(12,19,36,.80) !important;
}

html.theme-dark .app-card .card-header,
html.theme-dark .app-card .card-header h1,
html.theme-dark .app-card .card-header h2,
html.theme-dark .app-card .card-header h3,
html.theme-dark .app-card .card-header h4,
html.theme-dark .app-card .card-header h5,
html.theme-dark .app-card .card-header h6{
  color: #e5e7eb;
}

html.theme-dark .app-card .card-header i{
  color: #e5e7eb;
  opacity: .95;
}

html.theme-dark .app-table thead th{
  color: #cbd5e1;
  background: rgba(10,16,32,.84) !important;
  border-bottom-color: rgba(148,163,184,.16);
}

html.theme-dark .app-sticky-head thead th{
  background: rgba(10,16,32,.94) !important;
  box-shadow: 0 1px 0 rgba(148,163,184,.18);
}

html.theme-dark .app-table td,
html.theme-dark .app-table th{
  border-color: rgba(148,163,184,.12);
}

html.theme-dark .app-muted{
  color: #94a3b8 !important;
}

html.theme-dark .app-chip{
  color: #f8fafc;
  border-color: rgba(148,163,184,.35);
  background:
    linear-gradient(90deg, rgba(96,165,250,.32), rgba(59,130,246,.28), rgba(14,165,233,.22)),
    rgba(8,13,26,.72);
  box-shadow: 0 10px 22px rgba(56,189,248,.18);
}

html.theme-dark .app-chip-btn:hover{
  background:
    linear-gradient(90deg, rgba(96,165,250,.38), rgba(59,130,246,.34), rgba(14,165,233,.28)),
    rgba(8,13,26,.8);
}

html.theme-dark .app-input,
html.theme-dark .app-select,
html.theme-dark .app-textarea{
  background-color: rgba(10,16,32,.72) !important;
  color: #e5e7eb !important;
  border-color: rgba(148,163,184,.26) !important;
}

html.theme-dark .app-input::placeholder,
html.theme-dark .app-textarea::placeholder{
  color: rgba(203,213,225,.72);
}

html.theme-dark .form-label,
html.theme-dark .form-check-label{
  color: #cbd5e1;
}

html.theme-dark .form-text{
  color: rgba(148,163,184,.92) !important;
}

html.theme-dark .input-group-text{
  background-color: rgba(15,23,42,.66) !important;
  color: #cbd5e1 !important;
  border-color: rgba(148,163,184,.22) !important;
}

html.theme-dark .modal-content{
  background: rgba(12,19,36,.92);
  color: #e5e7eb;
  border-color: rgba(148,163,184,.18);
  backdrop-filter: blur(18px);
}

html.theme-dark .modal-header,
html.theme-dark .modal-footer{
  border-color: rgba(148,163,184,.18);
}

html.theme-dark .modal-title{
  color: #f8fafc;
}

html.theme-dark .btn-close{
  filter: invert(1) grayscale(100%) brightness(200%);
  opacity: .85;
}

html.theme-dark .btn-close:hover{
  opacity: 1;
}

html.theme-dark .modal-body{
  color: #e5e7eb;
}

html.theme-dark .form-control,
html.theme-dark .form-select{
  background-color: rgba(10,16,32,.84) !important;
  color: #e5e7eb !important;
  border-color: rgba(148,163,184,.26) !important;
}

html.theme-dark .form-control::placeholder{
  color: rgba(203,213,225,.72);
}

html.theme-dark .form-control:focus,
html.theme-dark .form-select:focus{
  border-color: rgba(56,189,248,.55) !important;
  box-shadow: 0 0 0 .22rem rgba(56,189,248,.16) !important;
}

html.theme-dark .dropdown-menu{
  background: rgba(15,23,42,.96);
  border-color: rgba(148,163,184,.18);
  color: #e5e7eb;
}

html.theme-dark .dropdown-item{
  color: #e5e7eb;
}

html.theme-dark .dropdown-item:hover,
html.theme-dark .dropdown-item:focus{
  background: rgba(56,189,248,.14);
  color: #f8fafc;
}

html.theme-dark .modal-content{
  background: rgba(8, 13, 26, .98) !important;
  color: #e5e7eb !important;
  border-color: rgba(148, 163, 184, .24) !important;
  box-shadow: 0 28px 70px rgba(0, 0, 0, .42) !important;
}

html.theme-dark .modal-header,
html.theme-dark .modal-footer{
  background: transparent !important;
  border-color: rgba(148, 163, 184, .16) !important;
}

html.theme-dark .modal-title{
  color: #f8fafc !important;
}

html.theme-dark .modal-body{
  color: #e5e7eb !important;
}

html.theme-dark .modal-content .form-label,
html.theme-dark .modal-content .form-check-label{
  color: #cbd5e1 !important;
}

html.theme-dark .modal-content .app-input,
html.theme-dark .modal-content .app-select,
html.theme-dark .modal-content .app-textarea,
html.theme-dark .modal-content .form-control,
html.theme-dark .modal-content .form-select{
  background-color: rgba(15, 23, 42, .92) !important;
  color: #f8fafc !important;
  border-color: rgba(148, 163, 184, .30) !important;
}

html.theme-dark .modal-content .form-control::placeholder,
html.theme-dark .modal-content .app-input::placeholder,
html.theme-dark .modal-content .app-textarea::placeholder{
  color: rgba(203, 213, 225, .68) !important;
}

html.theme-dark .modal-content .form-control:focus,
html.theme-dark .modal-content .form-select:focus,
html.theme-dark .modal-content .app-input:focus,
html.theme-dark .modal-content .app-select:focus,
html.theme-dark .modal-content .app-textarea:focus{
  border-color: rgba(56, 189, 248, .55) !important;
  box-shadow: 0 0 0 .22rem rgba(56, 189, 248, .16) !important;
}

html.theme-dark .modal-content .btn-light{
  background: rgba(248, 250, 252, .96) !important;
  color: #0f172a !important;
  border-color: rgba(226, 232, 240, .92) !important;
}

html.theme-dark .modal-content .btn-secondary{
  background: rgba(51, 65, 85, .94) !important;
  color: #f8fafc !important;
  border-color: rgba(71, 85, 105, .96) !important;
}

html.theme-dark .modal-content .btn-primary,
html.theme-dark .modal-content .app-btn-primary{
  background: linear-gradient(135deg, #0f172a, #111827, #1e293b) !important;
  color: #ffffff !important;
  border-color: rgba(148, 163, 184, .34) !important;
  box-shadow: 0 14px 28px rgba(2, 6, 23, .34) !important;
}

html.theme-dark .modal-content .btn-primary:hover,
html.theme-dark .modal-content .app-btn-primary:hover{
  background: linear-gradient(135deg, #111827, #1f2937, #334155) !important;
  color: #ffffff !important;
}

.app-page{
  padding-bottom: 36px;
}

.app-navbar{
  min-height: 68px;
  backdrop-filter: blur(14px);
  background:
    linear-gradient(90deg, rgba(15,76,129,.12), rgba(30,58,138,.10), rgba(56,189,248,.10)),
    rgba(255,255,255,.70) !important;
  border-bottom: 1px solid var(--app-border) !important;
  box-shadow: 0 12px 26px rgba(2,6,23,.08);
}

.app-brand{
  letter-spacing: .3px;
  background: linear-gradient(135deg, var(--app-primary), var(--app-primary-2), var(--app-primary-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
}

.app-card{
  border: 1px solid var(--app-border);
  border-radius: 18px;
  box-shadow: var(--app-shadow-sm);
  overflow: hidden;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(16px);
}

.app-card .table-responsive{
  border-radius: 0 0 18px 18px;
}

.app-card .table-responsive::-webkit-scrollbar{
  height: 10px;
}

.app-card .table-responsive::-webkit-scrollbar-thumb{
  background: rgba(100,116,139,.32);
  border-radius: 999px;
}

.app-card .card-header{
  background:
    linear-gradient(90deg, rgba(15,76,129,.12), rgba(37,99,235,.10), rgba(61,183,235,.08)),
    rgba(255,255,255,.80);
  border-bottom: 1px solid var(--app-border);
}

.app-card .card-header.bg-white{
  background:
    linear-gradient(90deg, rgba(15,76,129,.12), rgba(37,99,235,.10), rgba(61,183,235,.08)),
    rgba(255,255,255,.80) !important;
}

.app-card:hover{
  box-shadow: var(--app-shadow), var(--app-glow);
}

.app-table thead th{
  color: #223149;
  background: rgba(248,250,252,.92) !important;
  border-bottom: 1px solid var(--app-border);
  padding: .92rem .9rem !important;
  font-size: .9rem;
  letter-spacing: .02em;
}

.app-table td, .app-table th{
  border-color: rgba(15,23,42,.08);
}

.app-sticky-head thead th{
  position: sticky;
  top: 0;
  z-index: 25;
  box-shadow: 0 1px 0 rgba(15,23,42,.12);
  background: rgba(248,250,252,.94) !important;
  backdrop-filter: blur(14px);
}

.app-table tbody td{
  padding: .82rem .9rem !important;
  font-size: .94rem;
}

.app-table tbody tr{
  font-size: .94rem;
}

.app-table tbody tr{
  transition: background-color .16s ease, transform .16s ease;
}

.app-table tbody tr:hover{
  background: rgba(59,130,246,.04);
}

.app-btn{
  border-radius: 14px !important;
  padding: .48rem .92rem;
  font-size: .92rem;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}
.app-btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(2,6,23,.10);
}

.app-btn-primary{
  border: none !important;
  background: linear-gradient(135deg, var(--app-primary), var(--app-primary-2), var(--app-primary-3)) !important;
  box-shadow: 0 14px 26px rgba(15,76,129,.24);
}

.app-btn-outline{
  border-radius: 14px !important;
}

.app-muted{
  color: var(--app-muted) !important;
}

.app-input, .app-select, .app-textarea{
  border-radius: var(--app-radius-md) !important;
  border-color: rgba(15,23,42,.14) !important;
  background: rgba(255,255,255,.78);
  box-shadow: none !important;
  backdrop-filter: blur(10px);
}
.app-input:focus, .app-select:focus, .app-textarea:focus{
  border-color: rgba(15,76,129,.45) !important;
  box-shadow: 0 0 0 .25rem rgba(15,76,129,.16) !important;
}

.app-chip{
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .65rem;
  border-radius: 999px;
  font-size: .82rem;
  border: 1px solid rgba(15,23,42,.16);
  background:
    linear-gradient(90deg, rgba(15,76,129,.10), rgba(30,58,138,.08), rgba(56,189,248,.08)),
    rgba(255,255,255,.74);
  backdrop-filter: blur(10px);
  color: #0f172a;
  box-shadow: 0 8px 20px rgba(15,76,129,.10);
}

.app-action-buttons{
  display: inline-flex;
  gap: .4rem;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.app-fab{
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1040;
}

.delivery-page-wrap,
.equipment-page-wrap,
.computer-page-wrap,
.scanner-page-wrap,
.docking-page-wrap,
.branches-page-wrap{
  /* Keep last rows away from viewport bottom + floating action button */
  padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px) + 96px);
}

@media (max-width: 576px){
  .delivery-page-wrap,
  .equipment-page-wrap,
  .computer-page-wrap,
  .scanner-page-wrap,
  .docking-page-wrap,
  .branches-page-wrap{
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px) + 104px);
  }
}

.app-fab-btn{
  width: 48px;
  height: 48px;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 999px !important;
  box-shadow: 0 22px 52px rgba(2,6,23,.22), 0 16px 40px rgba(15,76,129,.22);
}

.app-fab-btn i{
  font-size: 1.25rem;
  line-height: 1;
}

.app-fab-menu{
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(15,23,42,.12);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
}

html.theme-dark .app-fab-menu{
  background: rgba(17,24,39,.94);
  border-color: rgba(148,163,184,.16);
}

@media (max-width: 576px){
  .app-fab{ right: 14px; bottom: 14px; }
  .app-fab-btn{ width: 48px; height: 48px; }
}

.app-ellipsis{
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-ellipsis.is-truncated:hover{
  text-decoration: underline;
  text-decoration-color: rgba(37,99,235,.55);
  text-underline-offset: 3px;
}

.app-ellipsis-popover{
  position: absolute;
  z-index: 1080;
  max-width: min(520px, calc(100vw - 20px));
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(15,23,42,.12);
  border-radius: 14px;
  box-shadow: 0 20px 46px rgba(2,6,23,.18);
  padding: .6rem .65rem .55rem;
  backdrop-filter: blur(10px);
}

.app-ellipsis-popover-inner{
  display: flex;
  gap: .5rem;
  align-items: center;
}

.app-ellipsis-input{
  flex: 1 1 auto;
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,.12);
  background: rgba(248,250,252,.92);
  padding: .45rem .6rem;
  font-size: .95rem;
}

.app-ellipsis-hint{
  margin-top: .4rem;
  font-size: .8rem;
  font-weight: 600;
}

html.theme-dark .app-ellipsis-popover{
  background: rgba(17,24,39,.92);
  border-color: rgba(148,163,184,.16);
  box-shadow: 0 24px 56px rgba(0,0,0,.35);
}

html.theme-dark .app-ellipsis-input{
  background: rgba(15,23,42,.72);
  border-color: rgba(148,163,184,.18);
  color: #e5e7eb;
}

.app-icon-btn{
  width: 28px;
  height: 28px;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 999px !important;
}
.app-icon-btn i{
  font-size: .9rem;
  line-height: 1;
}

.page-hero,
.dashboard-hero,
.computer-hero{
  overflow: hidden;
}

.page-hero{
  padding: 1.15rem 1.25rem;
}

.page-hero .d-flex,
.computer-hero .d-flex{
  gap: 1rem;
}

.computer-page-wrap{
  max-width: 1360px;
  margin-left: auto;
  margin-right: auto;
}

.computer-hero{
  border-radius: 28px;
  padding: 1.15rem 1.35rem;
  background:
    linear-gradient(135deg, rgba(17,78,136,.96), rgba(37,99,235,.90) 62%, rgba(61,183,235,.84));
  color: #fff;
  box-shadow: 0 18px 48px rgba(17,78,136,.22);
  margin-bottom: 1rem;
}

.computer-hero h1{
  margin: 0;
  font-size: clamp(1.3rem, 2.4vw, 1.95rem);
  font-weight: 800;
  line-height: 1.12;
}

.computer-hero p{
  margin: .35rem 0 0;
  opacity: .92;
}

.computer-table{
  width: 100%;
  table-layout: fixed;
}

.computer-table th,
.computer-table td{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.computer-table th:nth-child(1), .computer-table td:nth-child(1){ width: 130px; }
.computer-table th:nth-child(2), .computer-table td:nth-child(2){ width: 200px; }
.computer-table th:nth-child(3), .computer-table td:nth-child(3){ width: 180px; }
.computer-table th:nth-child(4), .computer-table td:nth-child(4){ width: 80px; }

.computer-detail-grid{
  display: grid;
  gap: .85rem;
}

.computer-detail-item{
  padding: .85rem 1rem;
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 14px;
  background: rgba(248,250,252,.92);
}

.computer-detail-label{
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--app-muted);
  margin-bottom: .25rem;
}

.computer-detail-value{
  font-weight: 700;
  word-break: break-word;
}

.branches-hero,
.remote-hero,
.tool-hero,
.computer-hero{
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  box-shadow: 0 18px 48px rgba(17,78,136,.22);
}

.branches-hero,
.remote-hero{
  padding: 1.15rem 1.35rem;
  background:
    linear-gradient(135deg, rgba(17,78,136,.96), rgba(37,99,235,.90) 62%, rgba(61,183,235,.84));
  color: #fff;
}

.branches-hero h1,
.remote-hero h1,
.computer-hero h1{
  margin: 0;
  font-size: clamp(1.3rem, 2.4vw, 1.95rem);
  font-weight: 800;
  line-height: 1.12;
}

.branches-hero p,
.remote-hero p,
.computer-hero p{
  margin: .35rem 0 0;
  opacity: .92;
}

.branches-hero::after,
.remote-hero::after,
.tool-hero::after,
.computer-hero::after{
  content: "";
  position: absolute;
  inset: auto -120px -120px auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  pointer-events: none;
}

.factory-wrap{
  max-width: 784px;
}

.factory-backup-wrap{
  max-width: 980px;
}

.branches-page-wrap{
  max-width: 1320px;
}

.remote-shell{
  width: min(100%, 900px);
  max-width: 900px;
  margin: 0 auto;
}

.remote-toolbar{
  margin-top: 1rem;
  border-radius: 20px;
  padding: .95rem 1rem;
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(148,163,184,.16);
  box-shadow: 0 18px 40px rgba(2,6,23,.08);
}

html.theme-dark .remote-toolbar{
  background: rgba(12,19,36,.76);
}

.summary-card{
  min-width: 120px;
  padding: .75rem .95rem;
  border-radius: 18px;
  background: rgba(248,250,252,.92);
  border: 1px solid rgba(148,163,184,.14);
}

html.theme-dark .summary-card{
  background: rgba(15,23,42,.62);
}

.summary-label{
  font-size: .78rem;
  color: var(--app-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.summary-value{
  font-size: 1.15rem;
  font-weight: 800;
  margin-top: .15rem;
}

.branch-card{
  margin-top: 1rem;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(148,163,184,.16);
  background: rgba(255,255,255,.88);
  box-shadow: 0 18px 40px rgba(2,6,23,.08);
}

html.theme-dark .branch-card{
  background: rgba(12,19,36,.74);
}

.branch-card-head{
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid rgba(148,163,184,.14);
}

.branch-title{
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.branch-title strong{
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: 1.18rem;
  font-weight: 900;
  letter-spacing: .02em;
  color: var(--app-text);
}

.branch-title span{
  color: var(--app-muted);
  font-size: .86rem;
}

.branch-meta{
  display: flex;
  flex-wrap: wrap;
  gap: .65rem 1rem;
  color: var(--app-text);
  font-size: 1.02rem;
  line-height: 1.35;
}

.branch-meta b{
  color: var(--app-text);
  font-weight: 900;
  font-size: 1.06rem;
}

body.app-page .remote-shell .branch-meta span,
body.app-page .remote-shell .branch-meta b{
  color: var(--app-text);
  font-size: 1.02rem;
  line-height: 1.35;
}

html.theme-dark body.app-page .remote-shell .branch-meta span,
html.theme-dark body.app-page .remote-shell .branch-meta b{
  color: #e5e7eb;
}

.branch-pill{
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .62rem;
  border-radius: 999px;
  background: rgba(17,78,136,.08);
  color: var(--app-primary);
  font-weight: 700;
  font-size: .82rem;
}

html.theme-dark .branch-pill{
  background: rgba(61,183,235,.14);
  color: #bae6fd;
}

.remote-table{
  margin: 0;
  table-layout: fixed;
  width: 100%;
}

body.app-page .remote-shell .remote-table thead th{
  padding-top: .6rem;
  padding-bottom: .6rem;
  font-size: .82rem;
}

body.app-page .remote-shell .remote-table tbody td{
  padding-top: .58rem;
  padding-bottom: .58rem;
  font-size: .88rem;
}

body.app-page .remote-shell .remote-table .app-btn,
body.app-page .remote-shell .remote-table .app-icon-btn{
  transform: scale(.92);
  transform-origin: center;
}

.remote-table th,
.remote-table td{
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.remote-table thead th{
  background: rgba(248,250,252,.98);
  color: #64748b;
  border-bottom: 1px solid rgba(148,163,184,.14);
  padding: .86rem .95rem;
  font-size: .84rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

html.theme-dark .remote-table thead th{
  background: rgba(15,23,42,.92);
  color: #cbd5e1;
}

.remote-table tbody td{
  padding: .78rem .95rem;
  border-bottom: 1px solid rgba(148,163,184,.12);
}

.remote-table tbody tr:hover{
  background: rgba(61,183,235,.05);
}

html.theme-dark .remote-table tbody tr:hover{
  background: rgba(61,183,235,.08);
}

.device-pill{
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .62rem;
  border-radius: 999px;
  background: rgba(17,78,136,.08);
  color: var(--app-primary);
  font-weight: 700;
  font-size: .82rem;
}

html.theme-dark .device-pill{
  background: rgba(61,183,235,.14);
  color: #bae6fd;
}

.remote-code{
  font-weight: 700;
  color: var(--app-primary);
}

.remote-actions{
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
}

.icon-btn{
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.icon-btn i{
  font-size: .9rem;
  margin: 0 !important;
}

.modal-branch-name{
  font-size: 1rem;
  color: var(--app-muted);
}

.edit-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
}

@media (max-width: 992px){
  .edit-grid{
    grid-template-columns: 1fr;
  }
}

.equipment-page-wrap{
  max-width: 1120px;
}

.delivery-page-wrap{
  max-width: 1480px;
}

.tool-shell,
.sql-tool-shell{
  max-width: 1280px;
  margin: 0 auto;
}

.tool-hero{
  padding: 1.35rem 1.5rem;
  background: linear-gradient(135deg, rgba(17,78,136,.95), rgba(37,99,235,.92) 60%, rgba(61,183,235,.88));
  color: #fff;
}

.tool-hero h1{
  margin: .25rem 0 .5rem;
  font-size: clamp(1.45rem, 2.8vw, 2.2rem);
  font-weight: 800;
}

.tool-hero p{
  margin: 0;
  max-width: 760px;
  opacity: .92;
}

.tool-card{
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 24px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 18px 40px rgba(2,6,23,.08);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

html.theme-dark .tool-card{
  background: rgba(12,19,36,.72);
  border-color: rgba(148,163,184,.16);
  box-shadow: 0 18px 40px rgba(0,0,0,.24);
}

.tool-card-head{
  padding: 1rem 1.15rem;
  border-bottom: 1px solid rgba(148,163,184,.16);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.tool-card-title{
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: .55rem;
}

.tool-card-body{
  padding: 1.15rem;
}

.factory-table thead th,
.factory-backup-table thead th{
  padding-top: .65rem !important;
  padding-bottom: .65rem !important;
  font-size: .9rem;
}

.factory-table tbody td,
.factory-backup-table tbody td{
  padding-top: .6rem !important;
  padding-bottom: .6rem !important;
  font-size: .9rem;
}

.status-stack{
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .3rem;
  min-width: 190px;
}

.status-select{
  border-radius: var(--app-radius-md) !important;
  border-width: 2px !important;
  font-weight: 600;
  white-space: nowrap;
}

.status-select.is-pending{
  border-color: rgba(220,53,69,.85) !important;
  background-color: rgba(220,53,69,.06) !important;
}

.status-select.is-sent{
  border-color: rgba(25,135,84,.85) !important;
  background-color: rgba(25,135,84,.06) !important;
}

.app-search-sm{ width: 220px; }
.app-search-md{ width: 240px; }
.app-search-lg{ width: 260px; }

.app-page-header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.app-page-header .app-page-title{
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.app-page-header .app-page-title h1,
.app-page-header .app-page-title h2{
  margin: 0;
}

.app-page-header .app-page-meta{
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.app-toolbar{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1rem;
}

.app-toolbar .app-toolbar-actions{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}

.app-toolbar .form-control,
.app-toolbar .form-select{
  min-height: 38px;
}

.app-table thead th{
  vertical-align: middle;
}

.app-table th[style*="width"]{
  white-space: nowrap;
}

.app-pill-stack{
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .3rem;
  min-width: 190px;
}

.app-status-select{
  border-radius: var(--app-radius-md) !important;
  border-width: 2px !important;
  font-weight: 600;
  white-space: nowrap;
}

.app-status-select.is-pending{
  border-color: rgba(220,53,69,.85) !important;
  background-color: rgba(220,53,69,.06) !important;
}

.app-status-select.is-sent{
  border-color: rgba(25,135,84,.85) !important;
  background-color: rgba(25,135,84,.06) !important;
}

.app-badge-soft{
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .42rem .78rem;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(148,163,184,.16);
  box-shadow: 0 8px 20px rgba(15,76,129,.10);
}

.app-subtle-list{
  display: grid;
  gap: .75rem;
}

.app-subtle-item{
  padding: .85rem 1rem;
  border: 1px solid rgba(148,163,184,.16);
  border-radius: 14px;
  background: rgba(255,255,255,.74);
}

html.theme-dark .app-badge-soft{
  background: rgba(15,23,42,.72);
  border-color: rgba(148,163,184,.16);
}

html.theme-dark .app-subtle-item{
  background: rgba(15,23,42,.72);
  border-color: rgba(148,163,184,.16);
}

@media (max-width: 1200px){
  .computer-page-wrap{ max-width: 100%; }
}

@media (max-width: 991.98px){
  .page-hero,
  .computer-hero{
    border-radius: 22px;
  }
}

@media (max-width: 767.98px){
  .page-hero,
  .computer-hero{
    padding: 1rem;
  }

  .page-hero .d-flex,
  .computer-hero .d-flex{
    flex-direction: column;
    align-items: flex-start !important;
  }

  .page-hero h1,
  .computer-hero h1{
    font-size: clamp(1.25rem, 6.4vw, 1.65rem);
  }

  .app-card .card-header{
    padding: .9rem 1rem;
  }

  .app-card .card-body{
    padding: 1rem;
  }

  .app-table thead th,
  .app-table tbody td{
    padding-left: .75rem !important;
    padding-right: .75rem !important;
  }
}

@media (max-width: 576px){
  .app-card{
    border-radius: 16px;
  }

  .app-card .table-responsive{
    border-radius: 0 0 16px 16px;
  }

  .computer-hero{
    border-radius: 18px;
  }

  .computer-detail-item{
    padding: .8rem .85rem;
  }

  .app-search-sm,
  .app-search-md,
  .app-search-lg{
    width: 100%;
  }

  .app-page-header,
  .app-toolbar{
    align-items: stretch;
  }

  .app-page-header{
    flex-direction: column;
  }

  .app-toolbar .app-toolbar-actions{
    width: 100%;
  }

  .app-toolbar .app-toolbar-actions > *{
    flex: 1 1 100%;
  }
}

.zone-row td{
  background:
    linear-gradient(90deg, rgba(37,99,235,.10), rgba(124,58,237,.07), rgba(6,182,212,.06)),
    rgba(203,213,225,.96);
  font-weight: 700;
  color: #0f172a;
  border-top: 1px solid rgba(15,23,42,.10);
  border-bottom: 1px solid rgba(15,23,42,.08);
}
.zone-item-row td{
  background: rgba(241,245,249,.9);
  font-size: .92rem;
}

/* Scanner: slightly tighter row height for branch rows */
.scanner-page-wrap .zone-item-row td{
  padding-top: .77rem !important;
  padding-bottom: .77rem !important;
}

@media (max-width: 576px){
  .zone-item-row td{
    font-size: .88rem;
  }
}

html.theme-dark .zone-row td{
  background:
    linear-gradient(90deg, rgba(37,99,235,.20), rgba(124,58,237,.16), rgba(6,182,212,.14)),
    rgba(15,23,42,.86);
  color: #e5e7eb;
  border-top-color: rgba(148,163,184,.16);
  border-bottom-color: rgba(148,163,184,.12);
}
.zone-spacer td{
  border: none !important;
  background: #fff !important;
  height: 22px;
  padding: 0 !important;
}

.status-select{
  border-radius: var(--app-radius-md) !important;
  border-width: 2px !important;
  font-weight: 800;
  white-space: nowrap;
}
html.theme-dark .status-select{
  background-color: rgba(15,23,42,.92) !important;
  border-color: rgba(148,163,184,.6) !important;
  color: #e5e7eb !important;
}
html.theme-dark .zone-row .status-select{
  background-color: rgba(2,6,23,.85) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-color: rgba(255,255,255,.7) !important;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
.status-select.is-pending{
  border-color: rgba(220,53,69,.92) !important;
  background-color: rgba(220,53,69,.07) !important;
  box-shadow: inset 0 0 0 0 rgba(0,0,0,0) !important;
}
html.theme-dark .status-select.is-pending{
  background-color: rgba(127,29,29,.55) !important;
  border-color: rgba(248,113,113,.85) !important;
  color: #fee2e2 !important;
}
.status-select.is-pending:focus{
  border-color: rgba(220,53,69,.98) !important;
  box-shadow: 0 0 0 .25rem rgba(220,53,69,.18) !important;
}
.status-select.is-sent{
  border-color: rgba(25,135,84,.92) !important;
  background-color: rgba(25,135,84,.07) !important;
  box-shadow: inset 0 0 0 0 rgba(0,0,0,0) !important;
}
html.theme-dark .status-select.is-sent{
  background-color: rgba(20,83,45,.55) !important;
  border-color: rgba(34,197,94,.85) !important;
  color: #dcfce7 !important;
}
.status-select.is-sent:focus{
  border-color: rgba(25,135,84,.98) !important;
  box-shadow: 0 0 0 .25rem rgba(25,135,84,.18) !important;
}
html.theme-dark .status-select option{
  color: #0f172a;
}

.btn-add-branch{
  padding: .18rem .65rem;
  font-size: .86rem;
  background: linear-gradient(135deg, #60a5fa, #7c3aed) !important;
  border-color: rgba(96,165,250,.9) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 18px rgba(59,130,246,.25);
}
.btn-add-branch i{
  font-size: .9rem;
  line-height: 1;
}
.btn-del-zone{
  padding: .18rem .55rem;
  font-size: .86rem;
  background: rgba(248,113,113,.15);
  border-color: rgba(248,113,113,.7) !important;
  color: #ef4444 !important;
}
.btn-del-zone i{
  font-size: .9rem;
  line-height: 1;
}
.status-stack{
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .3rem;
  min-width: 190px;
}
.status-note{
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.2;
}

.status-pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .28rem .75rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .85rem;
  border: 1px solid transparent;
  color: #0f172a;
  white-space: nowrap;
}
.status-ready{
  background: rgba(250,204,21,.35);
  border-color: rgba(250,204,21,.7);
  color: #92400e;
}
.status-using{
  background: rgba(34,197,94,.25);
  border-color: rgba(34,197,94,.6);
  color: #14532d;
}
.status-down{
  background: rgba(239,68,68,.22);
  border-color: rgba(239,68,68,.6);
  color: #991b1b;
}
 .status-neutral{
  background: rgba(148,163,184,.22);
  border-color: rgba(148,163,184,.5);
  color: #0f172a;
 }
html.theme-dark .status-pill{
  color: #0b0b0b;
  font-weight: 800;
}
html.theme-dark .status-ready{
  background: rgba(250,204,21,.35);
  border-color: rgba(250,204,21,.8);
}
html.theme-dark .status-using{
  background: rgba(34,197,94,.32);
  border-color: rgba(34,197,94,.8);
}
html.theme-dark .status-down{
  background: rgba(239,68,68,.3);
  border-color: rgba(239,68,68,.8);
}

.equip-table thead th{
  position: sticky;
  top: 0;
  z-index: 2;
}
.equip-table tbody td{
  padding-top: .55rem !important;
  padding-bottom: .55rem !important;
  vertical-align: middle;
}
.equip-table thead th{
  padding-top: .65rem !important;
  padding-bottom: .65rem !important;
}
.equip-type, .equip-model{
  font-weight: 400;
  color: #0f172a;
}

.app-auth-page{
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
}
.app-auth-card{
  width: 100%;
  max-width: 480px;
  padding: 2rem;
  border: 1px solid rgba(15,23,42,.10);
  border-radius: var(--app-radius-lg);
  background: rgba(255,255,255,.90);
  box-shadow: var(--app-shadow);
}

.auth-v2{
  max-width: 860px;
  padding: 0;
  overflow: hidden;
}

.auth-solo{
  max-width: 520px;
  padding: 2.2rem;
  background:
    radial-gradient(520px 360px at 15% 0%, rgba(147,197,253,.42), transparent 60%),
    radial-gradient(520px 360px at 85% 10%, rgba(56,189,248,.28), transparent 60%),
    rgba(255,255,255,.86);
  border: 1px solid rgba(15,23,42,.12);
  box-shadow: var(--app-shadow);
  backdrop-filter: blur(14px);
}

.auth-badge{
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .8rem;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.14);
  background:
    linear-gradient(90deg, rgba(15,76,129,.16), rgba(30,58,138,.12), rgba(56,189,248,.12)),
    rgba(255,255,255,.9);
  font-weight: 700;
}

.auth-brand-title{
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: .3px;
  margin: .8rem 0 .4rem;
}

.auth-glow{
  position: relative;
}

.auth-glow::before{
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: calc(var(--app-radius-lg) + 2px);
  padding: 2px;
  background: linear-gradient(135deg, rgba(15,76,129,.45), rgba(56,189,248,.45));
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: .55;
}

.auth-v2 .auth-grid{
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 0;
}

.auth-v2 .auth-left{
  padding: 2.4rem 2.2rem;
}

.auth-v2 .auth-right{
  padding: 2.2rem;
  background:
    radial-gradient(520px 360px at 20% 0%, rgba(147,197,253,.35), transparent 60%),
    radial-gradient(520px 360px at 90% 10%, rgba(56,189,248,.25), transparent 60%),
    rgba(255,255,255,.76);
  border-left: 1px solid rgba(15,23,42,.08);
}

.auth-title{
  font-size: 1.85rem;
  font-weight: 800;
  margin-bottom: .4rem;
}

.auth-subtitle{
  color: var(--app-muted);
  font-size: .98rem;
}

.auth-feature{
  display: flex;
  gap: .7rem;
  align-items: flex-start;
  padding: .8rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.78);
  font-size: .92rem;
  margin-top: .75rem;
}

.auth-feature i{
  color: var(--app-primary);
  font-size: 1.1rem;
  margin-top: .1rem;
}

@media (max-width: 992px){
  .auth-v2 .auth-grid{
    grid-template-columns: 1fr;
  }
  .auth-v2 .auth-right{
    border-left: 0;
    border-top: 1px solid rgba(15,23,42,.08);
  }
}

html.theme-dark .auth-v2 .auth-right{
  background:
    radial-gradient(520px 360px at 20% 0%, rgba(56,189,248,.22), transparent 60%),
    radial-gradient(520px 360px at 90% 10%, rgba(37,99,235,.22), transparent 60%),
    rgba(10,16,32,.66);
  border-left-color: rgba(148,163,184,.16);
}

html.theme-dark .auth-solo{
  background:
    radial-gradient(520px 360px at 15% 0%, rgba(56,189,248,.26), transparent 60%),
    radial-gradient(520px 360px at 85% 10%, rgba(37,99,235,.24), transparent 60%),
    rgba(10,16,32,.72);
  border-color: rgba(148,163,184,.18);
}

html.theme-dark .auth-badge{
  background:
    linear-gradient(90deg, rgba(56,189,248,.22), rgba(37,99,235,.20), rgba(14,165,233,.18)),
    rgba(10,16,32,.78);
  border-color: rgba(148,163,184,.22);
  color: #e5e7eb;
}

html.theme-dark .auth-feature{
  background: rgba(10,16,32,.72);
  border-color: rgba(148,163,184,.16);
}

.auth-shell{
  width: 100%;
  max-width: 980px;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 24px;
  align-items: stretch;
}

.auth-panel{
  position: relative;
  padding: 2.5rem 2.25rem;
  border-radius: var(--app-radius-lg);
  border: 1px solid rgba(15,23,42,.10);
  background:
    radial-gradient(420px 320px at 20% 10%, rgba(147,197,253,.35), transparent 60%),
    radial-gradient(520px 360px at 90% 0%, rgba(191,219,254,.32), transparent 65%),
    rgba(255,255,255,.78);
  box-shadow: var(--app-shadow-sm);
  backdrop-filter: blur(12px);
  overflow: hidden;
}

.auth-panel::after{
  content: "";
  position: absolute;
  inset: auto -30% -40% auto;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(191,219,254,.45), transparent 70%);
  filter: blur(2px);
  opacity: .6;
}

.auth-panel .auth-brand{
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .35rem .75rem;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(8px);
  font-weight: 700;
}

.auth-panel h1{
  font-size: 1.95rem;
  font-weight: 800;
  letter-spacing: .2px;
  margin: 1.25rem 0 .5rem;
}

.auth-panel p{
  color: var(--app-muted);
  max-width: 360px;
}

.auth-panel .auth-metrics{
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
  margin-top: 1.5rem;
}

.auth-metric{
  padding: .85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.85);
  font-weight: 600;
  font-size: .9rem;
}

.auth-form-card{
  align-self: center;
}

@media (max-width: 992px){
  .auth-shell{
    grid-template-columns: 1fr;
  }
  .auth-panel{
    order: 2;
  }
  .auth-form-card{
    order: 1;
  }
}

html.theme-dark .auth-panel{
  background:
    radial-gradient(420px 320px at 20% 10%, rgba(56,189,248,.22), transparent 60%),
    radial-gradient(520px 360px at 90% 0%, rgba(37,99,235,.20), transparent 65%),
    rgba(10,16,32,.66);
  border-color: rgba(148,163,184,.18);
}

html.theme-dark .auth-panel .auth-brand{
  background: rgba(10,16,32,.7);
  border-color: rgba(148,163,184,.18);
  color: #e5e7eb;
}

html.theme-dark .auth-metric{
  background: rgba(10,16,32,.7);
  border-color: rgba(148,163,184,.18);
  color: #e5e7eb;
}

.app-chip-btn{
  text-decoration: none;
  user-select: none;
  font-weight: 700;
}
.app-chip-btn i{
  color: inherit;
}

.app-chip-btn:hover{
  background:
    linear-gradient(90deg, rgba(37,99,235,.08), rgba(124,58,237,.07), rgba(6,182,212,.06)),
    rgba(255,255,255,.88);
}

/* Read-only users can view but not edit */
.app-readonly-user .app-action-buttons button:not([data-allow-readonly]),
.app-readonly-user .app-action-buttons a:not([data-allow-readonly]),
.app-readonly-user button[title*="แก้ไข"]:not([data-allow-readonly]),
.app-readonly-user button[title*="เพิ่ม"]:not([data-allow-readonly]),
.app-readonly-user button[title*="บันทึก"]:not([data-allow-readonly]),
.app-readonly-user button[title*="Edit"]:not([data-allow-readonly]),
.app-readonly-user button[title*="Add"]:not([data-allow-readonly]),
.app-readonly-user button[title*="Save"]:not([data-allow-readonly]),
.app-readonly-user [data-action="edit"]:not([data-allow-readonly]),
.app-readonly-user .btn-danger:not([data-allow-readonly]),
.app-readonly-user button[type="submit"]:not([data-allow-readonly]){
  display: none !important;
}

.app-chip-danger{
  border-color: rgba(220,38,38,.28) !important;
  background: rgba(220,38,38,.12) !important;
  color: #b91c1c !important;
}

.app-chip-danger:hover{
  border-color: rgba(220,38,38,.38) !important;
  background: rgba(220,38,38,.16) !important;
}

#globalLoadingBar{
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--app-primary), var(--app-primary-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .18s ease;
  z-index: 9999;
  box-shadow: 0 10px 18px rgba(37,99,235,.25);
}

#globalLoadingBar.is-active{
  transform: scaleX(1);
}

.toast-container{
  z-index: 9999;
}

.app-empty{
  border: 1px dashed rgba(15,23,42,.16);
  border-radius: var(--app-radius-lg);
  padding: 1.25rem;
  background: rgba(255,255,255,.65);
}

body{
  font-family: Inter, "Bai Jamjuree", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #000;
  background: #fff !important;
  letter-spacing: 0;
}

.app-with-sidebar{
  padding-left: 288px;
}

.app-with-sidebar .app-navbar{
  display: none !important;
}

.app-sidebar{
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1100;
  width: 288px;
  min-height: 100vh;
  background: #000;
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-10px);
  transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}

.app-sidebar.is-ready{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
  transition: opacity .18s ease, transform .18s ease, visibility 0s;
}

.app-sidebar-brand{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px 18px;
  border-bottom: 1px solid rgba(255,255,255,.16);
  flex-shrink: 0;
}

.app-sidebar-logo{
  width: 44px;
  height: 44px;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
  display: block;
}

.app-sidebar-title{
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.app-sidebar-caption{
  margin-top: 4px;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  letter-spacing: .12em;
  color: rgba(255,255,255,.72);
}

.app-sidebar-nav{
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 0;
  /* min-height:0 lets this flex child actually shrink, so a long menu scrolls here
     instead of pushing the footer past the sidebar's hidden overflow. */
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.app-sidebar-link{
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 999px;
  color: rgba(255,255,255,.82);
  text-decoration: none;
  font-size: 15px;
  font-weight: 650;
}

.app-sidebar-link i{
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

.app-sidebar-link:hover,
.app-sidebar-link.is-active{
  color: #000;
  background: #fff;
}

.app-sidebar-footer{
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.16);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.app-sidebar-user{
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.86);
  font-size: 13px;
  font-weight: 700;
}

.app-sidebar-user span{
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-sidebar-actions{
  display: inline-flex;
  gap: 6px;
}

.app-sidebar-action{
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  color: #fff;
}

.app-sidebar-action:hover{
  background: #fff;
  color: #000;
}

body.app-page .app-sidebar-logout{
  width: auto;
  min-width: 92px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 12px;
  background: rgba(255,255,255,.14);
  font-size: 13px;
  font-weight: 700;
}

body.app-page .app-sidebar-logout:hover{
  background: #fff;
  color: #991b1b;
}

/* Sidebar profile and logout ---------------------------------------------- */
body.app-page .app-sidebar-footer{
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: .7rem;
  padding: .9rem .25rem .25rem;
}

body.app-page .app-sidebar-user{
  min-width: 0;
  padding: .6rem .7rem;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 13px;
  background: rgba(255,255,255,.08);
}

body.app-page .app-sidebar-user > i{
  color: #fca5a5;
  font-size: 1.25rem;
}

body.app-page .app-sidebar-user small{
  display: block;
  margin-bottom: .08rem;
  color: rgba(255,255,255,.58);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .05em;
}

body.app-page .app-sidebar-user span{
  max-width: 100%;
  color: #fff;
  font-size: .82rem;
  font-weight: 700;
}

body.app-page .app-sidebar-actions{
  display: block !important;
}

body.app-page .app-sidebar-logout{
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
}

.container,
.container-fluid{
  max-width: 1280px;
}

.app-card,
.modal-content,
.app-auth-card{
  border: 1px solid #e6e6e6;
  border-radius: 24px;
  background: #fff;
  box-shadow: none;
  backdrop-filter: none;
}

.app-card:hover{
  box-shadow: none;
}

.app-card .card-header,
.app-card .card-header.bg-white{
  background: #fff !important;
  border-bottom: 1px solid #e6e6e6;
}

.app-btn,
.btn{
  border-radius: 999px !important;
}

.app-btn-primary,
.btn-primary{
  background: #000 !important;
  border-color: #000 !important;
  color: #fff !important;
  box-shadow: none !important;
}

.btn-success{
  background: #dceeb1 !important;
  border-color: #dceeb1 !important;
  color: #000 !important;
}

.btn-warning{
  background: #f4ecd6 !important;
  border-color: #f4ecd6 !important;
  color: #000 !important;
}

.btn-danger{
  background: #efd4d4 !important;
  border-color: #efd4d4 !important;
  color: #000 !important;
}

.app-table thead th,
.app-sticky-head thead th{
  background: #f7f7f5 !important;
  color: #000;
  border-bottom-color: #e6e6e6;
}

.app-input,
.app-select,
.app-textarea{
  border-radius: 8px !important;
  background: #fff !important;
  border-color: #e6e6e6 !important;
}

.app-icon-btn{
  width: 34px;
  height: 34px;
}

.app-sync-done{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #dceeb1;
  color: #000;
  border: 1px solid #c8dea0;
}

.delivery-table .app-action-buttons{
  gap: 4px;
  justify-content: center;
}

.delivery-table .app-icon-btn,
.delivery-table .app-sync-done{
  width: 26px;
  height: 26px;
  min-width: 26px;
  padding: 0 !important;
}

.delivery-table .app-icon-btn i,
.delivery-table .app-sync-done i{
  font-size: .78rem;
}

.dashboard-shell{
  padding: 28px 28px 56px;
}

.dashboard-hero{
  min-height: 280px;
  border-radius: 32px;
  background:
    radial-gradient(900px 320px at 0% 0%, rgba(14, 116, 144, .20), transparent 60%),
    radial-gradient(760px 280px at 100% 0%, rgba(37, 99, 235, .18), transparent 58%),
    linear-gradient(135deg, #f8fbff 0%, #eef5ff 48%, #e7f4f4 100%);
  padding: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr);
  gap: 28px;
  align-items: center;
}

.dashboard-eyebrow{
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 700;
}

.dashboard-title{
  margin: 12px 0 14px;
  font-size: clamp(42px, 6vw, 76px);
  font-weight: 430;
  line-height: .98;
  letter-spacing: 0;
}

.dashboard-lead{
  max-width: 760px;
  font-size: 20px;
  line-height: 1.4;
  color: #334155;
}

.dashboard-asset{
  width: min(260px, 100%);
  justify-self: center;
}

.dashboard-summary-panel{
  margin-top: 4px;
  padding: 24px;
  border-radius: 26px;
  border: 1px solid rgba(148, 163, 184, .18);
  background:
    radial-gradient(700px 220px at 0% 0%, rgba(14, 116, 144, .10), transparent 60%),
    radial-gradient(700px 220px at 100% 0%, rgba(37, 99, 235, .08), transparent 60%),
    rgba(255, 255, 255, .80);
  box-shadow: 0 20px 46px rgba(15, 23, 42, .10);
  backdrop-filter: blur(14px);
}

.dashboard-summary-panel .dashboard-eyebrow{
  color: #0f766e;
}

.dashboard-summary-panel .dashboard-section-title{
  color: #0f172a;
}

.dashboard-summary-header{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-summary-total-wrap{
  min-width: 152px;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(15, 118, 110, .12), rgba(37, 99, 235, .10));
  border: 1px solid rgba(148, 163, 184, .18);
  text-align: right;
}

.dashboard-summary-total-label{
  font-size: 15px;
  font-weight: 700;
  color: #475569;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.dashboard-summary-total{
  margin-top: 6px;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: #0f172a;
}

.dashboard-branch-summary-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-branch-summary-item{
  padding: 16px 16px 15px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(239, 246, 255, .82));
  border: 1px solid rgba(148, 163, 184, .16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.68);
}

.dashboard-branch-summary-label{
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 4px;
}

.dashboard-range-form .dashboard-eyebrow,
.dashboard-range-form .dashboard-section-title,
.dashboard-today-card .dashboard-eyebrow,
.dashboard-today-card .dashboard-stat-label,
.dashboard-flow-card .dashboard-eyebrow,
.dashboard-flow-card .dashboard-section-title,
.dashboard-ranking-card .dashboard-eyebrow,
.dashboard-ranking-card .dashboard-section-title{
  color: #0f172a;
}

.dashboard-today-card .dashboard-stat-label{
  color: #475569;
}

.dashboard-range-form .dashboard-eyebrow,
.dashboard-flow-card .dashboard-eyebrow,
.dashboard-ranking-card .dashboard-eyebrow{
  color: #0f766e;
}

.dashboard-branch-summary-item strong{
  font-size: 1.55rem;
  font-weight: 800;
  color: #0f172a;
}

html.theme-dark .dashboard-hero{
  background:
    radial-gradient(900px 320px at 0% 0%, rgba(56, 189, 248, .18), transparent 60%),
    radial-gradient(760px 280px at 100% 0%, rgba(37, 99, 235, .20), transparent 58%),
    linear-gradient(135deg, #0b1220 0%, #0f172a 52%, #0b1b27 100%);
}

html.theme-dark .dashboard-lead{
  color: #cbd5e1;
}

html.theme-dark .dashboard-summary-panel{
  background:
    radial-gradient(700px 220px at 0% 0%, rgba(56, 189, 248, .12), transparent 60%),
    radial-gradient(700px 220px at 100% 0%, rgba(37, 99, 235, .10), transparent 60%),
    rgba(15, 23, 42, .86);
  border-color: rgba(148, 163, 184, .18);
}

html.theme-dark .dashboard-summary-total,
html.theme-dark .dashboard-branch-summary-item strong{
  color: #f8fafc;
}

html.theme-dark .dashboard-summary-total-label,
html.theme-dark .dashboard-branch-summary-label{
  color: #cbd5e1;
}

html.theme-dark .dashboard-branch-summary-item{
  background: linear-gradient(180deg, rgba(15, 23, 42, .88), rgba(30, 41, 59, .82));
  border-color: rgba(148, 163, 184, .16);
}

.dashboard-insights{
  display: grid;
  grid-template-columns: minmax(240px, .42fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 22px;
}

.dashboard-range-panel{
  margin-top: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: stretch;
}

.dashboard-range-form,
.dashboard-range-summary{
  border: 1px solid #e6e6e6;
  border-radius: 24px;
  background: #ffffff;
  color: #000;
  box-shadow: none;
}

.dashboard-range-form{
  padding: 22px 24px;
}

.dashboard-range-controls{
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.dashboard-range-field .form-label{
  font-size: .88rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: .35rem;
}

.dashboard-range-actions{
  grid-column: 1 / -1;
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dashboard-range-summary{
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 22px 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
}

.dashboard-range-summary[role="button"]:hover{
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .16), 0 14px 30px rgba(15, 23, 42, .06);
}

.dashboard-range-summary-label{
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 700;
  color: #475569;
}

.dashboard-range-summary-value{
  margin-top: 12px;
  font-size: clamp(40px, 5vw, 66px);
  font-weight: 800;
  line-height: .95;
  color: #0f172a;
}

.dashboard-range-summary-note{
  margin-top: 10px;
  font-size: .95rem;
  font-weight: 700;
  color: #475569;
}

.dashboard-today-card,
.dashboard-flow-card{
  border: 1px solid #e6e6e6;
  border-radius: 24px;
  padding: 24px;
  color: #000;
}

.dashboard-today-card{
  background: #c5b0f4;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 260px;
}

.dashboard-flow-card{
  background: #f7f7f5;
  min-height: 240px;
}

.dashboard-stat-number{
  margin-top: 16px;
  font-size: clamp(68px, 9vw, 118px);
  font-weight: 430;
  line-height: .9;
}

.dashboard-stat-label{
  margin-top: 12px;
  font-size: 20px;
  font-weight: 700;
}

.dashboard-section-title{
  margin: 6px 0 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0;
}

.dashboard-flow-icon{
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font-size: 1.25rem;
}

.dashboard-flow-chart{
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.dashboard-line-chart{
  display: block;
  width: 100%;
  min-height: 190px;
  overflow: visible;
}

.dashboard-line-chart line{
  stroke: #d8d8d8;
  stroke-width: 2;
}

.dashboard-line-chart polyline{
  fill: none;
  stroke: #ff3d8b;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-line-chart circle{
  fill: #ffffff;
  stroke: #000000;
  stroke-width: 3;
}

.dashboard-line-chart text{
  fill: #000000;
  font-size: 14px;
  font-weight: 800;
}

.dashboard-line-label{
  font-size: 12px !important;
  font-weight: 700 !important;
  fill: #555 !important;
}

.dashboard-flow-row{
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.dashboard-flow-rank{
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font-weight: 800;
}

.dashboard-flow-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  font-weight: 750;
}

.dashboard-flow-track{
  margin-top: 6px;
  height: 12px;
  border-radius: 999px;
  background: #e6e6e6;
  overflow: hidden;
}

.dashboard-flow-bar{
  height: 100%;
  border-radius: inherit;
  background: #ff3d8b;
}

.dashboard-flow-empty{
  padding: 28px;
  border: 1px dashed #d8d8d8;
  border-radius: 18px;
  background: #fff;
  color: #555;
  font-weight: 700;
  text-align: center;
}

html.theme-dark .dashboard-range-form,
html.theme-dark .dashboard-range-summary,
html.theme-dark .dashboard-today-card,
html.theme-dark .dashboard-flow-card,
html.theme-dark .dashboard-ranking-card{
  background: rgba(15, 23, 42, .90);
  border-color: rgba(148, 163, 184, .16);
  color: #e5e7eb;
}

html.theme-dark .dashboard-range-summary{
  background: linear-gradient(180deg, rgba(15, 23, 42, .94) 0%, rgba(15, 23, 42, .86) 100%);
}

html.theme-dark .dashboard-range-field .form-label,
html.theme-dark .dashboard-range-summary-label,
html.theme-dark .dashboard-range-summary-note{
  color: #cbd5e1;
}

html.theme-dark .dashboard-range-summary-value{
  color: #f8fafc;
}

html.theme-dark .dashboard-range-summary[role="button"]:hover{
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, .22), 0 14px 30px rgba(0, 0, 0, .18);
}

.dashboard-ranking-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.dashboard-ranking-card{
  border: 1px solid #e6e6e6;
  border-radius: 24px;
  padding: 24px;
  background: #f4ecd6;
  color: #000;
}

.dashboard-ranking-card:nth-child(2){
  background: #c8e6cd;
}

.dashboard-ranking-list{
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dashboard-rank-list-row{
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.dashboard-rank-list-row:last-child{
  border-bottom: 0;
}

.dashboard-rank-number{
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.dashboard-rank-text{
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #101010;
  line-height: 1.45;
}

.dashboard-rank-name{
  min-width: 0;
  display: block;
  flex: 1 1 auto;
  font-size: 16px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-rank-meta{
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: #333;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.dashboard-rank-meta strong{
  color: #000;
  font-size: 16px;
  font-weight: 900;
}

.dashboard-rank-line-chart{
  min-height: 260px;
}

.dashboard-line-legend{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin-top: 12px;
}

.dashboard-line-legend-item{
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  font-size: 13px;
}

.dashboard-line-legend-item span{
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font-weight: 800;
  font-size: 12px;
}

.dashboard-line-legend-item strong{
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.dashboard-card{
  min-height: 170px;
  border-radius: 24px;
  padding: 18px;
  border: 1px solid #e6e6e6;
  color: #000;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.dashboard-card-title{
  margin-top: 0;
  font-size: 18px;
  font-weight: 800;
}

.dashboard-card-copy{
  margin: 6px 0 0;
  color: rgba(0,0,0,.72);
  font-size: 13px;
}

@media (max-width: 1180px){
  .app-with-sidebar{ padding-left: 0; padding-top: 74px; }
  .app-sidebar{
    inset: 0 0 auto 0;
    width: auto;
    min-height: 74px;
    height: 74px;
    flex-direction: row;
    align-items: center;
    padding: 10px 14px;
  }
  .app-sidebar-brand{ border-bottom: 0; padding: 0; }
  .app-sidebar-nav{
    flex: 1 1 auto;
    flex-direction: row;
    overflow-x: auto;
    padding: 0 8px;
  }
  .app-sidebar-link span{ display: none; }
  .app-sidebar-footer{ margin-top: 0; border-top: 0; padding-top: 0; }
  .dashboard-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-insights{ grid-template-columns: 1fr; }
  .dashboard-ranking-grid{ grid-template-columns: 1fr; }
}

@media (max-width: 760px){
  .dashboard-shell{ padding: 16px 12px 36px; }
  .dashboard-hero{
    grid-template-columns: 1fr;
    border-radius: 0;
    margin-left: -12px;
    margin-right: -12px;
    padding: 30px 22px;
  }
  .dashboard-grid{ grid-template-columns: 1fr; }
}

/* Modern IT tone refinement ------------------------------------------------ */
:root{
  --app-bg: #f4f7fb;
  --app-surface: #ffffff;
  --app-surface-2: #f8fafc;
  --app-border: #dbe4ef;
  --app-text: #111827;
  --app-muted: #64748b;
  --app-primary: #2563eb;
  --app-primary-2: #0f766e;
  --app-primary-3: #06b6d4;
  --app-success: #16a34a;
  --app-danger: #dc2626;
  --app-warning: #d97706;
  --app-radius-lg: 18px;
  --app-radius-md: 12px;
  --app-radius-sm: 9px;
  --app-shadow: 0 18px 40px rgba(15, 23, 42, .08);
  --app-shadow-sm: 0 10px 24px rgba(15, 23, 42, .06);
}

body{
  color: var(--app-text);
  background:
    linear-gradient(180deg, #f8fafc 0%, #eef4fb 100%) !important;
}

.app-sidebar{
  background: #0b1220;
  border-right: 1px solid rgba(148, 163, 184, .16);
}

.app-sidebar-logo{
  border-radius: 0;
  background: transparent;
  object-fit: contain;
}

.app-sidebar-link{
  border-radius: 12px;
  color: rgba(226, 232, 240, .82);
}

.app-sidebar-link:hover,
.app-sidebar-link.is-active{
  color: #e0f2fe;
  background: rgba(14, 165, 233, .16);
}

.app-sidebar-action:hover{
  color: #e0f2fe;
  background: rgba(14, 165, 233, .18);
}

.app-card,
.modal-content,
.app-auth-card{
  border: 1px solid var(--app-border) !important;
  border-radius: var(--app-radius-lg) !important;
  background: var(--app-surface) !important;
  box-shadow: var(--app-shadow-sm) !important;
}

.app-card .card-header,
.app-card .card-header.bg-white{
  background: #ffffff !important;
  border-bottom: 1px solid var(--app-border) !important;
}

.app-btn-primary,
.btn-primary{
  background: #2563eb !important;
  border-color: #2563eb !important;
}

.btn-success{
  background: #16a34a !important;
  border-color: #16a34a !important;
  color: #fff !important;
}

.btn-warning{
  background: #f59e0b !important;
  border-color: #f59e0b !important;
  color: #111827 !important;
}

.btn-danger{
  background: #dc2626 !important;
  border-color: #dc2626 !important;
  color: #fff !important;
}

.app-table thead th,
.app-sticky-head thead th{
  background: #eef4fb !important;
  color: #334155 !important;
  border-bottom-color: #d8e2ef;
}

.app-table td,
.app-table th{
  border-color: #e5edf6;
}

body.app-page .app-card,
body.app-page .panel,
body.app-page .branch-card,
body.app-page .table-wrap,
body.app-page .remote-toolbar{
  margin-bottom: 1.25rem;
}

body.app-page .delivery-shell,
body.app-page .remote-shell,
body.app-page .dashboard-shell{
  padding-bottom: 3.5rem;
}

.app-input,
.app-select,
.app-textarea{
  background: #fff !important;
  border-color: #d7e1ec !important;
}

.dashboard-shell{
  padding: 36px 24px 44px;
}

.dashboard-hero{
  min-height: 220px;
  border-radius: 22px;
  padding: 30px;
  background:
    linear-gradient(135deg, #e0f2fe 0%, #e8f5ff 46%, #eef2ff 100%);
  border: 1px solid #d4e8f7;
}

.dashboard-title{
  margin: 10px 0 12px;
  font-size: clamp(34px, 4.6vw, 58px);
  font-weight: 650;
}

.dashboard-lead{
  font-size: 17px;
}

.dashboard-asset{
  width: min(210px, 100%);
}

.dashboard-insights,
.dashboard-ranking-grid,
.dashboard-grid{
  gap: 14px;
  margin-top: 16px;
}

.dashboard-today-card,
.dashboard-flow-card,
.dashboard-ranking-card,
.dashboard-card{
  border-color: #dbe4ef;
  border-radius: 18px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, .07);
}

.dashboard-today-card,
.dashboard-flow-card{
  min-height: 205px;
  padding: 18px;
}

.dashboard-today-card{
  background: #eef2ff;
}

.dashboard-flow-card{
  background: #ffffff;
}

.dashboard-ranking-card{
  padding: 18px;
  background: #f8fafc;
}

.dashboard-ranking-card:nth-child(2){
  background: #f0fdfa;
}

.dashboard-ranking-card:nth-child(3){
  background: #eef2ff;
}

.dashboard-stat-number{
  margin-top: 10px;
  font-size: clamp(52px, 6.6vw, 84px);
  font-weight: 650;
}

.dashboard-stat-label{
  margin-top: 8px;
  font-size: 16px;
}

.dashboard-today-list{
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dashboard-today-item{
  padding: 8px 0;
  border-top: 1px solid rgba(15, 23, 42, .1);
}

.dashboard-today-branch{
  color: #0f172a;
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-today-detail{
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-section-title{
  font-size: 22px;
}

.dashboard-eyebrow{
  color: #475569;
  font-size: 11px;
}

.dashboard-flow-icon{
  width: 36px;
  height: 36px;
  background: #0f172a;
  font-size: 1rem;
}

.dashboard-flow-chart{
  gap: 8px;
}

.dashboard-line-chart{
  min-height: 190px;
}

.dashboard-line-chart polyline{
  stroke: #2563eb;
  stroke-width: 3.5;
}

.dashboard-line-chart circle{
  stroke: #0f172a;
  stroke-width: 2.5;
}

.dashboard-line-chart text{
  font-size: 12px;
}

.dashboard-flow-empty{
  padding: 18px;
  border-color: #cbd5e1;
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
  color: #64748b;
}

.dashboard-ranking-list{
  margin-top: 12px;
  gap: 6px;
}

.dashboard-rank-list-row{
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 0;
}

.dashboard-rank-number{
  width: 28px;
  height: 28px;
  background: #0f172a;
  font-size: 12px;
}

.dashboard-rank-name{
  font-size: 14px;
  font-weight: 750;
}

.dashboard-rank-meta{
  padding: 4px 9px;
  background: #e0f2fe;
  color: #075985;
  font-size: 12px;
}

.dashboard-rank-meta strong{
  color: #0f172a;
  font-size: 14px;
}

.dashboard-card{
  min-height: 142px;
  padding: 16px;
  background: #fff !important;
}

.dashboard-card-title{
  font-size: 18px;
}

.dashboard-card-copy{
  color: #64748b;
  font-size: 13px;
}

html.theme-dark body{
  color: #e5e7eb;
  background:
    linear-gradient(180deg, #080d18 0%, #0f172a 100%) !important;
}

html.theme-dark .app-sidebar{
  background: #050816;
  border-right-color: rgba(148, 163, 184, .14);
}

html.theme-dark .app-card,
html.theme-dark .modal-content,
html.theme-dark .app-auth-card{
  background: rgba(15, 23, 42, .92);
  border-color: rgba(148, 163, 184, .18);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .28);
}

html.theme-dark .app-card .card-header,
html.theme-dark .app-card .card-header.bg-white{
  background: rgba(15, 23, 42, .96) !important;
  border-bottom-color: rgba(148, 163, 184, .18);
}

html.theme-dark .app-table thead th,
html.theme-dark .app-sticky-head thead th{
  background: rgba(15, 23, 42, .96) !important;
  color: #cbd5e1;
  border-bottom-color: rgba(148, 163, 184, .16);
}

html.theme-dark .app-table td,
html.theme-dark .app-table th{
  border-color: rgba(148, 163, 184, .12);
}

html.theme-dark .dashboard-hero{
  background:
    linear-gradient(135deg, rgba(30, 41, 59, .96) 0%, rgba(15, 23, 42, .98) 100%);
  border-color: rgba(148, 163, 184, .16);
}

html.theme-dark .dashboard-today-card,
html.theme-dark .dashboard-flow-card,
html.theme-dark .dashboard-ranking-card,
html.theme-dark .dashboard-card{
  color: #e5e7eb;
  background: rgba(15, 23, 42, .92) !important;
  border-color: rgba(148, 163, 184, .18);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .28);
}

html.theme-dark .dashboard-card-copy,
html.theme-dark .dashboard-eyebrow,
html.theme-dark .dashboard-line-label{
  color: #94a3b8 !important;
  fill: #94a3b8 !important;
}

html.theme-dark .dashboard-flow-empty{
  background: rgba(15, 23, 42, .7);
  border-color: rgba(148, 163, 184, .22);
  color: #94a3b8;
}

html.theme-dark .dashboard-line-chart line{
  stroke: rgba(148, 163, 184, .26);
}

html.theme-dark .dashboard-line-chart text{
  fill: #e5e7eb;
}

html.theme-dark .dashboard-line-chart circle{
  fill: #0f172a;
  stroke: #e0f2fe;
}

html.theme-dark .dashboard-rank-number,
html.theme-dark .dashboard-flow-icon{
  background: #e0f2fe;
  color: #0f172a;
}

html.theme-dark .dashboard-rank-list-row{
  border-bottom-color: rgba(148, 163, 184, .14);
}

html.theme-dark .dashboard-today-item{
  border-top-color: rgba(148, 163, 184, .14);
}

html.theme-dark .dashboard-today-branch{
  color: #e5e7eb;
}

html.theme-dark .dashboard-today-detail{
  color: #94a3b8;
}

html.theme-dark .dashboard-rank-text,
html.theme-dark .dashboard-rank-name{
  color: #e5e7eb;
}

html.theme-dark .dashboard-rank-meta{
  background: rgba(14, 165, 233, .16);
  color: #bae6fd;
}

html.theme-dark .dashboard-rank-meta strong{
  color: #f8fafc;
}

@media (max-width: 1180px){
  .app-sidebar{
    border-right: 0;
    border-bottom: 1px solid rgba(148, 163, 184, .16);
  }
}

@media (max-width: 760px){
  .dashboard-shell{
    padding: 14px 12px 32px;
  }

  .dashboard-hero{
    padding: 24px 18px;
  }

  .dashboard-rank-text{
    gap: 8px;
  }

  .dashboard-rank-name{
    font-size: 13px;
  }

  .dashboard-rank-meta{
    font-size: 11px;
  }
}

/* Collapsible sidebar for 15.6-inch work screens -------------------------- */
.app-with-sidebar{
  padding-left: 236px;
  transition: padding-left 350ms cubic-bezier(.4, 0, .2, 1);
}

.app-sidebar{
  width: 236px;
  padding: 12px;
  overflow: hidden;
  transition:
    width 350ms cubic-bezier(.4, 0, .2, 1),
    padding 350ms cubic-bezier(.4, 0, .2, 1);
  will-change: width, padding;
}

.app-sidebar-brand{
  justify-content: flex-start;
  gap: 10px;
  padding: 6px 4px 12px;
}

.app-sidebar-brand-main{
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 6px;
  background: transparent;
  color: inherit;
  text-align: left;
  transition: none;
}

.app-sidebar-brand-main:hover{
  background: rgba(14, 165, 233, .14);
}

.app-sidebar-brand-text{
  min-width: 0;
  max-width: 180px;
  overflow: hidden;
  white-space: nowrap;
  opacity: 1;
  transform: translateX(0);
  transition:
    max-width 350ms cubic-bezier(.4, 0, .2, 1),
    opacity 250ms cubic-bezier(.4, 0, .2, 1),
    transform 350ms cubic-bezier(.4, 0, .2, 1);
}

.app-sidebar-title{
  font-size: 17px;
}

.app-sidebar-logo{
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  transition: none;
}

.app-sidebar-nav{
  gap: 4px;
  padding: 12px 0;
}

.app-sidebar-link{
  min-height: 36px;
  padding: 7px 9px;
  font-size: 13.5px;
  transition: none;
}

.app-sidebar-link span,
.app-sidebar-user span{
  display: block;
  max-width: 180px;
  overflow: hidden;
  white-space: nowrap;
  opacity: 1;
  transform: translateX(0);
  transition:
    max-width 350ms cubic-bezier(.4, 0, .2, 1),
    opacity 250ms cubic-bezier(.4, 0, .2, 1),
    transform 350ms cubic-bezier(.4, 0, .2, 1);
}

.app-sidebar-action{
  width: 32px;
  height: 32px;
  transition: none;
}

.container,
.container-fluid{
  max-width: min(100%, 1400px);
}

.dashboard-ranking-grid{
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-ranking-card:nth-child(3){
  grid-column: 1 / -1;
}

.app-sidebar-collapsed.app-with-sidebar{
  padding-left: 74px;
}

.app-sidebar-collapsed .app-sidebar{
  width: 74px;
  padding: 10px 8px;
}

.app-sidebar-collapsed .app-sidebar-brand{
  justify-content: center;
  padding: 6px 0 12px;
}

.app-sidebar-collapsed .app-sidebar-brand-main{
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 4px;
}

.app-sidebar-collapsed .app-sidebar-brand-text,
.app-sidebar-collapsed .app-sidebar-link span,
.app-sidebar-collapsed .app-sidebar-user span{
  max-width: 0;
  opacity: 0;
  transform: translateX(-8px);
}

.app-sidebar-collapsed .app-sidebar-logo{
  width: 34px;
  height: 34px;
  opacity: .96;
}

.app-sidebar-collapsed .app-sidebar-nav{
  align-items: center;
  padding-top: 10px;
  padding-bottom: 10px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.app-sidebar-collapsed .app-sidebar-nav::-webkit-scrollbar{
  width: 0;
  height: 0;
  display: none;
}

.app-sidebar-collapsed .app-sidebar-link{
  width: 42px;
  min-height: 38px;
  justify-content: center;
  padding: 0;
}

.app-sidebar-collapsed .app-sidebar-link i{
  width: auto;
  font-size: 1.08rem;
}

.app-sidebar-collapsed .app-sidebar-footer{
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  opacity: .98;
}

.app-sidebar-collapsed .app-sidebar-user{
  width: 42px;
  min-height: 42px;
  padding: 0;
  justify-content: center;
  border-radius: 13px;
  background: rgba(14, 165, 233, .12);
  border-color: rgba(56, 189, 248, .24);
}

.app-sidebar-collapsed .app-sidebar-actions{
  width: 42px;
  flex-direction: column;
}

.app-sidebar-collapsed .app-sidebar-user > i{
  margin: 0;
  font-size: 1.25rem;
}

.app-sidebar-collapsed .app-sidebar-user > div,
.app-sidebar-collapsed .app-sidebar-logout span{
  display: none;
}

.app-sidebar-collapsed .app-sidebar-logout{
  width: 42px !important;
  min-width: 42px !important;
  min-height: 42px;
  padding: 0;
  border-radius: 13px;
  justify-content: center;
  color: #fecaca;
  background: rgba(239, 68, 68, .12);
  border-color: rgba(248, 113, 113, .24);
}

.app-sidebar-collapsed .app-sidebar-logout i{
  font-size: 1.08rem;
}

.app-sidebar-collapsed .app-sidebar-logout:hover{
  color: #fee2e2;
  background: rgba(239, 68, 68, .28);
}

@media (max-width: 1180px){
  .app-with-sidebar,
  .app-sidebar-collapsed.app-with-sidebar{
    padding-left: 0;
    padding-top: 68px;
  }

  .app-sidebar,
  .app-sidebar-collapsed .app-sidebar{
    inset: 0 0 auto 0;
    width: auto;
    min-height: 64px;
    height: 64px;
    flex-direction: row;
    align-items: center;
    padding: 8px 10px;
  }

  .app-sidebar-brand,
  .app-sidebar-collapsed .app-sidebar-brand{
    justify-content: flex-start;
    border-bottom: 0;
    padding: 0;
  }

  .app-sidebar-brand-main,
  .app-sidebar-collapsed .app-sidebar-brand-main{
    width: 46px;
    height: 46px;
    justify-content: center;
    padding: 4px;
  }

  .app-sidebar-brand-text,
  .app-sidebar-collapsed .app-sidebar-brand-text{
    display: none;
  }

  .app-sidebar-nav,
  .app-sidebar-collapsed .app-sidebar-nav{
    flex: 1 1 auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .app-sidebar-nav::-webkit-scrollbar,
  .app-sidebar-collapsed .app-sidebar-nav::-webkit-scrollbar{
    width: 0;
    height: 0;
    display: none;
  }

  .app-sidebar-link,
  .app-sidebar-collapsed .app-sidebar-link{
    width: 42px;
    min-width: 42px;
    min-height: 42px;
    justify-content: center;
    padding: 0;
  }

  .app-sidebar-link span,
  .app-sidebar-user span{
    display: none;
  }

  .app-sidebar-footer,
  .app-sidebar-collapsed .app-sidebar-footer{
    margin-top: 0;
    border-top: 0;
    padding-top: 0;
    flex-direction: row;
  }

  .app-sidebar-actions,
  .app-sidebar-collapsed .app-sidebar-actions{
    flex-direction: row;
  }

  .dashboard-ranking-grid{
    grid-template-columns: 1fr;
  }

  .dashboard-ranking-card:nth-child(3){
    grid-column: auto;
  }

  .dashboard-range-panel{
    grid-template-columns: 1fr;
  }

  .dashboard-range-controls{
    grid-template-columns: 1fr;
  }

  .dashboard-range-actions{
    grid-column: auto;
    justify-content: flex-start;
  }
}

/* Login dark-mode readability --------------------------------------------- */
html.theme-dark .app-auth-page{
  color: #e5e7eb;
  background:
    linear-gradient(180deg, #07111f 0%, #0f172a 100%) !important;
}

html.theme-dark .app-auth-page .app-auth-card,
html.theme-dark .app-auth-page .auth-solo{
  background: #111c2e !important;
  border-color: rgba(148, 163, 184, .28) !important;
  color: #e5e7eb !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .42) !important;
}

html.theme-dark .app-auth-page .auth-brand-title{
  color: #f8fafc;
  text-shadow: none;
}

html.theme-dark .app-auth-page .auth-subtitle,
html.theme-dark .app-auth-page .form-text{
  color: #b6c2d1 !important;
}

html.theme-dark .app-auth-page .form-label,
html.theme-dark .app-auth-page .form-check-label{
  color: #e2e8f0 !important;
}

html.theme-dark .app-auth-page .auth-badge{
  background: rgba(14, 165, 233, .16) !important;
  border-color: rgba(125, 211, 252, .26) !important;
  color: #e0f2fe !important;
}

html.theme-dark .app-auth-page .app-input{
  background: #0b1220 !important;
  border-color: rgba(148, 163, 184, .34) !important;
  color: #f8fafc !important;
}

html.theme-dark .app-auth-page .app-input:focus{
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 .22rem rgba(56, 189, 248, .18) !important;
}

html.theme-dark .app-auth-page .app-input::placeholder{
  color: #94a3b8 !important;
}

html.theme-dark .app-auth-page .form-check-input{
  background-color: #0b1220;
  border-color: rgba(148, 163, 184, .42);
}

html.theme-dark .app-auth-page .alert-danger{
  color: #fecaca;
  background: rgba(127, 29, 29, .42);
  border-color: rgba(248, 113, 113, .32);
}

/* Dashboard ranking details ----------------------------------------------- */
.dashboard-rank-button{
  width: 100%;
  border: 0;
  background: transparent;
  padding-left: 0;
  padding-right: 0;
  text-align: left;
  color: inherit;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.dashboard-rank-button:hover .dashboard-rank-text{
  transform: translateX(2px);
}

.dashboard-rank-button:focus-visible{
  outline: 2px solid rgba(37, 99, 235, .45);
  outline-offset: 4px;
  border-radius: 14px;
}

.dashboard-detail-overlay{
  position: fixed;
  inset: 0;
  z-index: 2400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 6, 23, .52);
  backdrop-filter: blur(10px);
}

.dashboard-detail-overlay.is-open{
  display: flex;
}

.dashboard-detail-dialog{
  width: min(860px, 100%);
  max-height: min(82vh, 860px);
  overflow: auto;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, .18);
  background:
    radial-gradient(520px 260px at 10% 0%, rgba(56, 189, 248, .10), transparent 60%),
    radial-gradient(520px 260px at 90% 0%, rgba(37, 99, 235, .10), transparent 60%),
    #ffffff;
  box-shadow: 0 28px 72px rgba(15, 23, 42, .32);
  padding: 20px;
}

.dashboard-detail-head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-detail-summary{
  margin-top: 10px;
  color: #475569;
  font-size: 14px;
  font-weight: 700;
}

.dashboard-detail-close{
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: #e2e8f0;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dashboard-detail-close:hover{
  background: #cbd5e1;
}

.dashboard-detail-list{
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.dashboard-detail-item{
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(148, 163, 184, .18);
}

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

.dashboard-detail-index{
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
}

.dashboard-detail-content{
  min-width: 0;
}

.dashboard-detail-main{
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}

.dashboard-detail-sub{
  margin-top: 3px;
  font-size: 13px;
  color: #475569;
}

.dashboard-detail-note{
  margin-top: 4px;
  font-size: 13px;
  color: #0369a1;
}

html.theme-dark .dashboard-detail-overlay{
  background: rgba(2, 6, 23, .72);
}

html.theme-dark .dashboard-detail-dialog{
  background:
    radial-gradient(520px 260px at 10% 0%, rgba(56, 189, 248, .12), transparent 60%),
    radial-gradient(520px 260px at 90% 0%, rgba(37, 99, 235, .12), transparent 60%),
    rgba(15, 23, 42, .96);
  border-color: rgba(148, 163, 184, .18);
  color: #e5e7eb;
}

html.theme-dark .dashboard-detail-summary{
  color: #cbd5e1;
}

html.theme-dark .dashboard-detail-close{
  background: rgba(148, 163, 184, .16);
  color: #e5e7eb;
}

html.theme-dark .dashboard-detail-close:hover{
  background: rgba(148, 163, 184, .24);
}

html.theme-dark .dashboard-detail-item{
  border-bottom-color: rgba(148, 163, 184, .16);
}

html.theme-dark .dashboard-detail-index{
  background: #e0f2fe;
  color: #0f172a;
}

html.theme-dark .dashboard-detail-main{
  color: #f8fafc;
}

html.theme-dark .dashboard-detail-sub{
  color: #cbd5e1;
}

html.theme-dark .dashboard-detail-note{
  color: #7dd3fc;
}

/* Dark mode contrast pass -------------------------------------------------- */
html.theme-dark .app-sidebar{
  background: #070b17;
  border-right-color: rgba(148, 163, 184, .16);
}

html.theme-dark .app-sidebar-brand{
  border-bottom-color: rgba(148, 163, 184, .16);
}

html.theme-dark .app-sidebar-caption{
  color: rgba(203, 213, 225, .68);
}

html.theme-dark .app-sidebar-link{
  color: #cbd5e1;
}

html.theme-dark .app-sidebar-link:hover,
html.theme-dark .app-sidebar-link.is-active{
  color: #e0f2fe;
  background: rgba(14, 165, 233, .18);
}

html.theme-dark .app-sidebar-user{
  color: #cbd5e1;
}

html.theme-dark .app-sidebar-action{
  background: rgba(148, 163, 184, .14);
  color: #e5e7eb;
}

html.theme-dark .app-sidebar-action:hover{
  background: #e0f2fe;
  color: #0f172a;
}

html.theme-dark .app-btn{
  border-color: rgba(148, 163, 184, .24);
}

html.theme-dark .app-btn-primary,
html.theme-dark .btn-primary{
  background: linear-gradient(135deg, #38bdf8, #2563eb, #1d4ed8) !important;
  color: #ffffff !important;
  border-color: rgba(56, 189, 248, .45) !important;
  box-shadow: 0 14px 28px rgba(37, 99, 235, .34);
}

html.theme-dark .app-btn-primary:hover,
html.theme-dark .btn-primary:hover{
  background: linear-gradient(135deg, #4cc3fb, #3b82f6, #2563eb) !important;
  color: #ffffff !important;
  box-shadow: 0 16px 30px rgba(37, 99, 235, .42);
}

html.theme-dark .app-btn-outline,
html.theme-dark .btn-outline{
  background: rgba(15, 23, 42, .82);
  border-color: rgba(148, 163, 184, .38) !important;
  color: #f8fafc !important;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .35);
}

html.theme-dark .app-btn-outline:hover,
html.theme-dark .btn-outline:hover{
  background: rgba(30, 41, 59, .96);
  border-color: rgba(56, 189, 248, .48) !important;
  color: #ffffff !important;
}

html.theme-dark .btn-light,
html.theme-dark .btn-light.app-btn{
  background: rgba(248, 250, 252, .96) !important;
  border-color: rgba(226, 232, 240, .92) !important;
  color: #0f172a !important;
}

html.theme-dark .btn-light:hover,
html.theme-dark .btn-light.app-btn:hover{
  background: #ffffff !important;
  color: #0f172a !important;
}

html.theme-dark .btn-secondary,
html.theme-dark .btn-secondary.app-btn{
  background: rgba(51, 65, 85, .94) !important;
  border-color: rgba(71, 85, 105, .96) !important;
  color: #f8fafc !important;
}

html.theme-dark .btn-success,
html.theme-dark .btn-warning,
html.theme-dark .btn-danger{
  color: #0f172a !important;
}

html.theme-dark .app-btn:hover{
  box-shadow: 0 12px 22px rgba(0, 0, 0, .28);
}

html.theme-dark .app-btn i,
html.theme-dark .btn-primary i,
html.theme-dark .btn-outline i{
  color: inherit;
}

html.theme-dark .app-table tbody tr{
  background: rgba(15, 23, 42, .62);
}

html.theme-dark .app-table tbody tr:hover{
  background: rgba(30, 41, 59, .82);
}

html.theme-dark .app-table tbody td{
  color: #e5e7eb;
}

html.theme-dark .app-table tbody tr td,
html.theme-dark .app-table tbody tr th{
  border-color: rgba(148, 163, 184, .10);
}

html.theme-dark .app-chip-btn{
  color: #e5e7eb;
}

html.theme-dark .app-chip-btn:hover{
  background:
    linear-gradient(90deg, rgba(96, 165, 250, .22), rgba(59, 130, 246, .18), rgba(14, 165, 233, .16)),
    rgba(10, 16, 32, .90);
}

html.theme-dark .app-empty{
  background: rgba(15, 23, 42, .70);
  border-color: rgba(148, 163, 184, .18);
  color: #cbd5e1;
}

html.theme-dark .app-fab-menu{
  background: rgba(15, 23, 42, .96);
  border-color: rgba(148, 163, 184, .18);
  color: #e5e7eb;
}

html.theme-dark .app-ellipsis-popover{
  color: #e5e7eb;
}

html.theme-dark .app-ellipsis-input{
  color: #e5e7eb;
}

html.theme-dark .app-sync-done{
  background: rgba(16, 185, 129, .18);
  color: #d1fae5;
  border-color: rgba(16, 185, 129, .28);
}

html.theme-dark .status-pill{
  color: #e5e7eb;
}

html.theme-dark .status-neutral{
  background: rgba(148, 163, 184, .16);
  border-color: rgba(148, 163, 184, .36);
  color: #e5e7eb;
}

html.theme-dark .equip-type,
html.theme-dark .equip-model{
  color: #e5e7eb;
}

html.theme-dark .dashboard-ranking-card{
  background:
    linear-gradient(180deg, rgba(15, 23, 42, .94), rgba(15, 23, 42, .88));
  border-color: rgba(148, 163, 184, .16);
  color: #e5e7eb;
}

html.theme-dark .dashboard-ranking-card:nth-child(1){
  background:
    linear-gradient(180deg, rgba(15, 23, 42, .94), rgba(15, 23, 42, .86)),
    rgba(37, 99, 235, .10);
}

html.theme-dark .dashboard-ranking-card:nth-child(2){
  background:
    linear-gradient(180deg, rgba(15, 23, 42, .94), rgba(15, 23, 42, .86)),
    rgba(16, 185, 129, .10);
}

html.theme-dark .dashboard-ranking-card:nth-child(3){
  background:
    linear-gradient(180deg, rgba(15, 23, 42, .94), rgba(15, 23, 42, .86)),
    rgba(168, 85, 247, .10);
}

html.theme-dark .dashboard-ranking-card .dashboard-rank-button,
html.theme-dark .dashboard-ranking-card .dashboard-rank-button *{
  color: inherit;
}

html.theme-dark .dashboard-rank-meta{
  background: rgba(14, 165, 233, .16);
  color: #bae6fd;
}

html.theme-dark .dashboard-rank-meta strong{
  color: #f8fafc;
}

html.theme-dark .app-table,
html.theme-dark .table{
  color: #e5e7eb;
  background: transparent;
}

html.theme-dark .app-table > :not(caption) > * > *,
html.theme-dark .table > :not(caption) > * > *{
  background-color: rgba(15, 23, 42, .88) !important;
  color: #e5e7eb !important;
}

html.theme-dark .app-table tbody tr:nth-child(even) > *{
  background-color: rgba(17, 24, 39, .92) !important;
}

html.theme-dark .app-table tbody tr:hover > *{
  background-color: rgba(30, 41, 59, .96) !important;
}

html.theme-dark .app-card .table{
  background: transparent !important;
}

html.theme-dark .app-card .table thead th{
  background: rgba(15, 23, 42, .98) !important;
  color: #cbd5e1 !important;
}

html.theme-dark .app-card .table tbody td,
html.theme-dark .app-card .table tbody th{
  color: #e5e7eb !important;
}

html.theme-dark .app-table .text-muted,
html.theme-dark .table .text-muted{
  color: #94a3b8 !important;
}

html.theme-dark .dashboard-flow-chart{
  color: #e5e7eb;
}

html.theme-dark .dashboard-flow-row{
  color: #e5e7eb;
}

html.theme-dark .auth-panel h1{
  color: #f8fafc;
}

html.theme-dark .auth-panel p{
  color: #cbd5e1;
}

html.theme-dark .auth-feature{
  background: rgba(10, 16, 32, .78);
  border-color: rgba(148, 163, 184, .18);
  color: #e5e7eb;
}

html.theme-dark .auth-feature i{
  color: #7dd3fc;
}

/* Global UI refresh ------------------------------------------------------- */
body.app-page{
  background-attachment: fixed;
  font-family: 'Bai Jamjuree', sans-serif;
}

body.app-auth-page{
  color: var(--ui-text);
  background:
    radial-gradient(680px 360px at 12% 0%, rgba(42,155,194,.16), transparent 64%),
    radial-gradient(620px 340px at 90% 100%, rgba(22,93,154,.12), transparent 62%),
    var(--ui-bg);
  font-family: 'Bai Jamjuree', sans-serif;
}

body.app-auth-page .app-auth-card,
body.app-auth-page .auth-solo,
body.app-auth-page .auth-panel{
  color: var(--ui-text);
  background: var(--ui-surface) !important;
  border-color: var(--ui-border) !important;
  box-shadow: var(--ui-shadow-raised) !important;
}

body.app-auth-page .auth-brand-title,
body.app-auth-page .auth-subtitle,
body.app-auth-page .form-label,
body.app-auth-page .form-check-label{
  color: var(--ui-text);
}

body.app-auth-page .auth-subtitle{
  color: var(--ui-text-secondary) !important;
}

body.app-page .app-navbar{
  position: sticky;
  top: 0;
  z-index: 1030;
  backdrop-filter: blur(16px);
  background:
    linear-gradient(90deg, rgba(255,255,255,.92), rgba(245,250,255,.88)) !important;
  border-bottom: 1px solid rgba(148,163,184,.16) !important;
  box-shadow: 0 10px 28px rgba(2,6,23,.08);
}

body.app-page .app-card,
body.app-page .modal-content{
  border: 1px solid rgba(148,163,184,.16);
  border-radius: 24px;
  box-shadow: 0 18px 42px rgba(2,6,23,.08);
  overflow: hidden;
  backdrop-filter: blur(14px);
}

body.app-page .app-card .card-header,
body.app-page .app-card .card-header.bg-white,
body.app-page .modal-header,
body.app-page .modal-footer{
  background:
    linear-gradient(90deg, rgba(248,250,252,.98), rgba(241,246,255,.96)) !important;
  border-color: rgba(148,163,184,.14) !important;
}

body.app-page .app-card .card-header h1,
body.app-page .app-card .card-header h2,
body.app-page .app-card .card-header h3,
body.app-page .app-card .card-header h4,
body.app-page .app-card .card-header h5,
body.app-page .app-card .card-header h6,
body.app-page .modal-title{
  font-weight: 800;
  letter-spacing: .01em;
}

body.app-page .app-btn,
body.app-page .btn{
  border-radius: 14px;
  font-weight: 700;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, border-color .16s ease;
}

body.app-page .app-btn:hover,
body.app-page .btn:hover{
  transform: translateY(-1px);
}

body.app-page .app-btn-primary,
body.app-page .btn-primary{
  box-shadow: 0 10px 24px rgba(37,99,235,.22);
}

body.app-page .app-input,
body.app-page .app-select,
body.app-page .app-textarea,
body.app-page .form-control,
body.app-page .form-select{
  border-radius: 14px;
  border-color: rgba(148,163,184,.22);
  box-shadow: 0 1px 0 rgba(255,255,255,.65) inset;
}

body.app-page .app-input:focus,
body.app-page .app-select:focus,
body.app-page .app-textarea:focus,
body.app-page .form-control:focus,
body.app-page .form-select:focus{
  box-shadow: 0 0 0 .25rem rgba(61,183,235,.16);
}

body.app-page .app-table,
body.app-page .table{
  border-collapse: separate;
  border-spacing: 0;
}

body.app-page .app-table thead th,
body.app-page .table thead th{
  background: rgba(248,250,252,.98);
  color: #64748b;
  font-weight: 800;
  border-bottom: 1px solid rgba(148,163,184,.14);
}

body.app-page .app-table tbody tr,
body.app-page .table tbody tr{
  transition: transform .12s ease, background-color .12s ease, box-shadow .12s ease;
}

body.app-page .app-table tbody tr:hover,
body.app-page .table tbody tr:hover{
  transform: translateY(-1px);
  background-color: rgba(61,183,235,.05);
}

body.app-page .app-chip,
body.app-page .branch-pill,
body.app-page .soft-badge,
body.app-page .status-pill{
  border-radius: 999px;
}

body.app-page .app-fab-btn{
  box-shadow: 0 14px 32px rgba(17,78,136,.26);
}

body.app-page .dashboard-hero,
body.app-page .hero,
body.app-page .tool-hero{
  box-shadow: 0 18px 48px rgba(17,78,136,.24);
}

html.theme-dark body.app-page .app-navbar{
  background:
    linear-gradient(90deg, rgba(10,16,32,.88), rgba(12,19,36,.84)) !important;
  border-bottom-color: rgba(148,163,184,.14) !important;
}

html.theme-dark body.app-page .app-card,
html.theme-dark body.app-page .modal-content{
  background: rgba(12,19,36,.74);
  border-color: rgba(148,163,184,.16);
}

html.theme-dark body.app-page .app-card .card-header,
html.theme-dark body.app-page .app-card .card-header.bg-white,
html.theme-dark body.app-page .modal-header,
html.theme-dark body.app-page .modal-footer{
  background:
    linear-gradient(90deg, rgba(12,19,36,.92), rgba(10,16,32,.88)) !important;
  border-color: rgba(148,163,184,.14) !important;
}

html.theme-dark body.app-page .app-table thead th,
html.theme-dark body.app-page .table thead th{
  background: rgba(10,16,32,.94) !important;
  color: #cbd5e1 !important;
}

html.theme-dark body.app-page .app-table tbody tr:hover,
html.theme-dark body.app-page .table tbody tr:hover{
  background-color: rgba(61,183,235,.08);
}

html.theme-dark body.app-page .app-input,
html.theme-dark body.app-page .app-select,
html.theme-dark body.app-page .app-textarea,
html.theme-dark body.app-page .form-control,
html.theme-dark body.app-page .form-select{
  background-color: rgba(10,16,32,.72) !important;
  color: #e5e7eb !important;
  border-color: rgba(148,163,184,.22) !important;
}

html.theme-dark body.app-page .app-chip,
html.theme-dark body.app-page .branch-pill,
html.theme-dark body.app-page .soft-badge,
html.theme-dark body.app-page .status-pill{
  color: #e5e7eb;
}

/* Mobile-first overrides -------------------------------------------------- */
@media (max-width: 767.98px){
  html, body{
    overflow-x: hidden;
  }

  body{
    background-attachment: scroll;
  }

  body.app-page{
    padding-bottom: 2.5rem;
  }

  body.app-page .container,
  body.app-page .container-fluid{
    padding-left: .75rem;
    padding-right: .75rem;
  }

  body.app-page .app-navbar{
    padding-top: .6rem;
    padding-bottom: .6rem;
  }

  body.app-page .app-navbar .container,
  body.app-page .app-navbar .container-fluid{
    gap: .6rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  body.app-page .app-navbar .navbar-brand,
  body.app-page .app-navbar .navbar-text{
    font-size: .92rem;
  }

  body.app-page .app-navbar .btn{
    width: 100%;
    justify-content: center;
  }

  body.app-page .app-navbar .ms-auto{
    width: 100%;
    margin-left: 0 !important;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  body.app-page .app-card,
  body.app-page .modal-content,
  body.app-page .hero,
  body.app-page .tool-hero{
    border-radius: 18px;
  }

  body.app-page .app-card .card-header,
  body.app-page .app-card .card-body,
  body.app-page .modal-header,
  body.app-page .modal-body,
  body.app-page .modal-footer{
    padding-left: .9rem;
    padding-right: .9rem;
  }

  body.app-page .card-body,
  body.app-page .card-header{
    padding-top: .9rem;
    padding-bottom: .9rem;
  }

  body.app-page .app-btn,
  body.app-page .btn,
  body.app-page .app-input,
  body.app-page .app-select,
  body.app-page .form-control,
  body.app-page .form-select{
    min-height: 40px;
  }

  body.app-page .btn-group,
  body.app-page .toolbar,
  body.app-page .app-chip-row{
    width: 100%;
    display: flex;
    flex-wrap: wrap;
  }

  body.app-page .toolbar .btn,
  body.app-page .toolbar .form-control{
    width: 100%;
  }

  body.app-page .table-responsive{
    border-radius: 14px;
    -webkit-overflow-scrolling: touch;
  }

  body.app-page .table-responsive .table{
    min-width: 640px;
  }

  body.app-page .dashboard-shell,
  body.app-page .branch-equipment-shell,
  body.app-page .delivery-shell,
  body.app-page .remote-shell,
  body.app-page .computer-shell,
  body.app-page .scanner-shell,
  body.app-page .factory-shell,
  body.app-page .backup-shell,
  body.app-page .login-shell{
    width: 100%;
    max-width: none;
    padding-left: .25rem;
    padding-right: .25rem;
  }

  body.app-page .dashboard-hero{
    padding: 1rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: center;
  }

  body.app-page .dashboard-hero .dashboard-asset{
    width: min(100%, 160px);
    justify-self: center;
    opacity: .95;
  }

  body.app-page .dashboard-hero .btn,
  body.app-page .dashboard-hero .d-flex.flex-wrap.gap-2.mt-4{
    width: 100%;
  }

  body.app-page .dashboard-title{
    font-size: clamp(1.45rem, 7vw, 1.95rem);
    line-height: 1.1;
  }

  body.app-page .dashboard-lead{
    font-size: .92rem;
    line-height: 1.65;
  }

  body.app-page .dashboard-range-controls{
    display: grid;
    grid-template-columns: 1fr;
    gap: .75rem;
  }

  body.app-page .dashboard-range-actions{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem;
  }

  body.app-page .dashboard-range-panel{
    grid-template-columns: 1fr;
    gap: .75rem;
  }

  body.app-page .dashboard-range-form,
  body.app-page .dashboard-range-summary{
    border-radius: 18px;
  }

  body.app-page .dashboard-range-summary{
    padding: .95rem;
  }

  body.app-page .dashboard-ranking-grid,
  body.app-page .dashboard-insights{
    grid-template-columns: 1fr;
  }

  body.app-page .dashboard-ranking-card,
  body.app-page .dashboard-today-card,
  body.app-page .dashboard-flow-card{
    border-radius: 18px;
  }

  body.app-page .dashboard-rank-list-row,
  body.app-page .dashboard-detail-item{
    border-radius: 14px;
    background: rgba(255,255,255,.72);
  }

  body.app-page .dashboard-rank-button{
    text-align: left;
  }

  body.app-page .dashboard-detail-head{
    flex-wrap: wrap;
  }

  body.app-page .dashboard-detail-dialog{
    width: calc(100vw - 1rem);
    max-height: calc(100vh - 1rem);
  }

  body.app-page .app-with-sidebar{
    padding-left: 0;
    padding-top: 72px;
  }

  body.app-page .app-sidebar{
    position: fixed;
    inset: 0 0 auto 0;
    width: 100%;
    height: 64px;
    padding: .45rem .75rem;
    z-index: 1040;
    border-right: 0;
    border-bottom: 1px solid rgba(148,163,184,.16);
    display: flex;
    align-items: center;
    overflow: hidden;
  }

  body.app-page .app-sidebar-brand,
  body.app-page .app-sidebar-footer{
    display: none;
  }

  body.app-page .app-sidebar-nav{
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    padding-bottom: .15rem;
  }

  body.app-page .app-sidebar-link{
    flex: 0 0 auto;
    padding: .55rem .75rem;
    min-height: 42px;
  }

  body.app-page .app-sidebar-link span{
    display: none;
  }

  body.app-page .app-sidebar-actions{
    display: none;
  }

  body.app-page .app-table thead th,
  body.app-page .table thead th{
    white-space: nowrap;
    font-size: .78rem;
    padding: .72rem .8rem;
  }

  body.app-page .table-responsive{
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(148,163,184,.55) transparent;
  }

  body.app-page .table-responsive::-webkit-scrollbar{
    height: 8px;
  }

  body.app-page .table-responsive::-webkit-scrollbar-thumb{
    border-radius: 999px;
    background: rgba(148,163,184,.55);
  }

  body.app-page .table-responsive .table{
    min-width: 760px;
  }

  body.app-page .app-table td,
  body.app-page .app-table th,
  body.app-page .table td,
  body.app-page .table th{
    padding: .68rem .8rem;
    font-size: .9rem;
  }
}

@media (max-width: 479.98px){
  body.app-page .container,
  body.app-page .container-fluid{
    padding-left: .6rem;
    padding-right: .6rem;
  }

  body.app-page .app-navbar .ms-auto{
    gap: .5rem;
  }

  body.app-page .app-card,
  body.app-page .modal-content,
  body.app-page .hero,
  body.app-page .tool-hero{
    border-radius: 16px;
  }

  body.app-page .app-card .card-header,
  body.app-page .app-card .card-body,
  body.app-page .modal-header,
  body.app-page .modal-body,
  body.app-page .modal-footer{
    padding-left: .8rem;
    padding-right: .8rem;
  }

  body.app-page .app-table thead th,
  body.app-page .table thead th{
    font-size: .74rem;
  }

  body.app-page .table-responsive .table{
    min-width: 680px;
  }

  body.app-page .app-table td,
  body.app-page .app-table th,
  body.app-page .table td,
  body.app-page .table th{
    font-size: .86rem;
  }

  body.app-page .modal-dialog{
    margin: .5rem;
  }

  body.app-page .modal-dialog.modal-xl,
  body.app-page .modal-dialog.modal-lg{
    max-width: calc(100vw - 1rem);
  }
}

@media (max-width: 767.98px){
  .app-auth-page{
    padding: 16px 12px;
  }

  .app-auth-page .app-auth-card{
    max-width: 100%;
    padding: 1.4rem 1.1rem;
    border-radius: 20px !important;
  }

  .app-auth-page .auth-panel{
    padding: 1.6rem 1.2rem;
    border-radius: 20px;
  }

  .app-auth-page .auth-panel h1{
    font-size: 1.6rem;
    margin-top: 1rem;
  }

  .app-auth-page .auth-panel .auth-metrics{
    grid-template-columns: 1fr;
  }

  .app-auth-page .auth-feature{
    padding: .72rem .85rem;
  }

  .app-auth-page .auth-brand-title{
    font-size: 1.35rem;
    line-height: 1.25;
  }

  .app-auth-page .auth-subtitle{
    font-size: .95rem;
    line-height: 1.6;
  }

  .app-auth-page .btn,
  .app-auth-page .form-control{
    min-height: 42px;
  }
}

@media (max-width: 479.98px){
  .app-auth-page{
    padding: 10px 10px 14px;
  }

  .app-auth-page .app-auth-card{
    padding: 1.2rem .95rem;
    border-radius: 18px !important;
  }

  .app-auth-page .auth-panel{
    padding: 1.3rem 1rem;
    border-radius: 18px;
  }

  .app-auth-page .auth-panel h1{
    font-size: 1.42rem;
  }

  .app-auth-page .auth-brand-title{
    font-size: 1.18rem;
  }
}

/* Dashboard polish -------------------------------------------------------- */
.dashboard-shell{
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  gap: 1rem;
  padding: 18px 18px 40px;
}

.dashboard-hero{
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(180px, .8fr);
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem 1.6rem;
}

.dashboard-asset{
  width: min(100%, 210px);
  justify-self: end;
}

.dashboard-summary-panel,
.dashboard-range-panel,
.dashboard-ranking-card,
.dashboard-today-card,
.dashboard-flow-card{
  border-radius: 24px;
  border: 1px solid rgba(185,28,28,.12);
  box-shadow: 0 16px 34px rgba(127,29,29,.08);
}

.dashboard-summary-panel{
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,246,246,.96));
  padding: 1.2rem 1.25rem;
}

.dashboard-summary-header{
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.dashboard-summary-total-wrap{
  min-width: 138px;
  text-align: right;
}

.dashboard-range-panel{
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1rem;
}

.dashboard-range-form,
.dashboard-range-summary{
  border-radius: 22px;
}

.dashboard-range-controls{
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .85rem;
  align-items: end;
}

.dashboard-range-actions{
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}

.dashboard-range-summary{
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,242,242,.96));
}

.dashboard-insights,
.dashboard-ranking-grid{
  display: grid;
  gap: 1rem;
}

.dashboard-insights{
  grid-template-columns: 1fr 1fr;
}

.dashboard-ranking-grid{
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-ranking-card,
.dashboard-today-card,
.dashboard-flow-card{
  padding: 1rem 1.05rem;
  background: rgba(255,255,255,.88);
}

.dashboard-flow-chart svg{
  width: 100%;
  height: auto;
}

@media (max-width: 991.98px){
  .dashboard-hero,
  .dashboard-range-panel,
  .dashboard-insights,
  .dashboard-ranking-grid{
    grid-template-columns: 1fr;
  }

  .dashboard-asset{
    justify-self: start;
    width: min(100%, 180px);
  }

  .dashboard-range-controls{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-range-summary{
    min-height: auto;
  }
}

@media (max-width: 575.98px){
  .dashboard-shell{
    padding: 14px 10px 30px;
  }

  .dashboard-hero{
    padding: 1rem;
  }

  .dashboard-range-controls{
    grid-template-columns: 1fr;
  }

  .dashboard-summary-panel,
  .dashboard-range-panel,
  .dashboard-ranking-card,
  .dashboard-today-card,
  .dashboard-flow-card{
    border-radius: 18px;
  }
}

/* User management mobile cards ------------------------------------------- */
@media (max-width: 767.98px){
  .user-management-layout{
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  .user-management-layout > .col-md-4,
  .user-management-layout > .col-md-8{
    width: 100%;
    float: none;
  }

  .user-management-layout #createUserCard,
  .user-management-layout #changePasswordCard,
  .user-management-layout #adminPanel .card{
    border-radius: 18px;
  }

  .user-management-layout .table-responsive{
    border-radius: 0 0 18px 18px;
  }

  .user-management-layout .table{
    min-width: 0 !important;
  }

  .user-management-layout .table thead{
    display: none;
  }

  .user-management-layout .table tbody,
  .user-management-layout .table tr,
  .user-management-layout .table td{
    display: block;
    width: 100%;
  }

  .user-management-layout .table tbody tr{
    margin: .8rem .9rem;
    padding: .95rem;
    border: 1px solid rgba(185,28,28,.12);
    border-radius: 18px;
    background: rgba(255,255,255,.88);
    box-shadow: 0 12px 24px rgba(127,29,29,.07);
  }

  .user-management-layout .table tbody td{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .85rem;
    padding: .45rem 0 !important;
    border: 0 !important;
    text-align: left !important;
  }

  .user-management-layout .table tbody td::before{
    content: attr(data-label);
    flex: 0 0 42%;
    max-width: 42%;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #991b1b;
  }

  .user-management-layout .table tbody td > *{
    flex: 1 1 auto;
    min-width: 0;
  }

  .user-management-layout .app-action-buttons{
    width: 100%;
    justify-content: flex-start;
  }

  .user-management-layout .app-action-buttons .btn{
    flex: 1 1 0;
  }
}

/* Final visual contract: last-rule wins across all app pages */
body.app-page .app-card > .card-header,
body.app-page .app-card > .card-header.bg-white,
body.app-page .card.app-card > .card-header,
body.app-page .card.app-card > .card-header.bg-white,
body.app-page .panel-head,
body.app-page .tool-card-head,
body.app-page .branch-card-head,
body.app-page .remote-toolbar,
body.app-page .detail-card-header{
  background:
    linear-gradient(90deg, rgba(15,76,129,.12), rgba(37,99,235,.10), rgba(61,183,235,.08)),
    rgba(255,255,255,.82) !important;
  border-color: rgba(148,163,184,.14) !important;
  color: var(--app-text) !important;
}

body.app-page .app-card > .card-header h1,
body.app-page .app-card > .card-header h2,
body.app-page .app-card > .card-header h3,
body.app-page .app-card > .card-header h4,
body.app-page .app-card > .card-header h5,
body.app-page .app-card > .card-header h6,
body.app-page .panel-head h1,
body.app-page .panel-head h2,
body.app-page .panel-head h3,
body.app-page .panel-head h4,
body.app-page .panel-head h5,
body.app-page .panel-head h6,
body.app-page .tool-card-head h1,
body.app-page .tool-card-head h2,
body.app-page .tool-card-head h3,
body.app-page .tool-card-head h4,
body.app-page .tool-card-head h5,
body.app-page .tool-card-head h6,
body.app-page .branch-card-head h1,
body.app-page .branch-card-head h2,
body.app-page .branch-card-head h3,
body.app-page .branch-card-head h4,
body.app-page .branch-card-head h5,
body.app-page .branch-card-head h6,
body.app-page .remote-toolbar h1,
body.app-page .remote-toolbar h2,
body.app-page .remote-toolbar h3,
body.app-page .remote-toolbar h4,
body.app-page .remote-toolbar h5,
body.app-page .remote-toolbar h6,
body.app-page .detail-card-header h1,
body.app-page .detail-card-header h2,
body.app-page .detail-card-header h3,
body.app-page .detail-card-header h4,
body.app-page .detail-card-header h5,
body.app-page .detail-card-header h6{
  color: var(--app-text) !important;
}

html.theme-dark body.app-page .app-card > .card-header,
html.theme-dark body.app-page .app-card > .card-header.bg-white,
html.theme-dark body.app-page .card.app-card > .card-header,
html.theme-dark body.app-page .card.app-card > .card-header.bg-white,
html.theme-dark body.app-page .panel-head,
html.theme-dark body.app-page .tool-card-head,
html.theme-dark body.app-page .branch-card-head,
html.theme-dark body.app-page .remote-toolbar,
html.theme-dark body.app-page .detail-card-header{
  background:
    linear-gradient(90deg, rgba(56,189,248,.16), rgba(37,99,235,.14), rgba(14,165,233,.10)),
    rgba(12,19,36,.82) !important;
  border-color: rgba(148,163,184,.14) !important;
  color: #e5e7eb !important;
}

/* User management page dark-mode polish */
body.app-page .user-management-layout .app-card{
  overflow: hidden;
}

body.app-page .user-management-layout .card-header{
  padding-top: .85rem;
  padding-bottom: .85rem;
}

body.app-page .user-management-layout .table thead th{
  background: rgba(248,250,252,.98);
  color: #334155;
}

html.theme-dark body.app-page .user-management-layout .app-card,
html.theme-dark body.app-page .user-management-layout .modal-content{
  background: rgba(12,19,36,.88);
  border-color: rgba(148,163,184,.18);
  box-shadow: 0 18px 44px rgba(0,0,0,.28);
}

html.theme-dark body.app-page .user-management-layout .card-header{
  background:
    linear-gradient(90deg, rgba(56,189,248,.16), rgba(37,99,235,.14), rgba(14,165,233,.10)),
    rgba(12,19,36,.82) !important;
  border-bottom-color: rgba(148,163,184,.16) !important;
  color: #e5e7eb !important;
}

html.theme-dark body.app-page .user-management-layout .table thead th{
  background: rgba(15,23,42,.96);
  color: #cbd5e1;
}

html.theme-dark body.app-page .user-management-layout .table tbody td{
  color: #e5e7eb;
  border-color: rgba(148,163,184,.12);
}

html.theme-dark body.app-page .user-management-layout .table tbody tr:hover{
  background: rgba(61,183,235,.06);
}

html.theme-dark body.app-page .user-management-layout .input-group-text{
  background: rgba(15,23,42,.82) !important;
  color: #cbd5e1 !important;
  border-color: rgba(148,163,184,.18) !important;
}

html.theme-dark body.app-page .user-management-layout .app-input,
html.theme-dark body.app-page .user-management-layout .form-control,
html.theme-dark body.app-page .user-management-layout .form-select{
  background: rgba(10,16,32,.82) !important;
  border-color: rgba(148,163,184,.22) !important;
  color: #f8fafc !important;
}

html.theme-dark body.app-page .user-management-layout .app-input::placeholder,
html.theme-dark body.app-page .user-management-layout .form-control::placeholder{
  color: rgba(203,213,225,.72) !important;
}

html.theme-dark body.app-page .user-management-layout .badge.text-bg-light{
  background: rgba(30,41,59,.94) !important;
  color: #e2e8f0 !important;
  border: 1px solid rgba(148,163,184,.18);
}

html.theme-dark body.app-page .user-management-layout .badge.text-bg-secondary{
  background: rgba(71,85,105,.96) !important;
  color: #f8fafc !important;
}

html.theme-dark body.app-page .user-management-layout .badge.text-bg-dark{
  background: rgba(15,23,42,.96) !important;
  color: #f8fafc !important;
}

html.theme-dark body.app-page .user-management-layout .badge.text-bg-success{
  background: rgba(16,185,129,.92) !important;
  color: #ecfdf5 !important;
}

html.theme-dark body.app-page .user-management-layout .badge.text-bg-warning{
  background: rgba(245,158,11,.92) !important;
  color: #111827 !important;
}

html.theme-dark body.app-page .user-management-layout .btn-outline-secondary{
  color: #cbd5e1 !important;
  border-color: rgba(148,163,184,.28) !important;
}

html.theme-dark body.app-page .user-management-layout .btn-outline-secondary:hover{
  background: rgba(148,163,184,.12) !important;
  color: #fff !important;
}

html.theme-dark body.app-page,
html.theme-dark body.app-page .app-card,
html.theme-dark body.app-page .modal-content,
html.theme-dark body.app-page .panel,
html.theme-dark body.app-page .tool-card,
html.theme-dark body.app-page .detail-card,
html.theme-dark body.app-page .branch-card,
html.theme-dark body.app-page .summary-card,
html.theme-dark body.app-page .page-hero,
html.theme-dark body.app-page .branches-hero,
html.theme-dark body.app-page .remote-hero,
html.theme-dark body.app-page .tool-hero,
html.theme-dark body.app-page .computer-hero,
html.theme-dark body.app-page .hero,
html.theme-dark body.app-page .dashboard-hero,
html.theme-dark body.app-page .branch-detail-hero{
  color: #e5e7eb !important;
}

html.theme-dark body.app-page p,
html.theme-dark body.app-page li,
html.theme-dark body.app-page td,
html.theme-dark body.app-page th,
html.theme-dark body.app-page label,
html.theme-dark body.app-page .form-label,
html.theme-dark body.app-page .form-text,
html.theme-dark body.app-page .small,
html.theme-dark body.app-page .text-muted,
html.theme-dark body.app-page .app-muted,
html.theme-dark body.app-page .summary-label,
html.theme-dark body.app-page .summary-value,
html.theme-dark body.app-page .detail-label,
html.theme-dark body.app-page .detail-value,
html.theme-dark body.app-page .detail-card-title,
html.theme-dark body.app-page .panel-title,
html.theme-dark body.app-page .tool-card-title,
html.theme-dark body.app-page .branch-title strong,
html.theme-dark body.app-page .branch-title span,
html.theme-dark body.app-page .branch-meta,
html.theme-dark body.app-page .branch-meta b,
html.theme-dark body.app-page .remote-code,
html.theme-dark body.app-page .modal-branch-name{
  color: #e5e7eb !important;
}

html.theme-dark body.app-page .page-hero p,
html.theme-dark body.app-page .branches-hero p,
html.theme-dark body.app-page .remote-hero p,
html.theme-dark body.app-page .tool-hero p,
html.theme-dark body.app-page .computer-hero p,
html.theme-dark body.app-page .hero p,
html.theme-dark body.app-page .dashboard-hero p,
html.theme-dark body.app-page .branch-detail-hero p{
  color: rgba(229,231,235,.92) !important;
}

html.theme-dark body.app-page .page-hero .dashboard-eyebrow,
html.theme-dark body.app-page .branches-hero .dashboard-eyebrow,
html.theme-dark body.app-page .remote-hero .dashboard-eyebrow,
html.theme-dark body.app-page .tool-hero .tool-hero-eyebrow,
html.theme-dark body.app-page .computer-hero .dashboard-eyebrow,
html.theme-dark body.app-page .hero-eyebrow,
html.theme-dark body.app-page .dashboard-eyebrow,
html.theme-dark body.app-page .branch-detail-hero .eyebrow{
  color: rgba(226,232,240,.80) !important;
}

html.theme-dark body.app-page .app-btn,
html.theme-dark body.app-page .btn{
  color: #e5e7eb;
}

html.theme-dark body.app-page .app-btn-primary,
html.theme-dark body.app-page .btn-primary{
  background: linear-gradient(135deg, #2563eb, #1d4ed8, #0f766e) !important;
  border-color: rgba(96,165,250,.38) !important;
  color: #ffffff !important;
  box-shadow: 0 14px 28px rgba(37,99,235,.32) !important;
}

html.theme-dark body.app-page .btn-success{
  background: linear-gradient(135deg, #16a34a, #15803d) !important;
  border-color: rgba(74,222,128,.35) !important;
  color: #ffffff !important;
}

html.theme-dark body.app-page .btn-warning{
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  border-color: rgba(251,191,36,.35) !important;
  color: #111827 !important;
}

html.theme-dark body.app-page .btn-danger{
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  border-color: rgba(248,113,113,.35) !important;
  color: #ffffff !important;
}

html.theme-dark body.app-page .btn-light{
  background: rgba(248,250,252,.94) !important;
  color: #0f172a !important;
  border-color: rgba(226,232,240,.9) !important;
}

html.theme-dark body.app-page .btn-outline-primary,
html.theme-dark body.app-page .app-btn-outline{
  color: #dbeafe !important;
  border-color: rgba(96,165,250,.38) !important;
}

html.theme-dark body.app-page .btn-outline-primary:hover,
html.theme-dark body.app-page .app-btn-outline:hover{
  background: rgba(59,130,246,.16) !important;
  color: #ffffff !important;
}

html.theme-dark body.app-page .app-chip,
html.theme-dark body.app-page .branch-pill,
html.theme-dark body.app-page .soft-badge,
html.theme-dark body.app-page .status-pill,
html.theme-dark body.app-page .summary-card,
html.theme-dark body.app-page .app-badge-soft{
  box-shadow: 0 10px 22px rgba(0,0,0,.18);
}

html.theme-dark body.app-page .app-table thead th,
html.theme-dark body.app-page .table thead th{
  color: #e2e8f0 !important;
}

html.theme-dark body.app-page .app-table tbody td,
html.theme-dark body.app-page .table tbody td,
html.theme-dark body.app-page .app-table tbody th,
html.theme-dark body.app-page .table tbody th{
  color: #e5e7eb !important;
}

html.theme-dark body.app-page .table-wrap,
html.theme-dark body.app-page .panel,
html.theme-dark body.app-page .summary-card,
html.theme-dark body.app-page .detail-item,
html.theme-dark body.app-page .equip-model-item,
html.theme-dark body.app-page .ocr-box,
html.theme-dark body.app-page .ocr-preview,
html.theme-dark body.app-page .remote-search,
html.theme-dark body.app-page .app-ellipsis-input{
  border-color: rgba(148,163,184,.16) !important;
}

html.theme-dark body.app-page .remote-search .bi-search,
html.theme-dark body.app-page .summary-label,
html.theme-dark body.app-page .summary-value,
html.theme-dark body.app-page .detail-label,
html.theme-dark body.app-page .detail-value,
html.theme-dark body.app-page .detail-input::placeholder{
  color: rgba(226,232,240,.82) !important;
}

html.theme-dark body.app-page .status-select{
  color: #e5e7eb !important;
}

html.theme-dark body.app-page .status-select option{
  color: #0f172a !important;
}

html.theme-dark body.app-page .app-sidebar-action{
  background: rgba(255,255,255,.12);
  color: #ffffff;
}

html.theme-dark body.app-page .app-sidebar-action:hover{
  background: #ffffff;
  color: #0f172a;
}

body.app-page .remote-toolbar{
  padding: .95rem 1rem;
}

body.app-page .remote-search{
  display: flex;
  align-items: center;
  gap: .5rem;
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 16px;
  background: rgba(248,250,252,.9);
  padding: .2rem .7rem;
}

html.theme-dark body.app-page .remote-search{
  background: rgba(15,23,42,.72);
}

body.app-page .remote-search .form-control{
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

body.app-page .summary-card{
  min-width: 120px;
  padding: .75rem .95rem;
  border-radius: 18px;
  background: rgba(248,250,252,.92);
  border: 1px solid rgba(148,163,184,.14);
}

html.theme-dark body.app-page .summary-card{
  background: rgba(15,23,42,.62);
}

body.app-page .branch-card-head,
body.app-page .panel-head,
body.app-page .tool-card-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

@media (max-width: 767.98px){
  body.app-page .remote-toolbar{
    padding: .9rem;
  }

  body.app-page .remote-toolbar .row{
    --bs-gutter-y: .7rem;
  }

  body.app-page .remote-search{
    width: 100%;
  }

  body.app-page .remote-search .form-control{
    font-size: .95rem;
    min-height: 44px;
  }

  body.app-page .remote-toolbar .d-flex.flex-wrap.gap-2{
    width: 100%;
    gap: .6rem !important;
  }

  body.app-page .summary-card{
    flex: 1 1 100%;
    min-width: 0;
    padding: .78rem .85rem;
  }

  body.app-page .summary-label{
    font-size: .7rem;
  }

  body.app-page .summary-value{
    font-size: 1.15rem;
    line-height: 1.1;
  }

  body.app-page .branch-card{
    margin-top: .85rem;
    border-radius: 20px;
  }

  body.app-page .branch-card-head{
    padding: .85rem .9rem;
  }

  body.app-page .branch-title{
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: .35rem;
  }

  body.app-page .branch-title > span{
    font-size: .95rem;
    line-height: 1.35;
  }

  body.app-page .branch-meta{
    gap: .35rem .6rem;
    font-size: .8rem;
    line-height: 1.35;
  }

  body.app-page .branch-meta b{
    font-size: .9rem;
  }

  body.app-page .table-responsive{
    border-radius: 0 0 20px 20px;
  }

  body.app-page .remote-table{
    width: 100%;
    min-width: 760px;
  }

  body.app-page .remote-table thead th{
    padding: .6rem .7rem;
    font-size: .72rem;
  }

  body.app-page .remote-table tbody td{
    padding: .5rem .7rem;
    font-size: .82rem;
  }

  body.app-page .remote-code{
    font-size: .8rem;
  }

  body.app-page .remote-actions{
    gap: .25rem;
  }

  body.app-page .icon-btn{
    width: 30px;
    height: 30px;
  }

  body.app-page .edit-modal .modal-dialog,
  body.app-page .modal-dialog.modal-lg{
    margin: .75rem;
  }

  body.app-page .modal-content{
    border-radius: 20px;
  }

  body.app-page .edit-grid{
    grid-template-columns: 1fr;
    gap: .7rem;
  }

  body.app-page .modal-header,
  body.app-page .modal-body,
  body.app-page .modal-footer{
    padding-left: .9rem;
    padding-right: .9rem;
  }

  body.app-page .modal-footer{
    gap: .5rem;
  }

  body.app-page .modal-footer .btn{
    flex: 1 1 0;
  }

  body.app-page .delivery-shell .panel-head{
    flex-wrap: wrap;
    align-items: stretch;
    gap: .85rem;
  }

  body.app-page .delivery-shell .panel-head > div:last-child{
    width: 100%;
    flex-wrap: wrap;
  }

  body.app-page .delivery-shell .panel-head .form-control{
    width: 100% !important;
  }

  body.app-page .delivery-shell .panel-head .btn{
    flex: 1 1 calc(50% - .3rem);
    min-width: 0;
  }

  body.app-page .delivery-table{
    min-width: 0 !important;
    width: 100%;
  }

  body.app-page .delivery-table thead{
    display: none;
  }

  body.app-page .delivery-table,
  body.app-page .delivery-table tbody,
  body.app-page .delivery-table tr,
  body.app-page .delivery-table td{
    display: block;
  }

  body.app-page .delivery-table tbody tr{
    margin: .75rem .5rem 0;
    padding: .8rem .85rem;
    border-radius: 18px;
    border: 1px solid rgba(148,163,184,.16);
    background: rgba(248,250,252,.78);
    box-shadow: 0 10px 22px rgba(2,6,23,.05);
  }

  html.theme-dark body.app-page .delivery-table tbody tr{
    background: rgba(15,23,42,.74);
    border-color: rgba(148,163,184,.18);
  }

  body.app-page .delivery-table tbody td{
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: .7rem;
    padding: .38rem 0;
    border: 0 !important;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  body.app-page .delivery-table tbody td::before{
    display: none;
  }

  body.app-page .delivery-table tbody td > .app-ellipsis{
    flex: 1 1 auto;
    min-width: 0;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
    line-height: 1.35;
    text-align: right;
  }

  body.app-page .delivery-table tbody td.branch-cell{
    font-weight: 800;
    color: var(--app-text);
  }

  body.app-page .delivery-table tbody td .delivery-status-select{
    width: 100%;
    min-width: 0;
    font-size: .9rem;
  }

  body.app-page .delivery-table tbody td[data-label="การจัดการ"]{
    align-items: center;
  }

  body.app-page .delivery-table tbody td[data-label="การจัดการ"] .app-action-buttons{
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  body.app-page .delivery-table tbody td[data-label="การจัดการ"]::before{
    align-self: center;
  }

  body.app-page .delivery-table tbody td[data-label="วันที่"] .app-ellipsis,
  body.app-page .delivery-table tbody td[data-label="จำนวน"] .app-ellipsis,
  body.app-page .delivery-table tbody td[data-label="S/N"] .app-ellipsis{
    word-break: normal;
    overflow-wrap: anywhere;
  }

  body.app-page .delivery-table tbody td[data-label="อาการเสียหน้าสาขา"] .app-ellipsis,
  body.app-page .delivery-table tbody td[data-label="อุปกรณ์ที่ส่ง"] .app-ellipsis,
  body.app-page .delivery-table tbody td[data-label="ยี่ห้อ/รุ่น"] .app-ellipsis{
    overflow-wrap: anywhere;
  }
}

/* These rules restore the delivery table to a real scrolling table with compact
   cells. They were written indented as if they belonged to the phone media query
   above, but the block closed one rule early, so they applied at every width and
   cancelled the phone card layout — min-width:980px !important beat every attempt
   to stack the rows. Scoped to 768px and up, which is what they were sized for. */
@media (min-width: 768px) {
  body.app-page .delivery-shell .table-responsive{
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.app-page .delivery-shell .delivery-table{
    display: table;
    min-width: 980px !important;
    width: 100%;
  }

  body.app-page .delivery-shell .delivery-table thead{
    display: table-header-group;
  }

  body.app-page .delivery-shell .delivery-table tbody{
    display: table-row-group;
  }

  body.app-page .delivery-shell .delivery-table tr{
    display: table-row;
  }

  body.app-page .delivery-shell .delivery-table td{
    display: table-cell;
  }

  body.app-page .delivery-shell .delivery-table thead th{
    padding: .52rem .58rem !important;
    font-size: .7rem !important;
  }

  body.app-page .delivery-shell .delivery-table tbody td{
    padding: .42rem .58rem !important;
    font-size: .8rem !important;
  }

  body.app-page .delivery-shell .delivery-table .app-action-buttons{
    gap: .24rem;
  }

  body.app-page .delivery-shell .delivery-table .app-icon-btn{
    width: 28px;
    height: 28px;
    transform: scale(.92);
  }

  body.app-page .delivery-shell .delivery-table .delivery-status-select{
    min-height: 32px;
    font-size: .78rem;
  }

  body.app-page .delivery-shell .delivery-table{
    border-collapse: collapse;
  }

  body.app-page .delivery-shell .delivery-table thead th,
  body.app-page .delivery-shell .delivery-table tbody td{
    border-color: rgba(148,163,184,.22) !important;
    border-bottom-width: 1px !important;
  }

  body.app-page .delivery-shell .delivery-table tbody tr{
    background: rgba(255,255,255,.82);
  }

  html.theme-dark body.app-page .delivery-shell .delivery-table tbody tr{
    background: rgba(15,23,42,.82);
  }

  body.app-page .delivery-shell .delivery-table tbody td{
    background: transparent;
  }
}

  body.app-page .branch-detail-hero{
    padding: 1rem !important;
    border-radius: 20px !important;
  }

  body.app-page .branch-detail-head{
    flex-direction: column;
    align-items: stretch;
    gap: .85rem;
  }

  body.app-page .branch-detail-actions{
    width: 100%;
    justify-content: flex-start;
  }

  body.app-page .detail-grid{
    grid-template-columns: 1fr;
    gap: .75rem;
  }

  body.app-page .detail-card{
    padding: .72rem;
    border-radius: 16px;
  }

  body.app-page .detail-card-header{
    flex-wrap: wrap;
    align-items: flex-start;
  }

  body.app-page .detail-card-title{
    font-size: .8rem;
  }

  body.app-page .detail-item{
    padding: .62rem .72rem .66rem;
  }

  body.app-page .detail-item .form-control{
    min-height: 38px;
  }

  body.app-page .detail-value{
    font-size: .92rem;
  }

/* Page-specific components for remaining migrated pages */
body.app-page .branch-equipment-shell{
  max-width: 900px;
  margin: 0 auto;
}

body.app-page .branch-equipment-shell .summary{
  display: flex;
  flex-wrap: nowrap;
  gap: .75rem;
  align-items: stretch;
}

body.app-page .branch-equipment-shell .summary-card{
  flex: 1 1 0;
  min-width: 0;
}

@media (max-width: 767.98px){
  body.app-page .branch-equipment-shell .summary{
    flex-wrap: wrap;
  }

  body.app-page .branch-equipment-shell .summary-card{
    flex: 1 1 100%;
  }
}

body.app-page .branch-equipment-shell .panel-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: nowrap;
}

body.app-page .branch-equipment-shell .panel-head .panel-title{
  min-width: 0;
  flex: 1 1 auto;
}

body.app-page .branch-equipment-shell .panel-head .toolbar{
  flex: 0 0 260px;
  width: 260px;
}

body.app-page .branch-equipment-shell .panel-head .toolbar .form-control{
  width: 100%;
}

@media (max-width: 767.98px){
  body.app-page .branch-equipment-shell .panel-head{
    flex-wrap: wrap;
    align-items: stretch;
  }

  body.app-page .branch-equipment-shell .panel-head .toolbar{
    flex: 1 1 100%;
    width: 100%;
  }
}

body.app-page .branch-detail-hero{
  padding: 1.15rem 1.2rem;
  background:
    linear-gradient(135deg, rgba(17,78,136,.95), rgba(37,99,235,.92) 60%, rgba(61,183,235,.88)) !important;
}

body.app-page .branch-detail-head{
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: .15rem;
}

body.app-page .branch-detail-title-wrap{
  min-width: 0;
  flex: 1 1 auto;
}

body.app-page .branch-detail-kicker{
  font-size: .72rem;
  letter-spacing: .2em;
  font-weight: 800;
  color: rgba(255,255,255,.72);
  text-transform: uppercase;
  margin-bottom: .25rem;
}

body.app-page .branch-detail-actions{
  display: inline-flex;
  gap: .5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 0 0 auto;
}

body.app-page .branch-detail-actions .btn{
  border-radius: 999px;
  padding-left: 1rem;
  padding-right: 1rem;
  box-shadow: 0 10px 24px rgba(2,6,23,.12);
}

body.app-page .detail-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem;
}

body.app-page .detail-card{
  padding: .75rem;
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,.16);
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,249,253,.95));
  box-shadow: 0 10px 24px rgba(15,23,42,.05);
  min-height: 100%;
}

html.theme-dark body.app-page .detail-card{
  background:
    linear-gradient(180deg, rgba(15,23,42,.92), rgba(15,23,42,.76));
  border-color: rgba(148,163,184,.16);
  box-shadow: 0 14px 30px rgba(0,0,0,.2);
}

body.app-page .detail-card-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: 2rem;
  margin-bottom: .45rem;
  padding: .15rem .15rem .4rem;
  border-bottom: 1px solid rgba(148,163,184,.14);
  overflow: hidden;
}

body.app-page .detail-card-title{
  margin: 0;
  padding-top: 0;
  font-size: .86rem;
  font-weight: 900;
  letter-spacing: .08em;
  line-height: 1.1;
  color: #6b7b98;
  text-transform: uppercase;
}

body.app-page .detail-card-badge{
  font-size: .68rem;
  padding: .18rem .48rem;
  border-radius: 999px;
  background: rgba(17,78,136,.08);
  color: var(--app-primary);
  font-weight: 800;
}

body.app-page .detail-fields{
  display: grid;
  grid-template-columns: 1fr;
  gap: .5rem;
}

body.app-page .detail-item{
  padding: .68rem .8rem .72rem;
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,.14);
  background: linear-gradient(180deg, rgba(255,255,255,.86), rgba(248,250,252,.8));
}

body.app-page .detail-item .form-control{
  border-radius: 12px;
  min-height: 36px;
}

body.app-page .detail-label{
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--app-muted);
  margin-bottom: .22rem;
  font-weight: 900;
}

body.app-page .detail-value{
  font-size: .96rem;
  font-weight: 800;
  color: var(--app-text);
  word-break: break-word;
  line-height: 1.42;
}

body.app-page .detail-input{
  font-size: .97rem;
  font-weight: 900;
  letter-spacing: .01em;
  color: var(--app-text);
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(148,163,184,.18);
  box-shadow: inset 0 1px 2px rgba(15,23,42,.04);
  padding-top: .48rem;
  padding-bottom: .48rem;
  padding-left: .8rem;
  padding-right: .8rem;
}

html.theme-dark body.app-page .detail-input{
  background: rgba(15,23,42,.84);
  border-color: rgba(148,163,184,.16);
  color: #f8fafc;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.18);
}

body.app-page .detail-input::placeholder{
  font-weight: 700;
  color: rgba(100,116,139,.78);
}

body.app-page .branch-detail-readonly .detail-item input{
  pointer-events: none;
  background: transparent;
  border-color: transparent;
  padding-left: .6rem;
  padding-right: .6rem;
  box-shadow: none;
}

body.app-page .branch-detail-readonly .detail-item input:disabled{
  color: var(--app-text);
  opacity: 1;
  -webkit-text-fill-color: var(--app-text);
}

body.app-page .branch-detail-readonly .detail-item{
  background: rgba(255,255,255,.58);
}

html.theme-dark body.app-page .branch-detail-readonly .detail-item{
  background: rgba(15,23,42,.58);
}

body.app-page .detail-card{
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

body.app-page .detail-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(15,23,42,.08);
  border-color: rgba(61,183,235,.22);
}

body.app-page .delivery-shell{
  max-width: 1420px;
  margin: 0 auto;
}

body.app-page .delivery-list-panel{
  overflow: hidden;
  border: 1px solid rgba(185,28,28,.16);
  border-radius: 22px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 16px 36px rgba(127,29,29,.10);
}

body.app-page:has(#registerModal) .ready-list-panel{
  overflow: hidden;
  border: 1px solid rgba(185,28,28,.16);
  border-radius: 22px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 16px 36px rgba(127,29,29,.10);
}

body.app-page:has(#registerModal) .ready-list-panel .panel-head{
  min-height: 74px;
  padding: .9rem 1.15rem;
  border-bottom: 1px solid rgba(185,28,28,.13) !important;
  background: linear-gradient(100deg, rgba(153,27,27,.13), rgba(220,38,38,.08) 55%, rgba(255,255,255,.72)) !important;
}

body.app-page:has(#registerModal) .ready-list-title{
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: #7f1d1d;
  font-size: 1.05rem;
  letter-spacing: -.01em;
}

body.app-page:has(#registerModal) .ready-list-title > i{
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(135deg, #991b1b, #dc2626);
  color: #fff;
  font-size: 1rem;
  box-shadow: 0 7px 14px rgba(153,27,27,.22);
}

body.app-page:has(#registerModal) .ready-list-panel .panel-head #btnRegister{
  padding-inline: 1rem;
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(153,27,27,.16);
}

body.app-page:has(#registerModal) .ready-list-panel .panel-body{
  padding: 1rem;
  background: linear-gradient(180deg, rgba(255,250,250,.72), rgba(255,255,255,.96));
}

body.app-page:has(#registerModal) .ready-table-wrap{
  overflow: hidden;
  border: 1px solid rgba(185,28,28,.14);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(127,29,29,.05);
}

html.theme-dark body.app-page:has(#registerModal) .ready-list-panel{
  background: rgba(15,23,42,.92);
  border-color: rgba(248,113,113,.20);
}

html.theme-dark body.app-page:has(#registerModal) .ready-list-panel .panel-head{
  background: linear-gradient(100deg, rgba(127,29,29,.42), rgba(30,41,59,.80)) !important;
  border-bottom-color: rgba(248,113,113,.16) !important;
}

html.theme-dark body.app-page:has(#registerModal) .ready-list-title{
  color: #fecaca;
}

html.theme-dark body.app-page:has(#registerModal) .ready-list-panel .panel-body{
  background: rgba(15,23,42,.54);
}

@media (max-width: 767.98px){
  body.app-page:has(#registerModal) .ready-list-panel .panel-head{
    padding: .8rem;
  }
}

body.app-page .delivery-list-panel .panel-head{
  min-height: 74px;
  padding: .9rem 1.15rem;
  border-bottom: 1px solid rgba(185,28,28,.13) !important;
  background:
    linear-gradient(100deg, rgba(153,27,27,.13), rgba(220,38,38,.08) 55%, rgba(255,255,255,.72)) !important;
}

body.app-page .delivery-list-title{
  gap: .7rem;
  color: #7f1d1d;
  font-size: 1.05rem;
  letter-spacing: -.01em;
}

body.app-page .delivery-list-title > i{
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(135deg, #991b1b, #dc2626);
  color: #fff;
  font-size: 1rem;
  box-shadow: 0 7px 14px rgba(153,27,27,.22);
}

body.app-page .delivery-list-tools{
  padding: .3rem;
  border: 1px solid rgba(185,28,28,.12);
  border-radius: 14px;
  background: rgba(255,255,255,.74);
  box-shadow: 0 5px 14px rgba(127,29,29,.05);
}

body.app-page .delivery-list-tools .form-control{
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.app-page .delivery-list-tools .form-control:focus{
  border-color: rgba(185,28,28,.24) !important;
  background: #fff !important;
}

body.app-page .delivery-list-panel .panel-body{
  padding: 1rem;
  background: linear-gradient(180deg, rgba(255,250,250,.72), rgba(255,255,255,.96));
}

body.app-page .delivery-list-panel .table-wrap{
  border-color: rgba(185,28,28,.14);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(127,29,29,.05);
}

html.theme-dark body.app-page .delivery-list-panel{
  background: rgba(15,23,42,.92);
  border-color: rgba(248,113,113,.20);
}

html.theme-dark body.app-page .delivery-list-panel .panel-head{
  background: linear-gradient(100deg, rgba(127,29,29,.42), rgba(30,41,59,.80)) !important;
  border-bottom-color: rgba(248,113,113,.16) !important;
}

html.theme-dark body.app-page .delivery-list-title{
  color: #fecaca;
}

html.theme-dark body.app-page .delivery-list-tools{
  background: rgba(15,23,42,.54);
  border-color: rgba(248,113,113,.14);
}

html.theme-dark body.app-page .delivery-list-panel .panel-body{
  background: rgba(15,23,42,.54);
}

@media (max-width: 767.98px){
  body.app-page .delivery-list-panel .panel-head{
    padding: .8rem;
  }

  body.app-page .delivery-list-tools{
    width: 100%;
  }
}

body.app-page .delivery-page-wrap{
  max-width: min(100%, 1420px);
  margin-left: auto;
  margin-right: auto;
}

body.app-page .delivery-table{
  table-layout: fixed;
  width: 100%;
  min-width: 1160px;
}

body.app-page .delivery-shell .delivery-table th,
body.app-page .delivery-shell .delivery-table td{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 1.05rem !important;
  line-height: 1.42;
}

body.app-page .delivery-table th:nth-child(1), body.app-page .delivery-table td:nth-child(1){ width: 76px; }
body.app-page .delivery-table th:nth-child(2), body.app-page .delivery-table td:nth-child(2){ width: 250px; }
body.app-page .delivery-table th:nth-child(3), body.app-page .delivery-table td:nth-child(3){ width: 130px; }
body.app-page .delivery-table th:nth-child(4), body.app-page .delivery-table td:nth-child(4){ width: 150px; }
body.app-page .delivery-table th:nth-child(5), body.app-page .delivery-table td:nth-child(5){ width: 130px; }
body.app-page .delivery-table th:nth-child(6), body.app-page .delivery-table td:nth-child(6){ width: 72px; }
body.app-page .delivery-table th:nth-child(7), body.app-page .delivery-table td:nth-child(7){ width: 175px; }
body.app-page .delivery-table th:nth-child(8), body.app-page .delivery-table td:nth-child(8){ width: 104px; }
body.app-page .delivery-table th:nth-child(9), body.app-page .delivery-table td:nth-child(9){ width: 108px; }

body.app-page .delivery-table thead th{
  background: rgba(248,250,252,.98);
  color: #64748b;
  border-bottom: 1px solid rgba(148,163,184,.14);
}

html.theme-dark body.app-page .delivery-table thead th{
  background: rgba(15,23,42,.9);
  color: #cbd5e1;
}

body.app-page .delivery-table tbody tr:hover{
  background-color: rgba(61,183,235,.05);
}

html.theme-dark body.app-page .delivery-table tbody tr:hover{
  background-color: rgba(61,183,235,.08);
}

body.app-page .delivery-table{
  min-width: 1160px;
}

body.app-page .delivery-shell .delivery-table thead th{
  font-size: 1rem !important;
  font-weight: 700;
}

body.app-page .delivery-shell .delivery-table tbody td{
  font-size: 1.00rem !important;
  padding-top: 0.75rem !important;
  padding-bottom: 0.75rem !important;
}

body.app-page .delivery-shell .delivery-table tbody td.branch-cell,
body.app-page .delivery-shell .delivery-table tbody td .delivery-status-select{
  font-size: 1.05rem !important;
}

body.app-page .delivery-shell .delivery-table tbody td .delivery-status-select{
  min-height: 26px;
  padding-top: .18rem;
  padding-bottom: .18rem;
  padding-left: .45rem;
  padding-right: 1rem;
  line-height: 1.05;
  font-size: .86rem !important;
  max-width: 108px;
}

body.app-page .delivery-shell .delivery-table .app-action-buttons{
  gap: .28rem;
}

body.app-page .delivery-shell .delivery-table .app-icon-btn,
body.app-page .delivery-shell .delivery-table .app-sync-done{
  width: 28px;
  height: 28px;
  min-width: 28px;
}

body.app-page .delivery-shell .delivery-table .app-icon-btn i,
body.app-page .delivery-shell .delivery-table .app-sync-done i{
  font-size: .8rem;
}

body.app-page .delivery-combobox{
  position: relative;
}

body.app-page .delivery-combobox-input{
  padding-right: 2.65rem !important;
}

body.app-page .delivery-combobox-toggle{
  position: absolute;
  top: 50%;
  right: .45rem;
  width: 2rem;
  height: 2rem;
  transform: translateY(-50%);
  border: 0;
  border-radius: 999px;
  background: #eef4fb;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.app-page .delivery-combobox-menu{
  position: absolute;
  z-index: 1080;
  left: 0;
  right: 0;
  top: calc(100% + .4rem);
  display: none;
  max-height: 240px;
  overflow-y: auto;
  padding: .35rem;
  border: 1px solid #dbe4ef;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .16);
}

body.app-page .delivery-combobox.is-open .delivery-combobox-menu{
  display: block;
}

body.app-page .delivery-combobox-option,
body.app-page .delivery-combobox-empty{
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: .62rem .72rem;
  background: transparent;
  color: #0f172a;
  text-align: left;
  font-size: .92rem;
  line-height: 1.25;
}

body.app-page .delivery-combobox-option{
  display: flex;
  align-items: center;
  gap: .55rem;
}

body.app-page .delivery-combobox-option::before{
  content: "";
  width: .45rem;
  height: .45rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #38bdf8;
}

body.app-page .delivery-combobox-option:hover,
body.app-page .delivery-combobox-option.is-active{
  background: #eef6ff;
}

body.app-page .delivery-combobox-empty{
  color: #64748b;
  text-align: center;
}

body.app-page .delivery-status-select{
  display: block;
  width: 88%;
  border-radius: var(--app-radius-md) !important;
  border-width: 2px !important;
  font-weight: 700;
  white-space: nowrap;
  padding-left: .75rem !important;
  padding-right: .75rem !important;
  background-image: none !important;
  -webkit-appearance: none;
  appearance: none;
  margin: 0 auto;
  text-align: center !important;
  text-align-last: center;
}

body.app-page .delivery-status-select.is-sent{
  border-color: rgba(245,158,11,.92) !important;
  background-color: rgba(245,158,11,.10) !important;
  color: #0f172a !important;
}

body.app-page .delivery-status-select.is-returned{
  border-color: rgba(22,163,74,.95) !important;
  background-color: rgba(16,185,129,.16) !important;
  color: #14532d !important;
}

html.theme-dark body.app-page .delivery-status-select{
  color: #e5e7eb !important;
  background-color: rgba(15,23,42,.92) !important;
  border-color: rgba(148,163,184,.6) !important;
}

html.theme-dark body.app-page .delivery-status-select.is-sent{
  background-color: rgba(146,64,14,.58) !important;
  border-color: rgba(251,191,36,.85) !important;
  color: #fffbeb !important;
}

html.theme-dark body.app-page .delivery-status-select.is-returned{
  background-color: rgba(16,185,129,.22) !important;
  border-color: rgba(74,222,128,.92) !important;
  color: #dcfce7 !important;
}

html.theme-dark body.app-page .delivery-status-select option{
  color: #0f172a !important;
}

body.app-page #printSheet{
  position: fixed;
  left: -99999px;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

html.theme-dark body.app-page .delivery-combobox-toggle{
  background: rgba(14, 165, 233, .16);
  color: #bae6fd;
}

html.theme-dark body.app-page .delivery-combobox-menu{
  border-color: rgba(148, 163, 184, .22);
  background: #0f172a;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .36);
}

html.theme-dark body.app-page .delivery-combobox-option,
html.theme-dark body.app-page .delivery-combobox-empty{
  color: #e5e7eb;
}

html.theme-dark body.app-page .delivery-combobox-option:hover,
html.theme-dark body.app-page .delivery-combobox-option.is-active{
  background: rgba(14, 165, 233, .16);
}

body.app-page .equipment-page-wrap{
  max-width: 920px;
}

body.app-page .equip-table thead th{
  position: sticky;
  top: 0;
  z-index: 2;
}

body.app-page .equip-table tbody td{
  padding-top: .55rem !important;
  padding-bottom: .55rem !important;
  vertical-align: middle;
}

body.app-page .equip-table thead th{
  padding-top: .65rem !important;
  padding-bottom: .65rem !important;
}

body.app-page .equip-type,
body.app-page .equip-model{
  font-weight: 400;
  color: #0f172a;
}

body.app-page .equip-model-toggle{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .45rem;
  width: 100%;
  min-height: 2.2rem;
  max-width: 100%;
  border: 0;
  background: transparent;
  padding: .15rem 0;
  text-align: left;
  color: inherit;
}

body.app-page .equip-model-toggle .equip-group-caret{
  width: 1.65rem;
  height: 1.65rem;
  background: #eef4fb;
  color: #2563eb;
}

body.app-page .equip-model-toggle.is-open .equip-group-caret{
  transform: rotate(180deg);
  background: #dbeafe;
}

body.app-page .equip-group-toggle{
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  color: inherit;
}

body.app-page .equip-group-main{
  display: flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
}

body.app-page .equip-group-caret{
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  background: #eef4fb;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transition: transform .18s ease, background-color .18s ease;
}

body.app-page .equip-group-toggle.is-open .equip-group-caret{
  transform: rotate(180deg);
  background: #dbeafe;
}

body.app-page .equip-group-text{
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .14rem;
}

body.app-page .equip-group-name{
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.app-page .equip-group-sub{
  font-size: .85rem;
  color: #64748b;
}

body.app-page .equip-detail-row td{
  background: #f8fbff;
  padding: 0 !important;
  border-top: 0 !important;
}

body.app-page .equip-detail-panel{
  padding: 14px 16px 16px;
  border-top: 1px solid rgba(148, 163, 184, .18);
}

body.app-page .equip-detail-title{
  font-size: .84rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: .7rem;
}

body.app-page .equip-model-list{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body.app-page .equip-model-item{
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 14px;
  background: #fff;
}

body.app-page .equip-model-item-main{
  min-width: 0;
}

body.app-page .equip-model-item-line1{
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.app-page .equip-model-item-line2{
  margin-top: 2px;
  font-size: .88rem;
  color: #64748b;
}

body.app-page .equip-model-actions{
  display: inline-flex;
  gap: .4rem;
  flex-wrap: nowrap;
}

html.theme-dark body.app-page .equip-group-caret{
  background: rgba(14, 165, 233, .14);
  color: #bae6fd;
}

html.theme-dark body.app-page .equip-group-toggle.is-open .equip-group-caret{
  background: rgba(14, 165, 233, .22);
}

html.theme-dark body.app-page .equip-group-name,
html.theme-dark body.app-page .equip-model-item-line1{
  color: #e5e7eb;
}

html.theme-dark body.app-page .equip-group-sub,
html.theme-dark body.app-page .equip-detail-title,
html.theme-dark body.app-page .equip-model-item-line2{
  color: #94a3b8;
}

html.theme-dark body.app-page .equip-detail-row td{
  background: rgba(15, 23, 42, .92);
}

html.theme-dark body.app-page .equip-detail-panel{
  border-top-color: rgba(148, 163, 184, .16);
}

html.theme-dark body.app-page .equip-model-item{
  background: rgba(15, 23, 42, .88);
  border-color: rgba(148, 163, 184, .16);
}

body.app-page .computer-page-wrap{
  max-width: 1360px;
  margin-left: auto;
  margin-right: auto;
}

body.app-page .computer-table{
  width: 100%;
  table-layout: fixed;
}

body.app-page .computer-table th,
body.app-page .computer-table td{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.app-page .computer-table th:nth-child(1), body.app-page .computer-table td:nth-child(1){ width: 130px; }
body.app-page .computer-table th:nth-child(2), body.app-page .computer-table td:nth-child(2){ width: 200px; }
body.app-page .computer-table th:nth-child(3), body.app-page .computer-table td:nth-child(3){ width: 180px; }
body.app-page .computer-table th:nth-child(4), body.app-page .computer-table td:nth-child(4){ width: 80px; }

body.app-page .computer-detail-grid{
  display: grid;
  gap: .85rem;
}

body.app-page .computer-detail-item{
  padding: .85rem 1rem;
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 14px;
  background: rgba(248,250,252,.92);
}

html.theme-dark body.app-page .computer-detail-item{
  background: rgba(15,23,42,.72);
  border-color: rgba(148,163,184,.16);
}

body.app-page .computer-detail-label{
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--app-muted);
  margin-bottom: .25rem;
}

body.app-page .computer-detail-value{
  font-weight: 700;
  word-break: break-word;
}

@media print {
  .equipment-page-wrap .btn,
  .delivery-page-wrap .btn,
  .computer-page-wrap .btn,
  .equipment-page-wrap .modal,
  .delivery-page-wrap .modal,
  .computer-page-wrap .modal,
  .navbar,
  .add-btn{
    display: none !important;
  }

  .equip-table th:last-child,
  .equip-table td:last-child,
  .computer-table th:last-child,
  .computer-table td:last-child{
    display: none !important;
  }

  body.print-label .navbar,
  body.print-label .container,
  body.print-label .modal,
  body.print-label .toast-container{
    display: none !important;
  }

  body.print-label{
    background: #fff !important;
  }

  body.print-label .print-sheet{
    width: 100%;
    min-height: 100vh;
    padding: 12mm;
    box-sizing: border-box;
    font-family: "Bai Jamjuree", sans-serif;
    color: #000;
    display: flex;
    flex-direction: column;
  }

  body.print-label .sheet{
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
  }

  body.print-label .print-top{
    text-align: center;
    margin-bottom: 10mm;
  }

  body.print-label .print-title{
    font-size: 22pt;
    font-weight: 800;
    line-height: 1.1;
    margin: 0;
  }

  body.print-label .print-subtitle{
    margin-top: 3mm;
    font-size: 10pt;
    opacity: .9;
  }

  body.print-label .print-label-box{
    border: 1px solid #000;
    padding: 12mm;
    border-radius: 8mm;
  }

  body.print-label .print-code{
    font-size: 54pt;
    font-weight: 500;
    line-height: 1.1;
    text-align: center;
    width: 100%;
  }

  body.print-label #printRoot{
    display: block !important;
  }

  body.print-label #printRoot > *{
    display: block !important;
  }
}

/* Hard override for visual consistency across all major pages */
body.app-page .page-hero,
body.app-page .branches-hero,
body.app-page .remote-hero,
body.app-page .tool-hero,
body.app-page .computer-hero,
body.app-page .hero,
body.app-page .dashboard-hero,
body.app-page .branch-detail-hero{
  position: relative;
  overflow: hidden;
  border-radius: 28px !important;
  padding: 1.25rem 1.35rem !important;
  margin-bottom: 1rem !important;
  background:
    linear-gradient(135deg, rgba(127,29,29,.98), rgba(185,28,28,.96) 55%, rgba(220,38,38,.92)) !important;
  color: #fff !important;
  box-shadow: 0 18px 48px rgba(127,29,29,.22) !important;
}

body.app-page .page-hero::after,
body.app-page .branches-hero::after,
body.app-page .remote-hero::after,
body.app-page .tool-hero::after,
body.app-page .computer-hero::after,
body.app-page .hero::after,
body.app-page .dashboard-hero::after,
body.app-page .branch-detail-hero::after{
  content: "";
  position: absolute;
  inset: auto -120px -120px auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  pointer-events: none;
}

body.app-page .page-hero h1,
body.app-page .branches-hero h1,
body.app-page .remote-hero h1,
body.app-page .tool-hero h1,
body.app-page .computer-hero h1,
body.app-page .hero h1,
body.app-page .dashboard-hero h1,
body.app-page .branch-detail-hero h1,
body.app-page .branch-detail-hero h5{
  margin: 0 !important;
  font-size: clamp(1.45rem, 2.8vw, 2.2rem) !important;
  line-height: 1.12 !important;
  font-weight: 800 !important;
  letter-spacing: -.02em !important;
  color: #fff !important;
}

body.app-page .page-hero p,
body.app-page .branches-hero p,
body.app-page .remote-hero p,
body.app-page .tool-hero p,
body.app-page .computer-hero p,
body.app-page .hero p,
body.app-page .dashboard-hero p,
body.app-page .branch-detail-hero p{
  margin: .35rem 0 0 !important;
  max-width: 840px;
  opacity: .92;
  color: rgba(255,255,255,.92) !important;
}

body.app-page .page-hero .dashboard-eyebrow,
body.app-page .branches-hero .dashboard-eyebrow,
body.app-page .remote-hero .dashboard-eyebrow,
body.app-page .tool-hero .tool-hero-eyebrow,
body.app-page .computer-hero .dashboard-eyebrow,
body.app-page .hero-eyebrow,
body.app-page .dashboard-eyebrow,
body.app-page .branch-detail-hero .eyebrow{
  font-size: .78rem !important;
  letter-spacing: .18em !important;
  font-weight: 800 !important;
  opacity: .82 !important;
  color: rgba(255,255,255,.78) !important;
}

html.theme-dark body.app-page .page-hero,
html.theme-dark body.app-page .branches-hero,
html.theme-dark body.app-page .remote-hero,
html.theme-dark body.app-page .tool-hero,
html.theme-dark body.app-page .computer-hero,
html.theme-dark body.app-page .hero,
html.theme-dark body.app-page .dashboard-hero,
html.theme-dark body.app-page .branch-detail-hero{
  background:
    linear-gradient(135deg, rgba(127,29,29,.94), rgba(159,18,57,.92) 60%, rgba(225,29,72,.82)) !important;
}

body.app-page .app-card > .card-header,
body.app-page .card.app-card > .card-header,
body.app-page .panel-head,
body.app-page .tool-card-head,
body.app-page .branch-card-head,
body.app-page .remote-toolbar,
body.app-page .detail-card-header{
  background:
    linear-gradient(90deg, rgba(15,76,129,.12), rgba(37,99,235,.10), rgba(61,183,235,.08)),
    rgba(255,255,255,.82) !important;
  border-color: rgba(148,163,184,.14) !important;
  color: var(--app-text) !important;
}

html.theme-dark body.app-page .app-card > .card-header,
html.theme-dark body.app-page .card.app-card > .card-header,
html.theme-dark body.app-page .panel-head,
html.theme-dark body.app-page .tool-card-head,
html.theme-dark body.app-page .branch-card-head,
html.theme-dark body.app-page .remote-toolbar,
html.theme-dark body.app-page .detail-card-header{
  background:
    linear-gradient(90deg, rgba(56,189,248,.16), rgba(37,99,235,.14), rgba(14,165,233,.10)),
    rgba(12,19,36,.82) !important;
  border-color: rgba(148,163,184,.14) !important;
  color: #e5e7eb !important;
}

/* Red / White global theme overlay --------------------------------------- */
body.app-page{
  background-color: #fff5f5;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,.99) 0%, rgba(255,244,244,.97) 100%),
    radial-gradient(720px 360px at 8% 0%, rgba(248,113,113,.22), transparent 60%),
    radial-gradient(720px 360px at 92% 8%, rgba(220,38,38,.14), transparent 60%);
}

body.app-page .app-brand{
  background: linear-gradient(135deg, #991b1b, #dc2626, #fb7185);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
}

body.app-page .app-navbar{
  background:
    linear-gradient(90deg, rgba(185,28,28,.12), rgba(220,38,38,.10), rgba(251,113,133,.08)),
    rgba(255,255,255,.82) !important;
  border-bottom-color: rgba(185,28,28,.12) !important;
}

body.app-page .app-card,
body.app-page .modal-content,
body.app-page .summary-card,
body.app-page .branch-card,
body.app-page .detail-card,
body.app-page .panel,
body.app-page .tool-card{
  border-color: rgba(185,28,28,.12);
  box-shadow: 0 14px 34px rgba(127,29,29,.08);
}

body.app-page .app-card > .card-header,
body.app-page .card.app-card > .card-header,
body.app-page .panel-head,
body.app-page .tool-card-head,
body.app-page .branch-card-head,
body.app-page .remote-toolbar,
body.app-page .detail-card-header{
  background:
    linear-gradient(90deg, rgba(185,28,28,.10), rgba(220,38,38,.08), rgba(251,113,133,.06)),
    rgba(255,255,255,.88) !important;
  border-color: rgba(185,28,28,.12) !important;
}

body.app-page .page-hero,
body.app-page .branches-hero,
body.app-page .remote-hero,
body.app-page .tool-hero,
body.app-page .computer-hero,
body.app-page .hero,
body.app-page .dashboard-hero,
body.app-page .branch-detail-hero{
  background:
    linear-gradient(135deg, rgba(127,29,29,.98), rgba(185,28,28,.96) 55%, rgba(220,38,38,.92)) !important;
  box-shadow: 0 18px 48px rgba(127,29,29,.22) !important;
}

body.app-page .page-hero::after,
body.app-page .branches-hero::after,
body.app-page .remote-hero::after,
body.app-page .tool-hero::after,
body.app-page .computer-hero::after,
body.app-page .hero::after,
body.app-page .dashboard-hero::after,
body.app-page .branch-detail-hero::after{
  background: rgba(255,255,255,.10);
}

body.app-page .app-btn-primary,
body.app-page .btn-primary{
  background: linear-gradient(135deg, #991b1b, #dc2626, #fb7185) !important;
  border-color: #991b1b !important;
  box-shadow: 0 14px 26px rgba(185,28,28,.22);
}

body.app-page .app-btn-outline,
body.app-page .btn-outline-primary{
  color: #991b1b !important;
  border-color: rgba(185,28,28,.28) !important;
}

body.app-page .app-btn-outline:hover,
body.app-page .btn-outline-primary:hover{
  background: rgba(185,28,28,.08) !important;
  border-color: rgba(185,28,28,.35) !important;
}

body.app-page .app-input,
body.app-page .app-select,
body.app-page .app-textarea,
body.app-page .form-control,
body.app-page .form-select{
  border-color: rgba(185,28,28,.16) !important;
}

body.app-page .app-input:focus,
body.app-page .app-select:focus,
body.app-page .app-textarea:focus,
body.app-page .form-control:focus,
body.app-page .form-select:focus{
  border-color: rgba(185,28,28,.50) !important;
  box-shadow: 0 0 0 .22rem rgba(185,28,28,.14) !important;
}

body.app-page .app-table thead th,
body.app-page .table thead th{
  background: rgba(255,247,247,.96) !important;
  color: #7f1d1d !important;
  border-bottom-color: rgba(185,28,28,.12) !important;
}

body.app-page .app-table tbody tr:hover,
body.app-page .table tbody tr:hover{
  background: rgba(248,113,113,.05);
}

body.app-page .app-chip,
body.app-page .branch-pill,
body.app-page .soft-badge,
body.app-page .status-pill,
body.app-page .app-badge-soft{
  border-color: rgba(185,28,28,.18);
  background:
    linear-gradient(90deg, rgba(185,28,28,.08), rgba(220,38,38,.06), rgba(251,113,133,.06)),
    rgba(255,255,255,.82);
  color: #7f1d1d;
}

body.app-page .app-action-buttons{
  gap: .5rem;
}

body.app-page .summary-card,
body.app-page .dashboard-range-summary{
  background:
    linear-gradient(180deg, rgba(255,255,255,.90), rgba(255,245,245,.94));
  border: 1px solid rgba(185,28,28,.12);
}

body.app-page .remote-search{
  border-color: rgba(185,28,28,.12);
  background: rgba(255,255,255,.84);
}

body.app-page .remote-code,
body.app-page .equip-group-name,
body.app-page .equip-model-item-line1,
body.app-page .detail-value,
body.app-page .computer-detail-value{
  color: #3f1515;
}

body.app-page .delivery-status-select.is-sent{
  border-color: rgba(185,28,28,.50) !important;
  background-color: rgba(248,113,113,.10) !important;
  color: #7f1d1d !important;
}

body.app-page .delivery-status-select.is-returned{
  border-color: rgba(220,38,38,.50) !important;
  background-color: rgba(220,38,38,.12) !important;
  color: #14532d !important;
}

body.app-page .delivery-combobox-toggle,
body.app-page .equip-group-caret,
body.app-page .equip-model-toggle .equip-group-caret{
  background: rgba(254,226,226,.95);
  color: #b91c1c;
}

/* Delivery comboboxes use the compact pill control shown in the form design. */
body.app-page .delivery-combobox-input{
  min-height: 40px;
  padding-right: 3rem !important;
  border-radius: 10px !important;
  border-color: #d5d9e2 !important;
  background: #fff !important;
  color: #344054 !important;
}

body.app-page .delivery-combobox-input::placeholder{
  color: #98a2b3 !important;
}

body.app-page .delivery-combobox-toggle{
  right: .35rem;
  width: 32px;
  height: 32px;
  background: #fee2e2;
  color: #dc2626;
}

body.app-page .delivery-combobox-toggle:hover,
body.app-page .delivery-combobox-toggle:focus-visible{
  background: #fecaca;
  color: #b91c1c;
}

body.app-page .delivery-combobox-option::before{
  background: #dc2626;
}

body.app-page .dashboard-asset{
  filter: drop-shadow(0 20px 40px rgba(127,29,29,.18));
}

body.app-page .dashboard-summary-total,
body.app-page .dashboard-stat-number,
body.app-page .dashboard-range-summary-value{
  color: #b91c1c;
}

body.app-page .dashboard-line-chart polyline,
body.app-page .dashboard-line-chart circle{
  stroke: #dc2626;
  fill: #fff5f5;
}

body.app-page .dashboard-line-chart text{
  fill: #7f1d1d;
}

@media (max-width: 991.98px){
  body.app-page .app-navbar .container{
    gap: .75rem;
  }

  body.app-page .app-navbar .ms-auto{
    margin-left: 0 !important;
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  body.app-page .page-hero,
  body.app-page .branches-hero,
  body.app-page .remote-hero,
  body.app-page .tool-hero,
  body.app-page .computer-hero,
  body.app-page .hero,
  body.app-page .dashboard-hero,
  body.app-page .branch-detail-hero{
    padding: 1rem !important;
    border-radius: 22px !important;
  }

  body.app-page .dashboard-hero{
    grid-template-columns: 1fr !important;
  }

  body.app-page .dashboard-hero .dashboard-asset{
    max-width: 140px;
    margin-inline: auto;
  }

  body.app-page .branch-card-head,
  body.app-page .panel-head,
  body.app-page .tool-card-head,
  body.app-page .remote-toolbar,
  body.app-page .detail-card-header{
    padding-inline: 1rem !important;
  }

  body.app-page .app-card,
  body.app-page .modal-content{
    border-radius: 18px;
  }
}

@media (max-width: 767.98px){
  body.app-page .app-card .card-header,
  body.app-page .card.app-card > .card-header,
  body.app-page .panel-head,
  body.app-page .tool-card-head,
  body.app-page .branch-card-head,
  body.app-page .remote-toolbar,
  body.app-page .detail-card-header{
    flex-direction: column;
    align-items: flex-start !important;
    gap: .75rem;
  }

  body.app-page .app-card .card-header > div:last-child,
  body.app-page .panel-head > div:last-child,
  body.app-page .tool-card-head > div:last-child{
    width: 100%;
  }

  body.app-page .app-card .card-header .btn,
  body.app-page .panel-head .btn,
  body.app-page .tool-card-head .btn{
    width: 100%;
  }

  body.app-page .table-responsive{
    border-radius: 0 0 16px 16px;
  }

  body.app-page .app-action-buttons{
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  body.app-page .app-btn,
  body.app-page .btn{
    width: auto;
  }

  body.app-page .dashboard-range-controls{
    grid-template-columns: 1fr !important;
  }

  body.app-page .dashboard-ranking-grid,
  body.app-page .dashboard-insights{
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 575.98px){
  body.app-page .app-navbar .container{
    padding-inline: .75rem;
  }

  body.app-page .app-chip{
    width: 100%;
    justify-content: center;
  }

  body.app-page .summary-card{
    min-width: 0;
    flex: 1 1 calc(50% - .5rem);
  }

  body.app-page .remote-table thead th,
  body.app-page .equip-table thead th,
  body.app-page .computer-table thead th,
  body.app-page .delivery-table thead th{
    font-size: .84rem !important;
  }
}

/* Auth page red/white polish --------------------------------------------- */
body.app-auth-page{
  background:
    linear-gradient(180deg, rgba(255,255,255,.99), rgba(255,245,245,.97)),
    radial-gradient(780px 420px at 20% 0%, rgba(248,113,113,.20), transparent 60%),
    radial-gradient(780px 420px at 80% 0%, rgba(220,38,38,.16), transparent 60%);
}

body.app-auth-page .app-auth-card,
body.app-auth-page .auth-solo,
body.app-auth-page .auth-panel{
  border-color: rgba(185,28,28,.12);
  background:
    radial-gradient(540px 360px at 18% 0%, rgba(248,113,113,.22), transparent 60%),
    radial-gradient(520px 340px at 88% 10%, rgba(220,38,38,.14), transparent 60%),
    rgba(255,255,255,.88);
  box-shadow: 0 24px 60px rgba(127,29,29,.12);
}

body.app-auth-page .auth-badge{
  background:
    linear-gradient(90deg, rgba(185,28,28,.12), rgba(220,38,38,.10), rgba(251,113,133,.08)),
    rgba(255,255,255,.82);
  border-color: rgba(185,28,28,.14);
  color: #7f1d1d;
}

body.app-auth-page .auth-brand-title{
  color: #991b1b;
}

body.app-auth-page .auth-subtitle,
body.app-auth-page .auth-panel p{
  color: #7c5252;
}

body.app-auth-page .auth-feature,
body.app-auth-page .auth-metric{
  border-color: rgba(185,28,28,.12);
  background: rgba(255,255,255,.86);
}

body.app-auth-page .auth-feature i{
  color: #dc2626;
}

body.app-auth-page .app-btn-primary,
body.app-auth-page .btn-primary{
  background: linear-gradient(135deg, #991b1b, #dc2626, #fb7185) !important;
  border-color: #991b1b !important;
}

body.app-auth-page .app-input,
body.app-auth-page .form-control{
  border-color: rgba(185,28,28,.16) !important;
}

body.app-auth-page .app-input:focus,
body.app-auth-page .form-control:focus{
  border-color: rgba(185,28,28,.50) !important;
  box-shadow: 0 0 0 .22rem rgba(185,28,28,.14) !important;
}

/* Dashboard ranking layout override -------------------------------------- */
body.app-page .dashboard-ranking-grid{
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 1rem !important;
  align-items: stretch;
}

body.app-page .dashboard-ranking-card{
  min-width: 0;
}

@media (max-width: 991.98px){
  body.app-page .dashboard-ranking-grid{
    grid-template-columns: 1fr !important;
  }
}

/* Dashboard balance tweak ------------------------------------------------- */
body.app-page .dashboard-insights{
  grid-template-columns: minmax(210px, .34fr) minmax(0, 1fr) !important;
}

body.app-page .dashboard-today-card{
  padding: .9rem 1rem !important;
  min-height: 0 !important;
}

body.app-page .dashboard-flow-card{
  padding: 1.15rem 1.2rem !important;
  min-height: 280px !important;
}

body.app-page .dashboard-ranking-grid{
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

@media (max-width: 991.98px){
  body.app-page .dashboard-insights{
    grid-template-columns: 1fr !important;
  }

  body.app-page .dashboard-flow-card{
    min-height: 240px !important;
  }
}

/* Final dashboard overrides ---------------------------------------------- */
body.app-page .dashboard-ranking-grid{
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 1rem !important;
  align-items: stretch !important;
}

body.app-page .dashboard-ranking-grid > .dashboard-ranking-card{
  min-width: 0 !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  grid-column: auto !important;
}

body.app-page .dashboard-ranking-grid > .dashboard-ranking-card > .dashboard-ranking-list{
  flex: 1 1 auto;
}

@media (max-width: 991.98px){
  body.app-page .dashboard-ranking-grid{
    grid-template-columns: 1fr !important;
  }
}

body.app-page .dashboard-ranking-card:nth-child(3){
  grid-column: auto !important;
}

/* Final system theme layer ----------------------------------------------- */
:root{
  --ui-bg: #eef3f8;
  --ui-surface: rgba(255,255,255,.88);
  --ui-surface-solid: #ffffff;
  --ui-surface-raised: #ffffff;
  --ui-border: rgba(15,23,42,.11);
  --ui-border-strong: rgba(15,23,42,.18);
  --ui-text: #172033;
  --ui-text-secondary: #536176;
  --ui-text-muted: #758196;
  --ui-primary: #165d9a;
  --ui-primary-hover: #0f4778;
  --ui-accent: #2a9bc2;
  --ui-success: #16845a;
  --ui-warning: #b46a09;
  --ui-danger: #c13d4d;
  --ui-shadow: 0 16px 36px rgba(31,52,78,.10);
  --ui-shadow-raised: 0 22px 52px rgba(31,52,78,.16);
  --ui-radius: 16px;
  --ui-transition: 180ms ease;
}

html.theme-dark{
  --ui-bg: #0c1421;
  --ui-surface: rgba(19,30,47,.88);
  --ui-surface-solid: #131e2f;
  --ui-surface-raised: #18263a;
  --ui-border: rgba(148,163,184,.16);
  --ui-border-strong: rgba(148,163,184,.28);
  --ui-text: #edf3fb;
  --ui-text-secondary: #c2cede;
  --ui-text-muted: #91a1b7;
  --ui-primary: #70c5ef;
  --ui-primary-hover: #9bdcff;
  --ui-accent: #54bfd4;
  --ui-success: #62d39e;
  --ui-warning: #f4bb64;
  --ui-danger: #ff8997;
  --ui-shadow: 0 16px 36px rgba(0,0,0,.22);
  --ui-shadow-raised: 0 24px 58px rgba(0,0,0,.32);
}

html,
body,
body.app-page{
  transition: background-color var(--ui-transition), color var(--ui-transition);
}

body.app-page{
  color: var(--ui-text) !important;
  background:
    radial-gradient(720px 360px at 6% -8%, rgba(42,155,194,.12), transparent 64%),
    radial-gradient(680px 320px at 96% 0%, rgba(22,93,154,.10), transparent 62%),
    var(--ui-bg) !important;
  font-family: 'Bai Jamjuree', sans-serif;
}

html.theme-dark body.app-page{
  background:
    radial-gradient(720px 360px at 6% -8%, rgba(42,155,194,.14), transparent 64%),
    radial-gradient(680px 320px at 96% 0%, rgba(45,96,163,.16), transparent 62%),
    var(--ui-bg) !important;
}

body.app-page .app-card,
body.app-page .tool-card,
body.app-page .summary-card{
  color: var(--ui-text);
  background: var(--ui-surface) !important;
  border: 1px solid var(--ui-border) !important;
  box-shadow: var(--ui-shadow);
  transition: background-color var(--ui-transition), border-color var(--ui-transition), box-shadow var(--ui-transition), transform var(--ui-transition);
}

body.app-page .app-card:hover,
body.app-page .tool-card:hover{
  border-color: var(--ui-border-strong) !important;
  box-shadow: var(--ui-shadow-raised);
}

body.app-page .app-card h1,
body.app-page .app-card h2,
body.app-page .app-card h3,
body.app-page .app-card h4,
body.app-page .app-card h5,
body.app-page .app-card h6{
  color: var(--ui-text);
}

body.app-page .app-muted,
body.app-page .text-muted,
body.app-page .page-hero p,
body.app-page .form-text{
  color: var(--ui-text-secondary) !important;
}

body.app-page .app-navbar{
  color: var(--ui-text);
  background: var(--ui-surface) !important;
  border-color: var(--ui-border) !important;
  box-shadow: var(--ui-shadow);
}

body.app-page .app-table{
  color: var(--ui-text);
  --bs-table-bg: transparent;
  --bs-table-color: var(--ui-text);
  --bs-table-border-color: var(--ui-border);
}

body.app-page .app-table thead th,
body.app-page .app-table thead.table-light th{
  color: var(--ui-text-secondary) !important;
  background: color-mix(in srgb, var(--ui-surface-raised) 88%, transparent) !important;
  border-color: var(--ui-border) !important;
}

body.app-page .app-table tbody tr{
  border-color: var(--ui-border);
  transition: background-color var(--ui-transition), border-color var(--ui-transition);
}

body.app-page .app-table tbody tr:hover{
  background: color-mix(in srgb, var(--ui-accent) 8%, transparent) !important;
}

body.app-page .app-input,
body.app-page .app-select,
body.app-page .app-textarea,
body.app-page .form-control,
body.app-page .form-select{
  color: var(--ui-text) !important;
  background: var(--ui-surface-solid) !important;
  border-color: var(--ui-border-strong) !important;
  transition: border-color var(--ui-transition), box-shadow var(--ui-transition), background-color var(--ui-transition);
}

body.app-page .app-input::placeholder,
body.app-page .app-textarea::placeholder,
body.app-page .form-control::placeholder{
  color: var(--ui-text-muted) !important;
}

body.app-page .app-input:focus,
body.app-page .app-select:focus,
body.app-page .app-textarea:focus,
body.app-page .form-control:focus,
body.app-page .form-select:focus{
  border-color: var(--ui-accent) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-accent) 22%, transparent) !important;
}

body.app-page .app-btn,
body.app-page .btn{
  transition: transform var(--ui-transition), box-shadow var(--ui-transition), background-color var(--ui-transition), border-color var(--ui-transition), color var(--ui-transition);
}

body.app-page .app-btn:focus-visible,
body.app-page .btn:focus-visible,
body.app-page a:focus-visible,
body.app-page input:focus-visible,
body.app-page select:focus-visible,
body.app-page textarea:focus-visible{
  outline: 3px solid color-mix(in srgb, var(--ui-accent) 48%, transparent);
  outline-offset: 2px;
}

html.theme-dark body.app-page .modal-content,
html.theme-dark body.app-page .dropdown-menu,
html.theme-dark body.app-page .popover{
  color: var(--ui-text);
  background: var(--ui-surface-raised) !important;
  border-color: var(--ui-border-strong) !important;
  box-shadow: var(--ui-shadow-raised);
}

html.theme-dark body.app-page .modal-header,
html.theme-dark body.app-page .modal-footer{
  border-color: var(--ui-border) !important;
}

html.theme-dark body.app-page .dropdown-item{
  color: var(--ui-text-secondary);
}

html.theme-dark body.app-page .dropdown-item:hover,
html.theme-dark body.app-page .dropdown-item:focus{
  color: var(--ui-text);
  background: color-mix(in srgb, var(--ui-accent) 16%, transparent);
}

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
.ready-combobox { position: relative; }
.ready-combobox > input { padding-right: 42px; }
body:has(#registerModal) #equipmentType,
body:has(#registerModal) #model {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath fill='%23364759' d='M4 7.2 10 13l6-5.8 1.3 1.3-7.3 7.1-7.3-7.1z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 18px !important;
  padding-right: 42px !important;
  cursor: pointer;
}
.modal-body .col-md-6:not(.ready-combobox):has(> #equipmentType),
.modal-body .col-md-6:not(.ready-combobox):has(> #model) { position: relative; }
.modal-body .col-md-6:not(.ready-combobox):has(> #equipmentType)::after,
.modal-body .col-md-6:not(.ready-combobox):has(> #model)::after { content: '\2304'; position: absolute; right: 17px; bottom: 8px; z-index: 2; color: #364759; font-size: 22px; line-height: 1; pointer-events: none; }
.ready-catalog-toggle { position: absolute; z-index: 2; top: 50%; right: 0; width: 40px; height: 40px; transform: translateY(-50%); border: 0; border-radius: 0 10px 10px 0; background: transparent; color: var(--ui-muted, #667085); }
.ready-catalog-toggle:hover, .ready-catalog-toggle:focus { color: var(--ui-primary, #2563eb); background: var(--ui-primary-soft, #edf4ff); }
.ready-catalog-menu { display: none; position: absolute; z-index: 1080; inset: calc(100% + 4px) 0 auto; max-height: 220px; overflow-y: auto; padding: 6px; border: 1px solid var(--ui-border, #d9e1ec); border-radius: 12px; background: var(--ui-surface, #fff); box-shadow: 0 12px 28px rgba(26, 43, 73, .16); }
.ready-catalog-menu.is-open { display: grid; gap: 2px; }
.ready-catalog-option { border: 0; border-radius: 8px; padding: 8px 10px; background: transparent; text-align: left; color: inherit; font: inherit; }
.ready-catalog-option:hover, .ready-catalog-option:focus { background: var(--ui-primary-soft, #edf4ff); color: var(--ui-primary, #2563eb); }

/* Keep STOCK CONTROL catalog fields visually consistent with Delivery. */
body.app-page:has(#registerModal) .ready-combobox > input{
  min-height: 40px;
  padding-right: 3rem !important;
  border-radius: 10px !important;
  border-color: #d5d9e2 !important;
  background: #fff !important;
  background-image: none !important;
  color: #344054 !important;
}

/* Asset tag, brand, and status are internal compatibility fields only. */
body.app-page:has(#registerModal) .modal-body .col-md-6:has(> #brand),
body.app-page:has(#registerModal) .modal-body .col-md-6:has(> #assetTag),
body.app-page:has(#registerModal) .modal-body .col-md-6:has(> #status){
  display: none !important;
}

body.app-page:has(#registerModal) .ready-combobox > input::placeholder{
  color: #98a2b3 !important;
}

body.app-page:has(#registerModal) .ready-catalog-toggle{
  top: auto !important;
  right: .35rem !important;
  left: auto !important;
  bottom: 4px;
  width: 32px;
  height: 32px;
  transform: none;
  border-radius: 999px;
  background: #fee2e2;
  color: #dc2626;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.app-page:has(#registerModal) .ready-catalog-toggle:hover,
body.app-page:has(#registerModal) .ready-catalog-toggle:focus-visible{
  background: #fecaca;
  color: #b91c1c;
}

body.app-page:has(#registerModal) .ready-catalog-menu{
  top: calc(100% + .4rem);
  border-radius: 14px;
}

body.app-page .ready-summary-grid{
  margin: 0 0 2.25rem !important;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  align-items: stretch;
}

body.app-page .ready-summary-grid .ready-summary-item{
  min-width: 0;
  display: flex;
}

body.app-page .ready-summary-grid .ready-summary-item:nth-child(3){
  grid-column: 1;
}

body.app-page:has(#registerModal):not(.ready-summary-ready) main > section:nth-of-type(2){
  visibility: hidden;
}

body.app-page:has(#registerModal) main > section.panel .panel-body > .row.g-2.mb-3{
  display: none !important;
}

body.app-page .ready-summary-grid .app-stat-card{
  position: relative;
  width: 100%;
  min-height: 92px;
  padding: 14px 16px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 18px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 12px 28px rgba(15, 76, 129, .10);
}

body.app-page .ready-summary-grid .app-stat-card::after{
  position: absolute;
  right: 10px;
  bottom: -18px;
  font-family: "bootstrap-icons";
  font-size: 56px;
  line-height: 1;
  color: rgba(15, 76, 129, .08);
}

body.app-page .ready-summary-grid .col-lg-6:first-child .app-stat-card{
  border-color: rgba(22, 163, 74, .22);
}

body.app-page .ready-summary-grid .col-lg-6:first-child .app-stat-card::after{
  content: "\f26a";
  color: rgba(22, 163, 74, .12);
}

body.app-page .ready-summary-grid .col-lg-6:last-child .app-stat-card{
  border-color: rgba(37, 99, 235, .20);
}

body.app-page .ready-summary-grid .col-lg-6:last-child .app-stat-card::after{
  content: "\f2d1";
  color: rgba(37, 99, 235, .11);
}

body.app-page .ready-summary-grid .app-stat-card small{
  display: block;
  color: #526176;
  font-size: .82rem;
  font-weight: 600;
}

body.app-page .ready-summary-grid .app-stat-card strong{
  display: inline-block;
  margin-top: 2px;
  color: #10213f;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  line-height: 1;
}

body.app-page .ready-summary-grid .app-stat-card span{
  margin-left: 5px;
  color: #718096;
  font-size: .78rem;
}

@media (max-width: 991.98px){
  body.app-page .ready-summary-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .85rem;
  }
}

@media (max-width: 575.98px){
  body.app-page .ready-summary-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem;
    margin-bottom: 1.75rem !important;
  }
}

body.app-page .ready-summary-grid .app-stat-card.ready-summary-total,
body.app-page .ready-summary-grid .app-stat-card.ready-summary-sent,
body.app-page .ready-summary-grid .app-stat-card.ready-summary-type{
  border-color: rgba(15, 76, 129, .14);
}

body.app-page .ready-summary-grid .app-stat-card.ready-summary-total{
  border-color: rgba(22, 163, 74, .24);
}

body.app-page .ready-summary-grid .app-stat-card.ready-summary-sent{
  border-color: rgba(217, 119, 6, .24);
}

body.app-page .ready-row-actions{
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

body.app-page .ready-list-panel{
  max-width: 1060px;
  margin-left: auto;
  margin-right: auto;
}

body.app-page .ready-list-panel .ready-table-wrap{
  max-width: 980px;
  margin: 0 auto;
}

body.app-page .ready-list-panel .app-table{
  width: 100%;
  table-layout: fixed;
}

body.app-page .ready-list-panel .app-table th:nth-child(1),
body.app-page .ready-list-panel .app-table td:nth-child(1){ width: 28%; }

body.app-page .ready-list-panel .app-table th:nth-child(2),
body.app-page .ready-list-panel .app-table td:nth-child(2){ width: 30%; }

body.app-page .ready-list-panel .app-table th:nth-child(3),
body.app-page .ready-list-panel .app-table td:nth-child(3){ width: 14%; }

body.app-page .ready-list-panel .app-table th:nth-child(4),
body.app-page .ready-list-panel .app-table td:nth-child(4){ width: 16%; }

body.app-page .ready-list-panel .app-table th:nth-child(5),
body.app-page .ready-list-panel .app-table td:nth-child(5){ width: 12%; }

body.app-page .ready-detail-dialog{
  max-width: 860px;
}

body.app-page:has(#readySummaryGrid) .hero{
  max-width: 1060px;
  margin-left: auto;
  margin-right: auto;
}

body.app-page:has(#readySummaryGrid) .ready-summary-grid{
  max-width: 1060px;
  margin-left: auto !important;
  margin-right: auto !important;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

body.app-page:has(#readySummaryGrid) .ready-summary-grid .ready-summary-item:nth-child(-n+2){
  width: 50%;
  grid-column: span 2;
}

body.app-page:has(#readySummaryGrid) .ready-summary-grid .ready-summary-item:first-child{
  justify-self: end;
}

body.app-page:has(#readySummaryGrid) .ready-summary-grid .ready-summary-item:nth-child(2){
  justify-self: start;
}

body.app-page:has(#readySummaryGrid) .ready-summary-grid .ready-summary-item:nth-child(n+3){
  width: 100%;
  grid-column: span 1;
  justify-self: stretch;
}

body.app-page:has(#readySummaryGrid) .ready-summary-grid .ready-summary-item:nth-child(3){
  grid-column: 1;
}

@media (max-width: 575.98px){
  body.app-page:has(#readySummaryGrid) .ready-summary-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.app-page:has(#readySummaryGrid) .ready-summary-grid .ready-summary-item:nth-child(-n+2){
    width: 100%;
    grid-column: span 1;
    justify-self: stretch;
  }

  body.app-page:has(#readySummaryGrid) .ready-summary-grid .ready-summary-item:nth-child(n+3){
    grid-column: span 1;
  }
}

body.app-page [data-view-row]{
  cursor: pointer;
}

body.app-page [data-view-row]:hover,
body.app-page [data-view-row]:focus-visible{
  background: rgba(59,130,246,.06);
  outline: none;
}

body.app-page .ready-row-actions .btn{
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

body.app-page .ready-detail-status{
  display: inline-flex;
  align-items: center;
  min-width: 92px;
  justify-content: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: .84rem;
  font-weight: 600;
  line-height: 1.2;
}

body.app-page .ready-detail-status.is-ready{
  color: #166534;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
}

body.app-page .ready-detail-status.is-exported{
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
}

.print-preview-frame-wrap { aspect-ratio: 297 / 210; min-height: 0; height: auto; overflow: hidden; border: 1px solid var(--ui-border, #d9e1ec); border-radius: 14px; background: #f8fafc; }
.print-preview-frame-wrap iframe { display: block; width: 100%; height: 100%; min-height: 0; border: 0; background: #fff; }

/* Premium midnight theme --------------------------------------------------- */
html.theme-dark{
  --ui-bg: #0b1018;
  --ui-surface: rgba(18,26,38,.94);
  --ui-surface-solid: #121a26;
  --ui-surface-raised: #182334;
  --ui-border: rgba(148,163,184,.18);
  --ui-border-strong: rgba(203,213,225,.30);
  --ui-text: #f3f6fb;
  --ui-text-secondary: #c2ccda;
  --ui-text-muted: #93a1b4;
  --ui-primary: #fb7185;
  --ui-primary-hover: #fda4af;
  --ui-accent: #fb7185;
  --ui-success: #5dd39e;
  --ui-warning: #f7c66b;
  --ui-danger: #fb7185;
  --ui-shadow: 0 14px 34px rgba(0,0,0,.24);
  --ui-shadow-raised: 0 20px 48px rgba(0,0,0,.34);
}

html.theme-dark body.app-page{
  background:
    radial-gradient(760px 380px at 0% -8%, rgba(185,28,28,.18), transparent 62%),
    radial-gradient(680px 360px at 100% 0%, rgba(71,85,105,.15), transparent 58%),
    var(--ui-bg) !important;
}

html.theme-dark body.app-page .app-sidebar{
  background: linear-gradient(180deg, #101722 0%, #0b1018 100%);
  border-right: 1px solid rgba(148,163,184,.16);
  box-shadow: 12px 0 32px rgba(0,0,0,.18);
}

html.theme-dark body.app-page .app-sidebar-brand,
html.theme-dark body.app-page .app-sidebar-footer{
  border-color: rgba(148,163,184,.16);
}

html.theme-dark body.app-page .app-sidebar-link{
  color: #c6d0de;
}

html.theme-dark body.app-page .app-sidebar-link:hover{
  color: #fff;
  background: rgba(255,255,255,.07);
}

html.theme-dark body.app-page .app-sidebar-link.is-active{
  color: #ffe4e6;
  background: linear-gradient(90deg, rgba(190,24,93,.30), rgba(153,27,27,.15));
  box-shadow: inset 2px 0 0 #fb7185;
}

html.theme-dark body.app-page .app-sidebar-user,
html.theme-dark body.app-page .app-sidebar-logout{
  border-color: rgba(148,163,184,.18);
  background: rgba(255,255,255,.045);
}

html.theme-dark body.app-page .app-sidebar-logout:hover{
  color: #ffe4e6;
  background: rgba(190,24,93,.24);
}

html.theme-dark body.app-page .panel,
html.theme-dark body.app-page .app-card,
html.theme-dark body.app-page .tool-card,
html.theme-dark body.app-page .summary-card,
html.theme-dark body.app-page .detail-card,
html.theme-dark body.app-page .branch-card{
  background: var(--ui-surface) !important;
  border-color: var(--ui-border) !important;
  box-shadow: var(--ui-shadow);
}

html.theme-dark body.app-page .panel-head,
html.theme-dark body.app-page .app-card > .card-header,
html.theme-dark body.app-page .card.app-card > .card-header,
html.theme-dark body.app-page .tool-card-head,
html.theme-dark body.app-page .branch-card-head,
html.theme-dark body.app-page .remote-toolbar,
html.theme-dark body.app-page .detail-card-header{
  background: linear-gradient(90deg, rgba(127,29,29,.28), rgba(24,35,52,.96)) !important;
  border-color: var(--ui-border) !important;
}

html.theme-dark body.app-page .table-wrap,
html.theme-dark body.app-page .ready-table-wrap,
html.theme-dark body.app-page .delivery-list-panel .table-wrap{
  background: #101823;
  border-color: var(--ui-border) !important;
  box-shadow: none;
}

html.theme-dark body.app-page .app-table,
html.theme-dark body.app-page .table{
  --bs-table-bg: transparent;
  --bs-table-color: var(--ui-text);
  --bs-table-striped-color: var(--ui-text);
  --bs-table-hover-color: var(--ui-text);
  --bs-table-border-color: var(--ui-border);
  color: var(--ui-text) !important;
}

html.theme-dark body.app-page .app-table thead th,
html.theme-dark body.app-page .table thead th{
  color: #dce5f0 !important;
  background: #182334 !important;
  border-color: var(--ui-border) !important;
}

html.theme-dark body.app-page .app-table tbody tr:nth-child(even) > *,
html.theme-dark body.app-page .table tbody tr:nth-child(even) > *{
  background: rgba(255,255,255,.018);
}

html.theme-dark body.app-page .app-table tbody tr:hover > *,
html.theme-dark body.app-page .table tbody tr:hover > *{
  background: rgba(251,113,133,.09) !important;
}

html.theme-dark body.app-page .app-input,
html.theme-dark body.app-page .app-select,
html.theme-dark body.app-page .app-textarea,
html.theme-dark body.app-page .form-control,
html.theme-dark body.app-page .form-select{
  color: var(--ui-text) !important;
  background: #101823 !important;
  border-color: rgba(148,163,184,.28) !important;
}

html.theme-dark body.app-page .form-control:focus,
html.theme-dark body.app-page .form-select:focus,
html.theme-dark body.app-page .app-input:focus,
html.theme-dark body.app-page .app-select:focus,
html.theme-dark body.app-page .app-textarea:focus{
  border-color: #fb7185 !important;
  box-shadow: 0 0 0 3px rgba(251,113,133,.18) !important;
}

html.theme-dark body.app-page select option{
  color: #f3f6fb;
  background: #182334;
}

html.theme-dark body.app-page .modal-content,
html.theme-dark body.app-page .dropdown-menu,
html.theme-dark body.app-page .popover{
  background: #182334 !important;
  border-color: var(--ui-border-strong) !important;
  box-shadow: var(--ui-shadow-raised);
}

html.theme-dark body.app-page .modal-header,
html.theme-dark body.app-page .modal-footer{
  background: rgba(11,16,24,.38);
  border-color: var(--ui-border) !important;
}

html.theme-dark body.app-page .btn-primary,
html.theme-dark body.app-page .app-btn-primary{
  background: linear-gradient(135deg, #be123c, #e11d48) !important;
  border-color: #fb7185 !important;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(190,24,93,.22) !important;
}

html.theme-dark body.app-page .btn-primary:hover,
html.theme-dark body.app-page .app-btn-primary:hover{
  background: linear-gradient(135deg, #e11d48, #fb7185) !important;
}

/* Delivery status: red means sent, green means returned. */
body.app-page .delivery-status-select.is-sent{
  border-color: rgba(220,38,38,.72) !important;
  background-color: rgba(254,226,226,.94) !important;
  color: #991b1b !important;
}

body.app-page .delivery-status-select.is-returned{
  border-color: rgba(22,163,74,.72) !important;
  background-color: rgba(220,252,231,.94) !important;
  color: #166534 !important;
}

html.theme-dark body.app-page .delivery-status-select.is-sent{
  border-color: rgba(251,113,133,.80) !important;
  background-color: rgba(190,24,93,.25) !important;
  color: #ffe4e6 !important;
}

html.theme-dark body.app-page .delivery-status-select.is-returned{
  border-color: rgba(74,222,128,.78) !important;
  background-color: rgba(21,128,61,.28) !important;
  color: #dcfce7 !important;
}

/* Equipment add flow ------------------------------------------------------ */
.equipment-card-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.35rem 1.5rem;
}

.equipment-card-heading{
  display: flex;
  align-items: center;
  gap: .9rem;
}

.equipment-card-icon{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(145deg, #075985, #0284c7);
  box-shadow: 0 10px 22px rgba(2,132,199,.22);
  font-size: 1.35rem;
}

.equipment-card-kicker,
.modal-kicker{
  color: var(--app-primary);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
}

.equipment-card-heading h4{
  color: var(--app-text);
  letter-spacing: -.02em;
}

.equipment-card-heading p,
.modal-subtitle{
  color: var(--app-muted);
  font-size: .86rem;
}

.equipment-card-actions{
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .6rem;
}

.equipment-add-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 42px;
  padding: .6rem .9rem;
  white-space: nowrap;
}

.equipment-toolbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1.5rem;
  border-top: 1px solid rgba(148,163,184,.12);
  border-bottom: 1px solid rgba(148,163,184,.12);
  background: rgba(248,250,252,.62);
}

.equipment-result-label{
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--app-muted);
  font-size: .88rem;
  font-weight: 600;
}

.equipment-result-label i{ color: var(--app-primary); }

.equipment-search-wrap{
  position: relative;
  margin-left: auto;
  width: min(100%, 320px);
}

.equipment-search-wrap > i{
  position: absolute;
  top: 50%;
  left: .85rem;
  z-index: 2;
  color: var(--app-muted);
  transform: translateY(-50%);
}

.equipment-search-wrap .app-input{ padding-left: 2.35rem; }

.equipment-form-header{
  padding: 1.45rem 1.5rem 1.1rem;
}

.equipment-form-dialog{
  max-width: 460px;
}

#equipmentModal .modal-body{
  overflow: visible;
}

#equipmentModal .modal-content{
  overflow: visible;
}

#equipmentModal .delivery-combobox-menu{
  max-height: 190px;
}

#equipmentModal .equipment-type-picker.is-open{
  margin-bottom: .75rem;
}

#equipmentModal .equipment-type-picker.is-open .delivery-combobox-menu{
  position: static;
  display: block;
  max-height: 180px;
  margin-top: .45rem;
  box-shadow: none;
  border-color: rgba(185,28,28,.18);
}

@media (max-width: 767.98px){
  .equipment-card-header,
  .equipment-toolbar{ align-items: stretch; flex-direction: column; }
  .equipment-card-actions{ justify-content: stretch; }
  .equipment-add-btn{ flex: 1 1 0; }
  .equipment-search-wrap{ width: 100%; }
}

html.theme-dark .equipment-card-heading h4{ color: #f8fafc; }

html.theme-dark .equipment-toolbar{ background: rgba(10,16,32,.46); }

/* Keep the equipment card aligned with the red app-page theme. */
body.app-page .equipment-card{
  border-color: rgba(185,28,28,.12);
  box-shadow: 0 14px 34px rgba(127,29,29,.08);
}

body.app-page .equipment-card > .equipment-card-header{
  background:
    linear-gradient(90deg, rgba(185,28,28,.10), rgba(220,38,38,.08), rgba(251,113,133,.06)),
    rgba(255,255,255,.88) !important;
  border-color: rgba(185,28,28,.12) !important;
}

body.app-page .equipment-card-icon{
  background: linear-gradient(145deg, #991b1b, #dc2626, #fb7185);
  box-shadow: 0 10px 22px rgba(185,28,28,.22);
}

body.app-page .equipment-card-kicker,
body.app-page .modal-kicker,
body.app-page .equipment-result-label i{
  color: #b91c1c;
}

body.app-page .equipment-toolbar{
  background: rgba(255,247,247,.72);
  border-color: rgba(185,28,28,.12);
}

html.theme-dark body.app-page .equipment-card > .equipment-card-header{
  background:
    linear-gradient(90deg, rgba(127,29,29,.28), rgba(190,24,93,.22), rgba(225,29,72,.16)),
    rgba(8,13,26,.84) !important;
}

html.theme-dark body.app-page .equipment-toolbar{ background: rgba(45,10,18,.42); }

/* Equipment hero is intentionally white-on-red, matching the other app pages. */
body.app-page .equipment-page-wrap > .page-hero,
body.app-page .equipment-page-wrap > .page-hero h1,
body.app-page .equipment-page-wrap > .page-hero h2,
body.app-page .equipment-page-wrap > .page-hero h3,
body.app-page .equipment-page-wrap > .page-hero h4,
body.app-page .equipment-page-wrap > .page-hero p,
body.app-page .equipment-page-wrap > .page-hero .dashboard-eyebrow,
body.app-page .equipment-page-wrap > .page-hero .soft-badge{
  color: #fff !important;
}

body.app-page .equipment-page-wrap > .page-hero p{
  opacity: .92;
}

body.app-page .equipment-page-wrap > .page-hero .soft-badge{
  border-color: rgba(255,255,255,.30) !important;
  background: rgba(255,255,255,.12) !important;
}

/* Sidebar rail sizing (2026-09-11) ----------------------------------------
   Matches the ITSM rail proportions — 64px collapsed, 256px on hover — and
   nothing else. Colours, radii, icons and the footer keep their existing look.
   Scoped to the desktop breakpoint so the ≤1180px top bar is untouched. */
@media (min-width: 1181px){
  body.app-page.app-with-sidebar{ padding-left: 256px; }
  body.app-page.app-sidebar-collapsed.app-with-sidebar{ padding-left: 64px; }

  body.app-page .app-sidebar{ width: 256px; }

  /* 64px rail minus the 8px side padding leaves exactly 48px for a row. */
  body.app-page.app-sidebar-collapsed .app-sidebar{
    width: 64px;
    padding: 10px 8px;
  }

  body.app-page.app-sidebar-collapsed .app-sidebar-link,
  body.app-page.app-sidebar-collapsed .app-sidebar-user,
  body.app-page.app-sidebar-collapsed .app-sidebar-actions{
    width: 48px;
  }

  body.app-page.app-sidebar-collapsed .app-sidebar-brand-main{
    width: 48px;
    height: 48px;
  }

  body.app-page.app-sidebar-collapsed .app-sidebar-logout{
    width: 48px !important;
    min-width: 48px !important;
  }

  /* The theme switch has no styling of its own, so its three labelled buttons sit
     at their natural width and were already spilling past the old 74px rail — at
     64px they would be cut mid-word. Collapse their labels the same way the menu
     rows collapse theirs; the expanded sidebar is left exactly as it was. */
  body.app-page.app-sidebar-collapsed .app-theme-switch{
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 48px;
  }

  body.app-page.app-sidebar-collapsed .app-theme-switch-btn{
    width: 48px;
    overflow: hidden;
  }

  body.app-page.app-sidebar-collapsed .app-theme-switch-btn span{ display: none; }
}

/* Sidebar expand/collapse timing ------------------------------------------
   Matched to the ITSM rail, whose <aside> carries
   `transition: .3s cubic-bezier(.4, 0, .2, 1)` on every animated property.

   This sidebar ran 350ms for the width but 250ms for the label opacity, so the
   text finished fading 100ms before the panel stopped moving and the two reads
   as two separate movements. One duration for everything fixes that.

   The labels also slid in from translateX(-8px); ITSM's simply occupy their
   place as the panel widens, so the offset is dropped and only max-width and
   opacity animate. */
@media (min-width: 1181px){
  body.app-page.app-with-sidebar{
    transition: padding-left 300ms cubic-bezier(.4, 0, .2, 1);
  }

  /* NOTE: `.app-sidebar.is-ready` sets its own `transition: opacity/transform`,
     which outranked the plain `.app-sidebar` rule and dropped `width` from the
     list entirely — so the panel was snapping open with no animation at all.
     That is the real gap against ITSM. Width is restored here, and the entrance
     fade from is-ready is carried along so it still fades in on first paint. */
  body.app-page .app-sidebar,
  body.app-page .app-sidebar.is-ready{
    transition:
      width 300ms cubic-bezier(.4, 0, .2, 1),
      padding 300ms cubic-bezier(.4, 0, .2, 1),
      opacity .18s ease,
      transform .18s ease;
  }

  body.app-page .app-sidebar-brand-text,
  body.app-page .app-sidebar-link span,
  body.app-page .app-sidebar-user span,
  body.app-page.app-sidebar-collapsed .app-sidebar-brand-text,
  body.app-page.app-sidebar-collapsed .app-sidebar-link span,
  body.app-page.app-sidebar-collapsed .app-sidebar-user span{
    transform: none;
    transition:
      max-width 300ms cubic-bezier(.4, 0, .2, 1),
      opacity 300ms cubic-bezier(.4, 0, .2, 1);
  }
}
