/* ============================================================
   BASE
   ============================================================ */
*,*::before,*::after{box-sizing:border-box}
html,body{margin:0;padding:0}
html{-webkit-text-size-adjust:100%}
body{
  background:var(--page);
  color:var(--text);
  font-family:var(--font);
  font-size:14px;
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3{margin:0;color:var(--text);font-weight:600;letter-spacing:-.015em}
a{color:var(--accent);text-decoration:none}
button{font:inherit}
.container{
  width:100%;
  max-width:var(--container-max);
  margin:0 auto;
  padding-left:var(--s6);
  padding-right:var(--s6);
}
:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:2px;
  border-radius:4px;
}
.icon{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.icon-sprite{position:absolute}

/* ============================================================
   HEADER
   ============================================================ */
.appbar{
  background:linear-gradient(90deg,var(--header-from),var(--header-to));
  color:#fff;
}
.appbar-inner{
  display:flex;
  align-items:center;
  gap:var(--s3);
  height:64px;
  padding:0 var(--s5) 0 var(--s4);
}
.brand{display:flex;align-items:center;gap:var(--s3);min-width:0}
.brand-mark{
  height:64px;width:auto;flex:none;
  object-fit:contain;
}
.brand-name{font-size:16px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.appbar-tools{display:flex;align-items:center;gap:var(--s2);margin-left:auto}

.searchbox{position:relative;display:flex;align-items:center}
.searchbox .icon{position:absolute;left:10px;width:17px;height:17px;color:rgba(255,255,255,.7);pointer-events:none}
.searchbox input{
  width:260px;height:36px;
  padding:0 12px 0 34px;
  border:1px solid rgba(255,255,255,.22);
  border-radius:var(--r-ctl);
  background:rgba(255,255,255,.10);
  color:#fff;
  font:inherit;font-size:13px;
}
.searchbox input::placeholder{color:rgba(255,255,255,.65)}
.searchbox input:focus{background:rgba(255,255,255,.18);border-color:rgba(255,255,255,.45);outline:none}

.icon-btn{
  position:relative;
  width:36px;height:36px;
  display:flex;align-items:center;justify-content:center;
  border:0;border-radius:var(--r-ctl);
  background:transparent;color:#fff;cursor:pointer;
}
.icon-btn:hover{background:rgba(255,255,255,.14)}
.dot{
  position:absolute;top:6px;right:6px;
  min-width:16px;height:16px;padding:0 4px;
  border-radius:8px;
  background:#E4573D;color:#fff;
  font-size:10px;font-weight:600;line-height:16px;text-align:center;
}

/* user menu */
.usermenu{position:relative}
.usermenu-btn{
  display:flex;align-items:center;gap:var(--s2);
  height:36px;padding:0 8px 0 4px;
  border:0;border-radius:var(--r-ctl);
  background:transparent;color:#fff;cursor:pointer;font:inherit;
}
.usermenu-btn:hover{background:rgba(255,255,255,.14)}
.avatar{
  width:28px;height:28px;flex:none;border-radius:50%;
  background:rgba(255,255,255,.22);
  display:flex;align-items:center;justify-content:center;
  font-size:11px;font-weight:600;letter-spacing:.02em;
}
.usermenu-btn .icon{width:15px;height:15px}
.menu{
  position:absolute;top:calc(100% + 6px);right:0;
  min-width:184px;padding:var(--s1);
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--r-ctl);
  box-shadow:var(--shadow-lift);
  z-index:40;
}
.menu[hidden]{display:none}
.menu-head{padding:8px 10px 10px;border-bottom:1px solid var(--line);margin-bottom:var(--s1)}
.menu-head strong{display:block;font-size:13px;font-weight:600;color:var(--text)}
.menu-head span{font-size:12px;color:var(--text-3)}
.menu button{
  width:100%;display:flex;align-items:center;gap:10px;
  padding:8px 10px;border:0;border-radius:6px;
  background:transparent;color:var(--text);
  font:inherit;font-size:13px;text-align:left;cursor:pointer;
}
.menu button:hover{background:var(--grey-tint)}
.menu button.danger{color:var(--red)}
.menu button.danger:hover{background:var(--red-tint)}
.menu .icon{width:17px;height:17px}

/* ============================================================
   SIDEBAR  (persistent side nav for role-dashboard pages, an
   alternative page shell to the top .appbar above — see
   .shell-with-sidebar for the layout wrapper that pairs with it)
   ============================================================ */
.shell-with-sidebar{display:flex;min-height:100vh}
.shell-content{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;min-height:100vh}

.sidebar{
  flex:0 0 250px;
  position:sticky;top:0;height:100vh;
  display:flex;flex-direction:column;
  background:linear-gradient(180deg,var(--header-from),var(--header-to));
  color:#fff;
}
.sidebar-brand{
  padding:var(--s5) var(--s4);
  border-bottom:1px solid rgba(255,255,255,.14);
  display:flex;flex-direction:column;align-items:center;text-align:center;
}
.sidebar-brand img{height:40px;width:auto;object-fit:contain;border-radius:6px;margin-bottom:var(--s2)}
.sidebar-brand h2{font-size:16px;font-weight:600;color:#fff}
.sidebar-brand p{margin:2px 0 0;font-size:12px;color:rgba(255,255,255,.6)}

.sidebar-nav{flex:1;overflow-y:auto;padding:var(--s3) 0;display:flex;flex-direction:column}
.sidebar-nav-item{
  display:flex;align-items:center;gap:var(--s3);
  padding:11px var(--s5);
  color:rgba(255,255,255,.72);
  font-size:13.5px;font-weight:500;
  border-left:3px solid transparent;
  transition:background .15s ease,color .15s ease,border-color .15s ease;
}
.sidebar-nav-item .icon{width:18px;height:18px;color:inherit}
.sidebar-nav-item:hover{background:rgba(255,255,255,.08);color:#fff}
.sidebar-nav-item.is-active{background:rgba(255,255,255,.12);color:#fff;border-left-color:var(--accent)}

.sidebar-foot{padding:var(--s4) var(--s5);border-top:1px solid rgba(255,255,255,.14)}
.sidebar-logout{
  width:100%;display:inline-flex;align-items:center;justify-content:center;gap:7px;
  height:38px;border:0;border-radius:var(--r-ctl);
  background:var(--red);color:#fff;font:inherit;font-size:13px;font-weight:600;cursor:pointer;
}
.sidebar-logout:hover{opacity:.88}
.sidebar-logout .icon{width:16px;height:16px}

/* Mobile hamburger toggle + backdrop, injected by layout.js rather than
   living in components/sidebar.html itself -- they must stay reachable
   even while the sidebar is off-canvas. Hidden entirely above the
   collapse breakpoint (see RESPONSIVE below), so none of this affects
   the desktop layout. */
.sidebar-toggle{
  display:none;
  position:fixed;top:var(--s4);left:var(--s4);z-index:80;
  width:40px;height:40px;align-items:center;justify-content:center;
  border:0;border-radius:var(--r-ctl);
  background:var(--header-from);color:#fff;cursor:pointer;box-shadow:var(--shadow-lift);
}
.sidebar-toggle .icon{width:20px;height:20px}
.sidebar-backdrop{
  display:none;position:fixed;inset:0;background:rgba(15,33,48,.55);z-index:65;
}

/* ============================================================
   PAGEBAR  (per-page top bar for sidebar-layout pages -- pairs with
   .shell-content, the counterpart to .appbar for header-layout pages.
   Title/subtitle are page-authored; .icon-btn/.usermenu/.menu are the
   exact same classes and JS (wireUserMenu/fillUser, generalized to
   the .usermenu scope) as .appbar uses, just recoloured here for a
   light background instead of the dark header gradient. )
   ============================================================ */
.pagebar{
  display:flex;align-items:center;justify-content:space-between;gap:var(--s4);
  padding:var(--s5) var(--s6);
  background:var(--card);
  border-bottom:1px solid var(--line);
}
.pagebar h1{font-size:20px;font-weight:600;letter-spacing:-.01em}
.pagebar-subtitle{margin:2px 0 0;font-size:13px;color:var(--text-3)}
.pagebar-tools{display:flex;align-items:center;gap:var(--s2)}

.pagebar .icon-btn{color:var(--text-2)}
.pagebar .icon-btn:hover{background:var(--grey-tint)}
.pagebar .usermenu-btn{color:var(--text)}
.pagebar .usermenu-btn:hover{background:var(--grey-tint)}
.pagebar .avatar{background:var(--accent-tint);color:var(--accent)}

/* ============================================================
   BAR CHART  (simple CSS bar chart, e.g. counts by category)
   ============================================================ */
.bar-chart{display:flex;align-items:flex-end;gap:var(--s5);flex-wrap:wrap;height:120px;padding:0 var(--s2)}
.bar-chart-col{display:flex;flex-direction:column;align-items:center;gap:6px}
.bar-chart-count{font-size:12px;color:var(--text-2)}
.bar-chart-bar{width:34px;background:var(--accent);border-radius:4px 4px 0 0;transition:height .3s ease}
.bar-chart-label{font-size:12px;color:var(--text-2)}

/* Horizontal label+percentage breakdown list, e.g. it-sysadmin.html's
   Analytics tab "By Status/Priority/Category" -- a different shape from
   .bar-chart above (vertical columns), so a separate small class rather
   than a reuse. */
.breakdown-row{margin-bottom:var(--s3)}
.breakdown-row:last-child{margin-bottom:0}
.breakdown-row-top{display:flex;justify-content:space-between;font-size:12.5px;color:var(--text-2);margin-bottom:4px}
.breakdown-track{height:6px;background:var(--grey-tint);border-radius:4px;overflow:hidden}
.breakdown-fill{height:100%;background:var(--accent);border-radius:4px}

/* ============================================================
   NOTIFICATION LIST  (dot-marked rows with an unread state,
   e.g. superadmin-notification.html's activity feed)
   ============================================================ */
.notif-row{display:flex;gap:var(--s3);align-items:flex-start;padding:14px var(--s4);border-bottom:1px solid var(--line)}
.notif-row:last-child{border-bottom:none}
.notif-dot{width:8px;height:8px;border-radius:50%;margin-top:5px;flex:none;background:transparent}
.notif-row.is-unread .notif-dot{background:var(--accent)}
.notif-body{flex:1;min-width:0}
.notif-message{margin:0;font-size:13.5px;color:var(--text-2)}
.notif-row.is-unread .notif-message{color:var(--text);font-weight:500}
.notif-time{margin:2px 0 0;font-size:12px;color:var(--text-3)}

/* ============================================================
   PAGE HEAD
   ============================================================ */
main{padding:var(--s6) 0 var(--s6)}
.pagehead{display:flex;align-items:center;gap:var(--s4);flex-wrap:wrap;margin-bottom:var(--s5)}
.pagehead h1{margin:0;font-size:20px;font-weight:600;letter-spacing:-.01em}
.pagehead p{margin:2px 0 0;font-size:13px;color:var(--text-3)}

.crumb{display:flex;align-items:center;gap:7px;color:var(--text-3);font-size:12px;margin-bottom:var(--s2)}
.crumb a{color:var(--text-2);font-weight:500}
.crumb a:hover{color:var(--accent)}

/* Stacked variant for form-heavy detail pages: breadcrumb / heading / description as
   three separate block rows, instead of the base .pagehead's single flex row. */
.pagehead.pagehead-stack{display:block}
.pagehead-stack h1{font-size:clamp(26px,3.4vw,34px)}
.pagehead-stack p{margin:var(--s2) 0 0;max-width:640px;color:var(--text-2);font-size:13px}

.btn{
  display:inline-flex;align-items:center;gap:7px;
  height:38px;padding:0 16px;
  border:1px solid transparent;border-radius:var(--r-ctl);
  font:inherit;font-size:13px;font-weight:600;
  cursor:pointer;white-space:nowrap;
  transition:background .15s ease,border-color .15s ease;
}
.btn .icon{width:17px;height:17px}
.spinner{
  width:14px;height:14px;flex:none;border-radius:50%;
  border:2px solid currentColor;border-right-color:transparent;
  opacity:.85;
  animation:spin .6s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}
.btn-primary{background:var(--accent);color:#fff}
.btn-primary:hover{background:#186BA3}
.btn-ghost{background:var(--card);color:var(--text);border-color:var(--line-strong)}
.btn-ghost:hover{border-color:var(--text-3)}
/* Solid destructive-action button, e.g. the confirm button in a delete
   dialog -- deliberately not .btn-primary, so a modal's own destructive
   action never reads as a second competing primary CTA on the page. */
.btn-danger{background:var(--red);color:#fff}
.btn-danger:hover{opacity:.88}
.btn-sm{height:32px;padding:0 12px;font-size:12px}
.btn:disabled{opacity:.6;cursor:not-allowed}
.pagehead .btn{margin-left:auto}

/* ============================================================
   KPI ROW
   ============================================================ */
.kpis{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:var(--s3);
  margin-bottom:var(--s5);
}
.kpi{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--r-card);
  padding:var(--s4);
  box-shadow:var(--shadow);
  border-left:3px solid var(--line-strong);
}
.kpi-label{font-size:12px;font-weight:500;color:var(--text-2);letter-spacing:.01em}
.kpi-value{font-size:26px;font-weight:600;letter-spacing:-.02em;margin-top:2px}
.kpi.is-pending{border-left-color:var(--amber)}
.kpi.is-pending .kpi-label{color:var(--amber)}
.kpi.is-progress{border-left-color:var(--accent)}
.kpi.is-progress .kpi-label{color:var(--accent)}
.kpi.is-done{border-left-color:var(--green)}
.kpi.is-done .kpi-label{color:var(--green)}
.kpi.is-violet{border-left-color:var(--violet)}
.kpi.is-violet .kpi-label{color:var(--violet)}
.kpi.is-rejected{border-left-color:var(--red)}
.kpi.is-rejected .kpi-label{color:var(--red)}

/* Bare responsive grid layout (no card styling of its own -- put .panel or
   .form-card items inside it), for any grid of cards that isn't .kpis or
   .services specifically. */
.card-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:var(--s5)}

/* Fixed-width sidebar column + fluid content column (e.g. a picker list next
   to its detail settings) -- narrower and more rigid than .split-view's
   1.55:1 form+list ratio, so a separate class rather than a reuse. Collapses
   to one column at 900px, see RESPONSIVE below. */
.picker-layout{display:grid;grid-template-columns:260px 1fr;gap:var(--s5);align-items:start}

/* ============================================================
   SERVICE CARDS
   ============================================================ */
.section-title{font-size:15px;font-weight:600;margin:0 0 var(--s3)}
.services{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(280px,1fr));
  gap:var(--s3);
  margin-bottom:var(--s6);
}
.service{
  display:block;text-align:left;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--r-card);
  padding:var(--s4);
  box-shadow:var(--shadow);
  cursor:pointer;
  font:inherit;color:inherit;
  transition:transform .15s ease,border-color .15s ease,box-shadow .15s ease;
}
.service:hover{transform:translateY(-2px);border-color:var(--line-strong);box-shadow:var(--shadow-lift)}
.service:disabled{cursor:not-allowed;opacity:.6}
.service:disabled:hover{transform:none;border-color:var(--line);box-shadow:var(--shadow)}
.service-tile{
  width:40px;height:40px;
  border-radius:10px;
  display:flex;align-items:center;justify-content:center;
  margin-bottom:var(--s3);
}
.service-tile .icon{width:21px;height:21px}
.service-name{font-size:14px;font-weight:600}
.service-meta{font-size:12px;color:var(--text-3);margin-top:1px;display:flex;align-items:center;gap:4px}
.service-meta.has-open{color:var(--amber);font-weight:500}
.service-meta.is-restricted{color:var(--text-3)}
.service-meta .icon{width:13px;height:13px}

.t-accent{background:var(--accent-tint);color:var(--accent)}
.t-amber {background:var(--amber-tint); color:var(--amber)}
.t-green {background:var(--green-tint); color:var(--green)}
.t-violet{background:var(--violet-tint);color:var(--violet)}
.t-grey  {background:var(--grey-tint);  color:var(--grey)}

/* ============================================================
   REQUESTS TABLE
   ============================================================ */
.panel{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--r-card);
  box-shadow:var(--shadow);
  overflow:hidden;
}
.panel-head{
  display:flex;align-items:center;gap:var(--s3);
  padding:var(--s3) var(--s4);
  border-bottom:1px solid var(--line);
}
.panel-head h2{margin:0;font-size:15px;font-weight:600}
/* Not scoped to .panel-head -- also used standalone as a plain text-link
   button wherever a bordered/filled .btn would be too heavy (e.g. a
   settings row's "Change password"). */
.viewall-btn{
  margin-left:auto;font-size:13px;font-weight:500;color:var(--accent);
  background:none;border:0;padding:0;font-family:inherit;cursor:pointer;
}
.viewall-btn:hover{text-decoration:underline}
.viewall-btn[hidden]{display:none}
/* Padded content area for a .panel that isn't a table -- .table-scroll/table
   below handle that case directly without needing this wrapper. */
.panel-body{padding:var(--s5)}

.table-scroll{max-height:420px;overflow-y:auto}
table{width:100%;border-collapse:collapse}
thead th{
  padding:10px var(--s4);
  font-size:11px;font-weight:600;letter-spacing:.06em;
  color:var(--text-3);text-align:left;text-transform:uppercase;
  background:#FAFBFC;
  border-bottom:1px solid var(--line);
  position:sticky;top:0;z-index:1;
}
tbody td{padding:12px var(--s4);border-bottom:1px solid var(--line);vertical-align:middle}
tbody tr:last-child td{border-bottom:0}
tbody tr:hover{background:#FAFBFC}
.col-action{text-align:right}
.id-link{color:var(--accent);font-weight:500;text-decoration:none;font-variant-numeric:tabular-nums}
.id-link:hover{text-decoration:underline}
.muted{color:var(--text-2)}
/* Bare monospace utility for an ID cell inline in a table -- every other
   --font-mono use in this file is baked into a specific component (e.g.
   .request-id), this is the one for a plain <td> that needs nothing else. */
.mono{font-family:var(--font-mono)}

.badge{
  display:inline-block;
  padding:3px 10px;border-radius:20px;
  font-size:11px;font-weight:600;white-space:nowrap;
}
.b-pending {background:var(--amber-tint); color:var(--amber)}
.b-progress{background:var(--accent-tint);color:var(--accent)}
.b-done    {background:var(--green-tint); color:var(--green)}
.b-rejected{background:var(--red-tint);   color:var(--red)}
.b-open      {background:var(--accent-tint);color:var(--accent)}
.b-inprogress{background:var(--amber-tint); color:var(--amber)}
.b-onhold    {background:var(--violet-tint);color:var(--violet)}
.b-resolved  {background:var(--green-tint); color:var(--green)}
/* Neutral/inactive state -- e.g. a deactivated or hidden field. The third
   page to need a status colour the set didn't have (from
   superadmin-form-fields.html). */
.b-neutral   {background:var(--grey-tint);  color:var(--grey)}

.link-btn{
  border:1px solid var(--line-strong);border-radius:6px;
  background:transparent;color:var(--text);
  padding:4px 12px;font:inherit;font-size:12px;font-weight:500;cursor:pointer;
}
.link-btn:hover{border-color:var(--accent);color:var(--accent)}

/* Small square icon-only action button for a list/table row (edit, delete,
   remove) -- .is-danger for anything destructive, plain otherwise. */
.row-icon-btn{
  width:32px;height:32px;flex:none;border:0;border-radius:var(--r-ctl);
  display:flex;align-items:center;justify-content:center;
  background:transparent;color:var(--text-3);cursor:pointer;transition:background .15s ease,color .15s ease;
}
.row-icon-btn:hover{background:var(--accent-tint);color:var(--accent)}
.row-icon-btn.is-danger{background:var(--red-tint);color:var(--red)}
.row-icon-btn.is-danger:hover{background:var(--red);color:#fff}
.row-icon-btn .icon{width:16px;height:16px}
.row-icon-btn:disabled{opacity:.3;cursor:not-allowed;background:transparent;color:var(--text-3)}
/* Smaller variant, e.g. a stacked pair of reorder buttons. */
.row-icon-btn.is-sm{width:26px;height:26px}
.row-icon-btn.is-sm .icon{width:14px;height:14px}

/* empty state */
.empty{padding:var(--s6) var(--s4);text-align:center}
.empty .icon{width:36px;height:36px;color:var(--text-3);stroke-width:1.4}
.empty h3{margin:var(--s3) 0 2px;font-size:14px;font-weight:600}
.empty p{margin:0 0 var(--s4);font-size:13px;color:var(--text-3)}

/* skeleton */
.sk{background:#EDF1F5;border-radius:6px;display:block;animation:pulse 1.4s ease-in-out infinite}
.sk-line{height:12px;margin:6px 0}
.sk-kpi{width:40px}
.sk-id{width:110px}
.sk-cat{width:90px}
.sk-date{width:70px}
.sk-badge{width:60px;height:18px;border-radius:20px}
.sk-btn{width:56px;margin-left:auto}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.5}}

/* ============================================================
   FORM CARD  (request/ticket detail forms + a companion list panel)
   ============================================================ */
.split-view{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(340px,1fr);gap:var(--s5);align-items:start}
.sticky-panel{position:sticky;top:var(--s5)}

.form-card{background:var(--card);border:1px solid var(--line);border-radius:var(--r-card);box-shadow:var(--shadow)}
.form-card-head{padding:var(--s4) var(--s5);border-bottom:1px solid var(--line);display:flex;align-items:center;gap:var(--s3)}
.form-card-head h2{margin:0;font-size:16px;font-weight:600}
.form-card-head .hint{margin-left:auto;font-size:12px;color:var(--text-3)}
.form-card-body{padding:var(--s5)}
.form-card-foot{
  position:sticky;bottom:0;z-index:5;
  display:flex;justify-content:flex-end;gap:var(--s3);
  padding:var(--s4) var(--s5);background:var(--card);
  border-top:1px solid var(--line);
  border-radius:0 0 var(--r-card) var(--r-card);
}

/* ============================================================
   FORM FIELDS
   ============================================================ */
.field-label{display:block;font-size:13px;font-weight:600;color:var(--text);margin-bottom:var(--s2)}
.required-mark{color:var(--red)}

.field{
  flex:1 1 260px;width:100%;min-width:0;height:46px;padding:0 var(--s4);
  border:1px solid var(--line);border-radius:var(--r-ctl);
  background:var(--card);color:var(--text);font-size:15px;font-family:inherit;
}
.field::placeholder{color:var(--text-3)}
.field:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-tint)}
select.field{cursor:pointer}
textarea.field{height:auto;min-height:110px;padding:var(--s3) var(--s4);resize:vertical}
/* :read-only matches <select> too -- per spec, only text-editable controls have a
   read-write state, so an unscoped rule here tints every dropdown, not just a
   genuinely read-only field. */
input.field:read-only,
textarea.field:read-only{background:var(--card);color:var(--text-2);border-color:var(--line);cursor:default}
input.field:read-only:focus,
textarea.field:read-only:focus{outline:none;box-shadow:none;border-color:var(--line)}
/* Chrome/Edge autofill paints its own background via an internal box-shadow that
   the background property can't override -- match it to --card so a
   previously-remembered value never shows the native autofill tint. */
input.field:-webkit-autofill,
input.field:-webkit-autofill:focus{
  -webkit-text-fill-color:var(--text-2);
  -webkit-box-shadow:0 0 0 1000px var(--card) inset;
  box-shadow:0 0 0 1000px var(--card) inset;
  transition:background-color 5000s ease-in-out 0s;
}
.field:disabled{background:var(--grey-tint);color:var(--text-2);cursor:not-allowed;opacity:1}

/* Invalid state, applied by a form's own JS validation (see .form-error-summary
   below) rather than the browser's native constraint-validation styling. */
.field.is-invalid{border-color:var(--red)}
.field.is-invalid:focus{border-color:var(--red);box-shadow:0 0 0 3px var(--red-tint)}
/* input.field:read-only already sets its own border-color at higher specificity
   than .field.is-invalid alone -- restate it here so a readonly field can still
   show invalid (e.g. a field the page auto-fills but failed to populate). */
input.field:read-only.is-invalid{border-color:var(--red)}
input.field:read-only.is-invalid:focus{outline:none;border-color:var(--red);box-shadow:0 0 0 3px var(--red-tint)}

.field-help{margin:var(--s2) 0 0;font-size:12.5px;color:var(--text-3)}
.field-error{margin:var(--s2) 0 0;font-size:12px;color:var(--red);font-weight:500}
.form-error-summary{
  margin:0 0 var(--s3);padding:10px var(--s4);
  background:var(--red-tint);color:var(--red);border-radius:var(--r-ctl);
  font-size:13px;font-weight:600;
}

.filedrop{
  margin-top:4px;border:1.5px dashed var(--line-strong);border-radius:var(--r-ctl);
  padding:var(--s4);text-align:center;background:var(--grey-tint);
}
.filedrop input[type="file"]{font-size:13px;color:var(--text-2)}
.filedrop .field-help{white-space:nowrap}

.toggle-row{display:flex;align-items:center;gap:9px;font-size:14px;color:var(--text);cursor:pointer}
.toggle-row input{width:17px;height:17px;accent-color:var(--accent);cursor:pointer}

/* Pill-style on/off switch, e.g. a settings preference -- a real checkbox
   under the hood (keyboard + screen-reader accessible), not a div driven
   by a click handler. */
.switch{position:relative;display:inline-block;width:42px;height:24px;flex:none}
.switch input{position:absolute;opacity:0;width:0;height:0}
.switch-track{position:absolute;inset:0;cursor:pointer;background:var(--line-strong);border-radius:999px;transition:background .15s ease}
.switch-track::before{content:'';position:absolute;height:18px;width:18px;left:3px;bottom:3px;background:var(--card);border-radius:50%;transition:transform .15s ease}
.switch input:checked + .switch-track{background:var(--green)}
.switch input:checked + .switch-track::before{transform:translateX(18px)}
.switch input:focus-visible + .switch-track{outline:2px solid var(--accent);outline-offset:2px}

.ref-pill{
  display:inline-block;font-family:var(--font-mono);font-size:12.5px;color:var(--text-2);
  background:var(--grey-tint);border:1px solid var(--line);border-radius:100px;
  padding:6px 14px;
}

/* ============================================================
   SUMMARY BOX  (read-only auto-filled preview grid)
   ============================================================ */
.summary-box{
  display:grid;grid-template-columns:repeat(4,1fr);gap:var(--s4);
  background:var(--grey-tint);border:1px solid var(--line);border-radius:var(--r-ctl);
  padding:var(--s4) var(--s5);
}
.summary-cell p:first-child{margin:0;font-size:12.5px;color:var(--text-3)}
.summary-cell p:last-child{margin:4px 0 0;font-weight:600;color:var(--text)}

/* ============================================================
   NOTICE
   ============================================================ */
.notice{display:flex;gap:var(--s3);align-items:flex-start;padding:14px var(--s4);border-radius:var(--r-ctl);margin-bottom:var(--s5);font-size:13.5px}
.notice svg{flex:none;margin-top:1px}
.notice-success{background:var(--green-tint);color:var(--green);border:1px solid var(--line)}
.notice-error{background:var(--red-tint);color:var(--red);border:1px solid var(--line)}
.notice b{display:block;margin-bottom:2px;color:inherit}

/* ============================================================
   FILTER PILLS  (segmented tab-style filters above a list)
   ============================================================ */
.filter-pills{display:flex;gap:6px;flex-wrap:wrap;padding:var(--s3) var(--s4);border-bottom:1px solid var(--line);overflow-x:auto}
.filter-pill{
  border:1px solid var(--line-strong);background:var(--card);border-radius:100px;
  padding:7px 13px;cursor:pointer;white-space:nowrap;
  font-size:12.5px;font-weight:600;color:var(--text-2);
  transition:background .15s ease,border-color .15s ease,color .15s ease;
}
.filter-pill:hover{border-color:var(--accent);color:var(--accent)}
.filter-pill[aria-selected="true"]{background:var(--accent);border-color:var(--accent);color:#fff}
.filter-pill .count{font-family:var(--font-mono);font-size:11px;margin-left:5px;color:inherit;opacity:.75}
.filter-pill[aria-selected="true"] .count{opacity:.9}

.filterbar{padding:var(--s3) var(--s4);border-bottom:1px solid var(--line);display:flex;gap:var(--s2)}
.filterbar .field{height:40px;font-size:14px}

/* Segmented switcher between distinct page sections (e.g. Departments /
   Projects / Duty Stations, each with its own data source and layout) --
   distinct from .filter-pills above, which filters within a single list
   rather than swapping which content is shown (from
   superadmin-department.html). */
.section-tabs{display:inline-flex;gap:4px;padding:4px;background:var(--grey-tint);border-radius:var(--r-ctl);margin-bottom:var(--s5)}
.section-tab{border:0;background:transparent;border-radius:6px;padding:8px 16px;font:inherit;font-size:13.5px;font-weight:600;color:var(--text-2);cursor:pointer;transition:background .15s ease,color .15s ease}
.section-tab.is-active{background:var(--card);color:var(--text);box-shadow:var(--shadow)}

/* Vertical list-item picker with a selected state, e.g. "choose a form to
   edit" -- distinct from .filter-pill, which is a horizontal pill button,
   and from .sidebar-nav-item, which is dark-background-specific. */
.picker-item{
  display:flex;align-items:center;justify-content:space-between;gap:var(--s2);
  padding:10px 14px;border-radius:var(--r-ctl);cursor:pointer;
  font-size:13.5px;color:var(--text-2);
  transition:background .15s ease,color .15s ease;
}
.picker-item:hover{background:var(--grey-tint)}
.picker-item.is-active{background:var(--accent);color:#fff}
.picker-item.is-active .picker-count{color:#fff}
.picker-count{font-size:11px;color:var(--text-3)}

/* ============================================================
   REQUEST LIST / REQUEST CARDS
   ============================================================ */
.request-list{padding:var(--s3);display:grid;gap:var(--s3);max-height:calc(100vh - 260px);overflow:auto}
.list-empty{padding:var(--s6) var(--s4);text-align:center;color:var(--text-3);font-size:13.5px}

.request-card{
  border:1px solid var(--line);border-radius:var(--r-ctl);padding:14px 15px;
  background:var(--card);transition:border-color .15s ease,transform .15s ease,box-shadow .15s ease;
  cursor:pointer;
}
.request-card:hover{border-color:var(--line-strong);transform:translateY(-1px);box-shadow:var(--shadow-lift)}
.request-card-top{display:flex;align-items:center;gap:var(--s2)}
.request-card-top .badge{margin-left:auto;letter-spacing:.02em}
.request-id{font-family:var(--font-mono);font-size:13.5px;font-weight:600;color:var(--accent)}
.request-card-title{margin-top:var(--s2);font-weight:600;color:var(--text);font-size:14.5px}
.id-tag{
  font-family:var(--font-mono);font-weight:500;font-size:12px;color:var(--text-3);
  background:var(--grey-tint);border:1px solid var(--line);border-radius:5px;
  padding:1px 6px;margin-left:6px;
}
.request-card-route{display:flex;align-items:center;gap:var(--s2);margin-top:6px;font-size:13.5px;color:var(--text-2)}
.request-card-foot{display:flex;align-items:center;gap:var(--s2);margin-top:var(--s3);padding-top:11px;border-top:1px solid var(--line)}
.meta{font-size:12px;color:var(--text-3)}

/* Priority gets its own scale, deliberately distinct from the status badge's
   colours above, so the two badges never read as the same signal. */
.priority-badge{font-size:11px;font-weight:600;padding:3px 9px;border-radius:100px;letter-spacing:.02em}
.priority-badge.p-low{background:var(--grey-tint);color:var(--text-3)}
.priority-badge.p-medium{background:var(--amber-tint);color:var(--amber)}
.priority-badge.p-high{background:var(--red-tint);color:var(--red)}
.priority-badge.p-critical{background:var(--red);color:#fff}

.chat-btn{
  position:relative;margin-left:auto;border:1px solid var(--line-strong);background:var(--card);
  color:var(--violet);font-size:12px;font-weight:600;padding:5px 11px;border-radius:var(--r-ctl);cursor:pointer;
}
.chat-btn:hover{background:var(--violet-tint)}
.chat-btn.is-unread::after{
  content:'';position:absolute;top:-3px;right:-3px;width:8px;height:8px;border-radius:50%;
  background:var(--red);border:2px solid var(--card);
}

/* ============================================================
   ITEM LIST  (add-remove cart of line items on a request form)
   ============================================================ */
.item-list{margin-top:var(--s3);display:grid;gap:var(--s2)}
.item-list-empty{padding:14px;text-align:center;font-size:13px;color:var(--text-3);border:1px dashed var(--line-strong);border-radius:var(--r-ctl);background:var(--grey-tint)}
.item-row{
  display:flex;align-items:center;gap:var(--s3);padding:10px 14px;
  border:1px solid var(--line);border-radius:var(--r-ctl);background:var(--grey-tint);
}
.item-row-cat{font-weight:600;color:var(--text);font-size:13.5px}
.item-row-sub{color:var(--text-2);font-size:13.5px}
.item-row-qty{margin-left:auto;font-family:var(--font-mono);font-size:12.5px;color:var(--text-2);background:var(--card);border:1px solid var(--line);border-radius:100px;padding:3px 11px;white-space:nowrap}
.item-row-remove{border:0;background:none;color:var(--red);cursor:pointer;font-size:19px;line-height:1;padding:2px 4px}
.item-row-remove:hover{opacity:.7}

/* ============================================================
   APPROVAL CHAIN  (multi-stage approval progress tracker)
   ============================================================ */
.approval-chain{display:grid;grid-template-columns:repeat(2,1fr);gap:6px;margin-top:var(--s3)}
.approval-stage{position:relative;padding-top:16px}
.approval-stage .bar{position:absolute;top:0;left:0;right:0;height:5px;border-radius:100px;background:var(--line)}
.approval-stage .name{font-size:11px;font-weight:600;color:var(--text-3);letter-spacing:.02em;line-height:1.25}
.approval-stage .state{font-size:10.5px;color:var(--text-3);text-transform:uppercase;letter-spacing:.07em}
.approval-stage.is-pending .bar{background:var(--amber)}
.approval-stage.is-pending .state{color:var(--amber)}
.approval-stage.is-approved .bar{background:var(--green)}
.approval-stage.is-approved .name{color:var(--text)}
.approval-stage.is-approved .state{color:var(--green)}
.approval-stage.is-rejected .bar{background:var(--red)}
.approval-stage.is-rejected .state{color:var(--red)}

/* Spacing when two form-cards stack in one column (e.g. a form card followed
   by an informational card), mirroring the old .card + .card rule. */
.form-card + .form-card{margin-top:var(--s5)}

/* ============================================================
   RECENT-ITEM CHIPS  (e.g. recent searches)
   ============================================================ */
.recent{display:flex;align-items:center;gap:var(--s2);flex-wrap:wrap;margin-top:var(--s4);padding-top:var(--s4);border-top:1px dashed var(--line)}
.recent-label{font-size:12px;color:var(--text-3);text-transform:uppercase;letter-spacing:.08em;font-weight:600}
.chip{
  font-family:var(--font-mono);font-size:12px;padding:5px 10px;border-radius:100px;
  border:1px solid var(--line-strong);background:var(--grey-tint);color:var(--text-2);cursor:pointer;
}
.chip:hover{border-color:var(--accent);color:var(--accent);background:var(--accent-tint)}

/* ============================================================
   TAG CHIP  (a display tag with an inline remove control, e.g. a
   sub-category under a ticket category -- distinct from .chip, which
   is monospace and click-to-select, not display-plus-remove)
   ============================================================ */
.tag-chip{display:inline-flex;align-items:center;gap:6px;background:var(--grey-tint);color:var(--text-2);padding:4px 10px;border-radius:100px;font-size:12px;font-weight:500}
.tag-chip-remove{border:0;background:none;color:var(--text-3);cursor:pointer;line-height:1;padding:0;font-size:14px}
.tag-chip-remove:hover{color:var(--red)}
.tag-chip-add{display:inline-flex;align-items:center;gap:6px;color:var(--accent);font-size:12px;font-weight:600;padding:4px 10px;border-radius:100px;border:1px dashed var(--accent);background:none;cursor:pointer}
.tag-chip-add:hover{background:var(--accent-tint)}
.tag-chip-add .icon{width:12px;height:12px}

/* ============================================================
   RESULT LIST  (lookup/search results, e.g. an employee search)
   ============================================================ */
.result-list{margin-top:var(--s3);display:grid;gap:var(--s2)}
.result-item{
  width:100%;text-align:left;border:1px solid var(--line);border-radius:var(--r-ctl);
  padding:12px var(--s4);background:var(--card);cursor:pointer;
  transition:border-color .15s ease,background .15s ease;
}
.result-item:hover{border-color:var(--accent);background:var(--accent-tint)}
.result-item .rname{font-weight:600;color:var(--text);font-size:14px}
.result-item .rmeta{font-size:12px;color:var(--text-3);margin-top:2px;font-family:var(--font-mono)}

/* ============================================================
   PROFILE SUMMARY  (a loaded record's key fields, read-only)
   ============================================================ */
.profile-wrap{margin-top:var(--s5);padding:var(--s5);border:1px solid var(--line);border-radius:var(--r-card);background:var(--grey-tint)}
.profile-top{display:flex;justify-content:space-between;align-items:flex-start;gap:var(--s3);margin-bottom:var(--s4)}
.profile-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:var(--s4) var(--s5)}
.profile-item span{display:block}
.profile-item .plabel{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--text-3);margin-bottom:3px}
.profile-item .pvalue{font-size:14px;font-weight:600;color:var(--text)}

/* ============================================================
   LEGEND  (numbered explainer list, e.g. "how an approval works")
   ============================================================ */
.legend{display:grid;gap:var(--s4)}
.legend-item{display:flex;gap:var(--s3);align-items:flex-start}
.legend-num{
  flex:none;width:26px;height:26px;border-radius:8px;display:grid;place-items:center;
  font-family:var(--font-mono);font-size:12px;font-weight:600;
  background:var(--accent-tint);color:var(--accent);
}
.legend-item h4{margin:0 0 2px;font-size:13.5px;color:var(--text);font-weight:600}
.legend-item p{margin:0;font-size:13px;color:var(--text-3)}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay[hidden],.modal-ov[hidden]{display:none}
.modal-overlay{
  position:fixed;inset:0;background:rgba(15,33,48,.55);
  display:flex;align-items:center;justify-content:center;padding:var(--s5);z-index:100;
}
.modal-box{
  background:var(--card);border-radius:var(--r-card);box-shadow:var(--shadow);
  width:100%;max-width:1100px;max-height:95vh;overflow-y:auto;
}
.modal-box.chat{max-width:480px;height:80vh;max-height:80vh;display:flex;flex-direction:column;overflow:hidden}
.modal-box.narrow{max-width:560px;max-height:80vh}
.modal-head{
  display:flex;align-items:center;justify-content:space-between;gap:var(--s3);
  padding:var(--s4) var(--s5);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:30;background:var(--card);
}
.modal-head h3{margin:0;font-size:16px;font-weight:600}
.modal-subtitle{margin:2px 0 0;font-size:12.5px;color:var(--text-3)}
.modal-head-actions{display:flex;align-items:center;gap:var(--s4)}
.modal-action-btn{border:0;background:none;color:var(--text-3);font-size:13px;font-weight:600;cursor:pointer;padding:2px 4px}
.modal-action-btn:hover{color:var(--accent)}
.modal-close{border:0;background:none;font-size:22px;line-height:1;color:var(--text-3);cursor:pointer;padding:2px 6px}
.modal-close:hover{color:var(--text)}
.modal-body{padding:var(--s5)}
/* Action-button row for an edit/confirm modal (Cancel + Save, or Cancel +
   Delete) -- distinct from .modal-head-actions (Print/Save icons in the
   header of a read-only detail modal). Mirrors .form-card-foot's shape. */
.modal-foot{display:flex;justify-content:flex-end;gap:var(--s3);padding:var(--s4) var(--s5);border-top:1px solid var(--line)}
/* Centred icon badge for a confirm/warning dialog's lead icon. */
.confirm-icon{
  width:48px;height:48px;margin:0 auto var(--s4);border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  background:var(--grey-tint);color:var(--text-2);
}
.confirm-icon.is-danger{background:var(--red-tint);color:var(--red)}

.detail-row{display:flex;justify-content:space-between;gap:var(--s4);padding:9px 0;border-bottom:1px solid var(--line);font-size:13.5px}
.detail-row:last-child{border-bottom:none}
.detail-row span:first-child{color:var(--text-3)}
.detail-row span:last-child{color:var(--text);font-weight:600;text-align:right}
.detail-section-title{font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:var(--text-3);font-weight:600;margin:var(--s5) 0 var(--s2)}
.detail-section-title:first-child{margin-top:0}

/* Gradient identity band for a record-detail page inside a .panel (e.g.
   asset-view.html/assetmng-view.html) -- title+subtitle left, a .badge on
   the right. Sits flush against .panel's own rounded corners since .panel
   already clips with overflow:hidden, so this needs no radius of its own.
   .detail-photo is the record's photo/placeholder, used alongside it in
   .panel-body, not inside the gradient band itself. */
.detail-hero{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:var(--s3);background:linear-gradient(120deg,var(--header-from) 0%,var(--header-to) 100%);padding:var(--s5) var(--s6);color:#fff}
.detail-hero h2{margin:0;font-size:17px;font-weight:600}
.detail-hero p{margin:2px 0 0;font-size:13px;color:rgba(255,255,255,.75)}
.detail-photo{width:140px;height:140px;flex:none;border-radius:var(--r-ctl);display:flex;align-items:center;justify-content:center;background:var(--accent-tint);color:var(--accent);overflow:hidden}
.detail-photo img{width:100%;height:100%;object-fit:cover}
.detail-photo svg{width:40px;height:40px}

/* Small colour-coded card for a detail page's grouped fields (e.g. asset-view.
   html's Miscellaneous/Assignment/Description/Creation panels) -- a self-
   contained .panel-like shell (own background/border/shadow) rather than a
   modifier on .panel, since it's meant to sit inside a .card-grid alongside
   siblings of the same shape. Colour is set per instance via
   --accent-panel-color (a deliberately separate custom property from the
   global --accent, so it never bleeds into unrelated components nested
   inside the panel). */
.accent-panel{background:var(--card);border:1px solid var(--line);border-radius:var(--r-card);border-top:3px solid var(--accent-panel-color,var(--accent));box-shadow:var(--shadow);padding:var(--s5)}
.accent-panel-title{font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:var(--text-3);font-weight:600;margin:0 0 var(--s3)}

/* ============================================================
   CHAT
   ============================================================ */
.chat-body{flex:1;overflow-y:auto;padding:var(--s5);display:flex;flex-direction:column;gap:var(--s3);background:var(--grey-tint)}
.chat-input-row{display:flex;gap:var(--s2);padding:var(--s4);border-top:1px solid var(--line)}
.chat-input-row .field{height:42px}
.chat-bubble{max-width:75%;padding:9px 13px;border-radius:14px;font-size:13.5px;background:var(--card);border:1px solid var(--line);color:var(--text);display:flex;flex-direction:column;gap:2px}
.chat-bubble.mine{align-self:flex-end;background:var(--violet);color:#fff;border-color:var(--violet)}
.chat-bubble .sender{font-size:11.5px;font-weight:600;color:var(--violet)}
.chat-bubble .time{font-size:10.5px;color:var(--text-3)}
.chat-bubble.mine .time{color:rgba(255,255,255,.7)}

/* ============================================================
   HISTORY TIMELINE
   ============================================================ */
.history-entry{display:flex;gap:var(--s3);padding:10px 0;border-bottom:1px solid var(--line)}
.history-entry:last-child{border-bottom:none}
.history-dot{flex:none;width:8px;height:8px;border-radius:50%;background:var(--accent);margin-top:6px}
.h-label{margin:0;font-weight:600;color:var(--text);font-size:13.5px}
.h-details{margin:2px 0 0;font-size:12.5px;color:var(--text-2)}
.h-time{margin:2px 0 0;font-size:12px;color:var(--text-3)}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width:1040px){
  .split-view{grid-template-columns:1fr}
}
@media (max-width:900px){
  .container{padding-left:var(--s5);padding-right:var(--s5)}
  .services{grid-template-columns:repeat(2,minmax(0,1fr))}
  .kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .searchbox input{width:150px}
  .summary-box{grid-template-columns:repeat(2,1fr)}
  .picker-layout{grid-template-columns:1fr}

  /* Sidebar collapses off-canvas rather than disappearing outright --
     .sidebar-toggle (fixed, always reachable) slides it back in via
     .is-open, with a backdrop and focus trap wired in layout.js. */
  .sidebar{
    position:fixed;top:0;left:0;bottom:0;z-index:70;
    transform:translateX(-100%);
    transition:transform .2s ease;
    box-shadow:var(--shadow-lift);
  }
  .sidebar.is-open{transform:translateX(0)}
  .sidebar-toggle{display:flex}
  .sidebar-backdrop.is-open{display:block}
}
@media (max-width:600px){
  .container{padding-left:var(--s4);padding-right:var(--s4)}
  .services{grid-template-columns:1fr}
  .searchbox{display:none}
  .brand-name{display:none}
  .pagehead .btn{margin-left:0;width:100%;justify-content:center}
  .col-date{display:none}
  .summary-box{grid-template-columns:1fr}
}

@media (prefers-reduced-motion:reduce){
  *{animation:none!important;transition:none!important}
  .service:hover{transform:none}
  .request-card:hover{transform:none}
}

/* Full-page print (window.print(), e.g. asset-view.html/assetmng-view.html's
   Print button) -- hides chrome so only the current tab's content prints.
   Not used by the shared detail-modal print flow (viewModalExport.js),
   which renders into its own off-screen container instead. */
@media print{
  #app-sidebar,.pagebar,.no-print{display:none !important}
  body{background:#fff}
}

/* "New request" button feedback — brief glow on the category cards
   when the user is scrolled/pointed to the "Raise a request" section */
@keyframes cafm-services-flash {
  0%   { box-shadow: 0 0 0 0 var(--accent-tint); }
  40%  { box-shadow: 0 0 0 6px var(--accent-tint); }
  100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); }
}
.services.is-flash {
  border-radius: var(--r-card);
  animation: cafm-services-flash .9s ease;
}
@media (prefers-reduced-motion: reduce) {
  .services.is-flash { animation: none; }
}
