/* BeSafe MES - 简洁样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "Segoe UI", "PingFang SC", sans-serif;
       background: #f5f6fa; color: #222; }
.navbar { background: #2c3e50; color: #fff; padding: 12px 20px;
          display: flex; justify-content: space-between; align-items: center; }
.navbar strong { color: #ecf0f1; margin-right: 20px; }
.navbar a { color: #bdc3c7; margin: 0 8px; text-decoration: none; font-size: 14px; }
.navbar a:hover { color: #fff; }
.nav-right { display: flex; align-items: center; gap: 12px; }
.user-info { color: #95a5a6; font-size: 13px; }
.container { max-width: 1200px; margin: 20px auto; padding: 0 20px; }
h1 { margin-bottom: 16px; color: #2c3e50; }
h2 { margin-top: 24px; margin-bottom: 12px; color: #34495e; }
table { width: 100%; border-collapse: collapse; background: #fff;
        box-shadow: 0 1px 3px rgba(0,0,0,.08); margin-bottom: 20px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #ecf0f1; font-size: 14px; }
th { background: #f8f9fa; color: #7f8c8d; font-weight: 600; }
tr:hover { background: #fafbfc; }

/* Status colors */
.status-open { color: #3498db; }
.status-in_progress { color: #f39c12; font-weight: 600; }
.status-closed { color: #27ae60; }
.status-cancelled { color: #95a5a6; }
.status-pending { color: #7f8c8d; }
.status-active { color: #f39c12; }
.status-done { color: #27ae60; }
.status-skipped { color: #95a5a6; }
.result-ok { color: #27ae60; font-weight: 600; }
.result-rejected { color: #e74c3c; font-weight: 600; }
.result-duplicate { color: #f39c12; }

/* Buttons */
button, .btn-primary { background: #3498db; color: #fff; border: none;
                       padding: 10px 20px; border-radius: 4px; cursor: pointer;
                       font-size: 14px; }
button:hover, .btn-primary:hover { background: #2980b9; }
.btn-primary { display: inline-block; text-decoration: none; margin-bottom: 12px; }

/* Forms */
form label { display: block; margin-bottom: 12px; font-size: 14px; color: #34495e; }
form input, form select, form textarea { display: block; width: 100%;
                                          padding: 8px 10px; margin-top: 4px;
                                          border: 1px solid #bdc3c7;
                                          border-radius: 4px; font-size: 14px; }

/* Login */
.login-box { max-width: 360px; margin: 60px auto; padding: 30px;
             background: #fff; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.login-box h1 { text-align: center; color: #2c3e50; }
.login-box h3 { text-align: center; color: #7f8c8d; margin-bottom: 24px; font-weight: 400; }
.login-box input { margin-bottom: 12px; }
.login-box button { width: 100%; }
.hint { text-align: center; margin-top: 16px; color: #95a5a6; }
.msg { margin-top: 12px; padding: 8px; border-radius: 4px; text-align: center;
       font-size: 13px; min-height: 18px; }
.msg.err { background: #fdecea; color: #c0392b; }
.msg.ok { background: #e8f5e9; color: #2e7d32; }

/* Scan page */
.scan-page h1 { margin-bottom: 20px; }
.scan-controls { display: flex; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.scan-controls label { display: flex; align-items: center; gap: 6px;
                        background: #fff; padding: 8px 12px; border-radius: 4px;
                        box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.scan-controls select, .scan-controls input { width: auto; min-width: 180px;
                                              margin: 0; padding: 6px 8px; }
.scan-input-area { display: flex; gap: 12px; margin-bottom: 20px; }
.scan-input-area input { flex: 1; padding: 16px; font-size: 18px;
                          border: 2px solid #3498db; border-radius: 4px; }
.scan-input-area button { font-size: 18px; padding: 16px 32px; }
.result-card { padding: 20px; border-radius: 4px; margin-bottom: 20px;
               font-size: 16px; min-height: 60px; transition: opacity .5s; }
.result-card.ok { background: #e8f5e9; color: #2e7d32; border-left: 6px solid #27ae60; }
.result-card.err { background: #fdecea; color: #c0392b; border-left: 6px solid #e74c3c; }
.result-card.fade { opacity: 0.5; }

/* Dashboard */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
             gap: 12px; margin-bottom: 24px; }
.kpi-card { background: #fff; padding: 16px; border-radius: 4px;
            box-shadow: 0 1px 3px rgba(0,0,0,.08); text-align: center; }
.kpi-val { font-size: 32px; font-weight: 700; color: #2c3e50; }
.kpi-lbl { font-size: 13px; color: #7f8c8d; margin-top: 4px; }
.kpi-card.warn .kpi-val { color: #e74c3c; }
.trend { display: flex; align-items: flex-end; height: 200px; gap: 8px;
         background: #fff; padding: 16px; border-radius: 4px;
         box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; }
.bar { width: 80%; background: linear-gradient(to top, #3498db, #5dade2);
       border-radius: 2px 2px 0 0; min-height: 4px; }
.bar-lbl { font-size: 11px; color: #7f8c8d; margin-top: 6px; text-align: center; }

/* Phase 2 dashboard additions */
.muted { color: #95a5a6; font-size: 13px; }
.muted td { color: #95a5a6; font-style: italic; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.two-col section { background: #fff; padding: 12px; border-radius: 4px;
                    box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.two-col h2 { margin-top: 0; }
.two-col table { margin-bottom: 0; }

.alerts { margin-bottom: 24px; }
.alert { padding: 12px 16px; border-radius: 4px; margin-bottom: 8px; font-size: 14px;
         border-left: 4px solid; background: #fff; }
.alert-critical { border-color: #e74c3c; background: #fdecea; }
.alert-warn { border-color: #f39c12; background: #fef5e7; }
.alert-info { border-color: #3498db; background: #ebf5fb; }
.alert-empty { padding: 12px 16px; color: #27ae60; background: #e8f5e9;
               border-radius: 4px; font-size: 14px; text-align: center; }

.progress-bar { background: #ecf0f1; height: 16px; border-radius: 3px;
                overflow: hidden; margin-bottom: 4px; }
.progress-fill { background: linear-gradient(to right, #3498db, #2ecc71);
                 height: 100%; transition: width 0.5s; }

.sev-minor { color: #f39c12; font-weight: 600; }
.sev-major { color: #e67e22; font-weight: 600; }
.sev-critical { color: #e74c3c; font-weight: 600; }

.warn { color: #e74c3c; }

/* Phase 2.3 form/filter */
.form-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }
.filter-bar { margin-bottom: 12px; display: flex; gap: 12px; align-items: center; }
.filter-bar label { display: flex; align-items: center; gap: 6px; margin: 0; }
.filter-bar select { width: auto; }
#msg.ok { color: #27ae60; margin-left: 12px; }
#msg.err { color: #e74c3c; margin-left: 12px; }