html,
body {
    height: 100%;
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* =========================
   Z-INDEX LAYERS (IMPORTANT)
   ========================= */
:root {
    --z-banner: 20000;
    --z-menu: 15000;
    --z-scanner: 9999;
}

/* =========================
   OFFLINE BANNER
   ========================= */
#offlineBanner {
    display: none;
    background: #e74c3c;
    color: white;
    text-align: center;
    padding: 10px;
    font-weight: bold;

    position: fixed;
    top: 0;
    left: 0;
    right: 0;

    z-index: var(--z-banner);
}

/* =========================
   MAIN LAYOUT
   ========================= */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 20px;

    margin-top: 60px;
}

/* =========================
   INPUT
   ========================= */
#barcodeInput {
    width: 100%;
    max-width: 400px;
    font-size: 1.5rem;
    padding: 18px;
    border-radius: 14px;
    border: 2px solid #ddd;
    text-align: center;
    margin-bottom: 20px;
}

/* =========================
   RESULT CARD
   ========================= */
#result {
    width: 100%;
    max-width: 500px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;

    padding: 40px 20px;
    flex: 1 1 auto;
    margin-bottom: 15px;
    box-sizing: border-box;
}

/* =========================
   BUTTONS
   ========================= */
#buttonsContainer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 400px;
}

button {
    font-size: 1.2rem;
    padding: 14px 20px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    width: 100%;
}

#scansBtn {
    background: #3498db;
    color: white;
}

#scansBtn:hover {
    background: #2980b9;
}

#logoutBtn {
    background: #e67e22;
    color: white;
}

#logoutBtn:hover {
    background: #d35400;
}

/* =========================
   HAMBURGER MENU
   ========================= */
#hamburger {
    position: fixed;
    top: 10px;
    right: 10px;

    font-size: 28px;
    cursor: pointer;

    z-index: var(--z-menu);
}

/* dropdown */
#dropdownMenu {
    position: fixed;
    top: 45px;
    right: 10px;

    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);

    display: flex;
    flex-direction: column;
    min-width: 120px;

    z-index: var(--z-menu);
}

#dropdownMenu button {
    padding: 10px;
    border: none;
    background: white;
    text-align: left;
    cursor: pointer;
}

#dropdownMenu button:hover {
    background: #f2f2f2;
}

/* =========================
   SCANNER OVERLAY
   ========================= */
#scannerOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;

    background: rgba(0, 0, 0, 0.85);

    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;

    z-index: var(--z-scanner);
}

#reader {
    width: 90%;
    max-width: 400px;
}

#closeScanner {
    position: absolute;
    top: 20px;
    right: 20px;

    font-size: 1.5rem;
    background: rgba(0, 0, 0, 0.6);
    color: white;

    border-radius: 50%;
    width: 50px;
    height: 50px;
}

/* =========================
   UTILITIES
   ========================= */
.hidden {
    display: none !important;
}

/* =========================
   MOBILE TWEAKS
   ========================= */
@media (max-width: 450px) {
    #barcodeInput,
    #result,
    button {
        font-size: 1.1rem;
        padding: 12px;
    }
}

.disabled {
  pointer-events: none;
  opacity: 0.4;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-content {
  background: white;
  width: 90%;
  max-width: 400px;
  padding: 20px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}