/* FIFO unified theme — based on existing Receiving module style */

:root{
  --bg:#bfbfbf;
  --panel:#d4d4d4;
  --border:#8e8e8e;
  --border2:#9a9a9a;
  --text:#111;

  --btn:#d6d6d6;
  --btnBorder:#7a7a7a;
  --btn-hover:#c8c8c8;

  --btn-primary:#2c3e50;
  --btn-primary-hover:#233140;

  --success:#15803d;
  --warning:#b45309;
  --danger:#b91c1c;
  --info:#1d4ed8;

  --input-bg:#f3f0c9;
  --thead:#2c3e50;
  --thead-text:#fff;

  --focus:rgba(77,134,198,.18);
  --focus-border:#4d86c6;

  --module-width:980px;
  --module-wide:1240px;
}

*{ box-sizing:border-box; }

body{
  font-family:Arial, sans-serif;
  margin:0;
  background:var(--bg);
  color:var(--text);
}

.wrap,
.fifo-wrap{
  max-width:var(--module-width);
  margin:22px auto;
  padding:0 12px;
}

.fifo-wrap.wide{
  max-width:var(--module-wide);
}

.card,
.fifo-card{
  background:var(--panel);
  border:2px solid var(--border);
  box-shadow:0 1px 0 rgba(0,0,0,.08);
  padding:14px 14px 16px;
  margin-bottom:16px;
}

.card h2,
.fifo-card h2{
  margin:0 0 12px 0;
  font-size:18px;
  font-weight:700;
}

.fifo-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  flex-wrap:wrap;
  margin-bottom:16px;
}

.fifo-brand{
  display:flex;
  align-items:center;
  gap:12px;
}

.fifo-brand img{
  width:54px;
  height:54px;
  object-fit:contain;
}

.fifo-title{
  margin:0;
  font-size:24px;
  font-weight:800;
}

.fifo-subtitle{
  margin:4px 0 0;
  font-size:13px;
  opacity:.82;
}

label{
  font-weight:700;
  display:block;
  margin:10px 0 4px;
}

select,
input[type="text"],
input[type="number"],
input[type="date"],
input[type="file"]{
  width:100%;
  padding:8px 8px;
  border:1px solid var(--border2);
  background:var(--input-bg);
  outline:none;
  color:var(--text);
}

select:focus,
input:focus{
  border-color:var(--focus-border);
  box-shadow:0 0 0 2px var(--focus);
}

.row2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  align-items:start;
  margin-top:6px;
}

.row3{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:14px;
  align-items:start;
  margin-top:6px;
}

.hint{
  font-size:12px;
  opacity:.85;
  margin-top:4px;
}

.actions,
.fifo-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:14px;
}

button,
.fifo-btn,
a.fifo-btn{
  padding:9px 14px;
  background:var(--btn);
  border:1px solid var(--btnBorder);
  border-radius:6px;
  cursor:pointer;
  font-weight:700;
  color:var(--text);
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  line-height:1.2;
}

button:hover,
.fifo-btn:hover{
  background:var(--btn-hover);
}

button.primary,
.fifo-btn.primary{
  background:var(--btn-primary);
  border-color:var(--btn-primary);
  color:#fff;
}

button.primary:hover,
.fifo-btn.primary:hover{
  background:var(--btn-primary-hover);
  border-color:var(--btn-primary-hover);
}

.fifo-btn.success{
  background:#d7f5df;
  border-color:#3f8f53;
  color:#0f5132;
}

.fifo-btn.warning{
  background:#fff1c2;
  border-color:#c89416;
  color:#5f3d00;
}

.fifo-btn.danger{
  background:#ffd8d8;
  border-color:#b94a48;
  color:#7f1d1d;
}

.fifo-btn img,
button img{
  width:22px;
  height:22px;
  object-fit:contain;
}

.fifo-icon-btn{
  min-width:122px;
}

.fifo-dashboard-grid{
  display:grid;
  grid-template-columns:repeat(5, 1fr);
  gap:12px;
}

.fifo-dashboard-card{
  min-height:170px;
  text-align:center;
  color:var(--text);
  text-decoration:none;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:10px;
}

.fifo-dashboard-card img{
  width:56px;
  height:56px;
  object-fit:contain;
}

.fifo-dashboard-card strong{
  font-size:17px;
}

.fifo-dashboard-card span{
  font-size:12px;
  opacity:.82;
  max-width:150px;
}

.table-wrap,
.fifo-table-wrap{
  max-height:520px;
  overflow:auto;
  border:1px solid var(--border2);
  background:#fff;
}

table,
.fifo-table{
  width:100%;
  border-collapse:collapse;
  background:var(--input-bg);
}

th,
td,
.fifo-table th,
.fifo-table td{
  border:1px solid #c9c9c9;
  padding:9px 10px;
  text-align:left;
  font-size:14px;
  vertical-align:top;
}

th,
.fifo-table th{
  background:var(--thead);
  color:var(--thead-text);
  font-weight:700;
}

.table-actions{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}

button.mini,
.fifo-btn.mini{
  padding:6px 10px;
  font-size:12px;
  border-radius:4px;
}

.table-input{
  width:100%;
  min-width:90px;
  padding:6px 7px;
  border:1px solid var(--border2);
  background:var(--input-bg);
  outline:none;
  color:var(--text);
}

.table-input:focus{
  border-color:var(--focus-border);
  box-shadow:0 0 0 2px var(--focus);
}

.empty-state{
  text-align:center;
  font-style:italic;
  opacity:.8;
}

input[type="checkbox"]{
  accent-color:var(--btn-primary);
}

/* Scan-focused mobile panel */
.fifo-scan-card{
  max-width:640px;
  margin-left:auto;
  margin-right:auto;
}

.fifo-scan-input{
  font-size:24px;
  font-weight:700;
  letter-spacing:.03em;
  padding:16px 14px !important;
}

.fifo-status{
  margin-top:12px;
  padding:12px 14px;
  border:2px solid var(--border);
  background:#eee;
  font-weight:700;
}

.fifo-status.match{
  background:#d7f5df;
  border-color:#3f8f53;
  color:#0f5132;
}

.fifo-status.warning{
  background:#fff1c2;
  border-color:#c89416;
  color:#5f3d00;
}

.fifo-status.error{
  background:#ffd8d8;
  border-color:#b94a48;
  color:#7f1d1d;
}

.fifo-kpi-row{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:10px;
  margin-bottom:14px;
}

.fifo-kpi{
  background:var(--input-bg);
  border:1px solid var(--border2);
  padding:10px;
}

.fifo-kpi .num{
  font-size:22px;
  font-weight:800;
}

.fifo-kpi .label{
  font-size:12px;
  opacity:.8;
}

@media (max-width:900px){
  .fifo-dashboard-grid{
    grid-template-columns:repeat(2, 1fr);
  }
  .row3{
    grid-template-columns:1fr;
  }
  .fifo-kpi-row{
    grid-template-columns:repeat(2, 1fr);
  }
}

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

  .fifo-dashboard-grid{
    grid-template-columns:1fr;
  }

  .fifo-dashboard-card{
    min-height:96px;
    flex-direction:row;
    justify-content:flex-start;
    text-align:left;
    padding:14px;
  }

  .fifo-dashboard-card img{
    width:44px;
    height:44px;
  }

  .fifo-scan-input{
    font-size:22px;
  }
}

@media print{
  body{
    background:#fff;
  }
  .no-print,
  .fifo-no-print{
    display:none !important;
  }
  .wrap,
  .fifo-wrap{
    max-width:none;
    margin:0;
    padding:0;
  }
  .card,
  .fifo-card{
    border:1px solid #999;
    box-shadow:none;
  }
}
