/* 두나우 렌탈관리 페이지 - 공통 스타일 */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  background: #f8fafc;
  color: #0f172a;
}
a { color: inherit; text-decoration: none; }

/* 레이아웃 */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0; background: #fff;
  border-right: 1px solid #e2e8f0; padding: 16px;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; padding: 0 4px; }
.sidebar-brand .logo {
  width: 36px; height: 36px; border-radius: 10px; background: #2563eb;
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
}
.sidebar-brand .title { font-size: 14px; font-weight: 700; color: #0f172a; }
.sidebar-brand .subtitle { font-size: 11px; color: #94a3b8; }

.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 10px; font-size: 14px; font-weight: 500; color: #475569;
}
.nav-item:hover { background: #f1f5f9; }
.nav-item.active { background: #eff6ff; color: #1d4ed8; }

.sidebar-footer { margin-top: 16px; padding-top: 16px; border-top: 1px solid #e2e8f0; }
.sidebar-footer .user { font-size: 12px; color: #64748b; padding: 0 4px 8px; }
.btn-logout {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: 8px 12px; border-radius: 8px; font-size: 13px; color: #64748b;
}
.btn-logout:hover { background: #f1f5f9; }

.main { flex: 1; min-width: 0; padding: 24px; }
.container { max-width: 900px; margin: 0 auto; }
.container-lg { max-width: 1100px; margin: 0 auto; }

.topbar { display: none; }
.drawer { display: none; }

@media (max-width: 767px) {
  .sidebar { display: none; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between;
    height: 52px; padding: 0 16px; background: #fff; border-bottom: 1px solid #e2e8f0;
    position: sticky; top: 0; z-index: 20;
  }
  .topbar .brand { font-size: 14px; font-weight: 700; }
  .hamburger { background: none; border: none; font-size: 20px; cursor: pointer; }
  .main { padding: 16px; }
  .drawer {
    display: none; position: fixed; inset: 0; z-index: 30;
  }
  .drawer.open { display: block; }
  .drawer-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.3); }
  .drawer-panel {
    position: absolute; left: 0; top: 0; bottom: 0; width: 260px; background: #fff;
    padding: 16px; box-shadow: 4px 0 16px rgba(0,0,0,.1); overflow-y: auto;
  }
}

/* 카드/박스 */
.card { background: #fff; border-radius: 16px; padding: 20px; box-shadow: 0 1px 2px rgba(0,0,0,.04); border: 1px solid #e2e8f0; }
.card + .card { margin-top: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

/* 폼 */
label.field-label { display: block; font-size: 13px; font-weight: 600; color: #334155; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 10px;
  font-size: 14px; background: #fff; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px #dbeafe; }
.field { margin-bottom: 14px; }

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  padding: 10px 18px; border-radius: 10px; font-size: 14px; font-weight: 600;
  border: none; cursor: pointer; text-decoration: none;
}
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #fff; border: 1px solid #cbd5e1; color: #334155; }
.btn-secondary:hover { background: #f8fafc; }
.btn-danger { background: none; color: #ef4444; padding: 6px 10px; font-size: 13px; }
.btn-danger:hover { background: #fef2f2; }
.btn-block { width: 100%; }

/* 배지 */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-green { background: #f0fdf4; color: #16a34a; }
.badge-amber { background: #fffbeb; color: #d97706; }

/* 테이블 */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; color: #94a3b8; padding: 10px 12px; border-bottom: 1px solid #e2e8f0; }
td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; }
.table-wrap { background: #fff; border-radius: 16px; border: 1px solid #e2e8f0; overflow-x: auto; }

/* 진행률바 */
.progress-track { height: 10px; background: #f1f5f9; border-radius: 999px; overflow: hidden; margin-top: 12px; }
.progress-fill { height: 100%; background: #2563eb; border-radius: 999px; }

/* 로그인 페이지 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: #f1f5f9; }
.login-box { width: 100%; max-width: 360px; }
.login-logo { width: 48px; height: 48px; border-radius: 12px; background: #2563eb; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; margin: 0 auto 12px; }

.error-msg { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; padding: 8px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 12px; }
.hint { color: #94a3b8; font-size: 12px; }
.text-muted { color: #94a3b8; }
.text-right { text-align: right; }

/* 거래명세표 - 공급자/공급받는자 보관용 반절 분할 */
.statement-half { padding: 6mm 4mm; }
.cut-line {
  text-align: center; color: #94a3b8; font-size: 11px; letter-spacing: 1px;
  margin: 6mm 0; overflow: hidden; white-space: nowrap;
}

/* 인쇄 (청구서/거래명세표) */
@media print {
  .no-print { display: none !important; }
  .sidebar, .topbar { display: none !important; }
  .main { padding: 0; }
  body { background: #fff; }
  @page { size: A4; margin: 10mm; }
  .statement-sheet { box-shadow: none !important; border: none !important; padding: 0 !important; }
  .statement-half { page-break-inside: avoid; }
}
