* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif; background: #f4f6fb; color: #1f2733; }
.wrap { max-width: 760px; margin: 40px auto; padding: 0 16px; }
.wrap.wide { max-width: 1180px; }
h1 { font-size: 26px; margin: 0 0 6px; }
.lead { color: #5a6473; margin: 0 0 18px; }
.badge { display: inline-block; background: #e7edff; color: #2a47b8; padding: 4px 10px; border-radius: 6px; font-size: 13px; margin-bottom: 14px; }
.card { background: #fff; border: 1px solid #e2e7f0; border-radius: 12px; padding: 22px; box-shadow: 0 1px 3px rgba(20,40,80,.05); }
.card.err { border-color: #f3c2c2; background: #fff6f6; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.req { color: #c0392b; font-weight: 600; }
input[type=file] { display: block; width: 100%; padding: 10px; border: 1px dashed #b9c2d4; border-radius: 8px; background: #fafbff; }
input[type=text] { width: 100%; padding: 7px 9px; border: 1px solid #cdd5e3; border-radius: 6px; font-size: 14px; }
.hint { color: #7a8597; font-size: 13px; }
.btn { display: inline-block; background: #2a47b8; color: #fff; border: 0; padding: 11px 20px; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: #1f3690; }
.btn.ghost { background: #eef1f7; color: #2a3344; }
.foot { color: #8a93a4; font-size: 12px; margin-top: 18px; }
.metagrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.metagrid label { font-size: 13px; font-weight: 600; color: #3a4458; }
.metagrid input { margin-top: 5px; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th { text-align: left; background: #eef2fb; padding: 8px 6px; border-bottom: 2px solid #d6deee; position: sticky; top: 0; }
table.grid td { padding: 4px 5px; border-bottom: 1px solid #eef1f7; }
table.grid input { width: 100%; padding: 5px 6px; border: 1px solid #d6dded; border-radius: 5px; }
table.grid input.wide-in { min-width: 180px; }
tr.warn td { background: #fff7f3; }
tr.warn input { border-color: #f0c2a8; }
.actions { display: flex; justify-content: space-between; margin-top: 18px; }
.topbar { display: flex; justify-content: space-between; align-items: center; background: #1f2733; color: #cdd5e3; padding: 9px 18px; font-size: 13px; }
.topbar strong { color: #fff; }
.topbar a { color: #9cc1ff; text-decoration: none; margin-left: 14px; }
.topbar a:hover { text-decoration: underline; }
h2 { font-size: 17px; }
.btn.small { padding: 7px 13px; font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { background: #f6f8fd; border: 1px solid #e6ebf5; border-radius: 9px; padding: 14px; text-align: center; }
.stat .num { display: block; font-size: 24px; font-weight: 700; color: #2a47b8; }
.stat .lbl { display: block; font-size: 12px; color: #6a7587; margin-top: 4px; }
@media (max-width: 640px) { .stats { grid-template-columns: 1fr 1fr; } .metagrid { grid-template-columns: 1fr; } }

/* loading overlay */
.loader { position: fixed; inset: 0; background: rgba(20,30,50,.55); display: none; align-items: center; justify-content: center; z-index: 1000; }
.loader.show { display: flex; }
.loader-box { background: #fff; border-radius: 14px; padding: 26px 30px; width: 380px; max-width: 90%; box-shadow: 0 12px 44px rgba(0,0,0,.28); text-align: center; }
.loader-title { font-weight: 700; font-size: 16px; margin-bottom: 14px; color: #1f2733; }
.loader-track { height: 12px; background: #e8edf6; border-radius: 8px; overflow: hidden; }
.loader-bar { height: 100%; width: 0%; background: linear-gradient(90deg,#2a47b8,#5a7bf0); border-radius: 8px; transition: width .15s linear; }
.loader-pct { margin-top: 8px; font-weight: 700; color: #2a47b8; font-size: 14px; }
.loader-sub { margin-top: 4px; font-size: 12px; color: #7a8597; }
