/* =========================
   운영 관리 시스템 전체 CSS
   ========================= */

:root {
    --main-color: #2e7d32;
    --green: #2e7d32;
    --green-dark: #1b5e20;
    --green-soft: #eaf5ec;

    --bg: #f4f8f5;
    --card: #ffffff;
    --text: #1f2d24;
    --muted: #6b7c70;
    --border: #dce8df;
    --table-border: #d9e1ec;

    --danger: #d32f2f;
    --blue: #1565c0;

    --shadow: 0 10px 28px rgba(30, 70, 40, 0.08);
    --shadow-strong: 0 18px 45px rgba(20, 60, 35, 0.14);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    text-decoration: none;
    color: inherit;
}

/* =========================
   공통 버튼
   ========================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-green {
    background: var(--green);
    color: #fff;
}

.btn-green:hover {
    background: var(--green-dark);
}

.btn-gray {
    background: #eef2ef;
    color: #26362b;
    border-color: #d8e2db;
}

.btn-gray:hover {
    background: #dfe8e2;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #b71c1c;
}

.btn-blue {
    background: #eef2ef;
    color: #223328;
    border: 1px solid #d8e4dc;
}

.btn-blue:hover {
    background: #e3ece6;
}

.btn.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* =========================
   입력폼 공통
   ========================= */

input,
select {
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 12px;
    background: #fff;
    color: var(--text);
    font-size: 14px;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12);
}

input[type="checkbox"] {
    width: auto;
    height: auto;
}

/* =========================
   레이아웃
   ========================= */

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    min-width: 260px;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    color: #fff;
    background:
        radial-gradient(circle at 20% 8%, rgba(255,255,255,0.18), transparent 28%),
        linear-gradient(180deg, #123524 0%, #1f6f3a 62%, #15512b 100%);
    border-right: 1px solid rgba(255,255,255,0.08);
    box-shadow: 14px 0 34px rgba(20, 60, 35, 0.2);
}

.sidebar-logo {
    margin: 0 0 28px;
    font-size: 25px;
    font-weight: 900;
    letter-spacing: -0.6px;
    color: #ffffff;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.menu-group {
    width: 100%;
}

.menu-link,
.menu-parent {
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    border-radius: 13px;
    border: 1px solid transparent;
    outline: none;
    background: transparent;
    color: rgba(255,255,255,0.78);
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.18s ease;
}

.menu-link svg,
.menu-parent svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.menu-link:hover,
.menu-parent:hover {
    background: rgba(255,255,255,0.09);
    border-color: rgba(255,255,255,0.10);
    color: #ffffff;
}

.menu-link.active,
.menu-parent.active {
    background: rgba(255,255,255,0.96);
    color: #123524;
    border-color: rgba(255,255,255,0.35);
    box-shadow: 0 10px 28px rgba(0,0,0,0.18);
}

.menu-link.active svg,
.menu-parent.active svg {
    color: #123524;
}

.menu-link:focus,
.menu-parent:focus,
.menu-link:focus-visible,
.menu-parent:focus-visible {
    outline: none;
}

.menu-arrow {
    margin-left: auto;
    width: 16px !important;
    height: 16px !important;
    opacity: 0.75;
    transition: transform 0.2s ease;
}

.menu-group.open .menu-arrow {
    transform: rotate(180deg);
}

.submenu {
    display: none;
}

.menu-group.open .submenu {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 8px 0 10px 18px;
    padding: 4px 0 4px 14px;
    border-left: 1px solid rgba(255,255,255,0.22);
}

.submenu-link {
    display: flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    color: rgba(255,255,255,0.68);
    font-size: 13px;
    font-weight: 700;
    transition: all 0.16s ease;
}

.submenu-link::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255,255,255,0.36);
    margin-right: 9px;
    flex-shrink: 0;
}

.submenu-link:hover {
    background: rgba(255,255,255,0.08);
    color: #ffffff;
}

.submenu-link.active {
    background: rgba(255,255,255,0.17);
    color: #ffffff;
    font-weight: 900;
}

.submenu-link.active::before {
    background: #ffffff;
}

.user-box {
    margin-top: auto;
    padding: 15px;
    border-radius: 18px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.13);
    backdrop-filter: blur(10px);
}

.user-name,
.user-box > div:first-child {
    color: #ffffff;
    font-size: 17px;
    font-weight: 900;
}

.user-role,
.user-box > div:nth-child(2) {
    margin-top: 3px;
    font-size: 13px;
    color: rgba(255,255,255,0.74);
    font-weight: 700;
}

.user-ip-row {
    margin-top: 10px;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,0.72);
    word-break: break-all;
}

.user-action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}

.user-action-row .btn,
.user-action-row a.btn {
    width: 100%;
    height: 42px;
    min-height: 42px;
    margin-top: 0;
    padding: 0 10px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.content {
    flex: 1;
    padding: 28px 32px;
    overflow-y: auto;
}

.topbar {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 22px 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.topbar h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 900;
}

/* =========================
   알림
   ========================= */

.flash {
    padding: 13px 16px;
    border-radius: 14px;
    margin-bottom: 14px;
    font-weight: 800;
}

.flash.error {
    background: #fdecec;
    color: #a12626;
    border: 1px solid #f4c7c7;
}

.flash.success {
    background: #e9f7ec;
    color: #1b6b2a;
    border: 1px solid #cbe8d0;
}

/* =========================
   로그인
   ========================= */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(180deg, #f7fbf8, #edf7ef);
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 32px;
    box-shadow: var(--shadow);
}

.login-title {
    font-size: 24px;
    font-weight: 900;
    text-align: center;
    margin-bottom: 22px;
}

.login-card form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-card input {
    width: 100%;
    height: 48px;
    border-radius: 13px;
}

.login-btn {
    width: 100%;
    height: 48px;
    margin-top: 6px;
    font-size: 15px;
}

.login-message-wrap {
    margin-bottom: 12px;
}

/* =========================
   카드 / 필터
   ========================= */

.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 24px;
    margin-bottom: 22px;
    box-shadow: var(--shadow);
    overflow: visible;
}

.card h3 {
    margin: 0 0 18px;
    font-size: 23px;
    font-weight: 900;
}

.filter-box,
.bitdam-filter-card,
.blog-filter-card {
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid #dfe9e2;
    border-radius: 22px;
    padding: 18px 20px;
    margin: 18px 0 22px;
    box-shadow: 0 8px 22px rgba(30, 70, 40, 0.06);
}

.bitdam-filter-group,
.blog-filter-left,
.blog-filter-right,
.bitdam-filter-action {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.bitdam-filter-item,
.blog-filter-item,
.filter-item {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.bitdam-filter-item label,
.blog-filter-item label,
.filter-item label {
    font-size: 13px;
    font-weight: 900;
    color: #223328;
}

.bitdam-filter-card input[type="date"],
.bitdam-filter-card select,
.blog-filter-item input,
.blog-filter-item select,
.filter-box select {
    height: 44px;
    min-width: 160px;
    border: 1px solid #d8e4dc;
    border-radius: 12px;
    background: #fff;
    padding: 0 14px;
    font-weight: 800;
}

.bitdam-filter-card .btn,
.blog-filter-card .btn {
    height: 44px;
    min-width: 64px;
    border-radius: 12px;
    font-weight: 900;
}

/* =========================
   탭
   ========================= */

.bitdam-tab-row,
.bitdam-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 18px 0 22px;
}

.bitdam-tab-btn,
.tab-btn {
    min-width: 110px;
    height: 44px;
    padding: 0 18px;
    border: 1px solid #d8e4dc;
    border-radius: 13px;
    background: #fff;
    color: #223328;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    box-shadow: 0 4px 12px rgba(30, 70, 40, 0.04);
}

.bitdam-tab-btn:hover,
.tab-btn:hover {
    background: #eef7f0;
    color: #1b5e20;
}

.bitdam-tab-btn.active,
.tab-btn.active {
    background: var(--green);
    color: #fff;
    border-color: var(--green);
}

/* =========================
   공통 테이블
   ========================= */

table {
    width: 100%;
    background: #fff;
}

table:not(.bitdam-table) {
    border-collapse: collapse;
    border-radius: 16px;
    overflow: hidden;
}

table:not(.bitdam-table) th {
    background: #eef5f0;
    color: #203126;
    padding: 14px 12px;
    font-weight: 900;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

table:not(.bitdam-table) td {
    padding: 13px 12px;
    border-bottom: 1px solid #edf2ee;
    vertical-align: middle;
}

table:not(.bitdam-table) tbody tr:hover {
    background: #fbfdfb;
}

table:not(.bitdam-table) tbody tr:last-child td {
    border-bottom: none;
}

.bitdam-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--table-border);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.bitdam-table thead th {
    background: #eef2f7;
    color: #1f2937;
    font-weight: 900;
    padding: 12px 14px;
    text-align: center;
    font-size: 13px;
    border-right: 1px solid var(--table-border);
    border-bottom: 1px solid var(--table-border);
    white-space: nowrap;
}

.bitdam-table tbody td {
    padding: 12px 14px;
    background: #fff;
    text-align: center;
    font-size: 13px;
    border-right: 1px solid var(--table-border);
    border-bottom: 1px solid var(--table-border);
    vertical-align: middle;
}

.bitdam-table th:last-child,
.bitdam-table td:last-child {
    border-right: none;
}

.bitdam-table tbody tr:last-child td {
    border-bottom: none;
}

.bitdam-table tbody tr:hover td {
    background: #f8fbff;
}

.bitdam-table .total-row td {
    background: #f5f7fa;
    font-weight: 900;
}

.bitdam-month-compare-table {
    table-layout: fixed;
}

.bitdam-month-compare-table th,
.bitdam-month-compare-table td {
    width: 25%;
}

/* =========================
   계정/사용자 테이블
   ========================= */

.account-table-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 18px;
    box-shadow: var(--shadow);
    max-height: 620px !important;
    overflow-y: auto !important;
    overflow-x: auto !important;
    position: relative !important;
}

.account-table {
    min-width: 1150px;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.account-table thead th {
    position: sticky !important;
    top: 0 !important;
    z-index: 30 !important;
    background: #eef5f0 !important;
    box-shadow: 0 2px 0 #d9e1ec !important;
}

.account-table th {
    background: #eef5f0;
    color: #223328;
    text-align: center !important;
}

.account-table td {
    white-space: nowrap;
    text-align: center !important;
}

.text-strong {
    font-weight: 900;
}

/* =========================
   배지 / 비교값
   ========================= */

.diff-up {
    color: var(--blue);
    font-weight: 900;
}

.diff-down {
    color: var(--danger);
    font-weight: 900;
}

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

.monthly-diff-up {
    color: #dc2626;
    font-weight: 900;
}

.monthly-diff-down {
    color: #2563eb;
    font-weight: 900;
}

.highlight-good {
    background: #e8f0ff !important;
    color: #1d4ed8;
    font-weight: 900;
}

.highlight-bad {
    background: #fdecec !important;
    color: #dc2626;
    font-weight: 900;
}

.role-badge,
.status-badge {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 900;
}

.role-badge,
.status-badge.active {
    background: #e8f5e9;
    color: #1b5e20;
}

.status-badge.inactive {
    background: #f5f5f5;
    color: #777;
}

.meeting-option-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 900;
}

.meeting-option-badge.attend {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.meeting-option-badge.absent {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* =========================
   액션 버튼
   ========================= */

.account-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
}

.account-actions form {
    margin: 0;
}

.btn-mini {
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 9px;
    border: none;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.btn-mini.edit {
    background: #edf7ef;
    color: #1b5e20;
    border: 1px solid #cfe6d3;
}

.btn-mini.delete {
    background: #fdecec;
    color: #b42323;
    border: 1px solid #f3c3c3;
}

.attend-btn {
    border: none;
    padding: 4px 8px;
    margin: 0 2px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    opacity: 0.6;
}

.attend-btn.attend {
    background: #43a047;
    color: white;
}

.attend-btn.absent {
    background: #e53935;
    color: white;
}

.attend-btn.active {
    opacity: 1;
    font-weight: 700;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

/* =========================
   모달
   ========================= */

.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-box {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 22px;
    padding: 26px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
}

.account-modal {
    max-width: 560px;
}

.modal-title {
    font-size: 22px;
    font-weight: 900;
    margin-bottom: 18px;
}

.modal-box label {
    display: block;
    font-weight: 800;
    margin: 12px 0 6px;
}

.modal-box input,
.modal-box select {
    width: 100%;
    height: 44px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
}

.modal-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.modal-head-row .modal-title {
    margin-bottom: 0;
}

.modal-status-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #edf7ef;
    border: 1px solid #cfe6d3;
    color: #1b5e20;
    font-weight: 900;
    white-space: nowrap;
}

.modal-status-check input {
    width: auto;
    height: auto;
}

.password-policy {
    margin-top: 16px;
    padding: 14px;
    border-radius: 14px;
    background: #f2f8f3;
    border: 1px solid #d6e8d9;
    font-size: 14px;
    color: #2b4b32;
}

/* =========================
   폼 그리드 / 권한 박스
   ========================= */

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-grid label,
.permission-box label {
    display: block;
    font-weight: 800;
    margin-bottom: 6px;
}

.form-grid input,
.form-grid select {
    width: 100%;
}

.permission-box {
    margin-top: 16px;
    padding: 16px;
    border-radius: 16px;
    background: #f8fcf8;
    border: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.permission-title {
    grid-column: 1 / -1;
    font-weight: 900;
    margin-bottom: 4px;
    color: #223328;
}

.permission-box label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #dfe9e2;
    font-size: 14px;
    font-weight: 800;
    color: #26362b;
    cursor: pointer;
}

.permission-box label:hover {
    background: #eef7f0;
    border-color: #cfe6d3;
}

.permission-box input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--green);
    flex-shrink: 0;
}

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

.dashboard-top {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 22px;
    margin-bottom: 34px;
}

.dashboard-bottom {
    display: grid;
    grid-template-columns: 2.35fr 0.85fr;
    gap: 22px;
    align-items: start;
}

.dashboard-card {
    background: linear-gradient(180deg, #ffffff, #fbfdfb);
    border: 1px solid #dce8df;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 14px 34px rgba(30, 70, 40, 0.08);
}

.dashboard-card h3 {
    margin: 0 0 16px;
    font-size: 19px;
    font-weight: 900;
    color: #1f2d24;
}

.dashboard-card p {
    margin: 8px 0;
    color: #6b7c70;
    font-weight: 700;
}

.dashboard-card strong {
    color: #203126;
    font-weight: 900;
}

.dashboard-empty-card {
    background: linear-gradient(135deg, #f8fcf8, #eef7f0);
    border: 1px dashed #cfe0d4;
}

.dashboard-chart-card,
.dashboard-rank-card {
    height: 440px;
}

.dashboard-chart-card canvas {
    width: 100% !important;
    height: 340px !important;
}

.dashboard-chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.dashboard-chart-title {
    font-size: 20px;
    font-weight: 900;
    color: #1f2d24;
}

.dashboard-chart-filter select {
    height: 40px;
    min-width: 116px;
    border-radius: 12px;
    font-weight: 900;
}

.dashboard-rank-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.rank-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

.rank-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 13px;
    background: #f7fbf8;
    border: 1px solid #e2eee5;
    font-size: 13px;
}

.rank-row span,
.rank-row strong {
    font-weight: 900;
    color: #233529;
}

.rank-divider {
    height: 1px;
    background: #dce8df;
    margin: 18px 0;
}

.rank-empty {
    color: #7a8a80;
    font-size: 13px;
    padding: 10px;
    border-radius: 12px;
    background: #f7fbf8;
}

.card-title {
    font-weight: 900;
    margin-bottom: 12px;
    font-size: 15px;
}

.dept-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

.dept-name {
    color: #555;
}

.dept-count {
    font-weight: 900;
    color: #2e7d32;
}

.dept-total {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid #eee;
    text-align: right;
    font-weight: 900;
}

/* =========================
   기타
   ========================= */

.blog-page-actions,
.blog-history-head {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    background: #fff;
    border: 1px solid #dfe9e2;
    border-radius: 22px;
    padding: 18px 20px;
    margin: 18px 0 22px;
    box-shadow: 0 8px 22px rgba(30, 70, 40, 0.06);
}

.blog-page-actions p {
    margin: 0;
    color: #6b7c70;
    font-size: 15px;
}

.blog-history-title {
    font-size: 16px;
    font-weight: 900;
    color: #223328;
}

.blog-history-head .btn {
    height: 36px;
    min-height: 36px;
    padding: 0 12px;
    font-size: 13px;
}

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

.pagination-info {
    font-weight: 900;
    color: var(--text);
}

.masked-tel {
    cursor: pointer;
    color: #555;
    font-weight: 800;
}

.masked-tel:hover {
    color: #2e7d32;
}

.table-link {
    color: #2e7d32;
    font-weight: 800;
}

.table-link:hover {
    text-decoration: underline;
}

.muted {
    color: #999;
}

/* =========================
   모임 관리
   ========================= */

.meeting-filter-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
}

.meeting-filter-form {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.meeting-toggle-box {
    min-width: 220px;
}

.meeting-toggle-buttons {
    display: flex;
    gap: 8px;
}

.meeting-toggle-buttons form {
    margin: 0;
}

.meeting-switch-btn {
    min-width: 62px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid #d8e1dc;
    background: #fff;
    color: #555;
    font-weight: 900;
    cursor: pointer;
}

.meeting-switch-btn.on.active {
    background: #2e7d32;
    color: #fff;
    border-color: #2e7d32;
}

.meeting-switch-btn.off.active {
    background: #c62828;
    color: #fff;
    border-color: #c62828;
}

.meeting-switch-btn:disabled {
    cursor: not-allowed;
    opacity: 0.9;
}

/* =========================
   빛토리 / 주제 관리
   ========================= */

.topic-guide {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #f2f8f3;
    border: 1px solid #d6e8d9;
    color: #2b4b32;
    font-size: 14px;
    font-weight: 700;
}

.topic-list-cell {
    text-align: left !important;
    white-space: normal !important;
}

.topic-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    margin: 3px;
    border-radius: 999px;
    background: #eef7f0;
    border: 1px solid #d3e8d7;
    color: #1f5f2d;
    font-size: 13px;
    font-weight: 900;
}

.topic-input-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.topic-input-head label {
    margin: 0;
    font-weight: 900;
}

.topic-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.topic-input-row {
    display: grid;
    grid-template-columns: 1fr 64px;
    gap: 8px;
    align-items: center;
}

.topic-input-row input {
    height: 42px;
    width: 100%;
}

.topic-input-row .btn-mini {
    height: 38px;
    min-height: 38px;
    padding: 0 10px;
}

/* =========================
   빛토리 이력/현황 페이지 공통 레이아웃
   대상:
   - 엑스 이력 조회
   - 인스타 이력 조회
   - 팔로잉/팔로워 현황
   ========================= */

/* 제목, 검색, 표 카드 모두 다른 페이지처럼 전체 폭 */
body:has(.x-history-table) .topbar,
body:has(.instagram-history-table) .topbar,
body:has(.account-status-table) .topbar,
body:has(.bittory-account-status-table) .topbar,
body:has(.x-history-table) .filter-box,
body:has(.instagram-history-table) .filter-box,
body:has(.account-status-table) .filter-box,
body:has(.bittory-account-status-table) .filter-box,
body:has(.x-history-table) .blog-filter-card,
body:has(.instagram-history-table) .blog-filter-card,
body:has(.account-status-table) .blog-filter-card,
body:has(.bittory-account-status-table) .blog-filter-card,
body:has(.x-history-table) .card:has(.x-history-table),
body:has(.instagram-history-table) .card:has(.instagram-history-table),
body:has(.account-status-table) .card:has(.account-status-table),
body:has(.bittory-account-status-table) .card:has(.bittory-account-status-table) {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
}

/* 표 카드 흰 배경 유지 + 안쪽 표 스크롤 */
body:has(.x-history-table) .card:has(.x-history-table),
body:has(.instagram-history-table) .card:has(.instagram-history-table),
body:has(.account-status-table) .card:has(.account-status-table),
body:has(.bittory-account-status-table) .card:has(.bittory-account-status-table) {
    display: block !important;
    background: #ffffff !important;
    padding: 24px !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
}

/* 표는 카드 안에서 전체 폭 기준 */
.x-history-table,
.instagram-history-table,
.account-status-table,
.bittory-account-status-table {
    width: 100% !important;
    min-width: 1050px !important;
    table-layout: auto !important;
}

/* 이력 조회 셀 공통 */
.x-history-table th,
.x-history-table td,
.instagram-history-table th,
.instagram-history-table td,
.account-status-table th,
.account-status-table td,
.bittory-account-status-table th,
.bittory-account-status-table td {
    white-space: nowrap !important;
    text-align: center !important;
    padding: 10px 12px !important;
    font-size: 13px !important;
}

/* 스크롤바 */
.card:has(.x-history-table)::-webkit-scrollbar,
.card:has(.instagram-history-table)::-webkit-scrollbar,
.card:has(.account-status-table)::-webkit-scrollbar,
.card:has(.bittory-account-status-table)::-webkit-scrollbar {
    height: 10px;
}

.card:has(.x-history-table)::-webkit-scrollbar-thumb,
.card:has(.instagram-history-table)::-webkit-scrollbar-thumb,
.card:has(.account-status-table)::-webkit-scrollbar-thumb,
.card:has(.bittory-account-status-table)::-webkit-scrollbar-thumb {
    background: #c8d8cc;
    border-radius: 999px;
}

.card:has(.x-history-table)::-webkit-scrollbar-track,
.card:has(.instagram-history-table)::-webkit-scrollbar-track,
.card:has(.account-status-table)::-webkit-scrollbar-track,
.card:has(.bittory-account-status-table)::-webkit-scrollbar-track {
    background: #eef5f0;
    border-radius: 999px;
}

/* =========================
   엑스/인스타 이력 조회 헤더 색상
   ========================= */

/* 특별 활동 상단 */
.x-history-table thead tr:first-child th:nth-child(6),
.instagram-history-table thead tr:first-child th:nth-child(6) {
    background: #e8f1ff !important;
    color: #111827 !important;
}

/* 일상 활동 상단 */
.x-history-table thead tr:first-child th:nth-child(7),
.instagram-history-table thead tr:first-child th:nth-child(7) {
    background: #fff0f6 !important;
    color: #111827 !important;
}

/* 특별 활동 하위 컬럼 */
.x-history-table thead tr:nth-child(2) th:nth-child(1),
.x-history-table thead tr:nth-child(2) th:nth-child(2),
.x-history-table thead tr:nth-child(2) th:nth-child(3),
.x-history-table thead tr:nth-child(2) th:nth-child(4),
.x-history-table thead tr:nth-child(2) th:nth-child(5),
.instagram-history-table thead tr:nth-child(2) th:nth-child(1),
.instagram-history-table thead tr:nth-child(2) th:nth-child(2),
.instagram-history-table thead tr:nth-child(2) th:nth-child(3),
.instagram-history-table thead tr:nth-child(2) th:nth-child(4),
.instagram-history-table thead tr:nth-child(2) th:nth-child(5) {
    background: #e8f1ff !important;
    color: #111827 !important;
}

/* 일상 활동 하위 컬럼 */
.x-history-table thead tr:nth-child(2) th:nth-child(6),
.x-history-table thead tr:nth-child(2) th:nth-child(7),
.x-history-table thead tr:nth-child(2) th:nth-child(8),
.x-history-table thead tr:nth-child(2) th:nth-child(9),
.x-history-table thead tr:nth-child(2) th:nth-child(10),
.instagram-history-table thead tr:nth-child(2) th:nth-child(6),
.instagram-history-table thead tr:nth-child(2) th:nth-child(7),
.instagram-history-table thead tr:nth-child(2) th:nth-child(8),
.instagram-history-table thead tr:nth-child(2) th:nth-child(9),
.instagram-history-table thead tr:nth-child(2) th:nth-child(10) {
    background: #fff0f6 !important;
    color: #111827 !important;
}

/* 숫자 링크 셀 배경 제거 */
.x-history-table tbody td.x-special-filled,
.x-history-table tbody td.x-daily-filled,
.instagram-history-table tbody td.insta-special-filled,
.instagram-history-table tbody td.insta-daily-filled {
    background: #ffffff !important;
    color: #111827 !important;
    font-weight: 900;
}

.x-history-table tbody td.x-special-filled .table-link-btn,
.x-history-table tbody td.x-daily-filled .table-link-btn,
.instagram-history-table tbody td.insta-special-filled .table-link-btn,
.instagram-history-table tbody td.insta-daily-filled .table-link-btn {
    color: #111827 !important;
    font-weight: 900;
}

/* =========================
   팔로잉/팔로워 현황 헤더 색상
   ========================= */

.account-status-table thead tr:first-child th:nth-child(3),
.account-status-table thead tr:nth-child(2) th:nth-child(1),
.account-status-table thead tr:nth-child(2) th:nth-child(2),
.bittory-account-status-table thead tr:first-child th:nth-child(3),
.bittory-account-status-table thead tr:nth-child(2) th:nth-child(1),
.bittory-account-status-table thead tr:nth-child(2) th:nth-child(2) {
    background: #e8f1ff !important;
    color: #111827 !important;
}

.account-status-table thead tr:first-child th:nth-child(4),
.account-status-table thead tr:nth-child(2) th:nth-child(3),
.account-status-table thead tr:nth-child(2) th:nth-child(4),
.bittory-account-status-table thead tr:first-child th:nth-child(4),
.bittory-account-status-table thead tr:nth-child(2) th:nth-child(3),
.bittory-account-status-table thead tr:nth-child(2) th:nth-child(4) {
    background: #fff0f6 !important;
    color: #111827 !important;
}

.account-status-table .total-row td,
.bittory-account-status-table tbody tr.total-row td {
    background: #f5f7fa !important;
    font-weight: 900;
}

/* =========================
   빛토리 요약 페이지
   ========================= */

.bittory-summary-table {
    width: 100% !important;
    min-width: 1250px;
}

.bittory-summary-table th,
.bittory-summary-table td {
    text-align: center !important;
    white-space: nowrap;
}

.summary-diff-up {
    color: #dc2626;
    font-weight: 900;
}

.summary-diff-down {
    color: #2563eb;
    font-weight: 900;
}

.summary-diff-zero {
    color: #6b7280;
    font-weight: 800;
}

/* =========================
   빛토리 주간 요약
   ========================= */

.summary-week-card {
    padding: 24px;
    margin-bottom: 24px;
}

.summary-week-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
    font-size: 18px;
    font-weight: 900;
    color: #203126;
}

.summary-week-title span {
    font-size: 13px;
    font-weight: 800;
    color: #6b7280;
}

.bittory-summary-table {
    width: 100%;
}

.bittory-summary-table th,
.bittory-summary-table td {
    text-align: center !important;
    white-space: nowrap;
}

.bittory-summary-table .total-row td {
    background: #f5f7fa !important;
    font-weight: 900;
}

@media (max-width: 1200px) {
    .summary-week-card {
        overflow-x: auto;
    }

    .bittory-summary-table {
        min-width: 1200px;
    }
}


/* =========================
   상세 링크 버튼
   ========================= */

.table-link-btn {
    border: none;
    background: transparent;
    color: #2e7d32;
    font-weight: 900;
    cursor: pointer;
    text-decoration: underline;
    font-size: 13px;
}

.table-link-btn:hover {
    color: #1b5e20;
}

/* =========================
   상세 모달 테이블 깨짐 방지
   ========================= */

.detail-modal-box {
    width: calc(100% - 40px) !important;
    max-width: 760px !important;
    overflow: hidden !important;
}

.detail-modal-box .bitdam-table,
.detail-modal-box table,
.modal-box .detail-table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: fixed !important;
}

.detail-modal-box .bitdam-table th,
.detail-modal-box .bitdam-table td,
.detail-modal-box table th,
.detail-modal-box table td,
.modal-box .detail-table th,
.modal-box .detail-table td {
    white-space: normal !important;
    word-break: break-all !important;
    text-align: center !important;
    padding: 12px 14px !important;
    font-size: 13px !important;
}

.detail-modal-box .bitdam-table th:nth-child(1),
.detail-modal-box .bitdam-table td:nth-child(1) {
    width: 28% !important;
}

.detail-modal-box .bitdam-table th:nth-child(2),
.detail-modal-box .bitdam-table td:nth-child(2) {
    width: 46% !important;
}

.detail-modal-box .bitdam-table th:nth-child(3),
.detail-modal-box .bitdam-table td:nth-child(3) {
    width: 26% !important;
}

.detail-modal-box .table-link {
    color: #2e7d32 !important;
    font-weight: 900 !important;
    text-decoration: none !important;
}

.detail-modal-box .table-link:hover {
    text-decoration: underline !important;
}

.detail-modal-box .x-history-table,
.detail-modal-box .instagram-history-table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: fixed !important;
}

/* =========================
   편집 페이지 상세 행
   ========================= */

.edit-section-box {
    margin-top: 22px;
    padding: 20px;
    border-radius: 20px;
    background: #fbfdfb;
    border: 1px solid #dfe9e2;
}

.detail-row {
    display: grid;
    grid-template-columns: 1.1fr 2fr 1fr auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.detail-row input,
.detail-row select {
    width: 100%;
}

.share-number-grid {
    margin-top: 14px;
}

.daily-label-box {
    height: 42px;
    border: 1px solid #dce8df;
    border-radius: 10px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 14px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: not-allowed;
}

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

@media (max-width: 800px) {
    .detail-row {
        grid-template-columns: 1fr;
    }

    .detail-modal-box {
        width: calc(100% - 24px) !important;
        max-width: none !important;
    }
}

@media (max-width: 1100px) {
    .dashboard-top,
    .dashboard-bottom {
        grid-template-columns: 1fr;
    }

    .dashboard-chart-card,
    .dashboard-rank-card {
        height: auto;
    }

    .dashboard-chart-card canvas {
        height: 260px !important;
    }
}

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

    .sidebar {
        width: 100%;
        min-width: 100%;
        height: auto;
        position: relative;
    }

    .user-box {
        margin-top: 20px;
    }

    .content {
        padding: 18px;
    }

    .topbar h2 {
        font-size: 22px;
    }

    body:has(.x-history-table) .topbar,
    body:has(.instagram-history-table) .topbar,
    body:has(.x-history-table) .filter-box,
    body:has(.instagram-history-table) .filter-box,
    body:has(.x-history-table) .blog-filter-card,
    body:has(.instagram-history-table) .blog-filter-card,
    body:has(.x-history-table) .card:has(.x-history-table),
    body:has(.instagram-history-table) .card:has(.instagram-history-table) {
        min-width: 100% !important;
        width: 100% !important;
    }
}

@media (max-width: 700px) {
    .account-page-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

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

    .permission-box {
        grid-template-columns: 1fr;
    }

    .meeting-filter-card {
        flex-direction: column;
        align-items: stretch;
    }

    .meeting-toggle-box {
        min-width: 100%;
    }
}