* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, "Microsoft YaHei", sans-serif; color: #18212f; background: #f5f7fb; }
a { color: #1664d9; text-decoration: none; }
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #111827; color: #fff; padding: 22px 16px; }
.brand { font-size: 22px; font-weight: 700; margin-bottom: 24px; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar a { color: #cbd5e1; padding: 10px 12px; border-radius: 6px; }
.sidebar a.active, .sidebar a:hover { background: #263449; color: #fff; }
.main { flex: 1; padding: 26px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.topbar h1 { margin: 0 0 4px; font-size: 26px; }
.topbar p { margin: 0; color: #64748b; }
.button { border: 1px solid #cbd5e1; border-radius: 6px; padding: 9px 14px; background: #fff; color: #18212f; cursor: pointer; display: inline-block; }
.button.primary { background: #1664d9; border-color: #1664d9; color: #fff; }
.button.ghost { background: transparent; }
.button.full { width: 100%; }
.actions { margin-bottom: 14px; }
.panel { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 18px; margin-bottom: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 16px; }
.stat span { display: block; color: #64748b; margin-bottom: 8px; }
.stat strong { font-size: 28px; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid #e2e8f0; padding: 11px 10px; text-align: left; vertical-align: top; }
th { color: #475569; font-size: 13px; background: #f8fafc; }
.row-actions { min-width: 132px; white-space: nowrap; display: flex; align-items: center; gap: 10px; }
.row-actions a, .row-actions form { display: inline-flex; align-items: center; margin: 0; }
.link-button { border: 0; background: none; padding: 0; color: #1664d9; cursor: pointer; font: inherit; }
.link-button:hover { text-decoration: underline; }
.empty { text-align: center; color: #64748b; padding: 24px; }
.form { max-width: 860px; display: grid; gap: 16px; }
.form label { display: grid; gap: 7px; }
.form label span { font-weight: 600; }
input, textarea, select { width: 100%; border: 1px solid #cbd5e1; border-radius: 6px; padding: 10px; font: inherit; background: #fff; }
select[multiple] { min-height: 180px; }
small { color: #64748b; }
.form-actions { display: flex; gap: 10px; }
.filter-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; }
.filter-form label { display: grid; gap: 7px; flex: 0 0 210px; }
.filter-form label span { font-weight: 600; }
.filter-form input { width: 100%; }
.filter-wide { flex-basis: 300px; }
.filter-actions { display: flex; gap: 10px; align-items: center; flex: 0 0 auto; }
.table-meta { margin-bottom: 12px; color: #64748b; }
.pagination { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.pagination a, .pagination span, .pagination strong { min-width: 34px; height: 34px; border: 1px solid #cbd5e1; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; padding: 0 10px; background: #fff; }
.pagination strong { background: #1664d9; border-color: #1664d9; color: #fff; }
.pagination span { color: #94a3b8; }
.flash { border-radius: 6px; padding: 11px 13px; margin-bottom: 14px; background: #dcfce7; color: #166534; }
.flash.error { background: #fee2e2; color: #991b1b; }
.login-page { display: grid; min-height: 100vh; place-items: center; background: #111827; }
.login-card { width: min(380px, calc(100vw - 32px)); background: #fff; border-radius: 8px; padding: 26px; display: grid; gap: 16px; }
.login-card h1 { margin: 0; }
.login-card p { margin: -8px 0 0; color: #64748b; }
.text-cell { max-width: 560px; }
@media (max-width: 760px) {
    .shell { display: block; }
    .sidebar { width: auto; }
    .main { padding: 16px; }
    .topbar { display: block; }
    .filter-form label, .filter-wide, .filter-actions { flex-basis: 100%; }
}
