:root{
  --red:#c8102e;
  --red-dark:#9c0c22;
  --blue:#0056a3;
  --blue-dark:#003d75;
  --gray-bg:#f2f3f5;
  --gray-border:#d3d7dc;
  --gray-text:#3c3f44;
  --white:#ffffff;
  --green:#1e7e34;
}

*{box-sizing:border-box;}

body{
  margin:0;
  font-family:Arial, Helvetica, sans-serif;
  background:var(--gray-bg);
  color:var(--gray-text);
}

header.topbar{
  background:var(--red);
  color:var(--white);
  padding:14px 20px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:4px solid var(--red-dark);
}

header.topbar .brand{
  font-size:20px;
  font-weight:bold;
  letter-spacing:.5px;
}

header.topbar .brand small{
  display:block;
  font-size:11px;
  font-weight:normal;
  opacity:.9;
}

nav.tabs{
  background:var(--blue-dark);
  display:flex;
  flex-wrap:wrap;
}

nav.tabs a{
  color:var(--white);
  text-decoration:none;
  padding:10px 18px;
  font-size:14px;
  border-right:1px solid rgba(255,255,255,.15);
}

nav.tabs a:hover, nav.tabs a.active{
  background:var(--blue);
}

main{
  max-width:1000px;
  margin:20px auto;
  padding:0 16px 40px;
}

h1{font-size:20px; margin:0 0 4px;}
h2{font-size:17px; color:var(--blue-dark); margin-top:28px;}
p.sub{color:#6a6f76; margin-top:0; font-size:13px;}

.card{
  background:var(--white);
  border:1px solid var(--gray-border);
  border-radius:4px;
  padding:16px;
  margin-bottom:18px;
}

.grid-2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

label{
  display:block;
  font-size:12px;
  font-weight:bold;
  color:#555;
  margin-bottom:4px;
  margin-top:10px;
}

input, select{
  width:100%;
  padding:8px;
  border:1px solid var(--gray-border);
  border-radius:3px;
  font-size:14px;
  background:var(--white);
}

input[readonly]{
  background:#eceef0;
  color:#777;
}

button, .btn{
  display:inline-block;
  background:var(--blue);
  color:var(--white);
  border:none;
  padding:9px 16px;
  border-radius:3px;
  font-size:14px;
  cursor:pointer;
  margin-top:14px;
  text-decoration:none;
}

button:hover, .btn:hover{background:var(--blue-dark);}

button.secondary{background:#6c757d;}
button.secondary:hover{background:#565b60;}

button.small{
  padding:5px 10px;
  font-size:12px;
  margin-top:0;
}

table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
  margin-top:8px;
}

th, td{
  text-align:left;
  padding:8px;
  border-bottom:1px solid var(--gray-border);
}

th{background:#e9ebee; color:var(--blue-dark);}

.badge{
  display:inline-block;
  padding:2px 8px;
  border-radius:10px;
  font-size:11px;
  font-weight:bold;
  color:var(--white);
}
.badge.pending{background:#a0a4aa;}
.badge.checked{background:var(--green);}

.msg{
  padding:8px 12px;
  border-radius:3px;
  font-size:13px;
  margin-top:10px;
}
.msg.error{background:#fdeaea; color:#a52020; border:1px solid #f3b8b8;}
.msg.ok{background:#e9f6ec; color:var(--green); border:1px solid #b9e3c2;}

/* ---- Boarding pass ---- */
.pass{
  background:var(--white);
  border:2px solid var(--red);
  border-radius:6px;
  max-width:420px;
  margin:14px 0;
  overflow:hidden;
}
.pass .pass-head{
  background:var(--red);
  color:var(--white);
  padding:10px 14px;
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.pass .pass-head .airline{font-weight:bold; font-size:16px;}
.pass .pass-head .cabin{font-size:12px; text-transform:uppercase; letter-spacing:.5px;}
.pass .pass-body{padding:14px;}
.pass .route{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:10px;
}
.pass .route .code{font-size:26px; font-weight:bold; color:var(--blue-dark);}
.pass .route .arrow{color:#999; font-size:20px;}
.pass .fields{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:8px;
  font-size:12px;
  margin-bottom:12px;
}
.pass .fields div span{display:block; color:#888; font-size:10px; text-transform:uppercase;}
.pass .fields div b{font-size:14px;}
.pass .barcode-wrap{
  text-align:center;
  border-top:1px dashed var(--gray-border);
  padding-top:10px;
}
.pass .barcode-wrap canvas{max-width:100%;}
.pass .pass-code{
  text-align:center;
  font-size:11px;
  letter-spacing:2px;
  color:#888;
  margin-top:4px;
}

#camera-wrap{
  position:relative;
  max-width:480px;
  margin:0 auto;
}
#camera-wrap video{width:100%; border-radius:4px; background:#000;}

.result-panel{
  border:2px solid var(--green);
  background:#f2fbf4;
  border-radius:4px;
  padding:16px;
  margin-top:16px;
}
.result-panel.not-found{border-color:var(--red); background:#fdeeee;}
