* {
  box-sizing: border-box;
}

body.bg {
  margin: 0;
  font-family: Arial, "맑은 고딕", sans-serif;
  background: #f4f6fb;
  color: #222;
}

.container {
  max-width: 760px;
  margin: 40px auto;
  padding: 0 16px;
}

.container.small {
  max-width: 420px;
}

.container.wide {
  max-width: 1200px;
}

.card {
  background: #fff;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}

h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.sub-title {
  font-size: 14px;
  color: #666;
}

.field {
  margin-bottom: 16px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

input, button {
  font: inherit;
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d7deea;
  border-radius: 10px;
  background: #fff;
  font: inherit;
}

button {
  border: 0;
  background: #3c6cff;
  color: #fff;
  border-radius: 10px;
  padding: 12px 20px;
  cursor: pointer;
  font-weight: 700;
}

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-weight: 700;
}

.alert.error {
  background: #fdecec;
  color: #b12222;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.top-left h1 {
  margin: 0;
  font-size: 24px;
}

.top-menu {
  display: flex;
  gap: 12px;
}

.top-menu a {
  text-decoration: none;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  color: #333;
  background: #f3f4f6;
}

.top-menu a.danger {
  background: #fee2e2;
  color: #b91c1c;
}

.readonly-box {
  background: #f7f9fd;
  border: 1px solid #e3e8f1;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 20px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.menu-card {
  background: #fafbfd;
  border: 1px solid #e5e9f2;
  border-radius: 14px;
  padding: 18px;
}

.menu-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.menu-card p {
  margin: 0;
  color: #666;
  line-height: 1.5;
}

.auto-count-input{
  background:#f3f4f6 !important;
  color:#666;
  cursor:not-allowed;
  pointer-events:none;
}

@media (max-width: 900px) {
  .top-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }
}

.alert.success {
  background: #e9f8ee;
  color: #0d7f33;
}

.filter-box {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.button-field {
  margin-bottom: 16px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th, td {
  border: 1px solid #e1e7f0;
  padding: 10px;
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  background: #f2f5fa;
  font-weight: 700;
  white-space: nowrap;
}

.btn-link {
  display: inline-block;
  text-decoration: none;
  color: #3c6cff;
  font-weight: 700;
  background: none;
  padding: 0;
  margin-right: 8px;
  border: 0;
  cursor: pointer;
}

.btn-link.danger {
  color: #d02727;
}

.empty {
  text-align: center;
  color: #666;
}

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 20px;
}

.container.db-form-page {
  max-width: 620px;
}

.db-table th,
.db-table td {
  font-size: 13px;
  padding: 8px 10px;
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.action-buttons form {
  margin: 0;
}

.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid #d7deea;
  background: #fff;
  color: #3c6cff;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
}

.action-link:hover {
  background: #f6f8fc;
}

.action-link.danger {
  border-color: #ffd5d5;
  background: #fff5f5;
  color: #d02727;
}

select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d7deea;
  border-radius: 10px;
  background: #fff;
  font: inherit;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.section-line {
  border: 0;
  border-top: 1px solid #e3e8f1;
  margin: 20px 0;
}

textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d7deea;
  border-radius: 10px;
  background: #fff;
  font: inherit;
  resize: vertical;
}

.comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.mini-btn {
  min-width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 10px;
}

.hidden {
  display: none;
}

.success-card {
  text-align: center;
}

.success-message {
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.6;
  color: #555;
}

@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.menu-card-link {
  text-decoration: none;
  color: inherit;
}

.comment-preview {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 220px;
  white-space: normal;
  line-height: 1.5;
}

.comment-detail-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment-detail-item {
  padding: 14px;
  border: 1px solid #e1e7f0;
  border-radius: 12px;
  background: #fafbfd;
  line-height: 1.6;
}

.comment-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-right: 6px;
  border-radius: 6px;
  background: #6f8fb1;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}


input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.week-section {
  margin-top: 28px;
}

.week-section h2 {
  margin: 0 0 14px;
  font-size: 22px;
}

/* ===== 관리자 사이드바 레이아웃 ===== */

.admin-body {
  margin: 0;
  font-family: Arial, "맑은 고딕", sans-serif;
  background: #f4f6fb;
  color: #222;
}

.admin-layout {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

.admin-sidebar {
  width: 240px;
  min-width: 240px;
  background: #1f2937;
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  box-sizing: border-box;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 28px;
  line-height: 1.4;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-link {
  display: block;
  padding: 12px 14px;
  border-radius: 12px;
  text-decoration: none;
  color: #e5e7eb;
  font-weight: 700;
  background: transparent;
  white-space: nowrap;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-link.active {
  background: #3b82f6;
  color: #fff;
}

.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 18px;
}

.sidebar-user {
  margin-bottom: 12px;
  font-weight: 700;
  color: #f3f4f6;
}

.sidebar-user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
}

.sidebar-user-actions a {
  text-decoration: none;
  color: #e5e7eb;
  font-weight: 700;
}

.sidebar-user-actions a:hover {
  text-decoration: underline;
}

.sidebar-user-actions .danger-link {
  color: #fecaca;
}

.admin-main {
  flex: 1;
  min-width: 0;
  min-height: 100vh;
}

.admin-main-inner {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 28px;
  box-sizing: border-box;
}

.admin-page-header {
  margin-bottom: 18px;
}

.admin-page-header h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.admin-sub-title {
  font-size: 14px;
  color: #666;
}

.admin-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.admin-subnav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #d7deea;
  text-decoration: none;
  color: #374151;
  font-weight: 700;
  white-space: nowrap;
}

.admin-subnav-link:hover {
  background: #f8fafc;
}

.admin-subnav-link.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.admin-content-card {
  background: #fff;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.disabled {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
}

/* ===== 공통 관리자 폼 / 표 ===== */

.admin-main,
.admin-main-inner,
.admin-content-card,
.attendance-panel,
.dashboard-card,
.grid-2,
.attendance-two-column,
.table-wrap,
.admin-table-wrap {
  min-width: 0;
  box-sizing: border-box;
}

.filter-box,
.bitdam-filter-box,
.form-actions,
.dashboard-card-top,
.attendance-qr-admin-status-row,
.comment-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.filter-box .field,
.bitdam-filter-box .field {
  margin-bottom: 0;
}

.button-field {
  margin-bottom: 0;
}

.table-wrap,
.admin-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.admin-table,
.db-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.admin-table th,
.admin-table td,
.db-table th,
.db-table td {
  white-space: nowrap;
}

.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid #d7deea;
  background: #fff;
  color: #3c6cff;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
}

.action-link:hover {
  background: #f6f8fc;
}

.action-link.danger {
  border-color: #ffd5d5;
  background: #fff5f5;
  color: #d02727;
}

/* ===== 대시보드 ===== */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.dashboard-card {
  background: #fff;
  border: 1px solid #e6eaf0;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.dashboard-card-top {
  justify-content: space-between;
  margin-bottom: 14px;
}

.dashboard-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
}

.dashboard-card-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: #6b7280;
}

.dashboard-filter-form select {
  min-width: 120px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #d7dce5;
  border-radius: 10px;
  background: #fff;
}

.dashboard-chart-wrap {
  position: relative;
  height: 280px;
}

/* ===== 출결 현황 ===== */

.attendance-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.attendance-toolbar-left {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.attendance-inline-field {
  margin-bottom: 0;
  min-width: 180px;
}

.attendance-inline-field-search {
  min-width: 260px;
}

.attendance-inline-field label {
  margin-bottom: 8px;
  font-size: 14px;
}

.attendance-inline-field input[type="date"],
.attendance-inline-field select {
  height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
}

.attendance-toolbar-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.attendance-primary-btn,
.attendance-outline-btn,
.attendance-green-btn,
.attendance-purple-btn,
.attendance-red-btn,
.attendance-summary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

.attendance-primary-btn {
  border: 0;
  background: #3c6cff;
  color: #fff;
}

.attendance-outline-btn {
  border: 1px solid #cfd8e6;
  background: #fff;
  color: #3c6cff;
  cursor: pointer;
}

.attendance-green-btn {
  background: #2f9e44;
  color: #fff;
  border: 0;
}

.attendance-purple-btn {
  background: #6f2dbd;
  color: #fff;
  border: 0;
}

.attendance-red-btn {
  background: #dc2626;
  color: #fff;
  border: 0;
}

.attendance-summary-btn {
  border: 1px solid #d7deea !important;
  background: #fff !important;
  color: #3c6cff !important;
}

.attendance-stat-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
  width: 100%;
}

.attendance-stat-card {
  border: 1px solid #e5e9f2;
  border-radius: 16px;
  padding: 18px 20px;
  min-height: 108px;
  background: #fff;
  min-width: 0;
}

.attendance-stat-card.total {
  background: #f5f7fb;
}

.attendance-stat-card.present {
  background: #edf7ef;
}

.attendance-stat-card.absent {
  background: #fcf0f0;
}

.attendance-stat-card.unreported {
  background: #f4f5f8;
}

.attendance-stat-label {
  font-size: 14px;
  color: #666;
  margin-bottom: 12px;
  font-weight: 700;
}

.attendance-stat-value {
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
}

.attendance-two-column {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 18px;
  width: 100%;
}

.attendance-panel {
  background: #fff;
  border: 1px solid #e5e9f2;
  border-radius: 18px;
  padding: 18px;
  width: 100%;
  overflow: hidden;
}

.attendance-panel h3 {
  margin: 0 0 14px;
  font-size: 18px;
}

.attendance-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.attendance-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.attendance-table th,
.attendance-table td {
  white-space: nowrap;
  box-sizing: border-box;
}

.attendance-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.attendance-modal.hidden {
  display: none;
}

.attendance-modal-dialog {
  width: 100%;
  max-width: 680px;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.attendance-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 18px 14px;
  border-bottom: 1px solid #eef1f6;
}

.attendance-modal-header h3 {
  margin: 0;
  font-size: 18px;
}

.attendance-modal-close {
  min-width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #444;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.attendance-modal-subtitle {
  padding: 14px 18px 0;
  font-size: 14px;
  color: #666;
  font-weight: 600;
}

.attendance-summary-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 14px 0 0;
}

.attendance-summary-table th,
.attendance-summary-table td {
  border-bottom: 1px solid #edf0f5;
  padding: 12px 14px;
  text-align: center;
  font-size: 15px;
}

.attendance-summary-table th:first-child {
  border-top-left-radius: 14px;
}

.attendance-summary-table th:last-child {
  border-top-right-radius: 14px;
}

.summary-col-region {
  background: #dfeade;
}

.summary-col-total {
  background: #eef2df;
}

.summary-col-present {
  background: #d9ebf9;
}

.summary-col-absent {
  background: #f3ebcf;
}

.summary-col-unreported {
  background: #f2dfe4;
}

.attendance-summary-total-row td {
  font-weight: 800;
  background: #e9edf8;
  border-top: 2px solid #6d7480;
  border-bottom: 0;
}

.attendance-summary-total-row td:first-child {
  border-bottom-left-radius: 14px;
}

.attendance-summary-total-row td:last-child {
  border-bottom-right-radius: 14px;
}

/* ===== 출결 QR ===== */

.attendance-qr-wrap {
  display: flex;
  justify-content: center;
  padding: 10px 0 20px;
}

.attendance-qr-card {
  width: 100%;
  max-width: 560px;
  background: #fafbfd;
  border: 1px solid #e5e9f2;
  border-radius: 24px;
  padding: 28px 24px;
  text-align: center;
}

.attendance-qr-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}

.attendance-qr-subtitle {
  font-size: 15px;
  color: #666;
  margin-bottom: 22px;
}

.attendance-qr-image-box {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.attendance-qr-image-box img {
  width: min(78vw, 320px);
  height: min(78vw, 320px);
  object-fit: contain;
  background: #fff;
  border: 1px solid #e5e9f2;
  border-radius: 18px;
  padding: 14px;
}

.attendance-qr-countdown {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 16px;
}

.attendance-qr-url-box input {
  text-align: center;
  font-size: 13px;
  color: #666;
  background: #fff;
}

.attendance-qr-admin-panel {
  max-width: 720px;
}

.attendance-qr-admin-status-row {
  justify-content: space-between;
  gap: 16px;
}

.attendance-qr-admin-status-text {
  font-size: 22px;
  font-weight: 700;
}

.status-on {
  color: #15803d;
}

.status-off {
  color: #dc2626;
}

.attendance-qr-admin-form {
  margin: 0;
}

.attendance-qr-password-box {
  padding: 18px 20px;
  border: 1px solid #e5e9f2;
  border-radius: 16px;
  background: #fafbfd;
}

.attendance-qr-password-title {
  font-size: 14px;
  color: #666;
  font-weight: 700;
  margin-bottom: 10px;
}

.attendance-qr-password-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #111827;
}

.attendance-qr-password-help {
  margin-top: 16px;
  font-size: 14px;
  color: #666;
}

.attendance-admin-link-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
}

.attendance-admin-link-row a {
  color: #5f6b7a;
  text-decoration: none;
}

.attendance-admin-link-row a:hover {
  text-decoration: underline;
}

.attendance-admin-link-row span {
  color: #b0b7c3;
}

.attendance-qr-access-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.attendance-qr-access-card {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border-radius: 24px;
  padding: 32px 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.10);
}

.attendance-qr-access-card h1 {
  margin: 0 0 10px;
  font-size: 32px;
  text-align: center;
}

.attendance-qr-access-subtitle {
  margin-bottom: 22px;
  text-align: center;
  color: #666;
  line-height: 1.5;
}

.attendance-qr-access-form {
  margin-top: 8px;
}

.attendance-full-btn {
  width: 100%;
}

.attendance-qr-display-body {
  margin: 0;
  background: #ffffff;
}

.attendance-qr-display-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.attendance-qr-display-card {
  text-align: center;
}

.attendance-qr-display-image-box {
  display: flex;
  justify-content: center;
  align-items: center;
}

.attendance-qr-display-image-box img {
  width: min(80vw, 420px);
  height: min(80vw, 420px);
  object-fit: contain;
}

.attendance-qr-display-timer {
  margin-top: 20px;
  font-size: 34px;
  font-weight: 800;
  color: #111827;
  letter-spacing: 1px;
}

.region-delete-blocked {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 90px;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  color: #6b7280;
  font-weight: 700;
  font-size: 13px;
}

input[type="time"] {
  width: 100%;
  height: 46px;
  padding: 10px 14px;
  border: 1px solid #d7deea;
  border-radius: 12px;
  background: #fff;
  font: inherit;
  color: #111827;
}

input[type="time"]:focus {
  outline: none;
  border-color: #3c6cff;
  box-shadow: 0 0 0 3px rgba(60, 108, 255, 0.12);
}

input[type="time"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.8;
}

.attendance-qr-admin-panel input[type="time"] {
  background: #fafbfd;
}

.qr-time-title {
  margin: 0 0 6px;
  font-size: 20px;
}

.qr-time-subtitle {
  margin-bottom: 18px;
  color: #666;
  font-size: 14px;
}

/* ===== 빛담 ===== */

.week-section {
  margin-top: 28px;
}

.week-section h2 {
  margin: 0 0 14px;
  font-size: 22px;
}

.month-compare-section {
  margin-top: 28px;
}

.month-compare-section .db-table {
  width: 100%;
  table-layout: fixed;
}

.month-compare-section .db-table th,
.month-compare-section .db-table td {
  text-align: center;
}

.month-compare-section .db-table th:first-child,
.month-compare-section .db-table td:first-child {
  text-align: left;
  width: 28%;
}

.month-compare-section .db-table th:nth-child(2),
.month-compare-section .db-table td:nth-child(2),
.month-compare-section .db-table th:nth-child(3),
.month-compare-section .db-table td:nth-child(3),
.month-compare-section .db-table th:nth-child(4),
.month-compare-section .db-table td:nth-child(4) {
  width: 24%;
}

.compare-diff {
  font-weight: 800;
  font-size: 20px;
}

.compare-diff.up {
  color: #2563eb;
}

.compare-diff.down {
  color: #dc2626;
}

.compare-diff.same {
  color: #6b7280;
}

.compact-year-field {
  width: 140px;
  max-width: 140px;
  flex: 0 0 140px;
}

.compact-field {
  width: 220px;
  max-width: 220px;
  flex: 0 0 220px;
}

.bitdam-filter-box {
  margin-bottom: 20px;
}

.bitdam-filter-box .compact-year-field select,
.bitdam-filter-box .compact-field select,
.bitdam-filter-box .compact-year-field input,
.bitdam-filter-box .compact-field input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.bitdam-filter-box .button-field {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
}

.bg-high {
  background-color: #e3f2fd;
  color: #1565c0;
  font-weight: 600;
}

.bg-low {
  background-color: #fdecea;
  color: #c62828;
  font-weight: 600;
}

.pagination-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid #d7deea;
  background: #fff;
  color: #374151;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}

.page-link.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.page-dots {
  padding: 0 6px;
  color: #777;
}

/* 빛담 실적 지표 합계 행 강조 */
.total-row td {
  background: #f2f5fa !important;
  font-weight: 800 !important;
}

.total-row td:first-child {
  font-weight: 800 !important;
}

/* 전주 대비 스타일 */
.diff.up {
  color: #1976d2;   /* 파란색 */
  font-weight: 700;
}

.diff.down {
  color: #d32f2f;   /* 빨간색 */
  font-weight: 700;
}

.diff.same {
  color: #999;
}

.comment-title-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.comment-title-row label {
  margin-bottom: 0;
  white-space: nowrap;
}

.comment-topic-select {
  width: auto;
  min-width: 110px;
  max-width: 180px;
  height: 34px;
  padding: 4px 8px;
  font-size: 13px;
}

/* ===== 반응형 ===== */

@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .attendance-stat-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-sidebar {
    width: 210px;
    min-width: 210px;
  }
}

@media (max-width: 1024px) {
  .attendance-two-column {
    grid-template-columns: 1fr;
  }

  .menu-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .attendance-two-column {
    grid-template-columns: 1fr;
  }

  .dashboard-chart-wrap {
    height: 240px;
  }

  .admin-sidebar {
    width: 190px;
    min-width: 190px;
  }
}

@media (max-width: 768px) {
  .admin-layout {
    flex-direction: column;
  }

  .admin-sidebar {
    width: 100%;
    min-width: 100%;
    height: auto;
    position: static;
    padding: 12px;
  }

  .sidebar-top {
    margin-bottom: 8px;
  }

  .sidebar-logo {
    font-size: 16px;
    margin-bottom: 6px;
  }

  .sidebar-nav,
  .admin-subnav {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .sidebar-nav a,
  .admin-subnav a,
  .sidebar-link,
  .admin-subnav-link {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .sidebar-bottom {
    margin-top: 8px;
    font-size: 13px;
  }

  .admin-main {
    width: 100%;
  }

  .admin-main-inner {
    padding: 14px;
  }

  .admin-content-card {
    padding: 18px;
  }

  .filter-box,
  .bitdam-filter-box,
  .form-actions,
  .dashboard-card-top,
  .attendance-qr-admin-status-row,
  .comment-header,
  .attendance-toolbar,
  .attendance-toolbar-left {
    flex-direction: column;
    align-items: stretch;
  }

  .attendance-inline-field,
  .attendance-inline-field-search,
  .compact-year-field,
  .compact-field,
  .button-field {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: 1 1 100%;
  }

  .attendance-toolbar-buttons {
    width: 100%;
  }

  .attendance-primary-btn,
  .attendance-outline-btn,
  .attendance-green-btn,
  .attendance-purple-btn,
  .attendance-red-btn,
  .attendance-summary-btn {
    width: 100%;
  }

  .attendance-stat-cards {
    grid-template-columns: 1fr;
  }

  .dashboard-card,
  .attendance-panel,
  .card,
  .readonly-box {
    overflow: hidden;
  }

  .admin-table,
  .db-table,
  .attendance-table,
  table {
    min-width: 640px;
  }
}

/* ===== 모바일 햄버거 메뉴 ===== */

.mobile-header {
  display: none;
}

.admin-sidebar-overlay {
  display: none;
}

@media (max-width: 768px) {
  .admin-layout {
    flex-direction: column;
  }

  .mobile-header {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 52px;
    padding: 0 14px;
    background: #111827;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1001;
  }

  .mobile-header button {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
  }

  .mobile-header span {
    font-size: 16px;
    font-weight: 700;
  }

  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    min-width: 240px;
    height: 100vh;
    z-index: 1002;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    padding: 20px 16px;
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .admin-sidebar-overlay.show {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.38);
    z-index: 1000;
  }

  .admin-main {
    width: 100%;
    min-width: 0;
  }

  .admin-main-inner {
    padding: 14px;
  }

  .admin-subnav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .admin-subnav-link {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}