.main .main-body.dashboard {
    position: relative;
    background-color: inherit;
    box-shadow: inherit;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.action-bar {
    height: 60px;
}

.dashboard-select-box {
    padding: 5px;
    width: 300px;
    height: 100%;
}

.dropdown-btn-wrapper {
    display: flex;
    gap: 10px;
}

/* widget drop down */
.widget-dropdown {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: var(--font-size-body);
    cursor: pointer;
}

.widget-dropdown:hover {
    border-color: #d1d5db;
}

.widget-dropdown .widget-dropdown-btn {
    display: flex;
    height: 30px;
    justify-content: space-between;
    align-items: center;
    padding-left: 8px;
    user-select: none;
}

.widget-dropdown .widget-dropdown-btn img {
    width: 18px;
    height: 18px;
}

.widget-dropdown .widget-dropdown-btn img.rotated {
    transform: rotate(180deg);
}

.widget-dropdown-menu {
    position: absolute;
    display: none;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 3px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    overflow-y: auto;
    max-height: 150px;
    width: 250px;
    margin-top: 2px;
}

.widget-dropdown-menu.show {
    display: block;
    
}

.widget-dropdown-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    gap: 8px;
    transition: background-color 0.15s;
}

.widget-dropdown-item:hover {
    background-color: #f1f5f9;
}

.widget-check-mark {
    width: 18px;
    height: 18px;
    margin-right: 6px;
    color: #1e8649;
    font-weight: bold;
    align-items: center;
    justify-content: center;
    visibility: hidden;
}

.widget-check-mark.visible {
    visibility: visible;
    display: flex;
}

/* widget */
#dashboard-wrapper {
    display: flex;
    flex: 1;
    overflow-y: auto;
}

#dashboard {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
}

.grid-slot {
    min-height: 300px;
    border: 2px dashed transparent;
    border-radius: 8px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.grid-slot.drop-target {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.widget {
    width: 100%;
    height: 300px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: move;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    user-select: none;
}

.widget canvas {
    cursor: default; /* 캔버스 위에서는 기본 포인터 */
}
.widget:not(:has(canvas:hover)) {
    cursor: move; /* 나머지 widget 영역은 move */
}


.widget:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.widget.dragging {
    opacity: 0.5;
    z-index: 1000;
}

.widget-header {
    display: flex;
    align-items: center;
    padding: 10px;
    height: 40px;
}

.widget-title {
    font-weight: 600;
    color: #334155;
}

.widget-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
    background: #ef4444;
    color: white;
}

.widget-btn:hover {
    background: #dc2626;
}

.widget-content {
    width: 100%;
    height: calc(100% - 40px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: #64748b;
}

.widget-content.row {
    flex-direction: column;
}

.widget-content canvas {
    display: flex;
    margin: auto;
}


/* 차트 스타일 */
/* reqeust solution */
#requestSolution-wrapper {
    display: flex;
    flex: 1;
    padding: 10px;
    gap: 5px;
    height: 100%;
}

#today-request, #total-request {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    background-color: #f7fafc;
    border-radius: 8px;
    padding: 18px;
}

.request-header {
    font-size: 14px;
    font-weight: 500;
}
.request-header img {
    width: 26px;
    height: 26px;
}

.request-content {
    text-align: right;
}

.request-content p {
    color: #333333;
    font-size: 20px;
    font-weight: 500;
}

.request-content span {
    color: #aaa;
    font-size: 12px;
}

#today-request {
    color: #667eea;
}

#total-request {
    color: #805ad5;
}

/* data ingestion */
#data-ingestion-total {
    width: 100%;
    font-size: 14px;
    text-align: right;
    font-weight: 600;
    color: #667eea;
    height: 25px;
    padding-right: 15px;
}
.table-wrapper {
    height: calc(100% - 30px);
    margin: 10px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

#data-ingestion-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    height: 100%;
}

#data-ingestion-table thead {
    text-align: center;
    background-color: #f7fafc;
}

#data-ingestion-table th {
    padding: 12px 20px;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 2px solid #e2e8f0;
    height: 30px;
    box-sizing: border-box;
}

#data-ingestion-table th:first-child {
    border-top-left-radius: 8px;
}

#data-ingestion-table th:last-child {
    border-top-right-radius: 8px;
}

#data-ingestion-table tbody {
    display: block;
    height: 190px;
    overflow-y: auto;
    width: 100%;
}

#data-ingestion-table thead,
#data-ingestion-table tbody tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

#data-ingestion-table tbody tr {
    height: 40px;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s ease;
}

#data-ingestion-table td {
    padding: 6px 20px;
    font-size: 14px;
    height: 40px;
    box-sizing: border-box;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#data-ingestion-table td:last-child {
    text-align: right;
    font-weight: 600;
    color: #667eea;
}

#data-ingestion-table tbody tr:hover {
    background-color: #f7fafc;
}

#data-ingestion-table tbody td:first-child {
    font-weight: 500;
}

/* cluster */
.cluster-total {
    display: flex;
    width: 90%;
    justify-self: center;
    justify-content: right;
    border-top: 1px solid #f1f5f9;
    margin-top: 5px;
    padding: 5px 20px;
    font-size: 14px;
    color: #667eea;
    font-weight: 500;
}

/* tooltip */
.tooltip-body {
    display: flex;
    align-items: center;
    padding: 10px;
    font-size: 12px;
    gap: 10px;
    color: white;
}

.tooltip-icon {
    width: 13px;
    height: 13px;
}

.tooltip-lebel {
    display: flex;
    flex-direction: column;
    max-width: 120px;
    gap: 1px;
    font-weight: normal;
}

.tooltip-label span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 반응형 그리드 */
@media (max-width: 1440px) {
    #dashboard {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 960px) {
    #dashboard {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 580px) {
    #dashboard {
        grid-template-columns: repeat(1, 1fr);
    }
}