.page-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #eee;
  font-size: 12px;
  cursor: pointer;
}

.page-link-btn.active-page {
  background: var(--primary);
  color: #fff;
  font-weight: bold;
}

/* ── Validation styles ── */
.field-input.is-error,
.select2-container.is-error .select2-selection {
  border-color: #c0392b !important;
  box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.12) !important;
}

.field-error {
  display: none;
  align-items: center;
  gap: 4px;
  /* margin-top: 4px; */
  font-size: 10.5px;
  color: #c0392b;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.field-error.show {
  display: flex;
}

.field-error i {
  font-size: 9px;
  flex-shrink: 0;
}

/* Green border when valid */
.field-input.is-valid {
  border-color: #1a7a3a !important;
  box-shadow: 0 0 0 2px rgba(26, 122, 58, 0.1) !important;
}

/* Password strength bar */
.pw-strength-wrap {
  margin-top: 5px;
  display: none;
}

.pw-strength-wrap.show {
  display: block;
}

.pw-strength-bar {
  height: 3px;
  border-radius: 4px;
  background: #ecddd0;
  overflow: hidden;
}

.pw-strength-fill {
  height: 100%;
  border-radius: 4px;
  transition:
    width 0.25s,
    background 0.25s;
  width: 0%;
}

.pw-strength-label {
  font-size: 9.5px;
  margin-top: 3px;
  font-weight: 600;
}
/* .tbl-fit {
  width: 1%;
  white-space: nowrap;
} */

.tbl-fill {
  width: 100%;
}

.page-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #eee;
  font-size: 12px;
  cursor: pointer;
}

.page-link-btn.active-page {
  background: var(--primary);
  color: #fff;
  font-weight: bold;
}

/* ACTION BUTTONS (Edit/Delete) - Normalized for <a> and <button> */
.btn-act.btn-edit,
.btn-act.btn-del,
.btn-act.btn-view,
.btn-act.btn-cancel {
  width: 24px !important;
  height: 24px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  border-radius: 7px !important;
  border: 1.5px solid !important;
  transition: all 0.2s ease-in-out !important;
  cursor: pointer !important;
  text-decoration: none !important;
}

.btn-act:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12) !important;
}

.btn-act:active {
  transform: translateY(0) !important;
}

/* Edit Look (Blue) */
.btn-act.btn-edit {
  border-color: rgba(52, 152, 219, 0.3) !important;
  background: rgba(52, 152, 219, 0.05) !important;
  color: #2980b9 !important;
}
.btn-act.btn-edit:hover {
  border-color: #3498db !important;
  background: rgba(52, 152, 219, 0.12) !important;
}

/* Delete Look (Red) */
.btn-act.btn-del {
  border-color: rgba(231, 76, 60, 0.3) !important;
  background: rgba(231, 76, 60, 0.05) !important;
  color: #e74c3c !important;
}
.btn-act.btn-del:hover {
  border-color: #e74c3c !important;
  background: rgba(231, 76, 60, 0.12) !important;
}

/* View Look (Green) */
.btn-act.btn-view {
  border-color: rgba(39, 174, 96, 0.3) !important;
  background: rgba(39, 174, 96, 0.05) !important;
  color: #27ae60 !important;
}
.btn-act.btn-view:hover {
  border-color: #27ae60 !important;
  background: rgba(39, 174, 96, 0.12) !important;
}

/* Cancel Look (Orange) */
.btn-act.btn-cancel {
  border-color: rgba(230, 126, 34, 0.3) !important;
  background: rgba(230, 126, 34, 0.05) !important;
  color: #e67e22 !important;
}
.btn-act.btn-cancel:hover {
  border-color: #e67e22 !important;
  background: rgba(230, 126, 34, 0.12) !important;
}

/* Action Tooltips (if needed) */
.btn-act[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  margin-bottom: 4px;
  z-index: 999;
}

.tab-btn {
  padding: 5px 15px !important;
}

.req {
  color: #dc2626;
}
/* doer create + edit page custom css start */
.pw-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #888;
}
.pw-toggle:hover {
  color: #333;
}
.pw-note {
  font-size: 11px;
  color: #888;
  margin-top: 4px;
}

/* Fix bootstrap-select styling - remove outer box, match regular input */
.field-wrap .bootstrap-select {
  width: 100% !important;
  border: none !important;
}

.field-wrap .bootstrap-select > .dropdown-toggle {
  height: 33px !important;
  padding: 6px 30px 6px 10px !important;
  font-size: 13px !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 7px !important;
  background: #ffffff !important;
  color: #333 !important;
  box-shadow: none !important;
  outline: none !important;
}

.field-wrap .bootstrap-select > .dropdown-toggle:before {
  display: none !important;
}

.field-wrap .bootstrap-select > .dropdown-toggle:focus,
.field-wrap .bootstrap-select.show > .dropdown-toggle {
  background-color: #ffffff !important;
  border-color: #8e1d1d !important;
  box-shadow: none !important;
  outline: none !important;
}

/* Remove filter box from dropdown */
.field-wrap .bootstrap-select .bs-actionsbox,
.field-wrap .bootstrap-select .bs-searchbox {
  background: #fff !important;
}
.field-wrap .bootstrap-select .bs-searchbox input {
  height: 30px !important;
  font-size: 12px !important;
  border: 1px solid #ddd !important;
  border-radius: 4px !important;
  background: #fff !important;
}

.field-wrap .bootstrap-select .dropdown-menu {
  font-size: 13px !important;
  border: 1px solid #ddd !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}
.field-wrap .bootstrap-select > .dropdown-toggle.bs-placeholder {
  color: #bbb !important;
}
/* doer create + edit page custom css end */

/* ORDER PAGE CUSTOM STYLE START */
.field-wrap .bootstrap-select {
  width: 100% !important;
}
.field-wrap .bootstrap-select > .dropdown-toggle:before {
  display: none !important;
}
.field-wrap .bootstrap-select > .dropdown-toggle:focus,
.field-wrap .bootstrap-select.show > .dropdown-toggle {
  border-color: var(--primary) !important;
  background: #fff !important;
  box-shadow: none !important;
  outline: none !important;
}

/* Desktop / mobile split */
@media (min-width: 769px) {
  #itemsContainer,
  #mobileAddBtn {
    display: none !important;
  }

  #desktopItemTable {
    display: block !important;
  }
}

@media (max-width: 768px) {
  #desktopItemTable {
    display: none !important;
  }

  #itemsContainer,
  #mobileAddBtn {
    display: flex !important;
  }

  #itemsContainer {
    flex-direction: column;
    gap: 8px;
  }

  .content {
    padding-bottom: 70px !important;
  }
}

#desktopScrollWrap {
  max-height: calc(100vh - 480px);
  min-height: 130px;
  overflow-y: auto;
  overflow-x: auto;
}

.sys-tbl {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
}

/* .sys-tbl thead {
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  padding: 8px 10px;
  white-space: nowrap;
  position: sticky;
  top: 0;
} */
#desktopScrollWrap .sys-tbl thead {
  background: var(--primary);
  color: #fff;
  padding: 8px 10px;
  position: sticky;
  top: 0;
  z-index: 99;
}
.sys-tbl tbody tr:nth-child(even) td {
  background: #fafafa;
}

.sys-tbl tbody td {
  padding: 1px 3px !important;
}

.cell-input {
  width: 100%;
  border: 1.5px solid var(--border);
    border-radius: 4px !important;
    padding: 3px 4px;
  font-size: 12px;
  background: var(--bg);
  color: var(--text);
  transition: border 0.2s;
}

.cell-input:focus {
  outline: none;
  border-color: var(--primary);
}

.cell-input.is-error {
  border-color: #dc2626;
  box-shadow: inset 0 0 0 1px #dc2626;
}

.tbl-order-no {
  display: inline-block;
  font-size: 11px;
  color: var(--gray-lt);
  background: var(--border);
  border-radius: 4px;
  padding: 2px;
  font-weight: 600;
  min-width: 70px;
  text-align: center;
  pointer-events: none;
}

.btn-new {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
}

.btn-new:hover {
  opacity: 0.88;
}

.btn-del {
  background: none;
  border: none;
  cursor: pointer;
  color: #c0392b;
  padding: 3px 5px;
  transition: 0.15s;
}

.btn-del:hover {
  background: #fef2f2;
  border-radius: 5px;
}

.img-cell-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.img-preview-btn {
  gap: 3px;
  padding: 3px 7px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
}

.img-upload-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #f0f4ff;
  border: 1.5px dashed #93a8e8 !important;
  color: var(--primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-file-input {
  display: none !important;
}

.mob-img-zone {
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.miz-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
}

.miz-placeholder {
  font-size: 12px;
  color: var(--gray-lt);
  display: flex;
  align-items: center;
}

.upload-spin {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.cell-select-wrap .bootstrap-select {
  width: 100% !important;
}

.cell-select-wrap .bootstrap-select > .dropdown-toggle {
  height: 29px !important;
  padding: 3px 26px 3px 8px !important;
  font-size: 12px !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 6px !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

.cell-select-wrap .bootstrap-select > .dropdown-toggle:focus,
.cell-select-wrap .bootstrap-select.show > .dropdown-toggle {
  border-color: var(--primary) !important;
  background: #fff !important;
  box-shadow: none !important;
}

.cell-select-wrap .bootstrap-select > .dropdown-toggle:before {
  display: none !important;
}

.cell-select-wrap .bootstrap-select.is-error > .dropdown-toggle {
  border-color: #dc2626 !important;
}

.cell-select-wrap .bs-searchbox {
  padding: 5px 7px !important;
  background: #fff !important;
}

.cell-select-wrap .bs-searchbox input {
  height: 28px !important;
  font-size: 12px !important;
  border: 1px solid #ddd !important;
  border-radius: 4px !important;
}

.cell-select-wrap .dropdown-menu {
  font-size: 12px !important;
  border: 1px solid #ddd !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
  min-width: 180px !important;
}

.cell-select-wrap .dropdown-menu li a {
  padding: 6px 10px !important;
}

body > .bootstrap-select.open .dropdown-menu,
body > .open .dropdown-menu {
  z-index: 99999 !important;
  min-width: 180px !important;
  font-size: 12px !important;
  border: 1px solid #ddd !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14) !important;
  border-radius: 7px !important;
}

.section-sep {
  margin: 12px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--gray-lt);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.section-sep::before,
.section-sep::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border);
}

.party-found-badge {
  display: none;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #16a34a;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  border-radius: 20px;
  padding: 2px 10px;
  margin-top: 4px;
}

.party-found-badge.show {
  display: inline-flex;
}

.party-not-found-badge {
  display: none;
  font-size: 11px;
  color: #dc2626;
  margin-top: 4px;
}

.party-not-found-badge.show {
  display: block;
}

.party-loading-badge {
  display: none;
  font-size: 11px;
  color: var(--gray-lt);
  margin-top: 4px;
}

.party-loading-badge.show {
  display: block;
}

/* ORDER PAGE CUSTOM STYLE END */

/* STATUS BADGE CUSTOM VARIANTS */
.status-badge.cancelled {
  background: rgba(243, 156, 18, 0.1);
  color: #e67e22;
}
.status-badge.cancelled::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #f39c12;
}

/* ── TABLE HEIGHT MANAGEMENT (FMS STYLE) ── */
.tbl-scroll-managed {
  height: auto !important;
  /* max-height: calc(100vh - 280px); */
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dk) transparent;
}

.tbl-scroll-managed::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.tbl-scroll-managed::-webkit-scrollbar-thumb {
  background: var(--gold-dk);
  border-radius: 10px;
}

/* ── PERMISSION GRID STYLES (PREMIUM NEXT-LEVEL) ── */
.perm-table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  width: max-content !important;
  min-width: 100% !important;
  /* border: 1px solid var(--gold-lt); */
  background: #fff;
}

/* Header Cells */
.perm-table thead tr th {
  position: sticky !important;
  top: 0 !important;
  z-index: 10 !important; /* Base z-index for headers */
  font-size: 11px !important;
  padding: 5px !important;
  /* border-bottom: 2px solid var(--gold-lt) !important; */
  /* border-right: 1px solid var(--gold-lt) !important; */
  background: #fff;
  white-space: nowrap;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0 !important;
}

.perm-table thead tr.group-row th {
  top: 0 !important;
  z-index: 12 !important; /* Slightly higher for group row */
}

/* Sticky First Column (Doer) - MUST BE ABOVE HEADERS */
.perm-table .th-doer,
.perm-table .td-doer {
  text-align: center !important;
}

/* The intersection (Top Left Doer Header) */
.perm-table thead th.th-doer {
  z-index: 1100 !important; /* Highest possible to stay above both axes */
  background: #fdf5ea !important;
}

/* .perm-table .tbl-fit {
  width: 1% !important;
  white-space: nowrap !important;
  text-align: center !important;
} */

.perm-table tbody tr:nth-child(even) td:not(.td-doer) {
  background: #fcfcfc;
}
.perm-table thead {
  position: sticky;
  top: 0;
  z-index: 45;
}
.perm-table tbody tr:hover td:not(.td-doer) {
  background: #faf5eb;
}

.perm-table tbody tr:hover .td-doer {
  background: #f9efe1 !important;
}

/* Checkbox - Refined Minimal UI */
.perm-cb {
  appearance: none;
  width: 17px;
  height: 17px;
  border: 1.2px solid #d4b483; /* Lighter, thinner gold border */
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  background: #fff;
  display: inline-block;
  vertical-align: middle;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); /* Slight depth */
}

.perm-cb:checked {
  background: var(--primary);
  box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.3);
  transform: scale(1.05); /* Pop effect when checked */
}

.perm-cb:checked::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.perm-cb:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(188, 154, 107, 0.12);
  transform: scale(1.08);
}

.perm-cb:active {
  transform: scale(0.92);
}

/* ── GROUP DIVIDERS ── */
/* .th-divider,
.col-div,
.td-div {
  border-left: 1px solid var(--gold-lt) !important;
  border-top: 1px solid var(--gold-lt) !important;
} */

/* ── HIDE NUMBER INPUT SPINNERS (GLOBAL) ── */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}
input[type="number"] {
  -moz-appearance: textfield !important;
  appearance: textfield !important;
}

/* Floating Tooltip styling */
.items-cell {
  cursor: help;
  color: #1e293b;
  transition: color 0.15s;
}

.items-cell:hover {
  color: #8e1d1d;
}

#floating-items-tooltip {
  position: fixed;
  z-index: 100000;
  background: #1e293b;
  color: #fff;
  padding: 12px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  width: 240px;
  pointer-events: none;
  display: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.ict-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 6px;
  margin-bottom: 6px;
}

.ict-order-no {
  color: #38bdf8;
  font-weight: 800;
}

.ict-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  padding: 4px 0;
}

.ict-num {
  color: #64748b;
  font-weight: 600;
  width: 16px;
}

.ict-name {
  flex: 1;
  font-weight: 500;
}

.ict-qty {
  color: #38bdf8;
  font-weight: 700;
  font-size: 0.7rem;
}
/* Floating Tooltip end */

/* ── STANDARDIZED UI COMPONENTS ── */
.truncate-cell { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.img-thumb { width: 25px; height: 25px; border-radius: 6px; object-fit: cover; cursor: pointer; border: 1px solid #ddd; transition: transform 0.2s; }
.img-thumb:hover { transform: scale(1.1); }
.items-cell { cursor: help; color: #1e293b; transition: color 0.15s; }
.items-cell:hover { color: var(--primary-dark); }
.img-count-badge { position: absolute; bottom: -2px; right: -2px; background: var(--primary); color: #fff; font-size: 9px; padding: 1px 4px; border-radius: 4px; line-height: 1; }
.id-accent { color: #8e1d1d !important; font-weight: bold; }

/* Table Header Border Fix */
.sys-tbl thead tr.col-header th { border-bottom: 1px solid #e2e8f0 !important; }

/* CTA Button (Standardized) */
.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 6px;
    background: #8e1d1d;
    color: #fff !important;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none !important;
    transition: all 0.2s;
    box-shadow: 0 3px 12px rgba(142, 29, 29, 0.2);
    cursor: pointer;
    border: none;
}
.cta-button:hover {
    background: #7a1919;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(142, 29, 29, 0.3);
}
.cta-button:active { transform: translateY(0); }

/* Header Search Styles */
.header-search-wrap { position: relative; width: 250px; }
.header-search-input {
    width: 100%;
    height: 30px !important;
    padding: 5px 10px 5px 30px !important;
    font-size: 0.75rem !important;
    border: 1px solid var(--border) !important;
    border-radius: 50px !important;
    background: #f8fafc !important;
    transition: all 0.2s;
}
.header-search-input:focus {
    background: #fff !important;
    border-color: #8e1d1d !important;
    outline: none !important;
    box-shadow: none !important;
}
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 11px; color: #94a3b8; z-index: 5; }

/* ── SCROLL MANAGED TABLE SYSTEM ── */
.tbl-scroll-wrap {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Sticky Header Logic */
.tbl-scroll-managed .sys-tbl thead th {
    position: sticky !important;
    top: 0 !important;
    background: #f5ede0 !important;
    color: #8e1d1d !important;
    z-index: 20 !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: inset 0 -1px 0 #e2e8f0;
}

/* ── FULL HEIGHT FLEX-TABLE SYSTEM ── */
.full-height-panel {
    height: calc(100vh - 110px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.master-card-flex {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 0;
    padding-bottom: 5px;
}

.tbl-card-header-fixed {
    flex-shrink: 0;
}

.tbl-body-flex {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tbl-footer-fixed {
    flex-shrink: 0;

}

.form-body{
  padding: 6px !important;
}
