/* static/css/hope.css - HOPE 웹 공통 스타일 */
:root {
  --primary: #1E3A5F;
  --accent:  #2563EB;
  --success: #16A34A;
  --danger:  #DC2626;
  --warning: #D97706;
  --bg:      #F8F9FA;
  --card:    #FFFFFF;
  --border:  #E5E7EB;
  --text:    #1F2937;
  --muted:   #6B7280;
  --radius:  8px;
  --shadow:  0 1px 3px rgba(0,0,0,.1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Malgun Gothic', '맑은 고딕', Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
input, select, button, textarea { font-family: inherit; font-size: 14px; }

/* 카드 */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }

/* 버튼 */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border: none; border-radius: 6px; cursor: pointer; font-weight: 600; transition: opacity .15s, transform .1s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary  { background: var(--accent);   color: #fff; }
.btn-success  { background: var(--success);  color: #fff; }
.btn-danger   { background: var(--danger);   color: #fff; }
.btn-warning  { background: var(--warning);  color: #fff; }
.btn-ghost    { background: var(--border);   color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }

/* 입력 */
.input { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 6px; outline: none; transition: border-color .15s; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.input-lg { padding: 13px 16px; font-size: 16px; }

/* 배지 */
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.badge-green { background: #DCFCE7; color: #15803D; }
.badge-red   { background: #FEE2E2; color: #B91C1C; }
.badge-blue  { background: #DBEAFE; color: #1D4ED8; }
.badge-gray  { background: #F3F4F6; color: #374151; }
.badge-yellow{ background: #FEF9C3; color: #854D0E; }

/* 상태 행 색상 */
.row-done    { background: #F0FDF4 !important; }
.row-partial { background: #FFF7ED !important; }
.row-cancel  { background: #FEF2F2 !important; color: #9CA3AF; text-decoration: line-through; }
.row-child   { background: #FAFAFA !important; font-size: 12px; }

/* 테이블 */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th { background: var(--primary); color: #fff; padding: 10px 12px; text-align: left; font-size: 13px; white-space: nowrap; }
td { padding: 9px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #F9FAFB; }

/* 플래시 효과 */
@keyframes flashRed { 0%,100%{background:transparent} 20%,60%{background:#FEE2E2} }
@keyframes flashGreen { 0%,100%{background:transparent} 20%,60%{background:#DCFCE7} }
.flash-red   { animation: flashRed .5s ease; }
.flash-green { animation: flashGreen .5s ease; }

/* 프로그레스 */
.progress-bar { width: 100%; height: 12px; background: #E5E7EB; border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--success); border-radius: 99px; transition: width .3s ease; }
.progress-fill.warning { background: var(--warning); }

/* 토스트 알림 */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 14px 20px; border-radius: var(--radius); color: #fff; font-weight: 600; box-shadow: 0 4px 12px rgba(0,0,0,.2); animation: slideIn .2s ease; max-width: 360px; }
.toast-ok      { background: var(--success); }
.toast-error   { background: var(--danger); }
.toast-warning { background: var(--warning); }
.toast-info    { background: var(--accent); }
@keyframes slideIn { from{transform:translateX(100%);opacity:0} to{transform:translateX(0);opacity:1} }

/* 모달 */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-box { background: #fff; border-radius: var(--radius); padding: 28px; min-width: 380px; max-width: 560px; width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; }

/* 네비게이션 */
.navbar { background: var(--primary); color: #fff; display: flex; align-items: center; padding: 0 24px; height: 52px; gap: 20px; }
.navbar-brand { font-size: 18px; font-weight: 700; letter-spacing: -.5px; color: #fff; text-decoration: none; }
.navbar-brand:hover, .navbar-brand:visited, .navbar-brand:active { color: #fff; text-decoration: none; }
.navbar-nav { display: flex; gap: 4px; flex-shrink: 0; }
.nav-link { color: rgba(255,255,255,.75); padding: 6px 12px; border-radius: 6px; text-decoration: none; font-size: 13px; transition: background .15s; }
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,.15); color: #fff; }
.navbar-notice {
  flex: 1 1 auto;
  min-width: 320px;
  margin: 0 16px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.88);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
}
.navbar-right { display: flex; align-items: center; gap: 12px; font-size: 13px; color: rgba(255,255,255,.8); flex-shrink: 0; }
.navbar-notice-link {
  color: #FDE68A;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}
.navbar-notice-link:hover,
.navbar-notice-link:focus {
  color: #FFF3BF;
  text-decoration: underline;
}

/* 레이아웃 */
.page { padding: 20px 24px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-3 { margin-bottom: 12px; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }

/* 반응형 */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .page { padding: 12px; }
  .hide-mobile { display: none !important; }
  .navbar { padding: 0 12px; gap: 12px; flex-wrap: wrap; height: auto; min-height: 52px; }
  .navbar-nav { flex-wrap: wrap; }
  .navbar-notice {
    order: 3;
    width: 100%;
    min-width: 0;
    margin: 0 0 8px;
    white-space: normal;
    flex-wrap: wrap;
  }
  .navbar-right { margin-left: auto; width: auto; justify-content: flex-end; flex-wrap: wrap; padding-bottom: 8px; }
}

/* 스캔 화면 특화 */
.scan-status { padding: 10px 16px; border-radius: 6px; font-weight: 600; font-size: 15px; text-align: center; min-height: 44px; display: flex; align-items: center; justify-content: center; }
.scan-ok      { background: #DCFCE7; color: #15803D; }
.scan-error   { background: #FEE2E2; color: #B91C1C; }
.scan-waiting { background: #F3F4F6; color: #6B7280; }
.scan-over    { background: #FEF3C7; color: #92400E; }
.waybill-display { font-size: 22px; font-weight: 700; letter-spacing: 1px; font-family: 'Consolas', monospace; }

/* 현황 수치 카드 */
.stat-card { text-align: center; padding: 16px; border-radius: var(--radius); border: 1px solid var(--border); }
.stat-number { font-size: 32px; font-weight: 800; line-height: 1; }
.stat-label  { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* 로딩 스피너 */
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
