:root {
  --bg: #f4f8fb;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #0f172a;
  --muted: #4b5563;
  --sky: #0284c7;
  --sky-soft: #e0f2fe;
  --emerald: #059669;
  --indigo: #4f46e5;
  --amber: #f59e0b;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
}

* { box-sizing: border-box; }

body.page {
  margin: 0;
  min-height: 100vh;
  font-family: 'Pretendard', 'Noto Sans KR', system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle at 20% 20%, rgba(2,132,199,0.08), transparent 30%),
    radial-gradient(circle at 80% 0%, rgba(79,70,229,0.09), transparent 35%),
    linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  color: var(--text);
}

.inner {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

/* =============================
   Navigation
   ============================= */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(229, 231, 235, 0.7);
}
.nav .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  height: 42px;
  width: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--sky), #22c55e);
  color: #fff;
  font-weight: 700;
  box-shadow: var(--shadow);
}
.brand-domain {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
}
.brand-title {
  margin: 2px 0 0 0;
  font-size: 18px;
  font-weight: 700;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 18px;
  font-weight: 600;
  font-size: 14px;
}
.nav-links a {
  color: var(--text);
  text-decoration: none;
}
.nav-links a:hover {
  color: var(--sky);
}
.nav-links a.highlight {
  color: var(--sky);
}
.nav-links a.muted {
  color: #6b7280;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 10px;
  background: #fff;
  color: #475569;
  cursor: pointer;
}

.nav-mobile {
  display: none;
  flex-direction: column;
  padding: 0 20px 16px;
  gap: 10px;
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid var(--border);
}
.nav-mobile a {
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
}
.nav-mobile a:hover {
  color: var(--sky);
}

@media (min-width: 768px) {
  .nav-links { display: flex; }
  .nav-toggle { display: none; }
  .nav-mobile { display: none !important; }
}

.content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* =============================
   Generic cards / hero
   ============================= */

.hero {
  position: relative;
  overflow: hidden;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}
.gradient::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(2,132,199,0.12), transparent 35%),
    radial-gradient(circle at 85% 0%, rgba(79,70,229,0.12), transparent 30%),
    linear-gradient(120deg, rgba(255,255,255,0.85), rgba(236,253,245,0.6));
  opacity: 0.9;
  z-index: 0;
}
.hero > * {
  position: relative;
  z-index: 1;
}
.hero {
  padding: 40px;
}
.hero-title {
  margin: 10px 0;
  font-size: 34px;
  line-height: 1.2;
  font-weight: 800;
}
.lead {
  margin: 0 0 16px 0;
  font-size: 18px;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  background: var(--sky-soft);
  color: var(--sky);
}
.pill.soft {
  background: #f0f9ff;
  color: var(--text);
  margin-top: 14px;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0 10px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  font-size: 13px;
}
.btn.primary {
  background: linear-gradient(135deg, var(--sky), #0ea5e9);
  color: #fff;
  box-shadow: var(--shadow);
}
.btn.ghost {
  background: #fff;
  border-color: var(--border);
  color: var(--sky);
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  margin-top: 6px;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  background: #cbd5e1;
}
.dot.on {
  background: var(--emerald);
}
.dot.off {
  background: #cbd5e1;
}

.grid-3 {
  display: grid;
  gap: 16px;
  margin: 26px 0;
}
.grid-2 {
  display: grid;
  gap: 16px;
  margin: 10px 0;
}
@media (min-width: 768px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
}

.eyebrow {
  margin: 0 0 6px 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.eyebrow.sky { color: var(--sky); }
.eyebrow.green { color: var(--emerald); }
.eyebrow.indigo { color: var(--indigo); }
.eyebrow.amber { color: var(--amber); }

.card h3 {
  margin: 4px 0 8px 0;
  font-size: 20px;
}
.muted {
  color: var(--muted);
}
.list {
  padding-left: 16px;
  margin: 6px 0 0 0;
}
.list li {
  margin: 6px 0;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  background: #e2e8f0;
}
.badge.on {
  color: #065f46;
  background: #d1fae5;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.link-grid a {
  display: block;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
}
.link-grid a:hover {
  border-color: var(--sky);
  color: var(--sky);
  box-shadow: 0 8px 20px rgba(2,132,199,0.10);
}

.footer {
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.9);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px;
  color: #6b7280;
  font-size: 14px;
}
.footer-links {
  display: flex;
  gap: 16px;
}
.footer a {
  color: inherit;
  text-decoration: none;
}
.footer a:hover {
  color: var(--sky);
}

@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* =============================
   Form / common elements
   ============================= */

form {
  display: grid;
  gap: 12px;
}
input,
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 14px;
}
label {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}
button,
input[type=submit] {
  font-family: inherit;
}
button,
.btn-primary,
.btn-ghost {
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 12px;
  border: none;
  font-weight: 700;
  background: linear-gradient(135deg, #0284c7, #0ea5e9);
  color: #fff;
  box-shadow: 0 12px 30px rgba(14,165,233,0.28);
  cursor: pointer;
}
.btn-primary:hover {
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(14,165,233,0.25);
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}
.btn-ghost:hover {
  border-color: var(--sky);
  color: var(--sky);
  box-shadow: 0 8px 18px rgba(2,132,199,0.12);
}

.form-row-dual {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.form-row-dual > div {
  flex: 1;
  min-width: 260px;
}

/* Patrol activity create 공통 섹션 카드 스타일 재사용 */

.page-header {
  margin-bottom: 18px;
}
.page-header h1 {
  margin: 0 0 6px 0;
  font-size: 26px;
  font-weight: 800;
}
.page-header .lead {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 14px 0 18px 0;
}
.meta-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}
.meta-card label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: #64748b;
}
.meta-card input,
.meta-card select {
  width: 100%;
  border-radius: 10px;
}

.section-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
  margin-top: 12px;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px 0;
  font-size: 18px;
  font-weight: 800;
}
.section-sub {
  margin: 0 0 12px 0;
  font-size: 13px;
  color: var(--muted);
}

.count-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #ecfeff;
  color: #0369a1;
  font-weight: 700;
  font-size: 12px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.form-actions-top {
  margin-bottom: 12px;
}
.form-vertical {
  display: flex !important;
  flex-direction: column;
  gap: 16px;
}

/* Patrol activity 코스/목록 전용 레이아웃 */
.bg-white { background: #fff; }
.rounded-2xl { border-radius: 16px; }
.shadow-sm { box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06); }
.border { border: 1px solid var(--border); }
.border-slate-100 { border-color: #e5e7eb; }
.p-8 { padding: 24px; }
.space-y-4 > * + * { margin-top: 16px; }

.list-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: #f8fafc;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}
.panel h4 {
  margin: 0 0 8px 0;
  font-size: 15px;
}
.list-box {
  width: 100%;
  height: auto;
  min-height: 240px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #d9e0ea;
  background: #fff;
}
.empty-hint {
  margin: 8px 0 0 0;
  font-size: 13px;
  color: #94a3b8;
}

.course-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}
.btn-outline.active,
.btn-outline:hover {
  border-color: var(--sky);
  color: var(--sky);
  box-shadow: 0 6px 16px rgba(2,132,199,0.14);
}

.course-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 1.4fr;
  gap: 12px;
}
.course-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.course-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.course-card h5 {
  margin: 0 0 6px 0;
  font-size: 15px;
}
.course-card p {
  margin: 0;
  font-size: 13px;
  color: #475569;
}
.course-card:hover {
  border-color: var(--sky);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}
.course-card.active {
  border-color: var(--sky);
  box-shadow: 0 12px 28px rgba(2,132,199,0.12);
}

/* Mobile expand */
.nav-links.open {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 20px;
}
.nav-mobile.open {
  display: flex;
}

/* =============================
   Cashbook - Entry list page
   ============================= */

.cashbook-entry-card {
  max-width: 1100px;
  margin: 24px auto 0;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

/* 필터 영역 */
.cashbook-entry-filters select,
.cashbook-entry-filters input[type="date"] {
  border-radius: 10px;
  border: 1px solid #d4d9e1;
  font-size: 13px;
}

/* 리스트 카드 */
.cashbook-entry-list-card {
  max-width: 1100px;
  margin: 16px auto 40px;
}

/* 상단 "총 N건" pill */
.pill-small {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  color: #475569;
  background: #f8fafc;
}

/* 전표 테이블 기본 */
.cashbook-entry-table {
  font-size: 13px;
}

.cashbook-entry-table th,
.cashbook-entry-table td {
  padding: 8px 10px;
  vertical-align: middle;
}

.cashbook-entry-table thead th {
  background: #f8fafc;
  color: var(--text);
  font-weight: 700;
  border-bottom: 1px solid #e5e7eb;
}

.cashbook-entry-table tbody tr:hover {
  background: #f1f5f9;
}

/* thead 버튼 사이즈 조정 */
#entry-table th button.btn.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
}

/* ▶ 기본 상태: extra 컬럼 숨김 */
.cashbook-extra-col {
  display: none;
}

/* ▶ 펼친 상태: extra 컬럼 노출 */
.cashbook-table-expanded .cashbook-extra-col {
  display: table-cell;
}

/* ▶ 기본 상태: 더보기 컬럼 보임 */
.cashbook-toggle-col {
  /* 기본 display: table-cell (브라우저 기본값) */
}

/* ▶ 펼친 상태: 더보기 컬럼 숨김 */
.cashbook-table-expanded .cashbook-toggle-col {
  display: none;
}
.cashbook-entry-table td .btn.btn-sm {
  padding: 2px 8px;     /* 상하 패딩 줄이기 */
  font-size: 11px;      /* 글자 조금 줄이기 */
  line-height: 1.1;     /* 줄간격도 살짝 줄이기 */
}

/* 상세 단일항목 표시용 뱃지 */
.detail-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
}
.detail-pill-green {
  background: #e8f6ef;
  color: #198754;
  border: 1px solid #198754;
}
.detail-pill-warn {
  background: #fff4e5;
  color: #e59317;
  border: 1px solid #e59317;
}
.detail-pill-danger {
  background: #ffe8e8;
  color: #d9534f;
  border: 1px solid #d9534f;
}

.detail-panel {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
}

.detail-panel .btn.btn-xs {
  padding: 2px 6px;
  font-size: 11px;
}

.detail-inline-row {
  margin-top: 8px;
}
.detail-inline-row .form-control,
.detail-inline-row select {
  height: 34px;
  padding-top: 4px;
  padding-bottom: 4px;
  font-size: 13px;
}
.detail-inline-row .btn.btn-sm {
  height: 34px;
  font-size: 12px;
  padding: 4px 10px;
}

/* 이미지 프리뷰 */
.thumb-tooltip {
  position: fixed;
  z-index: 1060;
  padding: 6px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.thumb-tooltip img {
  max-width: 200px;
  max-height: 200px;
  display: block;
}

.image-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1070;
  display: none;
}
.image-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1080;
}
.image-modal .modal-inner {
  position: relative;
  background: #fff;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  max-width: 90%;
  max-height: 90%;
}
.image-modal img {
  max-width: 100%;
  max-height: 80vh;
  display: block;
}
.image-modal .close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  border: none;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
/* 상세 패널 인라인 행 - 항상 가로 플렉스 */
.detail-panel .detail-inline-row {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

/* 첫 번째(대원)만 넓게, 나머지는 내용 크기대로 */
.detail-panel .detail-inline-row > .flex-grow-1 {
  flex: 0 0 210px;
  max-width: 230px;
}
.detail-panel .detail-inline-row > div {
  flex: 0 0 auto;
}

/* 식비 행 내 라벨 높이 보정: 첫 행/이후 행 동일한 간격 */
.detail-panel .meal-row {
  position: relative;
  padding-top: 0;
}

/* 식비 행 입력 높이/폭 압축 */
.detail-panel .meal-row .form-control,
.detail-panel .meal-row .form-select {
  padding: 6px 10px;
  min-height: 34px;
  font-size: 13px;
}
.detail-panel .meal-row .unit-input {
  min-width: 110px;
  max-width: 130px;
}
.detail-panel .meal-row .memo-slot {
  min-width: 120px;
}

/* Toggle switch (volunteer setting) */
.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  appearance: none;
  -webkit-appearance: none;
  pointer-events: none;
  background: transparent !important;
}
.switch .slider {
  display: block;
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #e5e7eb;
  transition: 0.2s;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px #cbd5e1;
}
.switch .slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.switch input:checked + .slider {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: inset 0 0 0 1px rgba(34,197,94,0.25);
}
.switch input:checked + .slider:before {
  transform: translateX(24px);
}


/* 직업 카드: 라벨은 위에, 입력칸은 맨 아래로 내려서 높이 맞추기 */
.meta-card.meta-card-job {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
