/* ClaudeERP design system — adapted from the Genesis BioERP visual language (navy sidebar, soft cards, 17px body) */
:root {
  --ink: #17243d; --muted: #69768c; --line: #e5e9f0; --soft-line: #edf0f5; --surface: #fff; --canvas: #f4f6f9;
  --navy: #14233d; --navy-2: #1b3153; --blue: #2f6fed; --blue-soft: #edf4ff; --teal: #0f9d8f; --teal-soft: #e9f8f5; --green: #168b64; --green-soft: #eaf7f1;
  --amber: #c78218; --amber-soft: #fff5df; --red: #d34d4a; --red-soft: #fff0ef; --violet: #7255c6; --violet-soft: #f2edff;
  --shadow-sm: 0 1px 2px rgba(17,34,62,.04), 0 3px 12px rgba(17,34,62,.04); --shadow-md: 0 18px 50px rgba(20,35,61,.15);
  --text-body: 17px; --text-compact: 16px; --text-small: 15px; --text-title: 20px; --text-display: 24px; --sidebar-w: 252px;
}
* { box-sizing: border-box; }
html { background: var(--canvas); }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Inter, system-ui, sans-serif; font-size: var(--text-body); line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; font-size: var(--text-compact); color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
[v-cloak] { display: none; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: #c9d1dd; border-radius: 6px; } ::-webkit-scrollbar-track { background: transparent; }

/* ---------- login ---------- */
.login-screen { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 10% -10%, #e4efff 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #dff6f1 0%, transparent 60%), var(--canvas); padding: 20px; }
.login-card { width: min(440px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-md); padding: 34px 36px 28px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-brand .mark { width: 46px; height: 46px; border-radius: 12px; background: linear-gradient(145deg, #42d2b6, #1a8f8b); color: #fff; display: grid; place-items: center; font: 800 24px Georgia, serif; }
.login-brand strong { display: block; font-size: 21px; } .login-brand small { color: var(--muted); font-size: var(--text-small); }
.login-card label { display: block; font-size: var(--text-compact); color: #4a586f; margin: 14px 0 6px; }
.login-card input { width: 100%; height: 46px; border: 1px solid #d7dee8; border-radius: 9px; padding: 0 12px; background: #fafbfd; }
.login-card input:focus { outline: 0; border-color: #8eb0ed; box-shadow: 0 0 0 3px rgba(47,111,237,.1); background: #fff; }
.login-card .button { width: 100%; margin-top: 20px; height: 46px; }
.login-hint { margin-top: 18px; padding: 12px 14px; border-radius: 10px; background: #f6f9ff; border: 1px solid #dbe6f8; font-size: var(--text-small); color: #4b5b76; line-height: 1.6; }
.login-hint b { color: var(--blue); }
.login-error { margin-top: 12px; color: var(--red); font-size: var(--text-small); }
.login-foot { text-align: center; color: #93a0b4; font-size: 14px; margin-top: 16px; }

/* ---------- shell ---------- */
.erp-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: linear-gradient(180deg, #152642 0%, #102039 100%); color: #dbe3ef; display: flex; flex-direction: column; z-index: 40; box-shadow: 3px 0 18px rgba(13,28,51,.08); }
.brand { min-height: 78px; display: flex; align-items: center; gap: 11px; padding: 0 18px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-mark { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 10px; background: linear-gradient(145deg, #42d2b6, #1a8f8b); display: grid; place-items: center; box-shadow: 0 7px 18px rgba(24,177,154,.24); color: #fff; font: 800 20px Georgia, serif; }
.brand strong { display: block; color: #fff; font-size: 18px; } .brand small { display: block; color: #8192ac; font-size: 13px; margin-top: 2px; }
.env-pill { margin: 12px 14px 4px; padding: 8px 10px; border-radius: 8px; color: #c6d4e6; background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.06); font-size: 14px; display: flex; gap: 8px; align-items: center; }
.env-pill i { width: 8px; height: 8px; border-radius: 50%; background: #42d2b6; box-shadow: 0 0 0 3px rgba(66,210,182,.13); }
.sidebar nav { flex: 1; overflow: auto; padding: 2px 10px 16px; scrollbar-width: thin; scrollbar-color: #39506f transparent; }
.nav-group { margin-top: 14px; } .nav-group > p { margin: 0 10px 5px; color: #6f829e; font-size: 12px; letter-spacing: .8px; text-transform: uppercase; }
.nav-group button { appearance: none; width: 100%; border: 0; background: transparent; color: #aebcd0; min-height: 42px; border-radius: 8px; display: flex; align-items: center; gap: 10px; padding: 6px 10px; cursor: pointer; text-align: left; font-size: var(--text-compact); transition: .15s ease; }
.nav-group button:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-group button.active { color: #fff; background: linear-gradient(90deg, rgba(47,111,237,.23), rgba(32,88,165,.19)); box-shadow: inset 2px 0 #53bfb3; }
.nav-icon { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; background: rgba(255,255,255,.055); color: #a8bdd6; font-size: 12px; font-weight: 700; flex: 0 0 auto; }
.nav-group button.active .nav-icon { color: #72e0ca; background: rgba(75,210,184,.12); }
.nav-group button > span:nth-child(2) { flex: 1; } .nav-group button b { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center; background: #e25f5a; color: #fff; font-size: 12px; }
.sidebar-footer { min-height: 70px; padding: 10px 14px; border-top: 1px solid rgba(255,255,255,.07); display: flex; align-items: center; gap: 9px; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #133146; background: #71d8c6; font-weight: 700; flex: 0 0 auto; }
.sidebar-footer > div { min-width: 0; flex: 1; } .sidebar-footer strong { display: block; color: #fff; font-size: 14px; } .sidebar-footer small { display: block; color: #8192ac; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.sidebar-footer button { border: 0; background: rgba(255,255,255,.08); color: #cfd9e8; border-radius: 6px; padding: 4px 8px; font-size: 13px; }

.main-shell { min-height: 100vh; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.topbar { min-height: 66px; position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 8px 20px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.menu-button { display: none; }
.global-search { width: 340px; height: 40px; display: flex; align-items: center; gap: 8px; border: 1px solid #dfe4ec; border-radius: 9px; padding: 0 10px; color: #8a95a6; background: #f8f9fb; position: relative; }
.global-search:focus-within { border-color: #8eb0ed; background: #fff; box-shadow: 0 0 0 3px rgba(47,111,237,.08); }
.global-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); }
.global-search kbd { padding: 2px 6px; border: 1px solid #d9dee7; border-radius: 4px; background: #fff; font-family: inherit; font-size: 12px; color: #9aa4b4; }
.search-drop { position: absolute; left: 0; right: 0; top: 44px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-md); max-height: 420px; overflow: auto; z-index: 50; }
.search-drop button { width: 100%; border: 0; background: #fff; text-align: left; padding: 9px 12px; display: block; border-bottom: 1px solid var(--soft-line); }
.search-drop button:hover, .search-drop button.hl { background: #f3f7ff; } .search-drop button small { display: block; color: var(--muted); font-size: 13px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-button { min-width: 40px; height: 40px; border: 1px solid #e1e6ed; border-radius: 9px; background: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; color: #526178; cursor: pointer; position: relative; font-size: var(--text-small); }
.icon-button:hover { background: #f6f8fb; }
.icon-button b { position: absolute; right: -6px; top: -7px; min-width: 20px; height: 20px; padding: 0 5px; background: #e45754; color: #fff; border: 2px solid #fff; border-radius: 10px; font-size: 12px; display: grid; place-items: center; }
.tabstrip { display: flex; align-items: center; gap: 4px; padding: 6px 12px 0; background: #eef1f5; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.tabstrip .tab { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; background: transparent; color: #5a6a83; font-size: var(--text-small); white-space: nowrap; cursor: pointer; }
.tabstrip .tab.active { background: #fff; color: var(--ink); border-color: var(--line); font-weight: 600; }
.tabstrip .tab i { font-style: normal; color: #9aa6b8; border-radius: 4px; padding: 0 4px; } .tabstrip .tab i:hover { background: #e4e8ef; color: var(--red); }
.content { flex: 1; padding: 18px 22px 40px; max-width: 1800px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h1 { font-size: 23px; letter-spacing: -.2px; } .page-head p { margin: 4px 0 0; color: #7b8798; font-size: var(--text-small); }
.crumbs { color: #8792a4; font-size: 14px; margin-bottom: 4px; } .crumbs span + span::before { content: " › "; }

/* ---------- buttons ---------- */
.button { border: 0; border-radius: 8px; min-height: 40px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; font-weight: 600; font-size: var(--text-compact); transition: .15s ease; white-space: nowrap; }
.button.primary { background: #2367df; color: #fff; box-shadow: 0 5px 12px rgba(35,103,223,.15); } .button.primary:hover { background: #1859c8; }
.button.secondary { color: #245fae; background: #eef4ff; border: 1px solid #c9d9f3; } .button.secondary:hover { background: #e2ecfd; }
.button.ghost { color: #526178; background: #fff; border: 1px solid #dfe4eb; } .button.ghost:hover { background: #f6f8fb; }
.button.danger { background: #fff; color: var(--red); border: 1px solid #f0c7c5; } .button.danger:hover { background: var(--red-soft); }
.button.success { background: var(--green); color: #fff; }
.button.small { min-height: 34px; padding: 0 10px; font-size: var(--text-small); }
.button:disabled { opacity: .55; cursor: not-allowed; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dropdown { position: relative; } .dropdown-menu { position: absolute; right: 0; top: 44px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-md); min-width: 180px; z-index: 40; padding: 6px; }
.dropdown-menu button { width: 100%; border: 0; background: transparent; text-align: left; padding: 9px 12px; border-radius: 7px; font-size: var(--text-small); } .dropdown-menu button:hover { background: #f3f6fb; }

/* ---------- panels / cards ---------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); min-width: 0; overflow: hidden; }
.panel + .panel { margin-top: 14px; }
.panel-head { min-height: 58px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--soft-line); flex-wrap: wrap; }
.panel-head h3 { font-size: 18px; } .panel-head p { margin: 2px 0 0; color: #8792a4; font-size: 14px; }
.panel-body { padding: 14px 16px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi-card { min-height: 112px; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 14px 16px 12px; position: relative; overflow: hidden; box-shadow: var(--shadow-sm); }
.kpi-card > div { display: flex; justify-content: space-between; align-items: center; } .kpi-card > div span { color: #778398; font-size: 15px; }
.kpi-card > div b { font-size: 12px; padding: 3px 7px; border-radius: 8px; background: #eef3fa; color: #60718a; font-weight: 600; }
.kpi-card > strong { display: block; margin-top: 8px; font-size: 24px; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.kpi-card > p { margin: 4px 0 0; font-size: 14px; color: #929baa; }
.kpi-card > i { position: absolute; height: 3px; bottom: 0; left: 0; right: 0; background: var(--blue); }
.kpi-card.teal > i { background: var(--teal); } .kpi-card.amber > i { background: #e3a239; } .kpi-card.violet > i { background: var(--violet); } .kpi-card.red > i { background: var(--red); } .kpi-card.green > i { background: var(--green); }
.welcome-card { min-height: 120px; background: linear-gradient(110deg, #18375c, #1c4c6b 67%, #17655f); border-radius: 14px; padding: 20px 24px; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 20px; position: relative; overflow: hidden; box-shadow: var(--shadow-sm); margin-bottom: 14px; flex-wrap: wrap; }
.welcome-card::after { content: ""; position: absolute; width: 290px; height: 290px; border: 50px solid rgba(100,231,204,.08); border-radius: 50%; right: -90px; top: -130px; }
.welcome-card .eyebrow { color: #89daca; font-size: 13px; margin: 0 0 5px; letter-spacing: .7px; } .welcome-card h2 { font-size: 22px; } .welcome-card p { margin: 6px 0 0; color: #b7c8db; font-size: 15px; }
.quick-strip { display: flex; gap: 8px; z-index: 1; flex-wrap: wrap; }
.quick-strip button { min-width: 96px; min-height: 72px; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.1); border-radius: 10px; color: #e7eff8; display: flex; flex-direction: column; gap: 5px; justify-content: center; align-items: center; cursor: pointer; font-size: 14px; padding: 8px; }
.quick-strip button:hover { background: rgba(255,255,255,.15); } .quick-strip span { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: rgba(75,211,187,.18); color: #89e4d2; font-weight: 700; }
.dash-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; align-items: start; }
.span-7 { grid-column: span 7; } .span-5 { grid-column: span 5; } .span-12 { grid-column: span 12; } .span-6 { grid-column: span 6; } .span-4 { grid-column: span 4; }
.msg-center { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.msg-card { border-radius: 12px; padding: 16px 18px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); cursor: pointer; }
.msg-card.primary { background: linear-gradient(120deg, #2a6be6, #1f5cd0); color: #fff; border: 0; }
.msg-card h4 { font-size: 16px; font-weight: 600; margin-bottom: 8px; } .msg-card .nums { display: flex; gap: 18px; } .msg-card .nums div { text-align: center; } .msg-card .nums strong { display: block; font-size: 28px; line-height: 1.1; } .msg-card .nums span { font-size: 13px; opacity: .8; }
.list-rows button { width: 100%; min-height: 60px; background: #fff; border: 0; border-bottom: 1px solid var(--soft-line); display: flex; align-items: center; gap: 12px; padding: 10px 16px; cursor: pointer; text-align: left; }
.list-rows button:hover { background: #fafbfd; } .list-rows .type { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 auto; background: var(--blue-soft); color: var(--blue); font-weight: 700; font-size: 14px; }
.list-rows strong { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .list-rows small { display: block; color: #9099a9; font-size: 13px; margin-top: 2px; }
.list-rows .grow { min-width: 0; flex: 1; } .list-rows .amt { font-variant-numeric: tabular-nums; font-weight: 600; }
.mini-empty { padding: 26px 16px; text-align: center; color: #929baa; font-size: 15px; }
.shortcut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.shortcut-grid button { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 14px; text-align: left; font-size: var(--text-compact); box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 10px; }
.shortcut-grid button:hover { border-color: #a9c3e9; background: #f7faff; } .shortcut-grid button span { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); font-weight: 700; font-size: 13px; flex: 0 0 auto; }
.section-title { margin: 18px 0 8px; font-size: 16px; color: #5b6a83; font-weight: 600; }

/* ---------- app menu (全部应用) ---------- */
.appmenu-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(12,24,42,.35); }
.appmenu { position: absolute; left: var(--sidebar-w); top: 0; bottom: 0; width: min(980px, calc(100vw - var(--sidebar-w))); background: #fff; box-shadow: 20px 0 50px rgba(17,32,57,.18); display: flex; }
.appmenu .domains { width: 210px; border-right: 1px solid var(--line); background: #f8fafc; padding: 12px 8px; overflow: auto; }
.appmenu .domains button { width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 12px; border-radius: 8px; font-size: var(--text-compact); color: #3d4b63; display: flex; justify-content: space-between; }
.appmenu .domains button.active { background: #e8f0ff; color: var(--blue); font-weight: 600; } .appmenu .domains button small { color: #9aa6b8; font-size: 15px; }
.appmenu .modules { flex: 1; overflow: auto; padding: 16px 20px; }
.appmenu .module { margin-bottom: 18px; } .appmenu .module h4 { font-size: 16px; margin-bottom: 6px; color: var(--navy); border-left: 3px solid var(--teal); padding-left: 8px; }
.appmenu .group { display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: baseline; margin: 4px 0 6px 11px; }
.appmenu .group > span { color: #8a96a8; font-size: 15px; min-width: 110px; }
.appmenu .group a { font-size: 16px; color: #2a3a56; padding: 2px 4px; border-radius: 4px; cursor: pointer; } .appmenu .group a:hover { background: #eef4ff; color: var(--blue); }
.appmenu .group a.auto { color: #4a5a74; }
.appmenu-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; } .appmenu-head input { width: 280px; height: 38px; border: 1px solid #dfe4ec; border-radius: 8px; padding: 0 10px; }

/* ---------- query bar / tables ---------- */
.query-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; padding: 12px 16px; border-bottom: 1px solid var(--soft-line); background: #fbfcfd; }
.query-bar .field { min-width: 150px; max-width: 220px; } .query-bar .field label { font-size: 13px; }
.query-bar .actions { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.section-toolbar { min-height: 54px; padding: 8px 16px; border-bottom: 1px solid var(--soft-line); background: #fff; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.record-count { font-size: 14px; color: #7b8798; }
.view-tabs { display: inline-flex; padding: 3px; border-radius: 9px; border: 1px solid var(--line); background: #fff; }
.view-tabs button { min-height: 34px; border: 0; border-radius: 6px; padding: 0 12px; background: transparent; color: #758196; font-size: var(--text-small); } .view-tabs button.active { background: #edf3fd; color: #2564c3; font-weight: 600; }
.table-wrap { width: 100%; overflow: auto; }
.table-wrap table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 900px; }
.table-wrap th { position: sticky; top: 0; z-index: 2; height: 44px; padding: 0 11px; background: #fafbfd; border-bottom: 1px solid var(--line); color: #5f6c81; font-size: 14px; font-weight: 600; text-align: left; white-space: nowrap; cursor: pointer; user-select: none; }
.table-wrap th.sorted::after { content: " ▲"; font-size: 10px; color: var(--blue); } .table-wrap th.sorted.desc::after { content: " ▼"; }
.table-wrap td { min-height: 46px; padding: 9px 11px; border-bottom: 1px solid var(--soft-line); font-size: var(--text-compact); vertical-align: middle; }
.table-wrap tbody tr:hover td { background: #f8fbff; } .table-wrap tbody tr.selected td { background: #eef4ff; }
.table-wrap tfoot td { background: #fafbfd; font-weight: 600; border-top: 1px solid var(--line); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; } td.nowrap { white-space: nowrap; }
td .code { color: #2a68c8; font-family: Consolas, "Microsoft YaHei UI", monospace; font-size: 15px; font-weight: 600; cursor: pointer; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 2px 10px; border-radius: 14px; font-size: 14px; font-weight: 600; background: #eff2f6; color: #5f6d82; white-space: nowrap; }
.status-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-badge.green { background: var(--green-soft); color: var(--green); } .status-badge.blue { background: var(--blue-soft); color: var(--blue); } .status-badge.red { background: var(--red-soft); color: var(--red); } .status-badge.amber { background: var(--amber-soft); color: var(--amber); } .status-badge.gray { background: #eff2f6; color: #5f6d82; } .status-badge.violet { background: var(--violet-soft); color: var(--violet); }
.pager { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--soft-line); font-size: 14px; color: #7b8798; flex-wrap: wrap; }
.pager button { min-height: 32px; border: 1px solid #dfe4eb; background: #fff; border-radius: 6px; padding: 0 10px; font-size: 14px; } .pager button:disabled { opacity: .4; }
.pager select { min-height: 32px; border: 1px solid #dfe4eb; border-radius: 6px; padding: 0 6px; }
.empty-state { padding: 46px 20px; text-align: center; color: #93a0b4; } .empty-state h4 { font-size: 17px; color: #5b6a83; margin-bottom: 6px; font-weight: 600; }
.checkbox-cell { width: 36px; text-align: center; }
.link-btn { border: 0; background: transparent; color: #2a68c8; cursor: pointer; font-size: 15px; font-weight: 600; padding: 4px 6px; }
.link-btn:hover { text-decoration: underline; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 14px; color: #5f6c81; } .field label b { color: var(--red); margin-left: 2px; }
.field input, .field select, .field textarea { width: 100%; min-height: 42px; border: 1px solid #d7dee8; border-radius: 8px; padding: 8px 11px; background: #fff; color: var(--ink); }
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: #8eb0ed; box-shadow: 0 0 0 3px rgba(47,111,237,.1); }
.field input[readonly], .field input:disabled, .field select:disabled, .field textarea:disabled { background: #f4f6f9; color: #5f6c81; }
.field .hint { font-size: 13px; color: #97a3b5; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 16px; padding: 16px; }
.form-grid .field.span2 { grid-column: span 2; } .form-grid .field.span3 { grid-column: 1 / -1; }
.checkbox-row { display: flex; align-items: center; gap: 8px; min-height: 42px; font-size: var(--text-compact); } .checkbox-row input { width: 18px; height: 18px; }
.ref-picker { position: relative; } .ref-picker input { padding-right: 60px; }
.ref-picker .clear { position: absolute; right: 34px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: #98a3b5; font-size: 16px; }
.ref-picker .arrow { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: #98a3b5; pointer-events: none; }
.ref-drop { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow-md); max-height: 300px; overflow: auto; z-index: 70; }
.ref-drop button { width: 100%; border: 0; background: #fff; text-align: left; padding: 8px 12px; display: flex; gap: 10px; align-items: baseline; border-bottom: 1px solid var(--soft-line); font-size: 15px; }
.ref-drop button:hover, .ref-drop button.hl { background: #f3f7ff; } .ref-drop button small { color: #7b8798; font-family: Consolas, monospace; min-width: 90px; }
.ref-drop .none { padding: 12px; color: #97a3b5; font-size: 14px; }
.lines-grid { width: 100%; overflow: auto; padding: 0 0 8px; }
.lines-grid table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 900px; }
.lines-grid th { background: #fafbfd; border-bottom: 1px solid var(--line); padding: 8px 8px; font-size: 14px; color: #5f6c81; text-align: left; white-space: nowrap; font-weight: 600; }
.lines-grid td { padding: 4px 6px; border-bottom: 1px solid var(--soft-line); vertical-align: middle; }
.lines-grid td input, .lines-grid td select { width: 100%; min-height: 38px; border: 1px solid transparent; border-radius: 6px; padding: 5px 8px; background: transparent; }
.lines-grid td input:hover, .lines-grid td select:hover { border-color: #e1e6ed; background: #fff; }
.lines-grid td input:focus, .lines-grid td select:focus { outline: 0; border-color: #8eb0ed; background: #fff; box-shadow: 0 0 0 3px rgba(47,111,237,.08); }
.lines-grid td.num input { text-align: right; } .lines-grid td.seq { width: 44px; color: #8a96a8; text-align: center; font-size: 14px; }
.lines-grid td.ops { white-space: nowrap; width: 90px; } .lines-grid td.ops button { border: 0; background: transparent; color: #8a96a8; font-size: 16px; padding: 4px; } .lines-grid td.ops button:hover { color: var(--red); }
.lines-grid tfoot td { font-weight: 600; background: #fafbfd; padding: 8px; }
.lines-toolbar { display: flex; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--soft-line); }
.form-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: #fafbfd; position: sticky; bottom: 0; flex-wrap: wrap; }
.doc-status { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--soft-line); background: #fbfcfd; font-size: 14px; color: #5f6c81; }
.doc-status strong { font-size: 18px; color: var(--ink); font-family: Consolas, "Microsoft YaHei UI", monospace; }
.card-tabs { display: flex; gap: 2px; padding: 0 16px; border-bottom: 1px solid var(--line); background: #fff; overflow-x: auto; }
.card-tabs button { border: 0; background: transparent; padding: 12px 14px; font-size: var(--text-compact); color: #6a7890; border-bottom: 2px solid transparent; white-space: nowrap; }
.card-tabs button.active { color: var(--blue); border-color: var(--blue); font-weight: 600; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 16px; padding: 16px; }
.detail-grid .cell label { display: block; font-size: 13px; color: #8792a4; } .detail-grid .cell span { display: block; font-size: var(--text-compact); font-weight: 600; word-break: break-all; }
.timeline { padding: 12px 16px; } .timeline > div { display: grid; grid-template-columns: 170px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--soft-line); font-size: 15px; } .timeline > div span:first-child { color: #8792a4; font-variant-numeric: tabular-nums; }
.link-list { padding: 10px 16px; } .link-list button { display: inline-flex; align-items: center; gap: 8px; margin: 4px 8px 4px 0; border: 1px solid #cfdcf0; background: #f5f9ff; color: #2a5fae; border-radius: 8px; padding: 6px 10px; font-size: 15px; }
.attach-list { padding: 10px 16px; } .attach-list .row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--soft-line); font-size: 15px; } .attach-list .row small { color: #8792a4; }
.comment-box { display: flex; gap: 8px; padding: 10px 16px; } .comment-box input { flex: 1; min-height: 40px; border: 1px solid #d7dee8; border-radius: 8px; padding: 0 10px; }

/* ---------- modal / drawer / toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10,22,40,.47); z-index: 100; display: grid; place-items: center; padding: 20px; backdrop-filter: blur(2px); }
.modal { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: #fff; border-radius: 14px; box-shadow: var(--shadow-md); animation: modal-in .18s ease-out; }
.modal.wide { width: min(900px, 100%); } .modal.xwide { width: min(1240px, 100%); }
@keyframes modal-in { from { transform: translateY(8px); opacity: 0; } }
.modal > header { padding: 16px 18px; display: flex; justify-content: space-between; gap: 15px; align-items: flex-start; border-bottom: 1px solid var(--line); }
.modal h2 { font-size: 19px; } .modal header p { margin: 4px 0 0; color: #7e8a9d; font-size: 14px; }
.modal header > button { width: 32px; height: 32px; border: 0; border-radius: 7px; background: #f1f3f6; color: #6a7890; font-size: 18px; }
.modal .body { padding: 16px 18px; }
.toast-wrap { position: fixed; z-index: 200; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 8px; }
.toast { max-width: 460px; min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 9px; background: #183248; color: #fff; box-shadow: 0 12px 35px rgba(16,34,56,.25); font-size: 15px; animation: toast-in .2s ease-out; }
.toast.error { background: #a8342f; } .toast.success { background: #146d52; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
.loading-screen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #6a7890; }
.spinner { width: 28px; height: 28px; border: 3px solid #d9e2ef; border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }
.inline-spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.muted { color: #8792a4; } .small { font-size: 14px; } .mono { font-family: Consolas, monospace; }
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border: 1px solid #cedcf1; border-radius: 10px; background: linear-gradient(110deg, #f5f9ff, #eef8f7); font-size: 15px; color: #3c4b64; margin-bottom: 12px; }
.callout.warn { background: var(--amber-soft); border-color: #f0dfb4; color: #6f4d0b; }
.callout.ncc { background: #fbfcfe; border-color: #e3e8f0; color: #5b6a83; font-size: 14px; }
.chip { display: inline-block; padding: 3px 8px; border-radius: 6px; background: #eef2f6; color: #5f6d82; font-size: 13px; margin: 2px 4px 2px 0; }
.chip.auto { background: #fff5df; color: #8b641f; }
.trace-graph { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.trace-node { display: inline-flex; flex-direction: column; border: 1px solid #cfdcf0; background: #f7faff; border-radius: 10px; padding: 8px 12px; min-width: 200px; cursor: pointer; } .trace-node.root { border-color: var(--teal); background: var(--teal-soft); } .trace-node small { color: #7b8798; }
.trace-level { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; } .trace-level > i { color: #9aa6b8; font-style: normal; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; padding: 14px 16px; } .stat-row div { border: 1px solid var(--line); border-radius: 10px; padding: 12px; } .stat-row label { font-size: 13px; color: #8792a4; display: block; } .stat-row strong { font-size: 20px; }
.task-params { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 16px; padding: 16px; align-items: end; }
.print-hidden { display: none; }
.notice-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--soft-line); } .notice-row.unread { background: #f7faff; } .notice-row .dot { width: 10px; height: 10px; border-radius: 50%; background: #d3dbe6; margin-top: 8px; flex: 0 0 auto; } .notice-row.unread .dot { background: var(--blue); }
.notice-row strong { display: block; font-size: 16px; } .notice-row p { margin: 2px 0 0; color: #5f6c81; font-size: 15px; } .notice-row small { color: #97a3b5; font-size: 13px; }
.alert-row { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--soft-line); } .alert-row i { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 700; background: var(--amber-soft); color: var(--amber); flex: 0 0 auto; } .alert-row i.error { background: var(--red-soft); color: var(--red); } .alert-row i.info { background: var(--blue-soft); color: var(--blue); }
.alert-row .grow { flex: 1; min-width: 0; } .alert-row strong { display: block; font-size: 16px; } .alert-row small { color: #7b8798; font-size: 14px; }

@media (max-width: 1100px) { .dash-grid > * { grid-column: span 12 !important; } .msg-center { grid-template-columns: repeat(2, 1fr); } .global-search { width: 220px; } }
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; } .sidebar.open { transform: translateX(0); }
  .main-shell { margin-left: 0; } .menu-button { display: inline-flex; } .appmenu { left: 0; width: 100vw; } .appmenu .domains { width: 130px; }
  .content { padding: 12px; } .global-search { width: 160px; } .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .field.span2 { grid-column: span 2; }
}
@media (max-width: 620px) { .form-grid, .detail-grid, .task-params { grid-template-columns: 1fr; } .msg-center { grid-template-columns: 1fr; } .global-search { display: none; } .topbar { padding: 8px 10px; } }
@media print { .sidebar, .topbar, .tabstrip, .toolbar, .form-footer, .pager, .query-bar { display: none !important; } .main-shell { margin: 0; } .content { padding: 0; } .panel { box-shadow: none; border: 0; } }
