:root {
  --navy: #0e2240;
  --navy-2: #16345f;
  --navy-3: #1d4274;
  --gold: #c9a227;
  --gold-2: #e3c25b;
  --bg: #eef2f7;
  --card: #ffffff;
  --text: #142033;
  --muted: #5b6b82;
  --line: #e2e8f0;
  --ok: #15803d;
  --ok-bg: #dcfce7;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --bad: #b91c1c;
  --bad-bg: #fee2e2;
  --info: #1d4ed8;
  --info-bg: #dbeafe;
  --shadow: 0 10px 30px rgba(14, 34, 64, .08);
  --shadow-lg: 0 24px 60px rgba(14, 34, 64, .16);
  --radius: 16px;
  --sidebar: 260px;
  --sidebar-collapsed: 76px;
  --safe-b: env(safe-area-inset-bottom);
  --safe-t: env(safe-area-inset-top);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Sarabun", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { font-family: inherit; }
img { max-width: 100%; }

.app-body { min-height: 100dvh; }
.app-frame { min-width: 0; }
.sidebar { display: none; }
.bottom-nav { display: grid; }

.app-header {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  color: #fff;
  padding: calc(12px + var(--safe-t)) 16px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.app-header h1 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.app-header .header-sub { margin: 3px 0 0; opacity: .78; font-size: 12px; }
.header-left { min-width: 0; }
.header-left h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.user-chip { display: none; }

.icon-btn {
  position: relative;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: #fff;
  background: rgba(255,255,255,.1);
  border: 0; cursor: pointer; font: inherit;
}
.icon-btn:hover { background: rgba(255,255,255,.18); }
.badge-dot {
  position: absolute; top: 4px; right: 4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px;
  background: var(--gold); color: #1a1403;
  font-size: 10px; font-weight: 800;
  display: grid; place-items: center;
  line-height: 1;
}

.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #1a1403; font-weight: 800; font-size: 14px;
  flex: 0 0 auto;
  overflow: hidden;
  position: relative;
}
.avatar.lg { width: 56px; height: 56px; font-size: 22px; }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.avatar.has-photo { background: #d7e2f0; padding: 0; }
.avatar.has-photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

.wrap { width: 100%; margin: 0; padding: 16px 16px calc(96px + var(--safe-b)); }
.grid { display: grid; gap: 12px; }
.grid-2, .grid-4 { grid-template-columns: 1fr; }
@media (min-width: 560px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat b { font-size: 22px; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 13px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700;
  white-space: nowrap;
}
.b-draft, .b-pending { background: #e2e8f0; color: #334155; }
.b-submitted, .b-sent, .b-reviewing, .b-received, .b-checking { background: var(--info-bg); color: var(--info); }
.b-approved, .b-paid, .b-passed, .b-acknowledged { background: var(--ok-bg); color: var(--ok); }
.b-warning, .b-revision { background: var(--warn-bg); color: var(--warn); }
.b-rejected, .b-failed, .b-returned, .b-cancelled { background: var(--bad-bg); color: var(--bad); }
.b-urgent { background: #ffe4e6; color: #9f1239; }
.b-high { background: var(--warn-bg); color: var(--warn); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 11px 14px; font-weight: 700; cursor: pointer;
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--navy-2); }
.btn-gold { background: var(--gold); color: #1a1403; }
.btn-gold:hover:not(:disabled) { background: var(--gold-2); }
.btn-ok { background: #15803d; color: #fff; }
.btn-bad { background: #b91c1c; color: #fff; }
.btn-ghost { background: #eef2f7; color: var(--navy); }
.btn-ghost:hover:not(:disabled) { background: #e2e8f0; }
.btn-ghost.is-active { background: var(--navy); color: #fff; }
.btn-block { width: 100%; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 700; }
.field input, .field select, .field textarea {
  border: 1px solid #d5deea; border-radius: 12px; padding: 11px 12px; background: #fff;
  color: var(--text); width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, .22);
}
.field textarea { min-height: 88px; resize: vertical; }

.input-wrap { position: relative; }
.input-wrap input { padding-right: 46px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.pw-toggle:hover, .pw-toggle.is-on { background: #f1f5f9; color: var(--navy); }
.pw-toggle svg { display: none; pointer-events: none; }
.pw-toggle .ico-show { display: block; }
.pw-toggle.is-on .ico-show { display: none; }
.pw-toggle.is-on .ico-hide { display: block; }
[hidden] { display: none !important; }

.list { display: flex; flex-direction: column; gap: 10px; }
.item {
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
  padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
a.item:hover { border-color: #c5d4ea; box-shadow: var(--shadow); }
.item.is-new { background: #f4f8ff; border-color: #d7e2f2; }
.item .meta { color: var(--muted); font-size: 12px; margin-top: 4px; }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(8px + var(--safe-b));
}
.bottom-nav a {
  text-align: center; font-size: 11px; color: var(--muted);
  padding: 6px 2px; border-radius: 12px; font-weight: 600;
}
.bottom-nav a.active { color: var(--navy); background: #eef4ff; font-weight: 800; }
.bottom-nav i { display: block; margin: 0 auto 5px; font-size: 16px; }

.check { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: 0 0 10px; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--gold); }
.dot.bad { background: var(--bad); }
.timeline { border-left: 2px solid var(--line); margin-left: 8px; padding-left: 14px; }
.timeline .ev { margin-bottom: 12px; }
.timeline .ev small { color: var(--muted); }

.toast {
  position: fixed; left: 12px; right: 12px; bottom: 86px; z-index: 50;
  background: var(--navy); color: #fff; padding: 12px 14px; border-radius: 12px;
  display: none; box-shadow: var(--shadow-lg);
}
.toast.show { display: block; }

.hint { background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 12px; padding: 10px; font-size: 12px; color: var(--muted); }
.hidden { display: none !important; }
.progress { height: 8px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--navy), var(--gold)); }
.drop {
  border: 1.5px dashed #b6c3d6; border-radius: 14px; padding: 18px; text-align: center; color: var(--muted); background: #f8fbff;
}
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.muted { color: var(--muted); }
.right { text-align: right; }
.top-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.score { font-size: 28px; font-weight: 800; }
.warn-banner { background: var(--warn-bg); color: #7c4a03; padding: 10px 12px; border-radius: 12px; margin-bottom: 12px; font-size: 13px; }
.profile-head { display: flex; align-items: center; gap: 14px; }

/* Login */
.login-page {
  min-height: 100dvh;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(201,162,39,.28), transparent 50%),
    radial-gradient(900px 420px at 110% 10%, rgba(27,75,134,.55), transparent 46%),
    linear-gradient(160deg, #0a1830 0%, #0e2240 42%, #1b4b86 78%, #8a7424 140%);
  display: grid; place-items: center; padding: 20px;
}
.login-shell {
  width: min(1040px, 100%);
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: grid;
}
.login-hero {
  display: none;
  background:
    radial-gradient(circle at 80% 0%, rgba(201,162,39,.22), transparent 36%),
    linear-gradient(165deg, #0c1d38, #16345f 70%);
  color: #fff;
  padding: 40px 36px;
  position: relative;
}
.login-hero::after {
  content: "";
  position: absolute; inset: auto 0 0 0; height: 4px;
  background: linear-gradient(90deg, var(--gold), var(--gold-2), transparent);
}
.login-brand {
  display: flex; align-items: center; gap: 12px; margin-bottom: 28px;
}
.login-brand img { width: 44px; height: 44px; border-radius: 12px; }
.login-brand small { display: block; opacity: .7; font-size: 12px; }
.login-hero h2 { margin: 0 0 10px; font-size: 32px; line-height: 1.25; }
.login-hero p { margin: 0 0 24px; opacity: .8; line-height: 1.6; }
.login-features { display: grid; gap: 12px; margin: 0; padding: 0; }
.login-features li {
  list-style: none; display: flex; gap: 10px; align-items: flex-start;
  font-size: 14px; opacity: .92;
}
.login-features i {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(201,162,39,.2); color: var(--gold-2);
  display: grid; place-items: center; flex: 0 0 22px; font-size: 11px;
}
.login-panel { padding: 28px 22px 24px; }
.login-card { width: 100%; }
.login-card .eyebrow { color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .04em; }
.login-card h2 { margin: 4px 0 6px; font-size: 28px; color: var(--navy); }
.login-card > .muted { margin: 0 0 18px; line-height: 1.55; }
.login-tools {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; margin: 2px 0 16px; flex-wrap: wrap;
}
.remember {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--text); cursor: pointer; user-select: none;
}
.remember input { width: 17px; height: 17px; accent-color: var(--navy); }
.login-error { color: var(--bad); min-height: 1.2em; margin: 10px 0 0; font-size: 13px; font-weight: 600; }
.account-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.account-chip {
  border: 1px solid #d5deea; background: #fff; color: var(--navy);
  border-radius: 999px; padding: 5px 10px; font-size: 11px; font-weight: 700; cursor: pointer;
}
.account-chip:hover { border-color: var(--gold); background: #fffbeb; }

.brand-mark { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand-mark img { width: 36px; height: 36px; border-radius: 10px; }
.brand-text { display: block; min-width: 0; }
.brand-text strong { display: block; font-size: 14px; line-height: 1.2; }
.brand-text em { display: block; font-size: 11px; opacity: .7; font-weight: 500; font-style: normal; }

.side-nav { display: flex; flex-direction: column; gap: 4px; padding: 8px; }
.side-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 12px;
  color: rgba(255,255,255,.74); font-weight: 700; font-size: 14px;
}
.side-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-nav a.active {
  background: rgba(255,255,255,.1);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--gold);
}
.side-nav i { flex: 0 0 22px; width: 22px; text-align: center; font-size: 16px; }
.side-nav a, .bottom-nav a { position: relative; }
.nav-badge {
  margin-left: auto;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px;
  background: #dc2626; color: #fff;
  font-size: 10px; font-weight: 800;
  display: grid; place-items: center;
  line-height: 1;
  pointer-events: none;
  box-shadow: 0 0 0 2px #0b1a32;
}
.nav-badge[hidden] { display: none !important; }
.bottom-nav .nav-badge {
  position: absolute;
  top: 2px;
  left: calc(50% + 7px);
  margin: 0;
  min-width: 16px; height: 16px;
  box-shadow: 0 0 0 2px #fff;
}
.sidebar-head { display: flex; align-items: flex-start; gap: 4px; }
.sidebar-toggle {
  display: none;
  flex: 0 0 36px;
  width: 36px; height: 36px;
  margin: 18px 12px 0 0;
  border: 0; border-radius: 10px;
  background: rgba(255,255,255,.08); color: #fff;
  cursor: pointer;
  place-items: center;
}
.sidebar-toggle:hover { background: rgba(255,255,255,.16); }
.chip-caret { font-size: 11px; opacity: .7; }
.pop-link i { width: 16px; margin-right: 8px; text-align: center; }
.side-nav .nav-count {
  margin-left: auto;
  background: var(--gold); color: #1a1403;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; font-size: 11px;
  display: grid; place-items: center;
}
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.4); padding: 14px 20px 6px; font-weight: 800; }
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 14px 16px; border: 0;
  border-top: 1px solid rgba(255,255,255,.08);
  background: transparent; color: #fff; cursor: pointer;
}
.sidebar-user:hover { background: rgba(255,255,255,.06); }
.sidebar-user b { display: block; font-size: 13px; }
.sidebar-user > div span { display: block; font-size: 12px; opacity: .7; }

.desk-only { display: none; }
.menu-wrap { position: relative; }
.pop {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  z-index: 70;
  overflow: hidden;
}
.menu-wrap.is-open .pop { display: block; }
.pop-notify { width: min(400px, calc(100vw - 32px)); }
.pop-account { width: min(280px, calc(100vw - 32px)); }
.pop-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.pop-bar b { font-size: 14px; }
.btn-text {
  border: 0; background: none; color: var(--navy);
  font: inherit; font-weight: 700; font-size: 12px; cursor: pointer; padding: 4px 6px;
}
.pop-list { max-height: min(420px, 70vh); overflow: auto; }
.pop-empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.pop-empty i { display: block; font-size: 22px; color: var(--gold); margin-bottom: 8px; }
.pop-empty b { display: block; color: var(--navy); font-size: 14px; margin-bottom: 4px; }
.pop-empty span { display: block; font-size: 12px; line-height: 1.45; }
.pop-item {
  display: block; padding: 12px 14px; border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.pop-item:last-child { border-bottom: 0; }
.pop-item:hover { background: #f8fafc; }
.pop-item.is-new { background: #f4f8ff; }
.pop-item b { display: block; font-size: 13px; color: var(--navy); }
.pop-item span { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.pop-head {
  display: flex; gap: 10px; align-items: center;
  padding: 14px; border-bottom: 1px solid var(--line);
}
.pop-head b { display: block; font-size: 14px; }
.pop-head small { display: block; font-size: 12px; color: var(--muted); }
.pop-link {
  display: block; width: 100%; text-align: left;
  padding: 11px 14px; border: 0; background: #fff;
  color: var(--text); font: inherit; font-weight: 700; font-size: 13px; cursor: pointer;
}
.pop-link:hover { background: #f8fafc; }
.pop-link.pop-danger { color: var(--bad); border-top: 1px solid var(--line); }
.sidebar-account .pop { top: auto; bottom: calc(100% + 8px); left: 10px; right: 10px; width: auto; }

@media (max-width: 599px) {
  .top-actions { align-items: stretch; }
  .top-actions .btn { width: 100%; }
}

@media (min-width: 880px) {
  .app-body {
    display: flex;
    align-items: stretch;
    background:
      radial-gradient(900px 280px at 100% 0%, rgba(201,162,39,.08), transparent 40%),
      var(--bg);
  }
  .sidebar {
    display: flex;
    flex-direction: column;
    position: sticky; top: 0;
    height: 100dvh;
    width: var(--sidebar);
    flex: 0 0 var(--sidebar);
    background: linear-gradient(180deg, #0b1a32 0%, #0e2240 55%, #122a4d 100%);
    color: #fff;
    z-index: 40;
    box-shadow: 8px 0 30px rgba(14, 34, 64, .08);
  }
  .sidebar .brand-mark { padding: 22px 10px 16px 18px; flex: 1; min-width: 0; }
  .sidebar-toggle { display: grid; }
  .side-nav { flex: 1; overflow: auto; }
  html.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed);
    flex: 0 0 var(--sidebar-collapsed);
  }
  html.sidebar-collapsed .brand-text,
  html.sidebar-collapsed .sidebar .nav-text,
  html.sidebar-collapsed .sidebar-user > div:not(.avatar) {
    display: none;
  }
  html.sidebar-collapsed .sidebar-head { flex-direction: column; align-items: center; justify-content: center; padding-top: 8px; }
  html.sidebar-collapsed .sidebar .brand-mark { flex: 0 0 auto; padding: 14px 8px 8px; justify-content: center; }
  html.sidebar-collapsed .sidebar-toggle { margin: 0 0 10px; }
  html.sidebar-collapsed .side-nav a { justify-content: center; padding: 12px 8px; }
  html.sidebar-collapsed .side-nav .nav-badge {
    position: absolute;
    top: 4px; right: 4px;
    margin: 0;
    min-width: 16px; height: 16px;
    font-size: 9px;
  }
  html.sidebar-collapsed .sidebar-user { justify-content: center; padding: 14px 8px; }
  html.sidebar-collapsed .sidebar-account .pop {
    left: calc(100% + 8px);
    right: auto;
    bottom: 12px;
    width: min(280px, calc(100vw - 100px));
  }
  .app-frame { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .bottom-nav { display: none; }
  .app-header {
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(12px);
    color: var(--text);
    padding: 14px 28px;
    border-bottom: 1px solid var(--line);
    box-shadow: none;
  }
  .app-header h1 { font-size: 22px; }
  .app-header .header-sub { display: none; }
  .icon-btn { color: var(--navy); background: #eef2f7; }
  .icon-btn:hover { background: #e2e8f0; }
  .desk-only { display: block; }
  .mobile-only { display: none !important; }
  .app-header { z-index: 50; }
  .user-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 4px 10px 4px 4px;
    border: 0; cursor: pointer; font: inherit;
    border-radius: 999px; background: #eef2f7; color: var(--navy);
    font-size: 13px; font-weight: 700;
  }
  .user-chip:hover { background: #e2e8f0; }
  .user-chip small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
  .wrap { padding: 24px 28px 40px; }
  .toast { left: auto; right: 24px; bottom: 24px; width: min(380px, calc(100% - 48px)); }
  .card { padding: 18px; }
  .stat b { font-size: 26px; }
}

@media (min-width: 900px) {
  .login-shell { grid-template-columns: 1.05fr .95fr; min-height: 620px; }
  .login-hero { display: block; }
  .login-panel { padding: 40px 42px; display: grid; align-content: center; }
}

.nav-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px; z-index: 130;
  pointer-events: none; opacity: 0;
  overflow: hidden;
  background: transparent;
}
.nav-progress.show { opacity: 1; }
.nav-progress-bar {
  height: 100%; width: 34%;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
  border-radius: 0 2px 2px 0;
  transform: translateX(-120%);
}
.nav-progress.show .nav-progress-bar { animation: nav-slide 1s ease-in-out infinite; }
@keyframes nav-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(340%); }
}
a.is-nav-pending, tr.is-nav-pending { pointer-events: none; opacity: .62; }
body.is-leaving { cursor: progress; }

.page-loader {
  position: fixed; inset: 0; z-index: 80;
  display: none; place-items: center;
  background: rgba(10, 24, 48, .38);
  backdrop-filter: blur(6px);
}
.page-loader.show { display: grid; }
.page-loader .spin-card {
  background: #fff; border-radius: 18px; padding: 22px 28px;
  box-shadow: var(--shadow-lg); text-align: center; min-width: 180px;
}
.spinner {
  width: 36px; height: 36px; margin: 0 auto 10px;
  border: 3px solid #e2e8f0; border-top-color: var(--gold);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.page-enter { animation: rise .45s ease both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.hero-panel {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #0b1a32 0%, #16345f 58%, #1d4a7a 100%);
  color: #fff; border: 0; margin-bottom: 16px;
}
.hero-panel::after {
  content: "";
  position: absolute; right: -40px; top: -40px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201,162,39,.28), transparent 68%);
}
.hero-panel .hero-grid {
  display: grid; gap: 16px; position: relative; z-index: 1;
}
.hero-kicker {
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold-2); font-weight: 800; margin: 0 0 6px;
}
.hero-who { display: flex; align-items: flex-start; gap: 14px; }
.hero-panel .avatar.lg { box-shadow: 0 0 0 3px rgba(255,255,255,.18); }
.hero-panel h2 { margin: 0 0 8px; font-size: 26px; }
.hero-panel p { margin: 0; opacity: .82; line-height: 1.6; max-width: 52ch; }
.role-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.12); border-radius: 999px;
  padding: 5px 10px; font-size: 12px; font-weight: 700;
}

.kpi {
  display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center;
  transition: transform .2s ease, box-shadow .2s ease;
  animation: rise .5s ease both;
}
.kpi:nth-child(2) { animation-delay: .05s; }
.kpi:nth-child(3) { animation-delay: .1s; }
.kpi:nth-child(4) { animation-delay: .15s; }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.kpi-ico {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center; font-weight: 800;
}
.kpi-ico.navy { background: #e8eef8; color: var(--navy); }
.kpi-ico.gold { background: #fff6d8; color: #8a6d12; }
.kpi-ico.ok { background: var(--ok-bg); color: var(--ok); }
.kpi-ico.info { background: var(--info-bg); color: var(--info); }
.kpi-ico.warn { background: var(--warn-bg); color: var(--warn); }
.kpi-ico i { font-size: 18px; }
.kpi .stat b { font-size: 22px; }
.kpi small { color: var(--muted); font-size: 12px; }

.chart-card h3 { margin: 0 0 4px; font-size: 16px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 12px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 700; }
.swatch { width: 10px; height: 10px; border-radius: 3px; }
.bar-chart { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; align-items: end; height: 180px; padding-top: 8px; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar {
  width: 100%; max-width: 36px; border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, var(--gold-2), var(--navy));
  transform-origin: bottom;
  animation: grow .7s ease both;
}
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.bar-col em { font-style: normal; font-size: 11px; color: var(--muted); font-weight: 700; }
.bar-col b { font-size: 10px; color: var(--navy); }

.donut-wrap { display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: center; }
.donut { width: 140px; height: 140px; }
.empty-state { padding: 18px 8px; text-align: center; color: var(--muted); }
.empty-state > i { display: block; font-size: 28px; margin-bottom: 8px; opacity: .55; }

.skel { background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 37%, #eef2f7 63%); background-size: 400% 100%; animation: shimmer 1.2s infinite; border-radius: 12px; }
@keyframes shimmer { to { background-position: -400% 0; } }
.skel-h { height: 86px; }
.skel-row { height: 54px; }

.page-loading { display: grid; gap: 12px; }
.page-loading-card {
  display: grid; place-items: center; text-align: center; gap: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 20px 22px; box-shadow: var(--shadow);
}
.page-loading-card .spinner { margin-bottom: 6px; }
.page-loading-card b { font-size: 15px; color: var(--navy); }
.page-loading-card .muted { font-size: 13px; }
.page-loading.is-list { gap: 10px; }
.page-loading-inline {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; font-weight: 700; color: var(--navy);
}
.page-loading.is-compact {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px 12px; color: var(--muted); font-weight: 700; font-size: 13px;
}
.spinner-sm { width: 22px; height: 22px; margin: 0; border-width: 2px; }

@media (min-width: 880px) {
  .hero-panel .hero-grid { grid-template-columns: 1.3fr .7fr; align-items: center; }
  .donut-wrap { grid-template-columns: 160px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .item, .field input { transition: none; }
  .btn:hover:not(:disabled) { transform: none; }
  .page-enter, .kpi, .bar { animation: none; }
  .spinner { animation: none; }
  .skel, .nav-progress.show .nav-progress-bar { animation: none; }
}

.sum-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.sum-grid > div {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.sum-grid span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.sum-grid b { display: block; margin-top: 4px; font-size: 16px; }
.b-ecommerce { background: #ede9fe; color: #6d28d9; }
.b-b2b { background: #e0f2fe; color: #0369a1; }
.b-retail { background: #ecfccb; color: #3f6212; }
.b-project { background: #ffedd5; color: #9a3412; }
.drop select { display: block; width: 100%; margin-bottom: 10px; border: 1px solid #d5deea; border-radius: 10px; padding: 10px; }
@media (min-width: 700px) {
  .sum-grid { grid-template-columns: repeat(4, 1fr); }
}

.sheet { width: 100%; border-collapse: collapse; }
.sheet th {
  font-size: 12px; font-weight: 800; color: #fff;
  background: var(--navy); padding: 8px 8px; white-space: nowrap;
}
.sheet th:first-child { border-radius: 10px 0 0 0; }
.sheet th:last-child { border-radius: 0 10px 0 0; }
.sheet td { padding: 4px; vertical-align: middle; border-bottom: 1px solid var(--line); }
.sheet-in {
  width: 100%; border: 1px solid #d5deea; border-radius: 8px;
  padding: 8px 10px; background: #fff; color: var(--text); min-width: 0;
}
.sheet-in:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,.22); }
.sheet-del { padding: 6px 8px; font-size: 12px; }
.sheet-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; }
.sheet-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.sheet-total { margin-top: 8px; font-weight: 800; color: var(--navy); }
.sheet-pay { font-weight: 700; padding-right: 8px; }
.sum-line {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.sum-line:last-child { border-bottom: 0; }
.sum-line-main { font-weight: 800; color: var(--navy); }
.sum-line-gold { background: #fff8e1; margin: 8px -12px 0; padding: 10px 12px; border-radius: 10px; border: 0; font-weight: 800; }
.doc-check { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.doc-flag {
  display: inline-flex; align-items: center;
  border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700;
}
.doc-flag.is-ok { background: var(--ok-bg); color: var(--ok); }
.doc-flag.is-wait { background: var(--warn-bg); color: var(--warn); }
.doc-slots { display: grid; gap: 10px; margin-top: 8px; }
.doc-slot {
  display: block; border: 1px dashed #b6c3d6; border-radius: 12px;
  padding: 12px; background: #f8fbff; cursor: pointer;
}
.doc-slot input[type=file] { display: block; margin-top: 8px; width: 100%; }
@media (min-width: 700px) {
  .doc-slots { grid-template-columns: 1fr 1fr; }
}

.audit-card {
  padding: 0;
  overflow: hidden;
  margin-bottom: 12px;
}
.audit-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 18px;
  align-items: center;
  padding: 20px 18px 18px;
  color: #fff;
  background:
    radial-gradient(circle at 92% -10%, rgba(201,162,39,.28), transparent 42%),
    linear-gradient(135deg, #0b1a32 0%, #16345f 58%, #1d4a7a 100%);
}
.audit-hero::after {
  content: "";
  position: absolute;
  right: -36px;
  bottom: -48px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.08), transparent 68%);
  pointer-events: none;
}
.audit-board.is-passed .audit-hero {
  background:
    radial-gradient(circle at 92% -10%, rgba(74,222,128,.2), transparent 44%),
    linear-gradient(135deg, #0b1a32 0%, #16345f 62%, #14532d 140%);
}
.audit-board.is-warning .audit-hero {
  background:
    radial-gradient(circle at 92% -10%, rgba(227,194,91,.3), transparent 44%),
    linear-gradient(135deg, #0b1a32 0%, #16345f 62%, #854d0e 140%);
}
.audit-board.is-failed .audit-hero {
  background:
    radial-gradient(circle at 92% -10%, rgba(248,113,113,.22), transparent 44%),
    linear-gradient(135deg, #0b1a32 0%, #16345f 62%, #7f1d1d 140%);
}
.audit-ring {
  --p: 0;
  --tone: var(--gold-2);
  width: 118px;
  height: 118px;
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  margin: 0 auto;
}
.audit-ring::before {
  content: "";
  position: absolute;
  inset: 16%;
  border-radius: 50%;
  background: rgba(8, 18, 36, .35);
}
.audit-ring svg {
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  position: relative;
  z-index: 1;
}
.audit-ring-track, .audit-ring-bar {
  fill: none;
  stroke-width: 3.1;
}
.audit-ring-track { stroke: rgba(255,255,255,.22); }
.audit-ring-bar {
  stroke: var(--tone);
  stroke-linecap: round;
  stroke-dasharray: var(--p) 100;
  filter: drop-shadow(0 0 8px rgba(227, 194, 91, .45));
}
.audit-ring-val {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.audit-ring-val small {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  opacity: .78;
}
.audit-hero-copy { position: relative; z-index: 1; text-align: center; }
.audit-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold-2);
}
.audit-hero-copy h3 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.02em; }
.audit-hero-copy > p { margin: 0; opacity: .82; line-height: 1.55; }
.audit-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 700;
  opacity: .9;
}
.audit-body { padding: 14px 14px 16px; }
.audit-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.audit-kpi {
  appearance: none;
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 14px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}
.audit-kpi b {
  display: block;
  font-size: 22px;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.audit-kpi span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 700; }
.audit-kpi.is-ok b { color: var(--ok); }
.audit-kpi.is-warn b { color: var(--warn); }
.audit-kpi.is-bad b { color: var(--bad); }
.audit-kpi:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.audit-kpi.is-on {
  background: #eef4ff;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(14, 34, 64, .14);
}
.audit-kpi.is-ok.is-on { border-color: var(--ok); box-shadow: 0 0 0 3px rgba(21, 128, 61, .14); }
.audit-kpi.is-warn.is-on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 162, 39, .2); }
.audit-kpi.is-bad.is-on { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(185, 28, 28, .14); }
.audit-mix {
  display: flex;
  height: 7px;
  border-radius: 99px;
  overflow: hidden;
  background: #e2e8f0;
  margin: 12px 0 14px;
}
.audit-mix i { display: block; min-width: 0; }
.audit-mix .ok { background: var(--ok); }
.audit-mix .warn { background: var(--gold); }
.audit-mix .bad { background: var(--bad); }
.audit-list { display: grid; gap: 8px; }
.audit-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.audit-item.is-ok { background: #f8fafc; }
.audit-item.is-warn { background: #fffbeb; border-color: #fde68a; }
.audit-item.is-bad { background: #fff7f7; border-color: #fecaca; }
.audit-ico {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.audit-item.is-ok .audit-ico { background: var(--ok-bg); color: var(--ok); }
.audit-item.is-warn .audit-ico { background: var(--warn-bg); color: var(--warn); }
.audit-item.is-bad .audit-ico { background: var(--bad-bg); color: var(--bad); }
.audit-item b { display: block; font-size: 14px; }
.audit-item .muted { margin-top: 3px; font-size: 13px; line-height: 1.45; }
.audit-tag {
  align-self: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  background: #e2e8f0;
  color: #334155;
}
.audit-item.is-ok .audit-tag { background: var(--ok-bg); color: var(--ok); }
.audit-item.is-warn .audit-tag { background: var(--warn-bg); color: var(--warn); }
.audit-item.is-bad .audit-tag { background: var(--bad-bg); color: var(--bad); }
.audit-empty { text-align: center; padding: 18px 8px; }
.audit-passed {
  border: 1px solid #d7eadb;
  border-radius: 14px;
  background: #f3faf5;
}
.audit-passed summary {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}
.audit-passed summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid #7a8b76;
  border-bottom: 2px solid #7a8b76;
  transform: rotate(45deg);
  margin-right: 6px;
  transition: transform .15s ease;
}
.audit-passed[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.audit-passed summary::-webkit-details-marker,
.audit-passed summary::marker { display: none; content: none; }
.audit-passed summary b { display: block; font-size: 14px; }
.audit-passed summary small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.audit-passed > summary .audit-ico { background: var(--ok-bg); color: var(--ok); }
.audit-passed-list { display: grid; gap: 8px; padding: 0 10px 10px; }
.audit-passed[open] summary { border-bottom: 1px solid #d7eadb; margin-bottom: 10px; }
.audit-board .is-off { display: none !important; }

@media (min-width: 640px) {
  .audit-hero {
    grid-template-columns: auto 1fr;
    padding: 22px 24px;
  }
  .audit-ring { margin: 0; width: 128px; height: 128px; }
  .audit-hero-copy { text-align: left; }
  .audit-hero-meta { justify-content: flex-start; }
  .audit-body { padding: 16px 18px 18px; }
  .audit-kpis { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 420px) {
  .audit-tag { display: none; }
  .audit-item { grid-template-columns: auto 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .audit-kpi { transition: none; }
  .audit-kpi:hover { transform: none; }
}

.claim-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% -10%, rgba(201,162,39,.28), transparent 42%),
    linear-gradient(135deg, #0b1a32 0%, #16345f 58%, #1d4a7a 100%);
  color: #fff;
  border: 0;
  margin-bottom: 14px;
}
.claim-hero::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.08), transparent 68%);
  pointer-events: none;
}
.claim-hero-grid {
  display: grid;
  gap: 16px;
  position: relative;
  z-index: 1;
}
.claim-hero h2 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.claim-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin: 0 0 8px;
}
.claim-status { display: flex; flex-wrap: wrap; gap: 8px; }
.claim-status .badge {
  font-size: 14px;
  padding: 7px 14px;
  box-shadow: 0 0 0 3px rgba(255,255,255,.16);
}
.claim-owner { margin: 0; opacity: .82; font-weight: 700; }
.claim-route {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.claim-route span {
  background: rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 13px;
  font-weight: 700;
}
.claim-route i {
  width: 26px;
  height: 2px;
  background: var(--gold-2);
  position: relative;
  flex: 0 0 26px;
}
.claim-route i::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -4px;
  border: 5px solid transparent;
  border-left-color: var(--gold-2);
}
.claim-amt {
  background: rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 16px 18px;
  position: relative;
  z-index: 1;
}
.claim-amt span { display: block; font-size: 12px; font-weight: 700; opacity: .75; }
.claim-amt b {
  display: block;
  margin: 4px 0 2px;
  font-size: 28px;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.claim-amt small { opacity: .75; font-size: 12px; font-weight: 700; }
.claim-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  position: relative;
  z-index: 1;
}
.claim-flow {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  position: relative;
  z-index: 1;
}
.claim-flow-step {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 8px 10px;
}
.claim-flow-step i {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  font-style: normal;
  background: rgba(255,255,255,.16);
  flex: 0 0 24px;
}
.claim-flow-step b { display: block; font-size: 12px; }
.claim-flow-step small { display: block; opacity: .75; font-size: 11px; font-weight: 600; }
.claim-flow-step.is-done i { background: #15803d; color: #fff; }
.claim-flow-step.is-now { background: rgba(227,194,91,.2); }
.claim-flow-step.is-now i { background: var(--gold); color: #1a1403; }
.claim-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,.1);
  position: relative;
  z-index: 1;
}
.claim-note b { display: block; margin-bottom: 4px; }
.claim-note span { display: block; opacity: .86; font-size: 13px; font-weight: 600; line-height: 1.45; }
.audit-dock {
  display: grid;
  gap: 12px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}
.claim-dock-copy b { display: block; font-size: 15px; }
.claim-dock-copy .muted { margin-top: 3px; font-size: 13px; }
.claim-dock-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.audit-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  align-self: center;
}
.audit-jump {
  appearance: none;
  border: 0;
  background: #eef2f7;
  color: var(--navy);
  border-radius: 999px;
  padding: 4px 10px;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.audit-jump:hover { background: #e2e8f0; }
.audit-item.is-focus {
  box-shadow: 0 0 0 3px rgba(29, 78, 216, .22);
  border-color: #93c5fd;
}
.tl-wrap { padding: 16px; margin-bottom: 12px; }
.tl-title { margin-bottom: 14px; }
.tl-title b { display: block; font-size: 16px; }
.tl-empty { padding: 8px 0; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
  position: relative;
  padding-bottom: 14px;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 20px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}
.tl-item:last-child::before { display: none; }
.tl-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #94a3b8;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #cbd5e1;
  z-index: 1;
  margin-top: 2px;
}
.tl-item.is-submitted .tl-dot,
.tl-item.is-reviewing .tl-dot,
.tl-item.is-checking .tl-dot { background: var(--info); box-shadow: 0 0 0 2px #93c5fd; }
.tl-item.is-approved .tl-dot,
.tl-item.is-paid .tl-dot { background: var(--ok); box-shadow: 0 0 0 2px #86efac; }
.tl-item.is-revision .tl-dot { background: var(--gold); box-shadow: 0 0 0 2px #fde68a; }
.tl-item.is-rejected .tl-dot,
.tl-item.is-cancelled .tl-dot { background: var(--bad); box-shadow: 0 0 0 2px #fecaca; }
.tl-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
}
.tl-item.is-now .tl-card { background: #f8fbff; border-color: #c5d4ea; }
.tl-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.tl-now {
  font-size: 11px;
  font-weight: 800;
  background: var(--info-bg);
  color: var(--info);
  border-radius: 999px;
  padding: 3px 8px;
}
.tl-meta { margin-top: 4px; color: var(--muted); font-size: 13px; font-weight: 600; }
.tl-card time { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); font-weight: 700; }

.ecom-sum-card { margin-bottom: 12px; }
.sheet-foot {
  display: grid;
  gap: 14px;
  margin-top: 12px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.sheet-foot .sheet-total { margin: 0; align-self: center; }
.sheet-deduct label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 6px;
}
.sheet-deduct small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.sum-deduct-in {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
}
.sum-deduct-in input {
  width: 100%;
  border: 1px solid #d5deea;
  border-radius: 12px;
  padding: 10px 12px;
  text-align: right;
  font-weight: 800;
  background: #fff;
  color: var(--text);
}
.sum-deduct-in input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,162,39,.22);
}
.sum-deduct-in input[readonly] { background: #f8fafc; }
.sum-deduct-in span { font-size: 13px; font-weight: 800; color: var(--muted); white-space: nowrap; }
.sheet-dock {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.sheet-dock .btn { min-width: 220px; }
@media (min-width: 640px) {
  .sheet-foot { grid-template-columns: 1fr auto; align-items: center; }
}
@media (min-width: 720px) {
  .claim-hero-grid { grid-template-columns: 1.15fr .85fr; align-items: center; }
  .claim-flow { grid-template-columns: repeat(4, 1fr); }
  .audit-dock {
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 16px 18px;
  }
}
@media (max-width: 599px) {
  .claim-dock-btns .btn { flex: 1 1 calc(50% - 8px); }
  .claim-dock-btns .btn-gold,
  .claim-dock-btns .btn-ok,
  .claim-dock-btns .btn-bad { flex: 1 1 100%; }
  .audit-item { grid-template-columns: auto 1fr; }
  .audit-side { display: none; }
  .sheet-dock .btn { width: 100%; min-width: 0; }
}

.confirm-back {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(10, 24, 48, .52);
  backdrop-filter: blur(8px);
}
.confirm-back.show { display: grid; }
.confirm-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 22px;
  padding: 28px 24px 20px;
  box-shadow: 0 28px 70px rgba(14, 34, 64, .28);
  text-align: center;
  animation: rise .28s ease both;
}
.confirm-ico {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #e3c25b, #c9a227);
  color: #1a1403;
  box-shadow: 0 10px 22px rgba(201, 162, 39, .35);
}
.confirm-card.is-ok .confirm-ico { background: linear-gradient(135deg, #22c55e, #15803d); color: #fff; box-shadow: 0 10px 22px rgba(21, 128, 61, .28); }
.confirm-card.is-bad .confirm-ico { background: linear-gradient(135deg, #f87171, #b91c1c); color: #fff; box-shadow: 0 10px 22px rgba(185, 28, 28, .28); }
.confirm-card h3 {
  margin: 0 0 8px;
  font-size: 21px;
  letter-spacing: -.02em;
  color: var(--navy);
}
.confirm-card p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 600;
}
.confirm-btns {
  display: flex;
  gap: 10px;
}
.confirm-btns .btn { flex: 1; min-height: 48px; font-weight: 800; }
.confirm-btns .btn-ghost { border: 1px solid #d5deea; background: #fff; }
.confirm-btns .btn-gold {
  background: linear-gradient(135deg, #e3c25b, #c9a227);
  box-shadow: 0 10px 20px rgba(201, 162, 39, .32);
}
@media (prefers-reduced-motion: reduce) {
  .confirm-card { animation: none; }
}

.inbox-hero { margin-bottom: 14px; }
.inbox-hero.is-review {
  background: linear-gradient(135deg, #0b1a32 0%, #123a56 52%, #0f6a6a 130%);
}
.inbox-hero.is-mine {
  background: linear-gradient(135deg, #0b1a32 0%, #16345f 58%, #1d4a7a 100%);
}
.inbox-hero.is-admin {
  background: linear-gradient(135deg, #14120c 0%, #1b2a18 42%, #3d3420 100%);
}
.inbox-hero.is-lead {
  background: linear-gradient(135deg, #0b1a32 0%, #1a2744 55%, #3b2a12 120%);
}
.inbox-hero-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.inbox-hero-actions { display: flex; justify-content: flex-end; align-items: center; }
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.inbox-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 14px 0 12px;
  flex-wrap: wrap;
}
.inbox-toolbar:not(.users-toolbar) {
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
}
.inbox-filters {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px 0;
}
.inbox-filters::-webkit-scrollbar { display: none; }
.inbox-tab {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--navy);
  font: inherit;
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease, transform .16s ease;
}
.inbox-tab i { font-size: 12px; color: var(--muted); transition: color .18s ease; }
.inbox-tab:hover { background: #e8eef8; }
.inbox-tab.is-active {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 6px 16px rgba(14, 34, 64, .16);
}
.inbox-tab.is-active i { color: var(--gold-2); }
.inbox-tab-n {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e8eef8;
  color: var(--navy);
  font-size: 11px;
  font-weight: 800;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}
.inbox-tab-n:empty { display: none; }
.inbox-tab.is-active .inbox-tab-n {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}
.inbox-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin-left: auto;
  min-width: 0;
}
.inbox-toolbar:not(.users-toolbar) .inbox-tools { flex-wrap: nowrap; }
.view-switch {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.view-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .18s ease, color .18s ease;
}
.view-btn.is-active {
  background: var(--navy);
  color: #fff;
}
.table-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.data-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.data-table thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  z-index: 1;
}
.data-table th button {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 800;
  padding: 0;
  cursor: pointer;
}
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: #f5f8fc; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table .meta { margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 600; }
.data-table.is-manage { min-width: 980px; }
.data-table.is-manage tbody tr { cursor: default; }
.data-table.is-manage tbody tr:hover { background: #f8fafc; }
.inbox-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(280px, 100%);
}
.inbox-search.is-icon {
  position: relative;
  min-width: 220px;
  max-width: 320px;
  flex: 0 1 280px;
}
.inbox-search.is-icon > i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
}
.inbox-search input {
  width: 100%;
  border: 1px solid #d5deea;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
}
.inbox-search.is-icon input { padding-left: 36px; }
.inbox-search input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, .22);
}
.inbox-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: -2px 0 12px;
}
.inbox-date {
  display: grid;
  gap: 4px;
  min-width: 140px;
}
.inbox-date span {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}
.inbox-date input,
.inbox-date select {
  border: 1px solid #d5deea;
  border-radius: 12px;
  padding: 9px 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  min-height: 42px;
}
.inbox-date input:focus,
.inbox-date select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, .22);
}
@keyframes inbox-in {
  from { opacity: .45; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}
.inbox-board.is-swap > *,
#list.is-swap > * {
  animation: inbox-in .22s ease both;
}
.inbox-kpi {
  width: 100%;
  text-align: left;
  font: inherit;
  cursor: pointer;
  color: inherit;
}
.inbox-kpi.is-on {
  border-color: #c5d4ea;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, .12);
}
.inbox-board { display: grid; gap: 12px; }
.inbox-split {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}
.inbox-col {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  min-width: 0;
}
.inbox-col-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}
.inbox-col-head b { display: block; font-size: 15px; }
.inbox-col-head small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 600; }
.inbox-count {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #eef2f7;
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
}
.inbox-list { display: flex; flex-direction: column; gap: 10px; }
.inbox-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  border-left-width: 4px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.inbox-card:hover { border-color: #c5d4ea; box-shadow: var(--shadow); }
.inbox-card.is-draft, .inbox-card.is-checking { border-left-color: #94a3b8; }
.inbox-card.is-sent, .inbox-card.is-received { border-left-color: var(--info); }
.inbox-card.is-acknowledged { border-left-color: var(--ok); }
.inbox-card.is-returned, .inbox-card.is-rejected { border-left-color: var(--bad); }
.inbox-card.is-submitted, .inbox-card.is-reviewing { border-left-color: var(--info); }
.inbox-card.is-revision { border-left-color: var(--warn); }
.inbox-card.is-approved { border-left-color: var(--ok); }
.inbox-card.is-paid { border-left-color: #0f766e; }
.inbox-card.is-rejected, .inbox-card.is-cancelled { border-left-color: var(--bad); }
.inbox-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.inbox-card-top b { font-size: 15px; }
.inbox-card-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.inbox-card-who { color: var(--muted); font-size: 12px; margin-top: 5px; font-weight: 600; }
.inbox-card-next {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--navy);
}
.inbox-card-amt { text-align: right; min-width: 120px; }
.inbox-card-amt span { display: block; font-size: 11px; font-weight: 800; color: var(--muted); }
.inbox-card-amt b {
  display: block;
  margin: 2px 0;
  font-size: 18px;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.inbox-card-amt small { display: block; color: var(--muted); font-size: 11px; font-weight: 700; }
.inbox-empty { text-align: center; padding: 28px 16px; display: grid; gap: 8px; justify-items: center; }
.inbox-empty b { font-size: 16px; }
@media (min-width: 880px) {
  .inbox-split { grid-template-columns: 1fr 1fr; }
  .inbox-split:has(> .inbox-col:nth-child(3)) { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 879px) {
  .inbox-toolbar:not(.users-toolbar) {
    flex-wrap: wrap;
  }
  .inbox-toolbar:not(.users-toolbar) .inbox-filters {
    flex: 1 1 100%;
    width: 100%;
  }
  .inbox-toolbar:not(.users-toolbar) .inbox-tools {
    flex: 1 1 100%;
    width: 100%;
    margin-left: 0;
  }
  .inbox-search.is-icon {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
  }
  .inbox-meta { margin-top: 0; }
  .inbox-date { flex: 1 1 140px; min-width: 0; }
  .xfer-form-actions .btn { flex: 1; }
}
@media (max-width: 599px) {
  .inbox-card { grid-template-columns: 1fr; }
  .inbox-card-amt { text-align: left; }
  .view-btn { padding: 8px 10px; }
  .view-btn span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .inbox-tab, .view-btn { transition: none; }
  .inbox-board.is-swap > *,
  #list.is-swap > * { animation: none; }
}

.logs-page { display: grid; gap: 14px; }
.logs-hero p { max-width: 68ch; }
.logs-readway {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  margin-top: 16px; font-size: 13px; font-weight: 700;
}
.logs-readway span {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.12); border-radius: 999px; padding: 6px 10px;
}
.logs-readway > i { opacity: .55; font-size: 11px; }
.logs-kpis {
  display: grid; gap: 12px;
  grid-template-columns: 1fr 1fr;
}
.logs-kpi {
  appearance: none; -webkit-appearance: none;
  width: 100%; text-align: left; font: inherit; cursor: pointer; color: inherit;
  animation: rise .5s ease both;
}
.logs-kpi:nth-child(2) { animation-delay: .04s; }
.logs-kpi:nth-child(3) { animation-delay: .08s; }
.logs-kpi:nth-child(4) { animation-delay: .12s; }
.logs-kpi:nth-child(5) { animation-delay: .16s; }
.logs-kpi:nth-child(6) { animation-delay: .2s; }
.logs-page .kpi-ico.bad { background: var(--bad-bg); color: var(--bad); }
.logs-board { padding: 16px; }
.logs-toolbar { display: grid; gap: 12px; }
.logs-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.logs-filters {
  display: grid; gap: 8px;
  grid-template-columns: 1fr;
}
.logs-filter, .logs-search {
  display: flex; align-items: center; gap: 8px;
  min-width: 0;
}
.logs-filter span { color: var(--muted); font-size: 12px; font-weight: 800; white-space: nowrap; }
.logs-filter input, .logs-search input {
  width: 100%; border: 1px solid #d5deea; border-radius: 12px;
  padding: 10px 12px; background: #fff; color: var(--text); font: inherit;
}
.logs-filter input:focus, .logs-search input:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, .22);
}
.logs-search { position: relative; }
.logs-search > i {
  position: absolute; left: 12px; color: var(--muted); pointer-events: none;
}
.logs-search input { padding-left: 36px; }
.logs-count { margin: 12px 0 8px; font-weight: 700; }
.logs-feed { display: flex; flex-direction: column; gap: 0; }
.logs-feed.is-swap { animation: logs-swap .28s ease; }
.logs-row {
  display: grid;
  grid-template-columns: 18px auto 1fr auto;
  gap: 10px 12px;
  align-items: start;
  padding: 12px 4px 12px 0;
  border-bottom: 1px solid var(--line);
  animation: logs-swap .34s ease both;
}
a.logs-row:hover { background: #f8fafc; }
.logs-row:last-child { border-bottom: 0; }
.logs-rail {
  position: relative; display: flex; justify-content: center; align-self: stretch;
}
.logs-rail::before {
  content: ""; position: absolute; top: 18px; bottom: -12px; width: 2px; background: #e2e8f0;
}
.logs-row:last-child .logs-rail::before { display: none; }
.logs-dot {
  width: 12px; height: 12px; margin-top: 8px; border-radius: 50%;
  background: var(--navy); box-shadow: 0 0 0 4px #e8eef8; position: relative; z-index: 1;
}
.logs-dot.tone-ok { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); }
.logs-dot.tone-info { background: var(--info); box-shadow: 0 0 0 4px var(--info-bg); }
.logs-dot.tone-gold { background: var(--gold); box-shadow: 0 0 0 4px #fff6d8; }
.logs-dot.tone-bad { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-bg); }
.logs-who { width: 36px; height: 36px; font-size: 12px; }
.logs-body { min-width: 0; display: grid; gap: 3px; }
.logs-body b { font-size: 15px; line-height: 1.45; }
.logs-row .badge { margin-top: 6px; }
.logs-empty { padding: 28px 8px; }
@keyframes logs-swap {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (min-width: 700px) {
  .logs-kpis { grid-template-columns: repeat(3, 1fr); }
  .logs-filters { grid-template-columns: auto auto minmax(220px, 1fr); align-items: end; }
}
@media (min-width: 1100px) {
  .logs-kpis { grid-template-columns: repeat(6, 1fr); }
  .logs-toolbar { grid-template-columns: 1fr; }
}
@media (max-width: 599px) {
  .logs-row { grid-template-columns: 18px 1fr auto; }
  .logs-who { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .logs-kpi, .logs-row, .logs-feed.is-swap { animation: none; }
}

body.is-modal-open { overflow: hidden; }
.users-guide { margin: 14px 0 4px; }
.users-guide-head { margin-bottom: 12px; }
.users-guide-head b { display: block; font-size: 15px; color: var(--navy); }
.users-role-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}
.users-role {
  appearance: none;
  -webkit-appearance: none;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #f8fafc;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.users-role > i {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: #e8eef8;
  color: var(--navy);
}
.users-role b { display: block; color: var(--navy); font-size: 13px; }
.users-role small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}
.users-role em {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-weight: 800;
  color: var(--navy);
}
.users-role.is-on {
  border-color: #c5d4ea;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, .12);
}
.users-deps-wrap { margin-top: 14px; }
.users-deps-wrap > b { display: block; font-size: 13px; color: var(--navy); margin-bottom: 8px; }
.users-deps { display: flex; flex-wrap: wrap; gap: 8px; }
.dep-chip {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  border-radius: 999px;
  padding: 6px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.dep-chip span { color: var(--muted); font-weight: 700; }
.dep-chip.is-on {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.dep-chip.is-on span { color: var(--gold-2); }
.users-toolbar { align-items: flex-end; }
.users-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  flex: 1;
}
.users-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  min-width: 0;
}
.users-filter select,
.cell-select {
  border: 1px solid #d5deea;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  min-width: 140px;
}
.users-filter select:focus,
.cell-select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, .22);
}
.cell-select {
  min-width: 0;
  max-width: 180px;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 12px;
  color: var(--navy);
}
.users-result { margin: 0 0 10px; font-size: 13px; font-weight: 700; }
.user-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-cell b { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.you-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 1px 7px;
  background: #fff6d8;
  color: #8a6d12;
  font-size: 11px;
  font-weight: 800;
}
.status-toggle {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #d5deea;
  background: #f8fafc;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.status-toggle.is-on {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: #bbf7d0;
}
.status-toggle:disabled { opacity: .55; cursor: not-allowed; }
.user-card { align-items: stretch; flex-direction: column; }
.user-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.user-card-ctrls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}
.user-card-ctrls .cell-select { max-width: none; width: 100%; }
.form-back {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: center;
  padding: 16px;
  background: rgba(10, 24, 48, .52);
  backdrop-filter: blur(8px);
}
.form-back.show { display: grid; }
.form-card {
  width: min(760px, 100%);
  max-height: min(92dvh, 900px);
  overflow: auto;
  background: #fff;
  border-radius: 22px;
  padding: 22px 22px 18px;
  box-shadow: 0 28px 70px rgba(14, 34, 64, .28);
  animation: rise .28s ease both;
}
.form-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.form-card-head h3 { margin: 4px 0 0; font-size: 22px; color: var(--navy); }
.form-card .form-close {
  color: var(--navy);
  background: #eef2f7;
}
.form-card .form-close:hover { background: #e2e8f0; }
.form-card-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
@media (min-width: 560px) {
  .users-role-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1100px) {
  .users-role-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 599px) {
  .users-filter select { min-width: 0; width: 100%; }
  .users-filters .inbox-search { width: 100%; }
  .user-card-ctrls { grid-template-columns: 1fr; }
  .form-card-foot .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .form-card { animation: none; }
}

.xfer-form { display: grid; gap: 12px; }
.xfer-card { margin: 0; }
.xfer-card .field:last-child { margin-bottom: 0; }
.xfer-card-head {
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: 14px;
}
.xfer-card-head > i {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: #e8eef8; color: var(--navy); flex: 0 0 auto;
}
.xfer-card-head b { display: block; font-size: 15px; }
.xfer-route { font-weight: 700; color: var(--navy); margin-top: 6px; font-size: 13px; }
.xfer-hint { margin: 4px 0 0; }
.xfer-back { background: rgba(255,255,255,.14); color: #fff; }
.xfer-back:hover:not(:disabled) { background: rgba(255,255,255,.22); color: #fff; }
.xfer-table { min-width: 880px; }
.xfer-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.xfer-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  font-weight: 700;
}
.xfer-opt input { margin-top: 3px; }
.xfer-opt .muted, .xfer-opt span { display: block; font-weight: 600; }
.xfer-opt b { display: block; font-size: 14px; }
.xfer-send-bar { align-items: center; flex-wrap: wrap; }
.xfer-send-bar .xfer-opt { flex: 1 1 220px; }
.xfer-message { white-space: pre-wrap; line-height: 1.55; }
.mail-drop { display: grid; gap: 8px; justify-items: center; }
.mail-files { display: grid; gap: 8px; margin-top: 10px; }
.mail-file {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}
.mail-file small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.hr-lookup { margin-bottom: 14px; position: relative; z-index: 3; }
.hr-lookup > label { display: block; font-weight: 700; margin-bottom: 6px; }
.hr-lookup .meta { margin: 8px 0 0; }
.hr-lookup .people-results {
  position: relative;
  top: auto;
  margin-top: 8px;
  max-height: 220px;
}
.people-picker { position: relative; }
.people-search { position: relative; }
.people-search > i {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.people-search input {
  width: 100%; border: 1px solid #d5deea; border-radius: 12px;
  padding: 11px 12px 11px 36px; background: #fff; color: var(--text);
}
.people-search input:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, .22);
}
.people-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 8;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lg); max-height: 280px; overflow: auto;
  padding: 6px;
}
.people-row {
  width: 100%; display: grid; grid-template-columns: auto 1fr; gap: 10px;
  align-items: center; text-align: left; border: 0; background: transparent;
  padding: 8px; border-radius: 10px; cursor: pointer; font: inherit; color: inherit;
}
.people-row:hover { background: #f5f8fc; }
.people-row .meta { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 600; }
.people-empty { padding: 14px 10px; color: var(--muted); font-weight: 700; text-align: center; white-space: normal; line-height: 1.45; }
.hr-lookup .people-empty { font-weight: 600; text-align: left; font-size: 13px; }
.people-picked { margin-top: 10px; }
.people-chip {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center;
  padding: 10px 12px; border: 1px solid #c5d4ea; border-radius: 14px; background: #f8fafc;
}
.people-chip .meta { color: var(--muted); font-size: 12px; font-weight: 600; margin-top: 3px; }

.mail-sec { align-items: center; }
.mail-filter { position: relative; }
.mail-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #d5deea;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.mail-chip i { font-size: 11px; color: var(--gold); }
.mail-chip.is-on, .mail-chip[aria-expanded="true"] {
  border-color: var(--navy);
  background: #f4f7fb;
  color: var(--navy);
}
.mail-chip.is-ghost { background: transparent; }
.mail-chip.is-select { padding-right: 8px; }
.mail-chip.is-select select {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 0;
  max-width: 128px;
}
.mail-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 8;
  display: grid;
  gap: 6px;
  min-width: 220px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-lg);
}
.mail-preset {
  border: 0;
  background: #f4f7fb;
  color: var(--navy);
  border-radius: 10px;
  padding: 8px 10px;
  text-align: left;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.mail-preset.is-on { background: var(--navy); color: #fff; }
.mail-range { display: grid; gap: 6px; }
.mail-range label {
  display: grid;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.mail-range input {
  border: 1px solid #d5deea;
  border-radius: 10px;
  padding: 6px 8px;
  font: inherit;
  min-height: 34px;
}

.mail-row, .mail-digest .mail-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  margin-bottom: 8px;
  color: inherit;
}
.mail-row-link {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.mail-row:hover { border-color: #c5d4ea; box-shadow: var(--shadow); }
.mail-row.is-unread {
  background: #f7f9fd;
  border-color: #d7e2f2;
}
.mail-row.is-seen { background: #fff; }
.mail-row.is-draft { opacity: .92; }
.mail-row.is-hot { box-shadow: inset 3px 0 0 var(--gold); }
.mail-row.is-acknowledged { box-shadow: inset 3px 0 0 var(--ok); }
.mail-row.is-returned, .mail-row.is-rejected, .mail-row.is-cancelled { box-shadow: inset 3px 0 0 var(--bad); }
.mail-dot {
  width: 8px; height: 8px; margin-top: 8px;
  border-radius: 50%;
  background: transparent;
}
.mail-row.is-unread .mail-dot {
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, .18);
}
.mail-row-title {
  font-size: 16px;
  font-weight: 650;
  color: var(--navy);
  line-height: 1.35;
}
.mail-row.is-unread .mail-row-title { font-weight: 800; }
.mail-row.is-seen .mail-row-title { font-weight: 600; color: #24324a; }
.mail-row-people {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 700;
  color: #3b4b63;
}
.mail-row-people i { font-size: 10px; color: var(--gold); }
.mail-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.mail-no, .mail-when, .mail-td-sub {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.mail-row-badges .badge { font-size: 11px; padding: 2px 8px; }
.mail-marks {
  display: grid;
  gap: 6px;
  justify-items: end;
  min-width: 0;
}
.mail-read, .mail-comments {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.mail-read.is-unread { color: var(--navy); }
.mail-read.is-read { color: #3d6b4e; }
.mail-pin {
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0; background: transparent;
  color: #b7c2d3;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}
.mail-pin.is-on { color: var(--gold); }
.mail-pin:hover { background: #f4f7fb; color: var(--navy); }
.mail-digest { display: grid; gap: 0; }

.mail-table .mail-td-title {
  display: block;
  font-size: 15px;
  font-weight: 750;
  color: var(--navy);
}
.mail-table tr.is-unread .mail-td-title { font-weight: 800; }
.mail-td-people { margin-top: 3px; font-size: 12px; font-weight: 600; color: var(--muted); }
.mail-td-pin { width: 44px; text-align: center; }
.mail-table td { vertical-align: top; }

.mail-head {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px 14px;
  margin-bottom: 12px;
}
.mail-head-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.mail-head-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  color: var(--navy);
}
.mail-head-no {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .02em;
}
.mail-head-acts { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.mail-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}
.mail-chip-s {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f3f6fb;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
}
.mail-chip-s i { color: var(--gold); font-size: 11px; }
.mail-chip-s.is-unread { background: #fff6d8; }
.mail-chip-s.is-read { background: #e8f7ee; color: #166534; }
.mail-side-card { margin-bottom: 12px; }
.mail-readers, .mail-comments-list, .mail-thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mail-readers li, .mail-comment, .mail-thread-item {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  gap: 8px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px solid #eef2f7;
  font-size: 13px;
}
.mail-comment, .mail-thread-item { grid-template-columns: 1fr; }
.mail-comment p, .mail-thread-item p { margin: 4px 0 0; white-space: pre-wrap; }
.mail-comment time, .mail-thread-item time, .mail-readers em { color: var(--muted); font-size: 12px; font-style: normal; font-weight: 600; }
.mail-readers .is-wait { color: var(--muted); }
.mail-readers .is-open { color: var(--navy); }
.mail-comment-form, .mail-reply-form { display: grid; gap: 8px; margin-top: 10px; }
.mail-comment-form textarea, .mail-reply-form textarea {
  width: 100%;
  border: 1px solid #d5deea;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
}
.mail-thread-parent, .chat-ref {
  display: inline-flex;
  align-items: center;
  margin: 8px 12px 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff6d8;
  color: #1a1403;
  font-size: 12px;
  font-weight: 800;
}
.mail-chat .mail-thread-parent { display: inline-flex; margin: 8px 12px 0; padding: 4px 10px; background: #fff6d8; border: 0; }

.mail-chat {
  padding: 0;
  overflow: hidden;
  max-width: 680px;
}
.mail-chat-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.mail-chat-head i { color: var(--gold); }
.mail-chat-head b { font-size: 15px; color: var(--navy); }
.mail-chat-no {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: #3b4b63;
}
.chat-thread {
  display: flex; flex-direction: column; gap: 14px;
  padding: 14px 12px 16px;
  min-height: 160px;
  max-height: min(480px, 58vh);
  overflow: auto;
  background: #e8eef6;
}
.chat-empty {
  margin: auto;
  text-align: center;
  color: #3b4b63;
  font-size: 13px;
  font-weight: 700;
}
.chat-empty i { display: block; font-size: 22px; color: var(--gold); margin-bottom: 8px; }
.chat-row {
  display: flex; gap: 8px; align-items: flex-end;
  width: min(78%, 420px);
}
.chat-row.them { align-self: flex-start; }
.chat-row.mine { align-self: flex-end; flex-direction: row-reverse; margin-left: auto; }
.chat-col { min-width: 0; display: grid; justify-items: start; }
.chat-row.mine .chat-col { justify-items: end; }
.chat-bubble {
  display: inline-block;
  min-width: 2.8em;
  padding: 9px 13px;
  border-radius: 16px 16px 16px 5px;
  background: #fff;
  border: 1px solid #d5deea;
  box-shadow: 0 6px 16px rgba(14, 34, 64, .06);
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-row.mine .chat-bubble {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  border-radius: 16px 16px 5px 16px;
}
.chat-bubble.is-mail { border-color: var(--gold); }
.chat-row.mine .chat-bubble.is-mail { background: #16345f; }
.chat-meta {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 700;
  color: #2c3a51;
}
.chat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--gold);
  color: #1a1403;
  font-size: 12px;
  font-weight: 800;
}
.chat-chip i { font-size: 11px; }
.chat-compose {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.chat-modes { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-mode {
  border: 0; background: #eef2f7; color: var(--navy);
  border-radius: 999px; padding: 5px 10px;
  font-size: 12px; font-weight: 800; cursor: pointer;
}
.chat-mode.is-on { background: var(--navy); color: #fff; }
.chat-mode.is-reply.is-on { background: var(--gold); color: #1a1403; }
.chat-hint { font-size: 11px; font-weight: 600; color: var(--muted); }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form[hidden] { display: none !important; }
.chat-form textarea {
  flex: 1; min-width: 0; width: auto; min-height: 42px; max-height: 120px;
  resize: none;
  border: 1px solid #d5deea;
  border-radius: 14px;
  padding: 9px 12px;
  font: inherit;
  background: #f8fafc;
}
.mail-chat .mail-comment-form, .mail-chat .mail-reply-form { margin-top: 0; display: flex; }
.chat-form textarea:focus {
  outline: 2px solid rgba(14, 34, 64, .16);
  border-color: #b7c6dc;
  background: #fff;
}
.chat-send {
  width: 42px; height: 42px;
  border: 0; border-radius: 14px;
  background: var(--navy); color: #fff;
  cursor: pointer;
  flex: 0 0 42px;
}
.chat-send.is-gold { background: var(--gold); color: #1a1403; }
.chat-send:disabled { opacity: .55; cursor: not-allowed; }
.notify-page-empty {
  padding: 28px 16px;
  text-align: center;
}
.notify-page-empty i { display: block; font-size: 26px; color: var(--gold); margin-bottom: 8px; }

@media (max-width: 879px) {
  .mail-row { grid-template-columns: 40px minmax(0, 1fr); }
  .mail-row-link { grid-template-columns: 10px minmax(0, 1fr); }
  .mail-marks { grid-column: 2; justify-items: start; }
  .mail-pin { width: 40px; height: 40px; }
  .mail-td-pin { width: 48px; }
  .mail-head-title { font-size: 18px; }
  .mail-head-top { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .mail-row, .mail-chip, .mail-preset { transition: none; }
}
