/* ============================================================
   KEYBOARD SHORTCUTS POPUP  (custom_js/shortcuts.js)

   Standalone on purpose: this app ships Bootstrap 4.3.1 CSS with
   Bootstrap 3.3.7 JS, so .modal is not a safe thing to build on
   here. Plain overlay + card, no plugin.
   ============================================================ */
.sk-overlay{
  position:fixed;
  inset:0;
  z-index:1090;              /* over the topbar, under nothing else we own */
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:rgba(23,23,40,.46);
  backdrop-filter:blur(2px);
  -webkit-backdrop-filter:blur(2px);
  animation:sk-fade 160ms cubic-bezier(.22,.8,.3,1);
}
.sk-overlay[hidden]{display:none}

@keyframes sk-fade{from{opacity:0}to{opacity:1}}
@keyframes sk-rise{from{opacity:0;transform:translateY(8px) scale(.985)}to{opacity:1;transform:none}}

.sk-card{
  width:100%;
  max-width:560px;
  max-height:min(80vh, 680px);
  display:flex;
  flex-direction:column;
  background:#fff;
  border-radius:16px;
  box-shadow:0 24px 60px rgba(20,16,50,.32),0 2px 8px rgba(20,16,50,.14);
  overflow:hidden;
  font-family:'Plus Jakarta Sans','Barlow',system-ui,-apple-system,'Segoe UI',sans-serif;
  color:#23233c;
  animation:sk-rise 200ms cubic-bezier(.22,.8,.3,1);
}

.sk-head{
  flex:none;
  display:flex;
  align-items:center;
  gap:12px;
  padding:16px 18px;
  border-bottom:1px solid #e8e8f2;
  background:linear-gradient(135deg, rgba(109,91,208,.14), rgba(46,42,92,.05) 60%, transparent), #f6f4fd;
}
.sk-head h2{
  flex:1;
  margin:0;
  padding:0;
  font-family:inherit;
  font-size:16px;
  font-weight:700;
  line-height:1.2;
  letter-spacing:-.01em;
  color:#23233c;
}
.sk-close{
  width:30px;height:30px;
  flex:none;
  display:flex;align-items:center;justify-content:center;
  font-size:21px;line-height:1;
  color:#8a8aa3;
  background:#fff;
  border:1px solid #e8e8f2;
  border-radius:8px;
  cursor:pointer;
}
.sk-close:hover{color:#4c3fa0;background:#edeafb;border-color:transparent}
.sk-close:focus-visible{outline:2px solid #6d5bd0;outline-offset:2px}

.sk-body{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  padding:6px 18px 14px;
  scrollbar-width:thin;
}

.sk-group{margin-top:14px}
.sk-group h3{
  margin:0 0 6px;
  padding:0;
  font-family:inherit;
  font-size:10.5px;
  font-weight:800;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:#8a8aa3;
}
.sk-group ul{
  list-style:none;
  margin:0;
  padding:0;
}
.sk-group li{
  display:flex;
  align-items:center;
  gap:14px;
  padding:7px 8px;
  border-radius:9px;
}
.sk-group li:hover{background:#f6f4fd}
.sk-label{
  flex:1;
  min-width:0;
  font-size:13px;
  font-weight:600;
  color:#4b4b66;
}
.sk-keys{
  flex:none;
  display:flex;
  align-items:center;
  gap:3px;
}
.sk-plus{font-size:10px;color:#8a8aa3;font-weight:700}

/* Rows the browser owns, listed for reference but not bound by us.
   Muted, and tagged so nobody files a bug when the app "ignores" them. */
.sk-system .sk-label{color:#8a8aa3;font-weight:500}
.sk-system .sk-label::after{
  content:"browser";
  margin-left:8px;
  padding:1px 6px;
  font-size:9px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#8a8aa3;
  background:#f6f7fb;
  border:1px solid #e8e8f2;
  border-radius:999px;
  vertical-align:1px;
}
.sk-system kbd{opacity:.75}

.sk-overlay kbd,
.sk-foot kbd{
  display:inline-block;
  min-width:22px;
  padding:3px 7px;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:11px;
  font-weight:700;
  line-height:1.3;
  text-align:center;
  color:#2e2a5c;
  background:#f6f7fb;
  border:1px solid #e0e0ee;
  border-bottom-width:2px;
  border-radius:6px;
  box-shadow:0 1px 0 rgba(35,35,60,.04);
}

.sk-foot{
  flex:none;
  padding:10px 18px;
  border-top:1px solid #e8e8f2;
  background:#fbfbfe;
  font-size:11.5px;
  font-weight:600;
  color:#8a8aa3;
}

/* The page behind must not scroll while the dialog is up. */
body.sk-open{overflow:hidden}

/* ============================================================
   FONT PICKER  (custom_js/font_pref.js)
   Reuses the .sk-overlay / .sk-card shell above so both dialogs
   are the same object, not two that nearly match.
   ============================================================ */
.af-card{max-width:480px}
.af-intro{margin:10px 0 4px;font-size:11.5px;color:#8a8aa3;line-height:1.45}

.af-list{list-style:none;margin:10px 0 0;padding:0;display:flex;flex-direction:column;gap:3px}
.af-row{
  display:flex;align-items:center;gap:12px;
  width:100%;
  font:inherit;text-align:left;
  background:transparent;border:1px solid transparent;border-radius:10px;
  padding:7px 10px;cursor:pointer;
  transition:background 160ms,border-color 160ms;
}
.af-row:hover{background:#f6f4fd;border-color:#e0dcf6}
.af-row:focus-visible{outline:none;box-shadow:0 0 0 2px #fff,0 0 0 4px #6d5bd0}
.af-row.is-on{background:#edeafb;border-color:#c9c4e8}

/* The sample renders in the font it offers, which is the only
   honest preview - and for a Google face it also shows the swap
   happening, so the wait is visible rather than described. */
.af-sample{
  width:40px;height:34px;flex:none;
  display:flex;align-items:center;justify-content:center;
  font-size:17px;font-weight:700;
  color:#2e2a5c;background:#fff;
  border:1px solid #e8e8f2;border-radius:8px;
}
.af-meta{flex:1;min-width:0;display:flex;flex-direction:column}
.af-name{font-size:13px;font-weight:600;color:#23233c}
.af-note{font-size:10.5px;color:#8a8aa3;margin-top:1px}
.af-tick{flex:none;font-size:13px;font-weight:700;color:#4c3fa0;opacity:0}
.af-row.is-on .af-tick{opacity:1}

.af-custom{margin-top:16px;padding-top:13px;border-top:1px solid #e8e8f2}
.af-custom label{display:block;font-size:11px;font-weight:700;color:#4b4b66;margin-bottom:6px}
.af-custom-row{display:flex;gap:6px}
.af-custom input{
  flex:1;min-width:0;
  font:inherit;font-size:12.5px;color:#23233c;
  background:#f6f7fb;border:1px solid #e8e8f2;border-radius:8px;
  padding:8px 10px;outline:none;
}
.af-custom input:focus{border-color:#6d5bd0;background:#fff;box-shadow:0 0 0 3px rgba(109,91,208,.16)}
.af-apply{
  flex:none;font:inherit;font-size:12px;font-weight:700;color:#fff;
  background:linear-gradient(120deg,#6d5bd0,#4c3fa0);
  border:0;border-radius:8px;padding:8px 15px;cursor:pointer;
}
.af-apply:hover{filter:brightness(1.07)}
.af-hint{margin:7px 0 0;font-size:10.5px;color:#8a8aa3;line-height:1.45}

.af-status{
  margin-top:12px;min-height:18px;
  font-size:11.5px;font-weight:600;color:#4c3fa0;
}
.af-status:empty{display:none}

.af-foot{display:flex;align-items:center;gap:8px}
.af-spacer{flex:1}
.af-reset,
.af-save{
  font:inherit;font-size:12px;font-weight:700;
  border-radius:8px;padding:7px 15px;cursor:pointer;
}
.af-reset{color:#4b4b66;background:#fff;border:1px solid #e8e8f2}
.af-reset:hover{color:#4c3fa0;background:#edeafb;border-color:transparent}
.af-save{color:#fff;background:linear-gradient(120deg,#6d5bd0,#4c3fa0);border:0}
.af-save:hover{filter:brightness(1.07)}

/* ============================================================
   REARRANGER DIALOGS

   Shared by the two window-mode rearrangers on the same
   .sk-overlay / .sk-card shell:
     * report_order.js — report sidebar: groups, each with rows
     * sidebar_order.js — main menu: one flat list (.ro-flat)

   One set of rules rather than two that nearly match, so the two
   dialogs stay the same object as each other and as the
   shortcuts / font ones above.

   Wider than those two on purpose: report names run long ("Sales
   Invoice Weight Based Report"), and a row that wraps is a row
   whose drop position is hard to read.
   ============================================================ */
.ro-card{max-width:620px}
.so-card{max-width:540px}   /* menu labels are short — don't leave a gulf */
.ro-intro{margin:10px 0 2px;font-size:11.5px;color:#8a8aa3;line-height:1.5}
.ro-intro kbd{vertical-align:1px}

.ro-groups{list-style:none;margin:12px 0 0;padding:0}
.ro-group{
  position:relative;
  margin-bottom:10px;
  padding:4px 4px 6px;
  background:#fbfbfe;
  border:1px solid #e8e8f2;
  border-radius:12px;
  outline:none;
}
.ro-group:last-child{margin-bottom:0}
.ro-group:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px #6d5bd0}

/* The heading is a tinted band, not bare text on the card: with six
   groups stacked it is the only thing telling you where one group
   ends and the next begins while rows are moving around. */
.ro-group-head{
  display:flex;align-items:center;gap:8px;
  padding:7px 8px;
  margin-bottom:5px;
  background:linear-gradient(135deg,#edeafb,#f6f4fd 70%);
  border:1px solid #e0dcf6;
  border-radius:9px;
  cursor:grab;
  transition:background 140ms,border-color 140ms;
}
.ro-group-head:hover{background:linear-gradient(135deg,#e5e0f8,#edeafb 70%)}
.ro-group-head:active{cursor:grabbing}
.ro-group-title{
  flex:1;min-width:0;
  font-size:10.5px;font-weight:800;
  letter-spacing:.1em;text-transform:uppercase;
  color:#4c3fa0;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.ro-count{
  flex:none;
  min-width:20px;padding:1px 7px;
  font-size:10px;font-weight:800;line-height:1.6;
  text-align:center;
  color:#4c3fa0;background:#fff;
  border:1px solid #ded9f4;
  border-radius:999px;
}

.ro-items{list-style:none;margin:0;padding:0 2px}
.ro-item{
  display:flex;align-items:center;gap:9px;
  padding:6px 8px;
  background:#fff;
  border:1px solid #eeeef6;
  border-radius:9px;
  margin-bottom:3px;
  cursor:grab;
  outline:none;
  transition:background 140ms,border-color 140ms;
}
.ro-item:last-child{margin-bottom:0}
.ro-item:hover{background:#f6f4fd;border-color:#e0dcf6}
.ro-item:active{cursor:grabbing}
.ro-item:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px #6d5bd0}
.ro-item-ic{
  flex:none;width:22px;
  display:flex;align-items:center;justify-content:center;
  font-size:14px;color:#6d5bd0;
}
/* The main-menu dialog draws real SVG (custom_js/sidebar_icons.js) rather
   than an icon-font glyph, so it paints with the first frame instead of
   waiting on - or vanishing with - the webfont. Filled outlines, so no
   stroke; colour comes from the .ro-item-ic above via currentColor. */
.ro-item-svg{width:17px;height:17px;display:block;fill:currentColor}

/* A top-level menu row carries its submenu with it. The dialog lists only
   the top level, so the count is the one hint that moving this row moves
   nine other things too. */
.ro-sub-count{
  flex:none;
  min-width:19px;padding:1px 6px;
  font-size:9.5px;font-weight:800;line-height:1.7;
  text-align:center;
  color:#8a8aa3;background:#f6f7fb;
  border:1px solid #e8e8f2;border-radius:999px;
}
.ro-item.is-selected .ro-sub-count{color:#4c3fa0;background:#fff;border-color:#d7d1f1}

/* The main menu has no groups: the flat list drops the group's inset. */
.ro-flat{margin-top:12px;padding:0}
.ro-flat .ro-item{margin-bottom:4px}
.ro-item-label{
  flex:1;min-width:0;
  font-size:12.5px;font-weight:600;color:#23233c;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}

/* ---- the selected row ----
   Whatever the arrows will move is tinted, so there is never a
   question of which row a click is about to act on. The group's
   own highlight lands on its heading band, not on the whole
   block, which would swamp the rows inside it. */
.ro-item.is-selected{
  background:#edeafb;
  border-color:#b9b0ea;
  box-shadow:inset 3px 0 0 #6d5bd0;
}
.ro-item.is-selected .ro-item-label{color:#2e2a5c}
.ro-group.is-selected > .ro-group-head{
  background:linear-gradient(120deg,#6d5bd0,#4c3fa0);
  border-color:transparent;
}
.ro-group.is-selected > .ro-group-head .ro-group-title{color:#fff}
.ro-group.is-selected > .ro-group-head .ro-grip{color:rgba(255,255,255,.72)}
.ro-group.is-selected > .ro-group-head .ro-count{
  color:#4c3fa0;background:#fff;border-color:transparent;
}
.ro-group.is-selected > .ro-group-head .ro-mv{
  color:#fff;background:rgba(255,255,255,.16);border-color:transparent;
}
.ro-group.is-selected > .ro-group-head .ro-mv:hover:not(:disabled){
  background:rgba(255,255,255,.3);
}

.ro-grip{
  flex:none;width:16px;
  display:inline-flex;align-items:center;justify-content:center;
  color:#b6b6c8;
}
.ro-grip-ic{width:13px;height:13px}

/* ---- the up/down buttons ----
   Always visible rather than revealed on hover: on a touch screen
   there is no hover, and they are the only way to move a row there
   at all once dragging is out of reach. */
.ro-move{flex:none;display:flex;align-items:center;gap:3px}
.ro-mv{
  width:22px;height:22px;
  display:flex;align-items:center;justify-content:center;
  padding:0;
  color:#6b6b88;
  background:#fff;
  border:1px solid #e3e3ef;
  border-radius:6px;
  cursor:pointer;
  transition:color 140ms,background 140ms,border-color 140ms;
}
.ro-mv:hover:not(:disabled){color:#fff;background:#6d5bd0;border-color:transparent}
.ro-mv:active:not(:disabled){transform:translateY(1px)}
.ro-mv:disabled{opacity:.3;cursor:default}
.ro-mv-ic{width:14px;height:14px}
.ro-mv-down .ro-mv-ic{transform:rotate(180deg)}

/* The dragged element stays visible but recedes, so the gap it
   leaves behind is what the eye follows. */
.ro-dragging{opacity:.4}

.ro-status{
  margin-top:12px;min-height:18px;
  font-size:11.5px;font-weight:600;color:#4c3fa0;
}
.ro-status:empty{display:none}

.ro-foot{display:flex;align-items:center;gap:8px}
.ro-spacer{flex:1}
.ro-reset,
.ro-cancel,
.ro-save{
  font:inherit;font-size:12px;font-weight:700;
  border-radius:8px;padding:7px 15px;cursor:pointer;
}
.ro-reset,
.ro-cancel{color:#4b4b66;background:#fff;border:1px solid #e8e8f2}
.ro-reset:hover,
.ro-cancel:hover{color:#4c3fa0;background:#edeafb;border-color:transparent}
.ro-save{color:#fff;background:linear-gradient(120deg,#6d5bd0,#4c3fa0);border:0}
.ro-save:hover{filter:brightness(1.07)}

@media (max-width:575px){
  .sk-overlay{padding:12px}
  .sk-group li{flex-wrap:wrap;gap:6px}
  .ro-foot{flex-wrap:wrap}
  .ro-spacer{display:none}
}
@media (prefers-reduced-motion: reduce){
  .sk-overlay,.sk-card{animation:none}
}
