*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; background: #f5f7fa; color: #2d3748; }

.navbar { display: flex; align-items: center; background: #1a202c; padding: 0 20px; height: 52px; }
.navbar .brand { color: #fff; font-size: 18px; font-weight: 700; text-decoration: none; margin-right: 32px; }
.nav-links { display: flex; gap: 4px; }
.nav-links a { color: #a0aec0; text-decoration: none; padding: 6px 12px; border-radius: 4px; }
.nav-links a:hover { background: #2d3748; color: #fff; }
.nav-links .logout { margin-left: auto; color: #fc8181; }

.container { max-width: 1200px; margin: 24px auto; padding: 0 16px; }

.card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.card h3 { margin-bottom: 12px; font-size: 15px; color: #4a5568; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.mt1 { margin-top: 8px; }
.mt2 { margin-top: 16px; }

.stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 8px; padding: 16px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.stat-num { font-size: 28px; font-weight: 700; color: #2d3748; }
.stat-label { font-size: 12px; color: #718096; margin-top: 4px; }
.stat-analyzing .stat-num { color: #3182ce; }
.stat-approved .stat-num { color: #38a169; }
.stat-sent .stat-num { color: #805ad5; }
.stat-rejected .stat-num { color: #e53e3e; }

.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.toolbar h2 { font-size: 20px; }
.filters { display: flex; gap: 6px; }

.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.table th { background: #edf2f7; padding: 10px 12px; text-align: left; font-size: 12px; text-transform: uppercase; color: #718096; }
.table td { padding: 10px 12px; border-top: 1px solid #e2e8f0; }
.table tr:hover td { background: #f7fafc; }
.table a { color: #3182ce; text-decoration: none; }
.table a:hover { text-decoration: underline; }
.empty { text-align: center; color: #a0aec0; padding: 32px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.badge-new { background: #bee3f8; color: #2b6cb0; }
.badge-analyzing { background: #fefcbf; color: #744210; }
.badge-approved { background: #c6f6d5; color: #276749; }
.badge-sent { background: #e9d8fd; color: #553c9a; }
.badge-rejected { background: #fed7d7; color: #9b2c2c; }
.badge-low { background: #c6f6d5; color: #276749; }
.badge-medium { background: #fefcbf; color: #744210; }
.badge-high { background: #fed7d7; color: #9b2c2c; }
.badge-pending { background: #e2e8f0; color: #718096; }

.btn { display: inline-block; padding: 6px 14px; border-radius: 5px; font-size: 13px; cursor: pointer; border: 1px solid #e2e8f0; background: #fff; text-decoration: none; color: #2d3748; }
.btn:hover { background: #edf2f7; }
.btn-primary { background: #3182ce; color: #fff; border-color: #3182ce; }
.btn-primary:hover { background: #2b6cb0; }
.btn-danger { background: #e53e3e; color: #fff; border-color: #e53e3e; }
.btn-sm { padding: 3px 8px; font-size: 12px; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: #4a5568; margin-bottom: 4px; }
.field input { width: 100%; padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 5px; font-size: 14px; }
.field-row { display: flex; gap: 8px; align-items: center; }
.field-row input { flex: 1; padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 5px; font-size: 14px; }

.info-table { width: 100%; border-collapse: collapse; }
.info-table th { text-align: left; width: 40%; padding: 6px 8px; color: #718096; font-weight: 600; font-size: 12px; }
.info-table td { padding: 6px 8px; }

.alert { padding: 10px 14px; border-radius: 5px; margin-bottom: 12px; }
.alert-error { background: #fed7d7; color: #9b2c2c; }

.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: #fff; padding: 40px; border-radius: 10px; width: 360px; box-shadow: 0 4px 20px rgba(0,0,0,.1); }
.login-box h1 { font-size: 24px; text-align: center; margin-bottom: 4px; }
.login-box .subtitle { text-align: center; color: #718096; margin-bottom: 24px; }
.login-box .btn-primary { width: 100%; padding: 10px; margin-top: 8px; font-size: 15px; }

.score-bar { padding: 8px 16px; border-radius: 6px; font-weight: 700; font-size: 18px; margin-bottom: 8px; }
.score-low { background: #c6f6d5; color: #276749; }
.score-medium { background: #fefcbf; color: #744210; }
.score-high { background: #fed7d7; color: #9b2c2c; }

.text-success { color: #38a169; }
.text-danger { color: #e53e3e; }
.text-muted { color: #a0aec0; }
.small { font-size: 12px; color: #718096; }

.log-tail { font-family: monospace; font-size: 11px; background: #1a202c; color: #a0aec0; padding: 12px; border-radius: 5px; max-height: 200px; overflow-y: auto; white-space: pre-wrap; margin-top: 8px; }
.letter-text { font-size: 13px; white-space: pre-wrap; background: #f7fafc; padding: 16px; border-radius: 5px; border: 1px solid #e2e8f0; }
.doc-links { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.detail-header h2 { font-size: 22px; }
.row-inactive td { opacity: 0.5; }
.add-form { margin-bottom: 16px; }
