* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  margin: 0; min-height: 100vh;
  background: linear-gradient(135deg, #1B2A4A 0%, #253660 100%);
  color: #1A1C26;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 20px;
}
.card {
  width: 100%; max-width: 440px;
  background: #fff; border-radius: 18px;
  padding: 28px 24px;
  box-shadow: 0 14px 48px rgba(0,0,0,.35);
  margin: 16px auto;
}
.wide { max-width: 980px; }
.brand {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: #7A8090;
}
.gold-bar { height: 3px; width: 38px; background: #C9A84C; border-radius: 2px; margin: 6px 0 16px; }
.title { font-size: 20px; margin: 4px 0 4px; color: #1A1C26; font-weight: 700; }
.sub { color: #7A8090; font-size: 13px; margin: 0 0 16px; }
.name { font-size: 26px; font-weight: 700; line-height: 1.15; margin: 4px 0 6px; }
.sid  { font-size: 12px; color: #7A8090; letter-spacing: .04em; margin-bottom: 18px; }
.status {
  padding: 16px; border-radius: 12px; text-align: center;
  font-weight: 800; font-size: 20px; letter-spacing: .04em;
}
.status.in  { background: #E6F4E6; color: #1F7A33; border: 1px solid #BFE0C5; }
.status.out { background: #FDF0F0; color: #B03030; border: 1px solid #F0CACA; }
.status.unknown { background: #EEF0F4; color: #7A8090; }
.time { font-size: 12px; color: #7A8090; text-align: center; margin-top: 8px; min-height: 16px; }
label { display:block; font-size: 11px; color:#7A8090; letter-spacing:.08em; text-transform: uppercase; margin: 16px 0 6px; }
input[type="password"], input[type="text"] {
  width: 100%; padding: 12px 14px; font-size: 16px;
  border: 1.5px solid #DDE0E8; border-radius: 10px;
  outline: none; transition: border-color .15s;
}
input:focus { border-color: #C9A84C; }
.buttons { display: flex; gap: 10px; margin-top: 14px; }
button {
  flex: 1; padding: 14px 10px; border: 0;
  border-radius: 10px; font-size: 15px; font-weight: 700;
  cursor: pointer; color: #fff;
  transition: transform .08s, opacity .15s;
}
button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }
.btn-in  { background: #1F7A33; }
.btn-out { background: #B03030; }
.btn-primary { background: #1B2A4A; width: 100%; margin-top: 14px; }
.btn-link { background: none; color: #1B2A4A; padding: 6px 0; font-weight: 600; }
.msg { margin-top: 12px; text-align: center; font-size: 13px; min-height: 18px; font-weight: 600; }
.msg.err { color: #B03030; }
.msg.ok  { color: #1F7A33; }
.footer {
  text-align: center; color: #C9A84C; font-size: 10px;
  letter-spacing: .12em; text-transform: uppercase;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid #EEF0F4;
}
.bar {
  display:flex; align-items:center; justify-content: space-between;
  padding-bottom: 12px; border-bottom: 1px solid #EEF0F4; margin-bottom: 16px;
}
.bar .role { font-size:11px; letter-spacing:.1em; text-transform:uppercase; color:#7A8090; }
.tabs { display:flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.tab {
  padding: 8px 14px; border: 1.5px solid #DDE0E8; border-radius: 999px;
  font-size: 13px; font-weight: 600; cursor: pointer; background:#fff; color:#1A1C26;
}
.tab.active { background: #1B2A4A; color: #fff; border-color: #1B2A4A; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.stat { background:#F7F8FB; border-radius:10px; padding:12px; text-align:center; }
.stat .v { font-size: 22px; font-weight: 800; color:#1A1C26; }
.stat .l { font-size: 10px; letter-spacing:.1em; text-transform: uppercase; color:#7A8090; margin-top: 2px; }
.stat.in .v { color: #1F7A33; }
.stat.out .v { color: #B03030; }
table { width:100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 10px; border-bottom: 1px solid #EEF0F4; text-align: left; vertical-align: top; }
th { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #7A8090; }
.pill { display:inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.pill.in  { background:#E6F4E6; color:#1F7A33; }
.pill.out { background:#FDF0F0; color:#B03030; }
.pill.unk { background:#EEF0F4; color:#7A8090; }
.search { width: 100%; margin-bottom: 12px; }
.scroll { max-height: 60vh; overflow:auto; border: 1px solid #EEF0F4; border-radius: 10px; }
.muted { color:#7A8090; font-size: 12px; }
a { color: #1B2A4A; }
@media (max-width: 600px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  th.hide-sm, td.hide-sm { display: none; }
}
.btn-edit {
  background:#C9A84C; color:#1A1C26; padding:6px 12px;
  border-radius:8px; font-size:12px; font-weight:700; cursor:pointer;
  border:0;
}
.modal-bg {
  position: fixed; inset: 0; background: rgba(20,28,50,.55);
  display:none; align-items:flex-start; justify-content:center; z-index:50;
  padding: 20px; overflow:auto;
}
.modal-bg.show { display:flex; }
.modal {
  background:#fff; border-radius:14px; padding:22px;
  width:100%; max-width: 520px; box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.modal h3 { margin: 0 0 4px; font-size: 18px; }
.modal .sid { margin-bottom: 14px; }
.modal label { margin: 12px 0 4px; }
.modal input, .modal textarea {
  width:100%; padding:10px 12px; font-size:14px;
  border:1.5px solid #DDE0E8; border-radius:8px; box-sizing:border-box;
  font-family: inherit;
}
.modal textarea { min-height: 60px; resize: vertical; }
.modal .row2 { display:grid; grid-template-columns: 1fr 1fr; gap:10px; }
.modal-actions { display:flex; gap:10px; margin-top: 18px; }
.btn-cancel { background:#7A8090; }

/* ── Roster toolbar ─────────────────────────────────────────── */
.toolbar { display:flex; gap:10px; align-items:center; margin-bottom:12px; }
.toolbar .search { margin-bottom:0; flex:1; }
.toolbar button { flex:0 0 auto; padding:10px 16px; font-size:13px; }

/* ── Large edit/add modal with side-by-side preview ─────────── */
.modal-lg { max-width: 920px; }
.modal-body { display:grid; grid-template-columns: 1.15fr .85fr; gap:20px; align-items:start; }
.form-col { min-width:0; }
.preview-col { position:sticky; top:0; }
.preview-col iframe#cardPreview {
  width:100%; height:300px; border:1.5px solid #DDE0E8; border-radius:10px; background:#EEF0F4;
}
.preview-actions { display:flex; gap:10px; align-items:center; margin-top:10px; }
.preview-actions .btn-edit { flex:0 0 auto; }
.preview-actions .btn-link { flex:0 0 auto; padding:6px 8px; }
.preview-hint { margin-top:8px; }
.fieldset { border:1px solid #EEF0F4; border-radius:10px; padding:10px 12px; margin-top:14px; }
.fieldset-h { font-size:11px; letter-spacing:.1em; text-transform:uppercase; color:#7A8090; font-weight:700; margin-bottom:4px; }
.img-row { display:grid; grid-template-columns: repeat(3, 1fr); gap:10px; }
.img-slot { display:flex; flex-direction:column; }
.img-slot input[type=file] { font-size:11px; margin-top:6px; }
.thumb {
  display:none; width:100%; height:64px; object-fit:contain;
  background:#F7F8FB; border:1px solid #DDE0E8; border-radius:8px;
}

/* ── Bulk import ────────────────────────────────────────────── */
.bulk-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin:10px 0; }
.bulk-grid input[type=file] { font-size:12px; }
.bulk-actions { display:flex; gap:12px; align-items:center; margin:8px 0 12px; }
.bulk-actions button { flex:0 0 auto; padding:10px 18px; font-size:13px; }
.progress { height:8px; background:#EEF0F4; border-radius:999px; overflow:hidden; margin-bottom:12px; }
.progress-bar { height:100%; width:0; background:#1F7A33; transition: width .2s; }
.ok-text { color:#1F7A33; font-weight:700; }
.err-text { color:#B03030; font-weight:700; }

@media (max-width: 760px) {
  .modal-body { grid-template-columns: 1fr; }
  .bulk-grid { grid-template-columns: 1fr; }
  .preview-col { position:static; }
}
