/* =========================================================
   QR DASHBOARD — PAGE-SPECIFIC STYLES
   Used only by qrproject_dashboard.html.
   Base layout/theme from app.css; this file adds QR dashboard only.
========================================================= */

/* ===== Page layout (QR dashboard) ===== */
.page-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
}

.page-title{
  margin:0 0 6px 0;
  font-size:30px;
  color: rgba(245,230,207,.98);
  text-shadow: 0 14px 34px rgba(0,0,0,.55);
  letter-spacing: -0.3px;
}

.sub{
  margin:0 0 22px 0;
  color: var(--muted);
  font-size:14px;
  line-height:1.45;
  max-width: 860px;
}

@media (max-width: 780px){
  .page{
    background-attachment: scroll;
    background-image:
      radial-gradient(900px 540px at 55% 25%, rgba(255,150,40,.20), rgba(0,0,0,0) 60%),
      linear-gradient(180deg, rgba(0,0,0,.12), rgba(0,0,0,.72)),
      url("/images/bg-home-embers-mobile.jpg");
  }
}

/* ===== Action buttons ===== */
#loadProjectsBtn{
  background: linear-gradient(180deg, rgba(255,168,68,1), rgba(255,120,20,1));
  color: #1b0b00;
  border: 1px solid rgba(255,170,60,.55);
  box-shadow: 0 14px 30px rgba(255,120,20,.20);
}

#openCreateModalBtn.secondary{
  background: rgba(15,20,32,.65);
  color: rgba(245,230,207,.92);
  border: 1px solid rgba(255,170,60,.20);
}

#openCreateModalBtn.secondary:hover{
  background: rgba(15,20,32,.78);
  border-color: rgba(255,170,60,.32);
}

/* ===== Card overrides (QR dashboard) ===== */
.page-inner .card{
  overflow:hidden;
  position:relative;
  margin-bottom:22px;
}

.page-inner .card::before{
  content:"";
  position:absolute;
  inset:-60px -60px auto -60px;
  height: 190px;
  background: radial-gradient(circle at 30% 40%, rgba(255,140,40,.18), rgba(0,0,0,0));
  pointer-events:none;
}

.page-inner .card h2{
  margin:0 0 12px 0;
  font-size:18px;
  color: rgba(245,230,207,.96);
  display:flex;
  align-items:center;
  gap:10px;
  position:relative;
  z-index:1;
}

.pill{
  display:inline-block;
  padding:2px 10px;
  border-radius:999px;
  background: rgba(255,170,60,.16);
  font-size:12px;
  color: rgba(245,230,207,.92);
  border: 1px solid rgba(255,170,60,.20);
}

.pill.tracked{
  font-weight: 800;
}

.actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin:10px 0 12px;
  position:relative;
  z-index:1;
}

/* ===== Buttons (table / modal) ===== */
button{
  padding:10px 14px;
  background: var(--orange);
  color:#1b0b00;
  border:1px solid rgba(255,170,60,.45);
  border-radius:12px;
  cursor:pointer;
  font-size:14px;
  font-weight:900;
  box-shadow: 0 10px 22px rgba(255,120,20,.16);
}

button:hover{
  background: #ff9a35;
}

button.secondary{
  background: rgba(15,20,32,.65);
  color: rgba(245,230,207,.92);
  border: 1px solid rgba(255,170,60,.20);
  box-shadow:none;
}

button.secondary:hover{
  background: rgba(15,20,32,.78);
  border-color: rgba(255,170,60,.32);
}

button.ghost{
  background: rgba(0,0,0,.20);
  color: rgba(245,230,207,.92);
  border: 1px solid rgba(255,170,60,.18);
  box-shadow:none;
}

button.ghost:hover{
  background: rgba(0,0,0,.28);
  border-color: rgba(255,170,60,.32);
}

/* ===== Destination column ===== */
.destination-cell{
  max-width: 320px;
  font-size: 13px;
  line-height: 1.3;
  word-break: break-all;
  color: rgba(245,230,207,.90);
}

.destination-cell a{
  color: rgba(255,190,120,.95);
  text-decoration:none;
  font-weight: 800;
}

.destination-cell a:hover{
  text-decoration:underline;
}

/* ===== Table (QR dashboard) ===== */
.table-scroll{
  width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling: touch;
}

.page-inner .table-scroll table{
  min-width: 860px;
  position:relative;
  z-index:1;
}

.page-inner .table-scroll th,
.page-inner .table-scroll td{
  padding:10px;
  border-bottom:1px solid rgba(255,170,60,.10);
  text-align:left;
  vertical-align:top;
  color: rgba(245,230,207,.92);
  word-break: normal;
  overflow-wrap: break-word;
  white-space: normal;
}

.page-inner .table-scroll th{
  background: rgba(6,8,12,.40);
  color: rgba(245,230,207,.95);
  font-weight: 900;
  border-bottom: 1px solid rgba(255,170,60,.18);
}

.small{
  font-size:12px;
  color: var(--muted);
  margin-top:8px;
}

.info-line{
  font-size:13px;
  color: rgba(245,230,207,.92);
  margin: 6px 0 0;
}

/* ===== Scan badges ===== */
.icon-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  border-radius:10px;
  border:1px solid rgba(255,170,60,.18);
  background: rgba(0,0,0,.18);
  cursor:pointer;
  padding:0;
  color: rgba(245,230,207,.92);
}

.icon-btn:hover{
  background: rgba(0,0,0,.26);
  border-color: rgba(255,170,60,.30);
}

.icon{
  font-size:16px;
  line-height:1;
}

.scan-badge{
  display:inline-block;
  min-width:34px;
  text-align:center;
  padding:2px 8px;
  border-radius:999px;
  background: rgba(255,170,60,.16);
  font-size:12px;
  color: rgba(245,230,207,.92);
  border: 1px solid rgba(255,170,60,.20);
}

.mailing-btn{
  padding:6px 10px;
  font-size:13px;
  border-radius:10px;
  white-space:nowrap;
}

/* ===== Modal (QR dashboard create/scan) ===== */
.modal-overlay{
  display:none;
  padding:18px;
  backdrop-filter: blur(4px);
  z-index:1000;
}

.modal-overlay[aria-hidden="false"],
.modal-overlay[style*="flex"]{
  display:flex !important;
}

.modal{
  width:min(1100px, 96vw);
  max-height:86vh;
  overflow:hidden;
  background: #0c0a0e;
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(0,0,0,.65);
  border: 1px solid rgba(255,170,60,.22);
  display:flex;
  flex-direction:column;
}

.modal.small{
  width:min(820px, 96vw);
}

.modal-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  border-bottom: 1px solid rgba(255,170,60,.16);
  background: rgba(6,8,12,.35);
}

.modal-title{
  margin:0;
  font-size:16px;
  color: rgba(245,230,207,.96);
  font-weight: 900;
}

.modal-sub{
  font-size:12px;
  color: var(--muted);
  margin-top:2px;
}

.modal-body{
  padding:10px 16px 16px;
  overflow:auto;
}

.close-btn{
  padding:8px 10px;
  border-radius:10px;
  border: 1px solid rgba(255,170,60,.18);
  background: rgba(0,0,0,.18);
  cursor:pointer;
  color: rgba(245,230,207,.92);
  font-weight: 900;
}

.close-btn:hover{
  background: rgba(0,0,0,.26);
  border-color: rgba(255,170,60,.30);
}

#scanModalTable td:nth-child(4){
  white-space: normal;
  word-break: break-word;
}

/* ===== Form inside modal ===== */
.form-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}

@media (max-width: 780px){
  .form-grid{
    grid-template-columns: 1fr;
  }
}

.modal-body input,
.modal-body select,
.modal-body textarea{
  width:100%;
  padding:10px;
  margin-bottom:10px;
  border-radius:12px;
  border: 1px solid rgba(255,170,60,.18);
  box-sizing:border-box;
  background: rgba(255,255,255,.06);
  color: rgba(245,230,207,.92);
  font-family: inherit;
  font-size:14px;
  outline:none;
}

.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus{
  border-color: rgba(255,170,60,.38);
  box-shadow: 0 0 0 4px rgba(255,120,20,.12);
}

.modal-body label{
  font-size:12px;
  color: var(--muted);
  display:block;
  margin:8px 0 6px;
}

.modal-body textarea{
  min-height:90px;
  resize:vertical;
}

.modal-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin-top:8px;
}

/* ===== QR preview bubble ===== */
.qr-wrap{
  position: relative;
  display:inline-block;
}

.qr-img{
  width:88px;
  height:88px;
  border-radius:10px;
  border: 1px solid rgba(255,170,60,.14);
  background: rgba(255,255,255,.06);
}

.qr-edit-bubble{
  position:absolute;
  left:-14px;
  top:50%;
  transform: translateY(-50%);
  width:26px;
  height:26px;
  border-radius:999px;
  border: 1px solid rgba(255,170,60,.40);
  background: linear-gradient(180deg, rgba(255,168,68,1), rgba(255,120,20,1));
  color:#1b0b00;
  font-size:13px;
  cursor:pointer;
  box-shadow: 0 8px 16px rgba(0,0,0,.35);
  z-index:2;
  opacity:0;
  transition: opacity .15s ease;
}

.qr-edit-bubble:hover{
  filter: brightness(1.05);
}

.qr-wrap:hover .qr-edit-bubble{
  opacity:1;
}

/* ===== Create modal: date picker and select ===== */
.dark-date{
  color: #fff;
  background-color: #1a1a1a;
}

.dark-date::-webkit-calendar-picker-indicator{
  filter: invert(1);
  opacity: 1;
  cursor: pointer;
}

.dark-select{
  color: #000;
  background-color: #fff;
}

.dark-select option{
  color: #000;
}
