/* ==========================================================================
   茱萸 ZhuYu Design System — 业务子模块样式 (Modules)
   Style: Linear / Notion Inspired Clean Flat & Border-driven
   Modules: Dashboard, Scripture, Medicine, Warehouse, Logs, User Management
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 概览与看板 (Dashboard Module)
   -------------------------------------------------------------------------- */
.dashboard-banner {
  background: #192026;
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.dashboard-banner h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: #f3d887;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.dashboard-banner p {
  font-size: 14px;
  color: #a4b0ba;
}

.dashboard-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}

/* 宿舍管理状态卡片内 4 宫格微指标 */
.dashboard-dorm-stats-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.dorm-mini-stat-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.dorm-mini-stat-item:hover {
  background: #ffffff;
  border-color: var(--primary-border);
  box-shadow: 0 2px 8px rgba(44, 37, 29, 0.05);
  transform: translateY(-1px);
}

.mini-stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.mini-stat-header .mini-stat-label {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mini-stat-header .mini-stat-label i {
  font-size: 12px;
  color: var(--text-tertiary);
}

.mini-stat-val {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.mini-stat-val.val-free {
  color: var(--status-success);
}

.mini-stat-val.val-permanent {
  color: var(--primary-text);
}

.mini-stat-val.val-overdue {
  color: var(--status-danger);
}

.dorm-mini-stat-item.is-warning {
  border-color: var(--status-danger-border);
  background: var(--status-danger-bg);
}
.dorm-mini-stat-item.is-warning:hover {
  border-color: var(--status-danger);
}

/* --------------------------------------------------------------------------
   2. 操作审计日志 (Operation Logs Module)
   -------------------------------------------------------------------------- */
.log-filter-bar {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  align-items: center;
  padding: 14px 18px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
}

.log-table-container {
  overflow-x: auto;
}

/* HTTP 请求方法胶囊 */
.method-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  min-width: 44px;
  font-family: var(--font-mono);
}
.method-badge.GET {
  background: var(--status-info-bg);
  color: var(--status-info);
  border: 1px solid var(--status-info-border);
}
.method-badge.POST {
  background: var(--status-success-bg);
  color: var(--status-success);
  border: 1px solid var(--status-success-border);
}
.method-badge.PUT {
  background: var(--status-warning-bg);
  color: var(--status-warning);
  border: 1px solid var(--status-warning-border);
}
.method-badge.DELETE {
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border: 1px solid var(--status-danger-border);
}

/* 状态码徽标 */
.status-code-badge {
  display: inline-flex;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
}
.status-code-badge.s2xx {
  background: var(--status-success-bg);
  color: var(--status-success);
  border: 1px solid var(--status-success-border);
}
.status-code-badge.s4xx, .status-code-badge.s5xx {
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border: 1px solid var(--status-danger-border);
}

/* 模块分类徽标 */
.log-module-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   3. 药品与健康物资 (Medicine Module)
   -------------------------------------------------------------------------- */
.medicine-drawer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.drawer-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: border-color var(--transition-fast);
}
.drawer-card:hover {
  border-color: var(--border-strong);
}

.drawer-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--primary-subtle);
  color: var(--primary-text);
  border: 1px solid var(--primary-border);
}

/* 对外药品检索页 Hero 区域 */
.public-medicine-hero {
  text-align: center;
  padding: 32px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-5);
}
.public-medicine-hero h1 {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.public-medicine-search-bar {
  max-width: 540px;
  margin: 18px auto 0;
  display: flex;
  gap: var(--space-2);
}

/* --------------------------------------------------------------------------
   4. 经书与典籍管理 (Scripture Module)
   -------------------------------------------------------------------------- */
.scripture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.scripture-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: border-color var(--transition-fast);
}
.scripture-card:hover {
  border-color: var(--border-strong);
}

/* --------------------------------------------------------------------------
   5. 仓库与流转台账 (Warehouse Module)
   -------------------------------------------------------------------------- */
.warehouse-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.stock-threshold-warning {
  color: var(--status-warning);
  font-weight: 600;
}
.stock-threshold-danger {
  color: var(--status-danger);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   6. 用户与权限管理 (User Management)
   -------------------------------------------------------------------------- */
.user-management-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-4);
}

.user-card-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.user-card-item:hover {
  border-color: var(--border-strong);
}

.permission-tags-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.permission-tag {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.permission-tag i {
  color: var(--primary);
  font-size: 11px;
}

/* 用户与角色管理选项卡头部 */
.um-tab-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-surface);
}

.um-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 18px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition-fast);
}

.um-tab-btn:hover {
  color: var(--text-primary);
}

.um-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
