/* AssetTrack Pro theme. Loaded after bootstrap.min.css and vendor-plugins.css. */

:root {
  --paper: #F7F8FA;
  --rail: #F1F3F6;
  --surface: #FFFFFF;
  --ink: #172036;
  --ink-2: #48526A;
  --ink-3: #5F6880;
  --line: #E4E7ED;
  --line-2: #D3D8E1;
  --navy: #1D2B64;
  --navy-hover: #15204D;
  --navy-tint: #E9EDF8;
  --blue: #3B5FB8;
  --tag: #F2B705;
  --tag-tint: #FFF6D6;
  --red: #C42B27;
  --red-tint: #FDEEEE;
  --green: #1E7F55;
  --green-tint: #E6F3EC;
  --amber: #B86E00;
  --amber-tint: #FDF1DE;

  --s-inuse: #1E7F55;
  --s-stock: #3B5FB8;
  --s-disposed: #8B92A3;
  --s-repair: #B86E00;
  --s-broken: #B4232A;
  --s-lost: #6B3FA0;
  --s-need: #C7951A;

  --r-panel: 10px;
  --r-ctl: 7px;
  --r-tag: 3px;
  --rail-w: 252px;
  --top-h: 60px;
  --font: "Schibsted Grotesk", "Segoe UI", system-ui, sans-serif;
  --ring: 0 0 0 3px rgba(59, 95, 184, .16);

  --bs-body-font-family: var(--font);
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--paper);
  --bs-border-color: var(--line);
  --bs-primary: #1D2B64;
  --bs-primary-rgb: 29, 43, 100;
  --bs-link-color: #3B5FB8;
  --bs-link-hover-color: #1D2B64;
}

/* ---------- Base ---------- */
body.atp-app,
body.atp-auth-body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--font); color: var(--ink); font-weight: 650; letter-spacing: -0.01em; }
h4 { font-size: 17px; }
h5 { font-size: 15px; }
h6 { font-size: 14px; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--navy); }
.fe, .fa-solid, .fa-regular { line-height: 1; }
::selection { background: var(--navy-tint); }
code { padding: 1px 5px; font-size: .9em; color: var(--ink); background: var(--rail); border-radius: 4px; }
.text-muted, .atp-muted { color: var(--ink-3) !important; }
.text-primary { color: var(--navy) !important; }
.text-danger { color: var(--red) !important; }
.text-success, .text-success-strong { color: var(--green) !important; }
.text-warning, .text-warning-strong { color: var(--amber) !important; }
.bg-primary { background-color: var(--navy) !important; }
.bg-success-transparent { background: var(--green-tint) !important; color: var(--green) !important; }
.bg-danger-transparent { background: var(--red-tint) !important; color: var(--red) !important; }
.fs-13 { font-size: 13px !important; }
.fs-15 { font-size: 15px !important; }

/* ---------- Shell ---------- */
.atp-shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; }

.atp-rail {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--rail);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  scrollbar-width: thin;
}

.atp-brand { display: flex; flex-direction: column; gap: 6px; padding: 20px 20px 18px; border-bottom: 1px solid var(--line); }
.atp-brand:hover { color: inherit; }
.atp-wordmark { display: inline-flex; align-items: baseline; font-weight: 800; font-size: 20px; letter-spacing: -0.03em; color: var(--navy); line-height: 1.1; }
.atp-dash { display: inline-block; flex: none; width: 10px; height: 3px; margin-left: 3px; background: var(--red); border-radius: 1px; }
.atp-brand-sub { font-size: 12.5px; color: var(--ink-3); }

.atp-nav { display: flex; flex-direction: column; gap: 2px; padding: 12px 10px 20px; }
.atp-nav-group { margin-top: 14px; padding: 0 10px 6px; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.atp-nav a,
.atp-nav summary {
  display: flex; align-items: center; gap: 10px;
  min-height: 34px; padding: 6px 10px;
  border-radius: 7px;
  color: var(--ink-2); font-size: 14px; font-weight: 500;
  cursor: pointer; list-style: none;
}
.atp-nav summary::-webkit-details-marker { display: none; }
.atp-nav a > i:first-child, .atp-nav summary > i:first-child { width: 16px; font-size: 16px; text-align: center; color: var(--ink-3); }
.atp-nav a > .fa-solid { font-size: 13.5px; }
.atp-nav a:hover, .atp-nav summary:hover { background: #E7EAF0; color: var(--ink); }
.atp-nav > a[aria-current="page"] { background: var(--surface); color: var(--navy); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line-2); }
.atp-nav > a[aria-current="page"] i { color: var(--navy); }
.atp-nav .atp-caret { margin-left: auto; font-size: 13px; color: var(--ink-3); transition: transform .15s; }
.atp-nav details[open] > summary .atp-caret { transform: rotate(90deg); }
.atp-nav details[open] > summary { color: var(--ink); }
.atp-subnav { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 18px; padding-left: 12px; border-left: 1px solid var(--line-2); }
.atp-subnav a { position: relative; min-height: 30px; padding: 4px 10px; font-size: 13.5px; font-weight: 450; }
.atp-subnav a[aria-current="page"] { color: var(--navy); font-weight: 600; }
.atp-subnav a[aria-current="page"]::before { content: ""; position: absolute; left: -13px; top: 6px; bottom: 6px; width: 2px; background: var(--navy); border-radius: 2px; }
.atp-rail-foot { margin-top: auto; padding: 14px 20px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }

.atp-main { min-width: 0; display: flex; flex-direction: column; }

.atp-topbar {
  position: sticky; top: 0; z-index: 1020;
  height: var(--top-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.atp-search {
  flex: 1; max-width: 560px;
  display: flex; align-items: center; gap: 10px;
  height: 38px; margin: 0; padding: 0 8px 0 12px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-ctl);
  color: var(--ink-3);
}
.atp-search:focus-within { background: #fff; border-color: var(--blue); box-shadow: var(--ring); }
.atp-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; color: var(--ink); font-size: 14px; }
.atp-search input::placeholder { color: var(--ink-3); }
.atp-search kbd { padding: 0 6px; font-family: var(--font); font-size: 11.5px; font-weight: 600; line-height: 18px; color: var(--ink-3); background: #fff; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; }
.atp-top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.atp-user { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border: 0; border-radius: 8px; background: none; text-align: left; }
.atp-user:hover { background: var(--paper); }
.atp-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 7px; background: var(--navy); color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.atp-user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.atp-user-meta b { font-size: 13px; font-weight: 600; color: var(--ink); }
.atp-user-meta span { font-size: 12px; color: var(--ink-3); }
.atp-menu-btn { display: none !important; }

.atp-content { width: 100%;  padding: 28px 28px 56px; }
.atp-crumbs { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 13px; color: var(--ink-3); }
.atp-crumbs a { color: var(--ink-3); }
.atp-crumbs a:hover { color: var(--ink); text-decoration: underline; }
.atp-crumbs .fe { font-size: 12px; }
.atp-crumbs [aria-current] { color: var(--ink-2); }
.atp-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.atp-page-title { margin: 0; font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -0.025em; }
.atp-page-sub { margin: 6px 0 0; max-width: 760px; font-size: 14px; color: var(--ink-2); }
.atp-page-head.has-aside { align-items: stretch; flex-wrap: nowrap; }
.atp-page-head.has-aside .atp-page-head-main { display: flex; flex-direction: column; min-width: 0; }
.atp-page-head.has-aside .atp-page-actions { margin-top: auto; padding-top: 16px; }
.atp-page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.atp-page-actions > div { display: flex; gap: 8px; flex-wrap: wrap; }
.atp-page-actions form { margin: 0; }

.atp-page-card { padding: 22px 24px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); }
.atp-page-card > .card { border: 0; margin: 0; }
.atp-page-card > .card > .card-body { padding: 0; }

.atp-scrim { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 36px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: var(--r-ctl);
  background: var(--surface); color: var(--ink);
  font-size: 13.5px; font-weight: 600; line-height: 1.2; white-space: nowrap;
  box-shadow: 0 1px 0 rgba(23, 32, 54, .04);
  transition: background-color .12s, border-color .12s, color .12s;
}
.btn .fe, .btn .fa-solid { font-size: 15px; color: var(--ink-2); margin: 0 !important; }
.btn:hover { background: var(--paper); border-color: #BFC6D2; color: var(--ink); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--blue); }
.btn-sm { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn-lg { min-height: 42px; padding: 0 18px; font-size: 14.5px; }
.btn-block, .btn.w-100 { display: flex; width: 100%; }

.btn-primary, .btn-info {
  background: var(--navy); border-color: var(--navy); color: #fff;
  box-shadow: 0 1px 0 rgba(23, 32, 54, .2), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.btn-primary .fe, .btn-primary .fa-solid, .btn-info .fe { color: #fff; }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active,
.btn-info:hover, .btn-info:focus { background: var(--navy-hover) !important; border-color: var(--navy-hover) !important; color: #fff !important; }

.btn-outline-primary, .btn-light, .btn-white, .btn-default, .btn-secondary, .btn-outline-secondary {
  background: var(--surface); border-color: var(--line-2); color: var(--ink);
}
.btn-outline-primary:hover, .btn-light:hover, .btn-white:hover, .btn-default:hover, .btn-secondary:hover, .btn-outline-secondary:hover,
.btn-outline-primary:focus, .btn-outline-primary:active, .btn-check:checked + .btn-outline-primary {
  background: var(--paper) !important; border-color: #BFC6D2 !important; color: var(--ink) !important;
}

.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-success .fe { color: #fff; }
.btn-success:hover { background: #17673F; border-color: #17673F; color: #fff; }
.btn-warning { background: var(--tag); border-color: #DCA600; color: var(--ink); }
.btn-warning:hover { background: #E3AB00; border-color: #CC9A00; color: var(--ink); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger .fe, .btn-danger .fa-solid { color: #fff; }
.btn-danger:hover, .btn-danger:focus { background: #A8221F; border-color: #A8221F; color: #fff; }
.btn-outline-danger { background: var(--surface); border-color: #EBC2C0; color: var(--red); }
.btn-outline-danger .fe { color: var(--red); }
.btn-outline-danger:hover { background: var(--red-tint); border-color: var(--red); color: var(--red); }
.btn-link { border-color: transparent; background: none; box-shadow: none; color: var(--blue); }
.btn-link:hover { background: var(--rail); border-color: transparent; color: var(--navy); }

/* Icon buttons (row actions, top bar) */
.atp-row-actions { display: inline-flex; gap: 2px; justify-content: flex-end; }
.atp-icon-btn {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; padding: 0;
  border: 0; border-radius: 6px; background: none;
  color: var(--ink-3); font-size: 15px;
}
.atp-icon-btn:hover { background: var(--rail); color: var(--ink); }
.atp-icon-btn.danger:hover { background: var(--red-tint); color: var(--red); }

/* Legacy coloured row buttons */
.table td .btn-sm { min-height: 28px; padding: 0 8px; background: var(--surface); border-color: var(--line-2); color: var(--ink-2); box-shadow: none; }
.table td .btn-sm .fe, .table td .btn-sm .fa-solid { color: var(--ink-2); }
.table td .btn-sm:hover { background: var(--rail) !important; border-color: #BFC6D2 !important; color: var(--ink) !important; }
.table td .btn-sm.btn-danger:hover { background: var(--red-tint) !important; border-color: var(--red) !important; color: var(--red) !important; }
.table td .btn-sm.btn-danger:hover .fe { color: var(--red); }

/* ---------- Segmented / tabs ---------- */
.atp-segmented { display: inline-flex; gap: 2px; padding: 3px; background: var(--rail); border: 1px solid var(--line); border-radius: 9px; }
.atp-segmented a, .atp-segmented button {
  display: inline-flex; align-items: center; height: 30px; padding: 0 12px;
  border: 0; border-radius: 6px; background: none;
  font-size: 13px; font-weight: 550; color: var(--ink-2); white-space: nowrap;
}
.atp-segmented a:hover, .atp-segmented button:hover { color: var(--ink); }
.atp-segmented .active, .atp-segmented [aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 0 0 1px var(--line-2), 0 1px 2px rgba(23, 32, 54, .06); }

.atp-tabs, .nav-tabs {
  display: flex; flex-wrap: nowrap; gap: 2px;
  margin: 0 0 24px; padding: 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.atp-tabs::-webkit-scrollbar { display: none; }
.atp-tabs .nav-link, .nav-tabs .nav-link {
  position: relative;
  margin: 0; padding: 10px 12px 12px;
  border: 0; border-radius: 6px 6px 0 0; background: none;
  font-size: 14px; font-weight: 550; color: var(--ink-3); white-space: nowrap;
}
.atp-tabs .nav-link i, .nav-tabs .nav-link i { display: none; }
.atp-tabs .nav-link:hover, .nav-tabs .nav-link:hover { color: var(--ink); border: 0; }
.atp-tabs .nav-link.active, .nav-tabs .nav-link.active { color: var(--ink); background: none; border: 0; }
.atp-tabs .nav-link.active::after, .nav-tabs .nav-link.active::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--navy); border-radius: 2px 2px 0 0;
}
.nav-link.has-error { color: var(--red) !important; }
.nav-link.has-error::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--red); vertical-align: 2px; }

/* ---------- Signature: asset tag ---------- */
.atp-bars-glyph {
  display: inline-block; flex: none;
  background-image: linear-gradient(90deg,
    var(--bar, #172036) 0 4%, transparent 4% 7%, var(--bar, #172036) 7% 9%, transparent 9% 13%,
    var(--bar, #172036) 13% 19%, transparent 19% 21%, var(--bar, #172036) 21% 23%, transparent 23% 28%,
    var(--bar, #172036) 28% 30%, transparent 30% 32%, var(--bar, #172036) 32% 38%, transparent 38% 41%,
    var(--bar, #172036) 41% 43%, transparent 43% 47%, var(--bar, #172036) 47% 51%, transparent 51% 53%,
    var(--bar, #172036) 53% 55%, transparent 55% 60%, var(--bar, #172036) 60% 66%, transparent 66% 68%,
    var(--bar, #172036) 68% 70%, transparent 70% 73%, var(--bar, #172036) 73% 75%, transparent 75% 79%,
    var(--bar, #172036) 79% 85%, transparent 85% 87%, var(--bar, #172036) 87% 89%, transparent 89% 93%,
    var(--bar, #172036) 93% 96%, transparent 96% 98%, var(--bar, #172036) 98% 100%);
}
.atp-tag {
  display: inline-flex; align-items: center; gap: 7px;
  height: 24px; padding: 0 8px 0 0;
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-tag);
  font-size: 13px; font-weight: 600; letter-spacing: .01em; color: var(--ink);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.atp-tag::before { content: ""; align-self: stretch; width: 4px; margin-right: 1px; background: var(--tag); border-radius: 2px 0 0 2px; }
.atp-tag .atp-bars-glyph { width: 18px; height: 12px; opacity: .85; }
a.atp-tag:hover { border-color: var(--ink-3); color: var(--ink); }

.atp-label-card {
  position: relative; flex: none;
  width: 260px;
  padding: 14px 16px 12px 26px;
  background: #fff; border: 1px solid var(--line-2); border-radius: 8px;
  box-shadow: 0 1px 0 rgba(23, 32, 54, .05), 0 8px 24px -16px rgba(23, 32, 54, .35);
}
.atp-label-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 10px; background: var(--tag); border-radius: 7px 0 0 7px; }
.atp-label-card::after { content: ""; position: absolute; left: 14px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-2); }
.atp-label-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.atp-label-top .atp-wordmark { font-size: 13px; white-space: nowrap; overflow: hidden; }
.atp-label-top .atp-dash { width: 6px; height: 2px; margin-left: 2px; }
.atp-label-top small { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.atp-label-card .atp-bars-glyph { display: block; height: 44px; margin: 10px 0 6px; }
.atp-label-code { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.atp-label-code b { font-size: 18px; font-weight: 700; letter-spacing: .14em; }
.atp-label-code span { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Status ---------- */
.atp-status-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 550; color: var(--ink); white-space: nowrap; }
.atp-status-pill::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 2px; background: var(--c, var(--s-disposed)); }
.st-inuse { --c: var(--s-inuse); }
.st-stock { --c: var(--s-stock); }
.st-disposed { --c: var(--s-disposed); color: var(--ink-2); }
.st-repair { --c: var(--s-repair); }
.st-broken { --c: var(--s-broken); }
.st-lost { --c: var(--s-lost); }
.st-need { --c: var(--s-need); }
.atp-status-pill.is-success { --c: var(--s-inuse); }
.atp-status-pill.is-warning { --c: var(--s-repair); }
.atp-status-pill.is-danger { --c: var(--s-broken); }

.badge { padding: 3px 8px; border-radius: 5px; font-size: 12px; font-weight: 600; }
.badge.bg-success { background: var(--green-tint) !important; color: var(--green); }
.badge.bg-danger { background: var(--red-tint) !important; color: var(--red); }
.badge.bg-warning { background: var(--amber-tint) !important; color: var(--amber); }
.badge.bg-primary { background: var(--navy-tint) !important; color: var(--navy); }
.badge.bg-secondary, .badge.bg-light { background: var(--rail) !important; color: var(--ink-2); }

/* ---------- Cards / panels ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: none; }
.card-header { padding: 16px 20px 14px; background: none; border-bottom: 1px solid var(--line); font-weight: 650; }
.card-title { margin: 0; font-size: 15px; font-weight: 650; }
.card-body { padding: 20px; }
.card-footer { background: none; border-top: 1px solid var(--line); }

.atp-panel { display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; }
.atp-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 14px; }
.atp-panel-header h2, .atp-panel-header h5 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.atp-panel-header p { margin: 2px 0 0; font-size: 13px; color: var(--ink-3); }
.atp-panel-header a { font-size: 13px; font-weight: 600; white-space: nowrap; }
.atp-panel-body { padding: 0 20px 20px; }
.atp-panel-body.flush { padding: 0; }
.atp-panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 13px; }

.atp-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--blue); white-space: nowrap; }
.atp-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.atp-empty-note { padding: 6px 0; font-size: 13px; color: var(--ink-3); }
.atp-empty { padding: 48px 24px; text-align: center; color: var(--ink-2); }

/* ---------- Tables ---------- */
.table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: transparent;
  --bs-table-hover-bg: #FAFBFD;
  --bs-table-border-color: var(--line);
  margin-bottom: 0 !important;
  font-size: 13.5px; color: var(--ink);
  border-collapse: separate !important; border-spacing: 0;
}
.table > :not(caption) > * > * { padding: 10px 12px; vertical-align: middle; border-color: var(--line); border-width: 0 0 1px 0; box-shadow: none !important; background: transparent; }
.table thead th, table.dataTable thead th {
  padding: 9px 12px !important;
  background: #FAFBFC !important;
  border-top: 1px solid var(--line) !important;
  border-bottom: 1px solid var(--line) !important;
  font-size: 12.5px; font-weight: 550; color: var(--ink-3);
  text-transform: none; letter-spacing: 0; white-space: nowrap;
}
.table-bordered, .table-bordered > :not(caption) > * > * { border-left: 0 !important; border-right: 0 !important; }
.table-bordered, .table.border-bottom { border: 0 !important; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table tbody tr:hover > * { background: #FAFBFD; }
.table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-accent-bg: transparent; --bs-table-bg-type: transparent; }
table.dataTable tbody tr.odd, table.dataTable tbody tr.even { background: transparent !important; }
.table > :not(caption) > * > *:first-child { padding-left: 20px !important; }
.table > :not(caption) > * > *:last-child { padding-right: 20px !important; }
.table tbody td:first-child { color: var(--ink-3); }
.bulkbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 0 0 14px; padding: 8px 12px 8px 16px;
  background: var(--navy); color: #fff; font-size: 13px; border-radius: var(--r-panel);
}
.bulkbar[hidden] { display: none !important; }
.bulkbar b { font-weight: 650; }
.bulkbar .btn {
  height: 28px; min-height: 28px; padding: 0 10px;
  background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); color: #fff; box-shadow: none; font-size: 12.5px;
}
.bulkbar .btn .fe, .bulkbar .btn .fa-solid { color: #fff; }
.bulkbar .btn:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.3); color: #fff; }
.bulkbar .end { margin-left: auto; }
table.data tbody tr.selected td,
#assets-datatable tbody tr.selected td { background: #F5F7FD !important; }

.atp-page-card > .table-responsive, .atp-page-card > .dataTables_wrapper { width: auto; margin: 0 -24px -24px; }
.atp-page-card .atp-dt-top, .atp-page-card .atp-dt-bottom { padding: 0 24px; }
.atp-page-card .atp-dt-bottom { padding-bottom: 12px; }
.atp-panel .table > :not(caption) > * > * { font-size: 13.5px; }

.atp-row-title { font-weight: 600; color: var(--ink) !important; }
.atp-row-title:hover { color: var(--blue) !important; text-decoration: underline; text-underline-offset: 3px; }
.atp-row-sub { margin-top: 1px; font-size: 12.5px; color: var(--ink-3); letter-spacing: .02em; white-space: normal; }
.atp-count { display: inline-block; margin-left: 6px; padding: 0 6px; font-size: 11.5px; font-weight: 600; line-height: 18px; color: var(--ink-2); background: var(--rail); border: 1px solid var(--line); border-radius: 4px; vertical-align: 1px; }

/* ---------- DataTables ---------- */
.atp-dt-top, .atp-dt-bottom { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.atp-dt-top { margin-bottom: 14px; }
.atp-dt-bottom { justify-content: space-between; margin-top: 0; padding-top: 12px !important; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.atp-dt-top .dataTables_filter { margin-left: auto !important; }
.dataTables_wrapper .dt-buttons.btn-group { display: inline-flex; gap: 8px; margin: 0 !important; }
.dataTables_wrapper .dt-buttons .btn,
.dataTables_wrapper .dt-buttons.btn-group > .btn,
.dataTables_wrapper .dt-buttons .btn-group > .btn {
  min-height: 34px !important; padding: 0 12px !important; margin: 0 !important;
  border: 1px solid var(--line-2) !important; border-radius: var(--r-ctl) !important;
  background: var(--surface) !important; color: var(--ink) !important;
  font-size: 13px !important; font-weight: 600 !important; line-height: 1 !important;
}
.dataTables_wrapper .dt-buttons .btn:hover { background: var(--paper) !important; border-color: #BFC6D2 !important; }
.dataTables_wrapper .dt-buttons .btn .fe { margin-right: 4px !important; font-size: 14px; color: var(--ink-2); }
.dataTables_wrapper .dt-buttons .btn::after { display: none; }
.dataTables_wrapper .dataTables_filter label, .dataTables_wrapper .dataTables_length label { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--ink-2); }
div.dataTables_wrapper div.dataTables_filter input {
  width: 240px !important; height: 34px; margin: 0 !important; padding: 0 10px 0 32px !important;
  border: 1px solid var(--line-2) !important; border-radius: var(--r-ctl) !important;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235F6880' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 11px center !important;
  font-size: 13.5px; color: var(--ink);
}
div.dataTables_wrapper div.dataTables_filter input:focus { border-color: var(--blue) !important; box-shadow: var(--ring) !important; outline: none; }
div.dataTables_wrapper div.dataTables_length select { width: auto; min-height: 34px; height: 34px; padding: 0 30px 0 10px; }
.dataTables_wrapper .dataTables_info { padding: 0 !important; font-size: 13px; color: var(--ink-2); }
.dataTables_wrapper .dataTables_paginate { margin: 0 !important; }
.dataTables_wrapper .dataTables_paginate .pagination { margin: 0 !important; gap: 2px; }
div.dataTables_wrapper div.dataTables_processing { padding: 10px 16px; margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px -12px rgba(23, 32, 54, .3); font-size: 13px; color: var(--ink-2); transform: translate(-50%, -50%); }
div.dataTables_wrapper div.dataTables_processing > div:last-child { display: none; }
table.dataTable > thead .sorting::before, table.dataTable > thead .sorting::after,
table.dataTable > thead .sorting_asc::before, table.dataTable > thead .sorting_asc::after,
table.dataTable > thead .sorting_desc::before, table.dataTable > thead .sorting_desc::after { font-size: 9px; opacity: .25; }
table.dataTable > thead .sorting_asc::before, table.dataTable > thead .sorting_desc::after { opacity: .8; color: var(--navy); }
div.dt-button-collection, .dt-button-collection.dropdown-menu { padding: 4px !important; border: 1px solid var(--line) !important; border-radius: 8px !important; box-shadow: 0 12px 32px -12px rgba(23, 32, 54, .3) !important; }
.dt-button-collection .dt-button, .dt-button-collection .dropdown-item { border-radius: 5px !important; font-size: 13px; }
.dt-button-collection .dt-button.active { background: var(--navy-tint) !important; color: var(--navy) !important; }

.pagination { gap: 2px; }
.page-link {
  display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px !important;
  border: 0 !important; border-radius: 6px !important; background: none !important;
  font-size: 13px; font-weight: 550; color: var(--ink-2) !important;
}
.page-link:hover { background: var(--rail) !important; color: var(--ink) !important; }
.page-link:focus { box-shadow: var(--ring); }
.page-item.active .page-link { background: var(--ink) !important; color: #fff !important; }
.page-item.disabled .page-link { color: #B3B9C6 !important; }

/* ---------- Forms ---------- */
.form-label, label.control-label, .form-group > label {
  display: block; margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--ink);
}
.form-control, .form-select, .custom-select {
  width: 100%; min-height: 38px; padding: 7px 12px;
  border: 1px solid var(--line-2); border-radius: var(--r-ctl);
  background-color: #fff; font-size: 14px; color: var(--ink);
  box-shadow: inset 0 1px 1px rgba(23, 32, 54, .03);
  transition: border-color .12s, box-shadow .12s;
}
.form-select, .custom-select { padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235F6880' stroke-width='2' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 14px; appearance: none; }
.form-control-sm, .form-select-sm { min-height: 32px; padding-top: 4px; padding-bottom: 4px; font-size: 13px; }
textarea.form-control { min-height: 88px; line-height: 1.5; }
.form-control::placeholder { color: #8A92A4; }
.form-control:hover, .form-select:hover { border-color: #B6BDCA; }
.form-control:focus, .form-select:focus { outline: none; border-color: var(--blue); box-shadow: var(--ring); }
.form-control:disabled, .form-control[readonly], .form-select:disabled { background-color: var(--paper); color: var(--ink-2); }
.form-text, .help-block { margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }
.input-group-text { border-color: var(--line-2); background: var(--paper); color: var(--ink-2); font-size: 13.5px; }

.form-check { min-height: 22px; }
.form-check-input { width: 16px; height: 16px; margin-top: .15em; border: 1.5px solid #B9C0CD; border-radius: 4px; cursor: pointer; }
.form-check-input:checked { background-color: var(--navy); border-color: var(--navy); }
.form-check-input:focus { border-color: var(--blue); box-shadow: var(--ring); }
.form-check-label { font-size: 13.5px; color: var(--ink); cursor: pointer; }
.form-switch .form-check-input { width: 32px; height: 18px; border-radius: 9px; border: 0; background-color: #CBD1DC; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e"); }
.form-switch .form-check-input:checked { background-color: var(--navy); }

.validation-summary-valid { display: none !important; }
.form-control.is-invalid, .form-select.is-invalid, .input-validation-error, .select2.is-invalid .select2-selection {
  border-color: var(--red) !important; background-color: #FFFBFB !important; background-image: none;
  box-shadow: 0 0 0 3px rgba(196, 43, 39, .12) !important;
}
.form-select.is-invalid { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235F6880' stroke-width='2' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important; }
.was-validated .form-control:valid, .was-validated .form-select:valid { border-color: var(--line-2); background-image: none; }
.atp-field-error, .field-validation-error {
  display: flex; align-items: center; gap: 6px; margin-top: 6px;
  font-size: 12.5px; font-weight: 550; color: var(--red) !important;
}
.atp-field-error::before, .field-validation-error::before {
  content: ""; flex: none; width: 14px; height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C42B27' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8v5M12 16.5v.01'/%3E%3C/svg%3E") center / contain no-repeat;
}
.atp-field-error:empty, .field-validation-valid { display: none; }

.atp-form-section { padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.atp-form-section:last-of-type { border-bottom: 0; margin-bottom: 0; }
.atp-form-section h5 { margin: 0 0 16px; font-size: 15px; font-weight: 650; }
.atp-actions-bar {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
  margin: 24px -24px 0; padding: 12px 24px;
  background: #fff; border-top: 1px solid var(--line);
}
.atp-page-card > form:last-child > .atp-actions-bar:last-child,
.atp-page-card > .atp-actions-bar:last-child { margin-bottom: -24px; border-radius: 0 0 var(--r-panel) var(--r-panel); }

/* Select2 */
.select2-container { font-size: 14px; }
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  min-height: 38px; border: 1px solid var(--line-2) !important; border-radius: var(--r-ctl) !important;
  background: #fff !important; box-shadow: inset 0 1px 1px rgba(23, 32, 54, .03);
}
.select2-container--default .select2-selection--single .select2-selection__rendered { padding-left: 12px; padding-right: 34px; line-height: 36px !important; color: var(--ink) !important; }
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: #8A92A4; }
.select2-container--default .select2-selection--single .select2-selection__arrow { top: 0 !important; right: 8px !important; height: 36px !important; }
.select2-container--default .select2-selection--single .select2-selection__arrow b { border-color: var(--ink-3) transparent transparent !important; }
.select2-container--default .select2-selection--single .select2-selection__clear { margin-right: 6px; color: var(--ink-3); }
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple { border-color: var(--blue) !important; box-shadow: var(--ring); }
.select2-dropdown { overflow: hidden; border: 1px solid var(--line-2) !important; border-radius: 8px !important; box-shadow: 0 12px 32px -12px rgba(23, 32, 54, .3); }
.select2-search--dropdown { padding: 8px; }
.select2-container--default .select2-search--dropdown .select2-search__field { height: 32px; padding: 0 10px; border: 1px solid var(--line-2) !important; border-radius: 6px; outline: none; }
.select2-results__option { padding: 7px 12px; font-size: 13.5px; }
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background: var(--navy-tint) !important; color: var(--navy) !important; }
.select2-container--default .select2-results__option[aria-selected=true],
.select2-container--default .select2-results__option--selected { background: var(--rail) !important; color: var(--ink) !important; font-weight: 600; }
.select2-container--default .select2-selection--multiple .select2-selection__choice { background: var(--navy-tint) !important; border: 0 !important; color: var(--navy) !important; border-radius: 4px; }

/* Dropify */
.dropify-wrapper { border: 1px dashed #BFC6D2 !important; border-radius: 8px !important; background: var(--paper) !important; font-family: var(--font) !important; }
.dropify-wrapper:hover { background-image: none !important; border-color: var(--ink-3) !important; }
.dropify-wrapper .dropify-message p { font-size: 13px !important; color: var(--ink-2); }

/* ---------- Alerts / dropdowns / modals ---------- */
.alert { position: relative; display: block; padding: 12px 14px; border: 1px solid; border-radius: 8px; font-size: 13.5px; }
.alert-success { background: var(--green-tint); border-color: #BFDECD; color: #145C3C; }
.alert-danger { background: var(--red-tint); border-color: #F0C4C2; color: #8F1F1C; }
.alert-warning { background: var(--tag-tint); border-color: #EBDDAE; color: #6B4C00; }
.alert-info { background: var(--navy-tint); border-color: #CDD6EE; color: var(--navy); }
.alert-dismissible { padding-right: 44px; }
.alert .btn-close { padding: 14px; font-size: 11px; }

.dropdown-menu { min-width: 200px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 32px -12px rgba(23, 32, 54, .3); font-size: 13.5px; }
.dropdown-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 5px; color: var(--ink); }
.dropdown-item .fe { color: var(--ink-3); }
.dropdown-item:hover, .dropdown-item:focus { background: var(--rail); color: var(--ink); }
.dropdown-divider { margin: 4px 0; border-color: var(--line); }

.modal-backdrop.show { opacity: .32; background: var(--ink); }
.modal-content { border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 24px 64px -24px rgba(23, 32, 54, .45); }
.modal-header { padding: 18px 22px 12px; border-bottom: 1px solid var(--line); }
.modal-title { font-size: 16px; font-weight: 650; }
.modal-body { padding: 18px 22px; }
.modal-footer { gap: 8px; padding: 12px 22px; border-top: 1px solid var(--line); }
.modal-footer > * { margin: 0; }

.swal2-popup { padding: 24px 22px 20px !important; border-radius: 12px !important; font-family: var(--font) !important; }
.swal2-title { font-size: 18px !important; font-weight: 650 !important; color: var(--ink) !important; }
.swal2-html-container { font-size: 14px !important; color: var(--ink-2) !important; }
.swal2-styled { min-height: 36px; padding: 0 16px !important; border-radius: var(--r-ctl) !important; font-size: 13.5px !important; font-weight: 600 !important; box-shadow: none !important; }
.swal2-styled.swal2-confirm { background: var(--navy) !important; }
.swal2-styled.swal2-cancel { background: #fff !important; border: 1px solid var(--line-2) !important; color: var(--ink) !important; }
.swal2-styled.swal2-deny { background: var(--red) !important; }
.swal2-icon { transform: scale(.8); margin-top: 4px !important; margin-bottom: 4px !important; }

/* ---------- Dashboard ---------- */
.atp-register { display: grid; grid-template-columns: 340px minmax(0, 1fr); }
.atp-register-lead { display: flex; flex-direction: column; gap: 18px; padding: 24px 24px 22px; border-right: 1px solid var(--line); }
.atp-register-lead .lead-label { font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.atp-register-count { margin: 6px 0 0; font-size: 52px; font-weight: 750; line-height: 1; letter-spacing: -0.04em; color: var(--ink); }
.atp-custody { display: flex; flex-direction: column; gap: 8px; }
.atp-custody .row-line { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); }
.atp-custody .row-line b { font-weight: 650; color: var(--ink); }
.atp-meter { display: flex; height: 6px; overflow: hidden; border-radius: 3px; background: #E3E7EF; }
.atp-meter i { display: block; height: 100%; background: var(--navy); }
.atp-register-lead .foot { display: flex; gap: 14px; flex-wrap: wrap; margin-top: auto; }

.atp-register-mix { min-width: 0; padding: 22px 24px 20px; }
.atp-mix-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.atp-mix-head h2 { margin: 0; font-size: 15px; font-weight: 650; }
.atp-status-code { display: flex; align-items: stretch; gap: 3px; height: 64px; margin-bottom: 2px; }
.atp-status-code > a {
  min-width: 3px; border-radius: 2px;
  background-color: var(--c);
  background-image: repeating-linear-gradient(90deg, transparent 0 5px, rgba(255, 255, 255, .22) 5px 6px, transparent 6px 9px, rgba(255, 255, 255, .12) 9px 11px, transparent 11px 16px);
}
.atp-status-code > a:hover { filter: brightness(1.08); }
.atp-legend-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 18px; border-top: 1px solid var(--line); }
.atp-legend-grid a { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 4px 0; color: inherit; }
.atp-legend-grid a:hover .lg-name { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.atp-legend-grid .lg-name { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.atp-legend-grid .lg-name::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.atp-legend-grid .lg-val { padding-left: 15px; font-size: 18px; font-weight: 700; letter-spacing: -0.015em; color: var(--ink); }
.atp-legend-grid .lg-val small { margin-left: 6px; font-size: 12.5px; font-weight: 500; letter-spacing: 0; color: var(--ink-3); }
.atp-legend-grid .lg-val.zero { font-weight: 600; color: var(--ink-3); }

.atp-checks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 20px; }
.atp-check { display: flex; gap: 14px; align-items: flex-start; min-width: 0; padding: 18px 20px; border-left: 1px solid var(--line); color: inherit; }
.atp-check:first-child { border-left: 0; }
a.atp-check:hover { background: #FAFBFD; color: inherit; }
.atp-check-ico { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 8px; background: var(--rail); color: var(--ink-3); font-size: 17px; }
.atp-check h3 { margin: 0; font-size: 13.5px; font-weight: 550; color: var(--ink-2); }
.atp-check .val { margin-top: 2px; font-size: 22px; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
.atp-check .note { margin-top: 2px; font-size: 12.5px; color: var(--ink-3); }
.atp-check.ok .val { color: var(--ink-3); }
.atp-check.warn { background: linear-gradient(180deg, var(--tag-tint), #fff 85%); }
.atp-check.warn:first-child { border-radius: var(--r-panel) 0 0 var(--r-panel); }
.atp-check.warn .atp-check-ico { background: var(--tag); color: var(--ink); }
.atp-check.warn .note b { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--tag); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.atp-check.alert-ico .atp-check-ico { background: var(--red-tint); color: var(--red); }

.atp-dash-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 20px; margin-top: 20px; }
.atp-dash-grid.is-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.atp-sessions { list-style: none; margin: 0; padding: 0 20px 6px; }
.atp-sessions li { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.atp-sessions h3 { margin: 0; font-size: 14px; font-weight: 600; }
.atp-sessions h3 a { color: var(--ink); }
.atp-sessions h3 a:hover { color: var(--blue); text-decoration: underline; }
.atp-sessions p { margin: 1px 0 0; font-size: 12.5px; color: var(--ink-3); }
.atp-sessions .age { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.atp-date-chip { overflow: hidden; text-align: center; line-height: 1.1; border: 1px solid var(--line-2); border-radius: 6px; }
.atp-date-chip b { display: block; padding: 5px 0 1px; font-size: 17px; font-weight: 700; }
.atp-date-chip span { display: block; padding-bottom: 5px; font-size: 11px; font-weight: 600; color: var(--ink-3); }

.atp-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.atp-bars li { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr) 64px; gap: 14px; align-items: center; font-size: 13.5px; }
.atp-bars.is-compact li { grid-template-columns: minmax(90px, 150px) minmax(0, 1fr) 56px; }
.atp-bars .bar-label { overflow: hidden; font-weight: 500; color: var(--ink); white-space: nowrap; text-overflow: ellipsis; }
a.bar-label:hover { color: var(--blue); }
.atp-bars .bar-track { height: 10px; overflow: hidden; background: var(--rail); border-radius: 2px; }
.atp-bars .bar-fill { height: 100%; background: var(--navy); border-radius: 2px; }
.atp-bars li:nth-child(n+3) .bar-fill { background: #8E9BC4; }
.atp-bars .bar-fill.is-success { background: var(--s-inuse); }
.atp-bars .bar-fill.is-warning { background: var(--s-repair); }
.atp-bars .bar-fill.is-danger { background: var(--s-broken); }
.atp-bars .bar-fill.is-muted { background: var(--s-disposed); }
.atp-bars .bar-value { font-weight: 650; text-align: right; }
.atp-bars .bar-value small { margin-left: 4px; font-weight: 500; color: var(--ink-3); }

.atp-split { display: flex; gap: 3px; height: 36px; margin: 0; overflow: hidden; border-radius: 6px; background: repeating-linear-gradient(135deg, #EEF0F4 0 6px, #E1E5EC 6px 8px); }
.atp-split span { display: block; height: 100%; background: var(--navy); }
.atp-split-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.atp-split-legend div { display: flex; flex-direction: column; gap: 2px; }
.atp-split-legend .k { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.atp-split-legend .k::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--navy); }
.atp-split-legend div:last-child .k::before { background: repeating-linear-gradient(135deg, #EEF0F4 0 3px, #C9CFDA 3px 4px); box-shadow: inset 0 0 0 1px #C9CFDA; }
.atp-split-legend .v { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.atp-split-legend .v small { margin-left: 4px; font-size: 12.5px; font-weight: 500; color: var(--ink-3); }

.atp-legend { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.atp-legend li { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; }
.atp-legend .dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 2px; background: #C9CFDA; }
.atp-legend .dot.is-primary { background: var(--navy); }

.atp-quick { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 20px 0 0; padding: 0; }
.atp-quick a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); color: var(--ink); }
.atp-quick a:hover { border-color: var(--line-2); background: #FAFBFD; color: var(--ink); }
.atp-quick a > .fe, .atp-quick a > .fa-solid { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 8px; background: var(--rail); color: var(--ink-2); font-size: 16px; }
.atp-quick b { display: block; font-size: 13.5px; font-weight: 600; }
.atp-quick small { display: block; font-size: 12.5px; color: var(--ink-3); }

/* ---------- Stats (import, tracking, reports) ---------- */
.atp-stat-row { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); margin-bottom: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; }
.atp-stat { display: block; min-width: 0; padding: 16px 20px; border-left: 1px solid var(--line); color: inherit; }
.atp-stat:first-child { border-left: 0; }
a.atp-stat:hover { background: #FAFBFD; color: inherit; }
.atp-stat-label { font-size: 13.5px; font-weight: 550; color: var(--ink-2); }
.atp-stat-value { margin-top: 2px; font-size: 24px; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; color: var(--ink); }
.atp-stat-note { margin-top: 2px; font-size: 12.5px; color: var(--ink-3); }
.atp-stat.is-alert { background: linear-gradient(180deg, var(--tag-tint), #fff 85%); }
.atp-stat.is-alert .atp-stat-label::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 2px; background: var(--tag); vertical-align: 1px; }

.atp-kpi { display: block; height: 100%; padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); color: inherit; }
.atp-kpi:hover { border-color: var(--line-2); color: inherit; }
.atp-kpi .kpi-accent { display: none; }
.atp-kpi .kpi-val, .atp-kpi .kpi-value { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.atp-kpi .kpi-lbl, .atp-kpi .kpi-label { font-size: 13px; color: var(--ink-3); }

.atp-progress { height: 6px; overflow: hidden; border-radius: 3px; background: #E3E7EF; }
.atp-progress span { display: block; height: 100%; background: var(--s-inuse); }

/* ---------- Filter bars / reports ---------- */
.atp-toolbar, .atp-report-filter, .atp-filter-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px;
  margin: 0 -24px 18px; padding: 0 24px 18px;
  border-bottom: 1px solid var(--line);
}
.atp-filter-bar { justify-content: flex-start; }
.atp-filter-bar > div { min-width: 180px; }
.atp-filter-actions { min-width: 0 !important; }
.atp-report-filter > .d-flex { align-items: center !important; flex-wrap: nowrap !important; }
.atp-report-filter .form-label, .atp-report-filter label { margin: 0 !important; white-space: nowrap; }
.atp-report-filter h5 { margin: 0; font-size: 13.5px; font-weight: 600; }
.atp-report-filter .select2-container { width: 260px !important; }
.atp-subtitle { margin: 0; font-size: 13px; color: var(--ink-3); }

.atp-group-title { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.atp-report-card { display: flex; align-items: flex-start; gap: 12px; height: 100%; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); color: var(--ink); }
.atp-report-card:hover { border-color: var(--line-2); background: #FAFBFD; color: var(--ink); }
.atp-report-card:hover strong { color: var(--blue); }
.atp-report-card .atp-report-icon { display: grid; place-items: center; flex: none; width: 32px; height: 32px; margin: 0; border-radius: 8px; background: var(--rail); color: var(--ink-2); font-size: 15px; }
.atp-report-card strong { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.atp-report-card small { display: block; margin-top: 1px; font-size: 12.5px; color: var(--ink-3); }

/* ---------- Steps / checklist ---------- */
.atp-steps { display: flex; margin: 0 0 20px; padding: 0; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; }
.atp-steps li { display: flex; flex: 1; align-items: center; gap: 10px; padding: 12px 16px; font-size: 13.5px; color: var(--ink-3); border-left: 1px solid var(--line); }
.atp-steps li:first-child { border-left: 0; }
.atp-step-no { display: inline-grid; place-items: center; width: 24px; height: 24px; font-size: 12px; font-weight: 700; border: 1px solid var(--line-2); border-radius: 6px; }
.atp-steps li.is-current { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--navy); }
.atp-steps li.is-current .atp-step-no { background: var(--navy); border-color: var(--navy); color: #fff; }
.atp-steps li.is-done .atp-step-no { background: var(--green-tint); border-color: transparent; color: var(--green); }
.atp-checklist { margin: 0; padding: 0; list-style: none; }
.atp-checklist li { position: relative; padding: 8px 0 8px 20px; font-size: 13.5px; line-height: 1.5; border-bottom: 1px solid var(--line); }
.atp-checklist li:last-child { border-bottom: 0; }
.atp-checklist li::before { content: ""; position: absolute; top: 15px; left: 2px; width: 7px; height: 7px; border-radius: 2px; background: var(--tag); }

/* ---------- Asset edit ---------- */
.atp-asset-hero { display: flex; gap: 24px; align-items: stretch; margin-bottom: 20px; }
.atp-asset-hero .atp-page-head { flex: 1; min-width: 0; margin: 0; flex-direction: column; align-items: flex-start; justify-content: space-between; }
.atp-facts { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.25fr) minmax(0, 1.2fr) minmax(0, 1.8fr) minmax(0, 1.2fr) minmax(0, 1fr); gap: 1px; margin: 0 0 24px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; }
.atp-fact { min-width: 0; padding: 14px 18px; background: var(--surface); }
.atp-fact dt { margin-bottom: 4px; font-size: 12.5px; font-weight: 500; color: var(--ink-3); }
.atp-fact dd { margin: 0; overflow: hidden; font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; text-overflow: ellipsis; }
.atp-fact dd.none { font-weight: 500; color: var(--ink-3); }
.atp-fact.stale { background: linear-gradient(180deg, var(--tag-tint), #fff); }
.atp-fact.stale .hint { margin-top: 2px; font-size: 12px; font-weight: 500; color: #7A5600; }
.atp-asset-photo { display: grid; place-items: center; flex: none; width: 120px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); color: #A3ABB7; font-size: 28px; }
.atp-asset-photo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Identity / Manage ---------- */
.atp-manage { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.atp-manage-nav { margin: 0; padding: 6px; }
.atp-manage-nav .nav-link { padding: 7px 10px; border-radius: 6px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.atp-manage-nav .nav-link:hover { background: var(--rail); color: var(--ink); }
.atp-manage-nav .nav-link.active { background: var(--navy-tint); color: var(--navy); font-weight: 600; }
.atp-manage-body { margin: 0; }
.atp-manage-body h3, .atp-manage-body h4 { margin: 0 0 18px; font-size: 16px; font-weight: 650; }
.atp-manage-body .form-floating { display: flex; flex-direction: column; margin-bottom: 16px; }
.atp-manage-body .form-floating > label { position: static; order: -1; height: auto; margin: 0 0 6px; padding: 0; font-size: 13px; font-weight: 600; color: var(--ink); opacity: 1; transform: none !important; }
.atp-manage-body .form-floating > .form-control { height: auto; min-height: 38px; padding: 7px 12px; }
.atp-manage-body .form-floating > .form-control::placeholder { color: transparent; }
.atp-manage-body .btn-lg.w-100 { width: auto !important; }

/* ---------- Auth & error pages ---------- */
body.atp-auth-body { min-height: 100vh; }
.atp-auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.atp-auth-side {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px 48px; overflow: hidden;
  background: var(--navy); color: #fff;
}
.atp-auth-side .atp-wordmark { color: #fff; font-size: 22px; }
.atp-auth-side h2 { max-width: 420px; margin: 0; font-size: 30px; font-weight: 700; line-height: 1.2; letter-spacing: -0.025em; color: #fff; }
.atp-auth-side p { max-width: 400px; margin: 12px 0 0; font-size: 14.5px; color: rgba(255, 255, 255, .72); }
.atp-auth-side .atp-label-card .atp-wordmark { color: var(--navy); font-size: 13px; }
.atp-auth-side .atp-label-card { width: 300px; margin-top: 36px; color: var(--ink); transform: rotate(-3deg); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5); }
.atp-auth-side small { font-size: 12px; color: rgba(255, 255, 255, .55); }
.atp-auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; background: var(--paper); }
.atp-auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 20px; }
.atp-auth-brand img { max-width: 160px; max-height: 48px; object-fit: contain; }
.atp-auth-brand strong { font-size: 14px; font-weight: 500; color: var(--ink-3); }
.atp-auth-card { width: min(100%, 380px); }
.atp-auth-card h1 { margin: 0 0 6px; font-size: 26px; font-weight: 700; letter-spacing: -0.025em; }
.atp-auth-card .lead-text { margin: 0 0 24px; font-size: 14px; color: var(--ink-2); }
.atp-auth-card .form-control { min-height: 42px; }
.atp-auth-card .btn-primary { width: 100%; min-height: 42px; font-size: 14.5px; }
.atp-auth-card a:hover { text-decoration: underline; }
.atp-auth-foot { margin-top: 24px; font-size: 12px; color: var(--ink-3); text-align: center; }

.atp-error-card { width: min(100%, 520px); padding: 32px 30px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.atp-error-code { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.atp-error-code .atp-tag { height: 22px; font-size: 12px; }
.atp-error-card h1 { margin: 12px 0 6px; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.atp-error-text { margin: 0 0 20px; line-height: 1.55; color: var(--ink-2); }
.atp-error-meta { display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px; margin: 0 0 22px; padding: 12px 14px; font-size: 12.5px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.atp-error-meta dt { font-weight: 500; color: var(--ink-3); }
.atp-error-meta dd { margin: 0; word-break: break-all; color: var(--ink); }
.atp-error-meta code { padding: 0; background: none; }
.atp-error-dev { max-height: 160px; margin: 0 0 22px; padding: 12px; overflow: auto; font-size: 12px; white-space: pre-wrap; color: #6B4C00; background: var(--tag-tint); border-radius: 8px; }
.atp-error-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.atp-error-foot { margin: 16px 0 0; font-size: 12px; color: var(--ink-3); }
.atp-error-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }

/* Leftovers from the previous template */
.panel.panel-primary { border: 0; background: none; box-shadow: none; }
.panel-tabs.panel-info { display: none; }
.configuration-step-link { cursor: pointer; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .atp-register { grid-template-columns: 1fr; }
  .atp-register-lead { border-right: 0; border-bottom: 1px solid var(--line); }
  .atp-checks, .atp-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .atp-check:nth-child(3) { border-left: 0; }
  .atp-check:nth-child(n+3) { border-top: 1px solid var(--line); }
  .atp-dash-grid, .atp-dash-grid.is-even { grid-template-columns: 1fr; }
  .atp-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .atp-fact dd { white-space: normal; }
  .atp-stat-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .atp-stat:nth-child(3n+1) { border-left: 0; }
  .atp-stat:nth-child(n+4) { border-top: 1px solid var(--line); }
}

@media (max-width: 960px) {
  .atp-shell { grid-template-columns: 1fr; }
  .atp-rail {
    position: fixed; z-index: 1050; left: 0; top: 0; bottom: 0; width: 284px; height: 100%;
    transform: translateX(-100%); transition: transform .22s cubic-bezier(.2, .8, .2, 1);
    box-shadow: 0 0 0 1px var(--line), 12px 0 40px -12px rgba(23, 32, 54, .25);
  }
  body.atp-nav-open .atp-rail { transform: none; }
  .atp-scrim { display: block; position: fixed; inset: 0; z-index: 1040; background: rgba(23, 32, 54, .32); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.atp-nav-open .atp-scrim { opacity: 1; pointer-events: auto; }
  .atp-menu-btn { display: inline-grid !important; width: 36px; height: 36px; font-size: 18px; }
  .atp-user-meta { display: none; }
  .atp-auth { grid-template-columns: 1fr; }
  .atp-auth-side { display: none; }
  .atp-manage { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .atp-topbar { gap: 8px; padding: 0 12px; }
  .atp-search { height: 36px; }
  .atp-search kbd { display: none; }
  .atp-content { padding: 20px 14px 40px; }
  .atp-page-title { font-size: 24px; }
  .atp-page-head { align-items: flex-start; margin-bottom: 18px; }
  .atp-page-actions { width: 100%; }
  .atp-page-actions .btn { flex: 1 1 auto; }
  .atp-page-card { padding: 16px; }
  .atp-page-card > .table-responsive, .atp-page-card > .dataTables_wrapper { margin: 0 -16px -16px; }
  .atp-page-card .atp-dt-top, .atp-page-card .atp-dt-bottom { padding: 0 16px; }
  .atp-toolbar, .atp-report-filter, .atp-filter-bar { margin: 0 -16px 16px; padding: 0 16px 16px; }
  .atp-actions-bar { margin: 20px -16px 0; padding: 12px 16px; }
  .atp-page-card > form:last-child > .atp-actions-bar:last-child,
  .atp-page-card > .atp-actions-bar:last-child { margin-bottom: -16px; }
  div.dataTables_wrapper div.dataTables_filter input { width: 100% !important; }
  .atp-dt-top .dataTables_filter { flex: 1 1 100%; }
  .atp-register-lead, .atp-register-mix { padding: 18px; }
  .atp-register-count { font-size: 44px; }
  .atp-status-code { height: 48px; }
  .atp-legend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .atp-checks, .atp-quick { grid-template-columns: 1fr; }
  .atp-check { border-left: 0 !important; }
  .atp-check + .atp-check { border-top: 1px solid var(--line); }
  .atp-check.warn:first-child { border-radius: var(--r-panel) var(--r-panel) 0 0; }
  .atp-bars li, .atp-bars.is-compact li { grid-template-columns: 1fr 56px; gap: 6px 12px; }
  .atp-bars .bar-track { grid-column: 1 / -1; grid-row: 2; }
  .atp-sessions li { grid-template-columns: 48px 1fr; }
  .atp-sessions .age { display: none; }
  .atp-page-head.has-aside { flex-direction: column; }
  .atp-asset-hero { flex-direction: column; }
  .atp-label-card { width: 100%; }
  .atp-asset-photo { display: none; }
  .atp-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .atp-stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .atp-stat { border-left: 0 !important; border-top: 1px solid var(--line); }
  .atp-stat:nth-child(-n+2) { border-top: 0; }
  .atp-stat:nth-child(even) { border-left: 1px solid var(--line) !important; }
  .atp-steps li { justify-content: center; padding: 10px; }
  .atp-steps li:not(.is-current) .atp-step-label { display: none; }
  .atp-report-filter > .d-flex { flex-wrap: wrap !important; }
  .atp-report-filter .select2-container { width: 100% !important; }

  table.atp-reflow thead { display: none; }
  table.atp-reflow, table.atp-reflow tbody { display: block; width: 100% !important; }
  table.dataTable.atp-reflow { margin-top: 0 !important; border-top: 1px solid var(--line) !important; }
  table.atp-reflow tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  table.table.atp-reflow > tbody > tr > td { display: block; padding: 0 !important; border: 0; white-space: normal; }
  table.atp-reflow td.dataTables_empty { grid-column: 1 / -1; }
  table.table.atp-reflow > tbody > tr > td:nth-child(1), table.table.atp-reflow > tbody > tr > td:nth-child(4),
  table.table.atp-reflow > tbody > tr > td:nth-child(5), table.table.atp-reflow > tbody > tr > td:nth-child(6) { display: none; }
  table.atp-reflow td:nth-child(2) { grid-column: 1; grid-row: 1; }
  table.atp-reflow td:nth-child(3) { grid-column: 2; grid-row: 1; }
  table.atp-reflow td:nth-child(7) { grid-column: 1; grid-row: 2; align-self: center; }
  table.atp-reflow td:nth-child(8) { grid-column: 2; grid-row: 2; margin-right: -6px; }
  .atp-dt-top .dataTables_length { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.list-unstyled {
    font-size: 15pt !important;
}