/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: #f0f2f5;
  color: #1a1a1a;
  line-height: 1.6;
}

/* -- Nav ------------------------------------------------------------------- */
nav {
  background: #1558b0;
  color: #fff;
  padding: 0 1.5rem;
  height: 52px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: visible;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}

.nav-brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .03em;
  color: #fff;
  text-decoration: none;
  margin-right: 1.5rem;
  white-space: nowrap;
  flex-shrink: 0;
  height: 52px;
  display: flex;
  align-items: center;
}
.nav-brand:hover { color: #e8f0fe; }

/* Nav-collapse: flex row filling remaining space on desktop */
.nav-collapse {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  align-self: stretch;
}

nav a {
  color: rgba(255,255,255,.88);
  text-decoration: none;
  font-size: .9rem;
  padding: 0 .75rem;
  height: 52px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
nav a:hover  { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
nav a.nav-brand { padding: 0; }
nav a.nav-brand:hover { background: transparent; }

/* nav-user is pushed to the right inside nav-collapse */
.nav-user {
  margin-left: auto;
  font-size: .82rem;
  color: rgba(255,255,255,.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  padding: 0 .75rem;
  flex-shrink: 1;
}

nav button {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 4px;
  padding: .35rem .9rem;
  font-size: .85rem;
  cursor: pointer;
  margin-left: .5rem;
  flex-shrink: 0;
  transition: background .15s;
}
nav button:hover { background: rgba(255,255,255,.28); }

/* Language toggle */
.btn-lang {
  font-weight: 700;
  letter-spacing: .04em;
  padding: .3rem .7rem;
  min-width: 2.5rem;
  font-size: .8rem;
}

/* Hamburger -- hidden on desktop, shown on mobile */
.nav-hamburger {
  display: none;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
  padding: .25rem .5rem;
  line-height: 1;
  border-radius: 4px;
  flex-shrink: 0;
  margin-left: .4rem;
}
.nav-hamburger:hover { background: rgba(255,255,255,.18); }


/* ── Main ─────────────────────────────────────────────────────────────────── */
main { max-width: 1100px; margin: 2rem auto; padding: 0 1.5rem; }

h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 1rem; color: #111; }
h2 { font-size: 1.15rem; font-weight: 700; margin: 1.75rem 0 .75rem; color: #222; }
h3 { font-size: 1rem; font-weight: 700; margin: 0 0 .5rem; color: #333; }

/* ── Table ────────────────────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 8px rgba(0,0,0,.04);
}

th, td {
  padding: 0.65rem 1rem;
  text-align: left;
  border-bottom: 1px solid #eaecef;
}

th { background: #f6f8fa; font-weight: 600; font-size: .85rem; color: #555; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbfc; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
button, .btn-google {
  display: inline-block;
  padding: 0.5rem 1.1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s, box-shadow .15s;
}

.btn-google     { background: #1a73e8; color: #fff; }
.btn-google:hover { background: #1558c0; }
.btn-approve    { background: #188038; color: #fff; }
.btn-approve:hover { background: #0f6126; }
.btn-reject     { background: #c5221f; color: #fff; }
.btn-reject:hover  { background: #a50e0e; }
.btn-secondary  { background: #fff; color: #444; border: 1px solid #d0d5dd; }
.btn-secondary:hover { background: #f6f8fa; }
.btn-danger     { background: #7f1d1d; color: #fff; }
.btn-danger:hover    { background: #991b1b; }

button[type="submit"] { background: #1a73e8; color: #fff; margin-top: 0.5rem; }
button[type="submit"]:hover { background: #1558c0; }

/* ── Messages ─────────────────────────────────────────────────────────────── */
.success       { background: #ecfdf5; border-left: 4px solid #059669; padding: 0.75rem 1rem; margin-bottom: 1rem; border-radius: 6px; color: #065f46; }
.error, .error-message { background: #fef2f2; border-left: 4px solid #dc2626; padding: 0.75rem 1rem; margin-bottom: 1rem; border-radius: 6px; color: #991b1b; }

/* ── Item info (QR scan) ──────────────────────────────────────────────────── */
.item-info {
  background: #fff;
  padding: 1.25rem;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 8px rgba(0,0,0,.04);
  margin-bottom: 1.5rem;
}

dl { display: grid; grid-template-columns: 160px 1fr; gap: 0.4rem 1rem; }
dt { font-weight: 600; }

/* ── Form ─────────────────────────────────────────────────────────────────── */
select, input { padding: 0.45rem 0.75rem; border: 1px solid #d0d5dd; border-radius: 6px; }
select:focus, input:focus { outline: none; border-color: #1a73e8; box-shadow: 0 0 0 2px rgba(26,115,232,.2); }

/* ── Footer ───────────────────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: #9ca3af;
  font-size: 0.8rem;
  border-top: 1px solid #e5e7eb;
  margin-top: 3rem;
}

/* ── Admin toolbar ────────────────────────────────────────────────────────────*/
.admin-toolbar {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding: .75rem 1rem;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 8px rgba(0,0,0,.04);
}

/* ── Import panel ─────────────────────────────────────────────────────────── */
.import-panel {
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.import-ok { color: #065f46; font-weight: 600; }

/* ── Admin warehouse box ───────────────────────────────────────────────────── */
.admin-warehouse-box {
  margin-top: 2rem;
  padding: .85rem 1rem;
  border: 2px solid #fca5a5;
  border-radius: 10px;
  background: #fff5f5;
}

.btn-warehouse {
  display: block;
  width: 100%;
  padding: .75rem;
  background: #991b1b;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .02em;
  transition: background .15s;
}
.btn-warehouse:hover { background: #7f1d1d; }

/* ── QR scan — device edit panel ─────────────────────────────────────────── */
.change-data-panel {
  margin-top: 1.5rem;
  border: 1px solid #c5cae9;
  border-radius: 8px;
  padding: .75rem 1rem;
  background: #f8f9ff;
}
.change-data-panel summary {
  cursor: pointer;
  font-weight: 600;
  color: #3949ab;
  font-size: .95rem;
  padding: .25rem 0;
  user-select: none;
}
.field-row { margin-bottom: .9rem; }
.field-row label {
  display: block;
  font-size: .85rem;
  color: #555;
  margin-bottom: .3rem;
  font-weight: 600;
}
.field-row input[type="text"],
.field-row select,
.field-row textarea {
  width: 100%;
  padding: .55rem .75rem;
  font-size: .95rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
  background: #fff;
}

/* ── Stat cards (admin panel) ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem 1rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 8px rgba(0,0,0,.04);
  border-top: 4px solid transparent;
  transition: box-shadow .15s;
}
.stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.stat-num   { font-size: 2.5rem; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: .8rem; color: #6b7280; margin-top: .4rem; font-weight: 500; }
.stat-total        { border-top-color: #1a73e8; } .stat-total .stat-num   { color: #1a73e8; }
.stat-ok           { border-top-color: #059669; } .stat-ok .stat-num      { color: #059669; }
.stat-pending-card { border-top-color: #d97706; } .stat-pending-card .stat-num { color: #d97706; }
.stat-unscan       { border-top-color: #dc2626; } .stat-unscan .stat-num  { color: #dc2626; }
.stat-bhp          { border-top-color: #7f1d1d; } .stat-bhp .stat-num     { color: #7f1d1d; }

/* ── Progress bar ─────────────────────────────────────────────────────────── */
.progress-wrap {
  height: 18px;
  background: #e8eaed;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: .5rem;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #34a853, #1e8e3e);
  border-radius: 10px;
  min-width: 2px;
  transition: width .4s ease;
}

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge-ok      { color: #059669; font-weight: 700; }
.badge-pending { color: #d97706; font-weight: 700; }
.badge-warn    { color: #d97706; font-weight: 600; }
.badge-danger  { color: #dc2626; font-weight: 700; }

/* ── QR scan (mobile-first) ───────────────────────────────────────────────── */
.qr-header {
  background: #fff;
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.qr-klucz       { font-size: .8rem; color: #888; margin-bottom: .25rem; }
.qr-device-name { font-size: 1.8rem; font-weight: 700; margin: .25rem 0; line-height: 1.2; }
.qr-model       { font-size: 1rem; color: #555; }
.qr-serial      { font-size: .9rem; color: #666; margin-top: .3rem; }
.qr-serial-label{ font-weight: 600; color: #444; }

.qr-owner-box {
  background: #e8f0fe;
  border-left: 5px solid #1a73e8;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}
.qr-owner-label { font-size: .85rem; color: #444; margin-bottom: .25rem; }
.qr-owner-name  { font-size: 1.35rem; font-weight: 700; color: #1a73e8; }

.btn-confirm {
  display: block;
  width: 100%;
  background: #34a853;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  margin-bottom: .5rem;
  box-shadow: 0 2px 6px rgba(52,168,83,.3);
}
.btn-confirm:hover { background: #2d9247; }

.btn-change {
  display: block;
  width: 100%;
  background: #f57c00;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: .85rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.btn-change:hover { background: #e66c00; }

.divider-or {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1rem 0;
  color: #888;
  font-size: .9rem;
}
.divider-or::before, .divider-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e0e0e0;
}

/* ── Table scroll wrapper ─────────────────────────────────────────────────── */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1.5rem;
  border-radius: 8px;
}
.table-scroll table { margin-bottom: 0; }

/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE — mobile-first
   Primary use-case: scan/device page on phones (360–430px wide)
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Phones: ≤ 640px ─────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Tighter container */
  main { margin: .5rem auto 2rem; padding: 0 .75rem; }

  /* Headings */
  h1 { font-size: 1.4rem; margin-bottom: .65rem; }
  h2 { font-size: 1.1rem; margin: 1rem 0 .5rem; }

  /* Nav: hide links, show hamburger */
  nav { padding: 0 .75rem; }
  .nav-brand { font-size: .92rem; margin-right: 0; }
  .btn-lang { margin-left: auto; }
  .nav-hamburger { display: flex; align-items: center; }

  /* Collapse: hidden by default, full-width dropdown when open */
  .nav-collapse {
    display: none;
    position: absolute;
    top: 52px; left: 0; right: 0;
    background: #1558b0;
    flex-direction: column;
    align-items: stretch;
    padding: .5rem 0 .75rem;
    z-index: 200;
    box-shadow: 0 6px 20px rgba(0,0,0,.35);
    border-top: 1px solid rgba(255,255,255,.2);
  }
  nav.nav-open .nav-collapse { display: flex; }
  .nav-collapse a  { padding: .9rem 1.25rem; height: auto; font-size: .97rem; border-bottom: 1px solid rgba(255,255,255,.1); }
  .nav-collapse .nav-user { max-width: none; margin-left: 0; font-size: .87rem; padding: .75rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,.1); }
  .nav-collapse #logout-btn { margin: .65rem 1rem 0; width: calc(100% - 2rem); display: block; text-align: center; }

  /* Scan CTA: full width on mobile */
  .scan-cta-btn { max-width: none; }

  /* dl: stack label above value — works great on scan page */
  dl { grid-template-columns: 1fr; gap: 0; }
  dt {
    font-size: .7rem;
    font-weight: 700;
    color: #777;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-top: .65rem;
    margin-bottom: .1rem;
  }
  .item-info dt:first-child { margin-top: 0; }
  dd { padding-bottom: .35rem; font-size: .95rem; }

  /* Table cells: tighter */
  th, td { padding: .45rem .6rem; font-size: .82rem; }

  /* Hide less important columns in device list tables on mobile */
  .devices-table .col-dept,
  .devices-table .col-serial { display: none; }

  /* Admin toolbar: wrap */
  .admin-toolbar { gap: .5rem; }
  .admin-toolbar > button,
  .admin-toolbar > a { font-size: .85rem; padding: .45rem .75rem; }

  /* Stats cards: 2-column grid */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
  .stat-card  { padding: .9rem .6rem; }
  .stat-num   { font-size: 1.9rem; }
  .stat-label { font-size: .75rem; }

  /* QR / scan page header */
  .qr-header      { padding: 1rem; }
  .qr-device-name { font-size: 1.45rem; }
  .qr-model       { font-size: .93rem; }
  .item-info      { padding: 1rem; }

  /* Ownership box */
  .ownership-box  { padding: .85rem 1rem; gap: .75rem; font-size: .92rem; }
  .ownership-icon { font-size: 1.5rem; }

  /* Action buttons: tall enough for thumbs */
  .btn-primary-action   { padding: 1.1rem 1rem; font-size: 1rem; border-radius: 12px; }
  .btn-secondary-action { padding: 1rem 1rem; font-size: .95rem; border-radius: 12px; }
  .btn-warn-action      { padding: 1rem 1rem; font-size: .95rem; border-radius: 12px; }
  .btn-warehouse        { padding: .9rem; font-size: .95rem; }
  .btn-admin-save       { padding: 1rem; font-size: .95rem; }

  /* Admin edit panel */
  .admin-edit-panel   { padding: .75rem; margin-top: 1rem; }
  .admin-warehouse-box{ margin-top: 1.25rem; }

  /* Field rows: larger inputs for touch */
  .field-row input[type="text"],
  .field-row select,
  .field-row textarea { font-size: 1rem; padding: .65rem .75rem; }

  /* Footer: less padding */
  footer { padding: 1rem; }
}

/* ── Tablets: 641–960px ──────────────────────────────────────────────────── */
@media (min-width: 641px) and (max-width: 960px) {
  main { padding: 0 1rem; }

  /* On tablets, hide only the ID and Serial No columns */
  .devices-table .col-serial { display: none; }

  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Ownership indicator (scan page) ─────────────────────────────────────── */
.ownership-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  margin-bottom: 1.25rem;
  font-size: .97rem;
}
.ownership-mine       { background: #ecfdf5; border: 2px solid #059669; }
.ownership-unassigned { background: #fffbeb; border: 2px solid #d97706; }
.ownership-other      { background: #fef2f2; border: 2px solid #dc2626; }

/* CSS-only ownership icon: a coloured circle with a symbol */
.ownership-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 900;
  flex-shrink: 0;
  line-height: 1;
}
.ownership-mine .ownership-icon       { background: #059669; color: #fff; }
.ownership-mine .ownership-icon::before       { content: '\2713'; }  /* check */
.ownership-unassigned .ownership-icon { background: #d97706; color: #fff; }
.ownership-unassigned .ownership-icon::before { content: '!'; }
.ownership-other .ownership-icon      { background: #dc2626; color: #fff; }
.ownership-other .ownership-icon::before      { content: '\2717'; }  /* cross */

.ownership-text { line-height: 1.5; }
.ownership-text strong { display: block; margin-bottom: .15rem; }

/* ── Action buttons (scan page — employee) ───────────────────────────────── */
#action-area { display: flex; flex-direction: column; gap: .6rem; margin-top: .25rem; }

.btn-primary-action {
  display: block;
  width: 100%;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 2px 6px rgba(26,115,232,.3);
  transition: background .15s;
}
.btn-primary-action:hover    { background: #1558c0; }
.btn-primary-action:disabled { background: #b0bec5; cursor: default; }

.btn-secondary-action {
  display: block;
  width: 100%;
  background: #fff;
  color: #ea4335;
  border: 2px solid #ea4335;
  border-radius: 10px;
  padding: .85rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background .15s, color .15s;
}
.btn-secondary-action:hover { background: #fce8e6; }

.btn-warn-action {
  display: block;
  width: 100%;
  background: #f57c00;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: .85rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.btn-warn-action:hover { background: #e66c00; }

/* ── Report problem section (scan page) ─────────────────────────────────── */
.problem-report-section {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px dashed #d1d5db;
}
.btn-problem-toggle {
  display: block;
  width: 100%;
  padding: .65rem 1rem;
  background: transparent;
  color: #6b7280;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: .9rem;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  text-align: center;
}
.btn-problem-toggle:hover {
  border-color: #f59e0b;
  color: #92400e;
}

.action-note {
  font-size: .82rem;
  color: #888;
  text-align: center;
  margin: .25rem 0 0;
}

/* ── Admin edit panel (scan page) ────────────────────────────────────────── */
.admin-edit-panel {
  margin-top: 1.5rem;
  border: 2px solid #1a73e8;
  border-radius: 10px;
  padding: .85rem 1rem;
  background: #f0f6ff;
}
.admin-edit-panel summary {
  cursor: pointer;
  font-weight: 700;
  color: #1565c0;
  font-size: 1rem;
  padding: .2rem 0;
  user-select: none;
}

.btn-admin-save {
  display: block;
  width: 100%;
  background: #1565c0;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: .85rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: .5rem;
  transition: background .15s;
}
.btn-admin-save:hover { background: #0d47a1; }

/* ── Admin: confirm location (quick status → confirmed) ──────────────────────*/
.admin-confirm-location-box {
  margin: 1.25rem 0;
  padding: 1rem 1.1rem;
  background: #f0fdf4;
  border: 2px solid #86efac;
  border-radius: 10px;
}
.btn-confirm-location {
  display: block;
  width: 100%;
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: .9rem 1.2rem;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
  letter-spacing: .01em;
}
.btn-confirm-location:hover    { background: #15803d; }
.btn-confirm-location:disabled { opacity: .65; cursor: default; }
.admin-confirm-location-sub {
  font-size: .78rem;
  color: #166534;
  margin-top: .45rem;
  text-align: center;
}

.field-hint {
  display: block;
  font-size: .78rem;
  color: #6b7280;
  margin-top: .25rem;
}


  font-size: .8rem;
  font-weight: 700;
  color: #b71c1c;
  margin-bottom: .5rem;
  letter-spacing: .05em;
}

/* ── Scan next device button ──────────────────────────────────────────────────*/
.btn-scan-next {
  display: block;
  flex: 1;
  min-width: 120px;
  margin-top: 0;
  padding: .8rem 1.1rem;
  background: #f6f8fa;
  color: #374151;
  border: 2px solid #d0d5dd;
  border-radius: 10px;
  font-size: .97rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.btn-scan-next:hover { background: #eaecef; border-color: #9ca3af; text-decoration: none; }

/* ── Dashboard scan CTA ───────────────────────────────────────────────────────*/
.scan-cta {
  margin-bottom: 1.5rem;
}
.scan-cta-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.4rem;
  background: #1558b0;
  color: #fff;
  border-radius: 12px;
  text-decoration: none;
  font-size: 1rem;
  transition: background .15s;
  max-width: 420px;
}
.scan-cta-btn:hover { background: #0f4490; text-decoration: none; color: #fff; }
.scan-cta-btn strong { display: block; font-size: 1.05rem; }
.scan-cta-btn small { font-size: .82rem; opacity: .85; }
.scan-cta-icon {
  flex-shrink: 0;
  width: 2.4rem;
  height: 2.4rem;
  background: rgba(255,255,255,.18);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* QR code icon drawn with CSS box-shadow trick */
.scan-cta-icon::before {
  content: '';
  display: block;
  width: 1.3rem;
  height: 1.3rem;
  border: 3px solid #fff;
  border-radius: 2px;
  box-shadow: inset 0 0 0 2px #1558b0, inset 3px 3px 0 2px #fff;
}

/* ── Camera required / blocked screen ───────────────────────────────────── */
.cam-required-box {
  background: #fff8f0;
  border: 2px solid #f59e0b;
  border-radius: 12px;
  padding: 1.5rem 1.25rem;
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}
.cam-required-icon {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: .75rem;
}
.cam-required-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #92400e;
  margin: 0 0 .6rem;
}
.cam-required-desc {
  color: #374151;
  font-size: .95rem;
  line-height: 1.5;
  margin: 0 0 1rem;
}
.cam-required-steps {
  text-align: left;
  margin: 0 0 1.25rem;
  padding-left: 1.4rem;
  color: #374151;
  font-size: .93rem;
  line-height: 1.7;
}
.cam-required-btn {
  display: block;
  width: 100%;
  padding: .85rem 1rem;
  background: #1558b0;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.cam-required-btn:hover { background: #0f4490; }

/* ── Status boxes (confirmed / pending) ─────────────────────────────────── */
.status-box {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  font-size: .97rem;
  line-height: 1.5;
}
.status-box-icon {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  font-weight: 900;
  flex-shrink: 0;
  margin-top: .1rem;
}
.status-confirmed { background: #ecfdf5; border: 2px solid #059669; }
.status-confirmed strong { color: #065f46; }
.status-confirmed .status-box-icon { background: #059669; color: #fff; }
.status-confirmed .status-box-icon::before { content: '\2713'; }
.status-pending   { background: #fffbeb; border: 2px solid #d97706; }
.status-pending strong { color: #92400e; }
.status-pending .status-box-icon { background: #d97706; color: #fff; }
.status-pending .status-box-icon::before { content: '!'; }
.status-must-scan { background: #fff7ed; border: 2px solid #ea580c; }
.status-must-scan strong { color: #9a3412; }
.status-must-scan .status-box-icon { background: #ea580c; color: #fff; }
.status-must-scan .status-box-icon::before { content: 'i'; }

/* -- Clickable device row --------------------------------------------------- */
.device-row {
  cursor: pointer;
  transition: background .12s;
}
.device-row:hover { background: #f0f4ff; }
.device-row:active { background: #e3eafd; }

/* Status chips in device table */
.status-chip {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
}
.status-chip-ok       { background: #dcfce7; color: #166534; }
.status-chip-pending  { background: #fff3cd; color: #92400e; border: 1px solid #fbbf24; }
.status-chip-awaiting { background: #eff6ff; color: #1d4ed8; }

.chip-warn-icon { margin-right: .25em; font-style: normal; }

/* ── Scan nav actions (back + next) ──────────────────────────────────────────*/
.scan-nav-actions {
  display: flex;
  gap: .75rem;
  margin-top: .75rem;
  flex-wrap: wrap;
}
.btn-back-home {
  flex: 1;
  min-width: 120px;
  padding: .8rem 1.1rem;
  background: #f0f4ff;
  color: #2563eb;
  border: 2px solid #bfdbfe;
  border-radius: 10px;
  font-size: .97rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: background .15s;
}
.btn-back-home:hover { background: #dbeafe; text-decoration: none; }

/* ── Dashboard confirm notice ────────────────────────────────────────────────*/
.confirm-notice {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .8rem 1rem;
  margin-bottom: 1rem;
  background: #fffbeb;
  border: 1.5px solid #fbbf24;
  border-radius: 8px;
  font-size: .93rem;
  color: #92400e;
  font-weight: 500;
}
.confirm-notice-icon { font-size: 1.1em; flex-shrink: 0; margin-top: .05em; }

/* ── Dashboard device row — needs action ────────────────────────────────────*/
.device-row-needs-action td:first-child::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
  margin-right: .45rem;
  vertical-align: middle;
}

/* ── Dashboard — missing device section ─────────────────────────────────────*/
.missing-device-section {
  margin-top: 2rem;
  border-top: 2px dashed #d1d5db;
  padding-top: 1.25rem;
}
.btn-missing-toggle {
  background: none;
  border: 2px dashed #9ca3af;
  color: #4b5563;
  border-radius: 8px;
  padding: .65rem 1.1rem;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  width: 100%;
  text-align: left;
}
.btn-missing-toggle:hover,
.btn-missing-toggle.active {
  border-color: #2563eb;
  color: #1d4ed8;
}
.missing-device-form {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.missing-device-desc {
  font-size: .93rem;
  color: #374151;
  margin-bottom: 1rem;
}
.missing-device-form label {
  display: block;
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: .35rem;
  color: #1f2937;
}
.missing-device-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: .65rem .85rem;
  border: 1.5px solid #d1d5db;
  border-radius: 7px;
  font-size: .95rem;
  font-family: inherit;
  resize: vertical;
  margin-bottom: .75rem;
}
.missing-device-actions {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}

