body{margin:0;background:#f4f6f8;font-family:sans-serif;color:#111827;}

.wrap{max-width:1200px;margin:0 auto;padding:20px;}

h1{
  margin:22px 0;
  font-size:30px;
}

.search-card{
  background:rgba(255,255,255,0.60);
  border-radius:16px;
  padding:18px;
  box-shadow:0 2px 10px #0001;
  margin-bottom:18px;
}

.search-input{
  width:100%;
  box-sizing:border-box;
  font-size:18px;
  padding:14px;
  border:1px solid #d1d5db;
  border-radius:12px;
}

.filter-row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:14px;
}

.filter-btn{
  appearance:none;
  -webkit-appearance:none;
  border:none !important;
  outline:none;
  padding:11px 16px;
  border-radius:999px;
  background:#eef2f7;
  color:#334155;
  font-size:14px;
  font-weight:700;
  cursor:pointer;
  box-shadow:0 2px 8px rgba(0,0,0,.06);
  transition:.15s ease;
}

.filter-btn[data-status="未入場"]{ background:#e5e7eb; color:#374151; }
.filter-btn[data-status="熟成庫"]{ background:#dcfce7; color:#166534; }
.filter-btn[data-status="加工室"]{ background:#ffedd5; color:#9a3412; }
.filter-btn[data-status="精肉完了"]{ background:#ede9fe; color:#5b21b6; }
.filter-btn[data-status="廃棄"]{ background:#fee2e2; color:#991b1b; }


.filter-btn:hover{
  background:#dbeafe;
  color:#1d4ed8;
  transform:translateY(-1px);
  box-shadow:0 6px 14px rgba(37,99,235,.18);
}

.filter-btn.active{
  background:#2563eb;
  color:#fff;
  box-shadow:0 8px 18px rgba(37,99,235,.28);
}

.list{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.item{
  background:rgba(255,255,255,0.60);
  border-radius:16px;
  padding:24px;
  box-shadow:0 2px 10px #0001;
  display:grid;
  grid-template-columns:0.7fr 1.8fr 1fr 1.05fr 0.75fr 0.75fr 1.1fr 0.95fr 1.1fr;
  gap:18px;
  align-items:start;
  transition:.15s ease;
}

.item > div{
  padding:4px 0;
  min-width:0;
}

.item:hover{
  box-shadow:0 6px 18px #0002;
  transform:translateY(-1px);
}

.item .value{
  white-space: nowrap;
}

.item > div:first-child span{
  white-space: nowrap;
}

.no{
  font-size:20px;
  font-weight:bold;
  color:#2563eb;
  text-decoration:none;
}

.label{
  font-size:12px;
  color:#64748b;
  margin-bottom:6px;
  height:16px;
  display:flex;
  align-items:center;
}

.value{
  font-weight:bold;
}

.status{
  display:inline-block;
  padding:6px 10px;
  border-radius:999px;
  background:#eef2f7;
  font-weight:bold;
  white-space: nowrap;
}

.status-0{background:#f1f5f9;color:#334155;}
.status-1{background:#dbeafe;color:#1d4ed8;}
.status-2{background:#e0f2fe;color:#0369a1;}
.status-3{background:#dcfce7;color:#15803d;}
.status-4{background:#ffedd5;color:#c2410c;}
.status-5{background:#ede9fe;color:#6d28d9;}

.empty{
  background:rgba(255,255,255,0.60);
  border-radius:16px;
  padding:24px;
  text-align:center;
  color:#64748b;
}

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

.card{
  background:rgba(255,255,255,0.60);
  border-radius:18px;
  padding:28px;
  box-shadow:0 4px 18px #0001;
  margin-bottom:18px;
}

.info-box{
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:14px;
}

.info-box.wide{
  grid-column:1 / -1;
}

.alert{
  margin-top:18px;
  padding:12px 14px;
  border-radius:12px;
  font-weight:700;
}

.alert.warn{background:#fff7ed;color:#c2410c;}
.alert.ok{background:#dcfce7;color:#15803d;}
.alert.danger{background:#fee2e2;color:#991b1b;}
.alert.muted{background:#f1f5f9;color:#64748b;}

.detail-section{
  margin-top:26px;
}

.badge-list{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:12px;
}

.danger-badge{
  background:#fee2e2;
  color:#991b1b;
  padding:6px 10px;
  border-radius:999px;
  font-size:13px;
  font-weight:700;
}

.check-details{
  margin-top:18px;
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:14px;
  background:#fafafa;
}

.check-details summary{
  cursor:pointer;
  font-weight:700;
}

.check-list{
  margin-top:12px;
}

.check-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:10px 0;
  border-bottom:1px solid #e5e7eb;
}

.check-row:last-child{
  border-bottom:0;
}

.ng{color:#dc2626;}
.ok-text{color:#16a34a;}

.btn{
  display:inline-block;
  margin-top:22px;
  text-decoration:none;
  padding:13px 18px;
  border-radius:12px;
  border:none;
  background:#16a34a;
  color:#fff;
  font-weight:700;
  appearance:none;
  -webkit-appearance:none;
  transition: all 0.2s ease;
}

.btn:hover{
  background:#15803d;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.btn.disabled{
  background:#9ca3af;
  cursor:not-allowed;
  transform:none;
  box-shadow:none;
}

.detail-card{
  max-width:720px;
  margin:0 auto;
}

.detail-title{
  font-size:34px;
  margin:4px 0 24px;
  letter-spacing:.02em;
}

.detail-row{
  padding:13px 0;
  border-bottom:1px solid #e5e7eb;
  font-size:16px;
  font-weight:700;
  color:#111827;
}

.detail-row span{
  color:#475569;
  font-weight:700;
}

.detail-row.vertical{
  display:block;
}

.detail-row.vertical .badge-list{
  margin-top:10px;
}

.detail-btn{
  display:block;
  width:100%;
  box-sizing:border-box;
  text-align:center;
  margin-top:26px;
  font-size:16px;
}

.muted-text{
  color:#64748b;
}

.processing-order-panel{
  position:fixed;
  left:50%;
  bottom:24px;
  transform:translateX(-50%);
  z-index:1000;
  align-items:center;
  gap:16px;
  background:#ffffff;
  border:1px solid #dbe3ea;
  border-radius:999px;
  padding:12px 18px;
  box-shadow:0 12px 32px rgba(15,23,42,.22);
}

.processing-order-note{
  font-weight:bold;
  color:#334155;
  white-space:nowrap;
}

.processing-order-panel .detail-btn{
  margin-top:0;
  display:inline-block;
  padding:12px 18px;
}

@media(max-width:760px){
  .detail-title{
    font-size:28px;
  }
}

.danger-badge{
  color:#b91c1c !important;
  font-weight:700;
}

.danger-badge{
  color:#991b1b !important;
  font-weight:800 !important;
}

.danger-badge{
  font-size:14px !important;
}

.detail-row{
  font-weight:500 !important;
}

.detail-row span{
  font-weight:800 !important;
  color:#0f172a !important;
}

.detail-row strong{
  font-weight:800 !important;
}


.detail-card{
  max-width:980px !important;
}

.detail-card{
  max-width:100% !important;
  width:100%;
  box-sizing:border-box;
}

body{
  overflow-x:hidden;
}

.wrap{
  padding:20px !important;
}

.tag-card-form{
  transition:.15s ease;
}

.tag-card-form:hover{
  transform:translateY(-2px);
}

.tag-card-btn{
  width:100%;
  transition:.15s ease;
}

.tag-card-form:hover .tag-card-btn{
  background:#16a34a !important;
  box-shadow:0 12px 24px rgba(15,23,42,.12) !important; 
  transition: background 1.1s ease-in;
}

.tag-card-btn{
  width:100%;
  padding:14px 0;
  background:rgba(255,255,255,0.60);
  border:1px solid #e5e7eb;
  border-radius:10px;
  font-size:14px;
  font-weight:600;
  color:#111;
  cursor:pointer;
  transition:.15s ease;
}

.meat-card-title{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:6px;
}

.meat-icon{
  width:32px;
  height:32px;
  object-fit:contain;
  flex:0 0 auto;
}

.meat-section{
  margin-top:28px;
  padding-top:18px;
  border-top:1px solid #e5e7eb;
}

.meat-list{
  margin-top:12px;
}

.meat-card{
  padding:14px 0;
  border-bottom:1px solid #e5e7eb;
}

.meat-card:last-child{
  border-bottom:none;
}

.meat-card-title{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:8px;
  font-size:15px;
}

.meat-card-title strong{
  font-size:16px;
  font-weight:800;
}

.meat-icon{
  width:34px;
  height:34px;
  object-fit:contain;
  flex:0 0 auto;
}

.meat-meta{
  display:grid;
  gap:4px;
  padding-left:44px;
  color:#334155;
  font-size:13px;
  line-height:1.55;
}

.meat-meta span{
  color:#64748b;
  font-weight:700;
}

.danger-btn{
  background:#dc2626;
  color:#fff;
  border:none;
  padding:10px 18px;
  border-radius:8px;
  font-weight:700;
  cursor:pointer;
  transition: all 0.2s ease;
}

.danger-btn:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.danger-btn.disabled{
  background:#9ca3af;
  cursor:not-allowed;
  transform:none;
  box-shadow:none;
}

.aging-text{
  font-size:13px;
  font-weight:700;
  color:#b45309;
  white-space:nowrap;
}

@keyframes newlyCreatedFade {
  0% {
    background:#16a34a;
    color:#ffffff;
  }
  100% {
    background:#ffffff;
    color:inherit;
  }
}

.item.newly-created{
  animation: newlyCreatedFade 2.8s ease-out forwards;
}

.report-table{
    width:100%;
    border-collapse:collapse;
    font-size:14px;
    background:#fff;
}

.report-table th{
    background:#f8fafc;
    border-bottom:2px solid #e2e8f0;
    padding:10px 8px;
    text-align:left;
    white-space:nowrap;
    font-weight:700;
}

.report-table td{
    border-bottom:1px solid #e5e7eb;
    padding:8px;
    white-space:nowrap;
    vertical-align:middle;
}

.report-table tbody tr:hover{
    background:#f9fafb;
}

.summary-section{
    margin-top:0;
    border:1px solid #dbeafe;
    border-radius:18px;
    padding:18px;
    background:rgba(255,255,255,0.55);
}

.summary-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(160px, 1fr));
    gap:16px;
}

.summary-grid-total-breakdown{
    grid-template-columns:1.1fr 1fr 1fr;
}

.summary-section:first-child .summary-total-box{
    grid-row:span 3;
}

.summary-grid-total-breakdown .summary-box:not(.summary-total-box){
    min-height:72px;
}

.summary-section:nth-child(2){
    grid-column:1 / 3;
}

.summary-section:nth-child(3){
    grid-column:2;
    grid-row:1 / span 2;
}

.summary-value-with-icon{
    display:flex;
    align-items:center;
    gap:12px;
}

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

.summary-icon-img{
  width:72px;
  height:72px;
  object-fit:contain;
  opacity:0.92;
}

.summary-city-label{
    display:flex;
    align-items:center;
    gap:8px;
}

.summary-city-icon{
    width:36px;
    height:36px;
    object-fit:contain;
    flex-shrink:0;
    pointer-events:none;
    user-select:none;
    -webkit-user-drag:none;
}

.summary-danger-box{
    border:1px solid #fecaca;
    background:rgba(254,242,242,0.9);
}

.summary-danger-box .summary-label{
    color:#b91c1c;
}

.summary-danger-box .summary-value{
    color:#991b1b;
}

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

.summary-city-grid .summary-box{
    text-align:center;
}

.summary-city-grid .summary-value{
    display:flex;
    align-items:flex-end;
    justify-content:center;
    gap:6px;
    font-size:36px;
}

.summary-layout{
    display:grid;
    grid-template-columns:2fr 1fr;
    gap:22px;
    align-items:start;
}

.summary-layout .summary-section:nth-child(3) .summary-grid{
    grid-template-columns:1fr;
}

.summary-unit{
    font-size:22px;
    font-weight:700;
    color:#334155;
    margin-left:6px;
}

.summary-group-title{
    font-size:16px;
    font-weight:800;
    color:#334155;
    margin-bottom:14px;
}

.summary-box{
    background:#f8fafc;
    border:1px solid #e2e8f0;
    border-radius:14px;
    padding:16px;
}

.summary-label{
    font-size:13px;
    color:#64748b;
    font-weight:700;
    margin-bottom:8px;
}

.summary-value{
    font-size:28px;
    font-weight:800;
    color:#0f172a;
}

.summary-total-box{
    min-height:150px;
    display:flex;
    flex-direction:column;
    justify-content:center;
}

.summary-total-box .summary-value{
    font-size:42px;
}

.print-filter-summary{
    display:flex;
    flex-wrap:wrap;
    gap:18px 28px;

    margin-top:24px;
    padding:16px 20px;

    border-radius:12px;
    background:#f3f8f4;

    font-size:14px;
    font-weight:600;
    color:#334155;
}

.report-filter-form{
    display:flex;
    flex-direction:column;
    gap:26px;
}

.report-filter-row{
    display:grid;
    grid-template-columns:repeat(5, 1fr);
    gap:22px 28px;
    align-items:end;
}

.report-filter-item label{
    display:block;
    margin-bottom:8px;
    font-size:15px;
    font-weight:700;
    color:#334155;
}

.report-filter-item input,
.report-filter-item select{
    width:100%;
    height:42px;
    border:1px solid #cbd5e1;
    border-radius:8px;
    padding:0 12px;
    font-size:15px;
    background:#fff;
}

.report-filter-button{
    display:flex;
    gap:18px;
    align-items:end;
    grid-column:3 / span 3;
    padding-left:30px;
}

.report-filter-button .btn{
    margin-top:0;
    min-width:140px;
    text-align:center;
}

@media print{
    @page{
        size:A4;
        margin:8mm;
    }

    html{
        zoom:0.7;

    }
    
    .facility-nav,
    .report-filter-form,
    button{
        display:none !important;
    }

    body{
        background:#fff !important;
    }

    .card{
        box-shadow:none !important;
        break-inside:avoid;
    }

    .print-filter-summary{
        display:grid !important;
        grid-template-columns:1fr 1fr;
        gap:12px 48px;
        margin-top:20px;
        margin-left:auto;
        margin-right:auto;
        padding:14px 18px;
        max-width:520px;
        border-radius:10px;
        background:#f3f8f4 !important;
        font-size:16px;
        font-weight:700;
        line-height:1.9;
        color:#334155;
    }

    .print-filter-summary div{
        font-size:16px;
        font-weight:700;
        color:#0f172a;
    }

    .report-table{
        width:100%;
        table-layout:auto;
        font-size:12px;
    }

    .report-table th,
    .report-table td{
        white-space:normal;
    }
}


.page-top{
    padding-top:20px;
}

.report-header-facility{
    display:flex;
    flex-direction:column;
    gap:4px;
}

.report-header-facility-name{
    font-size:20px;
    font-weight:800;
    color:#0f172a;
    letter-spacing:.04em;
}

.report-header-facility-info{
    font-size:13px;
    font-weight:600;
    color:#475569;
    line-height:1.5;
}

.report-header{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    margin-bottom:28px;
}

.report-header-right{
    display:flex;
    align-items:center;
    gap:14px;
    margin-left:auto;
    margin-top:15px;
}

.report-header-logo{
    width:88px;
    height:auto;
    object-fit:contain;
}

.accordion-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 18px 22px;
  border-radius: 16px;

  background: #f3f4f6;

  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;

  cursor: pointer;

  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.18s ease;
}

.accordion-summary:hover {
  background: #e5e7eb;
}

.accordion-summary::-webkit-details-marker {
  display: none;
}

details[open] .accordion-summary {
  margin-bottom: 18px;
}

.color-atlas-result-details{
  margin-top:12px;
  margin-left:24px;
  padding:14px 18px;
  background:#f7faf7;
  border:1px solid #dcebdd;
  border-radius:12px;
}

.color-atlas-result-details .check-row{
  padding-left:18px;
}

.color-atlas-result-details .check-group-title{
  margin-top:14px;
  margin-bottom:6px;
  font-weight:700;
  color:#374151;
}

.color-atlas-result-details .check-row{
  display:grid;
  grid-template-columns:minmax(0, 1fr) 90px;
  gap:16px;
  align-items:center;
}

.color-atlas-result-details .check-row b{
  white-space:nowrap;
  text-align:right;
}

.check-group-title {
    margin-top: 20px;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
}

.check-group-appearance {
    background: #eef2ff;
}

.check-group-dismantling {
    background: #ecfdf5;
}

.check-group-carcass {
    background: #fef3c7;
}

.detail-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) 320px;
  gap:24px;
  align-items:start;
}

.detail-actions{
  position:sticky;
  top:90px;
}

.action-card{
  background:rgba(255,255,255,0.60);
  border-radius:18px;
  padding:22px;
  box-shadow:0 4px 18px #0001;
  margin-bottom:18px;
}

.action-card h3{
  margin:0 0 16px;
  font-size:18px;
}

.action-group{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.action-card .detail-btn{
  margin:0;
}

@media(max-width:980px){
  .detail-layout{
    grid-template-columns:1fr;
  }

  .detail-actions{
    position:static;
  }
}
