/* ===========================
   Guard Watch – Light Theme
   =========================== */

/* ---------- Design tokens ---------- */
:root{
  --gw-primary:#2563eb;
  --gw-primary-600:#1d4ed8;

  --gw-bg:#f6f8fb;
  --gw-surface:#ffffff;
  --gw-text:#111827;
  --gw-muted:#6b7280;

  --gw-accent:#22c55e;
  --gw-danger:#ef4444;
  --gw-warning:#f59e0b;
  --gw-warning-600:#d97706;

  --gw-border:rgba(17,24,39,.08);
  --gw-brand-bg:#f3f4f6;
  --gw-brand-divider:rgba(17,24,39,.06);

  --gw-nav-hover:rgba(37,99,235,.09);
  --gw-nav-active:rgba(37,99,235,.14);

  --gw-row-hover:  var(--gw-nav-hover);
  --gw-row-active: var(--gw-nav-active);

  --gw-focus:rgba(37,99,235,.30);

  --gw-info:#0ea5e9;
  --gw-info-600:#0284c7;

  --sb-base:14px;
  --sb-step:16px;
}

/* ---------- Base ---------- */
html,body{background:var(--gw-bg);color:var(--gw-text);}
.brand-image{background:transparent!important;box-shadow:none!important;}

/* ---------- Top navbar/header ---------- */
.navbar,.main-header,header,.topbar{
  background:#fff!important;
  border-bottom:1px solid var(--gw-border)!important;
  box-shadow:0 1px 1px rgba(0,0,0,.03);
}
.navbar a,.navbar-brand,.navbar-nav>li>a{color:#334155!important;}

/* ---------- Sidebar shell ---------- */
.sidebar,.main-sidebar,.sidebar-menu,.sidebar .menu{
  background:#fff!important;color:#334155!important;border-right:1px solid var(--gw-border)!important;
}

/* Sidebar brand strip */
.main-sidebar .brand-container{
  background:var(--gw-brand-bg);
  min-height:56px;display:flex;align-items:center;
  padding:8px 12px;position:relative;border-bottom:0!important;box-shadow:none!important;
}
.main-sidebar .brand-link,.main-sidebar .brand-link:hover,.main-sidebar .brand-link:focus{border-bottom:0!important;box-shadow:none!important;}
.main-sidebar .brand-image{width:36px;height:36px;-o-object-fit:contain;object-fit:contain;border-radius:8px;}
.main-sidebar .brand-text{color:#0f172a;font-weight:600;letter-spacing:.2px;}
.main-sidebar .brand-container::after{content:"";position:absolute;left:0;right:0;bottom:0;height:1px;background:var(--gw-brand-divider);pointer-events:none;}
.main-sidebar .brand-container .pushmenu i{color:#1f2937;opacity:.7;}

/* ---------- Sidebar navigation ---------- */
.nav-sidebar .nav-link{color:#334155!important;transition:background-color .12s ease,color .12s ease;}
.nav-sidebar .nav-link:hover{background:var(--gw-nav-hover)!important;color:#0f172a!important;}
.nav-sidebar .nav-link:focus-visible{outline:2px solid var(--gw-focus);outline-offset:2px;}
.nav-sidebar .nav-link .nav-icon{transition:color .12s ease;}
.nav-sidebar .nav-link.active,.nav-sidebar .menu-open>.nav-link,.sidebar .active>a{
  background:var(--gw-nav-active)!important;color:#0f172a!important;box-shadow:inset 3px 0 0 var(--gw-primary);
}
.nav-sidebar .nav-link:hover .nav-icon,.nav-sidebar .nav-link.active .nav-icon,.sidebar .active>a .nav-icon{color:var(--gw-primary)!important;}
.nav-sidebar>.nav-item>.nav-link{padding-left:var(--sb-base);}
.nav-sidebar>.nav-item>.nav-link .nav-icon{width:1.25rem;margin-right:.5rem;text-align:center;}
.nav-sidebar .nav-treeview>.nav-item>.nav-link{padding-left:calc(var(--sb-base) + var(--sb-step));}
.nav-sidebar .nav-item>.nav-link>.end{margin-left:auto;}
.nav-sidebar .nav-treeview .nav-link i{opacity:.85;font-size:.95em;}

/* ---------- Content & Cards ---------- */
.content-wrapper{background:var(--gw-bg)!important;}
.card,.panel,.box{
  background:var(--gw-surface)!important;color:var(--gw-text)!important;border:1px solid var(--gw-border)!important;
  border-radius:1rem!important;box-shadow:0 1px 2px rgba(0,0,0,.04),0 8px 24px rgba(0,0,0,.06)!important;
}
.card .card-header,.panel-heading{
  background:linear-gradient(180deg,#f8fafc,#f1f5f9)!important;color:#0f172a!important;border-color:var(--gw-border)!important;
  border-top-left-radius:1rem!important;border-top-right-radius:1rem!important;
}
.card-blank .card-title,.card .card-title,.card-header .card-title,
.panel .panel-heading .panel-title,.panel .panel-title,.box .box-header .box-title{
  float:none!important;display:block!important;margin:0 0 12px 0!important;font-weight:600;line-height:1.2;color:var(--gw-text);
}
.card .card-header{display:flex;align-items:center;gap:.75rem;background:linear-gradient(180deg,#f8fafc,#f1f5f9)!important;border-bottom:1px solid var(--gw-border)!important;}
.card .card-header .card-title{margin:0!important;}
.card .card-header .card-tools{margin-left:auto;}

.card-blank{background:#fff;border:1px solid var(--gw-border);border-radius:12px;padding:16px;}
.minh-280{min-height:220px;}
.minh-180{min-height:180px;}

.chart-area{position:relative;height:260px;margin-top:4px;overflow-x:auto;}
.chart-area canvas{width:100%!important;height:100%!important;display:block;}
.donut-area{position:relative;height:160px;max-width:220px;margin:0 auto;}
.donut-area canvas{width:100%!important;height:100%!important;display:block;}

/* ---------- Forms ---------- */
.form-control,input,select,textarea{
  background:#fff!important;color:var(--gw-text)!important;border:1px solid var(--gw-border)!important;border-radius:.75rem!important;
}
.form-control:focus,input:focus,select:focus,textarea:focus{
  outline:0;border-color:var(--gw-primary)!important;box-shadow:0 0 0 .25rem rgba(37,99,235,.15)!important;
}

/* ---------- Buttons ---------- */
.btn-primary{background:var(--gw-primary)!important;border-color:var(--gw-primary)!important;}
.btn-primary:hover{background:var(--gw-primary-600)!important;border-color:var(--gw-primary-600)!important;}

/* ---------- Page spacing ---------- */
.card{margin-top:1.5rem!important;}
.page-card{margin-top:20px;}

/* =========================================================
   Roles page – modern look (header bar, sticky tables)
   ========================================================= */
.card-header-modern{background:linear-gradient(180deg,#f8fafc,#f1f5f9)!important;border-bottom:1px solid var(--gw-border)!important;padding:.75rem 1rem!important;}
.header-tools{gap:.5rem;}
.header-tools .form-control{height:32px;padding:.25rem .5rem;}
.header-tools .btn{height:32px;}
@media (max-width:576px){
  .header-tools{gap:.35rem;}
  .header-tools .input-group{width:180px!important;}
}

/* Blue “Role Management” bar */
.roles-bar.card-header{
  background:#2196f3!important;color:#fff!important;border-bottom:0!important;
  padding:.9rem 1rem!important;border-top-left-radius:1rem!important;border-top-right-radius:1rem!important;
}
.roles-bar h5{margin:0;font-weight:700;letter-spacing:.2px;color:#fff!important;}
.roles-bar .btn-add{
  background:#fff!important;color:#1f3b69!important;border:0!important;border-radius:.6rem!important;
  padding:.45rem .95rem!important;font-weight:600;
}
.roles-bar .btn-add:hover{filter:brightness(.96);}

/* =======================================================
   Global table styling
   ======================================================= */
.table-standard{
  width:100%;
  border-collapse:separate;border-spacing:0;
  font-size:1rem;
  background-color:#fff;
  border:1px solid var(--gw-border);
  border-radius:.6rem;
  overflow:hidden;
}
.table-standard thead{background-color:var(--gw-brand-bg);}
.table-standard th{font-weight:600;text-align:left;padding:.8rem 1rem;border-bottom:2px solid var(--gw-border);color:var(--gw-text);}
.table-standard td{padding:.75rem 1rem;border-bottom:1px solid var(--gw-border);}
.table-standard tbody tr:last-child td{border-bottom:none;}
.table-standard td:first-child,.table-standard th:first-child{text-align:center;width:60px;}
.table-standard .table-actions{text-align:center;white-space:nowrap;}
.table-standard tbody tr:hover td,.table-striped tbody tr:hover td{background-color:var(--gw-row-hover)!important;transition:background-color .15s ease-in-out;}
.bootstrap-table .table tbody tr.selected td,
.bootstrap-table .table tbody tr.active td,
.table-standard tbody tr.table-active td{background-color:var(--gw-row-active)!important;box-shadow:inset 3px 0 0 var(--gw-primary);}

.table-modern thead th{background:#f8fafc!important;border-bottom:1px solid var(--gw-border)!important;font-weight:600;}
.table-modern tbody tr{background:#fff!important;}
.table-modern tbody tr+tr td{border-top:1px solid var(--gw-border)!important;}
.table-modern tbody tr:hover td{background:var(--gw-row-hover)!important;}
.table-modern td:first-child,.table-modern th:first-child{width:56px;text-align:center;}

/* Bootstrap-Table container & sticky headers (safe defaults) */
.bootstrap-table .fixed-table-container{border:1px solid var(--gw-border)!important;border-radius:12px!important;overflow:hidden;}
.bootstrap-table .fixed-table-toolbar{margin:.5rem 0;}
.bootstrap-table .fixed-table-container .table thead th{position:sticky;top:0;z-index:3;background:#f8fafc!important;}

.fixed-table-container .fixed-table-body table.table tbody tr:hover>th,
.fixed-table-container .fixed-table-body table.table tbody tr:hover>td,
.table.table-hover tbody tr:hover>th,
.table.table-hover tbody tr:hover>td,
.table tbody tr:hover>th,
.table tbody tr:hover>td{background-color:var(--gw-row-hover)!important;}
.fixed-table-container .fixed-table-body table.table tbody tr.selected>th,
.fixed-table-container .fixed-table-body table.table tbody tr.selected>td,
.fixed-table-container .fixed-table-body table.table tbody tr.active>th,
.fixed-table-container .fixed-table-body table.table tbody tr.active>td,
.table tbody tr.table-active>th,
.table tbody tr.table-active>td{background-color:var(--gw-row-active)!important;box-shadow:inset 3px 0 0 var(--gw-primary);}

/* ---------- Ghost/text buttons ---------- */
.btn-ghost{background:transparent!important;border:1px solid var(--gw-border)!important;color:#0f172a!important;border-radius:999px!important;padding:.25rem .6rem!important;line-height:1.1!important;cursor:pointer;margin-right:.25rem;}
.btn-ghost:hover{background:rgba(0,0,0,.03)!important;}
.btn-ghost-danger{background:transparent!important;border:1px solid var(--gw-danger)!important;color:var(--gw-danger)!important;border-radius:999px!important;padding:.35rem .9rem!important;line-height:1.1!important;cursor:pointer;margin-right:.25rem;font-size:.85rem;font-weight:600;}
.btn-ghost-danger:hover{background:rgba(239,68,68,.07)!important;}
.btn-danger,.btn-outline-danger{border-color:var(--gw-danger)!important;}
.btn-outline-danger{color:var(--gw-danger)!important;}
.btn-modify{background:#2563eb!important;color:#fff!important;border:none!important;border-radius:.6rem!important;padding:.35rem .9rem!important;font-weight:600;font-size:.85rem;line-height:1.1;transition:background-color .2s ease;}
.btn-modify:hover{background:#1d4ed8!important;color:#fff!important;}
.btn-reset{background:var(--gw-warning)!important;color:#fff!important;border:none!important;border-radius:.6rem!important;padding:.35rem .9rem!important;font-weight:600;font-size:.85rem;line-height:1.1;transition:background-color .2s ease;}
.btn-reset:hover{background:var(--gw-warning-600)!important;}
.btn-checkpoint{background:var(--gw-accent)!important;color:#fff!important;border:none!important;border-radius:.6rem!important;padding:.35rem .9rem!important;font-weight:600;font-size:.85rem;line-height:1.1;transition:background-color .2s ease, filter .2s ease;}
.btn-checkpoint:hover{background:var(--gw-accent-600, #16a34a)!important;color:#fff!important;;}
.btn-ghost-checkpoint{background:transparent!important;border:1px solid var(--gw-info)!important;color:var(--gw-info)!important;border-radius:999px!important;padding:.35rem .9rem!important;font-weight:600;font-size:.85rem;line-height:1.1;cursor:pointer;}
.btn-ghost-checkpoint:hover{ background:rgba(14,165,233,.08)!important; }
.fixed-table-container .no-records-found{display:none!important;}

/* ==========================
   Organization (zTree) skin
   ========================== */
.org-toolbar{padding:.25rem 0 .5rem;}
.ztree{background:#fff;border:1px solid var(--gw-border);border-radius:12px;padding:8px 10px;max-height:70vh;overflow:auto;}
.ztree li a{display:block;padding:.35rem .5rem;margin:.05rem 0;border-radius:.5rem;color:var(--gw-text);font-size:.95rem;line-height:1.2;}
.ztree li a:hover{background:var(--gw-row-hover);}
.ztree li a.curSelectedNode{background:var(--gw-row-active);box-shadow:inset 3px 0 0 var(--gw-primary);border:0;height:auto;}
.ztree li{line-height:1.25rem;}
.ztree li span.button.switch{margin-right:.25rem;}
.ztree li span.button.roots_open,
.ztree li span.button.roots_close,
.ztree li span.button.center_open,
.ztree li span.button.center_close,
.ztree li span.button.bottom_open,
.ztree li span.button.bottom_close,
.ztree li span.button.noline_open,
.ztree li span.button.noline_close{opacity:.85;}
.button_content{display:none!important;}

/* ===== Option B styles (org list) ===== */
.org-card{border:1px solid var(--gw-border)!important;border-radius:12px!important;overflow:hidden;}
.org-card .card-header{background:linear-gradient(180deg,#f8fafc,#f1f5f9)!important;}
.org-row{border-bottom:1px solid var(--gw-border);}
.org-row:last-child{border-bottom:none;}
.org-row:hover{background:var(--gw-row-hover);cursor:pointer;}
.org-row.selected{background:var(--gw-row-active);box-shadow:inset 3px 0 0 var(--gw-primary);}
.org-row .org-row-inner{display:flex;align-items:center;gap:.5rem;padding:.6rem .75rem;}
.org-row .org-row-inner{--depth:0;}
.org-row .org-main{flex:1;margin-left:calc(var(--depth) * 18px);}
.org-name{font-weight:600;}
.org-id{min-width:48px;text-align:right;}
.twisty{width:14px;height:14px;display:inline-block;border-right:2px solid #666;border-bottom:2px solid #666;transform:rotate(-45deg);opacity:.7;margin-left:2px;}
.twisty.open{transform:rotate(45deg);}
.twisty-empty{border-color:transparent;}
mark{background:#ffe58f;padding:0 2px;border-radius:3px;}
.btn-add{background:var(--gw-accent)!important;color:#fff!important;border:none!important;border-radius:.6rem!important;padding:.35rem .9rem!important;font-weight:600;font-size:.85rem;line-height:1.1;transition:filter .2s ease;}
.btn-add:hover{filter:brightness(.95);}

/* =======================================================
   Organization Tree — toggle + node icons
   ======================================================= */
.org-grid .tt-col-title{display:flex;align-items:center;gap:.5rem;min-width:280px;}
.org-grid .tt-indent{width:calc(var(--depth) * 18px);min-width:0;}
.org-grid .tt-toggle{width:16px;height:16px;line-height:1;display:inline-flex;align-items:center;justify-content:center;border:1px solid #94a3b8;border-radius:3px;background:#fff;font-size:12px;font-weight:700;color:#475569;cursor:pointer;margin-right:6px;}
.org-grid .tt-toggle.collapsed::before{content:"+";color:#2563eb;}
.org-grid .tt-toggle.expanded::before{content:"−";color:#22c55e;}
.org-grid .tt-toggle:hover{background:#f1f5f9;border-color:#64748b;}
.org-grid .tt-toggle.empty{visibility:hidden;}

.tt-node-icon{width:16px;height:16px;min-width:16px;display:inline-flex;align-items:center;justify-content:center;color:#64748b;position:relative;}
.tt-node-icon::before{ font-family: "Font Awesome 5 Free","FontAwesome"; font-style: normal; font-weight: 900; text-decoration: inherit; speak: none; display: inline-block; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-size: 14px; line-height: 1; }
.tt-node-icon.hq::before{content:"\f015";color:#0ea5e9;}
.tt-node-icon.branch::before{content:"\f19c";color:#475569;}
.tt-node-icon.leaf::before{content:"\f192";color:#94a3b8;}
.org-grid tbody tr:hover .tt-node-icon::before{color:#7c8fa3;}
.org-grid tbody tr.table-active .tt-node-icon::before{color:#1d4ed8;}
.org-grid .tt-toggle.expanded + .tt-node-icon.branch::before,
.org-grid .tt-toggle.expanded + .tt-node-icon.hq::before{color:#1d4ed8;}

/* =======================================================
   Kill blue highlight/focus in org grid (only look we keep)
   ======================================================= */
#org-grid, #org-grid *{user-select:none!important;-webkit-user-select:none!important;-moz-user-select:none!important;-ms-user-select:none!important;}
#org-grid ::-moz-selection{background:transparent!important;color:inherit!important;}
#org-grid ::selection,#org-grid ::-moz-selection{background:transparent!important;color:inherit!important;}
#org-grid :is(tr,td,th,div,span,a,button):is(:focus,:focus-visible,:focus-within){outline:none!important;box-shadow:none!important;}
#org-grid *{-webkit-tap-highlight-color:transparent;}
#org-grid *::-moz-focus-inner{border:0!important;}
#org-grid tbody tr.table-active td{background:var(--gw-row-active)!important;box-shadow:none!important;}
#org-grid thead th:focus,#org-grid tbody td:focus,#org-grid td.focus,.table td:focus{outline:none!important;box-shadow:none!important;background-color:inherit!important;border-color:inherit!important;}

/* ===========================
   Role & User modals polish
   =========================== */
#modal-role .modal-dialog,
#modal-user .modal-dialog{max-width:840px;}
#modal-role .modal-content,
#modal-user .modal-content{
  border:1px solid var(--gw-border);border-radius:16px;box-shadow:0 10px 30px rgba(0,0,0,.12);
}
#modal-role .modal-header,
#modal-user .modal-header{
  border-bottom:1px solid var(--gw-border);background:linear-gradient(180deg,#f8fafc,#f1f5f9);
  border-top-left-radius:16px;border-top-right-radius:16px;
}
#modal-role .modal-title,
#modal-user .modal-title{font-weight:700;letter-spacing:.2px;color:#0f172a;}
#modal-role .close,#modal-user .close,
#modal-role .btn-close,#modal-user .btn-close{opacity:.6;text-shadow:none;}
#modal-role .close:hover,#modal-user .close:hover,
#modal-role .btn-close:hover,#modal-user .btn-close:hover{opacity:.9;}

#modal-role .modal-body,#modal-user .modal-body{padding:18px 20px;}
#modal-role .form-group,#modal-user .form-group{margin-bottom:14px;}
#modal-role label,#modal-user label{font-weight:600;color:#111827;}
#modal-role .form-control,#modal-user .form-control{height:38px;border-radius:10px;}

#modal-role .ztree-height,#modal-user .ztree-height{
  max-height:360px;border-radius:10px;border:1px solid var(--gw-border);background:#fff;padding:8px;overflow:auto;
}
#modal-role .modal-footer,#modal-user .modal-footer{
  border-top:1px solid var(--gw-border);background:#fff;border-bottom-left-radius:16px;border-bottom-right-radius:16px;
}
#modal-role .btn-primary,#modal-user .btn-primary{
  background:var(--gw-primary)!important;border-color:var(--gw-primary)!important;border-radius:.6rem!important;font-weight:600;padding:.45rem .95rem;
}
#modal-role .btn-light,#modal-user .btn-light{
  border:1px solid var(--gw-border)!important;border-radius:.6rem!important;font-weight:600;padding:.45rem .95rem;
}

/* Make btn-close look proper in BS4 */
.btn-close{
  box-sizing:content-box;width:1em;height:1em;padding:.25em;color:#000;
  background:transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath stroke='currentColor' stroke-linecap='round' stroke-width='2' d='M2 2l12 12M14 2L2 14'/%3e%3c/svg%3e") center/1em auto no-repeat;
  border:0;border-radius:.25rem;opacity:.6;
}
.btn-close:hover{opacity:.9;}

/* ===== Permission Tree (zTree) — minimal, safe ===== */
#privilege-tree{font-size:14px;}
#privilege-tree li a{
  display:inline-block;padding:2px 6px;border-radius:6px;color:var(--gw-text);background:transparent;transition:background-color .12s ease;
}
#privilege-tree li a:hover{background:var(--gw-row-hover);}
#privilege-tree li a.curSelectedNode{
  background:var(--gw-row-active);border:0;height:18px;line-height:18px;box-shadow:inset 3px 0 0 var(--gw-primary);
}
#privilege-tree li span.button.switch{margin-right:4px;opacity:.9;}
#privilege-tree li span.button.ico_open,
#privilege-tree li span.button.ico_close,
#privilege-tree li span.button.ico_doc{opacity:.9;}
#privilege-tree li span.button.chk{transform:none;margin-right:4px;}
#privilege-tree li ul:before{content:none!important;}

/* ===== Permission Tree – flat look (no inner box, keep +/− & dotted line) ===== */
.ztree.ztree-flat{border:0!important;background:transparent!important;padding:0!important;max-height:none!important;}
.ztree.ztree-flat li{line-height:1.35rem;}
.ztree.ztree-flat li a{display:block;padding:.45rem .55rem;margin:2px 0;border-radius:8px;color:var(--gw-text);}
.ztree.ztree-flat li a:hover{background:var(--gw-row-hover);}
.ztree.ztree-flat li a.curSelectedNode{background:var(--gw-row-active);border:0;box-shadow:inset 3px 0 0 var(--gw-primary);height:auto;}
.ztree.ztree-flat li ul{margin:0 0 0 18px;padding:0;}

/* Toggle: remove square box entirely, keep glyph (for modal + query trees) */
#modal-user .gw-ztree-pro li span.button.switch,
#q-tree-wrap .gw-ztree-pro li span.button.switch{
  background:none!important;
  width:16px;height:16px;margin-right:.35rem;
  border:1px solid #94a3b8;border-radius:3px;position:relative;display:inline-block;vertical-align:middle;
}
#modal-user .gw-ztree-pro li span.button.switch:hover,
#q-tree-wrap .gw-ztree-pro li span.button.switch:hover{background:#f1f5f9;border-color:#64748b;}
#modal-user .gw-ztree-pro li span.button.roots_close::before,
#modal-user .gw-ztree-pro li span.button.center_close::before,
#modal-user .gw-ztree-pro li span.button.bottom_close::before,
#modal-user .gw-ztree-pro li span.button.noline_close::before,
#q-tree-wrap .gw-ztree-pro li span.button.roots_close::before,
#q-tree-wrap .gw-ztree-pro li span.button.center_close::before,
#q-tree-wrap .gw-ztree-pro li span.button.bottom_close::before,
#q-tree-wrap .gw-ztree-pro li span.button.noline_close::before{
  content:"+";position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  font-weight:700;font-size:12px;color:#2563eb;line-height:1;
}
#modal-user .gw-ztree-pro li span.button.roots_open::before,
#modal-user .gw-ztree-pro li span.button.center_open::before,
#modal-user .gw-ztree-pro li span.button.bottom_open::before,
#modal-user .gw-ztree-pro li span.button.noline_open::before,
#q-tree-wrap .gw-ztree-pro li span.button.roots_open::before,
#q-tree-wrap .gw-ztree-pro li span.button.center_open::before,
#q-tree-wrap .gw-ztree-pro li span.button.bottom_open::before,
#q-tree-wrap .gw-ztree-pro li span.button.noline_open::before{
  content:"−";position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  font-weight:700;font-size:12px;color:#22c55e;line-height:1;
}

/* Checkbox spacing (flat tree variant) */
.ztree.ztree-flat li span.button.chk{transform:scale(1.05);margin-right:.35rem;}

/* Folder/file icons subtler */
.ztree.ztree-flat li span.button.ico_open,
.ztree.ztree-flat li span.button.ico_close,
.ztree.ztree-flat li span.button.ico_doc{margin-right:.35rem;opacity:.85;}
.ztree.ztree-flat li span.button.ico_doc{
  background:none!important;width:14px;height:14px;position:relative;
}
.ztree.ztree-flat li span.button.ico_doc::before{content:"•";font-size:14px;line-height:1;color:#94a3b8;}

/* Permission Tree icons (Font Awesome 5 — cube/clipboard) */
#privilege-tree li span.button.ico_open,
#privilege-tree li span.button.ico_close,
#privilege-tree li span.button.ico_doc{
  background:none!important;width:16px;height:16px;margin-right:.45rem;position:relative;display:inline-block;vertical-align:middle;opacity:.95;
}
#privilege-tree li span.button.ico_open::before,
#privilege-tree li span.button.ico_close::before{
  font-family:"Font Awesome 5 Free";font-weight:900;content:"\f1b2";font-size:15px;line-height:1;color:#2563eb;
}
#privilege-tree li span.button.ico_doc::before{
  font-family:"Font Awesome 5 Free";font-weight:900;content:"\f46d";font-size:14px;line-height:1;color:#475569;
}
#privilege-tree li a:hover ~ span.button.ico_open::before,
#privilege-tree li a:hover ~ span.button.ico_close::before,
#privilege-tree li a:hover ~ span.button.ico_doc::before{opacity:1;}

/* ===========================================
   Bootstrap-Table: pagination size dropdown
   =========================================== */
.bootstrap-table .fixed-table-pagination,
.card .bootstrap-table,
.card .fixed-table-pagination{overflow:visible!important;}
.bootstrap-table .page-list .btn{
  background:#fff!important;border:1px solid var(--gw-border)!important;color: var(--gw-text)!important;
  border-radius:.6rem!important;padding:.25rem .6rem!important;line-height:1.1!important;
}
.bootstrap-table .page-list .btn .caret,
.bootstrap-table .page-list .btn .dropdown-toggle::after{margin-left:.35rem;}
.bootstrap-table .page-list .btn-group.dropup .dropdown-menu{top:auto;bottom:100%;margin-bottom:4px;}
.bootstrap-table .page-list .dropdown-menu{
  z-index:1060;min-width:96px;padding:4px 0;border:1px solid var(--gw-border);border-radius:.6rem;
  box-shadow:0 6px 18px rgba(0,0,0,.08);
}
.bootstrap-table .page-list .dropdown-menu>li>a{display:block;padding:6px 12px;cursor:pointer;}
.bootstrap-table .page-list .dropdown-menu>li>a:hover,
.bootstrap-table .page-list .dropdown-menu>li.active>a{background:var(--gw-row-hover);color:var(--gw-text);}

/* ===========================================
   Accounts table fixes (card grows; no inner scroll)
   =========================================== */
.bootstrap-table .fixed-table-container{overflow:visible!important;}
.bootstrap-table .fixed-table-container .fixed-table-body{max-height:none!important;overflow:visible!important;}

/* Footer text/controls inline helpers (optional) */
.bootstrap-table .fixed-table-pagination .gw-sizebox{
  display:inline-flex;align-items:center;gap:.25rem;margin-left:.5rem;
}
.bootstrap-table .fixed-table-pagination .gw-sizebox input{
  width:70px;height:28px;padding:.15rem .5rem;border:1px solid var(--gw-border);border-radius:.5rem;
}
.bootstrap-table .fixed-table-pagination .gw-sizebox button{
  height:28px;padding:.15rem .6rem;border-radius:.5rem;
}

/* Keep the page-size menu above the table/card */
.bootstrap-table .fixed-table-pagination .page-list .dropdown-menu{z-index:1060;}

/* ===========================================
   Accounts modal (#modal-user) – scoped fixes
   =========================================== */
#modal-user .modal-body{ max-height:70vh; overflow:auto; }
#modal-user .modal-dialog.modal-dialog-scrollable .modal-content{ overflow:visible; }
#modal-user .ztree-height{ max-height:none !important; overflow:visible !important; }
#modal-user .form-control{ height:40px; border-radius:10px; }
#modal-user label{ font-weight:600; color:#111827; }
#modal-user .modal-dialog{ max-width:940px; }

/* Keep toggle/checkbox/text on one line (scoped) */
#modal-user .ztree li a,
#modal-user .ztree.ztree-flat li a,
#q-tree-wrap .ztree li a,
#q-tree-wrap .ztree.ztree-flat li a{ display:inline-flex !important; align-items:center; }
#modal-user .ztree li span.button,
#q-tree-wrap .ztree li span.button{ vertical-align:middle; }
#modal-user .ztree li span.button.switch,
#q-tree-wrap .ztree li span.button.switch{ margin-right:.35rem; }
#modal-user .ztree li ul.line,
#q-tree-wrap .ztree li ul.line{ background:none !important; }

/* ===========================================
   Users modal + filter: zTree “PRO” skin only
   =========================================== */
#modal-user .gw-ztree-pro,
#q-tree-wrap .gw-ztree-pro{ border:1px solid var(--gw-border); border-radius:12px; background:#fff; padding:8px 10px; }
#modal-user .gw-ztree-pro li,
#q-tree-wrap .gw-ztree-pro li{ line-height:1.45rem; }
#modal-user .gw-ztree-pro li a,
#q-tree-wrap .gw-ztree-pro li a{
  display:inline-flex; align-items:center; gap:.25rem;
  padding:.42rem .52rem; margin:2px 0; border-radius:8px;
  color:var(--gw-text); border:0; height:auto;
}
#modal-user .gw-ztree-pro li a:hover,
#q-tree-wrap .gw-ztree-pro li a:hover{ background:var(--gw-row-hover); }
#modal-user .gw-ztree-pro li a.curSelectedNode,
#q-tree-wrap .gw-ztree-pro li a.curSelectedNode{
  background:var(--gw-row-active); box-shadow:inset 3px 0 0 var(--gw-primary);
  border:0; height:auto;
}

/* radios a touch larger & aligned */
#modal-user .gw-ztree-pro li span.button.chk,
#q-tree-wrap .gw-ztree-pro li span.button.chk{ transform:scale(1.05); margin-right:.40rem; }

/* ===== zTree icons — root=home, branch=cubes, leaf=building ===== */
#modal-user .gw-ztree-pro li span.button.ico_open,
#modal-user .gw-ztree-pro li span.button.ico_close,
#modal-user .gw-ztree-pro li span.button.ico_doc,
#modal-user .gw-ztree-pro li span.button.ico_docu,
#q-tree-wrap .gw-ztree-pro li span.button.ico_open,
#q-tree-wrap .gw-ztree-pro li span.button.ico_close,
#q-tree-wrap .gw-ztree-pro li span.button.ico_doc,
#q-tree-wrap .gw-ztree-pro li span.button.ico_docu{
  background:none!important; width:16px; height:16px; margin-right:.42rem;
  position:relative; opacity:.95;
}
#modal-user .gw-ztree-pro li span.button.ico_open::before,
#modal-user .gw-ztree-pro li span.button.ico_close::before,
#modal-user .gw-ztree-pro li span.button.ico_doc::before,
#modal-user .gw-ztree-pro li span.button.ico_docu::before,
#q-tree-wrap .gw-ztree-pro li span.button.ico_open::before,
#q-tree-wrap .gw-ztree-pro li span.button.ico_close::before,
#q-tree-wrap .gw-ztree-pro li span.button.ico_doc::before,
#q-tree-wrap .gw-ztree-pro li span.button.ico_docu::before{
  font-family:"Font Awesome 5 Free","FontAwesome";
  font-weight:900; line-height:1; display:inline-block;
}
#opt-tree.gw-ztree-pro > li > span.button.ico_open::before,
#opt-tree.gw-ztree-pro > li > span.button.ico_close::before,
#q-tree.gw-ztree-pro   > li > span.button.ico_open::before,
#q-tree.gw-ztree-pro   > li > span.button.ico_close::before{ content:"\f015"; font-size:16px; color:#0ea5e9; }
#modal-user .gw-ztree-pro li:not(.level0) > span.button.ico_open::before,
#modal-user .gw-ztree-pro li:not(.level0) > span.button.ico_close::before,
#q-tree-wrap .gw-ztree-pro li:not(.level0) > span.button.ico_open::before,
#q-tree-wrap .gw-ztree-pro li:not(.level0) > span.button.ico_close::before{ content:"\f1b3"; font-size:15px; color:#475569; }
#modal-user .gw-ztree-pro li span.button.ico_doc::before,
#modal-user .gw-ztree-pro li span.button.ico_docu::before,
#q-tree-wrap .gw-ztree-pro li span.button.ico_doc::before,
#q-tree-wrap .gw-ztree-pro li span.button.ico_docu::before{ content:"\f1ad"; font-size:16px; color:#64748b; }

/* ========= Patch: kill leftover zTree sprites ========= */
#modal-user .gw-ztree-pro li span.button.root_close::before,
#q-tree-wrap .gw-ztree-pro li span.button.root_close::before{
  content:"+";position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  font-weight:700;font-size:12px;color:#2563eb;line-height:1;
}
#modal-user .gw-ztree-pro li span.button.root_open::before,
#q-tree-wrap .gw-ztree-pro li span.button.root_open::before{
  content:"−";position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  font-weight:700;font-size:12px;color:#22c55e;line-height:1;
}
#modal-user .gw-ztree-pro li span.button.switch,
#q-tree-wrap .gw-ztree-pro li span.button.switch{ background:none!important; }
#modal-user .gw-ztree-pro li span.button.roots_docu,
#modal-user .gw-ztree-pro li span.button.center_docu,
#modal-user .gw-ztree-pro li span.button.bottom_docu,
#modal-user .gw-ztree-pro li span.button.root_docu,
#modal-user .gw-ztree-pro li span.button.noline_docu,
#q-tree-wrap .gw-ztree-pro li span.button.roots_docu,
#q-tree-wrap .gw-ztree-pro li span.button.center_docu,
#q-tree-wrap .gw-ztree-pro li span.button.bottom_docu,
#q-tree-wrap .gw-ztree-pro li span.button.root_docu,
#q-tree-wrap .gw-ztree-pro li span.button.noline_docu{
  background:none!important; width:16px;height:16px; margin-right:.35rem;
}
#opt-tree span.button,
#q-tree  span.button{ background-image:none!important; background:none!important; }
#opt-tree span.button[class$="_docu"],
#q-tree  span.button[class$="_docu"]{ background:none!important; }
#opt-tree span.button.root_open,
#opt-tree span.button.root_close,
#q-tree  span.button.root_open,
#q-tree  span.button.root_close{ background:none!important; }
#opt-tree li ul.line,
#q-tree  li ul.line{ background:none!important; }

/* Make orgPicker radios look same as org tree dots */
.org-grid .org-radio { margin-right:.4rem; accent-color:#2563eb; cursor:pointer; }
.org-grid .tt-col-title .tt-toggle { margin-right:.45rem; }
.org-grid .tt-col-title .org-radio { margin-right:.45rem; }

#org-picker { border:0!important; background:#fff!important; border-collapse:collapse!important; }
#org-picker thead { display:none!important; }
#org-picker td { border:0!important; padding:.6rem .75rem!important; }
#org-picker tr + tr td { border-top:0!important; }
#org-picker tbody tr:hover td { background:transparent!important; }

/* --- Filter dropdown using table-tree --- */
#org-filter-wrap{
  display:none; position:absolute; z-index:1051;
  background:#fff; border:1px solid var(--gw-border); border-radius:12px;
  box-shadow:0 10px 30px rgba(0,0,0,.12); padding:6px; min-width:320px;
}
#org-filter-picker { border:0; background:#fff; border-collapse:collapse; }
#org-filter-picker td { border:0; padding:.5rem .6rem; }
#org-filter-picker tr + tr td { border-top:0; }
#org-filter-picker .org-check { margin-right:.45rem; cursor:pointer; }

/* ===== Reset Password modal – polished look ===== */
#div-resetPwd .modal-dialog.modal-resetpw{ max-width:540px; }
#div-resetPwd .modal-content{
  border:1px solid var(--gw-border);
  border-radius:16px;
  box-shadow:0 14px 40px rgba(0,0,0,.16);
}
#div-resetPwd .modal-header{
  position:relative;
  background:linear-gradient(180deg,#f8fafc,#f1f5f9);
  border-bottom:1px solid var(--gw-border);
  padding:.9rem 1.1rem;
}
#div-resetPwd .modal-title{ width:100%; text-align:center; font-weight:700; margin:0; }
#div-resetPwd .modal-header .btn-close{ position:absolute; right:10px; top:10px; opacity:.7; }
#div-resetPwd .modal-header .btn-close:hover{ opacity:.95; }
#div-resetPwd .modal-body{ padding:18px 20px; }
#div-resetPwd .form-group label{ font-weight:600; color:#111827; }
#div-resetPwd .form-control{ height:40px; border-radius:10px; }

/* input with show/hide toggle */
.gw-input-with-toggle{ position:relative; }
.gw-input-with-toggle .pw-toggle{
  position:absolute; right:10px; top:50%; transform:translateY(-50%);
  width:32px; height:32px; border:0; border-radius:8px;
  background:transparent; cursor:pointer;
}
.gw-input-with-toggle .pw-toggle::before{
  content:""; display:block; width:18px; height:18px; margin:0 auto;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23647569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-7 11-7 11 7 11 7-4 7-11 7-11-7-11-7Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center/contain no-repeat;
}
.gw-input-with-toggle .pw-toggle.on::before{
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23647569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.94 10.94 0 0 1 12 20c-7 0-11-8-11-8a21.83 21.83 0 0 1-3.2 4.49'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Clearable input */
.clearable{ position:relative; }
.clearable input.form-control{ padding-right:28px; }
.clearable .clear-btn{
  position:absolute; right:8px; top:50%; transform:translateY(-50%);
  width:18px; height:18px; border:0; background:transparent;
  font-size:16px; color:#9ca3af; line-height:1; cursor:pointer; display:none;
}
.clearable .clear-btn:hover{ color:#111827; }
#formQuery-area + .clear-btn{ position:absolute; right:8px; top:50%; transform:translateY(-50%); width:18px; height:18px; border:0; background:transparent; font-size:16px; color:#9ca3af; line-height:1; cursor:pointer; display:none; }
#formQuery-area + .clear-btn:hover{ color:#111827; }

.gw-toprow .form-group{ margin-bottom:.5rem; }

/* ===================================================================================================
   Select2 — flat multi-select with comma-separated text (global – no rounded “chips”/pills anywhere)
   =================================================================================================== */
.select2-container--default .select2-selection--multiple{
  background:#fff;
  border:1px solid var(--gw-border);
  border-radius:.75rem;
  min-height:38px;
  padding:.5rem .625rem;
  box-shadow:none;
}

/* placeholder tone */
.select2-container--default .select2-selection--multiple .select2-selection__placeholder{
  color:var(--gw-muted);
  margin:0;
}

/* keep the rendered line tight like a normal input */
.select2-container--default .select2-selection--multiple .select2-selection__rendered{
  padding:0;
  margin:0;
}

/* hide chip styling and show plain text items */
.select2-container--default .select2-selection--multiple .select2-selection__choice{
  background:transparent !important;
  border:0 !important;
  border-radius:0 !important;
  box-shadow:none !important;
  padding:0 !important;
  margin:0 .25rem 0 0 !important;
  color:inherit;
}

/* hide the little “x” remove button inside chips */
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{
  display:none !important;
}

/* comma-separate selected values */
.select2-container--default .select2-selection--multiple
  .select2-selection__choice:not(:last-child)::after{
  content:", ";
}

/* input in the selection area */
.select2-container--default .select2-selection--multiple
  .select2-search--inline .select2-search__field{
  color:var(--gw-muted);
  font-size:.95rem;
  margin:0;
}

/* ---------- Dropdown (unchanged) ---------- */
.select2-dropdown{ border-radius:8px; box-shadow:0 6px 20px rgba(0,0,0,.12); }
#modal-user .select2-results{ max-height:260px; }
#modal-user .select2-results__option{
  padding:6px 10px; font-size:.9rem; display:flex; align-items:center;
}
#modal-user .select2-results__option .role-check{ margin-right:.55rem; }

/* soft hover highlight */
.select2-results__option--highlighted{
  background:var(--gw-row-hover) !important;
  color:inherit !important;
}

/* safety: hide any old footer actions if present */
#modal-user .select2-dropdown .role-actions{ display:none !important; }
/* Pill look for Checkpoint inside table cells (beats skin resets) */
.bootstrap-table .table td .btn-checkpoint,
.table td .btn-checkpoint,
td .btn-checkpoint {
  display: inline-block !important;
  background: var(--gw-accent) !important;      
  color: #fff !important;
  border: none !important;
  border-radius: .6rem !important;
  padding: .35rem .9rem !important;
  font-weight: 600 !important;
  font-size: .85rem !important;
  line-height: 1.1 !important;
  text-decoration: none !important;
}
.bootstrap-table .table td .btn-checkpoint:hover,
.table td .btn-checkpoint:hover,
td .btn-checkpoint:hover {
  background: var(--gw-accent-600, #16a34a)!important;
  color: #fff !important;
  text-decoration: none !important;
}
.select2-anchor { position: relative; }
/* Remove row background highlight from bootstrap-table selection */
.fixed-table-container tbody .selected td {
  background-color: transparent !important;
}

/* Routes Select2: flat 38px when empty; grow when it has selections */
#route-assess-card #route-multi + .select2-container .select2-selection--multiple{
  min-height:38px !important;
  height:38px !important;          /* match other controls */
  overflow:hidden !important;
  padding:6px 8px !important;
}

/* When there ARE selections, let the box grow to wrap chips */
#route-assess-card #route-multi + .select2-container.gw-has-selection
  .select2-selection--multiple{
  height:auto !important;
  overflow:visible !important;
}

/* (optional but helps) make the inline search input tidy */
#route-assess-card #route-multi + .select2-container
  .select2-search--inline .select2-search__field{
  height:28px !important;
  line-height:28px !important;
}
.gw-input-readonly {
    background-color: #f3f4f6; 
    cursor: not-allowed;

.gw-email-locked {
    background-color: #f3f4f6 !important; 
    color: #6b7280 !important;         
    cursor: not-allowed;
    caret-color: transparent;           
}

}

