/* 1. Layout & Board Structure */
.inquiry-board {
    padding: 0 20px 32px 20px;
    max-width: 98%;
    margin: 36px auto 0;
}

.board-sticky-header {
    position: sticky;
    top: 36px;
    background: #fff;
    z-index: 1000;
    padding: 15px 0 10px;
    border-bottom: 1px solid #eee;
}

.board-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
}

/* 2. Stats Dashboard */
.header-stats {
    display: flex;
    gap: 12px;
}

.stat-item {
    background: #fff;
    border: 1px solid #eee;
    padding: 8px 16px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.stat-label { font-size: 11px; font-weight: 600; color: #888; margin-bottom: 2px; }
.stat-value { font-size: 18px; font-weight: 700; color: #333; }

/* Status Border Colors */
.stat-item.total { }
.stat-item.total .stat-value { color: #1e5149; }
.stat-item.complete { }
.stat-item.complete .stat-value { color: #2e7d32; }
.stat-item.working { }
.stat-item.working .stat-value { color: #1565c0; }
.stat-item.checking { }
.stat-item.checking .stat-value { color: #ef6c00; }
.stat-item.pending { }
.stat-item.pending .stat-value { color: #673ab7; }
.stat-item.unconfirmed { }
.stat-item.unconfirmed .stat-value { color: #9e9e9e; }

/* 3. Filters & Notice */
.notice-container {
    background: #fdfdfd;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    margin-bottom: 24px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.filter-section {
    display: flex;
    gap: 12px;
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 15px;
}

.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label { font-size: 12px; font-weight: 600; color: #666; }
.filter-group select, .filter-group input { padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; }

/* 4. Table Styles */
.inquiry-table {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 10px;
}

.inquiry-table thead th {
    position: sticky;
    background: #f8f9fa;
    padding: 14px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    color: #333;
    border-bottom: 2px solid #eee;
    z-index: 900;
}

/* 정렬 가능한 헤더 스타일 추가 */
.inquiry-table thead th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
    white-space: nowrap;
}

.inquiry-table thead th.sortable .header-content {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sort-icon {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    width: 12px;
    height: 12px;
    font-size: 8px;
    color: #ccc;
    line-height: 1;
    margin-left: 2px;
}

.inquiry-table thead th.active-sort {
    color: #1e5149;
    background: #f0f7f6;
}

.inquiry-table thead th.active-sort .sort-icon {
    color: #1e5149;
    font-size: 10px;
}

.inquiry-table td {
    padding: 14px 16px;
    font-size: 13px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Table Row Hover & Active State */
.inquiry-row:hover { background: #fcfcfc; cursor: pointer; }
.inquiry-row.active-row { background-color: #f0f7f6 !important; }
.inquiry-row.active-row td { font-weight: 600; color: #1e5149; border-bottom-color: transparent; }

/* Status Badges */
.status-badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; display: inline-block; }
.status-complete { background: #e8f5e9; color: #2e7d32; }
.status-working { background: #e3f2fd; color: #1565c0; }
.status-checking { background: #fff3e0; color: #ef6c00; }
.status-pending { background: #f5f5f5; color: #616161; }

/* Table Columns Width & Truncation */
.inquiry-table td:nth-child(1) { max-width: 50px; }  /* No */
.inquiry-table td:nth-child(2) { max-width: 80px; text-align: center; } /* Image */
.inquiry-table td:nth-child(3) { max-width: 120px; } /* PM Type */
.inquiry-table td:nth-child(4) { max-width: 100px; } /* Env */
.inquiry-table td:nth-child(5) { max-width: 150px; } /* Category */
.inquiry-table td:nth-child(6) { max-width: 200px; } /* Project */
.inquiry-table td:nth-child(7), .inquiry-table td:nth-child(8) { max-width: 400px; } /* Content & Reply */
.inquiry-table td:nth-child(9) { max-width: 100px; } /* Author */
.inquiry-table td:nth-child(10) { max-width: 120px; } /* Date */
.inquiry-table td:nth-child(11) { max-width: 100px; } /* Status */

/* 5. Detail (Accordion) Styles */
.detail-row { display: none; background: #fdfdfd; }
.detail-row.active { display: table-row; }
.detail-row td { max-width: none; white-space: normal; overflow: visible; }

.detail-container {
    padding: 24px;
    background: #f9fafb;
    box-shadow: inset 0 4px 15px rgba(0,0,0,0.08);
    position: relative;
    border-bottom: 2px solid #eee;
}

.detail-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    border: 1px solid #e5e7eb;
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.btn-close-accordion {
    position: absolute;
    top: 35px;
    right: 45px;
    background: #eee;
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    z-index: 10;
}
.btn-close-accordion::after { content: "▲"; font-size: 10px; margin-left: 5px; }

.detail-meta-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 15px; font-size: 13px; color: #666; }
.detail-label { font-weight: 700; color: #888; margin-right: 8px; }

.detail-q-section { background: #f8f9fa; padding: 20px; border-radius: 8px; }
.detail-a-section { background: #f1f8f7; padding: 20px; border-radius: 8px; }

/* 6. Image Preview & Foldable Section */
.img-thumbnail { width: 32px; height: 32px; border-radius: 4px; object-fit: cover; border: 1px solid #ddd; cursor: pointer; transition: transform 0.2s; }
.img-thumbnail:hover { transform: scale(1.1); }
.no-img { font-size: 10px; color: #ccc; font-style: italic; }

.detail-image-section { margin-bottom: 20px; background: #f9fafb; border-radius: 8px; border: 1px solid #e5e7eb; overflow: hidden; }
.image-section-header { padding: 12px 16px; background: #f1f5f9; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.image-section-header:hover { background: #e2e8f0; }
.image-section-header h4 { margin: 0; color: #1e5149; display: flex; align-items: center; gap: 8px; }
.image-section-content { padding: 20px; display: flex; justify-content: center; background: #fff; border-top: 1px solid #eee; }
.image-section-content.collapsed { display: none; }
.toggle-icon { font-size: 12px; color: #64748b; transition: transform 0.3s; }
.detail-image-section.active .toggle-icon { transform: rotate(180deg); }

.preview-img { max-width: 100%; max-height: 400px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); object-fit: contain; }

/* 7. Forms & Reply */
.reply-edit-form textarea {
    width: 100%; height: 120px; padding: 12px; border: 1px solid #ddd; border-radius: 6px;
    font-family: inherit; font-size: 14px; margin-bottom: 15px; resize: none; background: #fff;
}
.reply-edit-form textarea:disabled, .reply-edit-form select:disabled, .reply-edit-form input:disabled { background: #fcfcfc; color: #666; border-color: #eee; }
.reply-edit-form.readonly .btn-save, .reply-edit-form.readonly .btn-delete, .reply-edit-form.readonly .btn-cancel { display: none; }
.reply-edit-form.editable .btn-edit { display: none; }
.reply-edit-form.editable textarea { border-color: #1e5149; box-shadow: 0 0 0 2px rgba(30, 81, 73, 0.1); }
