:root {
  --bg: #edf1f5;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --line: #d8e0ea;
  --line-strong: #bdcad8;
  --text: #152033;
  --muted: #5e6d82;
  --soft: #8795a8;
  --nav: #101c2b;
  --nav-2: #182a3e;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --blue: #2563eb;
  --red: #b42318;
  --amber: #b45309;
  --green-soft: #e6f4f1;
  --blue-soft: #e9f0ff;
  --amber-soft: #fff3d8;
  --red-soft: #fde8e4;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.07), 0 1px 0 rgba(255, 255, 255, 0.62) inset;
  --shadow: 0 18px 45px rgba(16, 24, 40, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(237, 241, 245, 0.92) 390px),
    var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

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

button {
  user-select: none;
}

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

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  padding: 22px 16px;
  color: #f8fafc;
  background:
    linear-gradient(180deg, rgba(65, 91, 119, 0.33), transparent 280px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06), transparent 42%),
    var(--nav);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 10px 0 32px rgba(16, 24, 40, 0.08);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 6px 6px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  overflow: hidden;
  border-radius: 11px;
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.25);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
}

.brand h1 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
  font-weight: 800;
}

.brand p {
  margin: 5px 0 0;
  color: #aebdcc;
  font-size: 12px;
}

.field-label {
  display: block;
  margin: 18px 0 8px;
  color: #c8d3df;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.select,
.input,
.textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: linear-gradient(180deg, #fff, #fbfcfe);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.select:focus,
.input:focus,
.textarea:focus {
  border-color: rgba(15, 118, 110, 0.72);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.textarea {
  min-height: 80px;
  resize: vertical;
}

.nav {
  display: grid;
  gap: 6px;
  margin-top: 18px;
}

.nav-group {
  margin: 14px 0 2px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(218, 230, 242, 0.84);
  text-transform: none;
  user-select: none;
}

.nav-group:first-child {
  margin-top: 4px;
}

.nav-item {
  width: 100%;
  min-height: 40px;
  padding: 10px 12px 10px 14px;
  color: #d8e2ec;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.nav-item:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
  color: #042f2b;
  border-color: rgba(157, 228, 216, 0.72);
  background: linear-gradient(135deg, #b7efe5, #7dd8c7);
  box-shadow: 0 10px 24px rgba(5, 39, 36, 0.24);
}

.workspace {
  min-width: 0;
  padding: 26px 30px 34px;
}

.topbar {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 5px;
  color: #6b7a90;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h2,
h3 {
  margin: 0;
}

.topbar h2 {
  font-size: 29px;
  line-height: 1.2;
  font-weight: 850;
}

.storage-status {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.storage-status.warning {
  color: var(--amber);
}

.security-notice {
  display: grid;
  gap: 4px;
  max-width: 760px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #f0b8af;
  border-left: 4px solid var(--red);
  border-radius: 8px;
  color: #7f1d1d;
  background: #fff1ee;
  box-shadow: var(--shadow-sm);
}

.security-notice strong {
  font-size: 13px;
}

.security-notice span {
  color: #8f1e12;
  font-size: 12px;
  line-height: 1.55;
}

.topbar-actions,
.row-actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}

.period-control {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 5px 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-sm);
}

.period-control span {
  font-size: 12px;
  font-weight: 800;
}

.period-control input {
  width: 132px;
  color: var(--text);
  border: 0;
  background: transparent;
  outline: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 13px;
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: linear-gradient(180deg, #12857c, var(--accent));
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.button:hover {
  background: var(--accent-strong);
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.16);
}

.button:disabled {
  color: var(--soft);
  border-color: var(--line);
  background: #f2f5f8;
  cursor: not-allowed;
}

.button.secondary {
  color: var(--accent);
  background: linear-gradient(180deg, #ffffff, #f2faf8);
}

.button.ghost {
  color: var(--text);
  border-color: var(--line);
  background: linear-gradient(180deg, #fff, #f7f9fb);
}

.button.danger {
  color: var(--red);
  border-color: #f4b7ae;
  background: #fff;
}

.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.view-root {
  display: grid;
  gap: 18px;
}

.hero-panel {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.96), rgba(38, 76, 104, 0.94) 52%, rgba(31, 43, 61, 0.97)),
    #173141;
  box-shadow: var(--shadow);
}

.hero-panel h3 {
  margin-top: 12px;
  font-size: 27px;
  line-height: 1.25;
}

.hero-panel p {
  max-width: 720px;
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.65;
}

.automation-hero p {
  max-width: 880px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  color: #d9fff7;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  font-size: 12px;
  font-weight: 800;
}

.hero-score {
  display: grid;
  min-width: 160px;
  place-items: center;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.hero-score span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
}

.hero-score strong {
  font-size: 34px;
}

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

.panel-header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-header h3 {
  font-size: 18px;
  font-weight: 850;
}

.panel-header p,
.help-text {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.grid {
  display: grid;
  gap: 14px;
}

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

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.metric {
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: linear-gradient(180deg, #fff, #fafcff);
  box-shadow: var(--shadow-sm);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 25px;
  line-height: 1.2;
  font-weight: 850;
}

.metric small {
  display: block;
  margin-top: 7px;
  color: var(--soft);
  font-size: 12px;
}

.metric.green {
  background: linear-gradient(180deg, var(--green-soft), #fff);
}

.metric.blue {
  background: linear-gradient(180deg, var(--blue-soft), #fff);
}

.metric.amber {
  background: linear-gradient(180deg, var(--amber-soft), #fff);
}

.metric.red {
  background: linear-gradient(180deg, var(--red-soft), #fff);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.form-grid .wide {
  grid-column: span 2;
}

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

.form-grid .field-label {
  margin-top: 0;
  color: var(--muted);
}

.form-grid label.wide {
  grid-column: span 2;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

th,
td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #3c4d63;
  background: linear-gradient(180deg, #f8fafc, #eef3f8);
  font-size: 12px;
  font-weight: 850;
}

td {
  font-size: 13px;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #f7fbfc;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 9px;
  border-radius: 999px;
  color: #24404a;
  background: #e8edf1;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(36, 64, 74, 0.06);
}

.tag.green {
  color: #07574f;
  background: #d6f2ec;
}

.tag.blue {
  color: #1d4ed8;
  background: #dce8ff;
}

.tag.amber {
  color: #8a3c05;
  background: #ffe2aa;
}

.tag.red {
  color: #8f1e12;
  background: #ffd7d0;
}

.automation-steps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0 6px;
}

.automation-steps span {
  min-height: 28px;
  padding: 6px 10px;
  color: #315044;
  border: 1px solid #c6e7dc;
  border-radius: 999px;
  background: #eefbf7;
  font-size: 12px;
  font-weight: 800;
}

.automation-table {
  min-width: 1180px;
}

.automation-table td {
  vertical-align: top;
}

.cell-title {
  display: block;
  max-width: 230px;
  font-size: 13px;
  line-height: 1.45;
  white-space: normal;
}

.draft-status {
  display: grid;
  gap: 6px;
  min-width: 86px;
}

.draft-status small,
.draft-source,
.table-field span {
  color: var(--soft);
  font-size: 12px;
  line-height: 1.45;
}

.draft-source,
.draft-detail {
  max-width: 320px;
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.6;
  white-space: normal;
}

.draft-flags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 9px;
}

.mini-flag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f4f7fa;
  color: #4b5e73;
  font-size: 12px;
  font-weight: 800;
}

.mini-flag.green {
  color: #07574f;
  border-color: #bde6dc;
  background: #e8f8f3;
}

.mini-flag.blue {
  color: #1d4ed8;
  border-color: #bfd1ff;
  background: #edf3ff;
}

.mini-flag.amber {
  color: #8a3c05;
  border-color: #f4cf92;
  background: #fff7e8;
}

.mini-flag.red {
  color: #8f1e12;
  border-color: #f0b8af;
  background: #fff0ed;
}

.table-field {
  display: grid;
  gap: 5px;
  min-width: 230px;
}

.table-field + .table-field {
  margin-top: 8px;
}

.table-input,
.table-textarea {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 13px;
}

.table-textarea {
  min-height: 58px;
}

.risk-list {
  display: grid;
  gap: 10px;
}

.risk-item {
  padding: 14px 15px;
  border: 1px solid #f4d19b;
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  background: linear-gradient(180deg, #fffaf0, #fff6e6);
}

.risk-item.high {
  border-color: #f5b8ad;
  border-left-color: var(--red);
  background: linear-gradient(180deg, #fff1ee, var(--red-soft));
}

.risk-item.low {
  border-color: #b7cbff;
  border-left-color: var(--blue);
  background: linear-gradient(180deg, #f4f8ff, var(--blue-soft));
}

.risk-item strong {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
}

.risk-item p,
.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.empty-state {
  padding: 40px 22px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.94)),
    #fff;
}

.empty-state h3 {
  font-size: 17px;
}

.archive-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: linear-gradient(180deg, #fff, #fafcff);
}

.archive-box strong {
  font-size: 14px;
}

.archive-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

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

.wide-panel {
  grid-column: 1 / -1;
  box-shadow: none;
}

.text-link {
  font-weight: 700;
  text-decoration: none;
}

.portal-card {
  display: flex;
  min-height: 190px;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #fbfcfe);
  box-shadow: var(--shadow-sm);
}

.portal-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.portal-card h3 {
  margin-top: 10px;
  font-size: 20px;
}

.portal-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

a {
  color: var(--accent);
}

a.button {
  text-decoration: none;
}

body.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 18% 18%, rgba(125, 216, 199, 0.2), transparent 28%),
    linear-gradient(135deg, #0d1b2a 0%, #13283b 42%, #edf1f5 42.1%, #f7fafc 100%);
}

.login-shell {
  display: grid;
  width: min(1080px, 100%);
  min-height: 640px;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.72fr);
  overflow: hidden;
  border: 1px solid rgba(216, 224, 234, 0.7);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(16, 24, 40, 0.2);
}

.login-visual {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  padding: 42px;
  color: #f8fafc;
  background:
    linear-gradient(145deg, rgba(15, 118, 110, 0.82), rgba(15, 28, 43, 0.94) 58%),
    #101c2b;
}

.login-brandline,
.login-card-header {
  display: flex;
  gap: 14px;
  align-items: center;
}

.login-logo,
.login-card-mark {
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 13px;
  box-shadow: 0 18px 36px rgba(4, 47, 43, 0.28);
}

.login-logo img,
.login-card-mark img {
  display: block;
  width: 100%;
  height: 100%;
}

.login-brandline p,
.login-card-header p {
  margin: 0 0 5px;
  color: rgba(226, 232, 240, 0.78);
  font-size: 12px;
  font-weight: 800;
}

.login-brandline h1,
.login-card-header h2 {
  margin: 0;
  line-height: 1.22;
  font-size: 25px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.login-copy {
  max-width: 650px;
}

.login-badge {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 5px 11px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: #d9fff7;
  background: rgba(255, 255, 255, 0.09);
  font-size: 12px;
  font-weight: 800;
}

.login-copy h2 {
  max-width: 720px;
  margin: 20px 0 12px;
  font-size: 36px;
  line-height: 1.2;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.login-copy p {
  max-width: 620px;
  margin: 0;
  color: rgba(241, 245, 249, 0.78);
  font-size: 15px;
  line-height: 1.8;
}

.login-signal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.login-signal-grid div {
  min-height: 94px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.09);
}

.login-signal-grid strong,
.login-signal-grid span {
  display: block;
}

.login-signal-grid strong {
  font-size: 15px;
}

.login-signal-grid span {
  margin-top: 8px;
  color: rgba(226, 232, 240, 0.74);
  font-size: 12px;
  line-height: 1.55;
}

.login-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 44px;
  background:
    linear-gradient(180deg, rgba(247, 250, 252, 0.96), rgba(255, 255, 255, 1)),
    #fff;
}

.login-card-header {
  margin-bottom: 34px;
}

.login-card-mark {
  width: 52px;
  height: 52px;
  border-radius: 12px;
}

.login-card-header p {
  color: var(--muted);
}

.login-card-header h2 {
  color: var(--text);
  font-size: 24px;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form .field-label {
  margin: 0 0 8px;
  color: #485970;
}

.login-form .input {
  min-height: 48px;
  padding: 12px 13px;
  border-radius: 9px;
  font-size: 15px;
}

.login-submit {
  min-height: 48px;
  margin-top: 2px;
  border-radius: 9px;
  font-size: 16px;
  font-weight: 850;
}

.error-msg {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
  line-height: 1.55;
}

.login-security {
  display: grid;
  gap: 8px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.login-security span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 1180px) {
  .grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .sidebar {
    position: static;
    min-height: auto;
  }

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

  .nav-group {
    grid-column: 1 / -1;
    margin: 10px 0 0;
  }

  .workspace {
    padding: 20px 16px 28px;
  }

  .topbar,
  .hero-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .row-actions {
    width: 100%;
  }

  .row-actions .button,
  .topbar-actions .button,
  .period-control {
    width: 100%;
  }

  .grid.two,
  .grid.three,
  .grid.four,
  .maintenance-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .wide,
  .form-grid .full {
    grid-column: auto;
  }

  .hero-score {
    width: 100%;
  }

  .automation-steps {
    display: grid;
    grid-template-columns: 1fr;
  }

  body.login-page {
    width: 100%;
    overflow-x: hidden;
    padding: 0;
    background: #f4f7fa;
  }

  .login-shell {
    width: 100%;
    min-height: 100vh;
    max-width: 100%;
    grid-template-columns: minmax(0, 1fr);
    overflow-x: hidden;
    border: 0;
    border-radius: 0;
  }

  .login-visual {
    min-width: 0;
    min-height: auto;
    padding: 28px 22px;
    overflow: hidden;
  }

  .login-copy h2 {
    font-size: 24px;
    word-break: break-word;
  }

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

  .login-card {
    order: -1;
    width: 100vw;
    max-width: 100vw;
    min-width: 0;
    padding: 28px 22px 34px;
    overflow: hidden;
  }

  .login-card-header,
  .login-form,
  .login-security {
    width: calc(100vw - 44px);
    max-width: 430px;
  }

  .login-form,
  .login-form label,
  .login-form .input {
    min-width: 0;
    max-width: 100%;
  }

  .login-submit {
    width: 100%;
  }
}

.report-section-header td {
  background: var(--surface-2);
  padding-top: 10px;
  padding-bottom: 6px;
  font-size: 13px;
  letter-spacing: .02em;
}

.report-subtotal td {
  border-top: 1px solid var(--border);
  font-weight: 600;
  color: var(--text-1);
}

.report-total td {
  border-top: 2px solid var(--border);
  font-size: 14px;
}

.report-diff-warn td {
  color: var(--red);
}

.user-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: var(--surface-2);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
}

.company-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-1);
  cursor: pointer;
  padding: 4px 10px;
  background: var(--surface-2);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.checkbox-item input[type=checkbox] { accent-color: var(--accent); }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-box {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}

.tab-bar {
  display: flex;
  gap: 8px;
  padding: 16px 0 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px !important;
}

.tab-bar .button {
  border-radius: 6px 6px 0 0;
  border-bottom: none;
  margin-bottom: -1px;
}

/* ── 打印 / 导出 PDF：只打印报表内容，隐藏导航和按钮 ── */
@media print {
  .sidebar,
  .topbar-actions,
  .no-print,
  .nav,
  .period-control { display: none !important; }
  .app-shell,
  .workspace { display: block !important; margin: 0 !important; padding: 0 !important; }
  .panel { box-shadow: none !important; border: 1px solid #ccc !important; break-inside: avoid; }
  body { background: #fff !important; }
  table { font-size: 11px !important; }
  .grid.four, .grid.two { display: grid !important; }
}
