:root {
  --bg: #ffffff;
  --surface: #f2f2f3;
  --text: #1f2120;
  --text-muted: #6b6c6c;
  --border: #e0e0e0;
  --accent: #33ffc9;
  --success: #02cf99;
  --error: #e92727;
  --warning: #ffd748;
  --info: #1890ff;
  --link: #607dff;
  --btn-bg: #1f2120;
  --btn-bg-hover: #363636;
  --btn-fg: #ffffff;
  --r-sm: 2px;
  --r-md: 4px;
  --error-tint-bg: #fdeaea;
  --success-tint-bg: #e6fbf4;
  --success-tint-fg: #027a5c;
  --warning-fg: #b8860b;
}

:root[data-theme="dark"] {
  --bg: #1c1e1d;
  --surface: #292b2a;
  --text: #f2f2f3;
  --text-muted: #9a9c98;
  --border: #3a3c3a;
  --btn-bg: #33ffc9;
  --btn-bg-hover: #5cffd4;
  --btn-fg: #1c1e1d;
  --error-tint-bg: #3a2020;
  --success-tint-bg: #16302a;
  --success-tint-fg: #4dffce;
  --warning-fg: #ffd748;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1e1d;
    --surface: #292b2a;
    --text: #f2f2f3;
    --text-muted: #9a9c98;
    --border: #3a3c3a;
    --btn-bg: #33ffc9;
    --btn-bg-hover: #5cffd4;
    --btn-fg: #1c1e1d;
    --error-tint-bg: #3a2020;
    --success-tint-bg: #16302a;
    --success-tint-fg: #4dffce;
  }
}

* { box-sizing: border-box; }

body {
  font-family: "MADE Outer Sans", Inter, "Space Grotesk", system-ui, sans-serif;
  font-weight: 300;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Topbar */
nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 2rem;
  position: sticky;
  top: 0;
  z-index: 10;
  overflow-x: auto;
  white-space: nowrap;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-right: 0.25rem;
  flex-shrink: 0;
}
.nav-logo { height: 16px; width: auto; display: block; }
.nav-logo-dark { display: none; }
:root[data-theme="dark"] .nav-logo-light { display: none; }
:root[data-theme="dark"] .nav-logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav-logo-light { display: none; }
  :root:not([data-theme="light"]) .nav-logo-dark { display: block; }
}
.nav-brand-divider { width: 1px; height: 18px; background: var(--border); flex-shrink: 0; }
.nav-brand-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  letter-spacing: -0.005em;
  flex-shrink: 0;
}
nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.1rem;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
}
nav a:hover { color: var(--text); }
nav a.active { color: var(--text); border-bottom-color: var(--accent); }

/* Grouped nav menus (simplified 2026-10-15: fewer top-level links, related
   pages grouped under a <details>-based dropdown — no JS needed). */
nav details.nav-dropdown { position: relative; flex-shrink: 0; }
nav details.nav-dropdown summary {
  list-style: none; cursor: pointer; user-select: none;
  color: var(--text-muted); font-size: 0.9rem; font-weight: 500;
  padding: 0.4rem 0.1rem; border-bottom: 2px solid transparent;
  transition: color 0.15s ease;
}
nav details.nav-dropdown summary::-webkit-details-marker { display: none; }
nav details.nav-dropdown summary:hover { color: var(--text); }
nav details.nav-dropdown[open] summary { color: var(--text); }
nav details.nav-dropdown summary::after { content: " \25BE"; font-size: 0.75em; }
nav .nav-dropdown-menu {
  position: absolute; top: calc(100% + 0.6rem); left: 0;
  display: flex; flex-direction: column; min-width: 170px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12); padding: 0.4rem; z-index: 20;
}
nav .nav-dropdown-menu a { padding: 0.5rem 0.7rem; border-bottom: none; border-radius: var(--r-sm); white-space: nowrap; }
nav .nav-dropdown-menu a:hover { background: var(--surface); }
/* Closes the dropdown on outside click/escape via native <details> behavior;
   this just makes sure it doesn't get clipped by the nav's own overflow-x. */
nav { overflow-x: visible; overflow-y: visible; }
@media (max-width: 900px) { nav { overflow-x: auto; } nav .nav-dropdown-menu { position: fixed; left: 1rem; right: 1rem; min-width: 0; } }
nav #me {
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.3rem 0.7rem;
  background: var(--surface);
  border-radius: var(--r-sm);
  flex-shrink: 0;
}
.theme-toggle-btn {
  margin: 0; padding: 0.35rem 0.55rem;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 0.95rem; line-height: 1;
  cursor: pointer; flex-shrink: 0;
}
.theme-toggle-btn:hover { background: var(--border); }
nav .lang-switch { order: 1; margin-left: auto; flex-shrink: 0; }
nav .theme-toggle-btn { order: 2; }
nav #me { order: 3; margin-left: 0; }
nav #logout-link {
  order: 4;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text) !important;
  font-weight: 500;
}
nav #logout-link:hover { background: var(--surface); border-color: var(--text-muted); }

/* Hero banner (dashboard) */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 2.75rem 2.5rem;
  margin-top: 1.75rem;
}
.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 1.1rem;
}
.hero-eyebrow::before {
  content: "";
  display: block;
  width: 18px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}
.hero-title {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0 0 0.9rem;
  max-width: 20ch;
  position: relative;
  z-index: 1;
}
.hero-sub {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  max-width: 46ch;
  margin: 0;
  position: relative;
  z-index: 1;
}
.hero-stripes {
  position: absolute;
  right: 2rem;
  bottom: 1.6rem;
  display: flex;
  gap: 6px;
  opacity: 0.9;
}
.hero-stripes span {
  display: block;
  width: 8px;
  height: 34px;
  background: var(--accent);
  transform: skewX(-18deg);
}
@media (max-width: 720px) { .hero-stripes { display: none; } }

/* Page container */
body > h1,
body > .hero,
body > .error,
body > form,
body > #result,
body > label,
body > select,
body > table,
body > section,
body > .form-card,
body > .stat-tiles,
body > p {
  display: block;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 2rem;
  padding-right: 2rem;
}
body > h1 { margin-top: 2rem; margin-bottom: 1.5rem; }

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
h2 {
  font-size: 1rem;
  font-weight: 700;
  border-left: 3px solid var(--accent);
  padding-left: 0.7rem;
  padding-bottom: 0;
  margin: 0 0 1rem;
}
section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

/* Card-style form (create page) */
.form-card {
  max-width: 480px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--r-md);
  padding: 1.75rem;
  margin-top: 0.5rem;
}
.form-card-sub { color: var(--text-muted); font-size: 0.85rem; margin: 0 0 1.25rem; line-height: 1.5; }

/* Dashboard summary stat tiles */
body > .stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.9rem;
  margin-top: 1.25rem;
}
.stat-tile {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.1rem 1.2rem;
}
.stat-tile-value { font-size: 1.65rem; font-weight: 700; letter-spacing: -0.01em; }
.stat-tile-label { color: var(--text-muted); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 0.25rem; }
.stat-tile-accent .stat-tile-value { color: var(--info); }
.stat-tile-success .stat-tile-value { color: var(--success); }
.stat-tile-warning .stat-tile-value { color: var(--warning-fg); }
.stat-tile-error .stat-tile-value { color: var(--error); }

/* Approval stepper */
.approval-stepper {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.stepper-item { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; width: 100px; }
.stepper-dot {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700;
  background: var(--surface); color: var(--text-muted); border: 2px solid var(--border);
}
.stepper-approved .stepper-dot { background: var(--success); color: #fff; border-color: var(--success); }
.stepper-rejected .stepper-dot { background: var(--error); color: #fff; border-color: var(--error); }
.stepper-pending .stepper-dot { background: var(--bg); color: var(--text); border-color: var(--accent); }
.stepper-label { margin-top: 0.5rem; font-size: 0.76rem; text-align: center; color: var(--text-muted); line-height: 1.3; }
.stepper-approved .stepper-label, .stepper-pending .stepper-label { color: var(--text); font-weight: 500; }
.stepper-line { flex: 1; height: 2px; background: var(--border); margin-top: 15px; min-width: 20px; }
.stepper-line-done { background: var(--success); }

/* Login page: split layout (dark pitch panel + centered card) */
body.login-body { margin: 0; }
.login-shell {
  display: flex;
  min-height: 100vh;
}
.login-aside {
  display: none;
  position: relative;
  flex-shrink: 0;
  width: 420px;
  background: #1f2120;
  overflow: hidden;
  border-top: 3px solid var(--accent);
}
@media (min-width: 1024px) {
  .login-aside { display: flex; flex-direction: column; }
}
.login-aside-grid {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background-image: linear-gradient(var(--accent) 1px, transparent 1px), linear-gradient(90deg, var(--accent) 1px, transparent 1px);
  background-size: 44px 44px;
}
.login-aside-content {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 2.75rem 2.5rem;
}
.login-brand { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 3.5rem; }
.login-brand-logo { height: 20px; width: auto; flex-shrink: 0; display: block; }
.login-brand-divider { width: 1px; height: 16px; background: #3a3c3a; flex-shrink: 0; }
.login-brand-name { color: #fff; font-size: 0.88rem; font-weight: 700; margin: 0; }
.login-brand-sub { color: #6b6c6c; font-size: 0.72rem; margin: 0.15rem 0 0; }
.login-pitch h1 {
  color: #fff; font-size: 1.85rem; font-weight: 700; letter-spacing: -0.02em;
  line-height: 1.2; margin: 0 0 0.9rem;
}
.login-pitch h1 span { color: var(--accent); }
.login-pitch > p { color: #9a9c98; font-size: 0.84rem; line-height: 1.6; margin: 0 0 2.25rem; max-width: 30ch; }
.login-features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
.login-features li { display: flex; align-items: center; gap: 0.75rem; }
.login-features span:last-child { color: #9a9c98; font-size: 0.82rem; }
.login-feature-icon {
  width: 30px; height: 30px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(51, 255, 201, 0.08); border: 1px solid rgba(51, 255, 201, 0.16);
  border-radius: var(--r-md); color: var(--accent);
}

.login-main {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  padding: 2rem;
}
.login-top-controls {
  position: absolute; top: 1.5rem; right: 1.5rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.login-theme-toggle { position: static; }
.lang-switch { display: flex; gap: 0.35rem; }
.lang-link {
  font-size: 0.76rem; font-weight: 500; text-decoration: none; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: var(--r-sm); padding: 0.3rem 0.5rem;
  background: var(--bg); cursor: pointer;
}
.lang-link:hover { background: var(--surface); }
.lang-link.active { color: var(--text); border-color: var(--text); background: var(--surface); }
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--r-md);
  padding: 2rem;
}
.login-card-logo { margin-bottom: 1.5rem; }
.login-card-logo .nav-logo { height: 18px; }
.login-card h1 { font-size: 1.4rem; margin: 0 0 0.35rem; }
.login-card-sub { color: var(--text-muted); font-size: 0.85rem; margin: 0 0 1.5rem; }
.login-password-field { position: relative; }
.login-password-field input { padding-right: 2.5rem; }
.login-eye-toggle {
  position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%);
  margin: 0; padding: 0.3rem; background: transparent; color: var(--text-muted);
  border: none; cursor: pointer; display: flex;
}
.login-eye-toggle:hover { color: var(--text); background: transparent; }
#login-submit { width: 100%; }
.login-sso-divider { text-align: center; color: var(--text-muted); font-size: 0.78rem; margin: 1rem 0 0.5rem; }
.login-sso-btn {
  display: block; width: 100%; box-sizing: border-box; text-align: center;
  padding: 0.6rem 1.1rem; border-radius: var(--r-sm); font-size: 0.88rem; font-weight: 500;
  background: transparent; color: var(--text); border: 1px solid var(--border);
  text-decoration: none; transition: background 0.15s ease;
}
.login-sso-btn:hover { background: var(--btn-bg-hover); }

/* Forms */
label {
  display: block;
  margin-top: 1rem;
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
label:first-child { margin-top: 0; }
input, select, textarea {
  width: 100%;
  padding: 0.6rem 0.7rem;
  box-sizing: border-box;
  margin-top: 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 0.92rem;
  font-family: inherit;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px var(--surface);
}
input[type="file"] {
  padding: 0.4rem;
  border-style: dashed;
}

/* Buttons */
button {
  margin-top: 1.25rem;
  padding: 0.6rem 1.1rem;
  cursor: pointer;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: none;
  border-radius: var(--r-sm);
  font-size: 0.88rem;
  font-weight: 500;
  font-family: inherit;
  transition: background 0.15s ease, transform 0.05s ease;
}
button:hover { background: var(--btn-bg-hover); }
button:active { transform: translateY(1px); }
.button-link {
  display: inline-block;
  margin-top: 1.25rem;
  padding: 0.6rem 1.1rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border-radius: var(--r-sm);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
}
.button-link:hover { background: var(--btn-bg-hover); }
td button, td select, td input { margin-top: 0; }
td button { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
td button[onclick^="decideApproval('reject')"] { background: var(--error); }
td button[onclick^="decideApproval('reject')"]:hover { background: #b81f1f; }
#approval-action button[onclick*="reject"] { background: var(--error); }
#approval-action button[onclick*="reject"]:hover { background: #b81f1f; }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg);
}
body > table {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-top: 1rem;
  border-spacing: 0;
}
section table { margin-top: 0; }
thead th {
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}
th, td {
  text-align: left;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface); }
table a { color: var(--link); text-decoration: none; font-weight: 500; }
table a:hover { text-decoration: underline; }
td code {
  background: var(--surface);
  padding: 0.15rem 0.4rem;
  border-radius: var(--r-sm);
  font-size: 0.82rem;
}

/* Small screens: let wide data tables scroll horizontally within their own
   box instead of blowing out the whole page. `display: block` on <table>
   makes it a scroll container without touching any template markup. */
@media (max-width: 640px) {
  body > table,
  table.data-table,
  table.sheet-table,
  section table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  body > table td, body > table th,
  table.data-table td, table.data-table th,
  table.sheet-table td, table.sheet-table th,
  section table td, section table th {
    white-space: nowrap;
  }
  body > h1,
  body > .hero,
  body > .error,
  body > form,
  body > #result,
  body > label,
  body > select,
  body > table,
  body > section,
  body > .form-card,
  body > .stat-tiles,
  body > p,
  main.page {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .hero { padding: 1.75rem 1.5rem; }
  .filter-bar input, .filter-bar select { min-width: 0; width: 100%; }
}

/* Status badges (solid fills, per ALVA semantic palette) */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: var(--r-sm);
  font-size: 0.76rem;
  font-weight: 500;
  white-space: nowrap;
  text-transform: capitalize;
}
.badge-approved, .badge-checked_ok, .badge-completed { background: var(--success); color: #fff; }
.badge-rejected, .badge-checked_reject, .badge-blocked, .badge-voided { background: var(--error); color: #fff; }
.badge-pending, .badge-pending_documents, .badge-submitted { background: var(--warning); color: var(--text); }
.badge-in_approval, .badge-checking, .badge-awaiting_documents { background: var(--info); color: #fff; }
.badge-not_submitted { background: var(--surface); color: var(--text-muted); border: 1px solid var(--border); }
.badge-label { background: var(--surface); color: var(--text); border: 1px solid var(--border); gap: 0.35rem; }
.ticket-labels-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.5rem 0 1rem; }
.label-remove-btn { background: none; border: none; padding: 0; margin: 0; color: inherit; font-size: 0.9rem; line-height: 1; cursor: pointer; }
.label-remove-btn:hover { color: var(--error); background: none; }

/* Alerts */
.error {
  background: var(--error-tint-bg);
  color: var(--error);
  padding: 0.85rem 1rem;
  border-radius: var(--r-sm);
  border-left: 3px solid var(--error);
  margin: 1rem 0;
  font-size: 0.9rem;
  font-weight: 500;
}
#result {
  background: var(--success-tint-bg);
  color: var(--success-tint-fg);
  border-left: 3px solid var(--success);
  padding: 1rem 1.1rem;
  border-radius: var(--r-sm);
  margin: 1rem 0;
  font-size: 0.9rem;
}
#result strong { display: block; margin-bottom: 0.4rem; font-size: 0.95rem; color: var(--text); }
#d-public-link { font-family: ui-monospace, monospace; font-size: 0.82rem; cursor: pointer; }

#event-checkboxes {
  display: flex;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}
.checkbox-label {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem;
  font-weight: 400;
  font-size: 0.85rem;
  text-transform: none;
  letter-spacing: normal;
  margin: 0.3rem 1.2rem 0.3rem 0;
  color: var(--text);
}
.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  padding: 0;
  margin: 0;
  border-width: 1px;
  flex: none;
}

/* AssetHub-specific components, built on the same tokens above */
main.page {
  display: block;
  max-width: 1200px;
  margin: 1.75rem auto;
  padding: 0 2rem;
}
.subtitle { color: var(--text-muted); font-size: 0.85rem; margin: -0.5rem 0 1.25rem; }
.muted { color: var(--text-muted); }
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.5rem;
  margin-top: 1.25rem;
}
.card h3, main.page h3 {
  font-size: 1rem;
  font-weight: 700;
  border-left: 3px solid var(--accent);
  padding-left: 0.7rem;
  margin: 0 0 1rem;
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}
.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.1rem 1.2rem;
}
.stat-card strong { display: block; font-size: 1.65rem; font-weight: 700; letter-spacing: -0.01em; }
.stat-card span { color: var(--text-muted); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-card.stat-green strong { color: var(--success); }
.stat-card.stat-orange strong { color: var(--warning-fg); }
.text-green { color: var(--success); }
.text-orange { color: var(--warning-fg); }
.text-red { color: var(--error); }
.progress-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  height: 8px;
  margin-top: 1rem;
  overflow: hidden;
}
.progress-fill { background: var(--accent); height: 100%; width: 0; transition: width 0.2s ease; }

/* Alerts (named variant of NSR's .error / #result) */
.alert { padding: 0.85rem 1rem; border-radius: var(--r-sm); margin: 1rem 0; font-size: 0.9rem; font-weight: 500; border-left: 3px solid transparent; }
.alert-error { background: var(--error-tint-bg); color: var(--error); border-left-color: var(--error); }
.alert-success { background: var(--success-tint-bg); color: var(--success-tint-fg); border-left-color: var(--success); }

/* Buttons as classes, matching the bare <button>/<a.button-link> look above */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.6rem 1.1rem; margin-top: 0; cursor: pointer;
  border-radius: var(--r-sm); font-size: 0.88rem; font-weight: 500;
  font-family: inherit; text-decoration: none; border: 1px solid transparent;
  transition: background 0.15s ease, transform 0.05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn-primary:hover { background: var(--btn-bg-hover); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface); }
.link-button {
  background: none; border: none; padding: 0; margin: 0;
  color: var(--text) !important; font: inherit; cursor: pointer; text-decoration: none;
}
.link-button:hover { text-decoration: underline; background: none; }
.inline { display: inline; margin: 0; }
.logout-form { margin: 0; order: 4; }
.webhook-grid{display:grid;grid-template-columns:minmax(280px,.7fr) minmax(520px,1.5fr);gap:1rem;align-items:start}.webhook-secret{border:2px solid var(--accent,#2563eb)}.webhook-secret code{display:block;padding:1rem;overflow-wrap:anywhere;font-size:1rem}.button-stack{display:flex;flex-wrap:wrap;gap:.4rem}.button-stack form{margin:0}.subscriptions{white-space:pre-wrap;margin:0;font:inherit}.check{display:block;margin:.35rem 0}.check input{width:auto}fieldset{border:1px solid #d1d5db;border-radius:8px;padding:.75rem}
@media(max-width:900px){.webhook-grid{grid-template-columns:1fr}}

/* Badge (neutral count pill) */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.5rem; padding: 0.15rem 0.5rem;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  font-size: 0.78rem; font-weight: 600;
}

/* Filter bars and pagination */
.filter-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem;
  margin: 1.25rem 0;
}
.filter-bar label { margin-top: 0; }
.filter-bar input, .filter-bar select { margin-top: 0.25rem; width: auto; min-width: 180px; }
.pagination { display: flex; align-items: center; gap: 0.75rem; margin-top: 1.25rem; font-size: 0.85rem; color: var(--text-muted); }
.pagination a, .pagination .btn { margin: 0; }

/* Data tables (editable spreadsheet variants included) */
main.page table.data-table { margin-top: 0.5rem; }
.editable-cell { cursor: text; }
.editable-cell:hover { background: var(--surface); }
tr.row-inactive td { opacity: 0.5; }
table.sheet-table td, table.sheet-table th { white-space: nowrap; }

/* Operation workflow badges */
.badge-op-WAITING_IT_SUPPORT_SIGN, .badge-op-WAITING_EMPLOYEE_SIGN, .badge-op-WAITING_IT_OPERATION_SIGN,
.badge-op-RECONCILING, .badge-op-WAITING_APPROVAL, .badge-op-WAITING_EVIDENCE,
.badge-op-WAITING_IT_VERIFICATION, .badge-op-WAITING_MANAGER_DECISION, .badge-op-PENDING { background: var(--warning); color: var(--text); }
.badge-op-NEEDS_REVIEW, .badge-op-MISMATCH { background: var(--error); color: #fff; }
.badge-op-COMPLETED, .badge-op-RETURNED { background: var(--success); color: #fff; }
.badge-signoff-PENDING { background: var(--surface); color: var(--text-muted); border: 1px solid var(--border); }
.badge-signoff-SIGNED { background: var(--success); color: #fff; }
.badge-signoff-MISMATCH { background: var(--error); color: #fff; }

/* Generated document (delivery order) — printable, served standalone */
.document-page { max-width: 760px; margin: 2rem auto; padding: 0 2rem 3rem; }
.document-header { display: flex; align-items: center; gap: 1.25rem; border-bottom: 2px solid var(--accent); padding-bottom: 1.25rem; margin-bottom: 1.5rem; }
.document-logo { height: 28px; width: auto; }
.document-header-text h1 { font-size: 1.25rem; margin: 0 0 0.25rem; }
.document-signature-block { margin-top: 1rem; }
.document-signature-role { font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin: 0 0 0.4rem; }
.document-footer-note { color: var(--text-muted); font-size: 0.78rem; margin-top: 2rem; text-align: center; }
@media print {
  nav, .btn, button { display: none !important; }
  .document-page { margin: 0; max-width: none; }
}

/* Simplified login wrapper for AssetHub's single-card login (no split pitch panel) */
body.login-body {
  margin: 0; min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--surface);
}
.login-card {
  width: 100%; max-width: 380px; background: var(--bg);
  border: 1px solid var(--border); border-top: 3px solid var(--accent);
  border-radius: var(--r-md); padding: 2rem; margin: 1rem;
}
.login-card h1 { font-size: 1.4rem; margin: 0 0 0.35rem; }
.login-card .subtitle { margin: 0 0 1.5rem; }
.login-card #login-submit, .login-card .btn { width: 100%; margin-top: 1.25rem; }

/* Ticketing (Phase 1: core tickets) */
.badge-ticket-OPEN { background: var(--warning); color: var(--text); }
.badge-ticket-IN_PROGRESS { background: var(--info, #0078d4); color: #fff; }
.badge-ticket-RESOLVED { background: var(--success); color: #fff; }
.badge-ticket-CLOSED { background: var(--surface); color: var(--text-muted); border: 1px solid var(--border); }
.badge-prio-LOW { background: var(--surface); color: var(--text-muted); border: 1px solid var(--border); }
.badge-prio-MEDIUM { background: var(--info, #0078d4); color: #fff; }
.badge-prio-HIGH { background: var(--warning); color: var(--text); }
.badge-prio-URGENT { background: var(--error); color: #fff; }

.ticket-layout { display: grid; grid-template-columns: 1fr 280px; gap: 1.25rem; align-items: start; }
.ticket-main { display: flex; flex-direction: column; gap: 1rem; }
.ticket-sidebar { position: sticky; top: 1rem; }
.comment { padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.comment:last-of-type { border-bottom: none; }
@media (max-width: 860px) { .ticket-layout { grid-template-columns: 1fr; } }
.badge-sla-ok { background: var(--success); color: #fff; }
.badge-sla-warning { background: var(--warning); color: var(--text); }
.badge-sla-breached { background: var(--error); color: #fff; }
.badge-sla-done { background: var(--surface); color: var(--text-muted); border: 1px solid var(--border); }
.badge-approval-PENDING { background: var(--warning); color: var(--text); }
.badge-approval-APPROVED { background: var(--success); color: #fff; }
.badge-approval-REJECTED { background: var(--error); color: #fff; }
.comment-internal { background: var(--warning-tint-bg, #fff8e1); border-left: 3px solid var(--warning); padding-left: 0.6rem; }
.alert-approval-notice { background: var(--warning-tint-bg, #fff8e1); border-left-color: var(--warning); }
.request-center-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }

/* Pemeriksaan kode aset di halaman Operation Baru (3 Nov 2026) */
.field-status { margin: .25rem 0 .75rem; font-size: .9rem; min-height: 1.2em; }
.field-status.ok { color: #1a7f37; }
.field-status.error { color: #b42318; }
.field-status.checking { color: #6b7280; }
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .55);
         display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 50; }
.modal[hidden] { display: none; }
.modal-card { background: #fff; border-radius: .75rem; padding: 1.25rem 1.5rem; max-width: 30rem;
              box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.modal-card h2 { margin-top: 0; font-size: 1.1rem; }
.modal-card button { margin-top: 1rem; }

/* Formulir menu-menu yang dipindahkan dari itasset (5 Nov 2026).
   .form-grid dan .form-inline sudah dipakai halaman Master Status Aset sejak
   3 Nov tapi belum pernah diberi aturan, jadi formulirnya tampil apa adanya.
   Aturannya ditaruh di sini sekali untuk semua halaman yang memakainya. */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
             gap: .75rem 1rem; align-items: end; margin-top: .5rem; }
.form-grid label, .form-inline label { display: flex; flex-direction: column; gap: .25rem;
             font-size: .9rem; color: var(--text-muted); }
.form-grid input, .form-grid select, .form-inline input, .form-inline select {
             padding: .4rem .5rem; border: 1px solid var(--border); border-radius: .375rem;
             background: var(--surface); color: var(--text); font: inherit; }
.form-grid button { align-self: end; }
.form-inline { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; margin: .25rem 0; }
/* Di dalam sel tabel, formulir sebaris harus tetap sempit supaya kolomnya
   tidak melebar sampai tabelnya tidak terbaca. */
table.data-table .form-inline input { max-width: 11rem; }
table.data-table .form-grid { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .4rem; }
