/* ============================================================================
   PLANT MANAGEMENT — component layer.
   Loaded after style.css (brand tokens) and app.css (base components), so
   everything here is expressed in the kit's variables and inherits the brand
   rule: white dominates, orange is used sparingly and with meaning.
   ============================================================================ */

/* Brand mark — the plant has no logo asset, so an icon tile stands in. */
.plant-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; background: var(--secondary-color); color: #fff;
  border-radius: var(--border-radius-sm); font-size: 1.15rem; flex: none;
}
.plant-mark.lg { width: 72px; height: 72px; font-size: 2rem; background: var(--primary-color); }
.nav-logo-text small {
  display: block; font-size: 0.7rem; font-weight: 500; color: var(--text-muted);
  letter-spacing: 0.6px; text-transform: uppercase;
}

/* Page header with actions pinned right */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 i { color: var(--primary-color); margin-right: 6px; }
.page-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Navigation dropdowns ----
   Matches the Proposal Automation portal: hover-opened menus that fade and
   slide in. Hover means only one can ever be open, so there is no JS state to
   manage and no two-menus-open bug.
   ---------------------------------------------------------------------- */
.nav-dropdown { position: relative; }
.nav-dropdown .dropdown-toggle {
  display: flex; align-items: center; gap: 0.5rem; cursor: pointer;
}
.nav-dropdown .dropdown-toggle i.fa-caret-down { font-size: 0.75rem; }
.dropdown-menu {
  position: absolute; top: 100%; left: 0; background: white; min-width: 200px;
  border-radius: var(--border-radius-sm); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: all 0.2s ease; list-style: none; padding: 0.5rem 0;
  margin: 0; z-index: 200;
}
.nav-dropdown:hover .dropdown-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.dropdown-menu li { padding: 0; }
.dropdown-menu li a {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem;
  color: var(--text-primary); text-decoration: none; font-size: 0.875rem;
  transition: all 0.15s ease;
}
.dropdown-menu li a:hover { background: var(--bg-secondary); color: var(--primary-color); }
.dropdown-menu li a i { width: 16px; text-align: center; color: var(--text-muted); }
.dropdown-menu li a:hover i { color: var(--primary-color); }

/* ---- User area (name / role / avatar / logout) ---- */
.nav-user { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.user-info {
  display: flex; flex-direction: column; align-items: flex-end;
  line-height: 1.3; margin-right: 0.5rem;
}
.user-name { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.user-role {
  font-size: 0.7rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.user-avatar {
  width: 40px; height: 40px; flex: none; border-radius: 50%;
  background: var(--gradient-secondary);          /* flat charcoal blue */
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 16px; text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(60, 81, 91, 0.3); border: 2px solid white;
  user-select: none;
}
.logout-btn {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: none; border-radius: 50%;
  background: rgba(239, 68, 68, 0.1); color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
  cursor: pointer; font-size: 0.95rem; padding: 0;
  transition: all 0.2s ease;
}
.logout-btn:hover {
  background: #ef4444; color: white; transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

form.inline { display: inline; }

/* ---- Role tags ---- */
.role-tag {
  display: inline-block; font-style: normal; font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px; padding: 2px 8px; border-radius: 999px;
}
.role-tag.admin { background: #fff0e6; color: var(--primary-darkest); }
.role-tag.manager { background: #e8f0f4; color: var(--info-color); }
.role-tag.viewer { background: var(--bg-secondary); color: var(--text-muted); }
.role-legend {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-light);
  display: grid; gap: 8px; font-size: 0.85rem; color: var(--text-muted);
}

/* ---- Month filter pills ---- */
.month-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.pill {
  display: inline-block; padding: 6px 14px; border-radius: 999px; font-size: 0.85rem;
  font-weight: 600; background: #fff; color: var(--text-secondary);
  border: 1.5px solid var(--border-color); text-decoration: none; transition: var(--transition-fast);
}
.pill:hover { border-color: var(--primary-color); color: var(--primary-color); }
.pill.active { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }

/* ---- Material tabs ---- */
.tab-row {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px;
  border-bottom: 2px solid var(--border-light);
}
.tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 11px 18px;
  font-size: 0.9rem; font-weight: 600; color: var(--text-muted); text-decoration: none;
  border-bottom: 3px solid transparent; margin-bottom: -2px; transition: var(--transition-fast);
}
.tab:hover { color: var(--primary-color); }
.tab.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }

/* ---- KPI tiles ----
   Matches the Proposal Automation portal's .kpi-tile: a soft-orange icon tile
   beside the figure, rather than the kit's coloured left rule.

   The 240px track floor is chosen so the longest realistic value fits on one
   line: 240px track - 40px padding = 200px of content box, and 13 tabular
   glyphs at 1.5rem run ~185px. (Plant figures are 13-glyph rupee amounts like
   "Rs 21,055,025", which overflow the kit's default 150px tile.) */
/* Track budget: 300px track − 40px padding − 44px icon − ~14px gap leaves
   ~200px for the figure, and 13 tabular glyphs at 1.4rem run ~180px. The icon
   tile costs ~54px, so these tracks are wider than a plain text tile needs. */
.kpi-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.kpi {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 1.1rem 1.25rem;
}
/* The icon tile carries the status colour now, so the kit's 3px coloured left
   rule is removed — every tile gets the same neutral 1px border on all four
   sides. app.css sets the rule on .kpi, .kpi.accent and .kpi.good, so all
   three are overridden here. */
.kpi,
.kpi.accent,
.kpi.good,
.kpi.bad { border-left: 1px solid var(--border-light); }
/* Icon tile — soft orange by default; status tones recolour it below. */
.kpi-ico {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; background: #fff0e6; color: var(--primary-color);
}
.kpi-body { min-width: 0; }
.kpi.good .kpi-ico { background: #e7f6ec; color: var(--success-darker); }
.kpi.bad .kpi-ico { background: #fdecec; color: var(--danger-color); }
.kpi.accent .kpi-ico { background: #fff0e6; color: var(--primary-color); }
.kpi-grid .kpi-value {
  font-size: clamp(1.1rem, 1vw + 0.7rem, 1.4rem);
  font-weight: 700; color: var(--secondary-color); line-height: 1.1;
  white-space: nowrap;              /* never break inside a number */
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
}
.kpi-grid.compact { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.kpi-grid.compact .kpi-value { font-size: clamp(1.05rem, 0.85vw + 0.62rem, 1.3rem); }
/* Status tones colour the figure as well as its icon tile — green is money
   received, red is money owed. */
.kpi.bad .kpi-value { color: var(--danger-color); }
.kpi.good .kpi-value { color: var(--success-darker); }
.kpi-hint { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.kpi-label {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); font-weight: 600; margin-top: 0.2rem;
  /* `anywhere` would snap "NET INCOME" mid-word when the body is squeezed;
     tracks are wide enough now that normal wrapping is correct. */
  overflow-wrap: normal;
}
/* No ellipsis on figures: truncating "Rs 9,845,947" to "Rs 9,845,9…" hides the
   number, which is worse than any layout overflow. The tracks above are sized
   so this cannot happen; if a figure ever does outgrow its tile, widen the
   track rather than clipping the digits. */
.kpi-value { max-width: 100%; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 20px; align-items: start; }

/* Chart.js canvases run with maintainAspectRatio:false, which sizes the canvas
   from its parent box. The parent must therefore have a height that does NOT
   depend on the canvas, or each resize grows it and the page scrolls forever.
   Fixed height + position:relative + a canvas pinned to it breaks that loop. */
.chart-box { position: relative; height: 280px; width: 100%; }
.chart-box > canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }

/* ---- Data entry forms ---- */
.entry-form .field-grid,
.inline-edit .field-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px 14px; align-items: end;
}
.field label {
  margin: 0 0 5px; font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 0.3px; color: var(--text-muted);
}
.field.wide { grid-column: span 2; }
.field.submit { display: flex; gap: 8px; align-items: flex-end; }
.field.check { display: flex; align-items: center; padding-bottom: 10px; }
.check-label {
  display: inline-flex !important; align-items: center; gap: 8px; margin: 0 !important;
  font-size: 0.85rem !important; text-transform: none !important; letter-spacing: 0 !important;
  color: var(--text-primary) !important; cursor: pointer; font-weight: 500 !important;
}
.check-label input { width: auto !important; accent-color: var(--primary-color); }
.entry-form input, .entry-form select { padding: 10px 12px; font-size: 0.92rem; }
.inline-edit input, .inline-edit select { padding: 9px 11px; font-size: 0.88rem; }

/* Inline edit row: tinted and rule-marked so it reads as "in progress". */
.edit-row > td { background: #fffaf5; border-left: 3px solid var(--primary-color); padding: 18px; }
.grid-input { padding: 8px 10px !important; font-size: 0.9rem !important; text-align: right; }

/* ---- Table extras ---- */
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .nowrap { white-space: nowrap; }
.table .actions { width: 1%; white-space: nowrap; text-align: right; }
.table tfoot .total-row td {
  background: var(--bg-secondary); font-weight: 700; color: var(--text-secondary);
  border-top: 2px solid var(--border-color); border-bottom: none;
}
.table .empty { padding: 34px 10px; }
.table tr.stock-row td { background: rgba(73, 115, 139, 0.05); }
.table tr.inactive-row td { opacity: 0.6; }
.table tr.zero-row td { color: var(--text-muted); }
.table code { font-size: 0.82em; }

.badge.stock { background: #e8f0f4; color: var(--info-color); margin-left: 6px; }
.badge.action-create { background: #e7f6ec; color: var(--success-darker); }
.badge.action-update { background: #fff0e6; color: var(--primary-darkest); }
.badge.action-delete { background: #fdecec; color: var(--danger-color); }
.badge.action-login { background: var(--bg-secondary); color: var(--text-muted); }

/* Inline bar charts inside report tables */
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-row .progress { flex: 1; margin: 0; }
.bar-row .bar-pct { min-width: 42px; text-align: right; font-variant-numeric: tabular-nums; }
.progress > span.ok { background: var(--success-color); }

/* ---- Income bottom-line block ---- */
.summary-card .summary-lines { display: grid; gap: 2px; max-width: 520px; }
.summary-line {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--border-light); font-size: 0.95rem;
}
.summary-line strong { font-variant-numeric: tabular-nums; font-size: 1.05rem; color: var(--text-secondary); }
.summary-line.final {
  border-bottom: none; border-top: 2px solid var(--secondary-color);
  margin-top: 6px; padding-top: 14px;
}
.summary-line.final strong { color: var(--primary-color); font-size: 1.35rem; }

/* ---- Login split layout ----
   style.css already ships its own .login-page and .login-card (a centered box
   sized for a page that sits inside the navbar + container chrome). This page
   has neither, so rather than fight that cascade it uses its own class names —
   .plant-login* — which the kit does not define. Nothing here depends on load
   order, a body class, or !important. */
/* Brand panel takes the slack, form panel stays a fixed narrow column —
   the same proportions as the training platform's login. */
.plant-login { display: flex; min-height: 100vh; width: 100%; }

.plant-login-visual {
  flex: 1;
  color: #fff; display: flex; align-items: center; justify-content: center;
  padding: 3rem; position: relative; overflow: hidden;
  /* Charcoal wash over the photo, so white text stays legible on any crop. */
  background:
    linear-gradient(160deg, rgba(60, 81, 91, 0.92) 0%, rgba(30, 40, 47, 0.96) 100%),
    url("../img/login-bg.jpg") center / cover no-repeat;
}
/* Orange rule down the leading edge. */
.plant-login-visual::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0;
  width: 5px; background: var(--primary-color); z-index: 3;
}
.plant-login-inner { position: relative; z-index: 2; max-width: 560px; width: 100%; }
.plant-login-inner h2 { color: #fff; font-size: 2rem; margin: 20px 0 10px; }
.plant-login-inner p { color: #c9d2d7; line-height: 1.7; margin: 0; }
.plant-login-points {
  list-style: none; padding: 0; margin: 2.5rem 0 0; display: flex;
  flex-direction: column; gap: 1.15rem;
}
.plant-login-points li {
  display: flex; align-items: center; gap: 0.85rem;
  font-size: 0.9rem; color: rgba(255, 255, 255, 0.92);
}
/* Icons sit in soft orange tiles, matching the training platform. */
.plant-login-points i {
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
  background: rgba(255, 102, 0, 0.15); border: 1px solid rgba(255, 102, 0, 0.35);
  color: var(--primary-color); display: flex; align-items: center;
  justify-content: center; font-size: 0.95rem;
}

/* Right panel — mirrors the Proposal Automation portal's .login-form-panel:
   a fixed narrow column with icon-prefixed inputs and a full-width orange CTA.
   The panel itself is the card, so nothing inside carries its own border or
   shadow. */
.plant-login-form {
  width: 520px; min-width: 420px; flex: none;
  display: flex; flex-direction: column; justify-content: center;
  padding: 3.5rem 4rem; background: var(--bg-primary);
}
.plant-login-form .form-header { margin-bottom: 2rem; }
.plant-login-form .form-header h2 {
  font-size: 1.65rem; font-weight: 700; color: var(--secondary-color);
  margin-bottom: 0.4rem; letter-spacing: -0.01em;
}
.plant-login-form .form-header p { font-size: 0.9rem; color: var(--text-muted); margin: 0; }

.login-form { display: flex; flex-direction: column; gap: 1.1rem; }
.login-form .form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.login-form .form-group label {
  font-size: 0.75rem; font-weight: 600; color: var(--secondary-color);
  text-transform: uppercase; letter-spacing: 0.05em; margin: 0;
}
.login-form .input-wrapper { position: relative; display: flex; align-items: center; }
.login-form .input-icon {
  position: absolute; left: 0.95rem; color: var(--text-muted);
  font-size: 0.95rem; pointer-events: none; transition: color 0.15s;
}
.login-form .form-group input {
  width: 100%; padding: 0.85rem 0.95rem 0.85rem 2.7rem;
  border: 1.5px solid var(--border-light); border-radius: 10px;
  font-size: 0.9rem; color: var(--text-primary); background: var(--bg-secondary);
  transition: all 0.15s ease; font-family: inherit; outline: none;
}
.login-form .form-group input:focus {
  border-color: var(--primary-color); background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.12);
}
.login-form .form-group:focus-within .input-icon { color: var(--primary-color); }
.login-form .form-group input::placeholder { color: #a8b3b8; }

.password-toggle {
  position: absolute; right: 0.9rem; background: none; border: none;
  color: var(--text-muted); cursor: pointer; padding: 0.25rem;
  font-size: 0.95rem; transition: color 0.15s;
}
.password-toggle:hover { color: var(--secondary-color); }

.btn-login {
  width: 100%; padding: 0.9rem; background: var(--primary-color); color: #fff;
  border: none; border-radius: 10px; font-size: 0.95rem; font-weight: 600;
  cursor: pointer; transition: all 0.15s ease;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  margin-top: 0.5rem; box-shadow: 0 4px 14px rgba(255, 102, 0, 0.30);
  font-family: inherit;
}
.btn-login:hover {
  background: var(--primary-dark); box-shadow: 0 8px 24px rgba(255, 102, 0, 0.40);
  transform: translateY(-1px);
}

.login-footer {
  margin-top: 1.75rem; padding-top: 1.5rem;
  border-top: 1px solid var(--border-light); text-align: center;
}
.login-help {
  font-size: 0.825rem; color: var(--text-muted); margin: 0;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.login-help i { color: var(--primary-color); }

/* ---- Error page ---- */
.error-page { padding: 56px 26px; }
.error-code { font-size: 4rem; font-weight: 900; color: var(--primary-color); line-height: 1; }

/* ============================================================================
   MOTION — reuses the keyframes already defined in style.css (fadeIn,
   fadeInUp, fadeInScale). The kit animates its own card classes by name; the
   plant's components are named differently, so they are opted in here. Same
   durations and easing as the training platform, so both apps feel identical.
   ============================================================================ */

/* Cards and KPI tiles rise and scale in, staggered across the row. */
.card,
.kpi {
  animation: fadeInScale 0.4s ease-out backwards;
}
.kpi-grid .kpi:nth-child(1) { animation-delay: 0.05s; }
.kpi-grid .kpi:nth-child(2) { animation-delay: 0.10s; }
.kpi-grid .kpi:nth-child(3) { animation-delay: 0.15s; }
.kpi-grid .kpi:nth-child(4) { animation-delay: 0.20s; }
.kpi-grid .kpi:nth-child(5) { animation-delay: 0.25s; }
.kpi-grid .kpi:nth-child(6) { animation-delay: 0.30s; }
.kpi-grid .kpi:nth-child(7) { animation-delay: 0.35s; }
.kpi-grid .kpi:nth-child(8) { animation-delay: 0.40s; }

/* Page header slides up, matching the kit's .section-title treatment. */
.page-head h1 { animation: fadeInUp 0.4s ease-out backwards; }
.page-head .muted { animation: fadeInUp 0.5s ease-out 0.1s backwards; }

/* Register rows stagger in, as the kit does for .admin-table rows. */
.table tbody tr { animation: fadeIn 0.3s ease-out backwards; }
.table tbody tr:nth-child(1) { animation-delay: 0.03s; }
.table tbody tr:nth-child(2) { animation-delay: 0.06s; }
.table tbody tr:nth-child(3) { animation-delay: 0.09s; }
.table tbody tr:nth-child(4) { animation-delay: 0.12s; }
.table tbody tr:nth-child(5) { animation-delay: 0.15s; }
.table tbody tr:nth-child(6) { animation-delay: 0.18s; }
.table tbody tr:nth-child(7) { animation-delay: 0.21s; }
.table tbody tr:nth-child(8) { animation-delay: 0.24s; }
/* Beyond the fold the stagger stops mattering — show the rest immediately. */
.table tbody tr:nth-child(n+9) { animation-delay: 0.27s; }

/* The inline edit row is toggled open by JS, so it animates on reveal, not
   on page load. */
.edit-row > td > form { animation: fadeIn 0.25s ease-out; }

/* Login panels: brand copy rises, form fades in behind it. */
.plant-login-inner h2 { animation: fadeInUp 0.5s ease-out 0.1s backwards; }
.plant-login-inner p { animation: fadeInUp 0.5s ease-out 0.2s backwards; }
.plant-login-points li { animation: fadeInUp 0.45s ease-out backwards; }
.plant-login-points li:nth-child(1) { animation-delay: 0.30s; }
.plant-login-points li:nth-child(2) { animation-delay: 0.38s; }
.plant-login-points li:nth-child(3) { animation-delay: 0.46s; }
.plant-login-points li:nth-child(4) { animation-delay: 0.54s; }
.plant-login-form .login-form { animation: fadeInScale 0.45s ease-out 0.15s backwards; }

/* Flash messages arrive from the side, as the kit's alerts do. */
.flash { animation: fadeInUp 0.35s ease-out; }

/* Respect the OS "reduce motion" setting — accessibility, not decoration. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 900px) {
  /* Stack: brand panel on top, form full width beneath. Everything centres,
     since there is no longer a second column to align against. */
  .plant-login { flex-direction: column; }
  .plant-login-visual { flex: none; padding: 2.5rem 1.75rem 3rem; }
  /* text-align centres the inline-flex .plant-mark tile and the copy alike. */
  .plant-login-inner { max-width: 100%; text-align: center; }
  .plant-login-inner h2 { font-size: 1.65rem; }
  .plant-login-points {
    max-width: 320px; margin-left: auto; margin-right: auto;
  }
  /* Rows keep their icon-then-label reading order, just centred as a group. */
  .plant-login-points li { text-align: left; }

  .plant-login-form { width: 100%; min-width: 0; padding: 2rem 1.5rem; }
  .field.wide { grid-column: span 1; }
}

@media (max-width: 992px) {
  /* In the drawer the dropdowns flatten into an always-open indented list —
     hover is meaningless on touch. */
  .nav-dropdown .dropdown-menu {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: none; padding: 0 0 0 1rem;
    background: transparent; min-width: auto;
  }
  .nav-dropdown .dropdown-toggle { width: 100%; justify-content: flex-start; }

  /* app.css already makes the drawer a flex column, so `order` alone lifts the
     identity block to the top without touching the markup — on desktop it must
     stay last, at the right-hand end of the navbar. */
  .nav-user {
    order: -1;
    margin-left: 0; margin-top: 0; width: 100%;
    /* Sits above the links now, so the rule goes underneath it. */
    border-top: none; border-bottom: 1px solid var(--border-light);
    padding: 4px 0 14px; margin-bottom: 10px;
    /* Identity left, avatar and logout pinned right. */
    justify-content: space-between;
  }
  .user-info { align-items: flex-start; margin-right: auto; }
}

/* ============================================================================
   ROLES, ACCESS AND APPROVALS
   ============================================================================ */

/* Role tags — one per fixed role. */
.role-tag.accountant { background: #eef4ec; color: var(--success-darker); }
.role-tag.user { background: var(--bg-secondary); color: var(--text-muted); }

/* Page-access checkbox grid on the users page. */
.access-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px 14px; padding: 14px; background: var(--bg-secondary);
  border: 1px solid var(--border-light); border-radius: var(--border-radius-sm);
}
.access-item { padding: 4px 2px; }

/* Navbar count badge, matching the portal's ticket badge. */
.ticket-badge {
  position: absolute; top: -6px; right: -10px;
  background: var(--danger-color); color: #fff;
  font-size: 0.65rem; font-weight: 700; line-height: 1;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* Before/after diff inside an approval row. */
.diff-table { border-collapse: collapse; font-size: 0.82rem; }
.diff-table td { padding: 2px 8px 2px 0; border: none; }
.diff-field { color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.diff-old { color: var(--danger-color); text-decoration: line-through; }
.diff-arrow { color: var(--text-muted); font-size: 0.7rem; }
.diff-new { color: var(--success-darker); font-weight: 600; }

/* A row whose change is awaiting review keeps its approved values and is
   tinted, so nobody mistakes the displayed figures for the proposed ones. */
.table tr.pending-row td { background: rgba(250, 166, 26, 0.08); }
.badge.pending {
  background: #fff6e5; color: #9a6300; border-color: #f6dfb0; margin-left: 6px;
}

/* ---- Collapsible filters card (audit log) ---- */
.filters-header {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; user-select: none;
}
.filters-header:hover h2 { color: var(--primary-color); }
.filters-header .fa-chevron-down {
  color: var(--text-muted); font-size: 0.85rem; transition: transform 0.2s ease;
}

/* Action badges for the workflow verbs the audit log records. */
.badge.action-login { background: var(--bg-secondary); color: var(--text-muted); }
.badge.action-request { background: #fff6e5; color: #9a6300; }
.badge.action-approve { background: #e7f6ec; color: var(--success-darker); }
.badge.action-reject { background: #fdecec; color: var(--danger-color); }
.badge.action-cancel { background: var(--bg-secondary); color: var(--text-muted); }
.badge.action-export { background: #e8f0f4; color: var(--info-color); }
