
/* =========================================================
   Daebak Admin UI - style_v4 (Blue-tinted Modern)
   - Tone: subtle blue surface, less "paper white"
   - Density: compact forms, consistent cards
   ========================================================= */

/* ---------- Design Tokens ---------- */
:root{
  --brand: #2f6bff;
  --brand-2: #2347b8;
  --brand-grad: linear-gradient(135deg, rgba(47,107,255,.18) 0%, rgba(35,71,184,.12) 55%, rgba(16,24,40,.04) 100%);

  --bg: #eef3ff;                 /* <- blue-tinted background */
  --bg-2: #e8f0ff;
  --surface: rgba(255,255,255,.78);
  --surface-2: rgba(255,255,255,.86);
  --surface-blue: rgba(236,244,255,.92); /* card header tint */
  --text: #111827;
  --muted: #64748b;
  --border: rgba(15, 23, 42, .10);
  --shadow: 0 10px 28px rgba(15, 23, 42, .10);
  --shadow-sm: 0 6px 16px rgba(15, 23, 42, .08);

  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;

  --radius: 18px;
  --radius-lg: 22px;

  --focus: 0 0 0 .22rem rgba(47,107,255,.22);
 
  --tabbar-h: 72px; /* 하단 탭바 실제 높이 */
}

/* ---------- Base ---------- */
html, body{
  background: radial-gradient(1100px 600px at 20% 0%, rgba(47,107,255,.16), transparent 60%),
              radial-gradient(900px 500px at 95% 10%, rgba(35,71,184,.12), transparent 55%),
              linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 55%, #f6f9ff 100%);
  color: var(--text);
  font-family: "Noto Sans KR", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

a { text-decoration: none; }
.small, .form-text { color: var(--muted); }

/* ---------- Glass / Cards ---------- */
.glass-header{
  background: rgba(255,255,255,.72) !important;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.glass-card{
  background: var(--surface);
  border: 1px solid rgba(47,107,255,.10);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
}

/* Card header tone unification */
.glass-card .card-header,
.glass-card > .p-3.bg-light,
.glass-card > .p-3.bg-light.border-bottom{
  background: linear-gradient(180deg, var(--surface-blue) 0%, rgba(255,255,255,.70) 100%) !important;
  border-bottom: 1px solid rgba(47,107,255,.10) !important;
}

/* A slightly stronger "section" header line */
.section-header{
  font-weight: 800;
  color: #0b2a7a;
  margin: 18px 0 10px;
  letter-spacing: -.2px;
}

/* ---------- Layout / Containers ---------- */
.container{ max-width: 1140px; }

.section-view{ display:none; }
.section-view.active-section{ display:block; }

/* ---------- Tables ---------- */
.table{
  --bs-table-bg: transparent;
}
.table thead th{
  color: #0f2f7a;
  border-bottom: 1px solid rgba(47,107,255,.12) !important;
}
.table td, .table th{
  border-color: rgba(15, 23, 42, .07) !important;
  font-size: 13px;
  line-height: 1.35;
}

.table thead th{
  font-size: 14px;
}
.table-hover > tbody > tr:hover > *{
  background: rgba(47,107,255,.06) !important;
}

/* ---------- Pending (미처리) Table Template ---------- */
.table-template{
  background: var(--surface);
  border: 1px solid rgba(47,107,255,.10);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 10px;
}

.table-template .table-responsive{
  border-radius: 14px;
  overflow: auto;
}

.table-row-click{ cursor: pointer; }

.table-template thead th{
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(180deg, var(--surface-blue) 0%, rgba(255,255,255,.70) 100%) !important;
}

/* ✅ 요청사항: 테이블 내 모든 항목(헤더/본문) 가운데 정렬 */
.table th,
.table td{
  text-align: center;
  vertical-align: middle;
}

/* ---------- Forms (Density + Tone) ---------- */
.form-label-sm{
  font-size: .78rem;
  font-weight: 700;
  color: rgba(15, 23, 42, .70);
  margin-bottom: .25rem;
}

.form-control, .form-select{
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,.12);
  background: rgba(255,255,255,.86);
  box-shadow: none !important;
}

.form-control:focus, .form-select:focus{
  border-color: rgba(47,107,255,.55);
  box-shadow: var(--focus) !important;
  background: rgba(255,255,255,.92);
}

.form-control-sm, .form-select-sm{
  padding-top: .42rem;
  padding-bottom: .42rem;
  font-size: .88rem;
}

.form-control-lg{
  border-radius: 18px;
}

/* Input groups */
.input-group .btn,
.input-group .form-control{
  border-radius: 14px;
}

/* ---------- Buttons ---------- */
.btn{
  border-radius: 14px;
  font-weight: 800;
  letter-spacing: -.2px;
}

.btn-primary{
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  border: none;
  box-shadow: 0 10px 22px rgba(47,107,255,.18);
}
.btn-primary:hover{ filter: brightness(.98); }
.btn-outline-primary{
  border-color: rgba(47,107,255,.55);
  color: var(--brand-2);
}
.btn-outline-primary:hover{
  background: rgba(47,107,255,.08);
  color: var(--brand-2);
  border-color: rgba(47,107,255,.65);
}

/* Success/Warning buttons keep Bootstrappy but slightly smoother */
.btn-success{ box-shadow: 0 10px 22px rgba(22,163,74,.12); border: none; }
.btn-warning{ box-shadow: 0 10px 22px rgba(245,158,11,.12); border: none; }

/* ---------- Alerts / Badges ---------- */
.alert{
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.82);
}
.badge{ border-radius: 999px; }

/* ---------- Scan UX ---------- */
.scan-wrapper{
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(47,107,255,.08);
  border: 1px dashed rgba(47,107,255,.22);
}

.scan-input{
  border-radius: 18px !important;
  padding: 14px 14px;
  font-size: 1.02rem;
  font-weight: 900;
  letter-spacing: .3px;
}

/* ---------- Mobile Bottom Nav ---------- */
.mobile-bottom-nav{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--tabbar-h, 72px);
  background: rgba(255,255,255,.78);
  border-top: 1px solid rgba(47,107,255,.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1100;
}

.mobile-bottom-nav .nav-item{
  display:flex;
  flex-direction: column;
  align-items:center;
  gap: 4px;
  font-size: .70rem;
  color: rgba(15,23,42,.62);
  width: 16.6%;
}

.mobile-bottom-nav .nav-item i{
  font-size: 1.25rem;
}

.mobile-bottom-nav .nav-item.active{
  color: var(--brand-2);
}

.mobile-bottom-nav .center-fab{
  transform: translateY(-16px);
}

.mobile-bottom-nav .fab-btn{
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: 0 14px 28px rgba(47,107,255,.22);
  color: white;
}

/* ---------- Modals ---------- */
.modal-content{
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(47,107,255,.10);
  box-shadow: 0 18px 40px rgba(15,23,42,.20);
}
.modal-header{
  border-bottom: 1px solid rgba(255,255,255,.25) !important;
}

/* ---------- Helpers ---------- */
.required-star{ color: var(--danger); margin-left: 2px; font-weight: 900; }

.border-danger-custom{ border-color: rgba(239,68,68,.45) !important; }
.text-danger-custom{ color: #b91c1c !important; }

.divider{
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(47,107,255,.18) 15%, rgba(15,23,42,.08) 50%, rgba(47,107,255,.18) 85%, transparent 100%);
  margin: 18px 0;
}

/* fixed height boxes used in dashboard */
.fixed-h-box{ min-height: 180px; }

/* ---------- Login View (optional class hook) ---------- */
.login-bg{
  background: radial-gradient(900px 600px at 20% 10%, rgba(47,107,255,.25), transparent 60%),
              radial-gradient(700px 500px at 90% 15%, rgba(35,71,184,.18), transparent 55%),
              linear-gradient(135deg, #1f4fff 0%, #162a6a 100%) !important;
}

.login-card{
  background: rgba(255,255,255,.92) !important;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 22px !important;
  box-shadow: 0 22px 50px rgba(0,0,0,.22) !important;
}

/* ---------- Responsive spacing (mobile density) ---------- */
@media (max-width: 576px){
  .container{ padding-bottom: 92px; } /* space for bottom nav */
  .glass-card{ border-radius: 20px; }
  .scan-input{ font-size: .98rem; }
}

/* ✅ 배경 단차(끊김) 방지: html/body 동일 배경 + 고정 */
html, body {
  height: 100%;
  margin: 0;
  background: var(--bg, #f4f7ff);
  background-attachment: fixed;
}

/* body가 콘텐츠 높이까지만 칠해지는 경우 방지 */
body {
  min-height: 100vh;
}

/* =========================================================
   FLOATING MENU (mobile bottom tab sub menus)
   ========================================================= */
.floating-menu{
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h, 72px) + 18px);
  transform: translateX(-50%) translateY(8px);
  z-index: 1060; /* overlay(1050)보다 위 */
  width: min(240px, calc(100vw - 28px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.floating-menu.open{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* overlay 켜졌을 때 스크롤 잠금 (setOverlay에서 토글함) */
body.no-scroll{
  overflow: hidden;
  touch-action: none;
}

/* =========================================================
   NAVBAR BRAND (Logo + Text)
   ========================================================= */
.brand-link{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--brand) !important;
}

.brand-link svg{
  height: 28px;
  width: auto;
  display: block;
}

.brand-link .brand-text{
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.2px;
  color: currentColor;
}

@media (max-width: 576px){
  .brand-link svg{ height: 26px; }
}

/* =========================================================
	LOGIN BRAND (inline, one-line)
   ========================================================= */
.login-brand.inline{
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-bottom: 22px;
	white-space: nowrap;
}

.login-logo-svg{
	width: 34px;		/* ✅ 원하던 “좀 더 크게” */
	height: 34px;
	display: block;
	color: var(--brand);	/* ✅ 텍스트와 완전 동일 색 */
	shape-rendering: geometricPrecision;
}

.login-inline-text{
	font-size: 1.35rem;
	font-weight: 800;
	letter-spacing: -0.2px;
	line-height: 1;
	color: var(--brand);
}

@media (max-width: 576px){
	.login-logo-svg{
		width: 30px;
		height: 30px;
	}
	.login-inline-text{
		font-size: 1.35rem;
	}
}

.summary-value {
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;

  font-size: 1.25rem;
  font-weight: 700;
  color: #1f2430;
}

.summary-sub { font-size: 0.8rem; }

/* 정산 대장용 (첫번째 열 고정) */
.sticky-start {
    position: sticky;
    left: 0;
    z-index: 2; 
}
thead .sticky-start {
    z-index: 10 !important; 
}

/* 공통 모달(미처리 관리) - 미사용 처리된 날짜 입력 시각화 */
#sp_dates_group input:disabled {
    background: rgba(148, 163, 184, 0.15);
    opacity: 0.9;
}
