/* =========================================================
   印章谱 · Seal Compendium
   Aesthetic: Editorial archive — vermillion / ink / paper cream
   ========================================================= */

:root {
  /* palette */
  --paper:        #f5f0e4;
  --paper-2:      #efe9da;
  --paper-3:      #e8e0cd;
  --card:         #fdfaf2;
  --card-2:       #f9f4e8;
  --ink:          #1c1814;
  --ink-2:        #3a322b;
  --ink-3:        #6a5f54;
  --ink-4:        #9a8f80;
  --vermillion:   #c8392f;
  --vermillion-2: #a82b22;
  --vermillion-3: #e96b5e;
  --vermillion-soft: #f4d9d4;
  --gold:         #b08a3e;
  --gold-soft:    #e8d6a8;
  --jade:         #5a7d5a;
  --line:         #d8cfb8;
  --line-2:       #e5dec9;
  --line-strong:  #b8ad94;
  --white:        #fffdf7;

  /* type */
  --serif:  'Fraunces', 'Noto Serif SC', Georgia, serif;
  --serif-cn: 'Noto Serif SC', 'Fraunces', serif;
  --sans:   'Manrope', 'Noto Sans SC', system-ui, sans-serif;
  --mono:   'JetBrains Mono', ui-monospace, monospace;

  /* radii & shadow */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;
  --r-xl: 22px;
  --shadow-1: 0 1px 2px rgba(28,24,20,.04), 0 1px 1px rgba(28,24,20,.03);
  --shadow-2: 0 4px 18px -6px rgba(28,24,20,.10), 0 2px 6px rgba(28,24,20,.04);
  --shadow-3: 0 18px 50px -12px rgba(28,24,20,.22), 0 6px 14px rgba(28,24,20,.06);

  /* layout */
  --sidebar-w: 248px;
  --topbar-h: 68px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* paper grain overlay */
.grain {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: .35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.11 0 0 0 0 0.09 0 0 0 0 0.08 0 0 0 0.08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hidden { display: none !important; }

/* ===================== TYPOGRAPHY ===================== */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--vermillion);
  font-weight: 500;
}
em { font-style: italic; color: var(--vermillion); }

a { color: inherit; text-decoration: none; }

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  padding: 10px 18px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .18s ease;
  white-space: nowrap;
  user-select: none;
}
.btn svg { transition: transform .18s ease; }
.btn-primary {
  background: var(--vermillion);
  color: var(--white);
  box-shadow: 0 2px 0 var(--vermillion-2), 0 6px 16px -6px rgba(200,57,47,.5);
}
.btn-primary:hover { background: var(--vermillion-2); transform: translateY(-1px); box-shadow: 0 3px 0 var(--vermillion-2), 0 10px 22px -6px rgba(200,57,47,.55); }
.btn-primary:hover svg { transform: translateX(3px); }
.btn-primary:active { transform: translateY(0); }
.btn-block { width: 100%; }

.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line);
  padding: 8px 14px;
  font-size: 12px;
}
.btn-ghost:hover { background: var(--card); border-color: var(--line-strong); color: var(--ink); }

.btn-outline {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn-outline:hover { background: var(--paper-2); border-color: var(--ink-3); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-danger { background: var(--vermillion-soft); color: var(--vermillion-2); border: 1px solid var(--vermillion-3); }
.btn-danger:hover { background: var(--vermillion); color: var(--white); }

.icon-btn {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--r-md);
  color: var(--ink-2);
  cursor: pointer;
  position: relative;
  transition: all .18s ease;
}
.icon-btn:hover { background: var(--paper-2); color: var(--vermillion); border-color: var(--vermillion-3); }
.badge-dot {
  position: absolute; top: 8px; right: 8px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--vermillion);
  box-shadow: 0 0 0 2px var(--card);
}

/* ===================== LOGIN ===================== */
.login-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  position: relative;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(200,57,47,.06), transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(176,138,62,.08), transparent 60%),
    var(--paper);
}
.login-view::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-2) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: -1px -1px;
  opacity: .4;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black, transparent 80%);
  pointer-events: none;
}

.login-stage {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1040px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-3);
  animation: stage-in .7s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes stage-in {
  from { opacity: 0; transform: translateY(18px) scale(.99); }
  to { opacity: 1; transform: none; }
}

.login-aside {
  background:
    linear-gradient(160deg, #faf7f0 0%, #f5f0e4 50%, #efe9da 100%);
  color: var(--ink);
  padding: 48px 44px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.login-aside::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(200,57,47,.08), transparent 65%);
  filter: blur(20px);
}
.login-aside::after {
  content: '印';
  position: absolute;
  bottom: -30px; right: -10px;
  font-family: var(--serif-cn);
  font-size: 280px;
  font-weight: 900;
  color: rgba(200,57,47,.04);
  line-height: 1;
  pointer-events: none;
}

.seal-mark {
  color: var(--vermillion);
  position: relative;
  z-index: 1;
  animation: seal-stamp .9s .3s cubic-bezier(.2,1.4,.4,1) both;
}
@keyframes seal-stamp {
  0% { opacity: 0; transform: scale(1.4) rotate(-8deg); }
  60% { opacity: 1; }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

.aside-text { position: relative; z-index: 1; }
.aside-text .kicker { color: var(--vermillion); }
.aside-title {
  font-family: var(--serif-cn);
  font-size: 76px;
  font-weight: 900;
  line-height: 1;
  margin: 14px 0 18px;
  color: var(--ink);
  letter-spacing: -.02em;
}
.aside-title em {
  color: var(--vermillion);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
}
.aside-sub {
  color: var(--ink-3);
  font-size: 14px;
  max-width: 320px;
  line-height: 1.7;
  margin-bottom: 28px;
}
.aside-meta {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--ink-4);
}
.aside-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--line); }

.login-form {
  padding: 52px 48px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--card);
  position: relative;
}
.form-head { margin-bottom: 6px; }
.form-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--vermillion);
}
.form-title {
  font-family: var(--serif-cn);
  font-size: 32px;
  font-weight: 700;
  margin: 6px 0 4px;
}
.form-caption { color: var(--ink-3); font-size: 13px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: .02em;
}
.field input, .field textarea, .field select {
  font-family: var(--sans);
  font-size: 14px;
  padding: 12px 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--ink);
  transition: all .18s ease;
  width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--vermillion);
  box-shadow: 0 0 0 3px var(--vermillion-soft);
  background: var(--white);
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-4); }

.form-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px;
}
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--ink-2); }
.checkbox input { accent-color: var(--vermillion); width: 14px; height: 14px; }
.link-muted { color: var(--ink-3); }
.link-muted:hover { color: var(--vermillion); }

.form-hint {
  font-size: 11px;
  color: var(--ink-4);
  font-family: var(--mono);
  text-align: center;
  margin-top: 4px;
  padding: 8px;
  background: var(--paper-2);
  border-radius: var(--r-sm);
  border: 1px dashed var(--line);
}

.demo-chips {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 4px;
}
.chip {
  font-family: var(--sans);
  font-size: 11px;
  padding: 5px 10px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--ink-3);
  cursor: pointer;
  transition: all .15s ease;
}
.chip:hover { border-color: var(--vermillion); color: var(--vermillion); background: var(--vermillion-soft); }

.login-foot {
  margin-top: 28px;
  display: flex; gap: 24px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--ink-4);
}

/* ===================== APP LAYOUT ===================== */
.app-view {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, #f5efe0 0%, #efe9da 100%);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  z-index: 50;
}

.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 22px 22px;
  border-bottom: 1px solid var(--line-2);
}
.brand-seal { color: var(--vermillion); display: flex; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong {
  font-family: var(--serif-cn);
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
}
.brand-text span {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--ink-4);
  text-transform: uppercase;
  margin-top: 2px;
}

.nav {
  flex: 1;
  padding: 18px 14px;
  overflow-y: auto;
}
.nav-group {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding: 8px 10px 12px;
}
.nav-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: baseline;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--r-md);
  color: var(--ink-2);
  cursor: pointer;
  margin-bottom: 2px;
  position: relative;
  transition: all .18s ease;
  border: 1px solid transparent;
}
.nav-item:hover {
  background: rgba(28,24,20,.04);
  color: var(--ink);
}
.nav-item.active {
  background: linear-gradient(90deg, rgba(200,57,47,.1), rgba(200,57,47,.02));
  color: var(--vermillion-2);
  border-color: rgba(200,57,47,.15);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px;
  background: var(--vermillion);
  border-radius: 0 3px 3px 0;
}
.nav-idx {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
  font-weight: 500;
}
.nav-label {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
}
.nav-en {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--ink-4);
  text-transform: uppercase;
}
.nav-item.active .nav-en { color: var(--vermillion-3); }

.sidebar-foot {
  padding: 14px;
  border-top: 1px solid var(--line-2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.user-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: rgba(28,24,20,.03);
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
}
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--vermillion), var(--vermillion-2));
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif-cn);
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--vermillion-3);
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.user-meta strong { color: var(--ink); font-size: 13px; font-weight: 600; }
.user-meta span { color: var(--ink-4); font-size: 11px; font-family: var(--mono); }

.btn-ghost.sidebar-logout {
  width: 100%;
  justify-content: center;
  color: var(--ink-3);
  border-color: var(--line);
  background: transparent;
}
.btn-ghost.sidebar-logout:hover {
  background: rgba(200,57,47,.08);
  color: var(--vermillion-2);
  border-color: rgba(200,57,47,.2);
}

/* main column */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--paper);
}

.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(8px);
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
}
.crumb-root { color: var(--ink-3); letter-spacing: .12em; text-transform: uppercase; }
.crumb-sep { color: var(--ink-4); }
.crumb-current { color: var(--ink); font-weight: 600; }

.topbar-right { display: flex; align-items: center; gap: 14px; }
.clock {
  display: flex; flex-direction: column; align-items: flex-end;
  line-height: 1.1;
  padding-right: 14px;
  border-right: 1px solid var(--line);
}
.clock-time {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .04em;
}
.clock-date {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.content {
  padding: 32px 36px 60px;
  flex: 1;
  animation: content-in .35s ease both;
}
@keyframes content-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

#menuToggle { display: none; }

/* ===================== PAGE HEADER ===================== */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 26px;
  gap: 20px;
  flex-wrap: wrap;
}
.page-head-text { display: flex; flex-direction: column; gap: 4px; }
.page-head .kicker { margin-bottom: 2px; }
.page-title {
  font-family: var(--serif-cn);
  font-size: 36px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.01em;
}
.page-title em { font-family: var(--serif); font-weight: 400; }
.page-sub { color: var(--ink-3); font-size: 13px; }
.page-actions { display: flex; gap: 10px; align-items: center; }

/* ===================== STAT CARDS (dashboard) ===================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 22px 20px;
  position: relative;
  overflow: hidden;
  transition: all .25s ease;
}
.stat-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--vermillion);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s ease;
}
.stat-card:hover::before { transform: scaleX(1); }

.stat-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.stat-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.stat-icon {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  background: var(--vermillion-soft);
  color: var(--vermillion);
}
.stat-value {
  font-family: var(--serif);
  font-size: 44px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -.02em;
  display: flex; align-items: baseline; gap: 6px;
}
.stat-value .unit { font-size: 14px; color: var(--ink-3); font-family: var(--sans); font-weight: 400; }
.stat-trend {
  margin-top: 10px;
  font-size: 11px;
  color: var(--ink-3);
  font-family: var(--mono);
}
.stat-trend .up { color: var(--jade); }
.stat-trend .down { color: var(--vermillion); }

/* ===================== CARD / PANEL ===================== */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-2);
  gap: 14px;
  flex-wrap: wrap;
}
.panel-title {
  font-family: var(--serif-cn);
  font-size: 17px;
  font-weight: 600;
  display: flex; align-items: center; gap: 10px;
}
.panel-title .idx {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--vermillion);
  background: var(--vermillion-soft);
  padding: 2px 7px;
  border-radius: var(--r-sm);
  font-weight: 500;
}
.panel-sub { font-size: 12px; color: var(--ink-3); }
.panel-body { padding: 18px 22px; }
.panel-actions { display: flex; gap: 8px; align-items: center; }

/* ===================== TABLE ===================== */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data thead th {
  text-align: left;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--card-2);
  white-space: nowrap;
}
table.data tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-2);
  color: var(--ink-2);
  vertical-align: middle;
}
table.data tbody tr {
  transition: background .15s ease;
}
table.data tbody tr:hover { background: var(--paper-2); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data .id-cell {
  font-family: var(--mono);
  color: var(--ink-3);
  font-size: 12px;
}
table.data .name-cell { font-weight: 600; color: var(--ink); }
table.data .code-cell {
  font-family: var(--mono);
  font-weight: 500;
  color: var(--vermillion);
  font-size: 12px;
}
.row-actions { display: flex; gap: 6px; }
.row-actions button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-3);
  padding: 5px 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 11px;
  display: inline-flex; align-items: center; gap: 4px;
  transition: all .15s ease;
}
.row-actions button:hover { border-color: var(--vermillion); color: var(--vermillion); background: var(--vermillion-soft); }
.row-actions button.danger:hover { border-color: var(--vermillion-2); background: var(--vermillion); color: var(--white); }

/* ===================== BADGES / STATUS ===================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--sans);
  letter-spacing: .02em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge-pending { background: #fff4d6; color: #8a6a1a; border-color: #e8c870; }
.badge-approved { background: #e3f0e3; color: #3d6a3d; border-color: #95c095; }
.badge-sealed { background: var(--vermillion-soft); color: var(--vermillion-2); border-color: var(--vermillion-3); }
.badge-void { background: #ece6dd; color: var(--ink-3); border-color: var(--line-strong); }
.badge-active { background: #e3f0e3; color: #3d6a3d; border-color: #95c095; }
.badge-inactive { background: #ece6dd; color: var(--ink-3); border-color: var(--line-strong); }

.tag {
  display: inline-flex; align-items: center;
  padding: 3px 8px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 11px;
  color: var(--ink-2);
  font-family: var(--mono);
}

/* ===================== FILTER BAR ===================== */
.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search-box input {
  width: 100%;
  font-family: var(--sans);
  font-size: 13px;
  padding: 9px 12px 9px 36px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--ink);
  transition: all .15s ease;
}
.search-box input:focus {
  outline: none;
  border-color: var(--vermillion);
  box-shadow: 0 0 0 3px var(--vermillion-soft);
}
.search-box svg {
  position: absolute;
  left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--ink-3);
}
.select, .filter-bar select {
  font-family: var(--sans);
  font-size: 13px;
  padding: 9px 32px 9px 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--ink);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236a5f54' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.select:focus, .filter-bar select:focus {
  outline: none;
  border-color: var(--vermillion);
  box-shadow: 0 0 0 3px var(--vermillion-soft);
}

/* ===================== EMPTY STATE ===================== */
.empty {
  padding: 50px 20px;
  text-align: center;
  color: var(--ink-3);
}
.empty-icon {
  width: 60px; height: 60px;
  margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper-2);
  border-radius: 50%;
  color: var(--ink-4);
}
.empty h4 { font-size: 16px; margin-bottom: 6px; color: var(--ink-2); }
.empty p { font-size: 12px; }

/* ===================== DASHBOARD GRID ===================== */
.dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.dash-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

/* timeline / activity */
.activity-list { display: flex; flex-direction: column; }
.activity-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line-2);
  transition: background .15s ease;
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: var(--paper-2); }
.activity-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--vermillion-soft);
  color: var(--vermillion);
  display: flex; align-items: center; justify-content: center;
}
.activity-body { min-width: 0; }
.activity-title { font-size: 13px; color: var(--ink); font-weight: 500; }
.activity-meta { font-size: 11px; color: var(--ink-3); margin-top: 2px; font-family: var(--mono); }
.activity-time { font-size: 11px; color: var(--ink-4); font-family: var(--mono); white-space: nowrap; }

/* mini bar chart */
.mini-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 140px;
  padding: 10px 0;
}
.mini-bar {
  flex: 1;
  background: linear-gradient(180deg, var(--vermillion) 0%, var(--vermillion-3) 100%);
  border-radius: 4px 4px 0 0;
  position: relative;
  min-height: 4px;
  transition: all .3s ease;
  cursor: pointer;
}
.mini-bar:hover { filter: brightness(1.15); }
.mini-bar .lbl {
  position: absolute;
  bottom: -20px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
}
.mini-bar .val {
  position: absolute;
  top: -18px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink);
  opacity: 0;
  transition: opacity .15s;
}
.mini-bar:hover .val { opacity: 1; }

/* seal grid */
.seal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  padding: 18px 22px;
}
.seal-card {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px;
  text-align: center;
  position: relative;
  transition: all .2s ease;
  cursor: pointer;
}
.seal-card:hover {
  border-color: var(--vermillion);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}
.seal-card .seal-img {
  width: 64px; height: 64px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--vermillion), var(--vermillion-2));
  display: flex; align-items: center; justify-content: center;
  color: var(--white);
  font-family: var(--serif-cn);
  font-weight: 900;
  font-size: 22px;
  box-shadow: 0 4px 12px -2px rgba(200,57,47,.4), inset 0 0 0 2px rgba(255,253,247,.2);
}
.seal-card .seal-name { font-weight: 600; font-size: 13px; color: var(--ink); margin-bottom: 2px; }
.seal-card .seal-dept { font-size: 11px; color: var(--ink-3); font-family: var(--mono); }

/* ===================== MODAL ===================== */
.modal-root {
  position: fixed; inset: 0;
  z-index: 1000;
  display: none;
}
.modal-root.open { display: block; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(28,24,20,.55);
  backdrop-filter: blur(4px);
  animation: fade .2s ease;
}
.modal {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  width: min(560px, 92vw);
  max-height: 90vh;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-3);
  animation: modal-in .3s cubic-bezier(.2,.8,.2,1);
}
.modal.modal-lg { width: min(820px, 94vw); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in {
  from { opacity: 0; transform: translate(-50%, -48%) scale(.97); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line-2);
}
.modal-title {
  font-family: var(--serif-cn);
  font-size: 18px;
  font-weight: 600;
  display: flex; align-items: center; gap: 10px;
}
.modal-title .kicker { font-size: 10px; }
.modal-close {
  background: transparent;
  border: none;
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--ink-3);
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.modal-close:hover { background: var(--paper-2); color: var(--vermillion); }
.modal-body {
  padding: 22px 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--line-2);
  display: flex; justify-content: flex-end; gap: 10px;
  background: var(--card-2);
}

/* form grid in modal */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-grid .span-2 { grid-column: span 2; }
.form-grid .field-label { display: block; margin-bottom: 6px; }

/* detail view */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
  padding: 8px 0;
}
.detail-item { display: flex; flex-direction: column; gap: 4px; }
.detail-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.detail-value { font-size: 14px; color: var(--ink); font-weight: 500; }
.detail-value.code { font-family: var(--mono); color: var(--vermillion); }
.detail-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}
.detail-section h5 {
  font-family: var(--serif-cn);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--ink);
}

/* workflow / steps */
.steps {
  display: flex;
  gap: 0;
  margin: 8px 0 4px;
}
.step {
  flex: 1;
  text-align: center;
  position: relative;
  padding-top: 26px;
}
.step::before {
  content: '';
  position: absolute;
  top: 8px; left: 50%; right: -50%;
  height: 2px;
  background: var(--line);
  z-index: 0;
}
.step:last-child::before { display: none; }
.step-dot {
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--line);
  z-index: 1;
}
.step.done .step-dot { background: var(--vermillion); border-color: var(--vermillion); }
.step.done::before { background: var(--vermillion); }
.step.current .step-dot { background: var(--card); border-color: var(--vermillion); box-shadow: 0 0 0 4px var(--vermillion-soft); }
.step-label { font-size: 12px; color: var(--ink-3); }
.step.current .step-label, .step.done .step-label { color: var(--ink); font-weight: 600; }

/* ===================== TOAST ===================== */
.toast-root {
  position: fixed;
  top: 24px; right: 24px;
  z-index: 2000;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--vermillion);
  border-radius: var(--r-md);
  padding: 12px 16px 12px 14px;
  box-shadow: var(--shadow-2);
  display: flex; align-items: center; gap: 10px;
  min-width: 260px;
  max-width: 360px;
  pointer-events: auto;
  animation: toast-in .3s cubic-bezier(.2,.8,.2,1);
}
.toast.success { border-left-color: var(--jade); }
.toast.error { border-left-color: var(--vermillion); }
.toast.info { border-left-color: var(--gold); }
.toast.fade-out { animation: toast-out .25s ease forwards; }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: none; }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateX(40px); }
}
.toast-icon { display: flex; }
.toast.success .toast-icon { color: var(--jade); }
.toast.error .toast-icon { color: var(--vermillion); }
.toast.info .toast-icon { color: var(--gold); }
.toast-text { font-size: 13px; color: var(--ink); }

/* ===================== MISC ===================== */
.divider {
  height: 1px;
  background: var(--line);
  margin: 18px 0;
}
.text-muted { color: var(--ink-3); }
.text-mono { font-family: var(--mono); }
.text-vermillion { color: var(--vermillion); }
.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--vermillion);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block {
  padding: 40px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 12px;
}

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 100px; border: 3px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }
.sidebar ::-webkit-scrollbar-thumb { border-color: var(--card); background: var(--line); }

/* ===================== ROLE BADGE ===================== */
.role-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid transparent;
  white-space: nowrap;
  text-transform: uppercase;
}
.role-badge.role-admin {
  background: var(--vermillion);
  color: var(--white);
  border-color: var(--vermillion-2);
}
.role-badge.role-approver {
  background: var(--gold-soft);
  color: #6b4f1c;
  border-color: var(--gold);
}
.role-badge.role-sealer {
  background: #d4e4d4;
  color: #2f4f2f;
  border-color: var(--jade);
}
.role-badge.role-staff {
  background: var(--paper-3);
  color: var(--ink-3);
  border-color: var(--line-strong);
}

/* ===================== QUICK ACTIONS ===================== */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 18px 0 4px;
}
.quick-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  transition: all .18s ease;
  text-align: left;
  position: relative;
  overflow: hidden;
}
.quick-action::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--vermillion);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform .22s ease;
}
.quick-action:hover {
  border-color: var(--vermillion-3);
  background: var(--card-2);
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow: var(--shadow-1);
}
.quick-action:hover::before { transform: scaleY(1); transform-origin: top; }
.quick-action .qa-icon {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  color: var(--vermillion);
  flex-shrink: 0;
}

/* ===================== STATUS LIST / BARS ===================== */
.status-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.status-row {
  display: grid;
  grid-template-columns: 92px 1fr 38px;
  align-items: center;
  gap: 12px;
}
.status-bar {
  height: 8px;
  background: var(--paper-2);
  border-radius: 100px;
  overflow: hidden;
  border: 1px solid var(--line-2);
}
.status-bar-fill {
  height: 100%;
  border-radius: 100px;
  transition: width .6s cubic-bezier(.2,.8,.2,1);
}
.status-bar-fill.badge-pending  { background: var(--gold); }
.status-bar-fill.badge-approved { background: var(--jade); }
.status-bar-fill.badge-sealed   { background: var(--vermillion); }
.status-bar-fill.badge-void     { background: var(--ink-4); }
.status-num {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  text-align: right;
}

/* ===================== USAGE ROW ===================== */
.usage-row {
  display: grid;
  grid-template-columns: 110px 1fr 32px;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}
.usage-name {
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.usage-bar {
  height: 6px;
  background: var(--paper-2);
  border-radius: 100px;
  overflow: hidden;
}
.usage-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--vermillion), var(--vermillion-3));
  border-radius: 100px;
  transition: width .6s cubic-bezier(.2,.8,.2,1);
}
.usage-num {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  text-align: right;
}

/* ===================== FILTER BAR ===================== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.filter-bar .search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 220px;
}
.filter-bar .search-box svg {
  position: absolute;
  left: 12px;
  color: var(--ink-4);
  pointer-events: none;
}
.filter-bar .search-box input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  transition: border-color .18s ease;
}
.filter-bar .search-box input:focus {
  outline: none;
  border-color: var(--vermillion-3);
  background: var(--white);
}
.filter-bar select {
  padding: 9px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  min-width: 110px;
}
.filter-bar select:focus {
  outline: none;
  border-color: var(--vermillion-3);
}
.filter-bar .btn { margin-left: auto; }
.filter-bar .btn:first-of-type { margin-left: 0; }

/* ===================== TABLE: COL-CHECK ===================== */
table.data .col-check {
  width: 38px;
  text-align: center;
}
table.data .col-check input[type=checkbox] {
  width: 15px; height: 15px;
  cursor: pointer;
  accent-color: var(--vermillion);
}
table.data tbody td.col-check {
  vertical-align: middle;
}

/* ===================== ROW ACTIONS ===================== */
.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.row-actions button {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--r-sm);
  color: var(--ink-3);
  cursor: pointer;
  transition: all .15s ease;
}
.row-actions button:hover {
  background: var(--paper-2);
  border-color: var(--line);
  color: var(--ink);
}
.row-actions button.success:hover {
  background: #e3efe3;
  border-color: var(--jade);
  color: var(--jade);
}
.row-actions button.danger,
.row-actions button.warn {
  color: var(--vermillion-2);
}
.row-actions button.danger:hover,
.row-actions button.warn:hover {
  background: var(--vermillion-soft);
  border-color: var(--vermillion-3);
  color: var(--vermillion-2);
}

/* danger outline button variant (batch delete etc.) */
.btn.danger-outline {
  color: var(--vermillion-2);
  border-color: var(--vermillion-3);
  background: var(--card);
}
.btn.danger-outline:hover:not(:disabled) {
  background: var(--vermillion);
  border-color: var(--vermillion-2);
  color: var(--white);
}
.btn.danger-outline:disabled,
.btn-outline:disabled,
.btn-ghost:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* ===================== BADGE: ACTIVE ===================== */
.badge.badge-active {
  background: #e3efe3;
  color: #2f4f2f;
  border: 1px solid var(--jade);
}

/* ===================== PROFILE CARD ===================== */
.profile-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 4px;
}
.profile-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--vermillion), var(--vermillion-2));
  color: var(--white);
  font-family: var(--serif-cn);
  font-size: 28px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px -4px rgba(200,57,47,.5);
  flex-shrink: 0;
}
.profile-meta h3 {
  font-family: var(--serif-cn);
  font-size: 22px;
  margin-bottom: 6px;
}
.profile-meta p {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 4px;
}

/* ===================== PERMISSION GRID ===================== */
.perm-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.perm-tag {
  font-family: var(--mono);
  font-size: 11px;
  padding: 5px 10px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink-2);
  letter-spacing: .02em;
}
.perm-tag:first-letter {
  text-transform: uppercase;
  color: var(--vermillion);
  font-weight: 700;
}

/* ===================== NOTIFICATION PANEL ===================== */
.notif-wrap {
  position: relative;
}
.notif-badge {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 100px;
  background: var(--vermillion);
  color: var(--white);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px var(--card);
  line-height: 1;
}
.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  max-height: 460px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-3);
  z-index: 200;
  opacity: 0;
  transform: translateY(-8px) scale(.97);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.notif-panel.open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.notif-panel::before {
  content: '';
  position: absolute;
  top: -6px; right: 14px;
  width: 10px; height: 10px;
  background: var(--card);
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  transform: rotate(45deg);
}
.notif-head {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line-2);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.notif-title {
  font-family: var(--serif-cn);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.notif-sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-4);
  letter-spacing: .08em;
}
.notif-list {
  overflow-y: auto;
  max-height: 380px;
}
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-2);
  cursor: pointer;
  transition: background .15s ease;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--paper-2); }
.notif-icon {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: var(--vermillion-soft);
  color: var(--vermillion-2);
  border-radius: var(--r-sm);
  flex-shrink: 0;
}
.notif-text {
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.5;
  flex: 1;
}
.notif-empty {
  padding: 32px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-4);
  font-family: var(--mono);
}

/* ===================== MINI CHART (trend) ===================== */
.mini-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 140px;
  padding: 12px 4px 4px;
}
.mini-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  height: 100%;
  position: relative;
}
.mini-bar {
  background: linear-gradient(180deg, var(--vermillion-3), var(--vermillion));
  border-radius: 3px 3px 0 0;
  min-height: 4px;
  transition: opacity .15s ease;
  position: relative;
}
.mini-bar:hover { opacity: .85; }
.mini-bar .val {
  position: absolute;
  top: -18px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-2);
}
.mini-bar .lbl {
  position: absolute;
  bottom: -20px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-4);
  white-space: nowrap;
}

/* ===================== STAT TREND (down indicator) ===================== */
.stat-trend .down { color: var(--vermillion); font-size: 8px; vertical-align: middle; }

/* ===================== ACTIVITY LIST ===================== */
.activity-list {
  display: flex;
  flex-direction: column;
}
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px dashed var(--line-2);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  border-radius: 50%;
  color: var(--vermillion);
  flex-shrink: 0;
}
.activity-body { flex: 1; min-width: 0; }
.activity-title {
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.activity-meta {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.activity-time {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-4);
  flex-shrink: 0;
}

/* ===================== SEAL CARD (overview) ===================== */
.seal-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  text-align: center;
  cursor: pointer;
  transition: all .18s ease;
}
.seal-card:hover {
  border-color: var(--vermillion-3);
  transform: translateY(-2px);
  box-shadow: var(--shadow-1);
}
.seal-card .seal-img {
  width: 48px; height: 48px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: var(--vermillion-soft);
  color: var(--vermillion-2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif-cn);
  font-size: 22px;
  font-weight: 700;
  border: 2px solid var(--vermillion-3);
}
.seal-card .seal-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.seal-card .seal-dept {
  font-size: 11px;
  color: var(--ink-3);
  font-family: var(--mono);
  margin-top: 2px;
}

/* ===================== FORM GRID (reuse) ===================== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.form-grid .span-2 { grid-column: span 2; }
.form-grid .field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.form-grid input,
.form-grid select,
.form-grid textarea {
  padding: 9px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  transition: border-color .18s ease;
}
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  outline: none;
  border-color: var(--vermillion-3);
  background: var(--white);
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 980px) {
  .dash-grid, .dash-grid-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
}
/* ===================== STANDARDS LEFT-RIGHT LAYOUT ===================== */
.std-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  align-items: start;
}
.std-sidebar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.std-cat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-2);
  cursor: pointer;
  transition: all .15s ease;
}
.std-cat-item:last-child { border-bottom: none; }
.std-cat-item:hover { background: var(--paper-2); }
.std-cat-item.active {
  background: var(--vermillion-soft);
  border-left: 3px solid var(--vermillion);
  color: var(--vermillion-2);
}
.std-cat-idx {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
  min-width: 20px;
}
.std-cat-item.active .std-cat-idx { color: var(--vermillion); }
.std-cat-name {
  font-size: 13px;
  font-weight: 500;
}
.std-main { min-width: 0; }

/* ===================== ATTACHMENT ITEMS ===================== */
.attach-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 12px;
}
.attach-icon { color: var(--vermillion); display: flex; }
.attach-name { color: var(--ink-2); }
.attach-size { font-family: var(--mono); font-size: 10px; color: var(--ink-4); }
.attach-del {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--ink-3);
  display: flex;
  padding: 2px;
  border-radius: 2px;
}
.attach-del:hover { color: var(--vermillion); background: var(--vermillion-soft); }
.attach-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.attach-preview {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--ink-3);
  display: flex;
  padding: 2px;
}
.attach-preview:hover { color: var(--vermillion); }

/* ===================== CONTEXT MENU ===================== */
.context-menu {
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-3);
  overflow: hidden;
  min-width: 140px;
  animation: fade .15s ease;
}
.context-item {
  padding: 10px 16px;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink-2);
  transition: all .1s ease;
  border-bottom: 1px solid var(--line-2);
}
.context-item:last-child { border-bottom: none; }
.context-item:hover { background: var(--paper-2); color: var(--vermillion); }

/* ===================== ROW CHECKBOX ===================== */
.row-check {
  width: 16px;
  height: 16px;
  accent-color: var(--vermillion);
  cursor: pointer;
}

/* ===================== BADGE: VOID GRAY + APPROVED BOLD BLUE ===================== */
.badge-void {
  background: #ece6dd !important;
  color: var(--ink-3) !important;
  border-color: var(--line-strong) !important;
}
.badge-approved-bold {
  font-weight: 700 !important;
  background: #dbeafe !important;
  color: #1e40af !important;
  border-color: #93c5fd !important;
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .app-view { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    width: 248px;
    transform: translateX(-100%);
    transition: transform .3s ease;
  }
  .sidebar.open { transform: translateX(0); }
  #menuToggle { display: inline-flex; }
  .content { padding: 22px 18px 40px; }
  .login-stage { grid-template-columns: 1fr; }
  .login-aside { padding: 36px 28px; }
  .aside-title { font-size: 56px; }
  .login-form { padding: 36px 28px; }
  .detail-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
}
