:root {
  color-scheme: light;
  --bg: #f6f9fc;
  --surface: #ffffff;
  --surface-soft: #f9fbfd;
  --surface-blue: #eef7ff;
  --line: #dce5ef;
  --line-strong: #c7d4e2;
  --text: #18212c;
  --text-muted: #647386;
  --text-soft: #667484;
  --primary: #0a74e8;
  --primary-strong: #065bd8;
  --primary-soft: #e8f3ff;
  --cyan: #19a7d8;
  --green: #12a56b;
  --green-soft: #e9f8f1;
  --amber: #f49b26;
  --amber-soft: #fff5e8;
  --red: #e64d4a;
  --red-soft: #fff0ef;
  --violet: #5865f2;
  --green-text: #08764b;
  --red-text: #b42a27;
  --amber-text: #9b5a07;
  --primary-text: #085bb6;
  --shadow-sm: 0 8px 24px rgba(23, 37, 56, 0.07);
  --shadow-md: 0 18px 54px rgba(23, 37, 56, 0.12);
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font: Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: 0;
  background:
    linear-gradient(90deg, rgba(10, 116, 232, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(10, 116, 232, 0.03) 1px, transparent 1px),
    var(--bg);
  background-size: 48px 48px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

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

code {
  padding: 2px 6px;
  color: #0757bc;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.92em;
  background: #edf5ff;
  border: 1px solid #d8e8fb;
  border-radius: 5px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.is-hidden {
  display: none !important;
}

.page-shell {
  min-height: 100vh;
}

.panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.panel-header,
.console-panel-head,
.ledger-detail-head,
.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.panel-header h2,
.panel-header h3,
.console-panel-head h2,
.ledger-detail-head h2,
.dialog-head h2,
.dialog-head strong {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.25;
  font-weight: 760;
}

.panel-header p,
.console-panel-head p,
.ledger-detail-head p,
.dialog-head span {
  margin: 7px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.console-panel-head.compact h2,
.panel-header.compact h2,
.panel-header.compact h3 {
  font-size: 16px;
}

.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  color: #314154;
  font-weight: 720;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.button:hover:not(:disabled) {
  background: #f8fbff;
  border-color: #b7c8dc;
  transform: translateY(-1px);
}

.button-primary {
  color: #fff;
  background: linear-gradient(180deg, #1688ff, var(--primary-strong));
  border-color: #0757c8;
  box-shadow: 0 10px 24px rgba(10, 116, 232, 0.22);
}

.button-primary:hover:not(:disabled) {
  color: #fff;
  background: linear-gradient(180deg, #0d7aee, #044fc0);
  border-color: #044fc0;
}

.button-ghost {
  color: #37516c;
  background: #fff;
}

.button-fill {
  width: 100%;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
}

.field > label,
.field > span {
  color: #425268;
  font-size: 13px;
  font-weight: 720;
}

.field input,
.field select,
.field textarea,
.top-search-field input,
.console-select {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.field input[type="checkbox"],
.toggle-field input[type="checkbox"] {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  flex: 0 0 16px;
  padding: 0;
  margin: 0;
  accent-color: var(--primary);
}

.field textarea {
  min-height: 104px;
  padding: 12px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.top-search-field input:focus,
.console-select:focus {
  border-color: #72aef4;
  box-shadow: 0 0 0 4px rgba(10, 116, 232, 0.11);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #9aa8b7;
}

.field-row,
.field-grid,
.mail-form-grid,
.offline-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field-full {
  grid-column: 1 / -1;
}

.field-checkbox {
  flex-direction: row;
  align-items: center;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.form-actions-column {
  flex-direction: column;
}

.section-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.section-card {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.section-card h3 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 15px;
  font-weight: 760;
}

.panel-badge,
.status-pill,
.risk-badge,
.lifetime-badge,
.activation-badge,
.product-badge,
.template-token,
.tab-chip {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  white-space: nowrap;
  color: #336180;
  font-size: 12px;
  font-weight: 760;
  background: #edf5ff;
  border: 1px solid #d6e7fb;
  border-radius: 999px;
}

.status-pill.is-active,
.status-ok,
.risk-badge.is-low,
.activation-badge.is-both,
.activation-badge.is-offline,
.product-badge.is-ppt {
  color: var(--green-text);
  background: var(--green-soft);
  border-color: #c8eedc;
}

.status-pill.is-revoked,
.risk-badge.is-critical,
.risk-badge.is-high {
  color: var(--red-text);
  background: var(--red-soft);
  border-color: #ffd2cf;
}

.status-pill.is-neutral,
.risk-badge.is-medium {
  color: var(--amber-text);
  background: var(--amber-soft);
  border-color: #f7ddb8;
}

.lifetime-badge.is-permanent,
.activation-badge.is-online,
.product-badge.is-host {
  color: var(--primary-text);
  background: var(--primary-soft);
  border-color: #cce3ff;
}

.toast-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  display: flex;
  width: min(380px, calc(100vw - 32px));
  flex-direction: column;
  gap: 12px;
}

.toast {
  padding: 14px 16px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

.toast strong,
.toast span {
  display: block;
}

.toast strong {
  margin-bottom: 4px;
  font-weight: 780;
}

.toast span {
  color: var(--text-muted);
  font-size: 13px;
}

.toast.is-success {
  border-left-color: var(--green);
}

.toast.is-danger {
  border-left-color: var(--red);
}

/* Login */

.login-page {
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(35, 151, 255, 0.13), transparent 30%),
    linear-gradient(90deg, rgba(10, 116, 232, 0.055) 1px, transparent 1px),
    linear-gradient(0deg, rgba(10, 116, 232, 0.045) 1px, transparent 1px),
    #f7fbff;
  background-size: auto, 58px 58px, 58px 58px, auto;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(480px, 1.08fr) minmax(380px, 0.72fr);
  align-items: stretch;
}

.login-side {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  padding: 42px clamp(32px, 5vw, 76px);
  overflow: hidden;
}

.login-side::before,
.login-side::after {
  position: absolute;
  inset: auto auto 9% 12%;
  width: 520px;
  height: 520px;
  content: "";
  background:
    linear-gradient(90deg, rgba(10, 116, 232, 0.12) 1px, transparent 1px),
    linear-gradient(0deg, rgba(10, 116, 232, 0.10) 1px, transparent 1px);
  background-size: 38px 38px;
  opacity: 0.55;
  transform: rotate(45deg);
  pointer-events: none;
}

.login-side::after {
  inset: 8% 8% auto auto;
  width: 220px;
  height: 220px;
  opacity: 0.25;
}

.login-brand,
.ledger-brand,
.brand-block {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #fff;
  font-size: 14px;
  font-weight: 860;
  background: linear-gradient(150deg, #16a7ff, #075bd7);
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(10, 116, 232, 0.18);
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.brand-copy strong {
  color: var(--text);
  font-size: 17px;
  line-height: 1.2;
  font-weight: 820;
}

.brand-copy span {
  color: var(--text-muted);
  font-size: 12px;
}

.login-hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(260px, 1fr);
  align-items: center;
  gap: 32px;
  margin: 44px 0;
}

.hero-kicker,
.section-eyebrow {
  display: inline-flex;
  margin-bottom: 14px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.login-side-copy h1 {
  max-width: 520px;
  margin: 0;
  color: #0f1d2c;
  font-size: 44px;
  line-height: 1.12;
  font-weight: 860;
}

.login-side-copy p {
  max-width: 520px;
  margin: 18px 0 0;
  color: var(--text-muted);
  font-size: 16px;
}

.login-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero-tag {
  padding: 7px 10px;
  color: #245273;
  font-size: 12px;
  font-weight: 720;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.login-mascot-stage {
  position: relative;
  min-height: 330px;
}

.login-mascot {
  position: absolute;
  right: 8%;
  bottom: 16px;
  width: 238px;
  height: 276px;
  filter: drop-shadow(0 24px 42px rgba(34, 73, 116, 0.16));
  transition: transform 0.24s ease;
}

.login-mascot.is-success {
  transform: translateY(-8px) rotate(-2deg);
}

.login-mascot.is-error {
  transform: translateX(4px) rotate(2deg);
}

.mascot-shadow {
  position: absolute;
  right: 40px;
  bottom: 4px;
  width: 150px;
  height: 22px;
  background: rgba(24, 50, 83, 0.16);
  border-radius: 999px;
  filter: blur(8px);
}

.mascot-body {
  position: absolute;
  inset: 40px 16px 20px;
  background: linear-gradient(155deg, #ffffff, #dfeeff);
  border: 1px solid #d5e6f7;
  border-radius: 46% 46% 38% 38% / 42% 42% 30% 30%;
  box-shadow: inset 0 -14px 26px rgba(9, 92, 180, 0.12), inset 0 12px 24px rgba(255, 255, 255, 0.92);
}

.mascot-body::after {
  position: absolute;
  left: 50%;
  bottom: 30px;
  display: grid;
  width: 42px;
  height: 28px;
  place-items: center;
  color: #fff;
  font-size: 11px;
  font-weight: 820;
  content: "HQ";
  background: linear-gradient(180deg, #188cff, #075ed7);
  border-radius: 9px;
  transform: translateX(-50%);
}

.mascot-face {
  position: absolute;
  left: 50%;
  top: 42px;
  width: 158px;
  height: 92px;
  background: linear-gradient(180deg, #1a3148, #0d1d2e);
  border: 6px solid #ebf5ff;
  border-radius: 42px;
  transform: translateX(-50%);
  box-shadow: inset 0 8px 18px rgba(255, 255, 255, 0.08), 0 12px 24px rgba(23, 62, 103, 0.12);
}

.mascot-eyes {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 24px;
  display: flex;
  justify-content: space-between;
}

.mascot-eye {
  position: relative;
  width: 38px;
  height: 42px;
  overflow: hidden;
  background: radial-gradient(circle at 35% 30%, #ffffff 0 12%, #7fd2ff 13% 34%, #1679e8 35% 68%, #0a408f 69%);
  border-radius: 50%;
}

.mascot-pupil {
  position: absolute;
  left: 13px;
  top: 13px;
  width: 13px;
  height: 13px;
  background: #061e4b;
  border: 3px solid #fff;
  border-radius: 50%;
  transition: transform 0.1s ease;
}

.mascot-lid {
  position: absolute;
  inset: -2px;
  background: #142a40;
  border-radius: 50%;
  transform: translateY(-115%);
  transition: transform 0.22s ease;
}

.login-mascot.is-password-focus .mascot-lid {
  transform: translateY(0);
}

.login-mascot.is-password-focus .mascot-eye {
  overflow: visible;
  background: transparent;
}

.login-mascot.is-password-focus .mascot-eye::after {
  position: absolute;
  left: 4px;
  top: 18px;
  width: 30px;
  height: 13px;
  content: "";
  border-bottom: 4px solid #7fd2ff;
  border-radius: 0 0 999px 999px;
}

.login-mascot.is-password-focus .mascot-lid,
.login-mascot.is-password-focus .mascot-pupil {
  opacity: 0;
  transform: translate(0, 0) !important;
}

.mascot-mouth {
  position: absolute;
  left: 50%;
  bottom: 16px;
  width: 28px;
  height: 12px;
  border-bottom: 3px solid #61c7ff;
  border-radius: 0 0 24px 24px;
  transform: translateX(-50%);
}

.mascot-hand {
  position: absolute;
  top: 122px;
  width: 42px;
  height: 66px;
  background: linear-gradient(180deg, #fff, #dbeeff);
  border: 1px solid #d3e5f7;
  border-radius: 26px;
}

.mascot-hand-left {
  left: -18px;
  transform: rotate(18deg);
}

.mascot-hand-right {
  right: -18px;
  transform: rotate(-28deg);
}

.login-side-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.login-side-card {
  min-height: 116px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.login-side-card span,
.login-side-card small {
  color: var(--text-muted);
  font-size: 12px;
}

.login-side-card strong {
  display: block;
  margin: 8px 0;
  font-size: 15px;
}

.login-panel {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: center;
  padding: clamp(32px, 6vw, 96px);
  background: rgba(255, 255, 255, 0.82);
  border-left: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.login-panel-head {
  margin-bottom: 28px;
}

.login-panel h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.18;
  font-weight: 840;
}

.login-form {
  display: flex;
  max-width: 430px;
  flex-direction: column;
  gap: 18px;
}

.login-form .field input {
  min-height: 48px;
  padding: 0 14px;
  background: #fbfdff;
}

.login-form .button {
  min-height: 48px;
}

/* Admin shell */

.ledger-page-shell {
  min-height: 100vh;
}

.ledger-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 232px minmax(0, 1fr);
  background: rgba(255, 255, 255, 0.3);
}

.ledger-sidebar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  height: 100vh;
  flex-direction: column;
  padding: 22px 16px;
  background: rgba(255, 255, 255, 0.9);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.ledger-brand {
  padding: 2px 2px 28px;
}

.ledger-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
}

.admin-nav-item {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  color: #425268;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.admin-nav-item:hover {
  color: #0a5ec4;
  background: #f4f9ff;
}

.admin-nav-item.is-active {
  color: var(--primary-strong);
  background: linear-gradient(90deg, #eaf4ff, #f7fbff);
  border-color: #d6e8fb;
}

.admin-nav-item strong {
  font-size: 14px;
  font-weight: 780;
}

.nav-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: currentColor;
  font-size: 16px;
  background: #fff;
  border: 1px solid #dbe6f2;
  border-radius: 8px;
}

.ledger-sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.sidebar-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
}

.sidebar-status-row strong {
  color: var(--text);
  font-weight: 760;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--text-soft);
  border-radius: 50%;
}

.status-dot.is-online {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(18, 165, 107, 0.12);
}

.ledger-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.ledger-topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.ledger-title-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 16px;
}

.ledger-title-row h1 {
  margin: 0;
  color: #111b28;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 850;
}

.ledger-title-row p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.menu-icon-button,
.top-icon-button,
.user-menu-button,
.detail-close-button,
.table-action-button,
.copy-key-button {
  display: inline-grid;
  min-width: 36px;
  height: 36px;
  place-items: center;
  color: #425268;
  font-weight: 760;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.menu-icon-button:hover,
.top-icon-button:hover,
.user-menu-button:hover,
.detail-close-button:hover,
.table-action-button:hover,
.copy-key-button:hover {
  color: var(--primary-strong);
  background: #f5faff;
  border-color: #c8dcf4;
}

.ledger-topbar-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.top-search-field {
  position: relative;
  display: flex;
  width: min(320px, 25vw);
  min-width: 180px;
  align-items: center;
}

.top-search-field input {
  padding-right: 36px;
  background: #fbfdff;
}

.top-search-field span {
  position: absolute;
  right: 12px;
  color: var(--text-soft);
}

.top-icon-button {
  position: relative;
  width: 38px;
  padding: 0;
}

.top-icon-button.command-button {
  width: auto;
  min-width: 58px;
  padding: 0 12px;
  font-size: 13px;
}

.ledger-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 6px 5px 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.user-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #fff;
  background: linear-gradient(180deg, #3a9cff, #075bd7);
  border-radius: 50%;
}

.ledger-user strong,
.ledger-user span {
  display: block;
}

.ledger-user strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
}

.ledger-user span {
  color: var(--text-muted);
  font-size: 11px;
}

.user-menu-button {
  width: auto;
  min-width: 48px;
  min-height: 40px;
  height: 40px;
  padding: 0 12px;
  border: 0;
  font-size: 12px;
}

.ledger-work-section {
  width: 100%;
  padding: 24px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card {
  position: relative;
  display: flex;
  min-height: 104px;
  align-items: center;
  gap: 14px;
  padding: 18px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.metric-card::after {
  position: absolute;
  right: 16px;
  bottom: 12px;
  width: 78px;
  height: 34px;
  content: "";
  background: linear-gradient(90deg, rgba(10, 116, 232, 0.0), rgba(10, 116, 232, 0.14));
  border-radius: 999px;
  opacity: 0.6;
}

.metric-icon {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--primary-strong);
  font-size: 20px;
  background: var(--primary-soft);
  border: 1px solid #d0e7ff;
  border-radius: 12px;
}

.metric-card-green .metric-icon {
  color: var(--green-text);
  background: var(--green-soft);
  border-color: #c8eedc;
}

.metric-card-orange .metric-icon,
.metric-card-purple .metric-icon {
  color: #9a5a0a;
  background: var(--amber-soft);
  border-color: #f7ddb8;
}

.metric-copy {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.metric-copy span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 720;
}

.metric-copy strong {
  color: #101b29;
  font-size: 26px;
  line-height: 1.1;
  font-weight: 840;
}

.metric-copy strong em {
  color: var(--text-soft);
  font-size: 12px;
  font-style: normal;
  font-weight: 720;
}

.metric-copy small {
  color: var(--text-soft);
  font-size: 12px;
}

.metric-spark {
  display: none;
}

/* Dashboard */

.dashboard-console-board,
.audit-console-board {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  gap: 18px;
}

.console-main-panel,
.console-side-panel,
.console-workflow-panel,
.console-product-panel,
.audit-main-panel,
.audit-side-panel {
  padding: 20px;
}

.console-side-stack,
.audit-side-stack,
.mail-side-stack,
.offline-side-stack {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 18px;
}

.dashboard-list,
.audit-timeline,
.audit-risk-list,
.audit-mail-list,
.offline-license-list {
  display: flex;
  flex-direction: column;
  margin-top: 16px;
}

.dashboard-list-item,
.audit-timeline-item,
.audit-risk-item,
.audit-mail-item,
.offline-license-item,
.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.dashboard-list-item:first-child,
.audit-timeline-item:first-child,
.audit-risk-item:first-child,
.audit-mail-item:first-child,
.offline-license-item:first-child,
.history-item:first-child {
  border-top: 0;
}

.dashboard-list-item strong,
.audit-timeline-item strong,
.audit-risk-item strong,
.audit-mail-item strong,
.offline-license-item strong,
.history-item strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}

.dashboard-list-item span,
.dashboard-list-item small,
.audit-timeline-item span,
.audit-timeline-item small,
.audit-risk-item span,
.audit-mail-item span,
.offline-license-item span,
.history-item span,
.history-item small {
  color: var(--text-muted);
  font-size: 12px;
}

.dashboard-console-lower {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.72fr);
  gap: 18px;
  margin-top: 18px;
}

.dashboard-workflow-grid,
.dashboard-product-grid,
.dashboard-today-grid,
.offline-rule-grid,
.record-kpi-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.dashboard-workflow-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-product-grid,
.dashboard-today-grid,
.offline-rule-grid,
.record-kpi-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-workflow-card,
.dashboard-product-card,
.dashboard-today-card,
.offline-rule-grid article,
.record-stat-card,
.record-meta-card,
.mail-mini-card,
.preview-card,
.info-item {
  min-width: 0;
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
}

.dashboard-workflow-card span,
.dashboard-product-card span,
.dashboard-today-card span,
.offline-rule-grid span,
.record-stat-card span,
.record-meta-card span,
.mail-mini-card span,
.preview-card span,
.info-item label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-workflow-card strong,
.dashboard-product-card strong,
.dashboard-today-card strong,
.offline-rule-grid strong,
.record-stat-card strong,
.record-meta-card strong,
.mail-mini-card strong,
.preview-card strong,
.info-item strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 18px;
  line-height: 1.25;
  font-weight: 820;
}

.dashboard-workflow-card small,
.dashboard-product-card small,
.dashboard-today-card small,
.record-stat-card small,
.record-meta-card small,
.mail-mini-card small {
  display: block;
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 12px;
}

.dashboard-product-meter {
  height: 8px;
  margin: 14px 0 10px;
  overflow: hidden;
  background: #e6edf5;
  border-radius: 999px;
}

.dashboard-product-meter i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  border-radius: inherit;
}

.dashboard-product-meter .meter-0 { width: 0; }
.dashboard-product-meter .meter-10 { width: 10%; }
.dashboard-product-meter .meter-20 { width: 20%; }
.dashboard-product-meter .meter-30 { width: 30%; }
.dashboard-product-meter .meter-40 { width: 40%; }
.dashboard-product-meter .meter-50 { width: 50%; }
.dashboard-product-meter .meter-60 { width: 60%; }
.dashboard-product-meter .meter-70 { width: 70%; }
.dashboard-product-meter .meter-80 { width: 80%; }
.dashboard-product-meter .meter-90 { width: 90%; }
.dashboard-product-meter .meter-100 { width: 100%; }

.dashboard-empty,
.empty-panel {
  display: grid;
  min-height: 118px;
  place-items: center;
  padding: 18px;
  color: var(--text-muted);
  text-align: center;
  background: #f8fbff;
  border: 1px dashed #c7d8ea;
  border-radius: var(--radius-sm);
}

.empty-panel strong,
.empty-panel span {
  display: block;
}

.empty-panel strong {
  color: var(--text);
  font-size: 15px;
}

.empty-panel span {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 13px;
}

/* License workspace */

.ledger-board,
.contacts-console-board,
.keys-console-board,
.records-console-board,
.offline-console-board,
.mail-console-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.55fr);
  gap: 18px;
  align-items: start;
}

.ledger-table-panel,
.ledger-detail-panel,
.contacts-list-panel,
.contact-detail-panel,
.keys-table-panel,
.key-detail-panel,
.records-license-panel,
.records-summary-panel,
.records-table-panel,
.offline-signer-panel,
.offline-side-panel,
.mail-settings-panel,
.mail-side-panel {
  padding: 20px;
}

.ledger-filter-panel {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.ledger-filter-bar,
.ledger-filter-controls {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.ledger-filter-controls {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.ledger-filter-field {
  width: 160px;
}

.ledger-filter-result {
  color: var(--text-muted);
  font-size: 13px;
  white-space: nowrap;
}

.sidebar-list {
  margin-top: 16px;
}

.list-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 14px;
  color: var(--text-muted);
  font-size: 12px;
}

.pagination-button {
  min-height: 40px;
  padding: 0 14px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  cursor: pointer;
}

.pagination-button:disabled {
  color: var(--text-soft);
  cursor: not-allowed;
  background: #f7fafd;
}

.license-table-wrap,
.contact-list,
.key-list,
.record-scroll,
.records-table-scroll,
.detail-scroll,
.ledger-detail-scroll {
  min-width: 0;
  overflow: auto;
}

.license-table,
.record-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.license-table th,
.license-table td,
.record-table th,
.record-table td {
  padding: 13px 12px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

.license-table th,
.record-table th {
  color: #5b6b7e;
  font-size: 12px;
  font-weight: 780;
  background: #f8fbff;
}

.license-table td,
.record-table td {
  color: #243448;
  font-size: 13px;
}

.license-table td strong,
.license-table td span,
.record-table td strong,
.record-table td span {
  display: block;
}

.license-table td span,
.record-table td span {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.license-table-row,
.license-card,
.record-license-card,
.contact-card {
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

.license-table-row:hover,
.license-table-row.is-selected {
  background: #f5faff;
}

.license-card,
.record-license-card {
  display: block;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.license-card:first-child,
.record-license-card:first-child {
  border-top: 0;
}

.license-card.is-selected,
.record-license-card.is-selected,
.contact-card.is-selected {
  padding-right: 12px;
  padding-left: 12px;
  background: #f5faff;
  border: 1px solid #cfe4fb;
  border-radius: var(--radius-xs);
}

.license-card-head,
.record-license-row-main,
.license-card-copy-row,
.license-card-meta-row,
.drawer-code-row,
.table-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.license-card-title strong,
.record-license-row-main strong {
  color: var(--text);
  font-size: 15px;
}

.record-license-row-main > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.license-card-title span,
.license-card-meta-row,
.record-license-row-meta,
.license-card-code {
  color: var(--text-muted);
  font-size: 12px;
}

.record-license-row-main span {
  overflow-wrap: anywhere;
}

.license-code-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.copy-key-button {
  width: auto;
  min-width: 48px;
  min-height: 40px;
  height: 40px;
  padding: 0 12px;
  font-size: 12px;
}

.ledger-detail-panel {
  position: sticky;
  top: 102px;
  max-height: calc(100vh - 126px);
  display: flex;
  flex-direction: column;
}

.ledger-detail-scroll {
  flex: 1;
  min-height: 360px;
  padding: 18px 0;
}

.ledger-detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* Contacts and keys */

.contacts-console-board {
  grid-template-columns: minmax(420px, 0.72fr) minmax(0, 1fr);
}

.keys-console-board {
  grid-template-columns: minmax(0, 1fr) minmax(380px, 0.5fr);
}

.contact-list,
.key-list {
  margin-top: 16px;
}

.contact-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.contact-card:first-child {
  border-top: 0;
}

.contact-card:hover {
  background: #f5faff;
}

.contact-card-main,
.contact-profile-head {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.contact-card-main strong,
.contact-card-main span,
.contact-profile-head strong,
.contact-profile-head span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.contact-card-main strong,
.contact-profile-head strong {
  color: var(--text);
  font-size: 15px;
}

.contact-card-main span,
.contact-profile-head span {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.contact-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  font-weight: 850;
  background: linear-gradient(180deg, #21b8c7, #0a67d8);
  border-radius: 50%;
}

.contact-avatar-large {
  width: 54px;
  height: 54px;
  font-size: 20px;
}

.contact-card-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.mini-metric {
  min-width: 0;
  padding: 10px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
}

.mini-metric small,
.mini-metric strong {
  display: block;
}

.mini-metric small {
  color: var(--text-muted);
  font-size: 11px;
}

.mini-metric strong {
  margin-top: 4px;
  color: var(--text);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.contact-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
}

.contact-profile-card,
.key-hero-card {
  padding: 18px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
}

.contact-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.contact-purchase-table,
.key-table {
  min-width: 880px;
}

.key-hero-card > span,
.key-hero-card > strong {
  display: block;
}

.key-hero-card > span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 740;
}

.key-hero-card > strong {
  margin-top: 8px;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 22px;
  overflow-wrap: anywhere;
}

.key-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.drawer-license-card {
  padding: 18px;
  background: linear-gradient(180deg, #f6fbff, #fff);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.drawer-code-row strong {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 18px;
}

.drawer-product-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.mini-product-chip {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #fff;
  font-weight: 820;
  background: var(--primary);
  border-radius: 8px;
}

.mini-product-chip.is-host {
  background: var(--green);
}

.drawer-section {
  margin-top: 20px;
}

.drawer-section-title {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 820;
}

.drawer-info-table {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
}

.drawer-info-row {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr 0.8fr 1.2fr;
  background: #fff;
}

.drawer-info-row label,
.drawer-info-row span,
.drawer-info-row strong {
  min-width: 0;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
}

.drawer-info-row label,
.drawer-info-row span {
  color: var(--text-muted);
  background: #f8fbff;
  font-weight: 720;
}

.drawer-info-row strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.drawer-empty-line,
.drawer-rule-note,
.create-rule-note {
  padding: 12px;
  color: var(--text-muted);
  background: #f8fbff;
  border: 1px dashed #c7d8ea;
  border-radius: var(--radius-xs);
}

.simple-advanced {
  margin-top: 18px;
  padding: 14px;
  background: #f9fbfd;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
}

.simple-advanced summary {
  color: var(--text);
  font-weight: 780;
  cursor: pointer;
}

.field-grid {
  margin-top: 14px;
}

.field-grid-advanced {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.toggle-field,
.field-checkbox label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #425268;
  font-weight: 720;
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.feature-pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 10px;
  color: var(--green-text);
  font-size: 12px;
  font-weight: 760;
  background: var(--green-soft);
  border: 1px solid #c8eedc;
  border-radius: 999px;
}

.feature-pill-warning {
  color: var(--amber-text);
  background: var(--amber-soft);
  border-color: #f7ddb8;
}

.feature-pill-danger {
  color: var(--red-text);
  background: var(--red-soft);
  border-color: #ffd2cf;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.drawer-record-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
}

.drawer-record-card + .drawer-record-card {
  margin-top: 10px;
}

.drawer-record-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border: 1px solid #d0e7ff;
  border-radius: 10px;
}

.drawer-record-card strong,
.drawer-record-card span {
  display: block;
}

.drawer-record-card span {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.drawer-record-card em {
  color: var(--green);
  font-style: normal;
  font-weight: 760;
}

.drawer-timeline {
  display: flex;
  flex-direction: column;
}

.drawer-timeline-item {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.drawer-timeline-item:first-child {
  border-top: 0;
}

.drawer-timeline-item i {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  background: var(--primary);
  border-radius: 50%;
}

.drawer-timeline-item strong,
.drawer-timeline-item span,
.drawer-timeline-item time {
  display: block;
}

.drawer-timeline-item span,
.drawer-timeline-item time {
  color: var(--text-muted);
  font-size: 12px;
}

/* Records */

.records-console-board {
  grid-template-columns: 340px minmax(0, 1fr);
}

.records-main-stack {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 18px;
}

.records-filter-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.records-filter-strip .ledger-filter-field {
  width: 100%;
}

.record-summary-shell,
.record-summary-grid {
  display: grid;
  gap: 14px;
}

.record-summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.record-tabs {
  display: flex;
  gap: 8px;
}

.tab-chip {
  min-height: 40px;
  color: #47586d;
  background: #fff;
}

.tab-chip.is-active {
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-color: #cce3ff;
}

/* Offline and activation */

.offline-console-board,
.mail-console-board {
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.55fr);
}

.offline-signer-form,
.mail-console-form,
.mail-test-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 18px;
}

.offline-process-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.certificate-output {
  padding: 16px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
}

.certificate-output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.certificate-output-head strong {
  font-size: 15px;
}

.certificate-output textarea {
  width: 100%;
  min-height: 86px;
  padding: 12px;
  color: var(--text-muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  resize: vertical;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.activation-page {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(10, 116, 232, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(10, 116, 232, 0.04) 1px, transparent 1px),
    #f7fbff;
  background-size: 52px 52px;
}

.activation-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.activation-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0 28px;
}

.activation-service-note {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  color: var(--text-muted);
  font-size: 12px;
}

.activation-service-note strong {
  color: var(--text);
  font-size: 13px;
}

.activation-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.activation-workbench {
  padding: 22px;
}

.activation-workbench-header h1 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  letter-spacing: 0;
}

.activation-stepper {
  position: relative;
  gap: 32px;
  margin: 24px 0 20px;
}

.activation-stepper::before {
  position: absolute;
  top: 16px;
  right: 12%;
  left: 12%;
  height: 1px;
  content: "";
  background: var(--line);
}

.activation-guide-card {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: auto;
  align-items: flex-start;
  gap: 12px;
  padding: 0 0 16px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--line);
  border-radius: 0;
}

.activation-guide-card.is-current {
  border-color: var(--primary);
  box-shadow: none;
}

.activation-flow-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(300px, 0.72fr) minmax(0, 0.92fr);
  gap: 20px;
}

.activation-flow-card {
  min-height: 122px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.activation-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.activation-guide-index {
  display: inline-grid;
  width: 30px;
  height: 30px;
  margin-bottom: 14px;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 820;
  background: var(--primary);
  border-radius: 50%;
}

.activation-card-head h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0;
}

.activation-card-head p,
.activation-card-note {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.activation-dropzone {
  display: grid;
  min-height: 130px;
  place-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 18px;
  text-align: center;
  background: #f8fbff;
  border: 1px dashed #abd2fb;
  border-radius: var(--radius-xs);
}

.activation-dropzone small {
  color: var(--text-muted);
}

.activation-inline-result {
  margin-top: 16px;
}

.activation-inline-result h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.activation-inline-result .info-grid {
  grid-template-columns: 1fr;
}

.activation-guide-card strong {
  display: block;
  font-size: 16px;
}

.activation-guide-card p {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

/* Mail and audit */

.mail-status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.template-help {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mail-form-actions,
.offline-form-actions {
  justify-content: space-between;
}

.preview-card + .preview-card {
  margin-top: 12px;
}

.preview-box {
  max-height: 360px;
  margin: 0;
  overflow: auto;
  color: #293a4e;
  white-space: pre-wrap;
  font-family: var(--font);
  font-size: 13px;
}

.audit-timeline-item,
.audit-risk-item,
.audit-mail-item {
  grid-template-columns: minmax(0, 1fr);
}

.history-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.history-title {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 14px;
}

.history-empty {
  padding: 14px;
  color: var(--text-muted);
  background: #f8fbff;
  border: 1px dashed #c7d8ea;
  border-radius: var(--radius-xs);
}

.info-item > span {
  display: block;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.copy-value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.device-dialog-backdrop,
.dialog-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 24, 38, 0.42);
  backdrop-filter: blur(8px);
}

.device-dialog-backdrop {
  z-index: 50;
  overflow: auto;
}

.device-dialog {
  width: min(1040px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.device-detail-section {
  margin-top: 20px;
}

/* Dialog */

.dialog-backdrop {
  z-index: 40;
}

.dialog-card {
  width: min(820px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.create-license-dialog-card {
  width: min(1040px, 100%);
}

.create-dialog-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  margin-top: 20px;
}

.create-dialog-aside {
  padding: 18px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.create-dialog-aside strong,
.create-dialog-aside p,
.create-dialog-points span {
  display: block;
}

.create-dialog-aside strong {
  margin-top: 16px;
  color: var(--text);
  font-size: 20px;
  line-height: 1.3;
}

.create-dialog-aside p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.7;
}

.create-dialog-points {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.create-dialog-points span {
  padding: 10px;
  color: #35506c;
  font-size: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
}

.create-dialog-form-host .section-card {
  margin: 0;
  border-radius: var(--radius-sm);
}

.security-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  margin-top: 20px;
}

.security-summary {
  padding: 18px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.security-summary > strong {
  display: block;
  margin-top: 16px;
  font-size: 22px;
}

.security-note-list {
  margin: 16px 0 0;
  padding-left: 18px;
  color: var(--text-muted);
}

.security-form {
  min-width: 0;
}

/* Responsive */

@media (max-width: 1180px) {
  .ledger-shell {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .ledger-sidebar {
    padding: 18px 12px;
  }

  .ledger-brand .brand-copy,
  .admin-nav-item strong,
  .ledger-sidebar-footer {
    display: none;
  }

  .admin-nav-item {
    justify-content: center;
    padding: 0;
  }

  .nav-icon {
    width: 34px;
    height: 34px;
  }

  .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ledger-board,
  .contacts-console-board,
  .keys-console-board,
  .dashboard-console-board,
  .dashboard-console-lower,
  .records-console-board,
  .offline-console-board,
  .mail-console-board,
  .audit-console-board {
    grid-template-columns: 1fr;
  }

  .ledger-detail-panel {
    position: static;
    max-height: none;
  }
}

@media (min-width: 681px) and (max-width: 1180px) {
  .ledger-shell.is-sidebar-expanded {
    grid-template-columns: 232px minmax(0, 1fr);
  }

  .ledger-shell.is-sidebar-expanded .ledger-sidebar {
    padding: 22px 16px;
  }

  .ledger-shell.is-sidebar-expanded .ledger-brand .brand-copy,
  .ledger-shell.is-sidebar-expanded .ledger-sidebar-footer {
    display: flex;
  }

  .ledger-shell.is-sidebar-expanded .admin-nav-item strong {
    display: block;
  }

  .ledger-shell.is-sidebar-expanded .ledger-brand .brand-copy,
  .ledger-shell.is-sidebar-expanded .ledger-sidebar-footer {
    flex-direction: column;
  }

  .ledger-shell.is-sidebar-expanded .admin-nav-item {
    justify-content: flex-start;
    padding: 0 12px;
  }

  .ledger-shell.is-sidebar-expanded .nav-icon {
    width: 28px;
    height: 28px;
  }
}

@media (max-width: 920px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-side {
    min-height: auto;
    padding-bottom: 22px;
  }

  .login-panel {
    min-height: auto;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .login-hero,
  .login-side-grid,
  .activation-guide,
  .activation-flow-grid,
  .field-row,
  .field-grid,
  .create-dialog-grid,
  .mail-form-grid,
  .offline-form-grid,
  .offline-process-grid,
  .info-grid,
  .mail-status-strip,
  .record-summary-grid {
    grid-template-columns: 1fr;
  }

  .login-mascot-stage {
    min-height: 260px;
  }

  .login-mascot {
    right: 50%;
    transform: translateX(50%);
  }

  .dashboard-workflow-grid,
  .dashboard-product-grid,
  .dashboard-today-grid,
  .offline-rule-grid,
  .record-kpi-grid,
  .contact-profile-grid,
  .contact-card-metrics {
    grid-template-columns: 1fr;
  }

  .ledger-topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }

  .ledger-topbar-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .top-search-field {
    width: 100%;
  }

  .security-grid {
    grid-template-columns: 1fr;
  }

  .activation-stepper::before {
    display: none;
  }
}

@media (max-width: 680px) {
  .ledger-shell {
    display: block;
  }

  .ledger-sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .ledger-brand .brand-copy,
  .admin-nav-item strong {
    display: flex;
  }

  .ledger-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-nav-item {
    justify-content: flex-start;
    padding: 0 10px;
  }

  .ledger-work-section {
    padding: 16px;
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }

  .ledger-filter-bar,
  .ledger-filter-controls,
  .ledger-detail-actions,
  .certificate-output-head,
  .form-actions,
  .mail-form-actions,
  .offline-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .ledger-filter-field {
    width: 100%;
  }

  .ledger-user {
    width: 100%;
  }

  .login-side-copy h1 {
    font-size: 34px;
  }

  .login-side-grid {
    display: none;
  }

  .activation-shell {
    width: min(100% - 24px, 1180px);
  }

  .drawer-info-row {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Admin experience refresh
   Scoped to the authenticated admin area so the login experience is unchanged.
   -------------------------------------------------------------------------- */

body.admin-page {
  --admin-bg: #f3f7fb;
  --admin-sidebar-width: 248px;
  --admin-panel-border: #dfe7f1;
  --admin-panel-shadow: 0 1px 2px rgba(20, 40, 68, 0.03), 0 10px 30px rgba(20, 40, 68, 0.045);
  min-width: 320px;
  background: var(--admin-bg);
}

.admin-page .skip-link {
  position: fixed;
  left: 20px;
  top: 12px;
  z-index: 100;
  padding: 10px 14px;
  color: #fff;
  font-weight: 760;
  background: var(--primary-strong);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  transform: translateY(-160%);
  transition: transform 0.16s ease;
}

.admin-page .skip-link:focus {
  transform: translateY(0);
}

.admin-page .ui-icon {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  stroke-width: 1.8;
}

.admin-page .button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 9px;
  box-shadow: none;
}

.admin-page .button-primary {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 8px 18px rgba(10, 116, 232, 0.18);
}

.admin-page .button-primary:hover:not(:disabled) {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
  box-shadow: 0 10px 22px rgba(10, 116, 232, 0.2);
}

.admin-page .button-ghost {
  background: #fff;
}

.admin-page .panel {
  background: #fff;
  border-color: var(--admin-panel-border);
  border-radius: 15px;
  box-shadow: var(--admin-panel-shadow);
}

.admin-page .panel-header,
.admin-page .console-panel-head,
.admin-page .ledger-detail-head,
.admin-page .dialog-head {
  gap: 16px;
}

.admin-page .panel-header h2,
.admin-page .panel-header h3,
.admin-page .console-panel-head h2,
.admin-page .ledger-detail-head h2,
.admin-page .dialog-head h2,
.admin-page .dialog-head strong {
  letter-spacing: -0.01em;
}

.admin-page .field input,
.admin-page .field select,
.admin-page .top-search-field input,
.admin-page .console-select {
  min-height: 44px;
  border-radius: 9px;
}

.admin-page .field textarea {
  border-radius: 9px;
}

.admin-page .ledger-page-shell,
.admin-page .ledger-shell {
  min-height: 100vh;
  background: var(--admin-bg);
}

.admin-page .ledger-shell {
  grid-template-columns: var(--admin-sidebar-width) minmax(0, 1fr);
}

.admin-page .ledger-sidebar {
  z-index: 20;
  width: var(--admin-sidebar-width);
  padding: 22px 16px 18px;
  background: #fff;
  border-right: 1px solid #e2e9f2;
  backdrop-filter: none;
}

.admin-page .ledger-brand {
  min-height: 56px;
  padding: 0 8px 22px;
}

.admin-page .ledger-brand .brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  box-shadow: 0 8px 18px rgba(10, 116, 232, 0.16);
}

.admin-page .ledger-brand .brand-copy {
  display: flex;
}

.admin-page .ledger-brand .brand-copy strong {
  font-size: 16px;
}

.admin-page .ledger-nav {
  gap: 3px;
  display: flex;
  grid-template-columns: none;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: thin;
}

.admin-page .nav-section-label {
  display: block;
  padding: 16px 12px 6px;
  color: #8a98a9;
  font-size: 11px;
  line-height: 1;
  font-weight: 760;
  letter-spacing: 0.08em;
}

.admin-page .nav-section-label:first-child {
  padding-top: 2px;
}

.admin-page .admin-nav-item {
  position: relative;
  min-height: 44px;
  justify-content: flex-start;
  gap: 11px;
  padding: 0 11px;
  color: #526174;
  border: 0;
  border-radius: 10px;
}

.admin-page .admin-nav-item::before {
  position: absolute;
  left: 0;
  top: 11px;
  bottom: 11px;
  width: 3px;
  content: "";
  background: transparent;
  border-radius: 0 3px 3px 0;
}

.admin-page .admin-nav-item:hover {
  color: #125fac;
  background: #f4f8fd;
}

.admin-page .admin-nav-item.is-active {
  color: #075fc3;
  background: #eaf4ff;
  box-shadow: none;
}

.admin-page .admin-nav-item.is-active::before {
  background: var(--primary);
}

.admin-page .admin-nav-item strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.admin-page .nav-icon {
  width: 30px;
  height: 30px;
  color: #6c7d90;
  background: transparent;
  border: 0;
  border-radius: 8px;
}

.admin-page .admin-nav-item:hover .nav-icon,
.admin-page .admin-nav-item.is-active .nav-icon {
  color: currentColor;
}

.admin-page .nav-icon .ui-icon {
  width: 19px;
  height: 19px;
}

.admin-page .ledger-sidebar-footer {
  display: flex;
  margin-top: 18px;
  padding: 16px 8px 0;
}

.admin-page .sidebar-status-row:first-child {
  justify-content: flex-start;
}

.admin-page .sidebar-status-row:first-child strong {
  margin-left: auto;
}

.admin-page .sidebar-scrim {
  display: none;
}

.admin-page .ledger-main {
  min-width: 0;
}

.admin-page .ledger-topbar {
  min-height: 76px;
  padding: 0 clamp(20px, 2.2vw, 34px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom-color: #e2e9f2;
  backdrop-filter: blur(14px);
}

.admin-page .ledger-title-row {
  gap: 12px;
}

.admin-page .ledger-title-row h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.admin-page .ledger-title-row p {
  margin-top: 3px;
  font-size: 12px;
}

.admin-page .menu-icon-button {
  display: none;
}

.admin-page .top-icon-button,
.admin-page .menu-icon-button,
.admin-page .user-menu-button,
.admin-page .detail-close-button,
.admin-page .table-action-button,
.admin-page .copy-key-button {
  min-width: 42px;
  height: 42px;
  border-radius: 9px;
}

.admin-page .top-icon-button.command-button {
  min-width: 42px;
  height: 42px;
  gap: 7px;
  padding: 0 12px;
}

.admin-page .top-icon-button.command-button .ui-icon {
  width: 18px;
  height: 18px;
}

.admin-page .topbar-primary-action {
  white-space: nowrap;
}

.admin-page .top-search-field {
  width: min(340px, 28vw);
}

.admin-page .top-search-field > span {
  display: grid;
  place-items: center;
}

.admin-page .top-search-field .ui-icon {
  width: 18px;
  height: 18px;
}

.admin-page .ledger-user {
  min-height: 44px;
  padding: 5px 5px 5px 7px;
  border-radius: 11px;
}

.admin-page .user-avatar {
  width: 32px;
  height: 32px;
}

.admin-page .user-avatar .ui-icon {
  width: 17px;
  height: 17px;
}

.admin-page .user-menu-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 42px;
  padding: 0 10px;
}

.admin-page .user-menu-button .ui-icon {
  width: 17px;
  height: 17px;
}

.admin-page .ledger-work-section {
  width: min(100%, 1680px);
  margin: 0 auto;
  padding: 28px clamp(20px, 2.2vw, 34px) 40px;
}

/* Dashboard overview */

.admin-page .dashboard-console {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-page .dashboard-welcome {
  position: relative;
  display: grid;
  min-height: 176px;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.38fr);
  align-items: stretch;
  gap: 28px;
  padding: clamp(24px, 3vw, 34px);
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 14%, rgba(73, 163, 255, 0.17), transparent 36%),
    linear-gradient(135deg, #f7fbff 0%, #edf6ff 100%);
  border-color: #cfe3f8;
}

.admin-page .dashboard-welcome::after {
  position: absolute;
  right: -90px;
  bottom: -130px;
  width: 330px;
  height: 330px;
  content: "";
  border: 54px solid rgba(10, 116, 232, 0.045);
  border-radius: 50%;
  pointer-events: none;
}

.admin-page .dashboard-welcome-copy {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
}

.admin-page .dashboard-welcome .section-eyebrow {
  margin-bottom: 9px;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.admin-page .dashboard-welcome h2 {
  margin: 0;
  color: #10243a;
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.2;
  font-weight: 820;
  letter-spacing: -0.025em;
}

.admin-page .dashboard-welcome p {
  max-width: 720px;
  margin: 10px 0 0;
  color: #5d7085;
  font-size: 14px;
}

.admin-page .dashboard-welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.admin-page .dashboard-health-card {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(175, 207, 239, 0.9);
  border-radius: 13px;
  box-shadow: 0 10px 28px rgba(26, 87, 148, 0.07);
  backdrop-filter: blur(8px);
}

.admin-page .dashboard-health-card span {
  color: #6d7f92;
  font-size: 12px;
  font-weight: 720;
}

.admin-page .dashboard-health-card strong {
  margin-top: 6px;
  color: #0a62c6;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 820;
}

.admin-page .dashboard-health-card small {
  margin-top: 10px;
  color: #718194;
  font-size: 12px;
  line-height: 1.55;
}

.admin-page .summary-strip {
  gap: 14px;
  margin: 0;
}

.admin-page .metric-card {
  min-height: 108px;
  gap: 13px;
  padding: 18px;
  overflow: visible;
  background: #fff;
  border-color: var(--admin-panel-border);
  border-radius: 14px;
  box-shadow: var(--admin-panel-shadow);
}

.admin-page .metric-card::after,
.admin-page .metric-spark {
  display: none;
}

.admin-page .metric-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
}

.admin-page .metric-icon .ui-icon {
  width: 20px;
  height: 20px;
}

.admin-page .metric-copy {
  gap: 2px;
}

.admin-page .metric-copy span {
  font-size: 12px;
  font-weight: 700;
}

.admin-page .metric-copy strong {
  font-size: 25px;
}

.admin-page .metric-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-page .dashboard-console-board {
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
  gap: 18px;
}

.admin-page .dashboard-console-lower {
  grid-template-columns: minmax(0, 1.38fr) minmax(330px, 0.72fr);
  gap: 18px;
  margin-top: 0;
}

.admin-page .console-main-panel,
.admin-page .console-side-panel,
.admin-page .console-workflow-panel,
.admin-page .console-product-panel,
.admin-page .console-today-panel,
.admin-page .audit-main-panel,
.admin-page .audit-side-panel {
  padding: 22px;
}

.admin-page .console-attention-panel,
.admin-page .console-activity-panel {
  min-height: 286px;
}

.admin-page .panel-kicker {
  display: block;
  margin-bottom: 5px;
  color: #7c8da0;
  font-size: 11px;
  line-height: 1;
  font-weight: 760;
  letter-spacing: 0.08em;
}

.admin-page .panel-text-link {
  display: inline-flex;
  min-height: 36px;
  flex: 0 0 auto;
  align-items: center;
  padding: 0 10px;
  color: var(--primary-text);
  font-size: 12px;
  font-weight: 720;
  background: #f3f8fe;
  border-radius: 8px;
}

.admin-page .panel-text-link:hover {
  color: #064fa7;
  background: #e8f3ff;
}

.admin-page .dashboard-list {
  margin-top: 15px;
}

.admin-page .dashboard-list-item {
  position: relative;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 52px;
  padding: 12px 8px;
  border-top-color: #e8edf4;
  border-radius: 8px;
  transition: background 0.16s ease;
}

.admin-page .dashboard-list-item:hover {
  background: #f6f9fd;
}

.admin-page .dashboard-list-item span {
  margin: 0;
  color: #587089;
  font-weight: 700;
}

.admin-page .dashboard-list-item strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-page .dashboard-list-item small {
  color: #8794a4;
  text-align: right;
  white-space: nowrap;
}

.admin-page .dashboard-list-item-danger,
.admin-page .dashboard-list-item-warning {
  padding-left: 12px;
}

.admin-page .dashboard-list-item-danger::before,
.admin-page .dashboard-list-item-warning::before {
  position: absolute;
  left: 2px;
  top: 13px;
  bottom: 13px;
  width: 3px;
  content: "";
  border-radius: 3px;
}

.admin-page .dashboard-list-item-danger::before {
  background: var(--red);
}

.admin-page .dashboard-list-item-warning::before {
  background: var(--amber);
}

.admin-page .dashboard-workflow-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-page .dashboard-workflow-card {
  display: grid;
  min-height: 112px;
  grid-template-columns: 42px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 13px;
  padding: 16px;
  background: #f8fafc;
  border-color: #e2e9f2;
  border-radius: 12px;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.admin-page .dashboard-workflow-card:hover {
  background: #fff;
  border-color: #bdd9f5;
  box-shadow: 0 10px 24px rgba(28, 65, 108, 0.08);
  transform: translateY(-2px);
}

.admin-page .dashboard-workflow-card .workflow-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin: 0;
  color: #0b68ce;
  background: #e9f4ff;
  border: 1px solid #d1e7fb;
  border-radius: 11px;
}

.admin-page .dashboard-workflow-card .workflow-icon .ui-icon {
  width: 20px;
  height: 20px;
}

.admin-page .dashboard-workflow-card .workflow-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  margin: 0;
}

.admin-page .dashboard-workflow-card .workflow-copy strong {
  font-size: 14px;
  line-height: 1.35;
}

.admin-page .dashboard-workflow-card .workflow-copy small {
  display: block;
  max-width: 100%;
  margin: 4px 0 0;
  overflow: hidden;
  color: #738397;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-page .dashboard-workflow-card .workflow-copy em {
  display: inline-flex;
  margin-top: 9px;
  padding: 3px 7px;
  color: #28689f;
  font-size: 11px;
  line-height: 1.35;
  font-style: normal;
  font-weight: 720;
  background: #edf6ff;
  border-radius: 999px;
}

.admin-page .dashboard-workflow-card .workflow-arrow {
  display: grid;
  width: 22px;
  place-items: center;
  margin: 0;
  color: #9aa8b7;
}

.admin-page .dashboard-workflow-card:hover .workflow-arrow {
  color: var(--primary);
}

.admin-page .dashboard-workflow-card .workflow-arrow .ui-icon {
  width: 18px;
  height: 18px;
}

.admin-page .dashboard-today-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-page .dashboard-today-card {
  min-height: 112px;
  padding: 16px;
  background: #f8fafc;
  border-color: #e2e9f2;
  border-radius: 12px;
}

.admin-page .dashboard-today-card > span {
  margin: 0;
  color: #6e7f92;
}

.admin-page .dashboard-today-card > strong {
  margin-top: 9px;
  font-size: 24px;
}

.admin-page .dashboard-today-card > small {
  margin-top: 7px;
  line-height: 1.45;
}

.admin-page .dashboard-product-panel {
  margin-top: 0;
}

.admin-page .dashboard-product-grid {
  gap: 14px;
}

.admin-page .dashboard-product-card {
  padding: 18px;
  background: #f8fafc;
  border-color: #e2e9f2;
  border-radius: 12px;
}

.admin-page .dashboard-product-card > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-page .dashboard-product-card > div:first-child span,
.admin-page .dashboard-product-card > div:first-child strong {
  margin: 0;
}

.admin-page .dashboard-product-card > div:first-child strong {
  font-size: 18px;
}

.admin-page .dashboard-product-meter {
  height: 7px;
  margin: 14px 0 12px;
}

.admin-page .dashboard-product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.admin-page .dashboard-product-meta span {
  margin: 0;
  color: #6f8092;
  font-weight: 650;
}

.admin-page .dashboard-empty {
  min-height: 154px;
  grid-template-columns: 42px minmax(0, 1fr);
  justify-content: center;
  align-content: center;
  gap: 13px;
  padding: 24px;
  color: #718295;
  text-align: left;
  background: #f8fafc;
  border-color: #d5e1ed;
  border-radius: 12px;
}

.admin-page .dashboard-empty-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #66809a;
  background: #edf2f7;
  border-radius: 50%;
}

.admin-page .dashboard-empty-success .dashboard-empty-icon {
  color: var(--green-text);
  background: var(--green-soft);
}

.admin-page .dashboard-empty strong,
.admin-page .dashboard-empty span {
  display: block;
}

.admin-page .dashboard-empty strong {
  color: #33465a;
  font-size: 14px;
}

.admin-page .dashboard-empty div > span {
  margin-top: 4px;
  color: #76879a;
  font-size: 12px;
  line-height: 1.55;
}

/* Data workspaces */

.admin-page .ledger-board,
.admin-page .contacts-console-board,
.admin-page .keys-console-board,
.admin-page .records-console-board,
.admin-page .offline-console-board,
.admin-page .mail-console-board,
.admin-page .audit-console-board {
  gap: 18px;
}

.admin-page .license-workspace:not(.has-selection),
.admin-page .contacts-console-board:not(.has-selection),
.admin-page .keys-console-board:not(.has-selection) {
  grid-template-columns: minmax(0, 1fr);
}

.admin-page .license-workspace:not(.has-selection) .ledger-detail-panel,
.admin-page .contacts-console-board:not(.has-selection) .contact-detail-panel,
.admin-page .keys-console-board:not(.has-selection) .key-detail-panel {
  display: none;
}

.admin-page .ledger-table-panel,
.admin-page .ledger-detail-panel,
.admin-page .contacts-list-panel,
.admin-page .contact-detail-panel,
.admin-page .keys-table-panel,
.admin-page .key-detail-panel,
.admin-page .records-license-panel,
.admin-page .records-summary-panel,
.admin-page .records-table-panel,
.admin-page .offline-signer-panel,
.admin-page .offline-side-panel,
.admin-page .mail-settings-panel,
.admin-page .mail-side-panel {
  padding: 22px;
}

.admin-page .ledger-filter-panel {
  padding-bottom: 18px;
}

.admin-page .ledger-filter-controls {
  gap: 10px;
}

.admin-page .ledger-filter-field {
  width: 172px;
}

.admin-page .license-table th,
.admin-page .record-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding-top: 12px;
  padding-bottom: 12px;
  color: #68798c;
  background: #f7f9fc;
}

.admin-page .license-table td,
.admin-page .record-table td {
  padding-top: 14px;
  padding-bottom: 14px;
}

.admin-page .license-table-row:hover,
.admin-page .license-table-row.is-selected {
  background: #f3f8fe;
}

.admin-page .license-table-row.is-selected {
  box-shadow: inset 3px 0 0 var(--primary);
}

.admin-page .pagination-button {
  min-height: 42px;
  border-radius: 9px;
}

.admin-page .contact-card {
  border-radius: 10px;
}

.admin-page .contact-card:hover {
  background: #f6f9fd;
}

.admin-page .license-card.is-selected,
.admin-page .record-license-card.is-selected,
.admin-page .contact-card.is-selected {
  background: #eef6ff;
  border-color: #c8e0f8;
  border-radius: 10px;
}

.admin-page .ledger-detail-panel,
.admin-page .contact-detail-panel,
.admin-page .key-detail-panel {
  border-color: #d5e3f1;
}

.admin-page .dialog-backdrop,
.admin-page .device-dialog-backdrop {
  background: rgba(12, 25, 42, 0.48);
  backdrop-filter: blur(6px);
}

.admin-page .dialog-card,
.admin-page .device-dialog {
  border-radius: 16px;
}

.admin-page .create-dialog-aside,
.admin-page .security-summary {
  background: #f5f9fd;
  border-radius: 12px;
}

/* Keep navigation readable: below desktop width it becomes a true drawer. */

@media (max-width: 1100px) {
  body.admin-page.is-admin-sidebar-open {
    overflow: hidden;
  }

  .admin-page .ledger-shell,
  .admin-page .ledger-shell.is-sidebar-expanded {
    display: block;
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-page .ledger-sidebar,
  .admin-page .ledger-shell.is-sidebar-expanded .ledger-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 52;
    display: flex;
    width: min(286px, calc(100vw - 54px));
    height: 100dvh;
    padding: 22px 16px 18px;
    border-right: 1px solid #dbe5ef;
    box-shadow: 18px 0 48px rgba(18, 38, 65, 0.15);
    transform: translateX(-104%);
    transition: transform 0.22s ease;
  }

  .admin-page .ledger-shell.is-sidebar-expanded .ledger-sidebar {
    transform: translateX(0);
  }

  .admin-page .ledger-sidebar .ledger-brand .brand-copy,
  .admin-page .ledger-sidebar .admin-nav-item strong,
  .admin-page .ledger-sidebar .ledger-sidebar-footer,
  .admin-page .ledger-shell.is-sidebar-expanded .ledger-brand .brand-copy,
  .admin-page .ledger-shell.is-sidebar-expanded .admin-nav-item strong,
  .admin-page .ledger-shell.is-sidebar-expanded .ledger-sidebar-footer {
    display: flex;
  }

  .admin-page .ledger-sidebar .admin-nav-item,
  .admin-page .ledger-shell.is-sidebar-expanded .admin-nav-item {
    justify-content: flex-start;
    padding: 0 11px;
  }

  .admin-page .ledger-sidebar .nav-icon,
  .admin-page .ledger-shell.is-sidebar-expanded .nav-icon {
    width: 30px;
    height: 30px;
  }

  .admin-page .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 51;
    display: block;
    padding: 0;
    background: rgba(13, 27, 46, 0.4);
    border: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .admin-page .ledger-shell.is-sidebar-expanded .sidebar-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .admin-page .menu-icon-button {
    display: inline-grid;
    min-width: 44px;
    height: 44px;
  }

  .admin-page .ledger-topbar {
    min-height: 72px;
  }

  .admin-page .dashboard-console-board,
  .admin-page .dashboard-console-lower {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-page .dashboard-workflow-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .admin-page .ledger-work-section {
    padding: 22px 18px 32px;
  }

  .admin-page .dashboard-welcome {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-page .dashboard-health-card {
    min-height: 112px;
  }

  .admin-page .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-page .ledger-board,
  .admin-page .contacts-console-board,
  .admin-page .keys-console-board,
  .admin-page .records-console-board,
  .admin-page .offline-console-board,
  .admin-page .mail-console-board,
  .admin-page .audit-console-board {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-page .ledger-detail-panel,
  .admin-page .contact-detail-panel,
  .admin-page .key-detail-panel {
    position: static;
    max-height: none;
  }

  .admin-page .dashboard-list-item {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .admin-page .dashboard-list-item small {
    grid-column: 2;
    text-align: left;
  }
}

@media (max-width: 760px) {
  .admin-page .ledger-topbar {
    position: sticky;
    display: flex;
    min-height: auto;
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
  }

  .admin-page .ledger-title-row {
    width: 100%;
  }

  .admin-page .ledger-title-row h1 {
    font-size: 20px;
  }

  .admin-page .ledger-title-row p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .admin-page .ledger-topbar-actions {
    width: 100%;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
  }

  .admin-page .top-search-field {
    width: 100%;
    min-width: 0;
    flex: 1 0 100%;
  }

  .admin-page .top-icon-button.command-button {
    width: 44px;
    min-width: 44px;
    padding: 0;
  }

  .admin-page .top-icon-button.command-button > span {
    display: none;
  }

  .admin-page .topbar-primary-action {
    min-height: 44px;
  }

  .admin-page .ledger-user {
    width: 44px;
    min-width: 44px;
    height: 44px;
    margin-left: 0;
    padding: 0;
    background: transparent;
    border: 0;
  }

  .admin-page .ledger-user > div {
    display: none;
  }

  .admin-page .ledger-user .user-avatar {
    display: none;
  }

  .admin-page .user-menu-button {
    width: 44px;
    height: 44px;
    padding: 0;
    background: #fff;
    border: 1px solid var(--line);
  }

  .admin-page .user-menu-button > span {
    display: none;
  }

  .admin-page .dashboard-welcome {
    min-height: 0;
    padding: 22px;
  }

  .admin-page .dashboard-welcome::after {
    right: -190px;
  }

  .admin-page .dashboard-welcome h2 {
    font-size: 25px;
  }

  .admin-page .dashboard-welcome-actions .button {
    flex: 1 1 150px;
  }

  .admin-page .metric-card {
    min-height: 102px;
    padding: 15px;
  }

  .admin-page .metric-icon {
    width: 38px;
    height: 38px;
  }

  .admin-page .metric-copy strong {
    font-size: 22px;
  }

  .admin-page .console-main-panel,
  .admin-page .console-side-panel,
  .admin-page .console-workflow-panel,
  .admin-page .console-product-panel,
  .admin-page .console-today-panel,
  .admin-page .audit-main-panel,
  .admin-page .audit-side-panel,
  .admin-page .ledger-table-panel,
  .admin-page .ledger-detail-panel,
  .admin-page .contacts-list-panel,
  .admin-page .contact-detail-panel,
  .admin-page .keys-table-panel,
  .admin-page .key-detail-panel,
  .admin-page .records-license-panel,
  .admin-page .records-summary-panel,
  .admin-page .records-table-panel,
  .admin-page .offline-signer-panel,
  .admin-page .offline-side-panel,
  .admin-page .mail-settings-panel,
  .admin-page .mail-side-panel {
    padding: 18px;
  }

  .admin-page .dashboard-workflow-grid,
  .admin-page .dashboard-product-grid,
  .admin-page .dashboard-today-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-page .dashboard-workflow-card {
    min-height: 102px;
  }

  .admin-page .ledger-filter-bar,
  .admin-page .ledger-filter-controls,
  .admin-page .ledger-detail-actions,
  .admin-page .certificate-output-head,
  .admin-page .form-actions,
  .admin-page .mail-form-actions,
  .admin-page .offline-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-page .ledger-filter-field {
    width: 100%;
  }

  .admin-page .list-pagination {
    justify-content: space-between;
  }

  .admin-page .dialog-backdrop,
  .admin-page .device-dialog-backdrop {
    place-items: end center;
    padding: 10px;
  }

  .admin-page .dialog-card,
  .admin-page .device-dialog {
    width: 100%;
    max-height: calc(100dvh - 20px);
    padding: 18px;
    border-radius: 16px 16px 12px 12px;
  }

  .admin-page .create-dialog-grid,
  .admin-page .security-grid,
  .admin-page .field-row,
  .admin-page .field-grid,
  .admin-page .mail-form-grid,
  .admin-page .offline-form-grid,
  .admin-page .info-grid,
  .admin-page .history-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-page .create-license-dialog-card .create-dialog-aside {
    display: none;
  }

  .admin-page .create-license-dialog-card .create-dialog-grid {
    margin-top: 16px;
  }

  .admin-page input,
  .admin-page select,
  .admin-page textarea {
    font-size: 16px;
  }
}

@media (max-width: 520px) {
  .admin-page .ledger-work-section {
    padding: 16px 12px 28px;
  }

  .admin-page .summary-strip {
    gap: 10px;
  }

  .admin-page .metric-card {
    min-height: 120px;
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .admin-page .metric-copy {
    width: 100%;
  }

  .admin-page .metric-copy small {
    white-space: normal;
  }

  .admin-page .panel-header,
  .admin-page .console-panel-head,
  .admin-page .ledger-detail-head,
  .admin-page .dialog-head {
    flex-direction: column;
  }

  .admin-page .panel-text-link {
    align-self: flex-start;
  }

  .admin-page .create-license-dialog-card .dialog-head {
    align-items: flex-start;
    flex-direction: row;
  }

  .admin-page .create-license-dialog-card .dialog-head > div {
    min-width: 0;
  }

  .admin-page .create-license-dialog-card .dialog-head .button {
    flex: 0 0 auto;
  }

  .admin-page .dashboard-list-item,
  .admin-page .dashboard-list-item-danger,
  .admin-page .dashboard-list-item-warning {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding: 12px 10px;
  }

  .admin-page .dashboard-list-item small {
    text-align: left;
    white-space: normal;
  }

  .admin-page .dashboard-list-item strong {
    white-space: normal;
  }

  .admin-page .dashboard-empty {
    min-height: 164px;
    grid-template-columns: minmax(0, 1fr);
    text-align: center;
  }

  .admin-page .dashboard-empty-icon {
    margin: 0 auto;
  }

  .admin-page .topbar-primary-action {
    flex: 1 1 auto;
  }

  .admin-page .ledger-user {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .admin-page *,
  .admin-page *::before,
  .admin-page *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
