* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; color: #1f2329; background: #f5f7fa; font-size: 14px; }
h1 { font-size: 22px; margin: 0 0 20px; }
h2, h3 { font-size: 16px; margin: 0 0 12px; }
.muted { color: #8a9099; font-size: 13px; }
code { background: #f0f2f5; padding: 2px 6px; border-radius: 4px; }

.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 360px; background: #fff; padding: 36px; border-radius: 16px; border: 1px solid #e8eaed; }
.login-card h1 { font-size: 20px; }
.login-card label { display: block; margin-top: 18px; }
.login-card input, .filters input, .filters select, .modal-card input, .modal-card select, .modal-card textarea {
  width: 100%; padding: 10px 12px; margin-top: 6px; border: 1px solid #dfe2e6; border-radius: 8px; background: #fff; font-size: 14px; font-family: inherit;
}
.login-card input:focus, .filters input:focus, .modal-card input:focus { outline: none; border-color: #1769e0; }
.error { color: #d0392b; font-size: 13px; margin-top: 12px; min-height: 18px; }

.app { display: flex; min-height: 100vh; }
.sidebar { width: 210px; flex-shrink: 0; background: #fff; border-right: 1px solid #e8eaed; padding: 24px 0; display: flex; flex-direction: column; }
.brand { font-size: 18px; font-weight: 600; padding: 0 24px 24px; }
.brand small { display: block; font-size: 12px; color: #8a9099; font-weight: 400; margin-top: 4px; }
.sidebar nav { display: flex; flex-direction: column; }
.sidebar nav a { padding: 12px 24px; color: #4e545c; text-decoration: none; }
.sidebar nav a:hover { background: #f5f7fa; }
.sidebar nav a.active { background: #e8f1ff; color: #1769e0; border-right: 3px solid #1769e0; }
.logout { margin: auto 24px 0; padding: 10px; border: 1px solid #dfe2e6; background: #fff; border-radius: 8px; cursor: pointer; }
.main { flex: 1; padding: 32px; min-width: 0; }
.view-head { display: flex; align-items: center; justify-content: space-between; }

.btn { padding: 9px 16px; border: 1px solid #dfe2e6; background: #fff; border-radius: 8px; cursor: pointer; font-size: 14px; font-family: inherit; }
.btn:hover { border-color: #1769e0; }
.btn.primary { background: #1769e0; color: #fff; border-color: #1769e0; }
.btn.danger { color: #d0392b; border-color: #f3c8c2; }
.btn.mini { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.stat { background: #fff; border: 1px solid #e8eaed; border-radius: 12px; padding: 24px; }
.stat b { display: block; font-size: 30px; color: #1769e0; }
.stat span { color: #8a9099; font-size: 13px; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; margin-top: 16px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #f0f1f2; font-size: 13px; vertical-align: top; }
th { background: #fafbfc; color: #646a73; font-weight: 500; }
td .ops { display: flex; gap: 6px; }
.tag { padding: 2px 8px; border-radius: 6px; background: #eaf7ee; color: #0f8a4d; font-size: 12px; }
.tag.off { background: #f2f3f5; color: #8a9099; }
.stem-cell { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.filters { display: flex; gap: 10px; margin-top: 16px; align-items: center; }
.filters input, .filters select { width: auto; min-width: 150px; margin: 0; }
.pager { display: flex; gap: 14px; align-items: center; justify-content: flex-end; margin-top: 16px; }

.card { background: #fff; border: 1px solid #e8eaed; border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.table-wrap { max-height: 340px; overflow: auto; }
input[type=file] { display: block; margin: 14px 0; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; z-index: 10; }
.modal-card { width: 560px; max-height: 86vh; overflow: auto; background: #fff; border-radius: 14px; padding: 24px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.close { font-size: 24px; cursor: pointer; color: #8a9099; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal-card label { display: block; margin-top: 12px; }
.modal-card textarea { min-height: 72px; resize: vertical; }
.row2 { display: flex; gap: 12px; }
.row2 > * { flex: 1; }

.toast { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); background: #1f2329; color: #fff; padding: 10px 20px; border-radius: 8px; z-index: 20; }
