/* =========================================================
   RCFA Industrial Core Theme
   ========================================================= */

:root{
  --bg-main:#0b0f14;
  --bg-soft:#111827;
  --card:#141b23;
  --card-2:#101720;

  --border:#1f2937;

  --text-main:#e5e7eb;
  --text-muted:#9ca3af;

  --blue:#3b82f6;
  --green:#22c55e;
  --red:#ef4444;
  --amber:#f59e0b;

  --radius:14px;
  --shadow: 0 20px 60px rgba(0,0,0,.35);
}

/* Base */
body{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  margin:0;
  background:
    radial-gradient(1000px 600px at 10% -10%, rgba(59,130,246,.12), transparent 50%),
    radial-gradient(900px 500px at 90% 0%, rgba(34,197,94,.10), transparent 50%),
    linear-gradient(180deg, var(--bg-main), #0e131a);
  color: var(--text-main);
}

/* Topbar */
.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 20px;
  background: rgba(11,15,20,.8);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--border);
}

.brand{
  font-weight:900;
  letter-spacing:1px;
}

/* =========================
   Top Navigation (Enterprise Clean)
   ========================= */

.nav{
  display:flex;
  align-items:center;
  gap:28px;
}

.navLink{
  text-decoration:none;
  color:var(--text-muted);
  font-size:14px;
  font-weight:700;
  letter-spacing:.6px;
  text-transform:uppercase;
  padding:6px 4px;
  position:relative;
  transition: color .15s ease;
}

.navLink:hover{
  color:var(--text-main);
}

.navLink::after{
  content:"";
  position:absolute;
  left:0;
  bottom:-6px;
  width:0%;
  height:2px;
  background:var(--blue);
  transition: width .18s ease;
}

.navLink:hover::after{
  width:100%;
}

.navAdmin{
  color:#ffd98f;
}

.navAdmin::after{
  background:var(--amber);
}

/* Layout */
.container{
  padding:20px;
  max-width:1200px;
  margin:0 auto;
}

/* Cards */
.card{
  background:linear-gradient(180deg, var(--card), var(--card-2));
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:18px;
  margin-top:14px;
  box-shadow: var(--shadow);
}

/* =========================
   Main Portal Login (Optional)
   ========================= */
.portalCard{
  max-width: 440px;
  margin: 120px auto;
}

.portalCard h2{
  margin: 0 0 10px;
  font-size: 22px;
  letter-spacing: .8px;
}

.portalCard .muted{
  margin-bottom: 14px;
}

/* Grid */
.grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap:16px;
}

.grid2{
  display:grid;
  grid-template-columns: 1fr 420px;
  gap:18px;
  align-items:start;
}

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

/* Buttons */
button{
  background: var(--blue);
  color:#fff;
  border:none;
  padding:10px 16px;
  border-radius:12px;
  font-weight:700;
  cursor:pointer;
  transition:.15s;
}

button:hover{
  background:#2563eb;
}

button:disabled{
  opacity:.5;
  cursor:not-allowed;
}

/* Inputs */
input, select{
  background:#0f1722;
  border:1px solid var(--border);
  color:var(--text-main);
  padding:10px;
  border-radius:12px;
  font-size:15px;
}

/* Status Colors */
.ok{ color: var(--green); font-weight:800; }
.bad{ color: var(--red); font-weight:800; }
.muted{ color: var(--text-muted); }

/* Lists */
.list{
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px;
  max-height:260px;
  overflow:auto;
  background:rgba(255,255,255,.02);
}

.itemRow{
  display:flex;
  justify-content:space-between;
  padding:10px 8px;
  border-bottom:1px solid var(--border);
}

/* =========================================================
   Pack Station - Industrial Checklist Layout
   LOT (left) + ITEM # (top) + Description (below)
   ========================================================= */

.itemRow{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  padding:14px 12px;
  border-bottom:1px solid var(--border);
  transition: background .12s ease;
}

.itemRow:hover{
  background: rgba(255,255,255,.03);
}

.itemLeft{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}

.lotPill{
  min-width:92px;
  height:46px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:12px;
  font-weight:900;
  letter-spacing:1px;
  font-size:16px;
  border:2px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.25);
}

.itemMain{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:0;
}

.itemNo{
  font-size:16px;
  font-weight:900;
  letter-spacing:.8px;
  text-transform:uppercase;
}

.itemTitle{
  font-size:14px;
  font-weight:700;
  color: var(--text-muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width: 54vw;
}

.itemRight{
  margin-left:auto;
  font-weight:900;
  font-size:14px;
  white-space:nowrap;
}

/* Flash */
.flash{
  padding:12px;
  border-radius:12px;
  margin-top:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.03);
}

.flash.success{
  border-color:rgba(34,197,94,.4);
  background:rgba(34,197,94,.1);
}

.flash.error{
  border-color:rgba(239,68,68,.4);
  background:rgba(239,68,68,.1);
}

/* Video */
video{
  width:100%;
  max-width:420px;
  border-radius:14px;
  border:1px solid var(--border);
  background:#000;
}

/* Modal */
.modal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.7);
  display:none;                /* ✅ HIDDEN BY DEFAULT */
  align-items:center;
  justify-content:center;
  padding:20px;
  z-index: 10000;              /* ✅ Always on top */
}

.modal.show{
  display:flex;                /* ✅ Only visible when JS adds .show */
}

.modalInner{
  background:var(--card);
  border-radius:16px;
  padding:18px;
  width:min(520px,100%);
  border:1px solid var(--border);
}

/* =========================
   Artsy Home Screen
   ========================= */
.hero{
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 22px;
  background: radial-gradient(1200px 600px at 20% 10%, rgba(255,255,255,.16), rgba(255,255,255,0)),
              radial-gradient(900px 500px at 80% 0%, rgba(255,255,255,.10), rgba(255,255,255,0)),
              linear-gradient(135deg, #0f0f12 0%, #151523 35%, #0f1117 100%);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  color: #fff;
}

.heroGlow{
  position:absolute;
  inset:-2px;
  background:
    radial-gradient(600px 300px at 15% 20%, rgba(255,255,255,.12), rgba(255,255,255,0)),
    radial-gradient(500px 260px at 85% 30%, rgba(255,255,255,.10), rgba(255,255,255,0));
  pointer-events:none;
  filter: blur(0px);
}

.heroTop{ position: relative; z-index: 1; }
.heroBadge{
  display:inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.14);
  font-weight: 700;
  letter-spacing: .2px;
  font-size: 12px;
}
.heroTitle{
  margin-top: 10px;
  font-size: 40px;
  line-height: 1.0;
  font-weight: 900;
  letter-spacing: .5px;
}
.heroSub{
  margin-top: 8px;
  max-width: 720px;
  color: rgba(255,255,255,.82);
  font-size: 14px;
}
.heroSubDot{ opacity:.6; margin: 0 6px; }

.heroGrid{
  position: relative;
  z-index: 1;
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 900px){
  .heroGrid{ grid-template-columns: 1fr; }
  .heroTitle{ font-size: 34px; }
}

.heroCard{
  display:block;
  text-decoration:none;
  color:#fff;
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  box-shadow: 0 10px 25px rgba(0,0,0,.25);
  transition: transform .08s ease, background .12s ease, border-color .12s ease;
}
.heroCard:hover{
  transform: translateY(-2px);
  background: rgba(255,255,255,.09);
  border-color: rgba(255,255,255,.22);
}
.heroCard:active{ transform: translateY(0px); }

.heroCardIcon{
  font-size: 28px;
  line-height: 1;
}
.heroCardTitle{
  margin-top: 10px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .6px;
}
.heroCardSub{
  margin-top: 6px;
  color: rgba(255,255,255,.78);
  font-size: 13px;
}
.heroCardCTA{
  margin-top: 12px;
  font-weight: 800;
  font-size: 13px;
  opacity: .95;
}

.heroCardPack{
  background:
    radial-gradient(600px 250px at 15% 10%, rgba(255,255,255,.12), rgba(255,255,255,0)),
    linear-gradient(135deg, rgba(0,0,0,.10), rgba(0,0,0,0)),
    rgba(255,255,255,.06);
}

.heroCardAdmin{
  background:
    radial-gradient(600px 250px at 15% 10%, rgba(255,255,255,.10), rgba(255,255,255,0)),
    linear-gradient(135deg, rgba(0,0,0,.10), rgba(0,0,0,0)),
    rgba(255,255,255,.06);
}

.heroCardLabel{
  background:
    radial-gradient(600px 250px at 15% 10%, rgba(255,255,255,.10), rgba(255,255,255,0)),
    linear-gradient(135deg, rgba(0,0,0,.10), rgba(0,0,0,0)),
    rgba(255,255,255,.06);
}

.heroCardOffice{
  background:
    radial-gradient(600px 250px at 15% 10%, rgba(255,255,255,.10), rgba(255,255,255,0)),
    linear-gradient(135deg, rgba(0,0,0,.10), rgba(0,0,0,0)),
    rgba(255,255,255,.06);
}

.heroFooter{
  position: relative;
  z-index: 1;
  margin-top: 16px;
}
.heroFooterPill{
  display:inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.78);
  font-size: 12px;
}

/* =========================
   Action Dropdown (Pack Station) - Industrial
   ========================= */

.dropdown{ position: relative; }

.dropdown-toggle{
  background: rgba(255,255,255,.04);
  color: var(--text-main);
  border: 1px solid var(--border);
  font-weight: 800;
}

.dropdown-toggle:hover{
  background: rgba(255,255,255,.07);
}

.dropdown-menu{
  position:absolute;
  right:0;
  top: calc(100% + 8px);
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--border);
  border-radius: 14px;
  min-width: 210px;
  padding: 8px;
  box-shadow: var(--shadow);
  z-index: 100;
}

.dropdown-item{
  width:100%;
  text-align:left;
  background: transparent;
  border: 1px solid transparent;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  cursor:pointer;
  color: var(--text-main);
}

.dropdown-item:hover{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.06);
}

.dropdown-item.danger{
  color: #fecaca; /* softer red for dark UI */
}

.dropdown-item.danger:hover{
  background: rgba(239,68,68,.10);
  border-color: rgba(239,68,68,.18);
}

/* =========================================================
   Big Scan Feedback (TC56)
   ========================================================= */

#scanFeedback{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  z-index:9999;
  font-weight:900;
  text-align:center;
  backdrop-filter: blur(4px);
}

#scanFeedback.ok{
  background:rgba(34,197,94,.15);
}

#scanFeedback.bad{
  background:rgba(239,68,68,.18);
}

#scanIcon{
  font-size:120px;
}

#scanHeadline{
  font-size:36px;
  margin-top:10px;
}

#scanItemNumber{
  font-size:22px;
  margin-top:6px;
  color:var(--text-muted);
}

/* =========================
   KPI Trend Arrows
   ========================= */

.kpi-value-wrap{
  display:flex;
  align-items:baseline;
  gap:12px;
}

.kpi-trend{
  display:flex;
  align-items:baseline;
  gap:6px;
  font-weight:800;
  font-size:13px;
  opacity:.95;
}

.kpi-trend-sub{
  font-weight:600;
  font-size:11px;
  opacity:.65;
  margin-left:6px;
}

.kpi-trend.up{ color: var(--green); }
.kpi-trend.down{ color: var(--red); }
.kpi-trend.flat{ color: var(--text-muted); }

/* =========================
   Admin Dashboard (Command Center)
   ========================= */

.dashboard-header h1{
  margin: 8px 0 2px;
  font-size: 28px;
  letter-spacing: 1px;
}

.kpi-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.kpi-card{
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.kpi-card.highlight{ border-left: 4px solid var(--green); }
.kpi-card.danger{ border-left: 4px solid var(--red); }

.kpi-label{
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
}

.kpi-value{
  font-size: 30px;
  font-weight: 900;
  margin-top: 6px;
}

.grid-2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

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

.dark-table{
  width:100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.dark-table th,
.dark-table td{
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}

.dark-table th{
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .6px;
}

.trend-row{
  display:flex;
  justify-content:space-between;
  padding: 10px 6px;
  border-bottom: 1px solid var(--border);
}

.quick-actions{
  margin-top: 18px;
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-btn{
  text-decoration:none;
  display:inline-block;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(59,130,246,.35);
  background: rgba(59,130,246,.12);
  font-weight: 900;
}

.action-btn:hover{
  background: rgba(59,130,246,.18);
}

/* =========================================================
   Pack Station - Checklist Layout (Warehouse-First)
   LOT (left pill) • ITEM # (top) • Description (below)
   ========================================================= */

/* Override the simple .itemRow earlier in this file */
.itemRow{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  padding:14px 12px;
  border-bottom:1px solid var(--border);
  transition: background .12s ease;
}

.itemRow:hover{
  background: rgba(255,255,255,.03);
}

.itemLeft{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}

.lotPill{
  min-width:92px;
  height:46px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:12px;
  font-weight:900;
  letter-spacing:1px;
  font-size:16px;
  border:2px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.25);
  flex: 0 0 auto;
}

.itemMain{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:0;
}

.itemNo{
  font-size:16px;
  font-weight:900;
  letter-spacing:.8px;
  text-transform:uppercase;
  color: var(--text-main);
}

.itemTitle{
  font-size:14px;
  font-weight:700;
  color: var(--text-muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width: 54vw;
}

.itemRight{
  margin-left:auto;
  font-weight:900;
  font-size:14px;
  white-space:nowrap;
}

/* =========================================================
   Office Queue - Tabbed Layout (Warehouse Focused)
   ========================================================= */

.officeTabsBar{
  position: sticky;
  top: 10px;
  z-index: 40;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--card), var(--card-2));
  box-shadow: var(--shadow);
}

.officeTabs{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

.tabBtn{
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: .4px;
  cursor: pointer;
  display:flex;
  align-items:center;
  gap:8px;
  transition:.15s;
}

.tabBtn:hover{
  background: rgba(255,255,255,.10);
}

.tabBtn.active{
  background: rgba(59,130,246,.18);
  border-color: rgba(59,130,246,.40);
}

.tabBadge{
  min-width: 26px;
  text-align:center;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 900;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  font-size: 11px;
}

.officeTabHint{
  margin-top: 6px;
  font-weight: 700;
  font-size: 12px;
  opacity: .8;
}

.tabPanel{
  display:none;
}

.tabPanel.active{
  display:block;
}

/* Prevent giant unpaid table takeover */
.tableScroll{
  max-height: 62vh;
  overflow:auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.tableScroll table{
  margin:0;
}