:root {
  --sidebar-w: 220px;
  --topbar-h: 56px;
  --bs-body-bg: #f8f9fa;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ===== 应用外壳 ===== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: var(--sidebar-w);
  background: #ffffff;
  border-right: 1px solid #dee2e6;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 100;
}

.app-brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 0 1rem;
  font-weight: 600;
  font-size: 1rem;
  border-bottom: 1px solid #dee2e6;
  background: #f8f9fa;
}
.app-brand i {
  color: #0d6efd;
  font-size: 1.25rem;
}

.app-menu {
  padding: .5rem 0;
}
.app-menu-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem 1rem;
  color: #212529;
  text-decoration: none;
  font-size: .9rem;
  border-left: 3px solid transparent;
}
.app-menu-item i {
  width: 18px;
  text-align: center;
  color: #6c757d;
}
.app-menu-item:hover {
  background: #f1f3f5;
}
.app-menu-item.active {
  background: #e7f1ff;
  color: #0d6efd;
  border-left-color: #0d6efd;
  font-weight: 500;
}
.app-menu-item.active i {
  color: #0d6efd;
}
.app-menu-item.disabled {
  cursor: not-allowed;
  opacity: .55;
}
.app-menu-item.disabled:hover {
  background: transparent;
}

.app-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
}

.app-topbar {
  height: var(--topbar-h);
  background: #ffffff;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 50;
}
.app-topbar-title {
  font-weight: 600;
  font-size: 1rem;
}
.app-topbar-user {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .9rem;
}

.app-content {
  padding: 1.5rem;
}

/* ===== 卡片 / 表格 ===== */
.card {
  border-radius: .5rem;
}

.stat-card .card-body { padding: 1rem 1.25rem; }
.stat-card-label {
  color: #6c757d;
  font-size: .8rem;
  margin-bottom: .25rem;
}
.stat-card-value {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.2;
}
.stat-card-icon {
  font-size: 2.2rem;
  opacity: .5;
}

.table thead th {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #6c757d;
  font-weight: 600;
}

/* ===== 审计等级徽章 ===== */
.audit-level-badge {
  display: inline-block;
  min-width: 1.8rem;
  padding: .3rem .6rem;
  font-weight: 700;
  font-size: .9rem;
  color: #fff !important;
}

/* ===== 登录页 ===== */
.login-body {
  background: linear-gradient(135deg, #e7f1ff 0%, #f8f9fa 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-wrap {
  width: 100%;
  max-width: 420px;
  padding: 0 1rem;
}
.login-card {
  border: none;
  border-radius: .75rem;
}

/* ===== 表单辅助 ===== */
.form-label {
  font-size: .85rem;
  font-weight: 500;
  color: #495057;
  margin-bottom: .3rem;
}
.form-text {
  font-size: .8rem;
  color: #6c757d;
}
.required-mark {
  color: #dc3545;
  margin-left: .15rem;
}

form.is-submitting {
  cursor: progress;
}
form.is-submitting .form-control,
form.is-submitting .form-select,
form.is-submitting .form-check-input {
  pointer-events: none;
}
button.is-loading {
  pointer-events: none;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .app-sidebar {
    width: 100%;
    position: relative;
    height: auto;
  }
  .app-main { margin-left: 0; }
}
