:root{
  --bg:#f5f7fb;
  --card:#ffffff;
  --line:#dde5ef;
  --line-2:#edf2f7;
  --text:#1f2a37;
  --muted:#6b7787;
  --primary:#2d6cdf;
  --primary-2:#1f5ac2;
  --accent:#eff5ff;
  --success:#edf8f0;
  --warning:#fff7ea;
  --danger:#fff1f1;
  --shadow:0 18px 50px rgba(26, 43, 74, 0.08);
  --radius:18px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;font-family:Segoe UI,Arial,sans-serif;color:var(--text);background:var(--bg)}
a{text-decoration:none;color:inherit}
button,input,select,textarea{font:inherit}
.auth-body{
  min-height:100vh;
  background:linear-gradient(180deg,#f9fbff 0%,#eef3f8 100%);
}
.auth-shell{
  max-width:1180px;
  margin:0 auto;
  min-height:100vh;
  display:grid;
  grid-template-columns:1.1fr 480px;
  gap:34px;
  align-items:center;
  padding:32px;
}
.auth-hero{
  padding:28px 12px 28px 8px;
}
.brand-badge{
  display:inline-block;
  background:#e7efff;
  color:#32539f;
  border:1px solid #d7e4ff;
  border-radius:999px;
  padding:8px 14px;
  font-size:13px;
  margin-bottom:18px;
}
.auth-hero h1{
  font-size:48px;
  line-height:1.05;
  letter-spacing:-0.03em;
  margin:0 0 14px;
  max-width:620px;
}
.auth-hero p{
  color:var(--muted);
  font-size:18px;
  line-height:1.7;
  margin:0 0 18px;
  max-width:640px;
}
.hero-list{
  list-style:none;
  padding:0;margin:24px 0 0;
  display:grid;gap:12px;
}
.hero-list li{
  padding:14px 16px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.7);
  border-radius:14px;
  max-width:460px;
}
.auth-card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:26px;
  box-shadow:var(--shadow);
  padding:30px;
}
.auth-card-top h2{
  margin:0 0 8px;
  font-size:28px;
}
.auth-card-top p{
  color:var(--muted);
  margin:0 0 22px;
  line-height:1.65;
}
.auth-form{display:grid;gap:16px}
.auth-form label{display:grid;gap:8px}
.auth-form span{
  font-size:14px;
  color:#445063;
  font-weight:600;
}
.auth-form input,
.data-table input,
.data-table select,
.ocr-text{
  width:100%;
  border:1px solid var(--line);
  border-radius:12px;
  padding:13px 14px;
  background:#fff;
  outline:none;
}
.auth-form input:focus,
.data-table input:focus,
.data-table select:focus{
  border-color:#8cb2ff;
  box-shadow:0 0 0 4px rgba(45,108,223,.12);
}
.btn{
  border:none;
  border-radius:14px;
  padding:13px 18px;
  font-weight:600;
  cursor:pointer;
  display:inline-flex;
  justify-content:center;
  align-items:center;
  gap:8px;
}
.btn-block{width:100%}
.btn-primary{
  background:linear-gradient(180deg,var(--primary) 0%,var(--primary-2) 100%);
  color:#fff;
}
.btn-primary:hover{filter:brightness(1.02)}
.btn-muted{
  background:#fff;
  border:1px solid var(--line);
  color:var(--text);
}
.auth-demo{
  margin-top:18px;
  padding:12px 14px;
  border-radius:14px;
  background:#f8fafc;
  border:1px solid var(--line-2);
  color:var(--muted);
}
.alert{
  padding:14px 16px;
  border-radius:14px;
  margin-bottom:18px;
  border:1px solid transparent;
}
.alert.error{background:#fff1f1;border-color:#ffd7d7;color:#8f2d2d}
.alert.success{background:#edf8f0;border-color:#ccebd4;color:#27613a}
.app-body{
  min-height:100vh;
  display:grid;
  grid-template-columns:280px 1fr;
}
.sidebar{
  background:#fbfcfe;
  border-right:1px solid var(--line);
  min-height:100vh;
  padding:26px 20px;
  display:flex;
  flex-direction:column;
}
.sidebar-brand{
  display:flex;
  align-items:center;
  gap:14px;
  margin-bottom:28px;
}
.brand-mark{
  width:48px;height:48px;border-radius:14px;
  display:flex;align-items:center;justify-content:center;
  font-weight:700;color:#2a4f98;
  background:linear-gradient(180deg,#eaf2ff,#dce9ff);
  border:1px solid #cfe0ff;
}
.sidebar-brand h1{
  margin:0;font-size:16px;
}
.sidebar-brand p{
  margin:4px 0 0;color:var(--muted);font-size:13px;
}
.sidebar-nav{
  display:grid;gap:8px;
}
.sidebar-nav a{
  padding:13px 14px;
  border-radius:12px;
  color:#425167;
}
.sidebar-nav a.active,
.sidebar-nav a:hover{
  background:#edf4ff;
  color:#234d97;
}
.sidebar-footer{
  margin-top:auto;
  font-size:12px;
  color:var(--muted);
  border-top:1px solid var(--line);
  padding-top:16px;
}
.main-content{
  padding:30px 34px 38px;
}
.page-header{
  margin-bottom:24px;
}
.page-header.between{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:flex-start;
}
.eyebrow{
  color:#5371a8;
  font-size:13px;
  margin-bottom:8px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.page-header h2{
  margin:0 0 8px;
  font-size:34px;
  letter-spacing:-.03em;
}
.page-header p{
  margin:0;color:var(--muted);line-height:1.7;
}
.header-actions{
  display:flex;gap:12px;align-items:center;flex-wrap:wrap
}
.panel-grid{
  display:grid;
  grid-template-columns:1.2fr .8fr;
  gap:22px;
}
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:22px;
  box-shadow:var(--shadow);
  padding:22px;
}
.card-head h3{
  margin:0 0 8px;font-size:22px;
}
.card-head p{
  margin:0 0 20px;color:var(--muted);
}
.upload-form{display:grid;gap:18px}
.upload-dropzone{
  position:relative;
  display:grid;
  place-items:center;
  min-height:260px;
  border:2px dashed #cfdcf1;
  border-radius:24px;
  background:linear-gradient(180deg,#fbfdff,#f5f8fd);
  text-align:center;
  padding:20px;
  cursor:pointer;
}
.upload-dropzone input{
  position:absolute;inset:0;opacity:0;cursor:pointer;
}
.upload-dropzone.dragover{
  border-color:#2d6cdf;
  background:linear-gradient(180deg,#edf4ff,#e0ecff);
  transform:scale(1.01);
  transition:all .2s;
}
.dropzone-icon{
  width:68px;height:68px;border-radius:20px;
  background:#eaf2ff;
  color:#315aa5;
  display:flex;align-items:center;justify-content:center;
  font-size:36px;font-weight:300;margin-bottom:12px;
}
.dropzone-title{font-size:22px;font-weight:700}
.dropzone-subtitle{max-width:420px;color:var(--muted);margin-top:8px;line-height:1.7}
.rule-box{
  background:#f8fbff;
  border:1px solid #deebff;
  border-radius:16px;
  padding:16px 18px;
}
.rule-box strong{display:block;margin-bottom:10px}
.rule-box ul{margin:0;padding-left:18px;color:var(--muted);line-height:1.8}
.info-card{background:linear-gradient(180deg,#ffffff,#fafcff)}
.info-steps{display:grid;gap:14px}
.step{
  display:grid;
  grid-template-columns:48px 1fr;
  gap:14px;
  align-items:flex-start;
  padding:14px 0;
  border-bottom:1px solid var(--line-2);
}
.step:last-child{border-bottom:none}
.step span{
  width:40px;height:40px;border-radius:14px;
  display:flex;align-items:center;justify-content:center;
  background:#edf4ff;color:#234d97;font-weight:700;
}
.step strong{display:block;margin-bottom:6px}
.step p{margin:0;color:var(--muted);line-height:1.65}
.stat-card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:18px;
  padding:18px 20px;
  box-shadow:var(--shadow);
}
.stat-card span{
  display:block;
  color:var(--muted);
  margin-bottom:10px;
}
.stat-card strong{
  font-size:30px;
}
.stat-card.danger{background:#fff8f8;border-color:#ffe0e0}
.review-grid{
  display:grid;
  grid-template-columns:1.35fr .65fr;
  gap:22px;
}
.table-wrap{
  overflow:auto;
  border:1px solid var(--line);
  border-radius:16px;
}
.data-table{
  width:100%;
  border-collapse:collapse;
  min-width:1100px;
}
.data-table th,
.data-table td{
  padding:12px 12px;
  border-bottom:1px solid var(--line-2);
  vertical-align:top;
}
.data-table thead th{
  background:#f8fbff;
  font-size:13px;
  text-align:left;
  color:#45546b;
}
.data-table tbody tr.valid{background:#fbfffc}
.data-table tbody tr.fixed{background:#fffdf7}
.data-table tbody tr.invalid{background:#fff8f8}
.table-actions{margin-top:16px;display:flex;justify-content:flex-end}
.ocr-text{
  min-height:320px;
  background:#fbfcff;
  resize:vertical;
  line-height:1.65;
}
.review-grid-full{
  display:grid;
  grid-template-columns:1fr;
  gap:22px;
}
.review-grid-full .table-wrap{
  max-height:60vh;
  overflow:auto;
}
.data-table input[type="text"]{
  padding:8px 6px;
  border-radius:8px;
  min-width:50px;
}
.btn-delete{
  background:#ff4d4d;
  color:#fff;
  border:none;
  border-radius:8px;
  padding:6px 10px;
  cursor:pointer;
  font-weight:700;
  font-size:12px;
}
.btn-delete:hover{background:#cc0000}
.row-num{
  text-align:center;
  font-weight:700;
  color:var(--muted);
  width:30px;
}
.stats-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:16px;
  margin-bottom:22px;
}
@media (max-width: 1200px){
  .app-body{grid-template-columns:240px 1fr}
  .panel-grid,.review-grid{grid-template-columns:1fr}
}
@media (max-width: 900px){
  .auth-shell{grid-template-columns:1fr;padding:20px}
  .auth-hero{padding:10px 0 0}
  .auth-hero h1{font-size:38px}
  .app-body{grid-template-columns:1fr}
  .sidebar{min-height:auto}
  .stats-grid{grid-template-columns:1fr 1fr}
  .page-header.between{display:block}
}
@media (max-width: 640px){
  .main-content{padding:20px}
  .stats-grid{grid-template-columns:1fr}
  .auth-card{padding:22px}
  .auth-hero h1{font-size:30px}
}
