/* [[[당일 주문처 목록 css]]] */
/* ------------------- section02 전체 도시락 수량 ------------------- */
.section02 {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.quantity_wrap {
    display: flex;
    gap: 20px;
    justify-content: flex-start;
}
.container {
    width: auto;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 0 20px 1px rgba(0, 0, 0, 0.1);
    padding: 30px;
    display: flex;
    justify-content: flex-start;
    flex-direction: column;
}
.box_title {
    font-size: 2.4rem;
    font-weight: 600;
    color: var(--label-neutral);
    padding-bottom: 10px;
    user-select: none;
    -webkit-user-select: none; 
}
.quantity {
    width: auto;
    min-width: 160px;
    height: 160px;
    padding: 20px;
    background-color: var(--background-light);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.quantity div:nth-child(1) {
    font-size: 4rem;
    font-weight: 700;
}
.quantity_bg_none {
    background-color: transparent;
}
.qty_kind {
    padding: 2px 14px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 18px;
    color: #00000090;
    user-select: none;
    -webkit-user-select: none; 
}
.heat_bg {
    background-color: #FF511720;
    color: var(--primary-orange);
}
.salad_bg {
    background-color: #189C3820;
    color: var(--primary-green);
}
.total_bg {
    background-color: #17171920;
    color: #00000090;
}
.dual-counter .primary,
.dual-counter .sep {
    color: #888;
}

/* 기사들 총합 */
.board-total {
  display: flex;
  border-bottom: 1px solid var(--line);
  width: 100%;
}

.board-total .quantity_wrap {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: stretch;
  gap: 0;
}
.board-total .quantity {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;            
  min-width: 0; 
  height: 80px;
  padding: 20px;
  background-color: transparent;
  border-radius: 0;
  position: relative;
  border-right: 1px solid var(--line-normal);
  background-color: var(--background-light);
  overflow: hidden;
}
.board-total .quantity_wrap .quantity:last-child {
  border-right: 0;
}
.board-total .quantity div:nth-child(1) {
  font-size: 3rem;
  padding: 20px 0 0 0;
  text-align: right;
  display: inline-flex;
  justify-content: right;
  width: 100%;
}
.board-total .quantity_wrap .quantity_bg_none {
    background-color: transparent;
}
.board-total .qty_kind {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 14px;
}
/* 기사 보드 아코디언 토글 스타일 */
.board .board-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.board.is-expanded .board-body {
    max-height: 1200px;
}

/* 주문목록 보기 인터랙티브 피드백 */
.board .help {
    cursor: pointer;
    user-select: none;
    padding: 14px 16px;
    background: #fafafa;
    border-top: 1px solid var(--line);
    transition: background 0.25s, color 0.25s;
    font-weight: 700;
    text-align: center;
    color: var(--label-neutral);
}
.board .help:hover {
    background: #f1f5f9;
    color: var(--primary-orange);
}

/* 토글 표시용 화살표 및 회전 트랜지션 */
.board .help::after {
    content: ' ▾';
    display: inline-block;
    margin-left: 6px;
    transition: transform 0.3s ease;
}
.board.is-expanded .help::after {
    transform: rotate(180deg);
}
.orders-table {
    position: relative;
}
/* ------------------- section02 전체 도시락 수량 end --------------- */
header{
    position:sticky; top:0; z-index:10;
    background:linear-gradient(180deg,#fff,rgba(255,255,255,.8));
    backdrop-filter:saturate(140%) blur(6px);
    border-bottom:1px solid var(--line);
}
.topbar{
    max-width:1200px; margin:0 auto; padding:14px 16px;
    display:flex; align-items:center; gap:12px;
}
.topbar h1{font-size:20px; margin:0; font-weight:900}
.spacer{flex:1}
.btn{
    appearance:none; border:1px solid var(--line); background:#fff; color:#111;
    padding:10px 14px; border-radius:12px; cursor:pointer; font-weight:700;
    box-shadow:0 1px 0 rgba(0,0,0,.02);
}
.btn.primary{ background:var(--primary-orange); color:#fff; border-color:var(--primary-orange) }
.btn:hover{ filter:brightness(1.03) }

/* Boards */
.table-scroll {
    border: initial;
}
/* 스크롤바 커스텀 (투명하고 얇게) */
.table-scroll::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}
.table-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.table-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}
.table-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}
.board .table-scroll {
    max-height: 450px;
    overflow-y: auto;
    overflow-x: auto;
}
.board .orders-table thead th {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

/* 가로 스크롤 래퍼 및 버튼 스타일 */
.scroll-wrapper {
    position: relative;
    width: 100%;
}
.scroll-btn {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 36px;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 8px rgba(0,0,0,0.1);
    transition: background 0.2s, color 0.2s;
    color: #9CA3AF;
}
.scroll-btn:hover {
    background: rgba(255, 255, 255, 1);
    color: var(--primary-orange);
}
.scroll-btn.left-btn {
    left: 0;
    border-right: 1px solid var(--line);
}
.scroll-btn.right-btn {
    right: 0;
    border-left: 1px solid var(--line);
}
.scroll-btn svg {
    width: 20px;
    height: 20px;
}
.boards{
    display: grid; 
    gap: 14px;
    grid-template-columns: repeat(2, 1fr);
    align-items: start;
}
@media (max-width:1100px){ .boards{ grid-template-columns: repeat(2, 1fr); } }

.board{
    background:#fff; 
    border:1px solid var(--line); 
    border-radius:var(--radius);
    display:flex; 
    flex-direction:column; 
    overflow:hidden;
}
.board header{
    position:static; border:0; background:#fff;
}
.board-title{
    padding: 12px 14px; 
    display:flex; 
    align-items:center; 
    gap:8px;
    border-bottom:1px solid var(--line);
}
.board-title .dot{
    width:10px; height:10px; border-radius:50%;
    background:#9CA3AF; flex:0 0 10px;
}
.board[data-driver="UNASSIGNED"] .dot{ background:#9CA3AF }
.board[data-driver="D1"] .dot{ background:#fca5a5 }
.board[data-driver="D2"] .dot{ background:#86efac }
.board[data-driver="D3"] .dot{ background:#93c5fd }

.board-title h2{ margin:0; font-size:15px; font-weight:800 }
.counter{ margin-left:auto; font-size:13px; color:var(--muted) }

.board-body{ 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
}
.board.drop-target{ 
    outline:2px dashed var(--primary-orange); 
    outline-offset:-6px; 
}

/* Card */
.card:active{ cursor:grabbing }
.card.dragging{ opacity:.6; transform:scale(.99) }

.card-head{
    display:flex; align-items:center; gap:8px; margin-bottom:8px;
}
.card-title{
    font-weight:900; font-size:16px; display:flex; align-items:center; gap:8px;
}
.badge{
    font-size:13px; font-weight:800; padding:4px 8px; border-radius:999px;
    background:var(--badge); color:var(--badge-text);
}
.card-fields{
    display:grid; gap:10px;
    grid-template-columns:1fr 1fr;
}
.field{ display:flex; flex-direction:column; gap:6px }
.field.full{ grid-column:1 / -1 }
.field label{ font-size:13px; color:var(--muted); font-weight:700 }
.field input[type="text"],
.field input[type="number"],
.field textarea{
    width:100%; border:1px solid var(--line); border-radius:10px; background:#fff;
    padding:10px 12px; font:inherit;
}
.field input[readonly]{ background:#F3F4F6; color:#6B7280; cursor:not-allowed }
.checks{ display:grid; grid-template-columns:1fr 1fr; gap:10px }
.check{
    display:flex; align-items:center; gap:8px; padding:10px 12px; border:1px solid var(--line);
    border-radius:10px; background:#fff;
}
.check input{ width:18px; height:18px; accent-color:var(--primary-orange) }
.meta{
    font-size:13px; color:var(--muted); display:flex; gap:10px; margin-top:6px;
}

/* 동 라벨 */
.dong-cell { 
    text-align: center;
}
.region-badge {
    display:inline-block;
    padding: 2px 12px;
    border-radius:999px;
    background:var(--label-bg);
    color:var(--label-text);
    font-size: 14px;
    font-weight:600;
    white-space: nowrap;
    user-select: none;
    pointer-events:none;   
    margin: 5px 0;
}
/* 값이 비어있을 때(미정) 스타일 */
.region-badge.is-empty{
    background:#e5e7eb;
    color:#6b7280;
}

/* Footer help */
.help {
    display: flex;
    justify-content: center;
    padding: 0 16px; 
    color: var(--muted); 
    font-size: 13px;
}

/* Focus ring */
:focus-visible{ 
    outline:3px solid rgba(255,81,23,.45); 
    outline-offset:2px; 
    border-radius:8px;
}

@media (prefers-reduced-motion: reduce){
    *{ transition:none !important; animation:none !important; }
}

/* ========== 특이사항 모달 스타일 ========== */
.note-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 9000;
}
.note-modal.open { display: flex; }
.note-modal__dialog {
  width: 100%;
  max-width: 720px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  padding: 20px;
  position: relative;
}
.note-modal__close {
  position: absolute;
  right: 12px;
  top: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #f3f4f6;
  font-size: 24px;
  cursor: pointer;
}
.note-modal__close:hover { background: #e5e7eb; }
.note-modal__title {
  font-size: 20px;
  font-weight: 700;
  margin: 4px 28px 8px 4px;
}
.note-modal__meta {
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.meta-row { display: flex; gap: 8px; font-size: 13px; color: #555; }
.meta-label { color: #6b7280; }
.meta-value { color: #111; }

.note-modal__section + .note-modal__section { margin-top: 14px; }
.note-modal__label {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #374151;
  display: flex; align-items: center; gap: 8px;
}
.note-modal__hint { font-weight: 400; color: #6b7280; }

.note-modal__current {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fbfbfb;
  color: #111;
  white-space: pre-wrap;
  line-height: 1.5;
}

.note-modal__form textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.6;
}
.note-modal__form textarea:focus {
  outline: none;
  border-color: #111;
  box-shadow: 0 0 0 3px rgba(17,17,17,.08);
}
.note-modal__actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 10px;
}
.note-modal__actions .btn-primary, .note-modal__actions .btn-secondary {
  appearance: none; border: 0; cursor: pointer; border-radius: 10px;
  padding: 10px 14px; font-weight: 600; font-size: 14px;
}
.note-modal__actions .btn-primary   { 
  background: var(--primary-orange); 
  color: #fff; 
  transition: all 0.3s;
}
.note-modal__actions .btn-primary:hover { background: var(--primary-brown); }
.note-modal__actions .btn-secondary { background: #f3f4f6; color: #111; }
.note-modal__actions .btn-secondary:hover { background: #e5e7eb; }

.note-modal__history {
  list-style: none; padding: 0; margin: 0;
  border: 1px solid #eee; border-radius: 10px; overflow: hidden;
}
.note-modal__history li {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
  display: grid; grid-template-columns: 140px 1fr; gap: 12px;
}
.note-modal__history li:last-child { border-bottom: 0; }
.note-modal__history .ts {
  font-size: 13px; color: #6b7280;
}
.note-modal__history .txt {
  white-space: pre-wrap; line-height: 1.5; color: #111;
}

/* 표 안의 행을 클릭 가능처럼 */
.boards .orders-table tbody tr {
  cursor: pointer;
}
.boards .orders-table tbody tr:hover {
  background: #fafafa;
}

@media (max-width:1024px){
    .section02 { gap: 10px; }
    .section03 .quantity_wrap { flex-direction: column; width: 100%; }
    .board-total .quantity div:nth-child(1) {
        padding: 0;
    }
    .board-total .quantity {
        border-right: 0;
    }
    .dashboard-main {
        padding-right: 0 !important;
    }
    .orders-table {
        width: 100%;
        min-width: 800px;
    }
    .ordersBody tr td {
        padding: 5px 40px !important;
    }
}
@media (max-width: 768px) {
    .box_title {
        font-size: 1.8rem;
    }
    .quantity {
        width: auto;
        min-width: 100px !important;
        height: 100px;
        padding: 20px;
        background-color: var(--background-light);
        border-radius: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
    }
    .quantity div:nth-child(1) {
        font-size: 3rem;
        font-weight: 700;
    }
    .qty_kind {
        padding: 2px 14px;
        border-radius: 100px;
        font-weight: 600;
        font-size: 15px;
        user-select: none;
        -webkit-user-select: none;
    }
    .container { padding: 15px; width: 100%; }
    .board-total .quantity div:nth-child(1) {
        font-size: 3rem;
        padding: 0;
        text-align: right;
        display: inline-flex;
        justify-content: right;
        width: 100%;
    }
    .orders-table {
        width: 100%;
        min-width: 600px;
    }
    .ordersBody tr td {
        padding: 5px 30px !important;
    }
}
@media (max-width: 650px) {
    .sub_navi_wrap {
        padding: 0px 20px;
    }
    .refresh-bar {
        padding: 0;
        padding-bottom: 10px;
    }
    .sub_navi_wrap .refresh-bar label {
        font-size: 12px;
    }
    .refresh-bar .last-sync {
        font-size: 12px;
    }
    .box_title {
        font-size: 1.8rem;
    }
    .quantity {
        display: flex;
        flex: 1;
        width: auto;
        min-width: initial !important;
        height: 100%;
        padding: 14px;
        background-color: var(--background-light);
        border-radius: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
    }
    .quantity div:nth-child(1) {
        font-size: 2.4rem;
        font-weight: 700;
    }
    .quantity_wrap {
        display: flex;
        gap: 10px;
        justify-content: flex-start;
    }
    .qty_kind {
        padding: 2px 14px;
        border-radius: 100px;
        font-weight: 600;
        font-size: 12px;
        user-select: none;
        -webkit-user-select: none;
    }
    .container { padding: 15px; width: 100%; }
    .board-total .quantity div:nth-child(1) {
        font-size: 2rem;
        padding: 0;
        text-align: right;
        display: inline-flex;
        justify-content: right;
        width: 100%;
    }
    .boards {
        grid-template-columns: repeat(1, 1fr);
    }
    .board-total .qty_kind {
        position: absolute;
        top: 10px;
        left: 10px;
        font-size: 10px;
        padding: 2px 8px;
    }
}
@media (max-width: 400px) {
    .board-total .quantity div:nth-child(1) {
        font-size: 2rem;
        padding: 0;
        text-align: right;
        display: inline-flex;
        justify-content: right;
        width: 100%;
    }
    .board-total .qty_kind {
        font-size: 10px;
        padding: 2px 8px;
    }
    .ordersBody tr td {
        padding: 5px 20px !important;
    }
}
