/* =====================================================================
   UNICORNS 운영실 — design system
   Ice rink palette: deep navy ink, ice blue accent, cool neutrals.
   ===================================================================== */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css");

:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e8ef;
  --border-light: #eef1f6;

  --text-primary: #0f1729;
  --text-secondary: #4a5568;
  --text-muted: #8a94a6;

  --ink: #0b1324;
  --ink-2: #131d33;
  --ink-text: #c8d1e1;
  --ink-muted: #6b7a96;

  --accent: #2458e6;
  --accent-hover: #1b47c4;
  --accent-soft: #eaf0ff;
  --accent-ring: rgba(36, 88, 230, .18);
  --ice: #5ccfe6;

  --green: #0f9d63;
  --green-bg: #e8f7f0;
  --green-border: #bfe9d6;
  --red: #dc3545;
  --red-bg: #fdeef0;
  --red-border: #f7cdd3;
  --yellow: #b7791f;
  --yellow-bg: #fdf6e7;
  --yellow-border: #f3e0b5;
  --blue: #2458e6;
  --blue-bg: #eaf0ff;
  --violet: #6d4bd8;
  --violet-bg: #f1edfd;

  --sidebar-w: 248px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 41, .04), 0 1px 3px rgba(15, 23, 41, .05);
  --shadow-lg: 0 8px 24px rgba(15, 23, 41, .08), 0 2px 6px rgba(15, 23, 41, .04);
  --mono: 'SF Mono', 'JetBrains Mono', Consolas, monospace;
}

/* ===================================================================== Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'tnum' 1;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }

/* ===================================================================== Layout */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--ink);
  background-image: radial-gradient(120% 60% at 0% 0%, rgba(92, 207, 230, .10), transparent 60%);
  color: var(--ink-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
}
.sidebar-brand { padding: 22px 18px 18px; }
.brand-link { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand-link:hover { color: #fff; }
.brand-mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--ice), var(--accent));
  color: #fff; font-weight: 800; font-size: 17px;
  box-shadow: 0 4px 14px rgba(36, 88, 230, .45);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-weight: 800; letter-spacing: 3px; font-size: 14.5px; }
.brand-sub { font-size: 11px; color: var(--ink-muted); letter-spacing: .2px; }

.sidebar-nav { list-style: none; padding: 4px 12px 12px; flex: 1; overflow-y: auto; }
.sidebar-nav li { margin: 1px 0; }
.nav-section {
  font-size: 10.5px; font-weight: 700; letter-spacing: 1.2px;
  color: var(--ink-muted); padding: 16px 10px 6px; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-text);
  font-size: 13.5px; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: rgba(92, 207, 230, .12); color: #fff; box-shadow: inset 2px 0 0 var(--ice); }
.nav-icon {
  width: 17px; height: 17px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  opacity: .85;
}
.nav-badge {
  margin-left: auto; font-size: 10px; font-weight: 700;
  padding: 1px 7px; border-radius: 100px;
  background: rgba(92, 207, 230, .18); color: var(--ice);
}
.sidebar-footer {
  padding: 12px; border-top: 1px solid rgba(255, 255, 255, .06);
  display: flex; flex-direction: column; gap: 6px;
}
.sidebar-footer .nav-item.small { font-size: 12.5px; }
.btn-logout {
  width: 100%; padding: 7px 12px;
  background: transparent; border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--radius-sm); color: var(--ink-muted);
  cursor: pointer; font-size: 12.5px; transition: all .15s;
}
.btn-logout:hover { border-color: rgba(220, 53, 69, .6); color: #ff8b97; }

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1; min-width: 0;
  padding: 32px 40px 64px;
  min-height: 100vh;
  max-width: calc(1280px + var(--sidebar-w));
}

/* ===================================================================== Page header */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; gap: 12px; flex-wrap: wrap;
}
.page-header-left, .page-header-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-title { font-size: 24px; font-weight: 750; letter-spacing: -.5px; }
.page-subtitle { color: var(--text-muted); font-size: 13.5px; margin-top: 2px; }
.eyebrow {
  font-size: 11.5px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 4px;
}

/* ===================================================================== Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  font-weight: 650; font-size: 14px;
}
.card-header-link { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }
.card-header-link:hover { color: var(--accent); }
.card-sub { font-size: 12.5px; color: var(--text-muted); font-weight: 400; }
.card-body { padding: 20px; }
.card-body.p-0 { padding: 0; overflow-x: auto; }
.card + .card { margin-top: 16px; }

/* ===================================================================== Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  white-space: nowrap; line-height: 1.4;
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 1px 2px rgba(36, 88, 230, .3); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text-primary); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-2); border-color: #cfd6e2; color: var(--text-primary); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--border-light); color: var(--text-primary); }
.btn-danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger:hover { background: #bb2d3b; color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--red); }
.btn-danger-ghost:hover { background: var(--red-bg); color: var(--red); }
.btn-full { width: 100%; }
.btn-lg { padding: 11px 20px; font-size: 14.5px; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn-xs { padding: 2px 8px; font-size: 11.5px; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }
.btn .nav-icon, .btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ===================================================================== Forms */
.form-group { margin-bottom: 16px; }
.form-group label, .form-label {
  display: block; font-size: 13px; font-weight: 600;
  margin-bottom: 6px; color: var(--text-secondary);
}
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.form-control:hover { border-color: #cfd6e2; }
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
textarea.form-control { resize: vertical; line-height: 1.55; }
select.form-control { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-light);
}
.field-error { display: block; font-size: 12px; color: var(--red); margin-top: 4px; }
.field-hint { display: block; font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.required { color: var(--red); }

/* ===================================================================== Table */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table thead tr { background: var(--surface-2); border-bottom: 1px solid var(--border); }
.table th {
  padding: 10px 16px; text-align: left;
  font-weight: 600; color: var(--text-muted);
  font-size: 12px; letter-spacing: .02em; white-space: nowrap;
}
.table td { padding: 11px 16px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fafbfd; }
.table-link { font-weight: 600; color: var(--text-primary); }
.table-link:hover { color: var(--accent); }
.table-actions { text-align: right; white-space: nowrap; }
.table-footer { padding: 12px 16px; border-top: 1px solid var(--border-light); text-align: right; background: var(--surface-2); }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* ===================================================================== Alerts */
.alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: 13.5px; margin-bottom: 16px; border: 1px solid;
}
.alert-success { background: var(--green-bg); border-color: var(--green-border); color: #0b7a4c; }
.alert-error { background: var(--red-bg); border-color: var(--red-border); color: #b42332; }
.alert-warning { background: var(--yellow-bg); border-color: var(--yellow-border); color: #8a5a12; }
.alert-info { background: var(--accent-soft); border-color: #cbd9ff; color: #1d3f9e; }

/* ===================================================================== Badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 100px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 1.6;
}
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge-gray, .badge-secondary { background: var(--border-light); color: var(--text-secondary); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-violet { background: var(--violet-bg); color: var(--violet); }
.badge-exec { background: var(--ink); color: #fff; font-size: 10.5px; padding: 1px 7px; vertical-align: middle; }

/* ===================================================================== Stats */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px; margin-bottom: 24px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.stat-label { font-size: 12.5px; color: var(--text-muted); font-weight: 600; margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: 750; letter-spacing: -.8px; line-height: 1.2; margin-bottom: 6px; }
.stat-value small { font-size: 14px; font-weight: 600; color: var(--text-muted); margin-left: 2px; letter-spacing: 0; }
.stat-meta { font-size: 12px; color: var(--text-muted); }
.stat-link { font-size: 12.5px; color: var(--accent); font-weight: 600; }
.stat-link:hover { text-decoration: underline; }
.stat-green .stat-value { color: var(--green); }
.stat-red .stat-value { color: var(--red); }
.stat-accent { background: linear-gradient(135deg, #1b47c4, #2458e6 55%, #3aa6de); border: none; color: #fff; }
.stat-accent .stat-label, .stat-accent .stat-meta { color: rgba(255, 255, 255, .75); }
.stat-accent .stat-link { color: #fff; }

/* ===================================================================== Dashboard */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dashboard-grid .card + .card { margin-top: 0; }
.hero {
  position: relative; overflow: hidden;
  border-radius: 16px; padding: 28px 30px; margin-bottom: 20px;
  background: var(--ink);
  background-image:
    radial-gradient(80% 120% at 100% 0%, rgba(92, 207, 230, .28), transparent 55%),
    radial-gradient(60% 90% at 0% 100%, rgba(36, 88, 230, .35), transparent 60%);
  color: #fff;
  display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
}
.hero h2 { font-size: 22px; font-weight: 750; letter-spacing: -.4px; margin-bottom: 4px; }
.hero p { color: #b7c3da; font-size: 13.5px; }
.hero .btn-primary { background: #fff; color: var(--ink); border-color: #fff; box-shadow: none; }
.hero .btn-primary:hover { background: #e8eefc; color: var(--ink); }
.hero .hero-check { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .25); }
.hero .hero-check:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.hero-roster { font-size: 13px; color: #dfe7f7; margin-top: 10px; display: flex; gap: 16px; flex-wrap: wrap; }
.hero-roster b { color: #fff; font-size: 18px; margin-right: 3px; }

.simple-list { list-style: none; }
.simple-list-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border-light);
}
.simple-list-item:last-child { border-bottom: none; }
.list-title { font-size: 13.5px; font-weight: 600; }
.list-meta { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* ===================================================================== Auth */
.auth-body {
  background: var(--ink);
  background-image:
    radial-gradient(70% 60% at 85% 10%, rgba(92, 207, 230, .22), transparent 60%),
    radial-gradient(60% 60% at 10% 90%, rgba(36, 88, 230, .35), transparent 60%);
}
.auth-container { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 24px 16px; }
.auth-card {
  background: var(--surface); border-radius: 18px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .35);
  padding: 36px 32px; width: 100%; max-width: 400px;
}
.auth-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 800; letter-spacing: 3px; margin-bottom: 20px;
}
.auth-brand::before {
  content: "U"; width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 10px; letter-spacing: 0; color: #fff; font-size: 16px;
  background: linear-gradient(135deg, var(--ice), var(--accent));
}
.auth-title { font-size: 20px; font-weight: 750; letter-spacing: -.3px; margin-bottom: 20px; }
.auth-form .form-group { margin-bottom: 14px; }
.auth-form .btn-full { margin-top: 8px; padding: 11px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-muted); }
.auth-footer a { color: var(--accent); font-weight: 600; }

/* ===================================================================== Search / detail / key */
.search-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search-input { max-width: 300px; }
.detail-list { display: grid; grid-template-columns: 120px 1fr; }
.detail-list dt, .detail-list dd { padding: 11px 0; border-bottom: 1px solid var(--border-light); }
.detail-list dt { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.detail-list dd { font-size: 13.5px; }
.detail-list dt:last-of-type, .detail-list dd:last-of-type { border-bottom: none; }
.key-display {
  padding: 14px 16px; background: var(--surface-2);
  border: 1px dashed #cfd6e2; border-radius: var(--radius-sm); margin-bottom: 16px;
}
.key-display code { font-size: 18px; font-weight: 700; letter-spacing: 2px; font-family: var(--mono); }

/* ===================================================================== Attendance */
.radio-group { display: flex; gap: 12px; flex-wrap: wrap; }
.radio-label { display: flex; align-items: center; gap: 5px; cursor: pointer; font-size: 13px; color: var(--text-secondary); }
.radio-label input { cursor: pointer; accent-color: var(--accent); }
.status-present { color: var(--green); font-weight: 600; }
.status-late { color: var(--yellow); font-weight: 600; }
.status-absent { color: var(--red); font-weight: 600; }
.status-excused { color: var(--blue); font-weight: 600; }
.attendance-table .attend-radio { width: 19px; height: 19px; cursor: pointer; }
.attendance-table .attend-present { accent-color: var(--green); }
.attendance-table .attend-late { accent-color: var(--yellow); }
.attendance-table .attend-excused { accent-color: var(--blue); }
.attendance-table .attend-absent { accent-color: var(--red); }

.progress-wrap { display: flex; align-items: center; gap: 8px; }
.progress-bar { height: 6px; border-radius: 100px; min-width: 4px; max-width: 80px; transition: width .3s; }
.progress-green { background: var(--green); }
.progress-yellow { background: var(--yellow); }
.progress-red { background: var(--red); }

/* ===================================================================== Schedule */
.schedule-list { padding: 0; }
.schedule-item { display: flex; align-items: flex-start; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--border-light); }
.schedule-item:last-child { border-bottom: none; }
.schedule-date {
  display: flex; flex-direction: column; align-items: center;
  min-width: 48px; padding: 6px 8px;
  background: var(--accent-soft); color: var(--accent);
  border-radius: var(--radius-sm); text-align: center;
}
.schedule-month { font-size: 11px; font-weight: 700; }
.schedule-day { font-size: 20px; font-weight: 800; line-height: 1.2; }
.schedule-info { flex: 1; min-width: 0; }
.schedule-title { font-size: 14px; font-weight: 650; margin-bottom: 2px; }
.schedule-time { font-size: 12px; color: var(--text-muted); margin-bottom: 3px; }
.schedule-desc { font-size: 12.5px; color: var(--text-secondary); }
.schedule-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ===================================================================== Gallery */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin-bottom: 24px; }
.post-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: block; transition: box-shadow .2s, transform .2s;
}
.post-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); color: inherit; }
.post-card-thumb { aspect-ratio: 4/3; background: var(--surface-2); display: flex; align-items: center; justify-content: center; position: relative; }
.post-card-thumb img, .post-card-thumb video { width: 100%; height: 100%; object-fit: cover; }
.post-card-no-media { color: var(--text-muted); font-size: 12px; }
.post-media-count {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(11, 19, 36, .65); color: #fff;
  font-size: 11px; padding: 2px 8px; border-radius: 100px;
}
.post-card-body { padding: 12px 14px; }
.post-card-title { font-size: 14px; font-weight: 650; margin-bottom: 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.post-card-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); }
.post-meta { font-size: 13px; color: var(--text-muted); }
.separator { margin: 0 6px; }
.post-content { white-space: pre-wrap; line-height: 1.75; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.media-item { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.media-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.media-video { width: 100%; display: block; }
.media-filename { padding: 6px 10px; font-size: 11px; color: var(--text-muted); border-top: 1px solid var(--border-light); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.existing-media { display: flex; flex-wrap: wrap; gap: 10px; }
.existing-media-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12.5px;
}
.existing-media-thumb { width: 36px; height: 36px; object-fit: cover; border-radius: 4px; }
.existing-media-name { max-width: 160px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }
.page-info { font-size: 13px; color: var(--text-muted); }

/* ===================================================================== Calendar */
.calendar-nav { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.calendar-title { font-size: 18px; font-weight: 750; min-width: 140px; text-align: center; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.calendar-dow { text-align: center; font-size: 12px; font-weight: 700; color: var(--text-muted); padding: 6px 0; }
.calendar-dow.tue, .calendar-dow.sat { color: var(--accent); }
.calendar-cell {
  min-height: 92px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px 8px; background: var(--surface);
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.calendar-cell.empty { background: transparent; border-color: transparent; }
.calendar-cell.activity-day { background: #f4f8ff; border-color: #cddcff; }
.calendar-cell.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cell-header { display: flex; align-items: center; justify-content: space-between; gap: 2px; min-height: 20px; }
.calendar-day-num { font-size: 13px; font-weight: 650; }
.calendar-day-num.sun { color: var(--red); }
.calendar-day-num.sat { color: var(--accent); }
.cell-add-btns { display: flex; gap: 3px; }
.cal-add-mini {
  font-size: 10px; border: 1px solid var(--border); border-radius: 4px; padding: 0 4px;
  color: var(--text-secondary); line-height: 1.6; white-space: nowrap;
}
.cal-add-mini:hover { background: var(--surface-2); }
.cal-add-mini.session { border-color: #b9ccff; color: var(--accent); }
.cal-add-mini.session:hover { background: var(--accent); color: #fff; }
.cal-add-mini.event { border-color: var(--green-border); color: var(--green); }
.cal-add-mini.event:hover { background: var(--green); color: #fff; }
.cal-session-link, .cal-event-link {
  font-size: 11px; color: #fff; border-radius: 5px; padding: 2px 6px;
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-session-link { background: var(--accent); }
.cal-event-link { background: var(--green); }
.cal-session-link:hover, .cal-event-link:hover { color: #fff; filter: brightness(1.08); }
.cal-new-link { font-size: 11px; color: var(--accent); }
.calendar-legend { font-size: 12px; color: var(--text-muted); margin-top: 8px; display: flex; gap: 14px; flex-wrap: wrap; }
.legend-activity, .legend-today, .legend-session { color: var(--accent); }
.legend-event { color: var(--green); }

/* ===================================================================== Misc (legacy) */
.input-with-unit { display: flex; align-items: center; gap: 8px; }
.input-unit { font-size: 13px; color: var(--text-secondary); white-space: nowrap; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.settings-fee-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.row-inactive { opacity: .5; }
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.checkbox-label input { accent-color: var(--accent); width: 16px; height: 16px; }
.guest-inline { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.guest-count-input { width: 56px; text-align: center; padding: 4px 6px; }
.guest-amount-val { font-size: 13.5px; min-width: 70px; text-align: right; }

/* ===================================================================== Utilities */
.text-muted { color: var(--text-muted); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-yellow { color: var(--yellow); }
.text-blue { color: var(--blue); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.p-0 { padding: 0; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-8 { padding-top: 32px; padding-bottom: 32px; }
.py-16 { padding-top: 64px; padding-bottom: 64px; }
.empty-state { text-align: center; color: var(--text-muted); font-size: 13.5px; }

/* =====================================================================
   정회원 산정
   ===================================================================== */
.ms-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.ms-grid > * { min-width: 0; }
.ms-side .card + .card { margin-top: 16px; }
.ms-grid.has-result { grid-template-columns: minmax(0, 1fr); }
.ms-grid.has-result .ms-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.ms-grid.has-result .ms-side .card + .card { margin-top: 0; }

.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center; padding: 28px 16px;
  border: 1.5px dashed #c3cde0; border-radius: var(--radius);
  background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone-icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--accent); margin-bottom: 4px;
}
.dropzone-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dropzone-title { font-weight: 650; font-size: 14px; }
.dropzone-hint { font-size: 12.5px; color: var(--text-muted); }
.dropzone-file { font-size: 13px; font-weight: 600; color: var(--accent); }

details.disclosure { border-top: 1px solid var(--border-light); margin-top: 16px; padding-top: 14px; }
details.disclosure > summary {
  cursor: pointer; list-style: none; font-size: 13px; font-weight: 600; color: var(--text-secondary);
  display: flex; align-items: center; gap: 6px;
}
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::before { content: "›"; font-size: 16px; transition: transform .15s; display: inline-block; }
details.disclosure[open] > summary::before { transform: rotate(90deg); }
details.disclosure > .disclosure-body { margin-top: 12px; }
.roster-input { font-family: inherit; font-size: 13px; min-height: 180px; }

.rule-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.rule-list li { display: flex; gap: 10px; font-size: 13px; color: var(--text-secondary); }
.rule-tag {
  flex-shrink: 0; width: 34px; height: 22px; display: grid; place-items: center;
  border-radius: 6px; font-size: 11px; font-weight: 800;
}
.rule-tag.yb { background: var(--accent-soft); color: var(--accent); }
.rule-tag.ob { background: var(--violet-bg); color: var(--violet); }
.rule-list b { color: var(--text-primary); font-weight: 650; }

.period-bar {
  display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap;
  padding: 14px 20px; background: var(--surface-2); border-bottom: 1px solid var(--border-light);
}
.period-bar .form-label { margin: 0; }
.month-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.month-chip input { position: absolute; opacity: 0; pointer-events: none; }
.month-chip span {
  display: inline-block; padding: 5px 11px; border-radius: 100px; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary);
  cursor: pointer; transition: all .12s; user-select: none;
}
.month-chip span:hover { border-color: #b9ccff; }
.month-chip input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.month-chip input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-ring); }
.inline-fields { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline-field { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-secondary); }
.inline-field .form-control { width: 70px; padding: 5px 8px; font-size: 13px; }

.summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--border-light); }
.summary-item { padding: 16px 20px; border-right: 1px solid var(--border-light); }
.summary-item:last-child { border-right: none; }
.summary-item .stat-label { margin-bottom: 2px; }
.summary-item .stat-value { font-size: 24px; margin: 0; }
.summary-item .stat-meta { margin-top: 2px; }

.announce-box { position: relative; }
.announce-text {
  font-family: inherit; font-size: 14px; line-height: 1.75; min-height: 220px;
  background: var(--surface-2); border-color: var(--border-light); white-space: pre;
}
.announce-actions { display: flex; gap: 8px; justify-content: space-between; align-items: center; margin-top: 12px; flex-wrap: wrap; }

.warn-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.warn-list li { font-size: 12.5px; color: #7a5210; padding-left: 14px; position: relative; line-height: 1.5; }
.warn-list li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--yellow); }

.tabs { display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--border-light); overflow-x: auto; }
.tab {
  padding: 12px 12px 10px; font-size: 13.5px; font-weight: 600; color: var(--text-muted);
  border: none; background: none; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab .count { font-size: 11.5px; margin-left: 4px; padding: 0 6px; border-radius: 100px; background: var(--border-light); color: var(--text-secondary); }
.tab.active .count { background: var(--accent-soft); color: var(--accent); }
.tab-panel[hidden] { display: none; }

.verdict-table td { padding: 9px 12px; }
.verdict-table th { padding: 9px 12px; }
.verdict-table td:first-child, .verdict-table th:first-child { padding-left: 18px; }
.verdict-table tr.is-qualified td:first-child { box-shadow: inset 3px 0 0 var(--green); }
.verdict-table tr.is-review td:first-child { box-shadow: inset 3px 0 0 var(--yellow); }
.verdict-table tr:target td { background: #fffbea; }
.v-name { font-weight: 650; white-space: nowrap; }
.v-source { display: block; font-size: 11.5px; color: var(--text-muted); font-weight: 400; white-space: nowrap; line-height: 1.35; }
.v-source.inferred { color: var(--yellow); }
.v-pick { width: 18px; height: 18px; accent-color: var(--green); cursor: pointer; vertical-align: middle; }

.month-cell { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; min-width: 40px; }
.pay-pill {
  display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 6px;
  border-radius: 6px; font-size: 11px; font-weight: 800; letter-spacing: .3px;
}
.pay-YB { background: var(--accent-soft); color: var(--accent); }
.pay-F { background: var(--violet-bg); color: var(--violet); }
.pay-H { background: #f5eefe; color: #9a5bd6; border: 1px dashed #d9c3f3; }
.pay-none { background: var(--red-bg); color: var(--red); }
.att-count { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.att-count .raw { opacity: .6; margin-right: 1px; }
.att-count .guest { color: var(--yellow); }

.att-meter { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.att-meter-track { position: relative; flex: 1; height: 6px; border-radius: 100px; background: var(--border-light); overflow: visible; }
.att-meter-fill { position: absolute; inset: 0 auto 0 0; border-radius: 100px; background: #9fb4e8; }
.att-meter-fill.ok { background: var(--green); }
.att-meter-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text-primary); opacity: .5; border-radius: 1px; }
.att-meter-num { font-size: 12px; font-weight: 600; white-space: nowrap; min-width: 38px; text-align: right; }

.group-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; background: var(--surface); }
.group-switch button {
  border: none; background: none; padding: 3px 8px; font-size: 11.5px; font-weight: 600;
  color: var(--text-muted); cursor: pointer; border-right: 1px solid var(--border-light);
}
.group-switch button:last-child { border-right: none; }
.group-switch button:hover { background: var(--surface-2); color: var(--text-primary); }
.group-switch button.on { background: var(--ink); color: #fff; }
.group-switch button.auto.on { background: var(--border-light); color: var(--text-secondary); }

.status-pill { font-size: 11.5px; }
.reason { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 2px; min-width: 110px; max-width: 220px; line-height: 1.4; }

.history-list { list-style: none; }
.history-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 11px 0; border-bottom: 1px solid var(--border-light); }
.history-item:last-child { border-bottom: none; }
.history-title { font-weight: 650; font-size: 13.5px; }
.history-meta { font-size: 12px; color: var(--text-muted); }
.review-text {
  white-space: pre-wrap; font-size: 13.5px; line-height: 1.75; padding: 16px 18px;
  background: var(--surface-2); border-radius: var(--radius-sm); border: 1px solid var(--border-light);
}
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.review-grid .card + .card { margin-top: 0; }

.step-num {
  width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; margin-right: 4px;
}
.step-num.muted { background: var(--border); color: var(--text-secondary); }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px;
  font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }


/* =====================================================================
   회원 명단 · 회비 관리 · 가져오기
   ===================================================================== */
.num { font-variant-numeric: tabular-nums; }
.pay-G { background: var(--yellow-bg); color: var(--yellow); }
.pay-empty { background: transparent; border: 1px dashed var(--border); min-width: 30px; }
.row-quiet td { color: var(--text-muted); }
.row-quiet .table-link { color: var(--text-secondary); }
.table tfoot td { padding: 11px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }

.filter-bar { display: flex; gap: 10px 12px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filter-bar .search-bar { margin-left: auto; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a {
  padding: 5px 11px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--text-secondary);
  display: inline-flex; gap: 6px; align-items: center; white-space: nowrap;
}
.seg a b { font-weight: 700; color: var(--text-muted); font-size: 12px; }
.seg a:hover { background: var(--surface-2); color: var(--text-primary); }
.seg a.on { background: var(--ink); color: #fff; }
.seg a.on b { color: rgba(255, 255, 255, .7); }

.split-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.split-grid + .card, .split-grid .card + .card { margin-top: 0; }
.split-grid + .card { margin-top: 16px; }
.profile-grid { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); margin-top: 0; }

/* 차트: 월별 수입·지출 (색은 dataviz 검증: #2458e6 / #e07b39) */
.chart-legend { display: flex; gap: 14px; font-size: 12.5px; font-weight: 500; color: var(--text-secondary); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.swatch-income { background: #2458e6; }
.swatch-expense { background: #e07b39; }
.bar-chart { display: flex; align-items: stretch; gap: 6px; height: 270px; }
.bar-group {
  position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center;
  border-radius: 8px; padding: 0 2px 6px; color: inherit;
}
.bar-group:hover { background: var(--surface-2); color: inherit; }
.bars {
  flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px;
  border-bottom: 1px solid var(--border);
  background-image: linear-gradient(to top, var(--border-light) 1px, transparent 1px);
  background-size: 100% 25%;
}
.bar { width: min(22px, 38%); border-radius: 4px 4px 0 0; min-height: 2px; }
.bar-income { background: #2458e6; }
.bar-expense { background: #e07b39; }
.bar-label { font-size: 12px; font-weight: 650; color: var(--text-secondary); margin-top: 6px; }
.bar-sub { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.chart-tip {
  position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; border-radius: 9px; padding: 9px 11px; font-size: 12px;
  display: flex; flex-direction: column; gap: 3px; white-space: nowrap; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 5;
}
.chart-tip span { display: flex; align-items: center; gap: 6px; color: #c8d1e1; }
.chart-tip em { font-style: normal; color: #fff; margin-left: auto; padding-left: 10px; font-weight: 600; }
.bar-group:hover .chart-tip, .bar-group:focus-visible .chart-tip { opacity: 1; }
.bar-group:nth-child(-n+2) .chart-tip { left: 0; transform: none; }
.bar-group:nth-last-child(-n+2) .chart-tip { left: auto; right: 0; transform: none; }

/* 잔액 흐름 */
.flow-strip { display: flex; align-items: center; gap: 8px; padding: 18px 20px; flex-wrap: wrap; border-bottom: 1px solid var(--border-light); }
.flow-item { flex: 1; min-width: 120px; }
.flow-value { font-size: 20px; font-weight: 750; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.flow-op { font-size: 18px; color: var(--text-muted); font-weight: 600; }
.flow-result { background: var(--accent-soft); border-radius: 10px; padding: 8px 12px; }
.flow-result .flow-value { color: var(--accent); }

.check-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.check-list li { display: flex; gap: 8px; align-items: baseline; font-size: 13px; color: var(--text-secondary); flex-wrap: wrap; }
.check-list b { color: var(--text-primary); min-width: 90px; }
.check-icon {
  width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 800; flex-shrink: 0; align-self: center;
}
.check-list .ok .check-icon { background: var(--green-bg); color: var(--green); }
.check-list .bad .check-icon { background: var(--yellow-bg); color: var(--yellow); }
.check-list .bad { color: #7a5210; }

.amount-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.amount-list li { display: grid; grid-template-columns: minmax(90px, 150px) 1fr auto; gap: 12px; align-items: center; font-size: 13px; }
.al-label { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-label small { color: var(--text-muted); font-weight: 500; margin-left: 2px; }
.al-bar { height: 8px; background: var(--border-light); border-radius: 100px; overflow: hidden; }
.al-bar i { display: block; height: 100%; border-radius: 100px; min-width: 2px; }
.al-bar i.income { background: #2458e6; }
.al-bar i.expense { background: #e07b39; }
.al-amount { font-weight: 650; text-align: right; min-width: 80px; }
.amount-list .empty-state { display: block; }

.memo-list li { color: var(--text-secondary); }
.day-chips { display: inline-flex; flex-wrap: wrap; gap: 3px; margin-left: 8px; vertical-align: middle; }
.day-chips span {
  font-size: 11px; font-weight: 600; min-width: 22px; text-align: center; padding: 1px 4px;
  border-radius: 5px; background: var(--accent-soft); color: var(--accent);
}

.name-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.name-cloud span { font-size: 12.5px; padding: 3px 9px; border-radius: 100px; background: var(--surface-2); border: 1px solid var(--border-light); }
.sticky-actions {
  position: sticky; bottom: 0; margin-top: 16px; padding: 12px 16px; z-index: 5;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(6px);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.stored-card { border-color: #cbd9ff; background: linear-gradient(135deg, #f4f7ff, #fff 60%); margin-bottom: 16px; }
.stored-body { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.stat-value.text-yellow, .stat-value.text-green { color: inherit; }
.stat-value.text-yellow span { color: var(--yellow); }
.stat-value.text-green span { color: var(--green); }

@media (max-width: 900px) {
  .split-grid, .profile-grid { grid-template-columns: 1fr; }
  .filter-bar .search-bar { margin-left: 0; width: 100%; }
  .filter-bar .search-input { max-width: none; }
  .bar-chart { height: 200px; gap: 2px; }
  .bar-sub { display: none; }
  .flow-op { display: none; }
}


/* =====================================================================
   일정 · 출석
   ===================================================================== */
.cal-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--border-light); }
.cal-toolbar .calendar-nav { margin: 0; }
.cal-summary { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-secondary); font-weight: 500; }
.calendar-dow.sun { color: var(--red); }
.calendar-cell { min-height: 104px; }
.calendar-cell.no-session { background: repeating-linear-gradient(135deg, var(--surface), var(--surface) 6px, var(--surface-2) 6px, var(--surface-2) 12px); }
.cell-header .cal-add-mini { opacity: 0; transition: opacity .12s; margin-left: auto; }
.calendar-cell:hover .cal-add-mini { opacity: 1; }
.cal-att {
  font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 100px; line-height: 18px;
  background: var(--green-bg); color: var(--green); margin-left: auto;
}
.cal-att:hover { background: var(--green); color: #fff; }
.cal-att.zero { background: var(--border-light); color: var(--text-muted); }
.cell-header .cal-att + .cal-add-mini { margin-left: 4px; }
.cal-ev {
  display: block; border-radius: 6px; padding: 3px 6px; font-size: 11px; line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 3px solid;
}
.cal-ev b { font-weight: 650; }
.cal-ev span { display: block; opacity: .8; font-variant-numeric: tabular-nums; }
.ev-practice { background: var(--accent-soft); color: #1d3f9e; border-color: var(--accent); }
.ev-game { background: #fff1e6; color: #9a4a12; border-color: #e07b39; }
.ev-extra { background: var(--green-bg); color: #0b6b44; border-color: var(--green); }
.ev-event { background: var(--violet-bg); color: #4a32a8; border-color: var(--violet); }
.cal-ev:hover { filter: brightness(.97); }
.cal-note { font-size: 10.5px; color: var(--text-muted); }
.calendar-legend { display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: center; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.lg-practice { background: var(--accent); }
.lg-game { background: #e07b39; }
.lg-extra { background: var(--green); }
.lg-event { background: var(--violet); }

.attendee-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.attendee {
  display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); transition: border-color .12s, box-shadow .12s;
}
.attendee:hover { border-color: #b9ccff; box-shadow: var(--shadow); color: inherit; }
.attendee-name { font-weight: 650; }
.attendee-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.simple-list-item .list-title { display: inline-flex; align-items: center; }
@media (max-width: 900px) {
  .calendar-cell { min-height: 72px; }
  .cal-ev span { display: none; }
  .cal-ev { padding: 2px 4px; font-size: 10px; }
}


/* =====================================================================
   통장 거래내역
   ===================================================================== */
.apply-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.apply-bar > div { display: flex; flex-direction: column; gap: 4px; }
.bulk-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--border-light); background: var(--surface-2); }
.form-control-sm { padding: 4px 8px; font-size: 12.5px; border-radius: 6px; width: auto; }
.tx-table td { padding: 7px 10px; }
.tx-table th { padding: 8px 10px; }
.tx-table tr.needs-review td:first-child { box-shadow: inset 3px 0 0 var(--yellow); }
.tx-table tr:target td { background: #fffbea; }
.tx-table .reason { max-width: 220px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }


/* =====================================================================
   현장 출석 (폰 전용 전체 화면)
   ===================================================================== */
.check-body {
  background: var(--bg); min-height: 100vh; min-height: 100dvh;
  -webkit-tap-highlight-color: transparent; overscroll-behavior-y: contain;
}
.ck-top {
  position: sticky; top: 0; z-index: 10;
  background: var(--ink); color: #fff;
  padding: calc(env(safe-area-inset-top) + 10px) 14px 12px;
  box-shadow: 0 6px 18px rgba(11, 19, 36, .25);
}
.ck-row { display: flex; align-items: center; gap: 10px; }
.ck-back {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px;
  background: rgba(255, 255, 255, .08); color: #fff; flex-shrink: 0;
}
.ck-back:hover { color: #fff; }
.ck-back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ck-title { flex: 1; min-width: 0; }
.ck-date { font-size: 18px; font-weight: 800; letter-spacing: -.3px; line-height: 1.2; }
.ck-sub { font-size: 12.5px; color: #9fb0cf; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ck-count { text-align: right; line-height: 1; flex-shrink: 0; }
.ck-count b { font-size: 30px; font-weight: 800; color: var(--ice); font-variant-numeric: tabular-nums; }
.ck-count span { font-size: 13px; color: #9fb0cf; margin-left: 2px; }
.ck-search { margin-top: 10px; }
.ck-search input {
  width: 100%; height: 44px; border-radius: 12px; border: none; padding: 0 14px;
  font-size: 16px; /* 16px 미만이면 iOS가 확대함 */
  background: rgba(255, 255, 255, .1); color: #fff; outline: none;
}
.ck-search input::placeholder { color: #8796b3; }
.ck-search input:focus { background: rgba(255, 255, 255, .16); }
.ck-offline { margin-top: 8px; font-size: 12.5px; font-weight: 600; color: #ffd6a3; }

.ck-main { padding: 12px 12px calc(env(safe-area-inset-bottom) + 28px); max-width: 960px; margin: 0 auto; }
.ck-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ck-btn {
  position: relative; min-height: 64px; padding: 10px 12px; border-radius: 14px;
  border: 1.5px solid var(--border); background: var(--surface);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px;
  text-align: left; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none;
  transition: background .1s, border-color .1s, transform .06s;
}
.ck-btn:active { transform: scale(.97); }
.ck-name { font-size: 17px; font-weight: 750; color: var(--text-primary); letter-spacing: -.2px; padding-right: 22px; }
.ck-meta { font-size: 11.5px; color: var(--text-muted); display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.ck-tag { font-size: 10px; font-weight: 700; padding: 0 5px; border-radius: 4px; background: var(--border-light); color: var(--text-secondary); }
.ck-check {
  position: absolute; top: 50%; right: 12px; width: 22px; height: 22px; margin-top: -11px;
  fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0;
}
.ck-btn.on { background: var(--accent); border-color: var(--accent); box-shadow: 0 3px 10px rgba(36, 88, 230, .3); }
.ck-btn.on .ck-name { color: #fff; }
.ck-btn.on .ck-meta { color: rgba(255, 255, 255, .75); }
.ck-btn.on .ck-tag { background: rgba(255, 255, 255, .2); color: #fff; }
.ck-btn.on .ck-check { opacity: 1; }
.ck-btn[hidden], .ck-divider[hidden] { display: none; }
.ck-divider {
  grid-column: 1 / -1; font-size: 12px; font-weight: 700; color: var(--text-muted);
  padding: 14px 4px 2px; border-top: 1px dashed var(--border); margin-top: 6px;
}
.ck-add {
  width: 100%; min-height: 56px; margin-bottom: 10px; border-radius: 14px; border: 1.5px dashed var(--accent);
  background: var(--accent-soft); color: var(--accent); font-size: 15px; cursor: pointer; touch-action: manipulation;
}
.ck-add span { font-size: 20px; font-weight: 800; vertical-align: -1px; }
.ck-more { margin-top: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
.ck-more summary { font-size: 14px; font-weight: 650; color: var(--text-secondary); cursor: pointer; }
.ck-days { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ck-days a { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-weight: 600; font-size: 14px; }
.ck-log { list-style: none; margin-top: 12px; font-size: 12.5px; color: var(--text-muted); display: flex; flex-direction: column; gap: 4px; }
@media (min-width: 560px) { .ck-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .ck-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ===================================================================== Responsive */
@media (max-width: 1100px) {
  .ms-grid { grid-template-columns: 1fr; }
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-item:nth-child(2) { border-right: none; }
  .summary-item:nth-child(-n+2) { border-bottom: 1px solid var(--border-light); }
}
@media (max-width: 900px) {
  .app-layout { flex-direction: column; }
  .sidebar { position: sticky; top: 0; width: 100%; flex-direction: row; align-items: center; inset: auto; }
  .sidebar-brand { padding: 10px 12px; }
  .brand-text { display: none; }
  .sidebar-nav { display: flex; gap: 2px; padding: 8px 8px 8px 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .sidebar-nav::-webkit-scrollbar { display: none; }
  .nav-section, .nav-badge { display: none; }
  .nav-item { white-space: nowrap; padding: 7px 10px; }
  .nav-item.active { box-shadow: inset 0 -2px 0 var(--ice); }
  .sidebar-footer { display: none; }
  .main-content { margin-left: 0; padding: 20px 16px 48px; }
  .dashboard-grid, .form-row { grid-template-columns: 1fr; }
  .page-title { font-size: 21px; }
  .calendar-cell { min-height: 64px; padding: 4px; }
  .cell-add-btns { display: none; }
  .hero { padding: 22px 20px; }
}

/* 통장 밖에서 받은 돈 입력 */
.manual-form { display: grid; grid-template-columns: 1.2fr .9fr 1fr 1fr 1fr 1.4fr auto; gap: 8px; align-items: center; }
@media (max-width: 900px) { .manual-form { grid-template-columns: 1fr 1fr; } .manual-form .btn { grid-column: 1 / -1; } }
.ck-add + .ck-add { margin-top: -2px; }
