:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --line: #d9e1ec;
  --text: #182230;
  --muted: #667085;
  --brand: #176b87;
  --brand-dark: #0f4f63;
  --accent: #c36b2c;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  font: inherit;
}

button {
  border: 0;
  background: var(--brand);
  color: white;
  cursor: pointer;
  border-radius: 6px;
  padding: 10px 16px;
}

button:hover {
  background: var(--brand-dark);
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(920px, 100%);
  min-height: 420px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 48px;
  box-shadow: 0 18px 60px rgba(16, 24, 40, 0.08);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
}

.muted {
  color: var(--muted);
}

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

label {
  display: grid;
  gap: 8px;
  color: #344054;
  font-size: 14px;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
}

.error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 14px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
}

.sidebar {
  background: #102a3a;
  color: white;
  padding: 20px 14px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 10px 24px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 6px;
  background: var(--accent);
  font-weight: 800;
}

.brand small {
  display: block;
  margin-top: 4px;
  color: #a9bdc9;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button {
  width: 100%;
  text-align: left;
  background: transparent;
  color: #d8e4ea;
  padding: 11px 12px;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.workspace {
  padding: 24px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.userbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.userbar span {
  color: var(--muted);
}

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

.status-grid article,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.status-grid article {
  padding: 16px;
}

.status-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.content-layout {
  display: grid;
  gap: 18px;
}

.panel {
  padding: 18px;
  overflow: hidden;
}

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

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

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

.module-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfe;
}

.module-card strong {
  display: block;
  margin-bottom: 8px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.master-toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

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

.tabs button {
  background: #eef4f7;
  color: var(--brand-dark);
}

.tabs button.active {
  background: var(--brand);
  color: #fff;
}

.toolbar-actions {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto auto auto;
  align-items: center;
  gap: 10px;
}

.inline-check {
  display: flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.inline-check input {
  width: auto;
}

.data-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.table-wrap {
  min-width: 0;
  overflow: auto;
}

.edit-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfe;
  align-self: start;
}

.compact {
  margin-bottom: 12px;
}

.compact h2 {
  font-size: 18px;
}

.field-grid {
  display: grid;
  gap: 10px;
  max-height: 560px;
  overflow: auto;
  padding-right: 4px;
}

.form-actions,
.row-actions,
.pager {
  display: flex;
  align-items: center;
  gap: 8px;
}

.row-actions button,
.pager button,
.form-actions button,
.toolbar-actions button {
  padding: 8px 11px;
}

.row-actions button.secondary,
.form-actions button#resetFormBtn {
  background: #eef4f7;
  color: var(--brand-dark);
}

.pager {
  justify-content: flex-end;
  padding-top: 12px;
}

.state-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  background: #e7f6ec;
  color: #067647;
}

.state-pill.off {
  background: #f2f4f7;
  color: #667085;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f8fafc;
  color: #344054;
  font-weight: 700;
}

@media (max-width: 900px) {
  .login-panel,
  .app-shell,
  .status-grid,
  .module-grid,
  .data-layout,
  .toolbar-actions {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}
