:root {
  --ink: #18251f;
  --muted: #6c756f;
  --line: #e4e8e4;
  --paper: #f4f5f1;
  --white: #fff;
  --green: #235b45;
  --green-deep: #173d31;
  --lime: #d8f36a;
  --lime-soft: #eef9c7;
  --orange: #f19743;
  --red: #bd4b42;
  --shadow: 0 18px 50px rgba(28, 49, 40, .09);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.visually-hidden-field {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

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

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 86% 6%, rgba(216, 243, 106, .2), transparent 28rem),
    var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { color: inherit; }

.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 18px 20px;
  color: #eef5ef;
  background:
    linear-gradient(160deg, rgba(216, 243, 106, .08), transparent 32%),
    var(--green-deep);
}

.brand { display: flex; gap: 12px; align-items: center; padding: 0 10px 28px; color: inherit; text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: var(--green-deep);
  background: var(--lime);
  font-weight: 900;
  letter-spacing: -.04em;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: .02em; }
.brand small { margin-top: 4px; color: #9ab0a4; font-size: 9px; letter-spacing: .16em; }

.nav-list { display: grid; gap: 7px; }
.nav-item {
  width: 100%;
  min-height: 46px;
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  color: #aebfb6;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.nav-item.is-active { color: var(--green-deep); background: var(--lime); font-weight: 750; }
.nav-icon { font-size: 20px; line-height: 1; }
.nav-count { min-width: 23px; padding: 2px 7px; border-radius: 99px; background: rgba(23, 61, 49, .12); text-align: center; font-size: 11px; }

.sync-card {
  margin-top: auto;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px;
  background: rgba(255, 255, 255, .045);
}
.sync-card-head { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.sync-orb { width: 8px; height: 8px; border-radius: 50%; background: #efd26e; box-shadow: 0 0 0 5px rgba(239, 210, 110, .1); }
.sync-orb.is-online { background: var(--lime); box-shadow: 0 0 0 5px rgba(216, 243, 106, .1); }
.sync-orb.is-error { background: #ff8076; box-shadow: 0 0 0 5px rgba(255, 128, 118, .1); }
.sync-card p { min-height: 32px; margin: 10px 0 16px; color: #90a89b; font-size: 11px; line-height: 1.45; }
.sync-meta { display: flex; justify-content: space-between; gap: 8px; padding-top: 11px; border-top: 1px solid rgba(255, 255, 255, .08); color: #80988b; font-size: 10px; }
.sync-meta time { color: #cfdbd4; }

.sidebar-foot { display: flex; gap: 10px; align-items: center; margin-top: 14px; padding: 11px 9px 0; border-top: 1px solid rgba(255, 255, 255, .07); }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; background: rgba(255,255,255,.06); font-size: 12px; }
.sidebar-foot strong, .sidebar-foot small { display: block; }
.sidebar-foot strong { font-size: 11px; }
.sidebar-foot small { margin-top: 3px; color: #779084; font-size: 9px; }
.sidebar-user { min-width: 0; }
.sidebar-user strong, .sidebar-user small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { min-width: 0; padding: 28px clamp(22px, 3.2vw, 52px) 48px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.eyebrow { margin: 0 0 5px; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.topbar h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(25px, 3vw, 37px); font-weight: 650; letter-spacing: -.04em; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.current-user-chip { min-width: 112px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.58); }
.current-user-chip strong, .current-user-chip small { display: block; overflow: hidden; max-width: 150px; text-overflow: ellipsis; white-space: nowrap; }
.current-user-chip strong { font-size: 10px; }
.current-user-chip small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.logout-button, .password-button { min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: rgba(255,255,255,.7); cursor: pointer; font-size: 10px; font-weight: 700; }
.logout-button:hover, .password-button:hover { border-color: #cbd3cd; color: var(--green); background: white; }
.date-chip { padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: rgba(255,255,255,.5); font-size: 11px; }
.sync-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 15px;
  border: 0;
  border-radius: 10px;
  color: white;
  background: var(--green);
  box-shadow: 0 7px 18px rgba(35, 91, 69, .17);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.sync-button:hover { background: #1d4e3b; }
.sync-button:disabled { cursor: wait; opacity: .65; }
.sync-button.is-loading .refresh-icon { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 30px;
  min-height: 190px;
  padding: 32px 34px;
  border-radius: 20px;
  color: #f7fbf8;
  background:
    linear-gradient(120deg, rgba(216,243,106,.12), transparent 48%),
    linear-gradient(135deg, #173d31, #235b45);
  box-shadow: var(--shadow);
}
.hero-panel::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -115px;
  width: 280px;
  height: 280px;
  border: 1px solid rgba(216, 243, 106, .18);
  border-radius: 50%;
  box-shadow: 0 0 0 45px rgba(216, 243, 106, .025), 0 0 0 90px rgba(216, 243, 106, .018);
}
.hero-panel > * { position: relative; z-index: 1; }
.hero-kicker { color: var(--lime); font-size: 9px; font-weight: 900; letter-spacing: .23em; }
.hero-panel h2 { max-width: 610px; margin: 13px 0 10px; font-family: Georgia, "Songti SC", serif; font-size: clamp(23px, 2.7vw, 36px); font-weight: 600; line-height: 1.22; letter-spacing: -.035em; }
.hero-panel p { max-width: 650px; margin: 0; color: #a9beb3; font-size: 12px; line-height: 1.7; }
.hero-flow { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.hero-flow span { padding: 8px 10px; border: 1px solid rgba(255,255,255,.13); border-radius: 8px; color: #bfd0c7; background: rgba(255,255,255,.055); font-size: 10px; }
.hero-flow i { color: #729084; font-style: normal; }
.hero-flow .is-highlight { border-color: var(--lime); color: var(--green-deep); background: var(--lime); font-weight: 800; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin: 15px 0; }
.metric-card { min-height: 129px; padding: 19px 20px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.78); }
.metric-primary { border-color: transparent; background: var(--lime-soft); }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 10px; font-weight: 700; }
.metric-top i { color: #a6aea8; font-style: normal; font-size: 9px; letter-spacing: .08em; }
.metric-card > strong { display: block; margin: 16px 0 5px; font-family: Georgia, serif; font-size: 28px; font-weight: 600; line-height: 1; }
.metric-card > small { color: #818983; font-size: 9px; }
.metric-card .metric-status { color: var(--green); font-family: inherit; font-size: 19px; font-weight: 800; }

.workspace { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.86); box-shadow: 0 10px 34px rgba(28,49,40,.045); }
.workspace-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 23px 24px 17px; }
.workspace-head h2 { margin: 0 0 5px; font-family: Georgia, "Songti SC", serif; font-size: 20px; font-weight: 650; }
.workspace-head p { margin: 0; color: var(--muted); font-size: 10px; }
.filters { display: flex; gap: 8px; }
.search-box { display: flex; align-items: center; gap: 8px; width: min(380px, 31vw); min-width: 230px; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.search-box > span { color: #87918b; font-size: 18px; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; }
.search-box input::placeholder { color: #9ca39e; }
.search-box kbd { padding: 2px 5px; border: 1px solid #e2e5e2; border-radius: 4px; color: #9aa19c; background: #f6f7f5; font: 9px/1.3 inherit; }
.filters select { height: 38px; padding: 0 30px 0 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: white; font-size: 10px; }

.status-tabs { display: flex; gap: 5px; padding: 0 24px 13px; border-bottom: 1px solid var(--line); }
.status-tab { padding: 7px 10px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; font-size: 10px; font-weight: 700; }
.status-tab span { margin-left: 3px; color: #9ca49f; }
.status-tab.is-active { color: var(--green-deep); background: var(--lime-soft); }

.table-wrap { min-height: 260px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 13px; color: #8a928d; background: #f8f9f7; text-align: left; font-size: 9px; font-weight: 800; letter-spacing: .025em; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 24px; }
th:last-child, td:last-child { padding-right: 24px; }
td { padding: 15px 13px; border-top: 1px solid #edf0ed; vertical-align: middle; font-size: 10px; }
tbody tr { cursor: pointer; transition: background .15s ease; }
tbody tr:hover { background: #fbfcf8; }
.align-right { text-align: right; }
.tracking-cell { display: flex; align-items: center; gap: 9px; }
.carrier-badge { display: grid; place-items: center; flex: 0 0 auto; width: 31px; height: 31px; border-radius: 9px; color: white; background: var(--green); font-size: 9px; font-weight: 900; }
.tracking-cell strong { display: block; font-size: 10px; letter-spacing: .025em; }
.tracking-cell small, .stack-cell small { display: block; margin-top: 4px; color: #8b948e; font-size: 8px; }
.stack-cell strong { display: block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.item-summary { max-width: 270px; }
.item-summary strong { display: block; overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.item-summary small { display: block; margin-top: 4px; color: #89928c; font-size: 8px; }
.warehouse-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 7px; color: #4c6257; background: #f0f4f1; font-size: 9px; white-space: nowrap; }
.warehouse-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #7fa18f; }
.quantity { text-align: right; font-family: Georgia, serif; font-size: 14px; font-weight: 700; }
.quantity strong, .quantity small { display: block; white-space: nowrap; }
.quantity small { margin-top: 4px; color: #8b948e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 8px; font-weight: 500; }
.time-cell { color: #67716b; white-space: nowrap; }
.time-cell small { display: block; margin-top: 4px; color: #9aa19d; font-size: 8px; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 99px; color: #4c654c; background: #edf5e8; font-size: 9px; font-weight: 700; white-space: nowrap; }
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #6e9d63; }
.status-pill.is-voided { color: #8a514c; background: #faecea; }
.status-pill.is-voided::before { background: var(--red); }
.status-pill.is-arrived { color: #4c6470; background: #eaf1f4; }
.status-pill.is-arrived::before { background: #6f95a6; }
.status-pill.is-short { color: #7b5524; background: #fff0d9; }
.status-pill.is-short::before { background: var(--orange); }

.empty-state { padding: 54px 20px 60px; text-align: center; }
.empty-mark { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 13px; border-radius: 14px; color: var(--green); background: var(--lime-soft); font-size: 27px; }
.empty-state h3 { margin: 0 0 8px; font-size: 13px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 10px; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(15, 31, 24, .28); backdrop-filter: blur(2px); }
.drawer { position: fixed; top: 0; right: 0; z-index: 21; width: min(520px, 92vw); height: 100vh; overflow-y: auto; padding: 34px 34px 50px; background: #fff; box-shadow: -24px 0 60px rgba(15,31,24,.16); transform: translateX(105%); transition: transform .24s ease; }
.drawer.is-open { transform: translateX(0); }
.drawer-close { position: absolute; right: 22px; top: 20px; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 9px; background: white; cursor: pointer; font-size: 19px; }
.detail-kicker { margin: 0 0 8px; color: var(--green); font-size: 9px; font-weight: 850; letter-spacing: .18em; }
.detail-title { margin: 0; font-family: Georgia, serif; font-size: 26px; letter-spacing: -.025em; }
.detail-carrier { margin: 8px 0 24px; color: var(--muted); font-size: 11px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 25px; }
.detail-field { padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #fafbf9; }
.detail-field span, .detail-field strong { display: block; }
.detail-field span { margin-bottom: 7px; color: #8b938e; font-size: 8px; }
.detail-field strong { font-size: 10px; }
.detail-section h3 { margin: 0 0 11px; font-family: Georgia, "Songti SC", serif; font-size: 17px; }
.detail-warning { margin-bottom: 14px; padding: 10px 12px; border-left: 3px solid var(--orange); color: #755838; background: #fff8ec; font-size: 9px; line-height: 1.55; }
.detail-item { display: grid; grid-template-columns: 1fr auto; gap: 13px; padding: 14px 0; border-top: 1px solid var(--line); }
.detail-item strong { display: block; font-size: 11px; }
.detail-item small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.detail-item-qty { align-self: center; color: var(--green); font-family: Georgia, serif; font-size: 18px; font-weight: 700; }
.copy-button { margin-top: 12px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--green); background: white; cursor: pointer; font-size: 9px; font-weight: 750; }

.toast { position: fixed; z-index: 30; left: 50%; bottom: 28px; min-width: 160px; padding: 10px 14px; border-radius: 9px; color: white; background: var(--green-deep); box-shadow: var(--shadow); text-align: center; font-size: 10px; opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: .2s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.auth-layer { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(15, 31, 24, .74); backdrop-filter: blur(10px); }
.auth-card { width: min(420px, 100%); padding: 34px; border: 1px solid rgba(255,255,255,.28); border-radius: 22px; background: #fff; box-shadow: 0 30px 90px rgba(6, 20, 14, .28); }
.auth-mark { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 22px; border-radius: 13px; color: var(--green-deep); background: var(--lime); font-weight: 900; }
.auth-card h2 { margin: 0 0 10px; font-family: Georgia, "Songti SC", serif; font-size: 26px; }
.auth-card > p:not(.detail-kicker) { margin: 0 0 24px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.auth-card label span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 9px; font-weight: 750; }
.auth-card input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; outline: 0; }
.auth-card input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(35,91,69,.1); }
.auth-card button { width: 100%; height: 44px; margin-top: 12px; border: 0; border-radius: 10px; color: white; background: var(--green); cursor: pointer; font-weight: 800; }
.auth-card button:disabled { cursor: wait; opacity: .65; }
.auth-card > small { display: block; min-height: 16px; margin-top: 9px; color: var(--red); font-size: 9px; }
.auth-card label + label { display: block; margin-top: 12px; }
.password-form-field { margin-top: 12px; }
.password-form-field > label { margin-top: 0; }
.password-input-shell { position: relative; }
.password-input-shell input { padding-right: 66px; }
.password-visibility-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  min-width: 48px;
  height: 32px;
  margin: 0;
  padding: 0 9px;
  transform: translateY(-50%);
  border: 1px solid #dce2dd;
  border-radius: 8px;
  color: var(--green);
  background: #f7faf7;
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
}
.password-visibility-toggle:hover { border-color: #c7d2ca; background: white; }
.password-visibility-toggle:focus-visible { outline: 2px solid rgba(35,91,69,.28); outline-offset: 1px; }
.auth-card .password-form-field > label > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 9px; font-weight: 750; }
.auth-card .password-visibility-toggle { width: auto; height: 32px; margin: 0; border: 1px solid #dce2dd; color: var(--green); background: #f7faf7; }
.auth-card .password-visibility-toggle:hover { background: white; }

.management-view { display: grid; gap: 15px; }
.management-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 26px;
  min-height: 150px;
  padding: 28px 30px;
  border-radius: 20px;
  color: #f7fbf8;
  background:
    radial-gradient(circle at 88% -25%, rgba(216,243,106,.18), transparent 18rem),
    linear-gradient(135deg, #173d31, #235b45);
  box-shadow: var(--shadow);
}
.management-hero h2 { margin: 7px 0 9px; font-family: Georgia, "Songti SC", serif; font-size: clamp(25px, 3vw, 36px); font-weight: 600; letter-spacing: -.035em; }
.management-hero p:not(.detail-kicker) { max-width: 660px; margin: 0; color: #a9beb3; font-size: 11px; line-height: 1.7; }
.primary-action, .secondary-action, .quiet-button, .table-action {
  border-radius: 10px;
  cursor: pointer;
  font-weight: 750;
}
.primary-action { min-height: 42px; padding: 0 16px; border: 0; color: var(--green-deep); background: var(--lime); font-size: 11px; box-shadow: 0 8px 20px rgba(10,35,26,.13); }
.primary-action:hover { background: #e2f88a; }
.primary-action:disabled, .secondary-action:disabled, .quiet-button:disabled, .table-action:disabled { cursor: wait; opacity: .55; }
.secondary-action { min-height: 42px; padding: 0 16px; border: 1px solid var(--line); color: var(--muted); background: white; font-size: 11px; }
.quiet-button { min-height: 34px; padding: 0 12px; border: 1px solid var(--line); color: var(--green); background: white; font-size: 9px; }
.quiet-button:hover, .secondary-action:hover { border-color: #cbd4ce; background: #fbfcfa; }
.integrity-badge { flex: 0 0 auto; padding: 8px 11px; border: 1px solid rgba(255,255,255,.17); border-radius: 99px; color: #c3d3ca; background: rgba(255,255,255,.06); font-size: 9px; font-weight: 750; }
.integrity-badge.is-verified { border-color: rgba(216,243,106,.4); color: var(--lime); }
.integrity-badge.is-warning { color: #ffd28a; }
.management-card { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.9); box-shadow: 0 10px 34px rgba(28,49,40,.045); }
.management-card-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 68px; padding: 15px 22px; border-bottom: 1px solid var(--line); }
.management-card-head strong, .management-card-head small { display: block; }
.management-card-head strong { font-family: Georgia, "Songti SC", serif; font-size: 17px; }
.management-card-head small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.management-table-wrap { overflow-x: auto; }
.management-table { min-width: 760px; }
.management-table tbody tr { cursor: default; }
.management-table td { height: 66px; }
.management-table code { color: #4f6358; font: 9px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.person-cell { display: flex; align-items: center; gap: 9px; }
.person-cell > span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: var(--green-deep); background: var(--lime-soft); font-weight: 850; }
.person-cell strong { font-size: 10px; }
.account-status, .audit-result { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 99px; font-size: 8px; font-weight: 800; white-space: nowrap; }
.account-status::before, .audit-result::before { content: ""; width: 5px; height: 5px; border-radius: 50%; }
.account-status.is-enabled, .audit-result.is-success { color: #426b50; background: #eaf5e8; }
.account-status.is-enabled::before, .audit-result.is-success::before { background: #6da365; }
.account-status.is-pending { color: #775820; background: #fff1d7; }
.account-status.is-pending::before { background: #d99b3f; }
.account-status.is-disabled, .audit-result.is-denied { color: #8a514c; background: #faecea; }
.account-status.is-disabled::before, .audit-result.is-denied::before { background: var(--red); }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.table-action { min-height: 30px; padding: 0 9px; border: 1px solid var(--line); color: var(--green); background: white; font-size: 8px; }
.table-action.is-danger { color: var(--red); }
.table-action.is-success { color: #3d754f; }
.protected-label { color: #a0a7a2; font-size: 8px; }
.management-empty { padding: 50px 20px; color: var(--muted); text-align: center; font-size: 10px; }
.load-more-wrap { padding: 14px; border-top: 1px solid var(--line); text-align: center; }
.audit-table time, .audit-table td > strong, .audit-table td > small { display: block; }
.audit-table td > small { margin-top: 4px; color: #929a95; font-size: 8px; }
.audit-action { color: var(--green-deep); font-weight: 750; }

.dialog-layer { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; overflow-y: auto; padding: 20px; background: rgba(15,31,24,.72); backdrop-filter: blur(10px); }
.dialog-card { position: relative; width: min(470px, 100%); padding: 31px; border: 1px solid rgba(255,255,255,.28); border-radius: 20px; background: white; box-shadow: 0 30px 90px rgba(6,20,14,.28); }
.dialog-card-compact { width: min(440px, 100%); }
.dialog-card h2 { margin: 0 0 10px; font-family: Georgia, "Songti SC", serif; font-size: 25px; letter-spacing: -.02em; }
.dialog-card > p:not(.detail-kicker) { margin: 0 0 22px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.dialog-card label { display: block; margin-top: 12px; }
.dialog-card label > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 9px; font-weight: 750; }
.dialog-card label > small { display: block; margin-top: 5px; color: #949b97; font-size: 8px; }
.dialog-card .password-form-field > label { margin-top: 0; }
.dialog-card input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; outline: 0; }
.dialog-card input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(35,91,69,.1); }
.dialog-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 19px; border-radius: 13px; color: var(--green-deep); background: var(--lime); font-size: 20px; font-weight: 900; }
.dialog-icon.is-success { color: white; background: var(--green); }
.dialog-close { position: absolute; top: 17px; right: 17px; width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: white; cursor: pointer; font-size: 18px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 19px; }
.form-error { display: block; min-height: 15px; margin-top: 8px; color: var(--red); font-size: 9px; }
.credential-box { margin: 18px 0 0; border: 1px solid #dfe5df; border-radius: 13px; background: #f8faf7; }
.credential-box > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; min-height: 53px; padding: 9px 13px; }
.credential-box > div + div { border-top: 1px solid #e3e8e3; }
.credential-box dt { color: var(--muted); font-size: 9px; }
.credential-box dd { overflow-wrap: anywhere; margin: 0; color: var(--green-deep); font: 700 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 78px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .brand { justify-content: center; padding-inline: 0; }
  .brand > span:last-child, .nav-item > span:nth-child(2), .nav-count, .sync-card, .sidebar-foot > div:last-child { display: none; }
  .nav-item { display: grid; grid-template-columns: 1fr; place-items: center; padding: 0; }
  .sidebar-foot { justify-content: center; padding-inline: 0; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-panel { align-items: start; flex-direction: column; }
  .workspace-head { align-items: stretch; flex-direction: column; }
  .filters { width: 100%; }
  .search-box { width: 100%; }
  .management-hero { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; flex-direction: row; align-items: center; gap: 10px; padding: 11px 14px; }
  .brand { margin-right: auto; padding: 0; }
  .brand > span:last-child { display: block; }
  .brand small { display: none; }
  .nav-list { display: flex; }
  .nav-item { width: 42px; min-height: 40px; }
  .sidebar-foot { display: none; }
  .main { padding: 20px 14px 38px; }
  .topbar { align-items: end; }
  .date-chip { display: none; }
  .current-user-chip { min-width: 0; padding-inline: 9px; }
  .current-user-chip small { display: none; }
  .logout-button, .password-button { min-height: 36px; padding-inline: 10px; }
  .sync-button { min-height: 36px; padding-inline: 11px; }
  .hero-panel { min-height: 0; padding: 25px 22px; }
  .hero-flow { width: 100%; overflow-x: auto; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 112px; padding: 16px; }
  .workspace-head { padding-inline: 16px; }
  .filters { flex-direction: column; }
  .search-box, .filters select { width: 100%; min-width: 0; }
  .status-tabs { overflow-x: auto; padding-inline: 16px; }
  th:first-child, td:first-child { padding-left: 16px; }
  .drawer { padding-inline: 22px; }
  .management-hero { min-height: 0; padding: 24px 22px; }
  .management-hero .primary-action { width: 100%; }
  .dialog-card { padding: 27px 22px; }
  .dialog-actions { align-items: stretch; flex-direction: column-reverse; }
  .dialog-actions > button { width: 100%; }
  .credential-box > div { grid-template-columns: 90px minmax(0, 1fr); }
}

@media (max-width: 600px) {
  .sidebar { overflow-x: auto; }
  .nav-list { flex: 0 0 auto; }
  .topbar { gap: 12px; }
  .topbar-actions { gap: 6px; }
  .current-user-chip { display: none; }
  .password-button { font-size: 0; }
  .password-button::after { content: "改密"; font-size: 10px; }
  .management-card { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .management-card-head { border: 1px solid var(--line); border-radius: 14px; background: white; }
  .management-table-wrap { overflow: visible; }
  .management-table { min-width: 0; }
  .management-table thead { display: none; }
  .management-table, .management-table tbody, .management-table tr, .management-table td { display: block; width: 100%; }
  .management-table tr { margin-top: 10px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.9); }
  .management-table td { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: auto; min-height: 40px; padding: 8px 0; border: 0; text-align: right; }
  .management-table td::before { content: attr(data-label); flex: 0 0 auto; color: #8a928d; font-size: 8px; font-weight: 750; }
  .management-table td:first-child, .management-table td:last-child { padding-inline: 0; }
  .person-cell { justify-content: flex-end; }
  .row-actions { flex-wrap: wrap; }
  .audit-table td > small { display: inline; margin-left: 5px; }
  .load-more-wrap { border: 0; }
}

@media (max-width: 440px) {
  .brand > span:last-child { display: none; }
  .topbar h1 { font-size: 24px; }
}

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