:root {
  --itms-navy: #0e1a4b;
  --itms-navy-dark: #0a1338;
  --itms-purple: #5b1f6e;
  --itms-green: #1e7e34;
  --itms-green-dark: #17652a;
  --itms-orange: #e08e00;
  --itms-blue: #1f5bd6;
  --sidebar-w: 230px;
}

* { box-sizing: border-box; }

body {
  background: #f4f6fb;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1c2333;
}

.topbar {
  background: var(--itms-purple);
  height: 46px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-brand { color: #fff; font-weight: 600; font-size: 0.92rem; letter-spacing: .3px; }
.topbar-user { color: #fff; font-size: 0.85rem; background: rgba(255,255,255,.15); padding: 3px 10px; border-radius: 14px; }

.app-shell { display: flex; min-height: calc(100vh - 46px); }

.sidebar {
  width: var(--sidebar-w);
  background: var(--itms-navy);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding-top: 10px;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
  padding: 10px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 8px;
}
.logo-emoji { font-size: 1.1rem; }
.sidebar-nav { flex-grow: 1; padding: 4px 10px; }
.sidebar-nav .nav-link {
  color: rgba(255,255,255,.72);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.93rem;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-nav .nav-link i { font-size: 1.02rem; width: 18px; text-align: center; }
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav .nav-link.active {
  background: rgba(76, 110, 245, .22);
  color: #fff;
  border-left: 3px solid #4c9aff;
  padding-left: 11px;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #2f3f8f;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
  flex-shrink: 0;
}

.content {
  flex-grow: 1;
  padding: 24px 28px 40px;
  max-width: 100%;
  overflow-x: hidden;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--itms-navy);
  margin-bottom: 4px;
}
.page-subtitle { color: #6b7385; font-size: 0.92rem; }

.stat-card {
  background: #fff;
  border: 1px solid #e4e8f2;
  border-radius: 10px;
  padding: 16px 18px;
  height: 100%;
}
.stat-card .stat-label { color: #6b7385; font-size: .82rem; text-transform: none; }
.stat-card .stat-value { font-size: 1.9rem; font-weight: 700; color: var(--itms-navy); line-height: 1.2; }
.stat-card .stat-foot { color: #8992a3; font-size: .78rem; }
.stat-card.stat-highlight {
  background: linear-gradient(135deg, #1e7e34, #17652a);
  color: #fff;
  border: none;
}
.stat-card.stat-highlight .stat-label,
.stat-card.stat-highlight .stat-foot { color: rgba(255,255,255,.85); }
.stat-card.stat-highlight .stat-value { color: #fff; }

.panel {
  background: #fff;
  border: 1px solid #e4e8f2;
  border-radius: 10px;
  padding: 18px 20px;
}
.panel-title {
  font-weight: 700;
  color: var(--itms-navy);
  font-size: 1.02rem;
  border-bottom: 2px solid #1e7e34;
  display: inline-block;
  padding-bottom: 6px;
  margin-bottom: 14px;
}

.op-row { padding: 12px 0; border-bottom: 1px solid #eef0f6; }
.op-row:last-child { border-bottom: none; }
.op-name { font-weight: 700; color: #1c2333; font-size: .95rem; }
.op-meta { color: #7b8296; font-size: .8rem; }
.progress { height: 6px; background: #eef0f6; }
.progress-bar { background: var(--itms-navy); }

.run-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid #eef0f6;
}
.run-item:last-child { border-bottom: none; }
.run-title { font-weight: 600; font-size: .88rem; color: #1c2333; }
.run-meta { color: #8992a3; font-size: .76rem; }

.btn-itms-green { background: var(--itms-green); border-color: var(--itms-green); color: #fff; }
.btn-itms-green:hover { background: var(--itms-green-dark); border-color: var(--itms-green-dark); color: #fff; }

.plate-preview {
  border: 4px solid #1c2333;
  border-radius: 10px;
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #fff;
  overflow: hidden;
}
.plate-preview .flag-strip {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 42px;
  display: flex;
  flex-direction: column;
}
.plate-preview .flag-strip div { flex: 1; }
.plate-preview.para .flag-strip { background: #1f5bd6; }
.plate-preview .flag-strip .blk { background: #1c2333; }
.plate-preview .flag-strip .yel { background: #ffcd00; }
.plate-preview .flag-strip .red { background: #d21f3c; }
.plate-preview .plate-number {
  font-family: "Arial Narrow", Arial, sans-serif;
  font-weight: 800;
  font-size: 2.3rem;
  letter-spacing: 2px;
  color: #1c2333;
  margin-left: 42px;
}
.plate-preview.para .plate-number { color: #1f5bd6; }

.badge-op { background: #eef0f6; color: #47506b; font-weight: 500; }

.scan-box {
  min-height: 320px;
  border: 1px solid #e4e8f2;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  font-weight: 600;
  color: #384157;
}

.table-sm-actions .btn { padding: 3px 10px; font-size: .76rem; }

.tab-pill { border-radius: 6px !important; font-weight: 600; }

.form-label { font-size: .82rem; color: #4b5163; font-weight: 600; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--itms-navy) 0%, var(--itms-purple) 100%);
}
.login-card {
  background: #fff;
  border-radius: 14px;
  padding: 36px 34px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.demo-creds { background: #f4f6fb; border-radius: 8px; padding: 10px 12px; font-size: .78rem; color: #5a6178; }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: -230px; top: 46px; bottom: 0; z-index: 40; transition: left .2s; }
  .sidebar.show { left: 0; }
  .content { padding: 16px; }
}
