* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif; font-size: 14px; color: #1f2937; background: #f3f4f6; }
.hidden { display: none !important; }

/* 登录 */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #eef2f7; }
.login-card { width: 380px; background: #fff; padding: 40px; border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,.08); }
.login-logo { font-size: 22px; font-weight: 600; text-align: center; color: #1d4ed8; margin-bottom: 32px; }
.login-subtitle { font-size: 13px; color: #6b7280; text-align: center; margin-bottom: 32px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; color: #374151; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; font-family: inherit;
  background: #fff; color: #1f2937; outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,.12); }
.form-group textarea { min-height: 76px; resize: vertical; }
.error-msg { color: #dc2626; font-size: 13px; min-height: 20px; margin-bottom: 8px; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 16px; border: 1px solid transparent; border-radius: 6px; font-size: 14px; cursor: pointer; font-family: inherit; background: #fff; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-outline { border-color: #d1d5db; color: #374151; }
.btn-outline:hover { background: #f3f4f6; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 布局 */
.topbar { height: 56px; background: #fff; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 10; }
.brand { font-size: 17px; font-weight: 600; color: #1d4ed8; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-info { font-size: 13px; color: #374151; }
.icon-btn { position: relative; background: none; border: none; cursor: pointer; font-size: 13px; color: #374151; padding: 6px 8px; }
.badge { position: absolute; top: -2px; right: -6px; background: #dc2626; color: #fff; font-size: 10px; border-radius: 8px; padding: 1px 5px; }
.layout { display: flex; min-height: calc(100vh - 56px); }
.sidebar { width: 180px; background: #fff; border-right: 1px solid #e5e7eb; padding: 16px 0; flex-shrink: 0; }
.nav-item { display: block; padding: 11px 24px; color: #4b5563; cursor: pointer; font-size: 14px; user-select: none; }
.nav-item:hover { background: #f3f4f6; }
.nav-item.active { background: #eff6ff; color: #1d4ed8; font-weight: 500; border-right: 3px solid #2563eb; }
.content { flex: 1; padding: 24px; overflow-x: auto; }

/* 卡片与看板 */
.page-title { font-size: 18px; font-weight: 600; margin-bottom: 20px; color: #111827; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 20px; }
.stat-card .label { font-size: 13px; color: #6b7280; margin-bottom: 8px; }
.stat-card .value { font-size: 26px; font-weight: 600; color: #111827; }
.stat-card .value.warn { color: #dc2626; }
.card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 20px; margin-bottom: 20px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; color: #111827; }

/* 表格 */
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #e5e7eb; font-size: 13px; }
th { background: #f9fafb; color: #6b7280; font-weight: 500; white-space: nowrap; }
tr:hover td { background: #f9fafb; }
.status-tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; background: #eff6ff; color: #1d4ed8; }
.status-tag.rejected { background: #fef2f2; color: #dc2626; }
.status-tag.shipped { background: #ecfdf5; color: #059669; }
.status-tag.producing { background: #fffbeb; color: #d97706; }

/* 工具栏 */
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.toolbar input, .toolbar select { padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px; }
.toolbar .spacer { flex: 1; }

/* 模态框 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal { background: #fff; border-radius: 10px; width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto; padding: 24px; }
.modal-lg { max-width: 860px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h3 { font-size: 17px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: #6b7280; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* 详情 */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; margin-bottom: 20px; }
.detail-item { font-size: 13px; }
.detail-item .k { color: #6b7280; margin-bottom: 3px; }
.detail-item .v { color: #111827; font-weight: 500; }
.log-list { list-style: none; }
.log-list li { padding: 10px 0; border-bottom: 1px solid #f3f4f6; font-size: 13px; }
.log-list li .time { color: #9ca3af; float: right; }

/* 提示 */
.toast { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 20px; border-radius: 6px; font-size: 13px; z-index: 100; }
.toast.error { background: #dc2626; }
.notice-item { padding: 12px 0; border-bottom: 1px solid #f3f4f6; font-size: 13px; }
.notice-item.unread { font-weight: 500; }
.notice-item .time { color: #9ca3af; font-size: 12px; margin-left: 8px; }
.empty { text-align: center; color: #9ca3af; padding: 40px 0; font-size: 13px; }
