* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", Arial, sans-serif; background: #f4f6f9; color: #1c2733; font-size: 14px; }
.hidden { display: none !important; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; padding: 7px 9px; border: 1px solid #c9d3dd; border-radius: 6px; background: #fff; width: 100%; }
textarea { resize: vertical; }
label { display: block; font-size: 13px; color: #44536a; margin: 8px 0; }
label input, label select, label textarea { margin-top: 4px; }

.btn { border: 1px solid #c9d3dd; background: #fff; color: #1c2733; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.btn:hover { background: #eef3fa; }
.btn.primary { background: #0d47a1; border-color: #0d47a1; color: #fff; }
.btn.primary:hover { background: #1565c0; }
.btn.danger { color: #c62828; border-color: #e0a3a3; }
.btn.small { padding: 3px 9px; font-size: 12px; }
.btn.big { width: 100%; padding: 10px; font-size: 15px; margin-top: 10px; }
.btn:disabled { opacity: .5; cursor: default; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { background: #fff; padding: 28px; border-radius: 12px; box-shadow: 0 2px 14px rgba(0,0,0,.10); width: 340px; max-width: 100%; }
.login-card h1 { font-size: 20px; margin: 0 0 4px; color: #0d47a1; }
.login-card .sub { color: #68788d; margin: 0 0 12px; font-size: 13px; }
.err { color: #c62828; min-height: 18px; font-size: 13px; }

.topbar { background: #0d47a1; color: #fff; display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; position: sticky; top: 0; z-index: 20; }
.brand { font-size: 17px; font-weight: 700; }
.brand-sub { font-size: 12px; font-weight: 400; opacity: .8; margin-left: 6px; }
.userbox { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.userbox .btn { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.35); }

.tabs { display: flex; gap: 4px; background: #fff; border-bottom: 1px solid #dde4ec; padding: 6px 12px 0; position: sticky; top: 45px; z-index: 19; overflow-x: auto; }
.tab { border: 0; background: none; padding: 9px 14px; font-size: 15px; cursor: pointer; color: #44536a; border-bottom: 3px solid transparent; white-space: nowrap; }
.tab.active { color: #0d47a1; font-weight: 700; border-bottom-color: #0d47a1; }
.badge { background: #c62828; color: #fff; border-radius: 10px; padding: 0 7px; font-size: 12px; margin-left: 2px; }

main { padding: 14px 16px 40px; max-width: 1280px; margin: 0 auto; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input, .toolbar select { width: auto; }
.toolbar .grow { flex: 1; min-width: 140px; }
h2.sec { font-size: 16px; margin: 18px 0 8px; }
.muted { color: #68788d; font-size: 12.5px; }
.empty { background: #fff; border: 1px dashed #c9d3dd; border-radius: 10px; padding: 26px; text-align: center; color: #68788d; }

.card { background: #fff; border: 1px solid #dde4ec; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.card.clickable { cursor: pointer; }
.card.clickable:hover { border-color: #0d47a1; }
.card .row { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card .title { font-weight: 700; font-size: 15px; }
.tag { display: inline-block; background: #eef3fa; color: #0d47a1; border-radius: 4px; padding: 1px 7px; font-size: 12px; margin-right: 5px; }
.tag.gray { background: #eceff3; color: #55606e; }
.tag.green { background: #e6f4ea; color: #1e7d32; }
.tag.orange { background: #fff3e0; color: #e65100; }
.tag.red { background: #fdecea; color: #c62828; }
.overdue { border-left: 5px solid #c62828 !important; }
.overdue .duedate { color: #c62828; font-weight: 700; }
.gradeA { border: 2px solid #fb8c00 !important; }
.grade-badge { background: #fb8c00; color: #fff; border-radius: 4px; padding: 1px 7px; font-size: 12px; font-weight: 700; }

.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; align-items: start; }
.board-col { background: #eef1f5; border-radius: 10px; padding: 10px; }
.board-col h3 { margin: 2px 0 10px; font-size: 14px; display: flex; justify-content: space-between; }
.board-col .card { margin-bottom: 8px; padding: 9px 10px; }
.board-col select { margin-top: 6px; padding: 4px 6px; font-size: 12.5px; }

table.list { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
table.list th, table.list td { border-bottom: 1px solid #e6ebf1; padding: 8px 10px; text-align: left; font-size: 13px; }
table.list th { background: #f0f3f8; color: #44536a; }

.progress { background: #e6ebf1; border-radius: 6px; height: 9px; overflow: hidden; margin-top: 6px; }
.progress > div { background: #2e7d32; height: 100%; }

.modal-mask { position: fixed; inset: 0; background: rgba(15,25,40,.45); display: flex; align-items: flex-start; justify-content: center; z-index: 50; overflow-y: auto; padding: 18px 10px; }
.modal { background: #fff; border-radius: 12px; width: 760px; max-width: 100%; padding: 16px 18px 20px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.quickdays { display: flex; gap: 6px; margin: 4px 0 8px; }
.items-table { width: 100%; border-collapse: collapse; }
.items-table th, .items-table td { padding: 4px; font-size: 13px; }
.items-table input { padding: 5px 6px; }
.timeline { border-left: 2px solid #dde4ec; margin: 8px 0 0 6px; padding-left: 14px; }
.timeline .tl-item { margin-bottom: 12px; position: relative; }
.timeline .tl-item::before { content: ''; position: absolute; left: -19.5px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: #0d47a1; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: #1c2733; color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 99; font-size: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.25); }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.kv .cell { background: #f7f9fc; border-radius: 8px; padding: 8px 10px; }
.kv .cell b { display: block; font-size: 12px; color: #68788d; font-weight: 400; margin-bottom: 2px; }
